diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2008-12-04 19:39:10 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2008-12-04 19:39:10 -0500 |
commit | 4132e0213ea9b168dd619ca76f1f1bf075d1f4a4 (patch) | |
tree | 3ee2afa254ea118a40b68e0978ee4ff05a091083 /src/pci.c | |
parent | 53ab0b600cc7cd14403a9d8feafb1bd1a81e56eb (diff) | |
download | seabios-hppa-4132e0213ea9b168dd619ca76f1f1bf075d1f4a4.zip seabios-hppa-4132e0213ea9b168dd619ca76f1f1bf075d1f4a4.tar.gz seabios-hppa-4132e0213ea9b168dd619ca76f1f1bf075d1f4a4.tar.bz2 |
Don't allow start_bdf with new auto max bus detection code.
It's not valid to set a "start bdf" when search for a device now,
because we wont be able to properly detect the maximum bus unless
we start at the beginning.
Change callers that need to resume a search to use foreachpci() macro.
Update all callers so that they don't pass in the now unused start_bdf.
Diffstat (limited to 'src/pci.c')
-rw-r--r-- | src/pci.c | 23 |
1 files changed, 4 insertions, 19 deletions
@@ -88,11 +88,11 @@ pci_next(int bdf, int *pmax) // Search for a device with the specified vendor and device ids. int -pci_find_device(u16 vendid, u16 devid, int start_bdf) +pci_find_device(u16 vendid, u16 devid) { u32 id = (devid << 16) | vendid; int bdf, max; - foreachpci(bdf, max, start_bdf) { + foreachpci(bdf, max) { u32 v = pci_config_readl(bdf, PCI_VENDOR_ID); if (v != id) continue; @@ -102,27 +102,12 @@ pci_find_device(u16 vendid, u16 devid, int start_bdf) return -1; } -// Search for a device with the specified class id and prog-if. -int -pci_find_classprog(u32 classprog, int start_bdf) -{ - int bdf, max; - foreachpci(bdf, max, start_bdf) { - u32 v = pci_config_readl(bdf, PCI_CLASS_REVISION); - if ((v>>8) != classprog) - continue; - // Found it. - return bdf; - } - return -1; -} - // Search for a device with the specified class id. int -pci_find_class(u16 classid, int start_bdf) +pci_find_class(u16 classid) { int bdf, max; - foreachpci(bdf, max, start_bdf) { + foreachpci(bdf, max) { u16 v = pci_config_readw(bdf, PCI_CLASS_DEVICE); if (v != classid) continue; |