Damjan Marion | 38c6191 | 2023-10-17 16:06:26 +0000 | [diff] [blame] | 1 | /* 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 | |
| 12 | typedef 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 Marion | ddf6cec | 2023-11-22 16:25:55 +0000 | [diff] [blame] | 18 | |
| 19 | /* return */ |
| 20 | u32 dev_index; |
Damjan Marion | 38c6191 | 2023-10-17 16:06:26 +0000 | [diff] [blame] | 21 | } vnet_dev_api_attach_args_t; |
| 22 | |
| 23 | vnet_dev_rv_t vnet_dev_api_attach (vlib_main_t *, |
| 24 | vnet_dev_api_attach_args_t *); |
| 25 | |
| 26 | typedef struct |
| 27 | { |
Damjan Marion | ddf6cec | 2023-11-22 16:25:55 +0000 | [diff] [blame] | 28 | u32 dev_index; |
Damjan Marion | 38c6191 | 2023-10-17 16:06:26 +0000 | [diff] [blame] | 29 | } vnet_dev_api_detach_args_t; |
| 30 | vnet_dev_rv_t vnet_dev_api_detach (vlib_main_t *, |
| 31 | vnet_dev_api_detach_args_t *); |
| 32 | |
| 33 | typedef struct |
| 34 | { |
| 35 | vnet_dev_device_id_t device_id; |
| 36 | } vnet_dev_api_reset_args_t; |
| 37 | vnet_dev_rv_t vnet_dev_api_reset (vlib_main_t *, vnet_dev_api_reset_args_t *); |
| 38 | |
| 39 | typedef struct |
| 40 | { |
Damjan Marion | ddf6cec | 2023-11-22 16:25:55 +0000 | [diff] [blame] | 41 | u32 dev_index; |
Damjan Marion | 38c6191 | 2023-10-17 16:06:26 +0000 | [diff] [blame] | 42 | 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 Marion | ddf6cec | 2023-11-22 16:25:55 +0000 | [diff] [blame] | 50 | |
| 51 | /* return */ |
| 52 | u32 sw_if_index; |
Damjan Marion | 38c6191 | 2023-10-17 16:06:26 +0000 | [diff] [blame] | 53 | } vnet_dev_api_create_port_if_args_t; |
| 54 | |
| 55 | vnet_dev_rv_t |
| 56 | vnet_dev_api_create_port_if (vlib_main_t *, |
| 57 | vnet_dev_api_create_port_if_args_t *); |
| 58 | |
| 59 | typedef struct |
| 60 | { |
| 61 | u32 sw_if_index; |
| 62 | } vnet_dev_api_remove_port_if_args_t; |
| 63 | |
| 64 | vnet_dev_rv_t |
| 65 | vnet_dev_api_remove_port_if (vlib_main_t *, |
| 66 | vnet_dev_api_remove_port_if_args_t *); |
| 67 | |
| 68 | #endif /* _VNET_DEV_API_H_ */ |