===================================================================
@@ -243,7 +243,7 @@ static int __init check_dev_quirk(int nu
class = read_pci_config_16(num, slot, func, PCI_CLASS_DEVICE);
if (class == 0xffff)
- return -1; /* no class, treat as single function */
+ return 0; /* no class, func gap */
vendor = read_pci_config_16(num, slot, func, PCI_VENDOR_ID);
@@ -263,27 +263,30 @@ static int __init check_dev_quirk(int nu
}
}
- type = read_pci_config_byte(num, slot, func,
- PCI_HEADER_TYPE);
- if (!(type & 0x80))
- return -1;
+ if (func == 0) {
+ type = read_pci_config_byte(num, slot, func,
+ PCI_HEADER_TYPE);
+ if (!(type & 0x80))
+ return -1;
+ }
return 0;
}
void __init early_quirks(void)
{
- int slot, func;
+ int num, slot, func;
if (!early_pci_allowed())
return;
/* Poor man's PCI discovery */
- /* Only scan the root bus */
- for (slot = 0; slot < 32; slot++)
- for (func = 0; func < 8; func++) {
- /* Only probe function 0 on single fn devices */
- if (check_dev_quirk(0, slot, func))
- break;
- }
+ /* Only can scan first domain */
+ for (num = 0; num < 256; num++)
+ for (slot = 0; slot < 32; slot++)
+ for (func = 0; func < 8; func++) {
+ /* Only probe func 0 on single fn devices */
+ if (check_dev_quirk(num, slot, func))
+ break;
+ }
}