vlib: add functions to dynamically open/close PCI device

Old code was only allowing PCIdevices to be scanned during startup,
now driver can open and close device without restart of vpp.

Change-Id: I1a06511e3f16f896101b43dac2bad420b6e6c35e
Signed-off-by: Damjan Marion <damarion@cisco.com>
This commit is contained in:
Damjan Marion
2018-03-05 14:08:33 +01:00
committed by Damjan Marion
parent 9e09ff394a
commit f313b747ad
2 changed files with 126 additions and 3 deletions

View File

@ -249,6 +249,11 @@ vlib_pci_bus_master_enable (vlib_pci_dev_handle_t h)
return vlib_pci_write_config_u16 (h, 4, &command);
}
clib_error_t *vlib_pci_device_open (vlib_pci_addr_t * addr,
pci_device_id_t ids[],
vlib_pci_dev_handle_t * handle);
void vlib_pci_device_close (vlib_pci_dev_handle_t h);
clib_error_t *vlib_pci_map_region (vlib_pci_dev_handle_t h, u32 resource,
void **result);