GNU Linux-libre 4.19.286-gnu1
[releases.git] / drivers / net / ethernet / intel / iavf / i40e_adminq_cmd.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2013 - 2018 Intel Corporation. */
3
4 #ifndef _I40E_ADMINQ_CMD_H_
5 #define _I40E_ADMINQ_CMD_H_
6
7 /* This header file defines the i40e Admin Queue commands and is shared between
8  * i40e Firmware and Software.
9  *
10  * This file needs to comply with the Linux Kernel coding style.
11  */
12
13 #define I40E_FW_API_VERSION_MAJOR       0x0001
14 #define I40E_FW_API_VERSION_MINOR_X722  0x0005
15 #define I40E_FW_API_VERSION_MINOR_X710  0x0007
16
17 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
18                                         I40E_FW_API_VERSION_MINOR_X710 : \
19                                         I40E_FW_API_VERSION_MINOR_X722)
20
21 /* API version 1.7 implements additional link and PHY-specific APIs  */
22 #define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007
23
24 struct i40e_aq_desc {
25         __le16 flags;
26         __le16 opcode;
27         __le16 datalen;
28         __le16 retval;
29         __le32 cookie_high;
30         __le32 cookie_low;
31         union {
32                 struct {
33                         __le32 param0;
34                         __le32 param1;
35                         __le32 param2;
36                         __le32 param3;
37                 } internal;
38                 struct {
39                         __le32 param0;
40                         __le32 param1;
41                         __le32 addr_high;
42                         __le32 addr_low;
43                 } external;
44                 u8 raw[16];
45         } params;
46 };
47
48 /* Flags sub-structure
49  * |0  |1  |2  |3  |4  |5  |6  |7  |8  |9  |10 |11 |12 |13 |14 |15 |
50  * |DD |CMP|ERR|VFE| * *  RESERVED * * |LB |RD |VFC|BUF|SI |EI |FE |
51  */
52
53 /* command flags and offsets*/
54 #define I40E_AQ_FLAG_DD_SHIFT   0
55 #define I40E_AQ_FLAG_CMP_SHIFT  1
56 #define I40E_AQ_FLAG_ERR_SHIFT  2
57 #define I40E_AQ_FLAG_VFE_SHIFT  3
58 #define I40E_AQ_FLAG_LB_SHIFT   9
59 #define I40E_AQ_FLAG_RD_SHIFT   10
60 #define I40E_AQ_FLAG_VFC_SHIFT  11
61 #define I40E_AQ_FLAG_BUF_SHIFT  12
62 #define I40E_AQ_FLAG_SI_SHIFT   13
63 #define I40E_AQ_FLAG_EI_SHIFT   14
64 #define I40E_AQ_FLAG_FE_SHIFT   15
65
66 #define I40E_AQ_FLAG_DD         BIT(I40E_AQ_FLAG_DD_SHIFT)  /* 0x1    */
67 #define I40E_AQ_FLAG_CMP        BIT(I40E_AQ_FLAG_CMP_SHIFT) /* 0x2    */
68 #define I40E_AQ_FLAG_ERR        BIT(I40E_AQ_FLAG_ERR_SHIFT) /* 0x4    */
69 #define I40E_AQ_FLAG_VFE        BIT(I40E_AQ_FLAG_VFE_SHIFT) /* 0x8    */
70 #define I40E_AQ_FLAG_LB         BIT(I40E_AQ_FLAG_LB_SHIFT)  /* 0x200  */
71 #define I40E_AQ_FLAG_RD         BIT(I40E_AQ_FLAG_RD_SHIFT)  /* 0x400  */
72 #define I40E_AQ_FLAG_VFC        BIT(I40E_AQ_FLAG_VFC_SHIFT) /* 0x800  */
73 #define I40E_AQ_FLAG_BUF        BIT(I40E_AQ_FLAG_BUF_SHIFT) /* 0x1000 */
74 #define I40E_AQ_FLAG_SI         BIT(I40E_AQ_FLAG_SI_SHIFT)  /* 0x2000 */
75 #define I40E_AQ_FLAG_EI         BIT(I40E_AQ_FLAG_EI_SHIFT)  /* 0x4000 */
76 #define I40E_AQ_FLAG_FE         BIT(I40E_AQ_FLAG_FE_SHIFT)  /* 0x8000 */
77
78 /* error codes */
79 enum i40e_admin_queue_err {
80         I40E_AQ_RC_OK           = 0,  /* success */
81         I40E_AQ_RC_EPERM        = 1,  /* Operation not permitted */
82         I40E_AQ_RC_ENOENT       = 2,  /* No such element */
83         I40E_AQ_RC_ESRCH        = 3,  /* Bad opcode */
84         I40E_AQ_RC_EINTR        = 4,  /* operation interrupted */
85         I40E_AQ_RC_EIO          = 5,  /* I/O error */
86         I40E_AQ_RC_ENXIO        = 6,  /* No such resource */
87         I40E_AQ_RC_E2BIG        = 7,  /* Arg too long */
88         I40E_AQ_RC_EAGAIN       = 8,  /* Try again */
89         I40E_AQ_RC_ENOMEM       = 9,  /* Out of memory */
90         I40E_AQ_RC_EACCES       = 10, /* Permission denied */
91         I40E_AQ_RC_EFAULT       = 11, /* Bad address */
92         I40E_AQ_RC_EBUSY        = 12, /* Device or resource busy */
93         I40E_AQ_RC_EEXIST       = 13, /* object already exists */
94         I40E_AQ_RC_EINVAL       = 14, /* Invalid argument */
95         I40E_AQ_RC_ENOTTY       = 15, /* Not a typewriter */
96         I40E_AQ_RC_ENOSPC       = 16, /* No space left or alloc failure */
97         I40E_AQ_RC_ENOSYS       = 17, /* Function not implemented */
98         I40E_AQ_RC_ERANGE       = 18, /* Parameter out of range */
99         I40E_AQ_RC_EFLUSHED     = 19, /* Cmd flushed due to prev cmd error */
100         I40E_AQ_RC_BAD_ADDR     = 20, /* Descriptor contains a bad pointer */
101         I40E_AQ_RC_EMODE        = 21, /* Op not allowed in current dev mode */
102         I40E_AQ_RC_EFBIG        = 22, /* File too large */
103 };
104
105 /* Admin Queue command opcodes */
106 enum i40e_admin_queue_opc {
107         /* aq commands */
108         i40e_aqc_opc_get_version        = 0x0001,
109         i40e_aqc_opc_driver_version     = 0x0002,
110         i40e_aqc_opc_queue_shutdown     = 0x0003,
111         i40e_aqc_opc_set_pf_context     = 0x0004,
112
113         /* resource ownership */
114         i40e_aqc_opc_request_resource   = 0x0008,
115         i40e_aqc_opc_release_resource   = 0x0009,
116
117         i40e_aqc_opc_list_func_capabilities     = 0x000A,
118         i40e_aqc_opc_list_dev_capabilities      = 0x000B,
119
120         /* Proxy commands */
121         i40e_aqc_opc_set_proxy_config           = 0x0104,
122         i40e_aqc_opc_set_ns_proxy_table_entry   = 0x0105,
123
124         /* LAA */
125         i40e_aqc_opc_mac_address_read   = 0x0107,
126         i40e_aqc_opc_mac_address_write  = 0x0108,
127
128         /* PXE */
129         i40e_aqc_opc_clear_pxe_mode     = 0x0110,
130
131         /* WoL commands */
132         i40e_aqc_opc_set_wol_filter     = 0x0120,
133         i40e_aqc_opc_get_wake_reason    = 0x0121,
134
135         /* internal switch commands */
136         i40e_aqc_opc_get_switch_config          = 0x0200,
137         i40e_aqc_opc_add_statistics             = 0x0201,
138         i40e_aqc_opc_remove_statistics          = 0x0202,
139         i40e_aqc_opc_set_port_parameters        = 0x0203,
140         i40e_aqc_opc_get_switch_resource_alloc  = 0x0204,
141         i40e_aqc_opc_set_switch_config          = 0x0205,
142         i40e_aqc_opc_rx_ctl_reg_read            = 0x0206,
143         i40e_aqc_opc_rx_ctl_reg_write           = 0x0207,
144
145         i40e_aqc_opc_add_vsi                    = 0x0210,
146         i40e_aqc_opc_update_vsi_parameters      = 0x0211,
147         i40e_aqc_opc_get_vsi_parameters         = 0x0212,
148
149         i40e_aqc_opc_add_pv                     = 0x0220,
150         i40e_aqc_opc_update_pv_parameters       = 0x0221,
151         i40e_aqc_opc_get_pv_parameters          = 0x0222,
152
153         i40e_aqc_opc_add_veb                    = 0x0230,
154         i40e_aqc_opc_update_veb_parameters      = 0x0231,
155         i40e_aqc_opc_get_veb_parameters         = 0x0232,
156
157         i40e_aqc_opc_delete_element             = 0x0243,
158
159         i40e_aqc_opc_add_macvlan                = 0x0250,
160         i40e_aqc_opc_remove_macvlan             = 0x0251,
161         i40e_aqc_opc_add_vlan                   = 0x0252,
162         i40e_aqc_opc_remove_vlan                = 0x0253,
163         i40e_aqc_opc_set_vsi_promiscuous_modes  = 0x0254,
164         i40e_aqc_opc_add_tag                    = 0x0255,
165         i40e_aqc_opc_remove_tag                 = 0x0256,
166         i40e_aqc_opc_add_multicast_etag         = 0x0257,
167         i40e_aqc_opc_remove_multicast_etag      = 0x0258,
168         i40e_aqc_opc_update_tag                 = 0x0259,
169         i40e_aqc_opc_add_control_packet_filter  = 0x025A,
170         i40e_aqc_opc_remove_control_packet_filter       = 0x025B,
171         i40e_aqc_opc_add_cloud_filters          = 0x025C,
172         i40e_aqc_opc_remove_cloud_filters       = 0x025D,
173         i40e_aqc_opc_clear_wol_switch_filters   = 0x025E,
174
175         i40e_aqc_opc_add_mirror_rule    = 0x0260,
176         i40e_aqc_opc_delete_mirror_rule = 0x0261,
177
178         /* Dynamic Device Personalization */
179         i40e_aqc_opc_write_personalization_profile      = 0x0270,
180         i40e_aqc_opc_get_personalization_profile_list   = 0x0271,
181
182         /* DCB commands */
183         i40e_aqc_opc_dcb_ignore_pfc     = 0x0301,
184         i40e_aqc_opc_dcb_updated        = 0x0302,
185         i40e_aqc_opc_set_dcb_parameters = 0x0303,
186
187         /* TX scheduler */
188         i40e_aqc_opc_configure_vsi_bw_limit             = 0x0400,
189         i40e_aqc_opc_configure_vsi_ets_sla_bw_limit     = 0x0406,
190         i40e_aqc_opc_configure_vsi_tc_bw                = 0x0407,
191         i40e_aqc_opc_query_vsi_bw_config                = 0x0408,
192         i40e_aqc_opc_query_vsi_ets_sla_config           = 0x040A,
193         i40e_aqc_opc_configure_switching_comp_bw_limit  = 0x0410,
194
195         i40e_aqc_opc_enable_switching_comp_ets                  = 0x0413,
196         i40e_aqc_opc_modify_switching_comp_ets                  = 0x0414,
197         i40e_aqc_opc_disable_switching_comp_ets                 = 0x0415,
198         i40e_aqc_opc_configure_switching_comp_ets_bw_limit      = 0x0416,
199         i40e_aqc_opc_configure_switching_comp_bw_config         = 0x0417,
200         i40e_aqc_opc_query_switching_comp_ets_config            = 0x0418,
201         i40e_aqc_opc_query_port_ets_config                      = 0x0419,
202         i40e_aqc_opc_query_switching_comp_bw_config             = 0x041A,
203         i40e_aqc_opc_suspend_port_tx                            = 0x041B,
204         i40e_aqc_opc_resume_port_tx                             = 0x041C,
205         i40e_aqc_opc_configure_partition_bw                     = 0x041D,
206         /* hmc */
207         i40e_aqc_opc_query_hmc_resource_profile = 0x0500,
208         i40e_aqc_opc_set_hmc_resource_profile   = 0x0501,
209
210         /* phy commands*/
211         i40e_aqc_opc_get_phy_abilities          = 0x0600,
212         i40e_aqc_opc_set_phy_config             = 0x0601,
213         i40e_aqc_opc_set_mac_config             = 0x0603,
214         i40e_aqc_opc_set_link_restart_an        = 0x0605,
215         i40e_aqc_opc_get_link_status            = 0x0607,
216         i40e_aqc_opc_set_phy_int_mask           = 0x0613,
217         i40e_aqc_opc_get_local_advt_reg         = 0x0614,
218         i40e_aqc_opc_set_local_advt_reg         = 0x0615,
219         i40e_aqc_opc_get_partner_advt           = 0x0616,
220         i40e_aqc_opc_set_lb_modes               = 0x0618,
221         i40e_aqc_opc_get_phy_wol_caps           = 0x0621,
222         i40e_aqc_opc_set_phy_debug              = 0x0622,
223         i40e_aqc_opc_upload_ext_phy_fm          = 0x0625,
224         i40e_aqc_opc_run_phy_activity           = 0x0626,
225         i40e_aqc_opc_set_phy_register           = 0x0628,
226         i40e_aqc_opc_get_phy_register           = 0x0629,
227
228         /* NVM commands */
229         i40e_aqc_opc_nvm_read                   = 0x0701,
230         i40e_aqc_opc_nvm_erase                  = 0x0702,
231         i40e_aqc_opc_nvm_update                 = 0x0703,
232         i40e_aqc_opc_nvm_config_read            = 0x0704,
233         i40e_aqc_opc_nvm_config_write           = 0x0705,
234         i40e_aqc_opc_oem_post_update            = 0x0720,
235         i40e_aqc_opc_thermal_sensor             = 0x0721,
236
237         /* virtualization commands */
238         i40e_aqc_opc_send_msg_to_pf             = 0x0801,
239         i40e_aqc_opc_send_msg_to_vf             = 0x0802,
240         i40e_aqc_opc_send_msg_to_peer           = 0x0803,
241
242         /* alternate structure */
243         i40e_aqc_opc_alternate_write            = 0x0900,
244         i40e_aqc_opc_alternate_write_indirect   = 0x0901,
245         i40e_aqc_opc_alternate_read             = 0x0902,
246         i40e_aqc_opc_alternate_read_indirect    = 0x0903,
247         i40e_aqc_opc_alternate_write_done       = 0x0904,
248         i40e_aqc_opc_alternate_set_mode         = 0x0905,
249         i40e_aqc_opc_alternate_clear_port       = 0x0906,
250
251         /* LLDP commands */
252         i40e_aqc_opc_lldp_get_mib       = 0x0A00,
253         i40e_aqc_opc_lldp_update_mib    = 0x0A01,
254         i40e_aqc_opc_lldp_add_tlv       = 0x0A02,
255         i40e_aqc_opc_lldp_update_tlv    = 0x0A03,
256         i40e_aqc_opc_lldp_delete_tlv    = 0x0A04,
257         i40e_aqc_opc_lldp_stop          = 0x0A05,
258         i40e_aqc_opc_lldp_start         = 0x0A06,
259
260         /* Tunnel commands */
261         i40e_aqc_opc_add_udp_tunnel     = 0x0B00,
262         i40e_aqc_opc_del_udp_tunnel     = 0x0B01,
263         i40e_aqc_opc_set_rss_key        = 0x0B02,
264         i40e_aqc_opc_set_rss_lut        = 0x0B03,
265         i40e_aqc_opc_get_rss_key        = 0x0B04,
266         i40e_aqc_opc_get_rss_lut        = 0x0B05,
267
268         /* Async Events */
269         i40e_aqc_opc_event_lan_overflow         = 0x1001,
270
271         /* OEM commands */
272         i40e_aqc_opc_oem_parameter_change       = 0xFE00,
273         i40e_aqc_opc_oem_device_status_change   = 0xFE01,
274         i40e_aqc_opc_oem_ocsd_initialize        = 0xFE02,
275         i40e_aqc_opc_oem_ocbb_initialize        = 0xFE03,
276
277         /* debug commands */
278         i40e_aqc_opc_debug_read_reg             = 0xFF03,
279         i40e_aqc_opc_debug_write_reg            = 0xFF04,
280         i40e_aqc_opc_debug_modify_reg           = 0xFF07,
281         i40e_aqc_opc_debug_dump_internals       = 0xFF08,
282 };
283
284 /* command structures and indirect data structures */
285
286 /* Structure naming conventions:
287  * - no suffix for direct command descriptor structures
288  * - _data for indirect sent data
289  * - _resp for indirect return data (data which is both will use _data)
290  * - _completion for direct return data
291  * - _element_ for repeated elements (may also be _data or _resp)
292  *
293  * Command structures are expected to overlay the params.raw member of the basic
294  * descriptor, and as such cannot exceed 16 bytes in length.
295  */
296
297 /* This macro is used to generate a compilation error if a structure
298  * is not exactly the correct length. It gives a divide by zero error if the
299  * structure is not of the correct size, otherwise it creates an enum that is
300  * never used.
301  */
302 #define I40E_CHECK_STRUCT_LEN(n, X) enum i40e_static_assert_enum_##X \
303         { i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
304
305 /* This macro is used extensively to ensure that command structures are 16
306  * bytes in length as they have to map to the raw array of that size.
307  */
308 #define I40E_CHECK_CMD_LENGTH(X)        I40E_CHECK_STRUCT_LEN(16, X)
309
310 /* Queue Shutdown (direct 0x0003) */
311 struct i40e_aqc_queue_shutdown {
312         __le32  driver_unloading;
313 #define I40E_AQ_DRIVER_UNLOADING        0x1
314         u8      reserved[12];
315 };
316
317 I40E_CHECK_CMD_LENGTH(i40e_aqc_queue_shutdown);
318
319 struct i40e_aqc_vsi_properties_data {
320         /* first 96 byte are written by SW */
321         __le16  valid_sections;
322 #define I40E_AQ_VSI_PROP_SWITCH_VALID           0x0001
323 #define I40E_AQ_VSI_PROP_SECURITY_VALID         0x0002
324 #define I40E_AQ_VSI_PROP_VLAN_VALID             0x0004
325 #define I40E_AQ_VSI_PROP_CAS_PV_VALID           0x0008
326 #define I40E_AQ_VSI_PROP_INGRESS_UP_VALID       0x0010
327 #define I40E_AQ_VSI_PROP_EGRESS_UP_VALID        0x0020
328 #define I40E_AQ_VSI_PROP_QUEUE_MAP_VALID        0x0040
329 #define I40E_AQ_VSI_PROP_QUEUE_OPT_VALID        0x0080
330 #define I40E_AQ_VSI_PROP_OUTER_UP_VALID         0x0100
331 #define I40E_AQ_VSI_PROP_SCHED_VALID            0x0200
332         /* switch section */
333         __le16  switch_id; /* 12bit id combined with flags below */
334 #define I40E_AQ_VSI_SW_ID_SHIFT         0x0000
335 #define I40E_AQ_VSI_SW_ID_MASK          (0xFFF << I40E_AQ_VSI_SW_ID_SHIFT)
336 #define I40E_AQ_VSI_SW_ID_FLAG_NOT_STAG 0x1000
337 #define I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB 0x2000
338 #define I40E_AQ_VSI_SW_ID_FLAG_LOCAL_LB 0x4000
339         u8      sw_reserved[2];
340         /* security section */
341         u8      sec_flags;
342 #define I40E_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD    0x01
343 #define I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK    0x02
344 #define I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK     0x04
345         u8      sec_reserved;
346         /* VLAN section */
347         __le16  pvid; /* VLANS include priority bits */
348         __le16  fcoe_pvid;
349         u8      port_vlan_flags;
350 #define I40E_AQ_VSI_PVLAN_MODE_SHIFT    0x00
351 #define I40E_AQ_VSI_PVLAN_MODE_MASK     (0x03 << \
352                                          I40E_AQ_VSI_PVLAN_MODE_SHIFT)
353 #define I40E_AQ_VSI_PVLAN_MODE_TAGGED   0x01
354 #define I40E_AQ_VSI_PVLAN_MODE_UNTAGGED 0x02
355 #define I40E_AQ_VSI_PVLAN_MODE_ALL      0x03
356 #define I40E_AQ_VSI_PVLAN_INSERT_PVID   0x04
357 #define I40E_AQ_VSI_PVLAN_EMOD_SHIFT    0x03
358 #define I40E_AQ_VSI_PVLAN_EMOD_MASK     (0x3 << \
359                                          I40E_AQ_VSI_PVLAN_EMOD_SHIFT)
360 #define I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH 0x0
361 #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP   0x08
362 #define I40E_AQ_VSI_PVLAN_EMOD_STR      0x10
363 #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING  0x18
364         u8      pvlan_reserved[3];
365         /* ingress egress up sections */
366         __le32  ingress_table; /* bitmap, 3 bits per up */
367 #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT  0
368 #define I40E_AQ_VSI_UP_TABLE_UP0_MASK   (0x7 << \
369                                          I40E_AQ_VSI_UP_TABLE_UP0_SHIFT)
370 #define I40E_AQ_VSI_UP_TABLE_UP1_SHIFT  3
371 #define I40E_AQ_VSI_UP_TABLE_UP1_MASK   (0x7 << \
372                                          I40E_AQ_VSI_UP_TABLE_UP1_SHIFT)
373 #define I40E_AQ_VSI_UP_TABLE_UP2_SHIFT  6
374 #define I40E_AQ_VSI_UP_TABLE_UP2_MASK   (0x7 << \
375                                          I40E_AQ_VSI_UP_TABLE_UP2_SHIFT)
376 #define I40E_AQ_VSI_UP_TABLE_UP3_SHIFT  9
377 #define I40E_AQ_VSI_UP_TABLE_UP3_MASK   (0x7 << \
378                                          I40E_AQ_VSI_UP_TABLE_UP3_SHIFT)
379 #define I40E_AQ_VSI_UP_TABLE_UP4_SHIFT  12
380 #define I40E_AQ_VSI_UP_TABLE_UP4_MASK   (0x7 << \
381                                          I40E_AQ_VSI_UP_TABLE_UP4_SHIFT)
382 #define I40E_AQ_VSI_UP_TABLE_UP5_SHIFT  15
383 #define I40E_AQ_VSI_UP_TABLE_UP5_MASK   (0x7 << \
384                                          I40E_AQ_VSI_UP_TABLE_UP5_SHIFT)
385 #define I40E_AQ_VSI_UP_TABLE_UP6_SHIFT  18
386 #define I40E_AQ_VSI_UP_TABLE_UP6_MASK   (0x7 << \
387                                          I40E_AQ_VSI_UP_TABLE_UP6_SHIFT)
388 #define I40E_AQ_VSI_UP_TABLE_UP7_SHIFT  21
389 #define I40E_AQ_VSI_UP_TABLE_UP7_MASK   (0x7 << \
390                                          I40E_AQ_VSI_UP_TABLE_UP7_SHIFT)
391         __le32  egress_table;   /* same defines as for ingress table */
392         /* cascaded PV section */
393         __le16  cas_pv_tag;
394         u8      cas_pv_flags;
395 #define I40E_AQ_VSI_CAS_PV_TAGX_SHIFT           0x00
396 #define I40E_AQ_VSI_CAS_PV_TAGX_MASK            (0x03 << \
397                                                  I40E_AQ_VSI_CAS_PV_TAGX_SHIFT)
398 #define I40E_AQ_VSI_CAS_PV_TAGX_LEAVE           0x00
399 #define I40E_AQ_VSI_CAS_PV_TAGX_REMOVE          0x01
400 #define I40E_AQ_VSI_CAS_PV_TAGX_COPY            0x02
401 #define I40E_AQ_VSI_CAS_PV_INSERT_TAG           0x10
402 #define I40E_AQ_VSI_CAS_PV_ETAG_PRUNE           0x20
403 #define I40E_AQ_VSI_CAS_PV_ACCEPT_HOST_TAG      0x40
404         u8      cas_pv_reserved;
405         /* queue mapping section */
406         __le16  mapping_flags;
407 #define I40E_AQ_VSI_QUE_MAP_CONTIG      0x0
408 #define I40E_AQ_VSI_QUE_MAP_NONCONTIG   0x1
409         __le16  queue_mapping[16];
410 #define I40E_AQ_VSI_QUEUE_SHIFT         0x0
411 #define I40E_AQ_VSI_QUEUE_MASK          (0x7FF << I40E_AQ_VSI_QUEUE_SHIFT)
412         __le16  tc_mapping[8];
413 #define I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT 0
414 #define I40E_AQ_VSI_TC_QUE_OFFSET_MASK  (0x1FF << \
415                                          I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT)
416 #define I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT 9
417 #define I40E_AQ_VSI_TC_QUE_NUMBER_MASK  (0x7 << \
418                                          I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT)
419         /* queueing option section */
420         u8      queueing_opt_flags;
421 #define I40E_AQ_VSI_QUE_OPT_MULTICAST_UDP_ENA   0x04
422 #define I40E_AQ_VSI_QUE_OPT_UNICAST_UDP_ENA     0x08
423 #define I40E_AQ_VSI_QUE_OPT_TCP_ENA     0x10
424 #define I40E_AQ_VSI_QUE_OPT_FCOE_ENA    0x20
425 #define I40E_AQ_VSI_QUE_OPT_RSS_LUT_PF  0x00
426 #define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI 0x40
427         u8      queueing_opt_reserved[3];
428         /* scheduler section */
429         u8      up_enable_bits;
430         u8      sched_reserved;
431         /* outer up section */
432         __le32  outer_up_table; /* same structure and defines as ingress tbl */
433         u8      cmd_reserved[8];
434         /* last 32 bytes are written by FW */
435         __le16  qs_handle[8];
436 #define I40E_AQ_VSI_QS_HANDLE_INVALID   0xFFFF
437         __le16  stat_counter_idx;
438         __le16  sched_id;
439         u8      resp_reserved[12];
440 };
441
442 I40E_CHECK_STRUCT_LEN(128, i40e_aqc_vsi_properties_data);
443
444 /* Get VEB Parameters (direct 0x0232)
445  * uses i40e_aqc_switch_seid for the descriptor
446  */
447 struct i40e_aqc_get_veb_parameters_completion {
448         __le16  seid;
449         __le16  switch_id;
450         __le16  veb_flags; /* only the first/last flags from 0x0230 is valid */
451         __le16  statistic_index;
452         __le16  vebs_used;
453         __le16  vebs_free;
454         u8      reserved[4];
455 };
456
457 I40E_CHECK_CMD_LENGTH(i40e_aqc_get_veb_parameters_completion);
458
459 #define I40E_LINK_SPEED_100MB_SHIFT     0x1
460 #define I40E_LINK_SPEED_1000MB_SHIFT    0x2
461 #define I40E_LINK_SPEED_10GB_SHIFT      0x3
462 #define I40E_LINK_SPEED_40GB_SHIFT      0x4
463 #define I40E_LINK_SPEED_20GB_SHIFT      0x5
464 #define I40E_LINK_SPEED_25GB_SHIFT      0x6
465
466 enum i40e_aq_link_speed {
467         I40E_LINK_SPEED_UNKNOWN = 0,
468         I40E_LINK_SPEED_100MB   = BIT(I40E_LINK_SPEED_100MB_SHIFT),
469         I40E_LINK_SPEED_1GB     = BIT(I40E_LINK_SPEED_1000MB_SHIFT),
470         I40E_LINK_SPEED_10GB    = BIT(I40E_LINK_SPEED_10GB_SHIFT),
471         I40E_LINK_SPEED_40GB    = BIT(I40E_LINK_SPEED_40GB_SHIFT),
472         I40E_LINK_SPEED_20GB    = BIT(I40E_LINK_SPEED_20GB_SHIFT),
473         I40E_LINK_SPEED_25GB    = BIT(I40E_LINK_SPEED_25GB_SHIFT),
474 };
475
476 /* Send to PF command (indirect 0x0801) id is only used by PF
477  * Send to VF command (indirect 0x0802) id is only used by PF
478  * Send to Peer PF command (indirect 0x0803)
479  */
480 struct i40e_aqc_pf_vf_message {
481         __le32  id;
482         u8      reserved[4];
483         __le32  addr_high;
484         __le32  addr_low;
485 };
486
487 I40E_CHECK_CMD_LENGTH(i40e_aqc_pf_vf_message);
488
489 struct i40e_aqc_get_set_rss_key {
490 #define I40E_AQC_SET_RSS_KEY_VSI_VALID          BIT(15)
491 #define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT       0
492 #define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK        (0x3FF << \
493                                         I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT)
494         __le16  vsi_id;
495         u8      reserved[6];
496         __le32  addr_high;
497         __le32  addr_low;
498 };
499
500 I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key);
501
502 struct i40e_aqc_get_set_rss_key_data {
503         u8 standard_rss_key[0x28];
504         u8 extended_hash_key[0xc];
505 };
506
507 I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data);
508
509 struct  i40e_aqc_get_set_rss_lut {
510 #define I40E_AQC_SET_RSS_LUT_VSI_VALID          BIT(15)
511 #define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT       0
512 #define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK        (0x3FF << \
513                                         I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT)
514         __le16  vsi_id;
515 #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT   0
516 #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK \
517                                 BIT(I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT)
518
519 #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI     0
520 #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF      1
521         __le16  flags;
522         u8      reserved[4];
523         __le32  addr_high;
524         __le32  addr_low;
525 };
526
527 I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut);
528 #endif /* _I40E_ADMINQ_CMD_H_ */