FD.io VPP  v19.04.1-1-ge4a0f9f
Vector Packet Processing
pci.h File Reference
+ Include dependency graph for pci.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vlib_pci_device_info
 
struct  pci_device_id_t
 
struct  vlib_pci_main_t
 

Macros

#define VLIB_PCI_DEVICE_INFO_F_NOIOMMU   (1 << 0);
 
#define PCI_REGISTER_DEVICE(x, ...)
 

Typedefs

typedef struct vlib_pci_device_info vlib_pci_device_info_t
 
typedef u32 vlib_pci_dev_handle_t
 
typedef void( pci_intx_handler_function_t) (vlib_main_t *vm, vlib_pci_dev_handle_t handle)
 
typedef void( pci_msix_handler_function_t) (vlib_main_t *vm, vlib_pci_dev_handle_t handle, u16 line)
 
typedef struct _pci_device_registration pci_device_registration_t
 

Functions

typedef CLIB_PACKED (union{struct{u16 domain;u8 bus;u8 slot:5;u8 function:3;};u32 as_u32;}) vlib_pci_addr_t
 
vlib_pci_device_info_tvlib_pci_get_device_info (vlib_main_t *vm, vlib_pci_addr_t *addr, clib_error_t **error)
 
vlib_pci_addr_t * vlib_pci_get_all_dev_addrs ()
 
vlib_pci_addr_t * vlib_pci_get_addr (vlib_main_t *vm, vlib_pci_dev_handle_t h)
 
u32 vlib_pci_get_numa_node (vlib_main_t *vm, vlib_pci_dev_handle_t h)
 
u32 vlib_pci_get_num_msix_interrupts (vlib_main_t *vm, vlib_pci_dev_handle_t h)
 
uword vlib_pci_get_private_data (vlib_main_t *vm, vlib_pci_dev_handle_t h)
 
void vlib_pci_set_private_data (vlib_main_t *vm, vlib_pci_dev_handle_t h, uword private_data)
 
static void vlib_pci_free_device_info (vlib_pci_device_info_t *di)
 
clib_error_tvlib_pci_bind_to_uio (vlib_main_t *vm, vlib_pci_addr_t *addr, char *uio_driver_name)
 
clib_error_tvlib_pci_read_write_config (vlib_main_t *vm, vlib_pci_dev_handle_t handle, vlib_read_or_write_t read_or_write, uword address, void *data, u32 n_bytes)
 
clib_error_tvlib_pci_read_write_io (vlib_main_t *vm, vlib_pci_dev_handle_t handle, vlib_read_or_write_t read_or_write, uword address, void *data, u32 n_bytes)
 
static clib_error_tvlib_pci_intr_enable (vlib_main_t *vm, vlib_pci_dev_handle_t h)
 
static clib_error_tvlib_pci_intr_disable (vlib_main_t *vm, vlib_pci_dev_handle_t h)
 
static clib_error_tvlib_pci_bus_master_enable (vlib_main_t *vm, vlib_pci_dev_handle_t h)
 
clib_error_tvlib_pci_device_open (vlib_main_t *vm, vlib_pci_addr_t *addr, pci_device_id_t ids[], vlib_pci_dev_handle_t *handle)
 
void vlib_pci_device_close (vlib_main_t *vm, vlib_pci_dev_handle_t h)
 
clib_error_tvlib_pci_map_region (vlib_main_t *vm, vlib_pci_dev_handle_t h, u32 resource, void **result)
 
clib_error_tvlib_pci_map_region_fixed (vlib_main_t *vm, vlib_pci_dev_handle_t h, u32 resource, u8 *addr, void **result)
 
clib_error_tvlib_pci_io_region (vlib_main_t *vm, vlib_pci_dev_handle_t h, u32 resource)
 
clib_error_tvlib_pci_register_intx_handler (vlib_main_t *vm, vlib_pci_dev_handle_t h, pci_intx_handler_function_t *intx_handler)
 
