From 6d910559b3855e3b09f7475a42c67b5bcf39327f Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 1 Aug 2013 16:52:28 +0100 Subject: [pci] Add pci_find_next() to iterate over existent PCI devices Signed-off-by: Michael Brown --- src/include/ipxe/pci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/include') diff --git a/src/include/ipxe/pci.h b/src/include/ipxe/pci.h index a6ed484f1..692771ebe 100644 --- a/src/include/ipxe/pci.h +++ b/src/include/ipxe/pci.h @@ -351,6 +351,7 @@ struct pci_driver { #define PCI_FUNC( busdevfn ) ( ( (busdevfn) >> 0 ) & 0x07 ) #define PCI_BUSDEVFN( bus, slot, func ) \ ( ( (bus) << 8 ) | ( (slot) << 3 ) | ( (func) << 0 ) ) +#define PCI_FIRST_FUNC( busdevfn ) ( (busdevfn) & ~0x07 ) #define PCI_BASE_CLASS( class ) ( (class) >> 16 ) #define PCI_SUB_CLASS( class ) ( ( (class) >> 8 ) & 0xff ) @@ -385,6 +386,7 @@ extern void adjust_pci_device ( struct pci_device *pci ); extern unsigned long pci_bar_start ( struct pci_device *pci, unsigned int reg ); extern int pci_read_config ( struct pci_device *pci ); +extern int pci_find_next ( struct pci_device *pci, unsigned int busdevfn ); extern int pci_find_driver ( struct pci_device *pci ); extern int pci_probe ( struct pci_device *pci ); extern void pci_remove ( struct pci_device *pci ); -- cgit v1.2.3-55-g7522