diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2011-06-20 22:21:11 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2011-06-20 23:52:20 -0400 |
commit | 49f5ce5bacf9a1396d26135f1cbe0b3d3fead253 (patch) | |
tree | a026c92c17ab5cb435d6c5c2db5a88f45e14e383 | |
parent | 3f3e58d29f0cbf1f084aedf4e69d19ac2b9ff6b8 (diff) | |
download | seabios-49f5ce5bacf9a1396d26135f1cbe0b3d3fead253.zip seabios-49f5ce5bacf9a1396d26135f1cbe0b3d3fead253.tar.gz seabios-49f5ce5bacf9a1396d26135f1cbe0b3d3fead253.tar.bz2 |
Convert mptable code to use struct pci_device.
-rw-r--r-- | src/mptable.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mptable.c b/src/mptable.c index d7cab03..3100c9a 100644 --- a/src/mptable.c +++ b/src/mptable.c @@ -68,9 +68,10 @@ mptable_init(void) // PCI buses struct mpt_bus *buses = (void*)cpu, *bus = buses; - int bdf, max, lastbus = -1; - foreachbdf(bdf, max) { - int curbus = pci_bdf_to_bus(bdf); + int lastbus = -1; + struct pci_device *pci; + foreachpci(pci) { + int curbus = pci_bdf_to_bus(pci->bdf); if (curbus == lastbus) continue; lastbus = curbus; @@ -106,7 +107,8 @@ mptable_init(void) int dev = -1; unsigned short mask = 0, pinmask = 0; - foreachbdf(bdf, max) { + foreachpci(pci) { + u16 bdf = pci->bdf; int pin = pci_config_readb(bdf, PCI_INTERRUPT_PIN); int irq = pci_config_readb(bdf, PCI_INTERRUPT_LINE); if (pin == 0) |