diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2015-04-07 14:25:49 +0200 |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2015-04-17 01:10:26 +0200 |
commit | c1c37a1c5819ecd1d8fc0495ea0d5561dc5ced0d (patch) | |
tree | a8d77d5a86d82243b32b288a72186a5f5a25fe05 /cpukit/libpci/pci_for_each.c | |
parent | DRVMGR: PCI BUS converted to BSD header (diff) | |
download | rtems-c1c37a1c5819ecd1d8fc0495ea0d5561dc5ced0d.tar.bz2 |
LIBPCI: converted to BSD header
Diffstat (limited to 'cpukit/libpci/pci_for_each.c')
-rw-r--r-- | cpukit/libpci/pci_for_each.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cpukit/libpci/pci_for_each.c b/cpukit/libpci/pci_for_each.c index 88e4ac3935..9c54af2040 100644 --- a/cpukit/libpci/pci_for_each.c +++ b/cpukit/libpci/pci_for_each.c @@ -28,11 +28,11 @@ int pci_for_each(int (*func)(pci_dev_t, void*), void *arg) pci_dev_t pcidev; for (bus = 0; bus < maxbus ; bus++) { - for (dev = 0; dev < PCI_MAX_DEVICES; dev++) { + for (dev = 0; dev <= PCI_SLOTMAX; dev++) { pcidev = PCI_DEV(bus, dev, 0); - for (fun = 0; fun < PCI_MAX_FUNCTIONS; fun++, pcidev++) { - fail = pci_cfg_r32(pcidev, PCI_VENDOR_ID, &id); + for (fun = 0; fun <= PCI_FUNCMAX; fun++, pcidev++) { + fail = pci_cfg_r32(pcidev, PCIR_VENDOR, &id); if (fail || (0xffffffff == id) || (0 == id)) { if (fun == 0) break; @@ -48,9 +48,9 @@ int pci_for_each(int (*func)(pci_dev_t, void*), void *arg) /* Stop if not a multi-function device */ if (fun == 0) { - pci_cfg_r8(pcidev, PCI_HEADER_TYPE, + pci_cfg_r8(pcidev, PCIR_HDRTYPE, &hd); - if ((hd & PCI_MULTI_FUNCTION) == 0) + if ((hd & PCIM_MFDEV) == 0) break; } } |