mirror of
https://github.com/ipxe/ipxe
synced 2026-05-10 18:10:36 +03:00
[pci] Allow probing permission to vary by range
Make pci_can_probe() part of the runtime selectable PCI I/O API, and defer this check to the per-range API. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -447,10 +447,6 @@ static int pcibus_probe ( struct root_device *rootdev ) {
|
||||
uint32_t busdevfn = 0;
|
||||
int rc;
|
||||
|
||||
/* Skip automatic probing if prohibited */
|
||||
if ( ! pci_can_probe() )
|
||||
return 0;
|
||||
|
||||
do {
|
||||
/* Allocate struct pci_device */
|
||||
if ( ! pci )
|
||||
@@ -464,6 +460,10 @@ static int pcibus_probe ( struct root_device *rootdev ) {
|
||||
if ( ( rc = pci_find_next ( pci, &busdevfn ) ) != 0 )
|
||||
break;
|
||||
|
||||
/* Skip automatic probing if prohibited */
|
||||
if ( ! pci_can_probe ( pci ) )
|
||||
continue;
|
||||
|
||||
/* Look for a driver */
|
||||
if ( ( rc = pci_find_driver ( pci ) ) != 0 ) {
|
||||
DBGC ( pci, PCI_FMT " (%04x:%04x class %06x) has no "
|
||||
|
||||
@@ -142,6 +142,18 @@ static struct pci_api * pcicloud_api ( struct pci_device *pci ) {
|
||||
return api;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if PCI bus probing is allowed
|
||||
*
|
||||
* @v pci PCI device
|
||||
* @ret ok Bus probing is allowed
|
||||
*/
|
||||
static int pcicloud_can_probe ( struct pci_device *pci ) {
|
||||
struct pci_api *api = pcicloud_api ( pci );
|
||||
|
||||
return api->pci_can_probe ( pci );
|
||||
}
|
||||
|
||||
/**
|
||||
* Read byte from PCI configuration space
|
||||
*
|
||||
@@ -246,7 +258,7 @@ static void * pcicloud_ioremap ( struct pci_device *pci,
|
||||
return api->pci_ioremap ( pci, bus_addr, len );
|
||||
}
|
||||
|
||||
PROVIDE_PCIAPI_INLINE ( cloud, pci_can_probe );
|
||||
PROVIDE_PCIAPI ( cloud, pci_can_probe, pcicloud_can_probe );
|
||||
PROVIDE_PCIAPI ( cloud, pci_discover, pcicloud_discover );
|
||||
PROVIDE_PCIAPI ( cloud, pci_read_config_byte, pcicloud_read_config_byte );
|
||||
PROVIDE_PCIAPI ( cloud, pci_read_config_word, pcicloud_read_config_word );
|
||||
|
||||
Reference in New Issue
Block a user