MFS: I was confused. This code wasn't in -current after all.

Merge in the irq 0 detection.  Add comment about why.

If we have irq 0, ignore it like we do irq 255.  Some BIOS writers aren't
careful like they should be.
This commit is contained in:
Warner Losh 2001-11-26 21:25:03 +00:00
parent ef2b805fcf
commit 1cf5f5552b
3 changed files with 42 additions and 15 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}