clib_error_tvlib_pci_register_msix_handler (vlib_main_t *vm, vlib_pci_dev_handle_t h, u32 start, u32 count, pci_msix_handler_function_t *msix_handler)
 
clib_error_tvlib_pci_enable_msix_irq (vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 start, u16 count)
 
clib_error_tvlib_pci_disable_msix_irq (vlib_main_t *vm, vlib_pci_dev_handle_t h, u16 start, u16 count)
 
clib_error_tvlib_pci_map_dma (vlib_main_t *vm, vlib_pci_dev_handle_t h, void *ptr)
 
int vlib_pci_supports_virtual_addr_dma (vlib_main_t *vm, vlib_pci_dev_handle_t h)
 

Variables

vlib_pci_main_t pci_main
 
unformat_function_t unformat_vlib_pci_addr
 
format_function_t format_vlib_pci_addr
 
format_function_t format_vlib_pci_link_speed
 
format_function_t format_vlib_pci_vpd
 

Macro Definition Documentation

#define PCI_REGISTER_DEVICE (   x,
  ... 
)
Value:
__VA_ARGS__ pci_device_registration_t x; \
static void __vlib_add_pci_device_registration_##x (void) \
__attribute__((__constructor__)) ; \
static void __vlib_add_pci_device_registration_##x (void) \
{ \
vlib_pci_main_t * pm = &pci_main; \
x.next_registration = pm->pci_device_registrations; \
pm->pci_device_registrations = &x; \
} \
static void __vlib_rm_pci_device_registration_##x (void) \
__attribute__((__destructor__)) ; \
static void __vlib_rm_pci_device_registration_##x (void) \
{ \
vlib_pci_main_t * pm = &pci_main; \
VLIB_REMOVE_FROM_LINKED_LIST (pm->pci_device_registrations, \
&x, next_registration); \
} \
pci_device_registration_t * pci_device_registrations
Definition: pci.h:156
#define VLIB_REMOVE_FROM_LINKED_LIST(first, p, next)
Definition: init.h:82
vlib_pci_main_t pci_main
Definition: pci.c:53
struct _pci_device_registration pci_device_registration_t

Definition at line 163 of file pci.h.

#define VLIB_PCI_DEVICE_INFO_F_NOIOMMU   (1 << 0);

Definition at line 63 of file pci.h.

Typedef Documentation

typedef struct _pci_device_registration pci_device_registration_t
typedef void( pci_intx_handler_function_t) (vlib_main_t *vm, vlib_pci_dev_handle_t handle)

Definition at line 130 of file pci.h.

typedef void( pci_msix_handler_function_t) (vlib_main_t *vm, vlib_pci_dev_handle_t handle, u16 line)

Definition at line 132 of file pci.h.

Definition at line 97 of file pci.h.

Function Documentation

typedef CLIB_PACKED ( union{struct{u16 domain;u8 bus;u8 slot:5;u8 function:3;};u32 as_u32;}  )
clib_error_t* vlib_pci_bind_to_uio ( vlib_main_t vm,
vlib_pci_addr_t *  addr,
char *  uio_driver_name 
)

Definition at line 386 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* vlib_pci_bus_master_enable ( vlib_main_t vm,
vlib_pci_dev_handle_t  h 
)
inlinestatic

Definition at line 271 of file pci.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vlib_pci_device_close ( vlib_main_t vm,
vlib_pci_dev_handle_t  h 
)

Definition at line 1275 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_pci_device_open ( vlib_main_t vm,
vlib_pci_addr_t *  addr,
pci_device_id_t  ids[],
vlib_pci_dev_handle_t handle 
)

Definition at line 1215 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_pci_disable_msix_irq ( vlib_main_t vm,
vlib_pci_dev_handle_t  h,
u16  start,
u16  count 
)

Definition at line 905 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_pci_enable_msix_irq ( vlib_main_t vm,
vlib_pci_dev_handle_t  h,
u16  start,
u16  count 
)

