[efi] Allow discovery of PCI bus:dev.fn address ranges

Generalise the logic for identifying the matching PCI root bridge I/O
protocol to allow for identifying the closest matching PCI bus:dev.fn
address range, and use this to provide PCI address range discovery
(while continuing to inhibit automatic PCI bus probing).

This allows the "pciscan" command to work as expected under UEFI.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2024-08-14 23:40:50 +01:00
parent 7c82ff0b6b
commit 950f6b5861
2 changed files with 181 additions and 83 deletions

View File

@@ -42,20 +42,6 @@ PCIAPI_INLINE ( efi, pci_can_probe ) ( void ) {
return 0;
}
/**
* Find next PCI bus:dev.fn address range in system
*
* @v busdevfn Starting PCI bus:dev.fn address
* @v range PCI bus:dev.fn address range to fill in
*/
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 */
range->count = 0;
}
/**
* Read byte from PCI configuration space via EFI
*