diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-03-01 17:24:54 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-03-01 17:24:54 +0100 |
commit | a0404ff58245f16d2117542d2dffd1fc6199943d (patch) | |
tree | 1eea09a3c9b1426c73858e90f13c77f1bc315bbd /sys/src/9/pc/mp.c | |
parent | 35558431105e4c793673310bd5bfa7f8a99d89e3 (diff) |
devpccard, pci: fix pccard support and handle pci expansion roms
let pci.c deal with the special cardbus controller bar0 and
expansion roms.
handle apic interrupt routing for devices behind a cardbus slot.
do not free the pcidev on card removal, as the drivers
most certanly are not prepared to handle this yet.
instead, we provide a pcidevfree() function that just unlinks
the device from pcilist and the parent bridge.
Diffstat (limited to 'sys/src/9/pc/mp.c')
-rw-r--r-- | sys/src/9/pc/mp.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/src/9/pc/mp.c b/sys/src/9/pc/mp.c index abb3e010e..ede29b323 100644 --- a/sys/src/9/pc/mp.c +++ b/sys/src/9/pc/mp.c @@ -351,13 +351,19 @@ Findbus: if(bus == nil){ /* - * if the PCI device is behind a PCI-PCI bridge thats not described - * by the MP or ACPI tables then walk up the bus translating interrupt - * pin to parent bus. + * if the PCI device is behind a bridge thats not described + * by the MP or ACPI tables then walk up the bus translating + * interrupt pin to parent bus. */ if(pci != nil && pci->parent != nil && pin > 0){ - pin = ((dno+(pin-1))%4)+1; pci = pci->parent; + if(pci->ccrb == 6 && pci->ccru == 7){ + /* Cardbus bridge, use controllers interrupt pin */ + pin = pcicfgr8(pci, PciINTP); + } else { + /* PCI-PCI bridge */ + pin = ((dno+(pin-1))%4)+1; + } bno = BUSBNO(pci->tbdf); dno = BUSDNO(pci->tbdf); goto Findbus; |