Definition at line 883 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_pci_free_device_info ( vlib_pci_device_info_t di)
inlinestatic

Definition at line 114 of file pci.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vlib_pci_addr_t* vlib_pci_get_addr ( vlib_main_t vm,
vlib_pci_dev_handle_t  h 
)

Definition at line 163 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vlib_pci_addr_t* vlib_pci_get_all_dev_addrs ( )

Definition at line 1430 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vlib_pci_device_info_t* vlib_pci_get_device_info ( vlib_main_t vm,
vlib_pci_addr_t *  addr,
clib_error_t **  error 
)

Definition at line 202 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 vlib_pci_get_num_msix_interrupts ( vlib_main_t vm,
vlib_pci_dev_handle_t  h 
)

Definition at line 177 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 vlib_pci_get_numa_node ( vlib_main_t vm,
vlib_pci_dev_handle_t  h 
)

Definition at line 170 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword vlib_pci_get_private_data ( vlib_main_t vm,
vlib_pci_dev_handle_t  h 
)

Definition at line 148 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* vlib_pci_intr_disable ( vlib_main_t vm,
vlib_pci_dev_handle_t  h 
)
inlinestatic

Definition at line 255 of file pci.h.

+ Here is the caller graph for this function:

static clib_error_t* vlib_pci_intr_enable ( vlib_main_t vm,
vlib_pci_dev_handle_t  h 
)
inlinestatic

Definition at line 239 of file pci.h.

+ Here is the caller graph for this function:

clib_error_t* vlib_pci_io_region ( vlib_main_t vm,
vlib_pci_dev_handle_t  h,
u32  resource 
)

Definition at line 1160 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_pci_map_dma ( vlib_main_t vm,
vlib_pci_dev_handle_t  h,
void *  ptr 
)

Definition at line 1196 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_pci_map_region ( vlib_main_t vm,
vlib_pci_dev_handle_t  h,
u32  resource,
void **  result 
)

Definition at line 1146 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_pci_map_region_fixed ( vlib_main_t vm,
vlib_pci_dev_handle_t  h,
u32  resource,
u8 addr,
void **  result 
)

Definition at line 1153 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_pci_read_write_config ( vlib_main_t vm,
vlib_pci_dev_handle_t  handle,
vlib_read_or_write_t  read_or_write,
uword  address,
void *  data,
u32  n_bytes 
)

Definition at line 1017 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_pci_read_write_io ( vlib_main_t vm,
vlib_pci_dev_handle_t  handle,
vlib_read_or_write_t  read_or_write,
uword  address,
void *  data,
u32  n_bytes 
)

Definition at line 1176 of file pci.c.

+ Here is the call graph for this function:

clib_error_t* vlib_pci_register_intx_handler ( vlib_main_t vm,
vlib_pci_dev_handle_t  h,
pci_intx_handler_function_t intx_handler 
)

Definition at line 775 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_pci_register_msix_handler ( vlib_main_t vm,
vlib_pci_dev_handle_t  h,
u32  start,
u32  count,
pci_msix_handler_function_t msix_handler 
)

Definition at line 826 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vlib_pci_set_private_data ( vlib_main_t vm,
vlib_pci_dev_handle_t  h,
uword  private_data 
)

Definition at line 155 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vlib_pci_supports_virtual_addr_dma ( vlib_main_t vm,
vlib_pci_dev_handle_t  h 
)

Definition at line 1207 of file pci.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

format_function_t format_vlib_pci_addr

Definition at line 324 of file pci.h.

format_function_t format_vlib_pci_link_speed

Definition at line 325 of file pci.h.

format_function_t format_vlib_pci_vpd

Definition at line 326 of file pci.h.

vlib_pci_main_t pci_main

Definition at line 53 of file pci.c.

unformat_function_t unformat_vlib_pci_addr

Definition at line 323 of file pci.h.