devices: virtio API cleanup
[vpp.git] / src / vnet / devices / virtio / virtio.api
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 option version = "2.0.0";
17
18 import "vnet/interface_types.api";
19 import "vnet/ethernet/ethernet_types.api";
20 import "vnet/pci/pci_types.api";
21
22
23 /** \brief Initialize a new virtio pci interface with the given parameters
24     @param client_index - opaque cookie to identify the sender
25     @param context - sender context, to match reply w/ request
26     @param pci_addr - pci address
27     @param use_random_mac - let the system generate a unique mac address
28     @param mac_address - mac addr to assign to the interface if use_random not set
29     @param gso_enabled - enable gso feature if available, 1 to enable
30     @param features - the virtio features which driver should negotiate with device
31 */
32 define virtio_pci_create
33 {
34   u32 client_index;
35   u32 context;
36   vl_api_pci_address_t pci_addr;
37   bool use_random_mac;
38   vl_api_mac_address_t mac_address;
39   bool gso_enabled;
40   u64 features;
41 };
42
43 /** \brief Reply for virtio pci create reply
44     @param context - returned sender context, to match reply w/ request
45     @param retval - return code
46     @param sw_if_index - software index allocated for the new virtio pci interface
47 */
48 define virtio_pci_create_reply
49 {
50   u32 context;
51   i32 retval;
52   vl_api_interface_index_t sw_if_index;
53 };
54
55 /** \brief Delete virtio pci interface
56     @param client_index - opaque cookie to identify the sender
57     @param context - sender context, to match reply w/ request
58     @param sw_if_index - interface index of existing virtio pci interface
59 */
60 autoreply define virtio_pci_delete
61 {
62   u32 client_index;
63   u32 context;
64   vl_api_interface_index_t sw_if_index;
65 };
66
67 /** \brief Dump virtio pci interfaces request */
68 define sw_interface_virtio_pci_dump
69 {
70   u32 client_index;
71   u32 context;
72 };
73
74 /** \brief Reply for virtio pci interface dump request
75     @param sw_if_index - software index of virtio pci interface
76     @param pci_addr - pci address
77     @param mac_addr - native virtio device mac address
78     @param tx_ring_sz - the number of entries of TX ring
79     @param rx_ring_sz - the number of entries of RX ring
80     @param features - the virtio features which driver have negotiated with device
81 */
82 define sw_interface_virtio_pci_details
83 {
84   u32 context;
85   vl_api_interface_index_t sw_if_index;
86   vl_api_pci_address_t pci_addr;
87   vl_api_mac_address_t mac_addr;
88   u16 tx_ring_sz;
89   u16 rx_ring_sz;
90   u64 features;
91 };
92
93 /*
94  * Local Variables:
95  * eval: (c-set-style "gnu")
96  * End:
97  */