fixed multi-function devices

This commit is contained in:
Markus Fröschle
2013-11-07 06:03:49 +00:00
parent de9a84f48a
commit a76deac026

View File

@@ -246,13 +246,16 @@ int16_t pci_find_device(uint16_t device_id, uint16_t vendor_id, int index)
if (vendor_id == 0xffff || if (vendor_id == 0xffff ||
(PCI_VENDOR_ID(value) == vendor_id && PCI_DEVICE_ID(value) == device_id)) (PCI_VENDOR_ID(value) == vendor_id && PCI_DEVICE_ID(value) == device_id))
{ {
return handle; if (pos == index)
} {
else return handle;
{ }
/* found a match, but at wrong position */ else
pos++; {
continue; /* found a match, but at wrong position */
pos++;
continue;
}
} }
} }
} }