summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/efi
diff options
context:
space:
mode:
authorMichael Brown2022-09-15 17:47:04 +0200
committerMichael Brown2022-09-15 17:49:47 +0200
commitff228f745c15594291fd3cbf3c02af27753a3885 (patch)
tree20fcd06b1407db029e1969095c9f4a449451ba64 /src/include/ipxe/efi
parent[pci] Check for wraparound in callers of pci_find_next() (diff)
downloadipxe-ff228f745c15594291fd3cbf3c02af27753a3885.tar.gz
ipxe-ff228f745c15594291fd3cbf3c02af27753a3885.tar.xz
ipxe-ff228f745c15594291fd3cbf3c02af27753a3885.zip
[pci] Generalise pci_num_bus() to pci_discover()
Allow pci_find_next() to discover devices beyond the first PCI segment, by generalising pci_num_bus() (which implicitly assumes that there is only a single PCI segment) with pci_discover() (which has the ability to return an arbitrary contiguous chunk of PCI bus:dev.fn address space). Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/efi')
-rw-r--r--src/include/ipxe/efi/efi_pci_api.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/include/ipxe/efi/efi_pci_api.h b/src/include/ipxe/efi/efi_pci_api.h
index 887d5ee14..cf5e1d020 100644
--- a/src/include/ipxe/efi/efi_pci_api.h
+++ b/src/include/ipxe/efi/efi_pci_api.h
@@ -33,14 +33,17 @@ extern int efipci_write ( struct pci_device *pci, unsigned long location,
unsigned long value );
/**
- * Determine number of PCI buses within system
+ * Find next PCI bus:dev.fn address range in system
*
- * @ret num_bus Number of buses
+ * @v busdevfn Starting PCI bus:dev.fn address
+ * @v range PCI bus:dev.fn address range to fill in
*/
-static inline __always_inline int
-PCIAPI_INLINE ( efi, pci_num_bus ) ( void ) {
+static inline __always_inline void
+PCIAPI_INLINE ( efi, pci_discover ) ( uint32_t busdevfn __unused,
+ struct pci_range *range ) {
+
/* EFI does not want us to scan the PCI bus ourselves */
- return 0;
+ range->count = 0;
}
/**