diff options
author | Michael Brown <mcb30@ipxe.org> | 2022-09-15 16:47:04 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2022-09-15 16:49:47 +0100 |
commit | ff228f745c15594291fd3cbf3c02af27753a3885 (patch) | |
tree | 20fcd06b1407db029e1969095c9f4a449451ba64 /src/include/ipxe/efi | |
parent | 56b30364c5db6367279ffe88929f286f15680b40 (diff) | |
download | ipxe-ff228f745c15594291fd3cbf3c02af27753a3885.zip ipxe-ff228f745c15594291fd3cbf3c02af27753a3885.tar.gz ipxe-ff228f745c15594291fd3cbf3c02af27753a3885.tar.bz2 |
[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.h | 13 |
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 887d5ee..cf5e1d0 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; } /** |