diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2011-06-20 22:22:42 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2011-06-20 23:57:51 -0400 |
commit | 9cb49921878e3b74646c93a3d91dd51ff68a3b59 (patch) | |
tree | a81e05801771bfbdff6571a3f792c0e5822a6ab4 | |
parent | 5d74ce0f164f75f63b8a4501f396bb4337b09b00 (diff) | |
download | seabios-9cb49921878e3b74646c93a3d91dd51ff68a3b59.zip seabios-9cb49921878e3b74646c93a3d91dd51ff68a3b59.tar.gz seabios-9cb49921878e3b74646c93a3d91dd51ff68a3b59.tar.bz2 |
Convert AHCI detection code to use struct pci_device.
-rw-r--r-- | src/ahci.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -8,7 +8,7 @@ #include "ioport.h" // inb #include "util.h" // dprintf #include "biosvar.h" // GET_EBDA -#include "pci.h" // foreachbdf +#include "pci.h" // foreachpci #include "pci_ids.h" // PCI_CLASS_STORAGE_OTHER #include "pci_regs.h" // PCI_INTERRUPT_LINE #include "boot.h" // add_bcv_hd @@ -462,13 +462,13 @@ static void ahci_init(void) { // Scan PCI bus for ATA adapters - int bdf, max; - foreachbdf(bdf, max) { - if (pci_config_readw(bdf, PCI_CLASS_DEVICE) != PCI_CLASS_STORAGE_SATA) + struct pci_device *pci; + foreachpci(pci) { + if (pci->class != PCI_CLASS_STORAGE_SATA) continue; - if (pci_config_readb(bdf, PCI_CLASS_PROG) != 1 /* AHCI rev 1 */) + if (pci->prog_if != 1 /* AHCI rev 1 */) continue; - ahci_init_controller(bdf); + ahci_init_controller(pci->bdf); } } |