From 70d880905c37cfde7f4ddfe46c5cab582dd36ab7 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 22 Jul 2017 22:17:54 +0200 Subject: added interrupt to PCI descriptors --- src/hardware/pci.c | 4 +++- src/hardware/pci.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/hardware/pci.c b/src/hardware/pci.c index f544d98..6b622c1 100644 --- a/src/hardware/pci.c +++ b/src/hardware/pci.c @@ -20,6 +20,7 @@ #define PCI_CLASS 0x0B #define PCI_HEADER_TYPE 0x0E #define PCI_BAR_BASE 0x10 +#define PCI_INTERRUPT 0x3C void pci_controller_init( pci_controller_t *controller ) { @@ -134,6 +135,7 @@ void pci_device_descriptor_init( pci_device_descriptor_t *descriptor, pci_contro descriptor->subclass_id = pci_controller_read( controller, bus, device, function, PCI_SUBCLASS ); descriptor->interface_id = pci_controller_read( controller, bus, device, function, PCI_INTERFACE ); descriptor->revision_id = pci_controller_read( controller, bus, device, function, PCI_REVISION ); + descriptor->interrupt = pci_controller_read( controller, bus, device, function, PCI_INTERRUPT ) & 0xFF; } void pci_base_address_register_init( pci_base_address_register_t *base_address_register, pci_controller_t *controller, uint16_t bus, uint16_t device, uint16_t function, uint16_t bar ) @@ -179,7 +181,7 @@ driver_t *pci_device_get_driver( pci_device_descriptor_t *descriptor, interrupt_ switch( descriptor->device_id ) { case 0x8139: // RTL8139 driver = (driver_t *)malloc( sizeof( rtl8139_t ) ); - rtl8139_init( (rtl8139_t *)driver, interrupt, context ); + rtl8139_init( (rtl8139_t *)driver, descriptor, interrupt, context ); break; } break; diff --git a/src/hardware/pci.h b/src/hardware/pci.h index fcc957e..9bc29bb 100644 --- a/src/hardware/pci.h +++ b/src/hardware/pci.h @@ -15,6 +15,7 @@ typedef struct { uint8_t interface_id; uint8_t revision_id; uint32_t port_base; + uint8_t interrupt; } pci_device_descriptor_t; typedef struct { -- cgit v1.2.3-54-g00ecf