aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/pci
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-03-04 19:35:23 +0100
committerDamjan Marion <damarion@cisco.com>2018-03-04 19:54:15 +0100
commit599a16bf8afeee9937cf3b12f2385a454d956bc7 (patch)
tree03f67e6107ea3cb293f9e9e0538f84cf8ecc0593 /src/vlib/pci
parent2060db832a9b77345e6beb9a4dd5b18e8f9427cf (diff)
vlib: add PCI MSI-X interrupt support (vfio only)
Change-Id: Iae2ddf93d1705354175e3dcae26b66e6f98a5c32 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/pci')
-rw-r--r--src/vlib/pci/pci.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/vlib/pci/pci.h b/src/vlib/pci/pci.h
index cf69de49976..072988a3561 100644
--- a/src/vlib/pci/pci.h
+++ b/src/vlib/pci/pci.h
@@ -117,6 +117,10 @@ typedef struct
u16 vendor_id, device_id;
} pci_device_id_t;
+typedef void (pci_intx_handler_function_t) (vlib_pci_dev_handle_t handle);
+typedef void (pci_msix_handler_function_t) (vlib_pci_dev_handle_t handle,
+ u16 line);
+
typedef struct _pci_device_registration
{
/* Driver init function. */
@@ -124,7 +128,7 @@ typedef struct _pci_device_registration
vlib_pci_dev_handle_t handle);
/* Interrupt handler */
- void (*interrupt_handler) (vlib_pci_dev_handle_t handle);
+ pci_intx_handler_function_t *interrupt_handler;
/* List of registrations */
struct _pci_device_registration *next_registration;
@@ -252,6 +256,15 @@ clib_error_t *vlib_pci_map_region_fixed (vlib_pci_dev_handle_t h,
u32 resource, u8 * addr,
void **result);
+clib_error_t *vlib_pci_register_msix_handler (vlib_pci_dev_handle_t h,
+ u32 start, u32 count,
+ pci_msix_handler_function_t *
+ msix_handler);
+clib_error_t *vlib_pci_enable_msix_irq (vlib_pci_dev_handle_t h, u16 start,
+ u16 count);
+clib_error_t *vlib_pci_disable_msix_irq (vlib_pci_dev_handle_t h, u16 start,
+ u16 count);
+
unformat_function_t unformat_vlib_pci_addr;
format_function_t format_vlib_pci_addr;
format_function_t format_vlib_pci_link_speed;