blob: 3e552e4326e5785acc1acd04e0d8a3211571c6ca [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;
Damjan Marionddf6cec2023-11-22 16:25:55 +000018
19 /* return */
20 u32 dev_index;
Damjan Marion38c61912023-10-17 16:06:26 +000021} vnet_dev_api_attach_args_t;
22
23vnet_dev_rv_t vnet_dev_api_attach (vlib_main_t *,
24 vnet_dev_api_attach_args_t *);
25
26typedef struct
27{
Damjan Marionddf6cec2023-11-22 16:25:55 +000028 u32 dev_index;
Damjan Marion38c61912023-10-17 16:06:26 +000029} vnet_dev_api_detach_args_t;
30vnet_dev_rv_t vnet_dev_api_detach (vlib_main_t *,
31 vnet_dev_api_detach_args_t *);
32
33typedef struct
34{
35 vnet_dev_device_id_t device_id;
36} vnet_dev_api_reset_args_t;
37vnet_dev_rv_t vnet_dev_api_reset (vlib_main_t *, vnet_dev_api_reset_args_t *);
38
39typedef struct
40{
Damjan Marionddf6cec2023-11-22 16:25:55 +000041 u32 dev_index;
Damjan Marion38c61912023-10-17 16:06:26 +000042 vnet_dev_if_name_t intf_name;
43 u16 num_rx_queues;
44 u16 num_tx_queues;
45 u16 rx_queue_size;
46 u16 tx_queue_size;
47 vnet_dev_port_id_t port_id;
48 vnet_dev_port_flags_t flags;
49 u8 *args;
Damjan Marionddf6cec2023-11-22 16:25:55 +000050
51 /* return */
52 u32 sw_if_index;
Damjan Marion38c61912023-10-17 16:06:26 +000053} vnet_dev_api_create_port_if_args_t;
54
55vnet_dev_rv_t
56vnet_dev_api_create_port_if (vlib_main_t *,
57 vnet_dev_api_create_port_if_args_t *);
58
59typedef struct
60{
61 u32 sw_if_index;
62} vnet_dev_api_remove_port_if_args_t;
63
64vnet_dev_rv_t
65vnet_dev_api_remove_port_if (vlib_main_t *,
66 vnet_dev_api_remove_port_if_args_t *);
67
Damjan Marion61e287b2024-10-08 20:50:56 +020068typedef struct
69{
70 u32 primary_sw_if_index;
71 vnet_dev_if_name_t intf_name;
72 u8 *args;
73
74 /* return */
75 u32 sw_if_index;
76} vnet_dev_api_port_add_sec_if_args_t;
77
78vnet_dev_rv_t
79vnet_dev_api_port_add_sec_if (vlib_main_t *,
80 vnet_dev_api_port_add_sec_if_args_t *);
81
82typedef struct
83{
84 u32 sw_if_index;
85} vnet_dev_api_port_del_sec_if_args_t;
86
87vnet_dev_rv_t
88vnet_dev_api_port_del_sec_if (vlib_main_t *,
89 vnet_dev_api_port_del_sec_if_args_t *);
90
Damjan Marion38c61912023-10-17 16:06:26 +000091#endif /* _VNET_DEV_API_H_ */