extend the function pci_get_device_info to determine a device with a specific IO address
This commit is contained in:
parent
21b6fdf309
commit
c26a8fa4f8
2 changed files with 6 additions and 2 deletions
|
@ -60,12 +60,13 @@ int pci_init(void);
|
|||
* @param vendor_id The device's vendor ID
|
||||
* @param device_id the device's ID
|
||||
* @param info Pointer to the record pci_info_t where among other the IObase address will be stored
|
||||
* @param base Search for the preferred IO address. Zero, if any address is useful
|
||||
*
|
||||
* @return
|
||||
* - 0 on success
|
||||
* - -EINVAL on failure
|
||||
*/
|
||||
int pci_get_device_info(uint32_t vendor_id, uint32_t device_id, pci_info_t* info);
|
||||
int pci_get_device_info(uint32_t vendor_id, uint32_t device_id, uint32_t base, pci_info_t* info);
|
||||
|
||||
#ifdef WITH_PCI_NAMES
|
||||
/** @brief Print information of existing pci adapters
|
||||
|
|
|
@ -143,7 +143,7 @@ int pci_init(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pci_get_device_info(uint32_t vendor_id, uint32_t device_id, pci_info_t* info)
|
||||
int pci_get_device_info(uint32_t vendor_id, uint32_t device_id, uint32_t base, pci_info_t* info)
|
||||
{
|
||||
uint32_t slot, bus, i;
|
||||
|
||||
|
@ -166,6 +166,9 @@ int pci_get_device_info(uint32_t vendor_id, uint32_t device_id, pci_info_t* info
|
|||
info->size[i] = (info->base[i]) ? pci_what_size(bus, slot, i) : 0;
|
||||
}
|
||||
info->irq = pci_what_irq(bus, slot);
|
||||
if (base)
|
||||
if (!(info->base[0] == base))
|
||||
continue;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue