blob: 69a846296eda8acfb992f818df3d589b5023a12f [file] [log] [blame]
Damjan Marion38c61912023-10-17 16:06:26 +00001/* SPDX-License-Identifier: Apache-2.0
2 * Copyright (c) 2023 Cisco Systems, Inc.
3 */
4
5#ifndef _VNET_DEV_API_H_
6#define _VNET_DEV_API_H_
7
8#include <vppinfra/clib.h>
9#include <vnet/vnet.h>
10#include <vnet/dev/types.h>
11
12typedef struct
13{
14 vnet_dev_device_id_t device_id;
15 vnet_dev_driver_name_t driver_name;
16 vnet_dev_flags_t flags;
17 u8 *args;
18} vnet_dev_api_attach_args_t;
19
20vnet_dev_rv_t vnet_dev_api_attach (vlib_main_t *,
21 vnet_dev_api_attach_args_t *);
22
23typedef struct
24{
25 vnet_dev_device_id_t device_id;
26} vnet_dev_api_detach_args_t;
27vnet_dev_rv_t vnet_dev_api_detach (vlib_main_t *,
28 vnet_dev_api_detach_args_t *);
29
30typedef struct
31{
32 vnet_dev_device_id_t device_id;
33} vnet_dev_api_reset_args_t;
34vnet_dev_rv_t vnet_dev_api_reset (vlib_main_t *, vnet_dev_api_reset_args_t *);
35
36typedef struct
37{
38 vnet_dev_device_id_t device_id;
39 vnet_dev_if_name_t intf_name;
40 u16 num_rx_queues;
41 u16 num_tx_queues;
42 u16 rx_queue_size;
43 u16 tx_queue_size;
44 vnet_dev_port_id_t port_id;
45 vnet_dev_port_flags_t flags;
46 u8 *args;
47} vnet_dev_api_create_port_if_args_t;
48
49vnet_dev_rv_t
50vnet_dev_api_create_port_if (vlib_main_t *,
51 vnet_dev_api_create_port_if_args_t *);
52
53typedef struct
54{
55 u32 sw_if_index;
56} vnet_dev_api_remove_port_if_args_t;
57
58vnet_dev_rv_t
59vnet_dev_api_remove_port_if (vlib_main_t *,
60 vnet_dev_api_remove_port_if_args_t *);
61
62#endif /* _VNET_DEV_API_H_ */