- if (pci_read32(bus, dev, 0, 0) != 0xFFFFFFFF)
- for (fn = 0; fn < 8; fn++)
+ {
+ if (pci_read32(bus, dev, 0, 0) == 0xFFFFFFFF)
+ continue;
+ for (fn = 0; fn < 8; fn++)
+ {
+ int bar;
+
+ if (pci_read32(bus, dev, fn, 0) == 0xFFFFFFFF)
+ continue;
+
+ if ((fn != 0) && !(pci_read8(bus, dev, 0, 0x0E) & 0x80))
+ continue;
+
+ pdev.bus = bus;
+ pdev.dev = dev;
+ pdev.fn = fn;
+ pdev.vid = pci_read16(bus, dev, fn, 0);
+ pdev.did = pci_read16(bus, dev, fn, 2);
+
+ for (bar = 0; bar < 6; bar++)