summaryrefslogtreecommitdiffstats
path: root/sys/i386/pci/pci_cfgreg.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/pci/pci_cfgreg.c')
-rw-r--r--sys/i386/pci/pci_cfgreg.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c
index 3d5afb7..da1d208 100644
--- a/sys/i386/pci/pci_cfgreg.c
+++ b/sys/i386/pci/pci_cfgreg.c
@@ -383,11 +383,20 @@ pci_cfgintr_search(struct PIR_entry *pe, int bus, int device, int matchpin, int
for (j = 0, childp = pci_children; j < pci_childcount; j++, childp++) {
if ((pci_get_bus(*childp) == bus) &&
(pci_get_slot(*childp) == device) &&
- (pci_get_intpin(*childp) == matchpin) &&
- ((irq = pci_get_irq(*childp)) != 255)) {
- PRVERB(("pci_cfgintr_search: linked (%x) to configured irq %d at %d:%d:%d\n",
- pe->pe_intpin[pin - 1].link, irq,
- pci_get_bus(*childp), pci_get_slot(*childp), pci_get_function(*childp)));
+ (pci_get_intpin(*childp) == matchpin)) {
+ irq = pci_get_irq(*childp);
+ /*
+ * Some BIOS writers seem to want to ignore the spec and put
+ * 0 in the intline rather than 255 to indicate none. Once
+ * we've found one that matches, we break because there can
+ * be no others (which is why test looks a little odd).
+ */
+ if (irq == 0)
+ irq = 255;
+ if (irq != 255)
+ PRVERB(("pci_cfgintr_search: linked (%x) to configured irq %d at %d:%d:%d\n",
+ pe->pe_intpin[pin - 1].link, irq,
+ pci_get_bus(*childp), pci_get_slot(*childp), pci_get_function(*childp)));
break;
}
}
OpenPOWER on IntegriCloud