xref: /freebsd/sys/dev/ixl/i40e_adminq_cmd.h (revision 61ae650d55553d48c55fbe023706dfa4b97483bb)
1*61ae650dSJack F Vogel /******************************************************************************
2*61ae650dSJack F Vogel 
3*61ae650dSJack F Vogel   Copyright (c) 2013-2014, Intel Corporation
4*61ae650dSJack F Vogel   All rights reserved.
5*61ae650dSJack F Vogel 
6*61ae650dSJack F Vogel   Redistribution and use in source and binary forms, with or without
7*61ae650dSJack F Vogel   modification, are permitted provided that the following conditions are met:
8*61ae650dSJack F Vogel 
9*61ae650dSJack F Vogel    1. Redistributions of source code must retain the above copyright notice,
10*61ae650dSJack F Vogel       this list of conditions and the following disclaimer.
11*61ae650dSJack F Vogel 
12*61ae650dSJack F Vogel    2. Redistributions in binary form must reproduce the above copyright
13*61ae650dSJack F Vogel       notice, this list of conditions and the following disclaimer in the
14*61ae650dSJack F Vogel       documentation and/or other materials provided with the distribution.
15*61ae650dSJack F Vogel 
16*61ae650dSJack F Vogel    3. Neither the name of the Intel Corporation nor the names of its
17*61ae650dSJack F Vogel       contributors may be used to endorse or promote products derived from
18*61ae650dSJack F Vogel       this software without specific prior written permission.
19*61ae650dSJack F Vogel 
20*61ae650dSJack F Vogel   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21*61ae650dSJack F Vogel   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22*61ae650dSJack F Vogel   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23*61ae650dSJack F Vogel   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24*61ae650dSJack F Vogel   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25*61ae650dSJack F Vogel   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26*61ae650dSJack F Vogel   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27*61ae650dSJack F Vogel   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28*61ae650dSJack F Vogel   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29*61ae650dSJack F Vogel   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30*61ae650dSJack F Vogel   POSSIBILITY OF SUCH DAMAGE.
31*61ae650dSJack F Vogel 
32*61ae650dSJack F Vogel ******************************************************************************/
33*61ae650dSJack F Vogel /*$FreeBSD$*/
34*61ae650dSJack F Vogel 
35*61ae650dSJack F Vogel #ifndef _I40E_ADMINQ_CMD_H_
36*61ae650dSJack F Vogel #define _I40E_ADMINQ_CMD_H_
37*61ae650dSJack F Vogel 
38*61ae650dSJack F Vogel /* This header file defines the i40e Admin Queue commands and is shared between
39*61ae650dSJack F Vogel  * i40e Firmware and Software.
40*61ae650dSJack F Vogel  *
41*61ae650dSJack F Vogel  * This file needs to comply with the Linux Kernel coding style.
42*61ae650dSJack F Vogel  */
43*61ae650dSJack F Vogel 
44*61ae650dSJack F Vogel #define I40E_FW_API_VERSION_MAJOR	0x0001
45*61ae650dSJack F Vogel #define I40E_FW_API_VERSION_MINOR	0x0002
46*61ae650dSJack F Vogel 
47*61ae650dSJack F Vogel struct i40e_aq_desc {
48*61ae650dSJack F Vogel 	__le16 flags;
49*61ae650dSJack F Vogel 	__le16 opcode;
50*61ae650dSJack F Vogel 	__le16 datalen;
51*61ae650dSJack F Vogel 	__le16 retval;
52*61ae650dSJack F Vogel 	__le32 cookie_high;
53*61ae650dSJack F Vogel 	__le32 cookie_low;
54*61ae650dSJack F Vogel 	union {
55*61ae650dSJack F Vogel 		struct {
56*61ae650dSJack F Vogel 			__le32 param0;
57*61ae650dSJack F Vogel 			__le32 param1;
58*61ae650dSJack F Vogel 			__le32 param2;
59*61ae650dSJack F Vogel 			__le32 param3;
60*61ae650dSJack F Vogel 		} internal;
61*61ae650dSJack F Vogel 		struct {
62*61ae650dSJack F Vogel 			__le32 param0;
63*61ae650dSJack F Vogel 			__le32 param1;
64*61ae650dSJack F Vogel 			__le32 addr_high;
65*61ae650dSJack F Vogel 			__le32 addr_low;
66*61ae650dSJack F Vogel 		} external;
67*61ae650dSJack F Vogel 		u8 raw[16];
68*61ae650dSJack F Vogel 	} params;
69*61ae650dSJack F Vogel };
70*61ae650dSJack F Vogel 
71*61ae650dSJack F Vogel /* Flags sub-structure
72*61ae650dSJack F Vogel  * |0  |1  |2  |3  |4  |5  |6  |7  |8  |9  |10 |11 |12 |13 |14 |15 |
73*61ae650dSJack F Vogel  * |DD |CMP|ERR|VFE| * *  RESERVED * * |LB |RD |VFC|BUF|SI |EI |FE |
74*61ae650dSJack F Vogel  */
75*61ae650dSJack F Vogel 
76*61ae650dSJack F Vogel /* command flags and offsets*/
77*61ae650dSJack F Vogel #define I40E_AQ_FLAG_DD_SHIFT	0
78*61ae650dSJack F Vogel #define I40E_AQ_FLAG_CMP_SHIFT	1
79*61ae650dSJack F Vogel #define I40E_AQ_FLAG_ERR_SHIFT	2
80*61ae650dSJack F Vogel #define I40E_AQ_FLAG_VFE_SHIFT	3
81*61ae650dSJack F Vogel #define I40E_AQ_FLAG_LB_SHIFT	9
82*61ae650dSJack F Vogel #define I40E_AQ_FLAG_RD_SHIFT	10
83*61ae650dSJack F Vogel #define I40E_AQ_FLAG_VFC_SHIFT	11
84*61ae650dSJack F Vogel #define I40E_AQ_FLAG_BUF_SHIFT	12
85*61ae650dSJack F Vogel #define I40E_AQ_FLAG_SI_SHIFT	13
86*61ae650dSJack F Vogel #define I40E_AQ_FLAG_EI_SHIFT	14
87*61ae650dSJack F Vogel #define I40E_AQ_FLAG_FE_SHIFT	15
88*61ae650dSJack F Vogel 
89*61ae650dSJack F Vogel #define I40E_AQ_FLAG_DD		(1 << I40E_AQ_FLAG_DD_SHIFT)  /* 0x1    */
90*61ae650dSJack F Vogel #define I40E_AQ_FLAG_CMP	(1 << I40E_AQ_FLAG_CMP_SHIFT) /* 0x2    */
91*61ae650dSJack F Vogel #define I40E_AQ_FLAG_ERR	(1 << I40E_AQ_FLAG_ERR_SHIFT) /* 0x4    */
92*61ae650dSJack F Vogel #define I40E_AQ_FLAG_VFE	(1 << I40E_AQ_FLAG_VFE_SHIFT) /* 0x8    */
93*61ae650dSJack F Vogel #define I40E_AQ_FLAG_LB		(1 << I40E_AQ_FLAG_LB_SHIFT)  /* 0x200  */
94*61ae650dSJack F Vogel #define I40E_AQ_FLAG_RD		(1 << I40E_AQ_FLAG_RD_SHIFT)  /* 0x400  */
95*61ae650dSJack F Vogel #define I40E_AQ_FLAG_VFC	(1 << I40E_AQ_FLAG_VFC_SHIFT) /* 0x800  */
96*61ae650dSJack F Vogel #define I40E_AQ_FLAG_BUF	(1 << I40E_AQ_FLAG_BUF_SHIFT) /* 0x1000 */
97*61ae650dSJack F Vogel #define I40E_AQ_FLAG_SI		(1 << I40E_AQ_FLAG_SI_SHIFT)  /* 0x2000 */
98*61ae650dSJack F Vogel #define I40E_AQ_FLAG_EI		(1 << I40E_AQ_FLAG_EI_SHIFT)  /* 0x4000 */
99*61ae650dSJack F Vogel #define I40E_AQ_FLAG_FE		(1 << I40E_AQ_FLAG_FE_SHIFT)  /* 0x8000 */
100*61ae650dSJack F Vogel 
101*61ae650dSJack F Vogel /* error codes */
102*61ae650dSJack F Vogel enum i40e_admin_queue_err {
103*61ae650dSJack F Vogel 	I40E_AQ_RC_OK		= 0,  /* success */
104*61ae650dSJack F Vogel 	I40E_AQ_RC_EPERM	= 1,  /* Operation not permitted */
105*61ae650dSJack F Vogel 	I40E_AQ_RC_ENOENT	= 2,  /* No such element */
106*61ae650dSJack F Vogel 	I40E_AQ_RC_ESRCH	= 3,  /* Bad opcode */
107*61ae650dSJack F Vogel 	I40E_AQ_RC_EINTR	= 4,  /* operation interrupted */
108*61ae650dSJack F Vogel 	I40E_AQ_RC_EIO		= 5,  /* I/O error */
109*61ae650dSJack F Vogel 	I40E_AQ_RC_ENXIO	= 6,  /* No such resource */
110*61ae650dSJack F Vogel 	I40E_AQ_RC_E2BIG	= 7,  /* Arg too long */
111*61ae650dSJack F Vogel 	I40E_AQ_RC_EAGAIN	= 8,  /* Try again */
112*61ae650dSJack F Vogel 	I40E_AQ_RC_ENOMEM	= 9,  /* Out of memory */
113*61ae650dSJack F Vogel 	I40E_AQ_RC_EACCES	= 10, /* Permission denied */
114*61ae650dSJack F Vogel 	I40E_AQ_RC_EFAULT	= 11, /* Bad address */
115*61ae650dSJack F Vogel 	I40E_AQ_RC_EBUSY	= 12, /* Device or resource busy */
116*61ae650dSJack F Vogel 	I40E_AQ_RC_EEXIST	= 13, /* object already exists */
117*61ae650dSJack F Vogel 	I40E_AQ_RC_EINVAL	= 14, /* Invalid argument */
118*61ae650dSJack F Vogel 	I40E_AQ_RC_ENOTTY	= 15, /* Not a typewriter */
119*61ae650dSJack F Vogel 	I40E_AQ_RC_ENOSPC	= 16, /* No space left or alloc failure */
120*61ae650dSJack F Vogel 	I40E_AQ_RC_ENOSYS	= 17, /* Function not implemented */
121*61ae650dSJack F Vogel 	I40E_AQ_RC_ERANGE	= 18, /* Parameter out of range */
122*61ae650dSJack F Vogel 	I40E_AQ_RC_EFLUSHED	= 19, /* Cmd flushed due to prev cmd error */
123*61ae650dSJack F Vogel 	I40E_AQ_RC_BAD_ADDR	= 20, /* Descriptor contains a bad pointer */
124*61ae650dSJack F Vogel 	I40E_AQ_RC_EMODE	= 21, /* Op not allowed in current dev mode */
125*61ae650dSJack F Vogel 	I40E_AQ_RC_EFBIG	= 22, /* File too large */
126*61ae650dSJack F Vogel };
127*61ae650dSJack F Vogel 
128*61ae650dSJack F Vogel /* Admin Queue command opcodes */
129*61ae650dSJack F Vogel enum i40e_admin_queue_opc {
130*61ae650dSJack F Vogel 	/* aq commands */
131*61ae650dSJack F Vogel 	i40e_aqc_opc_get_version	= 0x0001,
132*61ae650dSJack F Vogel 	i40e_aqc_opc_driver_version	= 0x0002,
133*61ae650dSJack F Vogel 	i40e_aqc_opc_queue_shutdown	= 0x0003,
134*61ae650dSJack F Vogel 	i40e_aqc_opc_set_pf_context	= 0x0004,
135*61ae650dSJack F Vogel 
136*61ae650dSJack F Vogel 	/* resource ownership */
137*61ae650dSJack F Vogel 	i40e_aqc_opc_request_resource	= 0x0008,
138*61ae650dSJack F Vogel 	i40e_aqc_opc_release_resource	= 0x0009,
139*61ae650dSJack F Vogel 
140*61ae650dSJack F Vogel 	i40e_aqc_opc_list_func_capabilities	= 0x000A,
141*61ae650dSJack F Vogel 	i40e_aqc_opc_list_dev_capabilities	= 0x000B,
142*61ae650dSJack F Vogel 
143*61ae650dSJack F Vogel 	i40e_aqc_opc_set_cppm_configuration	= 0x0103,
144*61ae650dSJack F Vogel 	i40e_aqc_opc_set_arp_proxy_entry	= 0x0104,
145*61ae650dSJack F Vogel 	i40e_aqc_opc_set_ns_proxy_entry		= 0x0105,
146*61ae650dSJack F Vogel 
147*61ae650dSJack F Vogel 	/* LAA */
148*61ae650dSJack F Vogel 	i40e_aqc_opc_mng_laa		= 0x0106,   /* AQ obsolete */
149*61ae650dSJack F Vogel 	i40e_aqc_opc_mac_address_read	= 0x0107,
150*61ae650dSJack F Vogel 	i40e_aqc_opc_mac_address_write	= 0x0108,
151*61ae650dSJack F Vogel 
152*61ae650dSJack F Vogel 	/* PXE */
153*61ae650dSJack F Vogel 	i40e_aqc_opc_clear_pxe_mode	= 0x0110,
154*61ae650dSJack F Vogel 
155*61ae650dSJack F Vogel 	/* internal switch commands */
156*61ae650dSJack F Vogel 	i40e_aqc_opc_get_switch_config		= 0x0200,
157*61ae650dSJack F Vogel 	i40e_aqc_opc_add_statistics		= 0x0201,
158*61ae650dSJack F Vogel 	i40e_aqc_opc_remove_statistics		= 0x0202,
159*61ae650dSJack F Vogel 	i40e_aqc_opc_set_port_parameters	= 0x0203,
160*61ae650dSJack F Vogel 	i40e_aqc_opc_get_switch_resource_alloc	= 0x0204,
161*61ae650dSJack F Vogel 
162*61ae650dSJack F Vogel 	i40e_aqc_opc_add_vsi			= 0x0210,
163*61ae650dSJack F Vogel 	i40e_aqc_opc_update_vsi_parameters	= 0x0211,
164*61ae650dSJack F Vogel 	i40e_aqc_opc_get_vsi_parameters		= 0x0212,
165*61ae650dSJack F Vogel 
166*61ae650dSJack F Vogel 	i40e_aqc_opc_add_pv			= 0x0220,
167*61ae650dSJack F Vogel 	i40e_aqc_opc_update_pv_parameters	= 0x0221,
168*61ae650dSJack F Vogel 	i40e_aqc_opc_get_pv_parameters		= 0x0222,
169*61ae650dSJack F Vogel 
170*61ae650dSJack F Vogel 	i40e_aqc_opc_add_veb			= 0x0230,
171*61ae650dSJack F Vogel 	i40e_aqc_opc_update_veb_parameters	= 0x0231,
172*61ae650dSJack F Vogel 	i40e_aqc_opc_get_veb_parameters		= 0x0232,
173*61ae650dSJack F Vogel 
174*61ae650dSJack F Vogel 	i40e_aqc_opc_delete_element		= 0x0243,
175*61ae650dSJack F Vogel 
176*61ae650dSJack F Vogel 	i40e_aqc_opc_add_macvlan		= 0x0250,
177*61ae650dSJack F Vogel 	i40e_aqc_opc_remove_macvlan		= 0x0251,
178*61ae650dSJack F Vogel 	i40e_aqc_opc_add_vlan			= 0x0252,
179*61ae650dSJack F Vogel 	i40e_aqc_opc_remove_vlan		= 0x0253,
180*61ae650dSJack F Vogel 	i40e_aqc_opc_set_vsi_promiscuous_modes	= 0x0254,
181*61ae650dSJack F Vogel 	i40e_aqc_opc_add_tag			= 0x0255,
182*61ae650dSJack F Vogel 	i40e_aqc_opc_remove_tag			= 0x0256,
183*61ae650dSJack F Vogel 	i40e_aqc_opc_add_multicast_etag		= 0x0257,
184*61ae650dSJack F Vogel 	i40e_aqc_opc_remove_multicast_etag	= 0x0258,
185*61ae650dSJack F Vogel 	i40e_aqc_opc_update_tag			= 0x0259,
186*61ae650dSJack F Vogel 	i40e_aqc_opc_add_control_packet_filter	= 0x025A,
187*61ae650dSJack F Vogel 	i40e_aqc_opc_remove_control_packet_filter	= 0x025B,
188*61ae650dSJack F Vogel 	i40e_aqc_opc_add_cloud_filters		= 0x025C,
189*61ae650dSJack F Vogel 	i40e_aqc_opc_remove_cloud_filters	= 0x025D,
190*61ae650dSJack F Vogel 
191*61ae650dSJack F Vogel 	i40e_aqc_opc_add_mirror_rule	= 0x0260,
192*61ae650dSJack F Vogel 	i40e_aqc_opc_delete_mirror_rule	= 0x0261,
193*61ae650dSJack F Vogel 
194*61ae650dSJack F Vogel 	/* DCB commands */
195*61ae650dSJack F Vogel 	i40e_aqc_opc_dcb_ignore_pfc	= 0x0301,
196*61ae650dSJack F Vogel 	i40e_aqc_opc_dcb_updated	= 0x0302,
197*61ae650dSJack F Vogel 
198*61ae650dSJack F Vogel 	/* TX scheduler */
199*61ae650dSJack F Vogel 	i40e_aqc_opc_configure_vsi_bw_limit		= 0x0400,
200*61ae650dSJack F Vogel 	i40e_aqc_opc_configure_vsi_ets_sla_bw_limit	= 0x0406,
201*61ae650dSJack F Vogel 	i40e_aqc_opc_configure_vsi_tc_bw		= 0x0407,
202*61ae650dSJack F Vogel 	i40e_aqc_opc_query_vsi_bw_config		= 0x0408,
203*61ae650dSJack F Vogel 	i40e_aqc_opc_query_vsi_ets_sla_config		= 0x040A,
204*61ae650dSJack F Vogel 	i40e_aqc_opc_configure_switching_comp_bw_limit	= 0x0410,
205*61ae650dSJack F Vogel 
206*61ae650dSJack F Vogel 	i40e_aqc_opc_enable_switching_comp_ets			= 0x0413,
207*61ae650dSJack F Vogel 	i40e_aqc_opc_modify_switching_comp_ets			= 0x0414,
208*61ae650dSJack F Vogel 	i40e_aqc_opc_disable_switching_comp_ets			= 0x0415,
209*61ae650dSJack F Vogel 	i40e_aqc_opc_configure_switching_comp_ets_bw_limit	= 0x0416,
210*61ae650dSJack F Vogel 	i40e_aqc_opc_configure_switching_comp_bw_config		= 0x0417,
211*61ae650dSJack F Vogel 	i40e_aqc_opc_query_switching_comp_ets_config		= 0x0418,
212*61ae650dSJack F Vogel 	i40e_aqc_opc_query_port_ets_config			= 0x0419,
213*61ae650dSJack F Vogel 	i40e_aqc_opc_query_switching_comp_bw_config		= 0x041A,
214*61ae650dSJack F Vogel 	i40e_aqc_opc_suspend_port_tx				= 0x041B,
215*61ae650dSJack F Vogel 	i40e_aqc_opc_resume_port_tx				= 0x041C,
216*61ae650dSJack F Vogel 	i40e_aqc_opc_configure_partition_bw			= 0x041D,
217*61ae650dSJack F Vogel 
218*61ae650dSJack F Vogel 	/* hmc */
219*61ae650dSJack F Vogel 	i40e_aqc_opc_query_hmc_resource_profile	= 0x0500,
220*61ae650dSJack F Vogel 	i40e_aqc_opc_set_hmc_resource_profile	= 0x0501,
221*61ae650dSJack F Vogel 
222*61ae650dSJack F Vogel 	/* phy commands*/
223*61ae650dSJack F Vogel 	i40e_aqc_opc_get_phy_abilities		= 0x0600,
224*61ae650dSJack F Vogel 	i40e_aqc_opc_set_phy_config		= 0x0601,
225*61ae650dSJack F Vogel 	i40e_aqc_opc_set_mac_config		= 0x0603,
226*61ae650dSJack F Vogel 	i40e_aqc_opc_set_link_restart_an	= 0x0605,
227*61ae650dSJack F Vogel 	i40e_aqc_opc_get_link_status		= 0x0607,
228*61ae650dSJack F Vogel 	i40e_aqc_opc_set_phy_int_mask		= 0x0613,
229*61ae650dSJack F Vogel 	i40e_aqc_opc_get_local_advt_reg		= 0x0614,
230*61ae650dSJack F Vogel 	i40e_aqc_opc_set_local_advt_reg		= 0x0615,
231*61ae650dSJack F Vogel 	i40e_aqc_opc_get_partner_advt		= 0x0616,
232*61ae650dSJack F Vogel 	i40e_aqc_opc_set_lb_modes		= 0x0618,
233*61ae650dSJack F Vogel 	i40e_aqc_opc_get_phy_wol_caps		= 0x0621,
234*61ae650dSJack F Vogel 	i40e_aqc_opc_set_phy_debug		= 0x0622,
235*61ae650dSJack F Vogel 	i40e_aqc_opc_upload_ext_phy_fm		= 0x0625,
236*61ae650dSJack F Vogel 
237*61ae650dSJack F Vogel 	/* NVM commands */
238*61ae650dSJack F Vogel 	i40e_aqc_opc_nvm_read			= 0x0701,
239*61ae650dSJack F Vogel 	i40e_aqc_opc_nvm_erase			= 0x0702,
240*61ae650dSJack F Vogel 	i40e_aqc_opc_nvm_update			= 0x0703,
241*61ae650dSJack F Vogel 	i40e_aqc_opc_nvm_config_read		= 0x0704,
242*61ae650dSJack F Vogel 	i40e_aqc_opc_nvm_config_write		= 0x0705,
243*61ae650dSJack F Vogel 
244*61ae650dSJack F Vogel 	/* virtualization commands */
245*61ae650dSJack F Vogel 	i40e_aqc_opc_send_msg_to_pf		= 0x0801,
246*61ae650dSJack F Vogel 	i40e_aqc_opc_send_msg_to_vf		= 0x0802,
247*61ae650dSJack F Vogel 	i40e_aqc_opc_send_msg_to_peer		= 0x0803,
248*61ae650dSJack F Vogel 
249*61ae650dSJack F Vogel 	/* alternate structure */
250*61ae650dSJack F Vogel 	i40e_aqc_opc_alternate_write		= 0x0900,
251*61ae650dSJack F Vogel 	i40e_aqc_opc_alternate_write_indirect	= 0x0901,
252*61ae650dSJack F Vogel 	i40e_aqc_opc_alternate_read		= 0x0902,
253*61ae650dSJack F Vogel 	i40e_aqc_opc_alternate_read_indirect	= 0x0903,
254*61ae650dSJack F Vogel 	i40e_aqc_opc_alternate_write_done	= 0x0904,
255*61ae650dSJack F Vogel 	i40e_aqc_opc_alternate_set_mode		= 0x0905,
256*61ae650dSJack F Vogel 	i40e_aqc_opc_alternate_clear_port	= 0x0906,
257*61ae650dSJack F Vogel 
258*61ae650dSJack F Vogel 	/* LLDP commands */
259*61ae650dSJack F Vogel 	i40e_aqc_opc_lldp_get_mib	= 0x0A00,
260*61ae650dSJack F Vogel 	i40e_aqc_opc_lldp_update_mib	= 0x0A01,
261*61ae650dSJack F Vogel 	i40e_aqc_opc_lldp_add_tlv	= 0x0A02,
262*61ae650dSJack F Vogel 	i40e_aqc_opc_lldp_update_tlv	= 0x0A03,
263*61ae650dSJack F Vogel 	i40e_aqc_opc_lldp_delete_tlv	= 0x0A04,
264*61ae650dSJack F Vogel 	i40e_aqc_opc_lldp_stop		= 0x0A05,
265*61ae650dSJack F Vogel 	i40e_aqc_opc_lldp_start		= 0x0A06,
266*61ae650dSJack F Vogel 
267*61ae650dSJack F Vogel 	/* Tunnel commands */
268*61ae650dSJack F Vogel 	i40e_aqc_opc_add_udp_tunnel	= 0x0B00,
269*61ae650dSJack F Vogel 	i40e_aqc_opc_del_udp_tunnel	= 0x0B01,
270*61ae650dSJack F Vogel 	i40e_aqc_opc_tunnel_key_structure	= 0x0B10,
271*61ae650dSJack F Vogel 
272*61ae650dSJack F Vogel 	/* Async Events */
273*61ae650dSJack F Vogel 	i40e_aqc_opc_event_lan_overflow		= 0x1001,
274*61ae650dSJack F Vogel 
275*61ae650dSJack F Vogel 	/* OEM commands */
276*61ae650dSJack F Vogel 	i40e_aqc_opc_oem_parameter_change	= 0xFE00,
277*61ae650dSJack F Vogel 	i40e_aqc_opc_oem_device_status_change	= 0xFE01,
278*61ae650dSJack F Vogel 
279*61ae650dSJack F Vogel 	/* debug commands */
280*61ae650dSJack F Vogel 	i40e_aqc_opc_debug_get_deviceid		= 0xFF00,
281*61ae650dSJack F Vogel 	i40e_aqc_opc_debug_set_mode		= 0xFF01,
282*61ae650dSJack F Vogel 	i40e_aqc_opc_debug_read_reg		= 0xFF03,
283*61ae650dSJack F Vogel 	i40e_aqc_opc_debug_write_reg		= 0xFF04,
284*61ae650dSJack F Vogel 	i40e_aqc_opc_debug_modify_reg		= 0xFF07,
285*61ae650dSJack F Vogel 	i40e_aqc_opc_debug_dump_internals	= 0xFF08,
286*61ae650dSJack F Vogel 	i40e_aqc_opc_debug_modify_internals	= 0xFF09,
287*61ae650dSJack F Vogel };
288*61ae650dSJack F Vogel 
289*61ae650dSJack F Vogel /* command structures and indirect data structures */
290*61ae650dSJack F Vogel 
291*61ae650dSJack F Vogel /* Structure naming conventions:
292*61ae650dSJack F Vogel  * - no suffix for direct command descriptor structures
293*61ae650dSJack F Vogel  * - _data for indirect sent data
294*61ae650dSJack F Vogel  * - _resp for indirect return data (data which is both will use _data)
295*61ae650dSJack F Vogel  * - _completion for direct return data
296*61ae650dSJack F Vogel  * - _element_ for repeated elements (may also be _data or _resp)
297*61ae650dSJack F Vogel  *
298*61ae650dSJack F Vogel  * Command structures are expected to overlay the params.raw member of the basic
299*61ae650dSJack F Vogel  * descriptor, and as such cannot exceed 16 bytes in length.
300*61ae650dSJack F Vogel  */
301*61ae650dSJack F Vogel 
302*61ae650dSJack F Vogel /* This macro is used to generate a compilation error if a structure
303*61ae650dSJack F Vogel  * is not exactly the correct length. It gives a divide by zero error if the
304*61ae650dSJack F Vogel  * structure is not of the correct size, otherwise it creates an enum that is
305*61ae650dSJack F Vogel  * never used.
306*61ae650dSJack F Vogel  */
307*61ae650dSJack F Vogel #define I40E_CHECK_STRUCT_LEN(n, X) enum i40e_static_assert_enum_##X \
308*61ae650dSJack F Vogel 	{ i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
309*61ae650dSJack F Vogel 
310*61ae650dSJack F Vogel /* This macro is used extensively to ensure that command structures are 16
311*61ae650dSJack F Vogel  * bytes in length as they have to map to the raw array of that size.
312*61ae650dSJack F Vogel  */
313*61ae650dSJack F Vogel #define I40E_CHECK_CMD_LENGTH(X)	I40E_CHECK_STRUCT_LEN(16, X)
314*61ae650dSJack F Vogel 
315*61ae650dSJack F Vogel /* internal (0x00XX) commands */
316*61ae650dSJack F Vogel 
317*61ae650dSJack F Vogel /* Get version (direct 0x0001) */
318*61ae650dSJack F Vogel struct i40e_aqc_get_version {
319*61ae650dSJack F Vogel 	__le32 rom_ver;
320*61ae650dSJack F Vogel 	__le32 fw_build;
321*61ae650dSJack F Vogel 	__le16 fw_major;
322*61ae650dSJack F Vogel 	__le16 fw_minor;
323*61ae650dSJack F Vogel 	__le16 api_major;
324*61ae650dSJack F Vogel 	__le16 api_minor;
325*61ae650dSJack F Vogel };
326*61ae650dSJack F Vogel 
327*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_version);
328*61ae650dSJack F Vogel 
329*61ae650dSJack F Vogel /* Send driver version (indirect 0x0002) */
330*61ae650dSJack F Vogel struct i40e_aqc_driver_version {
331*61ae650dSJack F Vogel 	u8	driver_major_ver;
332*61ae650dSJack F Vogel 	u8	driver_minor_ver;
333*61ae650dSJack F Vogel 	u8	driver_build_ver;
334*61ae650dSJack F Vogel 	u8	driver_subbuild_ver;
335*61ae650dSJack F Vogel 	u8	reserved[4];
336*61ae650dSJack F Vogel 	__le32	address_high;
337*61ae650dSJack F Vogel 	__le32	address_low;
338*61ae650dSJack F Vogel };
339*61ae650dSJack F Vogel 
340*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_driver_version);
341*61ae650dSJack F Vogel 
342*61ae650dSJack F Vogel /* Queue Shutdown (direct 0x0003) */
343*61ae650dSJack F Vogel struct i40e_aqc_queue_shutdown {
344*61ae650dSJack F Vogel 	__le32	driver_unloading;
345*61ae650dSJack F Vogel #define I40E_AQ_DRIVER_UNLOADING	0x1
346*61ae650dSJack F Vogel 	u8	reserved[12];
347*61ae650dSJack F Vogel };
348*61ae650dSJack F Vogel 
349*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_queue_shutdown);
350*61ae650dSJack F Vogel 
351*61ae650dSJack F Vogel /* Set PF context (0x0004, direct) */
352*61ae650dSJack F Vogel struct i40e_aqc_set_pf_context {
353*61ae650dSJack F Vogel 	u8	pf_id;
354*61ae650dSJack F Vogel 	u8	reserved[15];
355*61ae650dSJack F Vogel };
356*61ae650dSJack F Vogel 
357*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_pf_context);
358*61ae650dSJack F Vogel 
359*61ae650dSJack F Vogel /* Request resource ownership (direct 0x0008)
360*61ae650dSJack F Vogel  * Release resource ownership (direct 0x0009)
361*61ae650dSJack F Vogel  */
362*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_NVM			1
363*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_SDP			2
364*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_ACCESS_READ		1
365*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_ACCESS_WRITE		2
366*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_NVM_READ_TIMEOUT	3000
367*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_NVM_WRITE_TIMEOUT	180000
368*61ae650dSJack F Vogel 
369*61ae650dSJack F Vogel struct i40e_aqc_request_resource {
370*61ae650dSJack F Vogel 	__le16	resource_id;
371*61ae650dSJack F Vogel 	__le16	access_type;
372*61ae650dSJack F Vogel 	__le32	timeout;
373*61ae650dSJack F Vogel 	__le32	resource_number;
374*61ae650dSJack F Vogel 	u8	reserved[4];
375*61ae650dSJack F Vogel };
376*61ae650dSJack F Vogel 
377*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_request_resource);
378*61ae650dSJack F Vogel 
379*61ae650dSJack F Vogel /* Get function capabilities (indirect 0x000A)
380*61ae650dSJack F Vogel  * Get device capabilities (indirect 0x000B)
381*61ae650dSJack F Vogel  */
382*61ae650dSJack F Vogel struct i40e_aqc_list_capabilites {
383*61ae650dSJack F Vogel 	u8 command_flags;
384*61ae650dSJack F Vogel #define I40E_AQ_LIST_CAP_PF_INDEX_EN	1
385*61ae650dSJack F Vogel 	u8 pf_index;
386*61ae650dSJack F Vogel 	u8 reserved[2];
387*61ae650dSJack F Vogel 	__le32 count;
388*61ae650dSJack F Vogel 	__le32 addr_high;
389*61ae650dSJack F Vogel 	__le32 addr_low;
390*61ae650dSJack F Vogel };
391*61ae650dSJack F Vogel 
392*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_list_capabilites);
393*61ae650dSJack F Vogel 
394*61ae650dSJack F Vogel struct i40e_aqc_list_capabilities_element_resp {
395*61ae650dSJack F Vogel 	__le16	id;
396*61ae650dSJack F Vogel 	u8	major_rev;
397*61ae650dSJack F Vogel 	u8	minor_rev;
398*61ae650dSJack F Vogel 	__le32	number;
399*61ae650dSJack F Vogel 	__le32	logical_id;
400*61ae650dSJack F Vogel 	__le32	phys_id;
401*61ae650dSJack F Vogel 	u8	reserved[16];
402*61ae650dSJack F Vogel };
403*61ae650dSJack F Vogel 
404*61ae650dSJack F Vogel /* list of caps */
405*61ae650dSJack F Vogel 
406*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_SWITCH_MODE	0x0001
407*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_MNG_MODE		0x0002
408*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_NPAR_ACTIVE	0x0003
409*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_OS2BMC_CAP	0x0004
410*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_FUNCTIONS_VALID	0x0005
411*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_ALTERNATE_RAM	0x0006
412*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_SRIOV		0x0012
413*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_VF		0x0013
414*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_VMDQ		0x0014
415*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_8021QBG		0x0015
416*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_8021QBR		0x0016
417*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_VSI		0x0017
418*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_DCB		0x0018
419*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_FCOE		0x0021
420*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_RSS		0x0040
421*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_RXQ		0x0041
422*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_TXQ		0x0042
423*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_MSIX		0x0043
424*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_VF_MSIX		0x0044
425*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_FLOW_DIRECTOR	0x0045
426*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_1588		0x0046
427*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_IWARP		0x0051
428*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_LED		0x0061
429*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_SDP		0x0062
430*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_MDIO		0x0063
431*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_FLEX10		0x00F1
432*61ae650dSJack F Vogel #define I40E_AQ_CAP_ID_CEM		0x00F2
433*61ae650dSJack F Vogel 
434*61ae650dSJack F Vogel /* Set CPPM Configuration (direct 0x0103) */
435*61ae650dSJack F Vogel struct i40e_aqc_cppm_configuration {
436*61ae650dSJack F Vogel 	__le16	command_flags;
437*61ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_LTRC	0x0800
438*61ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_DMCTH	0x1000
439*61ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_DMCTLX	0x2000
440*61ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_HPTC	0x4000
441*61ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_DMARC	0x8000
442*61ae650dSJack F Vogel 	__le16	ttlx;
443*61ae650dSJack F Vogel 	__le32	dmacr;
444*61ae650dSJack F Vogel 	__le16	dmcth;
445*61ae650dSJack F Vogel 	u8	hptc;
446*61ae650dSJack F Vogel 	u8	reserved;
447*61ae650dSJack F Vogel 	__le32	pfltrc;
448*61ae650dSJack F Vogel };
449*61ae650dSJack F Vogel 
450*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration);
451*61ae650dSJack F Vogel 
452*61ae650dSJack F Vogel /* Set ARP Proxy command / response (indirect 0x0104) */
453*61ae650dSJack F Vogel struct i40e_aqc_arp_proxy_data {
454*61ae650dSJack F Vogel 	__le16	command_flags;
455*61ae650dSJack F Vogel #define I40E_AQ_ARP_INIT_IPV4	0x0008
456*61ae650dSJack F Vogel #define I40E_AQ_ARP_UNSUP_CTL	0x0010
457*61ae650dSJack F Vogel #define I40E_AQ_ARP_ENA		0x0020
458*61ae650dSJack F Vogel #define I40E_AQ_ARP_ADD_IPV4	0x0040
459*61ae650dSJack F Vogel #define I40E_AQ_ARP_DEL_IPV4	0x0080
460*61ae650dSJack F Vogel 	__le16	table_id;
461*61ae650dSJack F Vogel 	__le32	pfpm_proxyfc;
462*61ae650dSJack F Vogel 	__le32	ip_addr;
463*61ae650dSJack F Vogel 	u8	mac_addr[6];
464*61ae650dSJack F Vogel };
465*61ae650dSJack F Vogel 
466*61ae650dSJack F Vogel /* Set NS Proxy Table Entry Command (indirect 0x0105) */
467*61ae650dSJack F Vogel struct i40e_aqc_ns_proxy_data {
468*61ae650dSJack F Vogel 	__le16	table_idx_mac_addr_0;
469*61ae650dSJack F Vogel 	__le16	table_idx_mac_addr_1;
470*61ae650dSJack F Vogel 	__le16	table_idx_ipv6_0;
471*61ae650dSJack F Vogel 	__le16	table_idx_ipv6_1;
472*61ae650dSJack F Vogel 	__le16	control;
473*61ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_ADD_0		0x0100
474*61ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_DEL_0		0x0200
475*61ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_ADD_1		0x0400
476*61ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_DEL_1		0x0800
477*61ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_ADD_IPV6_0	0x1000
478*61ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_DEL_IPV6_0	0x2000
479*61ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_ADD_IPV6_1	0x4000
480*61ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_DEL_IPV6_1	0x8000
481*61ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_COMMAND_SEQ	0x0001
482*61ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_INIT_IPV6_TBL	0x0002
483*61ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_INIT_MAC_TBL	0x0004
484*61ae650dSJack F Vogel 	u8	mac_addr_0[6];
485*61ae650dSJack F Vogel 	u8	mac_addr_1[6];
486*61ae650dSJack F Vogel 	u8	local_mac_addr[6];
487*61ae650dSJack F Vogel 	u8	ipv6_addr_0[16]; /* Warning! spec specifies BE byte order */
488*61ae650dSJack F Vogel 	u8	ipv6_addr_1[16];
489*61ae650dSJack F Vogel };
490*61ae650dSJack F Vogel 
491*61ae650dSJack F Vogel /* Manage LAA Command (0x0106) - obsolete */
492*61ae650dSJack F Vogel struct i40e_aqc_mng_laa {
493*61ae650dSJack F Vogel 	__le16	command_flags;
494*61ae650dSJack F Vogel #define I40E_AQ_LAA_FLAG_WR	0x8000
495*61ae650dSJack F Vogel 	u8	reserved[2];
496*61ae650dSJack F Vogel 	__le32	sal;
497*61ae650dSJack F Vogel 	__le16	sah;
498*61ae650dSJack F Vogel 	u8	reserved2[6];
499*61ae650dSJack F Vogel };
500*61ae650dSJack F Vogel 
501*61ae650dSJack F Vogel /* Manage MAC Address Read Command (indirect 0x0107) */
502*61ae650dSJack F Vogel struct i40e_aqc_mac_address_read {
503*61ae650dSJack F Vogel 	__le16	command_flags;
504*61ae650dSJack F Vogel #define I40E_AQC_LAN_ADDR_VALID		0x10
505*61ae650dSJack F Vogel #define I40E_AQC_SAN_ADDR_VALID		0x20
506*61ae650dSJack F Vogel #define I40E_AQC_PORT_ADDR_VALID	0x40
507*61ae650dSJack F Vogel #define I40E_AQC_WOL_ADDR_VALID		0x80
508*61ae650dSJack F Vogel #define I40E_AQC_ADDR_VALID_MASK	0xf0
509*61ae650dSJack F Vogel 	u8	reserved[6];
510*61ae650dSJack F Vogel 	__le32	addr_high;
511*61ae650dSJack F Vogel 	__le32	addr_low;
512*61ae650dSJack F Vogel };
513*61ae650dSJack F Vogel 
514*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_mac_address_read);
515*61ae650dSJack F Vogel 
516*61ae650dSJack F Vogel struct i40e_aqc_mac_address_read_data {
517*61ae650dSJack F Vogel 	u8 pf_lan_mac[6];
518*61ae650dSJack F Vogel 	u8 pf_san_mac[6];
519*61ae650dSJack F Vogel 	u8 port_mac[6];
520*61ae650dSJack F Vogel 	u8 pf_wol_mac[6];
521*61ae650dSJack F Vogel };
522*61ae650dSJack F Vogel 
523*61ae650dSJack F Vogel I40E_CHECK_STRUCT_LEN(24, i40e_aqc_mac_address_read_data);
524*61ae650dSJack F Vogel 
525*61ae650dSJack F Vogel /* Manage MAC Address Write Command (0x0108) */
526*61ae650dSJack F Vogel struct i40e_aqc_mac_address_write {
527*61ae650dSJack F Vogel 	__le16	command_flags;
528*61ae650dSJack F Vogel #define I40E_AQC_WRITE_TYPE_LAA_ONLY	0x0000
529*61ae650dSJack F Vogel #define I40E_AQC_WRITE_TYPE_LAA_WOL	0x4000
530*61ae650dSJack F Vogel #define I40E_AQC_WRITE_TYPE_PORT	0x8000
531*61ae650dSJack F Vogel #define I40E_AQC_WRITE_TYPE_MASK	0xc000
532*61ae650dSJack F Vogel 	__le16	mac_sah;
533*61ae650dSJack F Vogel 	__le32	mac_sal;
534*61ae650dSJack F Vogel 	u8	reserved[8];
535*61ae650dSJack F Vogel };
536*61ae650dSJack F Vogel 
537*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_mac_address_write);
538*61ae650dSJack F Vogel 
539*61ae650dSJack F Vogel /* PXE commands (0x011x) */
540*61ae650dSJack F Vogel 
541*61ae650dSJack F Vogel /* Clear PXE Command and response  (direct 0x0110) */
542*61ae650dSJack F Vogel struct i40e_aqc_clear_pxe {
543*61ae650dSJack F Vogel 	u8	rx_cnt;
544*61ae650dSJack F Vogel 	u8	reserved[15];
545*61ae650dSJack F Vogel };
546*61ae650dSJack F Vogel 
547*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_clear_pxe);
548*61ae650dSJack F Vogel 
549*61ae650dSJack F Vogel /* Switch configuration commands (0x02xx) */
550*61ae650dSJack F Vogel 
551*61ae650dSJack F Vogel /* Used by many indirect commands that only pass an seid and a buffer in the
552*61ae650dSJack F Vogel  * command
553*61ae650dSJack F Vogel  */
554*61ae650dSJack F Vogel struct i40e_aqc_switch_seid {
555*61ae650dSJack F Vogel 	__le16	seid;
556*61ae650dSJack F Vogel 	u8	reserved[6];
557*61ae650dSJack F Vogel 	__le32	addr_high;
558*61ae650dSJack F Vogel 	__le32	addr_low;
559*61ae650dSJack F Vogel };
560*61ae650dSJack F Vogel 
561*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_switch_seid);
562*61ae650dSJack F Vogel 
563*61ae650dSJack F Vogel /* Get Switch Configuration command (indirect 0x0200)
564*61ae650dSJack F Vogel  * uses i40e_aqc_switch_seid for the descriptor
565*61ae650dSJack F Vogel  */
566*61ae650dSJack F Vogel struct i40e_aqc_get_switch_config_header_resp {
567*61ae650dSJack F Vogel 	__le16	num_reported;
568*61ae650dSJack F Vogel 	__le16	num_total;
569*61ae650dSJack F Vogel 	u8	reserved[12];
570*61ae650dSJack F Vogel };
571*61ae650dSJack F Vogel 
572*61ae650dSJack F Vogel struct i40e_aqc_switch_config_element_resp {
573*61ae650dSJack F Vogel 	u8	element_type;
574*61ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_MAC	1
575*61ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_PF		2
576*61ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_VF		3
577*61ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_EMP	4
578*61ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_BMC	5
579*61ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_PV		16
580*61ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_VEB	17
581*61ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_PA		18
582*61ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_VSI	19
583*61ae650dSJack F Vogel 	u8	revision;
584*61ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_REV_1		1
585*61ae650dSJack F Vogel 	__le16	seid;
586*61ae650dSJack F Vogel 	__le16	uplink_seid;
587*61ae650dSJack F Vogel 	__le16	downlink_seid;
588*61ae650dSJack F Vogel 	u8	reserved[3];
589*61ae650dSJack F Vogel 	u8	connection_type;
590*61ae650dSJack F Vogel #define I40E_AQ_CONN_TYPE_REGULAR	0x1
591*61ae650dSJack F Vogel #define I40E_AQ_CONN_TYPE_DEFAULT	0x2
592*61ae650dSJack F Vogel #define I40E_AQ_CONN_TYPE_CASCADED	0x3
593*61ae650dSJack F Vogel 	__le16	scheduler_id;
594*61ae650dSJack F Vogel 	__le16	element_info;
595*61ae650dSJack F Vogel };
596*61ae650dSJack F Vogel 
597*61ae650dSJack F Vogel /* Get Switch Configuration (indirect 0x0200)
598*61ae650dSJack F Vogel  *    an array of elements are returned in the response buffer
599*61ae650dSJack F Vogel  *    the first in the array is the header, remainder are elements
600*61ae650dSJack F Vogel  */
601*61ae650dSJack F Vogel struct i40e_aqc_get_switch_config_resp {
602*61ae650dSJack F Vogel 	struct i40e_aqc_get_switch_config_header_resp	header;
603*61ae650dSJack F Vogel 	struct i40e_aqc_switch_config_element_resp	element[1];
604*61ae650dSJack F Vogel };
605*61ae650dSJack F Vogel 
606*61ae650dSJack F Vogel /* Add Statistics (direct 0x0201)
607*61ae650dSJack F Vogel  * Remove Statistics (direct 0x0202)
608*61ae650dSJack F Vogel  */
609*61ae650dSJack F Vogel struct i40e_aqc_add_remove_statistics {
610*61ae650dSJack F Vogel 	__le16	seid;
611*61ae650dSJack F Vogel 	__le16	vlan;
612*61ae650dSJack F Vogel 	__le16	stat_index;
613*61ae650dSJack F Vogel 	u8	reserved[10];
614*61ae650dSJack F Vogel };
615*61ae650dSJack F Vogel 
616*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_statistics);
617*61ae650dSJack F Vogel 
618*61ae650dSJack F Vogel /* Set Port Parameters command (direct 0x0203) */
619*61ae650dSJack F Vogel struct i40e_aqc_set_port_parameters {
620*61ae650dSJack F Vogel 	__le16	command_flags;
621*61ae650dSJack F Vogel #define I40E_AQ_SET_P_PARAMS_SAVE_BAD_PACKETS	1
622*61ae650dSJack F Vogel #define I40E_AQ_SET_P_PARAMS_PAD_SHORT_PACKETS	2 /* must set! */
623*61ae650dSJack F Vogel #define I40E_AQ_SET_P_PARAMS_DOUBLE_VLAN_ENA	4
624*61ae650dSJack F Vogel 	__le16	bad_frame_vsi;
625*61ae650dSJack F Vogel 	__le16	default_seid;        /* reserved for command */
626*61ae650dSJack F Vogel 	u8	reserved[10];
627*61ae650dSJack F Vogel };
628*61ae650dSJack F Vogel 
629*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_port_parameters);
630*61ae650dSJack F Vogel 
631*61ae650dSJack F Vogel /* Get Switch Resource Allocation (indirect 0x0204) */
632*61ae650dSJack F Vogel struct i40e_aqc_get_switch_resource_alloc {
633*61ae650dSJack F Vogel 	u8	num_entries;         /* reserved for command */
634*61ae650dSJack F Vogel 	u8	reserved[7];
635*61ae650dSJack F Vogel 	__le32	addr_high;
636*61ae650dSJack F Vogel 	__le32	addr_low;
637*61ae650dSJack F Vogel };
638*61ae650dSJack F Vogel 
639*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_switch_resource_alloc);
640*61ae650dSJack F Vogel 
641*61ae650dSJack F Vogel /* expect an array of these structs in the response buffer */
642*61ae650dSJack F Vogel struct i40e_aqc_switch_resource_alloc_element_resp {
643*61ae650dSJack F Vogel 	u8	resource_type;
644*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VEB		0x0
645*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VSI		0x1
646*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_MACADDR		0x2
647*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_STAG		0x3
648*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_ETAG		0x4
649*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_MULTICAST_HASH	0x5
650*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_UNICAST_HASH	0x6
651*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VLAN		0x7
652*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VSI_LIST_ENTRY	0x8
653*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_ETAG_LIST_ENTRY	0x9
654*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VLAN_STAT_POOL	0xA
655*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_MIRROR_RULE	0xB
656*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_QUEUE_SETS	0xC
657*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VLAN_FILTERS	0xD
658*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_INNER_MAC_FILTERS	0xF
659*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_IP_FILTERS	0x10
660*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_GRE_VN_KEYS	0x11
661*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VN2_KEYS		0x12
662*61ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_TUNNEL_PORTS	0x13
663*61ae650dSJack F Vogel 	u8	reserved1;
664*61ae650dSJack F Vogel 	__le16	guaranteed;
665*61ae650dSJack F Vogel 	__le16	total;
666*61ae650dSJack F Vogel 	__le16	used;
667*61ae650dSJack F Vogel 	__le16	total_unalloced;
668*61ae650dSJack F Vogel 	u8	reserved2[6];
669*61ae650dSJack F Vogel };
670*61ae650dSJack F Vogel 
671*61ae650dSJack F Vogel /* Add VSI (indirect 0x0210)
672*61ae650dSJack F Vogel  *    this indirect command uses struct i40e_aqc_vsi_properties_data
673*61ae650dSJack F Vogel  *    as the indirect buffer (128 bytes)
674*61ae650dSJack F Vogel  *
675*61ae650dSJack F Vogel  * Update VSI (indirect 0x211)
676*61ae650dSJack F Vogel  *     uses the same data structure as Add VSI
677*61ae650dSJack F Vogel  *
678*61ae650dSJack F Vogel  * Get VSI (indirect 0x0212)
679*61ae650dSJack F Vogel  *     uses the same completion and data structure as Add VSI
680*61ae650dSJack F Vogel  */
681*61ae650dSJack F Vogel struct i40e_aqc_add_get_update_vsi {
682*61ae650dSJack F Vogel 	__le16	uplink_seid;
683*61ae650dSJack F Vogel 	u8	connection_type;
684*61ae650dSJack F Vogel #define I40E_AQ_VSI_CONN_TYPE_NORMAL	0x1
685*61ae650dSJack F Vogel #define I40E_AQ_VSI_CONN_TYPE_DEFAULT	0x2
686*61ae650dSJack F Vogel #define I40E_AQ_VSI_CONN_TYPE_CASCADED	0x3
687*61ae650dSJack F Vogel 	u8	reserved1;
688*61ae650dSJack F Vogel 	u8	vf_id;
689*61ae650dSJack F Vogel 	u8	reserved2;
690*61ae650dSJack F Vogel 	__le16	vsi_flags;
691*61ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_SHIFT		0x0
692*61ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_MASK		(0x3 << I40E_AQ_VSI_TYPE_SHIFT)
693*61ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_VF		0x0
694*61ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_VMDQ2		0x1
695*61ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_PF		0x2
696*61ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_EMP_MNG	0x3
697*61ae650dSJack F Vogel #define I40E_AQ_VSI_FLAG_CASCADED_PV	0x4
698*61ae650dSJack F Vogel 	__le32	addr_high;
699*61ae650dSJack F Vogel 	__le32	addr_low;
700*61ae650dSJack F Vogel };
701*61ae650dSJack F Vogel 
702*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_get_update_vsi);
703*61ae650dSJack F Vogel 
704*61ae650dSJack F Vogel struct i40e_aqc_add_get_update_vsi_completion {
705*61ae650dSJack F Vogel 	__le16 seid;
706*61ae650dSJack F Vogel 	__le16 vsi_number;
707*61ae650dSJack F Vogel 	__le16 vsi_used;
708*61ae650dSJack F Vogel 	__le16 vsi_free;
709*61ae650dSJack F Vogel 	__le32 addr_high;
710*61ae650dSJack F Vogel 	__le32 addr_low;
711*61ae650dSJack F Vogel };
712*61ae650dSJack F Vogel 
713*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_get_update_vsi_completion);
714*61ae650dSJack F Vogel 
715*61ae650dSJack F Vogel struct i40e_aqc_vsi_properties_data {
716*61ae650dSJack F Vogel 	/* first 96 byte are written by SW */
717*61ae650dSJack F Vogel 	__le16	valid_sections;
718*61ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_SWITCH_VALID		0x0001
719*61ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_SECURITY_VALID		0x0002
720*61ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_VLAN_VALID		0x0004
721*61ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_CAS_PV_VALID		0x0008
722*61ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_INGRESS_UP_VALID	0x0010
723*61ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_EGRESS_UP_VALID	0x0020
724*61ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_QUEUE_MAP_VALID	0x0040
725*61ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_QUEUE_OPT_VALID	0x0080
726*61ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_OUTER_UP_VALID		0x0100
727*61ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_SCHED_VALID		0x0200
728*61ae650dSJack F Vogel 	/* switch section */
729*61ae650dSJack F Vogel 	__le16	switch_id; /* 12bit id combined with flags below */
730*61ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_SHIFT		0x0000
731*61ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_MASK		(0xFFF << I40E_AQ_VSI_SW_ID_SHIFT)
732*61ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_FLAG_NOT_STAG	0x1000
733*61ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB	0x2000
734*61ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_FLAG_LOCAL_LB	0x4000
735*61ae650dSJack F Vogel 	u8	sw_reserved[2];
736*61ae650dSJack F Vogel 	/* security section */
737*61ae650dSJack F Vogel 	u8	sec_flags;
738*61ae650dSJack F Vogel #define I40E_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD	0x01
739*61ae650dSJack F Vogel #define I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK	0x02
740*61ae650dSJack F Vogel #define I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK	0x04
741*61ae650dSJack F Vogel 	u8	sec_reserved;
742*61ae650dSJack F Vogel 	/* VLAN section */
743*61ae650dSJack F Vogel 	__le16	pvid; /* VLANS include priority bits */
744*61ae650dSJack F Vogel 	__le16	fcoe_pvid;
745*61ae650dSJack F Vogel 	u8	port_vlan_flags;
746*61ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_SHIFT	0x00
747*61ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_MASK	(0x03 << \
748*61ae650dSJack F Vogel 					 I40E_AQ_VSI_PVLAN_MODE_SHIFT)
749*61ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_TAGGED	0x01
750*61ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_UNTAGGED	0x02
751*61ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_ALL	0x03
752*61ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_INSERT_PVID	0x04
753*61ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_SHIFT	0x03
754*61ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_MASK	(0x3 << \
755*61ae650dSJack F Vogel 					 I40E_AQ_VSI_PVLAN_EMOD_SHIFT)
756*61ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH	0x0
757*61ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP	0x08
758*61ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_STR	0x10
759*61ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING	0x18
760*61ae650dSJack F Vogel 	u8	pvlan_reserved[3];
761*61ae650dSJack F Vogel 	/* ingress egress up sections */
762*61ae650dSJack F Vogel 	__le32	ingress_table; /* bitmap, 3 bits per up */
763*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT	0
764*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP0_MASK	(0x7 << \
765*61ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP0_SHIFT)
766*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP1_SHIFT	3
767*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP1_MASK	(0x7 << \
768*61ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP1_SHIFT)
769*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP2_SHIFT	6
770*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP2_MASK	(0x7 << \
771*61ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP2_SHIFT)
772*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP3_SHIFT	9
773*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP3_MASK	(0x7 << \
774*61ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP3_SHIFT)
775*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP4_SHIFT	12
776*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP4_MASK	(0x7 << \
777*61ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP4_SHIFT)
778*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP5_SHIFT	15
779*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP5_MASK	(0x7 << \
780*61ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP5_SHIFT)
781*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP6_SHIFT	18
782*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP6_MASK	(0x7 << \
783*61ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP6_SHIFT)
784*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP7_SHIFT	21
785*61ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP7_MASK	(0x7 << \
786*61ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP7_SHIFT)
787*61ae650dSJack F Vogel 	__le32	egress_table;   /* same defines as for ingress table */
788*61ae650dSJack F Vogel 	/* cascaded PV section */
789*61ae650dSJack F Vogel 	__le16	cas_pv_tag;
790*61ae650dSJack F Vogel 	u8	cas_pv_flags;
791*61ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_SHIFT		0x00
792*61ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_MASK		(0x03 << \
793*61ae650dSJack F Vogel 						 I40E_AQ_VSI_CAS_PV_TAGX_SHIFT)
794*61ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_LEAVE		0x00
795*61ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_REMOVE		0x01
796*61ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_COPY		0x02
797*61ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_INSERT_TAG		0x10
798*61ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_ETAG_PRUNE		0x20
799*61ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_ACCEPT_HOST_TAG	0x40
800*61ae650dSJack F Vogel 	u8	cas_pv_reserved;
801*61ae650dSJack F Vogel 	/* queue mapping section */
802*61ae650dSJack F Vogel 	__le16	mapping_flags;
803*61ae650dSJack F Vogel #define I40E_AQ_VSI_QUE_MAP_CONTIG	0x0
804*61ae650dSJack F Vogel #define I40E_AQ_VSI_QUE_MAP_NONCONTIG	0x1
805*61ae650dSJack F Vogel 	__le16	queue_mapping[16];
806*61ae650dSJack F Vogel #define I40E_AQ_VSI_QUEUE_SHIFT		0x0
807*61ae650dSJack F Vogel #define I40E_AQ_VSI_QUEUE_MASK		(0x7FF << I40E_AQ_VSI_QUEUE_SHIFT)
808*61ae650dSJack F Vogel 	__le16	tc_mapping[8];
809*61ae650dSJack F Vogel #define I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT	0
810*61ae650dSJack F Vogel #define I40E_AQ_VSI_TC_QUE_OFFSET_MASK	(0x1FF << \
811*61ae650dSJack F Vogel 					 I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT)
812*61ae650dSJack F Vogel #define I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT	9
813*61ae650dSJack F Vogel #define I40E_AQ_VSI_TC_QUE_NUMBER_MASK	(0x7 << \
814*61ae650dSJack F Vogel 					 I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT)
815*61ae650dSJack F Vogel 	/* queueing option section */
816*61ae650dSJack F Vogel 	u8	queueing_opt_flags;
817*61ae650dSJack F Vogel #define I40E_AQ_VSI_QUE_OPT_TCP_ENA	0x10
818*61ae650dSJack F Vogel #define I40E_AQ_VSI_QUE_OPT_FCOE_ENA	0x20
819*61ae650dSJack F Vogel 	u8	queueing_opt_reserved[3];
820*61ae650dSJack F Vogel 	/* scheduler section */
821*61ae650dSJack F Vogel 	u8	up_enable_bits;
822*61ae650dSJack F Vogel 	u8	sched_reserved;
823*61ae650dSJack F Vogel 	/* outer up section */
824*61ae650dSJack F Vogel 	__le32	outer_up_table; /* same structure and defines as ingress table */
825*61ae650dSJack F Vogel 	u8	cmd_reserved[8];
826*61ae650dSJack F Vogel 	/* last 32 bytes are written by FW */
827*61ae650dSJack F Vogel 	__le16	qs_handle[8];
828*61ae650dSJack F Vogel #define I40E_AQ_VSI_QS_HANDLE_INVALID	0xFFFF
829*61ae650dSJack F Vogel 	__le16	stat_counter_idx;
830*61ae650dSJack F Vogel 	__le16	sched_id;
831*61ae650dSJack F Vogel 	u8	resp_reserved[12];
832*61ae650dSJack F Vogel };
833*61ae650dSJack F Vogel 
834*61ae650dSJack F Vogel I40E_CHECK_STRUCT_LEN(128, i40e_aqc_vsi_properties_data);
835*61ae650dSJack F Vogel 
836*61ae650dSJack F Vogel /* Add Port Virtualizer (direct 0x0220)
837*61ae650dSJack F Vogel  * also used for update PV (direct 0x0221) but only flags are used
838*61ae650dSJack F Vogel  * (IS_CTRL_PORT only works on add PV)
839*61ae650dSJack F Vogel  */
840*61ae650dSJack F Vogel struct i40e_aqc_add_update_pv {
841*61ae650dSJack F Vogel 	__le16	command_flags;
842*61ae650dSJack F Vogel #define I40E_AQC_PV_FLAG_PV_TYPE		0x1
843*61ae650dSJack F Vogel #define I40E_AQC_PV_FLAG_FWD_UNKNOWN_STAG_EN	0x2
844*61ae650dSJack F Vogel #define I40E_AQC_PV_FLAG_FWD_UNKNOWN_ETAG_EN	0x4
845*61ae650dSJack F Vogel #define I40E_AQC_PV_FLAG_IS_CTRL_PORT		0x8
846*61ae650dSJack F Vogel 	__le16	uplink_seid;
847*61ae650dSJack F Vogel 	__le16	connected_seid;
848*61ae650dSJack F Vogel 	u8	reserved[10];
849*61ae650dSJack F Vogel };
850*61ae650dSJack F Vogel 
851*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_update_pv);
852*61ae650dSJack F Vogel 
853*61ae650dSJack F Vogel struct i40e_aqc_add_update_pv_completion {
854*61ae650dSJack F Vogel 	/* reserved for update; for add also encodes error if rc == ENOSPC */
855*61ae650dSJack F Vogel 	__le16	pv_seid;
856*61ae650dSJack F Vogel #define I40E_AQC_PV_ERR_FLAG_NO_PV	0x1
857*61ae650dSJack F Vogel #define I40E_AQC_PV_ERR_FLAG_NO_SCHED	0x2
858*61ae650dSJack F Vogel #define I40E_AQC_PV_ERR_FLAG_NO_COUNTER	0x4
859*61ae650dSJack F Vogel #define I40E_AQC_PV_ERR_FLAG_NO_ENTRY	0x8
860*61ae650dSJack F Vogel 	u8	reserved[14];
861*61ae650dSJack F Vogel };
862*61ae650dSJack F Vogel 
863*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_update_pv_completion);
864*61ae650dSJack F Vogel 
865*61ae650dSJack F Vogel /* Get PV Params (direct 0x0222)
866*61ae650dSJack F Vogel  * uses i40e_aqc_switch_seid for the descriptor
867*61ae650dSJack F Vogel  */
868*61ae650dSJack F Vogel 
869*61ae650dSJack F Vogel struct i40e_aqc_get_pv_params_completion {
870*61ae650dSJack F Vogel 	__le16	seid;
871*61ae650dSJack F Vogel 	__le16	default_stag;
872*61ae650dSJack F Vogel 	__le16	pv_flags; /* same flags as add_pv */
873*61ae650dSJack F Vogel #define I40E_AQC_GET_PV_PV_TYPE			0x1
874*61ae650dSJack F Vogel #define I40E_AQC_GET_PV_FRWD_UNKNOWN_STAG	0x2
875*61ae650dSJack F Vogel #define I40E_AQC_GET_PV_FRWD_UNKNOWN_ETAG	0x4
876*61ae650dSJack F Vogel 	u8	reserved[8];
877*61ae650dSJack F Vogel 	__le16	default_port_seid;
878*61ae650dSJack F Vogel };
879*61ae650dSJack F Vogel 
880*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_pv_params_completion);
881*61ae650dSJack F Vogel 
882*61ae650dSJack F Vogel /* Add VEB (direct 0x0230) */
883*61ae650dSJack F Vogel struct i40e_aqc_add_veb {
884*61ae650dSJack F Vogel 	__le16	uplink_seid;
885*61ae650dSJack F Vogel 	__le16	downlink_seid;
886*61ae650dSJack F Vogel 	__le16	veb_flags;
887*61ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_FLOATING		0x1
888*61ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_PORT_TYPE_SHIFT	1
889*61ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_PORT_TYPE_MASK		(0x3 << \
890*61ae650dSJack F Vogel 					I40E_AQC_ADD_VEB_PORT_TYPE_SHIFT)
891*61ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_PORT_TYPE_DEFAULT	0x2
892*61ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_PORT_TYPE_DATA		0x4
893*61ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_ENABLE_L2_FILTER	0x8
894*61ae650dSJack F Vogel 	u8	enable_tcs;
895*61ae650dSJack F Vogel 	u8	reserved[9];
896*61ae650dSJack F Vogel };
897*61ae650dSJack F Vogel 
898*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_veb);
899*61ae650dSJack F Vogel 
900*61ae650dSJack F Vogel struct i40e_aqc_add_veb_completion {
901*61ae650dSJack F Vogel 	u8	reserved[6];
902*61ae650dSJack F Vogel 	__le16	switch_seid;
903*61ae650dSJack F Vogel 	/* also encodes error if rc == ENOSPC; codes are the same as add_pv */
904*61ae650dSJack F Vogel 	__le16	veb_seid;
905*61ae650dSJack F Vogel #define I40E_AQC_VEB_ERR_FLAG_NO_VEB		0x1
906*61ae650dSJack F Vogel #define I40E_AQC_VEB_ERR_FLAG_NO_SCHED		0x2
907*61ae650dSJack F Vogel #define I40E_AQC_VEB_ERR_FLAG_NO_COUNTER	0x4
908*61ae650dSJack F Vogel #define I40E_AQC_VEB_ERR_FLAG_NO_ENTRY		0x8
909*61ae650dSJack F Vogel 	__le16	statistic_index;
910*61ae650dSJack F Vogel 	__le16	vebs_used;
911*61ae650dSJack F Vogel 	__le16	vebs_free;
912*61ae650dSJack F Vogel };
913*61ae650dSJack F Vogel 
914*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_veb_completion);
915*61ae650dSJack F Vogel 
916*61ae650dSJack F Vogel /* Get VEB Parameters (direct 0x0232)
917*61ae650dSJack F Vogel  * uses i40e_aqc_switch_seid for the descriptor
918*61ae650dSJack F Vogel  */
919*61ae650dSJack F Vogel struct i40e_aqc_get_veb_parameters_completion {
920*61ae650dSJack F Vogel 	__le16	seid;
921*61ae650dSJack F Vogel 	__le16	switch_id;
922*61ae650dSJack F Vogel 	__le16	veb_flags; /* only the first/last flags from 0x0230 is valid */
923*61ae650dSJack F Vogel 	__le16	statistic_index;
924*61ae650dSJack F Vogel 	__le16	vebs_used;
925*61ae650dSJack F Vogel 	__le16	vebs_free;
926*61ae650dSJack F Vogel 	u8	reserved[4];
927*61ae650dSJack F Vogel };
928*61ae650dSJack F Vogel 
929*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_veb_parameters_completion);
930*61ae650dSJack F Vogel 
931*61ae650dSJack F Vogel /* Delete Element (direct 0x0243)
932*61ae650dSJack F Vogel  * uses the generic i40e_aqc_switch_seid
933*61ae650dSJack F Vogel  */
934*61ae650dSJack F Vogel 
935*61ae650dSJack F Vogel /* Add MAC-VLAN (indirect 0x0250) */
936*61ae650dSJack F Vogel 
937*61ae650dSJack F Vogel /* used for the command for most vlan commands */
938*61ae650dSJack F Vogel struct i40e_aqc_macvlan {
939*61ae650dSJack F Vogel 	__le16	num_addresses;
940*61ae650dSJack F Vogel 	__le16	seid[3];
941*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_SEID_NUM_SHIFT	0
942*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_SEID_NUM_MASK	(0x3FF << \
943*61ae650dSJack F Vogel 					I40E_AQC_MACVLAN_CMD_SEID_NUM_SHIFT)
944*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_SEID_VALID		0x8000
945*61ae650dSJack F Vogel 	__le32	addr_high;
946*61ae650dSJack F Vogel 	__le32	addr_low;
947*61ae650dSJack F Vogel };
948*61ae650dSJack F Vogel 
949*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_macvlan);
950*61ae650dSJack F Vogel 
951*61ae650dSJack F Vogel /* indirect data for command and response */
952*61ae650dSJack F Vogel struct i40e_aqc_add_macvlan_element_data {
953*61ae650dSJack F Vogel 	u8	mac_addr[6];
954*61ae650dSJack F Vogel 	__le16	vlan_tag;
955*61ae650dSJack F Vogel 	__le16	flags;
956*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_ADD_PERFECT_MATCH	0x0001
957*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_ADD_HASH_MATCH		0x0002
958*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_ADD_IGNORE_VLAN	0x0004
959*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_ADD_TO_QUEUE		0x0008
960*61ae650dSJack F Vogel 	__le16	queue_number;
961*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_QUEUE_SHIFT	0
962*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_QUEUE_MASK		(0x7FF << \
963*61ae650dSJack F Vogel 					I40E_AQC_MACVLAN_CMD_SEID_NUM_SHIFT)
964*61ae650dSJack F Vogel 	/* response section */
965*61ae650dSJack F Vogel 	u8	match_method;
966*61ae650dSJack F Vogel #define I40E_AQC_MM_PERFECT_MATCH	0x01
967*61ae650dSJack F Vogel #define I40E_AQC_MM_HASH_MATCH		0x02
968*61ae650dSJack F Vogel #define I40E_AQC_MM_ERR_NO_RES		0xFF
969*61ae650dSJack F Vogel 	u8	reserved1[3];
970*61ae650dSJack F Vogel };
971*61ae650dSJack F Vogel 
972*61ae650dSJack F Vogel struct i40e_aqc_add_remove_macvlan_completion {
973*61ae650dSJack F Vogel 	__le16 perfect_mac_used;
974*61ae650dSJack F Vogel 	__le16 perfect_mac_free;
975*61ae650dSJack F Vogel 	__le16 unicast_hash_free;
976*61ae650dSJack F Vogel 	__le16 multicast_hash_free;
977*61ae650dSJack F Vogel 	__le32 addr_high;
978*61ae650dSJack F Vogel 	__le32 addr_low;
979*61ae650dSJack F Vogel };
980*61ae650dSJack F Vogel 
981*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_macvlan_completion);
982*61ae650dSJack F Vogel 
983*61ae650dSJack F Vogel /* Remove MAC-VLAN (indirect 0x0251)
984*61ae650dSJack F Vogel  * uses i40e_aqc_macvlan for the descriptor
985*61ae650dSJack F Vogel  * data points to an array of num_addresses of elements
986*61ae650dSJack F Vogel  */
987*61ae650dSJack F Vogel 
988*61ae650dSJack F Vogel struct i40e_aqc_remove_macvlan_element_data {
989*61ae650dSJack F Vogel 	u8	mac_addr[6];
990*61ae650dSJack F Vogel 	__le16	vlan_tag;
991*61ae650dSJack F Vogel 	u8	flags;
992*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_DEL_PERFECT_MATCH	0x01
993*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_DEL_HASH_MATCH		0x02
994*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_DEL_IGNORE_VLAN	0x08
995*61ae650dSJack F Vogel #define I40E_AQC_MACVLAN_DEL_ALL_VSIS		0x10
996*61ae650dSJack F Vogel 	u8	reserved[3];
997*61ae650dSJack F Vogel 	/* reply section */
998*61ae650dSJack F Vogel 	u8	error_code;
999*61ae650dSJack F Vogel #define I40E_AQC_REMOVE_MACVLAN_SUCCESS		0x0
1000*61ae650dSJack F Vogel #define I40E_AQC_REMOVE_MACVLAN_FAIL		0xFF
1001*61ae650dSJack F Vogel 	u8	reply_reserved[3];
1002*61ae650dSJack F Vogel };
1003*61ae650dSJack F Vogel 
1004*61ae650dSJack F Vogel /* Add VLAN (indirect 0x0252)
1005*61ae650dSJack F Vogel  * Remove VLAN (indirect 0x0253)
1006*61ae650dSJack F Vogel  * use the generic i40e_aqc_macvlan for the command
1007*61ae650dSJack F Vogel  */
1008*61ae650dSJack F Vogel struct i40e_aqc_add_remove_vlan_element_data {
1009*61ae650dSJack F Vogel 	__le16	vlan_tag;
1010*61ae650dSJack F Vogel 	u8	vlan_flags;
1011*61ae650dSJack F Vogel /* flags for add VLAN */
1012*61ae650dSJack F Vogel #define I40E_AQC_ADD_VLAN_LOCAL			0x1
1013*61ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_SHIFT		1
1014*61ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_MASK	(0x3 << I40E_AQC_ADD_PVLAN_TYPE_SHIFT)
1015*61ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_REGULAR		0x0
1016*61ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_PRIMARY		0x2
1017*61ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_SECONDARY	0x4
1018*61ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_SHIFT		3
1019*61ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_MASK	(0x3 << I40E_AQC_VLAN_PTYPE_SHIFT)
1020*61ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_REGULAR_VSI		0x0
1021*61ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_PROMISC_VSI		0x8
1022*61ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_COMMUNITY_VSI	0x10
1023*61ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_ISOLATED_VSI	0x18
1024*61ae650dSJack F Vogel /* flags for remove VLAN */
1025*61ae650dSJack F Vogel #define I40E_AQC_REMOVE_VLAN_ALL	0x1
1026*61ae650dSJack F Vogel 	u8	reserved;
1027*61ae650dSJack F Vogel 	u8	result;
1028*61ae650dSJack F Vogel /* flags for add VLAN */
1029*61ae650dSJack F Vogel #define I40E_AQC_ADD_VLAN_SUCCESS	0x0
1030*61ae650dSJack F Vogel #define I40E_AQC_ADD_VLAN_FAIL_REQUEST	0xFE
1031*61ae650dSJack F Vogel #define I40E_AQC_ADD_VLAN_FAIL_RESOURCE	0xFF
1032*61ae650dSJack F Vogel /* flags for remove VLAN */
1033*61ae650dSJack F Vogel #define I40E_AQC_REMOVE_VLAN_SUCCESS	0x0
1034*61ae650dSJack F Vogel #define I40E_AQC_REMOVE_VLAN_FAIL	0xFF
1035*61ae650dSJack F Vogel 	u8	reserved1[3];
1036*61ae650dSJack F Vogel };
1037*61ae650dSJack F Vogel 
1038*61ae650dSJack F Vogel struct i40e_aqc_add_remove_vlan_completion {
1039*61ae650dSJack F Vogel 	u8	reserved[4];
1040*61ae650dSJack F Vogel 	__le16	vlans_used;
1041*61ae650dSJack F Vogel 	__le16	vlans_free;
1042*61ae650dSJack F Vogel 	__le32	addr_high;
1043*61ae650dSJack F Vogel 	__le32	addr_low;
1044*61ae650dSJack F Vogel };
1045*61ae650dSJack F Vogel 
1046*61ae650dSJack F Vogel /* Set VSI Promiscuous Modes (direct 0x0254) */
1047*61ae650dSJack F Vogel struct i40e_aqc_set_vsi_promiscuous_modes {
1048*61ae650dSJack F Vogel 	__le16	promiscuous_flags;
1049*61ae650dSJack F Vogel 	__le16	valid_flags;
1050*61ae650dSJack F Vogel /* flags used for both fields above */
1051*61ae650dSJack F Vogel #define I40E_AQC_SET_VSI_PROMISC_UNICAST	0x01
1052*61ae650dSJack F Vogel #define I40E_AQC_SET_VSI_PROMISC_MULTICAST	0x02
1053*61ae650dSJack F Vogel #define I40E_AQC_SET_VSI_PROMISC_BROADCAST	0x04
1054*61ae650dSJack F Vogel #define I40E_AQC_SET_VSI_DEFAULT		0x08
1055*61ae650dSJack F Vogel #define I40E_AQC_SET_VSI_PROMISC_VLAN		0x10
1056*61ae650dSJack F Vogel 	__le16	seid;
1057*61ae650dSJack F Vogel #define I40E_AQC_VSI_PROM_CMD_SEID_MASK		0x3FF
1058*61ae650dSJack F Vogel 	__le16	vlan_tag;
1059*61ae650dSJack F Vogel #define I40E_AQC_SET_VSI_VLAN_VALID		0x8000
1060*61ae650dSJack F Vogel 	u8	reserved[8];
1061*61ae650dSJack F Vogel };
1062*61ae650dSJack F Vogel 
1063*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_vsi_promiscuous_modes);
1064*61ae650dSJack F Vogel 
1065*61ae650dSJack F Vogel /* Add S/E-tag command (direct 0x0255)
1066*61ae650dSJack F Vogel  * Uses generic i40e_aqc_add_remove_tag_completion for completion
1067*61ae650dSJack F Vogel  */
1068*61ae650dSJack F Vogel struct i40e_aqc_add_tag {
1069*61ae650dSJack F Vogel 	__le16	flags;
1070*61ae650dSJack F Vogel #define I40E_AQC_ADD_TAG_FLAG_TO_QUEUE		0x0001
1071*61ae650dSJack F Vogel 	__le16	seid;
1072*61ae650dSJack F Vogel #define I40E_AQC_ADD_TAG_CMD_SEID_NUM_SHIFT	0
1073*61ae650dSJack F Vogel #define I40E_AQC_ADD_TAG_CMD_SEID_NUM_MASK	(0x3FF << \
1074*61ae650dSJack F Vogel 					I40E_AQC_ADD_TAG_CMD_SEID_NUM_SHIFT)
1075*61ae650dSJack F Vogel 	__le16	tag;
1076*61ae650dSJack F Vogel 	__le16	queue_number;
1077*61ae650dSJack F Vogel 	u8	reserved[8];
1078*61ae650dSJack F Vogel };
1079*61ae650dSJack F Vogel 
1080*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_tag);
1081*61ae650dSJack F Vogel 
1082*61ae650dSJack F Vogel struct i40e_aqc_add_remove_tag_completion {
1083*61ae650dSJack F Vogel 	u8	reserved[12];
1084*61ae650dSJack F Vogel 	__le16	tags_used;
1085*61ae650dSJack F Vogel 	__le16	tags_free;
1086*61ae650dSJack F Vogel };
1087*61ae650dSJack F Vogel 
1088*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_tag_completion);
1089*61ae650dSJack F Vogel 
1090*61ae650dSJack F Vogel /* Remove S/E-tag command (direct 0x0256)
1091*61ae650dSJack F Vogel  * Uses generic i40e_aqc_add_remove_tag_completion for completion
1092*61ae650dSJack F Vogel  */
1093*61ae650dSJack F Vogel struct i40e_aqc_remove_tag {
1094*61ae650dSJack F Vogel 	__le16	seid;
1095*61ae650dSJack F Vogel #define I40E_AQC_REMOVE_TAG_CMD_SEID_NUM_SHIFT	0
1096*61ae650dSJack F Vogel #define I40E_AQC_REMOVE_TAG_CMD_SEID_NUM_MASK	(0x3FF << \
1097*61ae650dSJack F Vogel 					I40E_AQC_REMOVE_TAG_CMD_SEID_NUM_SHIFT)
1098*61ae650dSJack F Vogel 	__le16	tag;
1099*61ae650dSJack F Vogel 	u8	reserved[12];
1100*61ae650dSJack F Vogel };
1101*61ae650dSJack F Vogel 
1102*61ae650dSJack F Vogel /* Add multicast E-Tag (direct 0x0257)
1103*61ae650dSJack F Vogel  * del multicast E-Tag (direct 0x0258) only uses pv_seid and etag fields
1104*61ae650dSJack F Vogel  * and no external data
1105*61ae650dSJack F Vogel  */
1106*61ae650dSJack F Vogel struct i40e_aqc_add_remove_mcast_etag {
1107*61ae650dSJack F Vogel 	__le16	pv_seid;
1108*61ae650dSJack F Vogel 	__le16	etag;
1109*61ae650dSJack F Vogel 	u8	num_unicast_etags;
1110*61ae650dSJack F Vogel 	u8	reserved[3];
1111*61ae650dSJack F Vogel 	__le32	addr_high;          /* address of array of 2-byte s-tags */
1112*61ae650dSJack F Vogel 	__le32	addr_low;
1113*61ae650dSJack F Vogel };
1114*61ae650dSJack F Vogel 
1115*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_mcast_etag);
1116*61ae650dSJack F Vogel 
1117*61ae650dSJack F Vogel struct i40e_aqc_add_remove_mcast_etag_completion {
1118*61ae650dSJack F Vogel 	u8	reserved[4];
1119*61ae650dSJack F Vogel 	__le16	mcast_etags_used;
1120*61ae650dSJack F Vogel 	__le16	mcast_etags_free;
1121*61ae650dSJack F Vogel 	__le32	addr_high;
1122*61ae650dSJack F Vogel 	__le32	addr_low;
1123*61ae650dSJack F Vogel 
1124*61ae650dSJack F Vogel };
1125*61ae650dSJack F Vogel 
1126*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_mcast_etag_completion);
1127*61ae650dSJack F Vogel 
1128*61ae650dSJack F Vogel /* Update S/E-Tag (direct 0x0259) */
1129*61ae650dSJack F Vogel struct i40e_aqc_update_tag {
1130*61ae650dSJack F Vogel 	__le16	seid;
1131*61ae650dSJack F Vogel #define I40E_AQC_UPDATE_TAG_CMD_SEID_NUM_SHIFT	0
1132*61ae650dSJack F Vogel #define I40E_AQC_UPDATE_TAG_CMD_SEID_NUM_MASK	(0x3FF << \
1133*61ae650dSJack F Vogel 					I40E_AQC_UPDATE_TAG_CMD_SEID_NUM_SHIFT)
1134*61ae650dSJack F Vogel 	__le16	old_tag;
1135*61ae650dSJack F Vogel 	__le16	new_tag;
1136*61ae650dSJack F Vogel 	u8	reserved[10];
1137*61ae650dSJack F Vogel };
1138*61ae650dSJack F Vogel 
1139*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_update_tag);
1140*61ae650dSJack F Vogel 
1141*61ae650dSJack F Vogel struct i40e_aqc_update_tag_completion {
1142*61ae650dSJack F Vogel 	u8	reserved[12];
1143*61ae650dSJack F Vogel 	__le16	tags_used;
1144*61ae650dSJack F Vogel 	__le16	tags_free;
1145*61ae650dSJack F Vogel };
1146*61ae650dSJack F Vogel 
1147*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_update_tag_completion);
1148*61ae650dSJack F Vogel 
1149*61ae650dSJack F Vogel /* Add Control Packet filter (direct 0x025A)
1150*61ae650dSJack F Vogel  * Remove Control Packet filter (direct 0x025B)
1151*61ae650dSJack F Vogel  * uses the i40e_aqc_add_oveb_cloud,
1152*61ae650dSJack F Vogel  * and the generic direct completion structure
1153*61ae650dSJack F Vogel  */
1154*61ae650dSJack F Vogel struct i40e_aqc_add_remove_control_packet_filter {
1155*61ae650dSJack F Vogel 	u8	mac[6];
1156*61ae650dSJack F Vogel 	__le16	etype;
1157*61ae650dSJack F Vogel 	__le16	flags;
1158*61ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC	0x0001
1159*61ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP		0x0002
1160*61ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TO_QUEUE	0x0004
1161*61ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX		0x0008
1162*61ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_RX		0x0000
1163*61ae650dSJack F Vogel 	__le16	seid;
1164*61ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_CMD_SEID_NUM_SHIFT	0
1165*61ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_CMD_SEID_NUM_MASK	(0x3FF << \
1166*61ae650dSJack F Vogel 				I40E_AQC_ADD_CONTROL_PACKET_CMD_SEID_NUM_SHIFT)
1167*61ae650dSJack F Vogel 	__le16	queue;
1168*61ae650dSJack F Vogel 	u8	reserved[2];
1169*61ae650dSJack F Vogel };
1170*61ae650dSJack F Vogel 
1171*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_control_packet_filter);
1172*61ae650dSJack F Vogel 
1173*61ae650dSJack F Vogel struct i40e_aqc_add_remove_control_packet_filter_completion {
1174*61ae650dSJack F Vogel 	__le16	mac_etype_used;
1175*61ae650dSJack F Vogel 	__le16	etype_used;
1176*61ae650dSJack F Vogel 	__le16	mac_etype_free;
1177*61ae650dSJack F Vogel 	__le16	etype_free;
1178*61ae650dSJack F Vogel 	u8	reserved[8];
1179*61ae650dSJack F Vogel };
1180*61ae650dSJack F Vogel 
1181*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_control_packet_filter_completion);
1182*61ae650dSJack F Vogel 
1183*61ae650dSJack F Vogel /* Add Cloud filters (indirect 0x025C)
1184*61ae650dSJack F Vogel  * Remove Cloud filters (indirect 0x025D)
1185*61ae650dSJack F Vogel  * uses the i40e_aqc_add_remove_cloud_filters,
1186*61ae650dSJack F Vogel  * and the generic indirect completion structure
1187*61ae650dSJack F Vogel  */
1188*61ae650dSJack F Vogel struct i40e_aqc_add_remove_cloud_filters {
1189*61ae650dSJack F Vogel 	u8	num_filters;
1190*61ae650dSJack F Vogel 	u8	reserved;
1191*61ae650dSJack F Vogel 	__le16	seid;
1192*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT	0
1193*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK	(0x3FF << \
1194*61ae650dSJack F Vogel 					I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT)
1195*61ae650dSJack F Vogel 	u8	reserved2[4];
1196*61ae650dSJack F Vogel 	__le32	addr_high;
1197*61ae650dSJack F Vogel 	__le32	addr_low;
1198*61ae650dSJack F Vogel };
1199*61ae650dSJack F Vogel 
1200*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_cloud_filters);
1201*61ae650dSJack F Vogel 
1202*61ae650dSJack F Vogel struct i40e_aqc_add_remove_cloud_filters_element_data {
1203*61ae650dSJack F Vogel 	u8	outer_mac[6];
1204*61ae650dSJack F Vogel 	u8	inner_mac[6];
1205*61ae650dSJack F Vogel 	__le16	inner_vlan;
1206*61ae650dSJack F Vogel 	union {
1207*61ae650dSJack F Vogel 		struct {
1208*61ae650dSJack F Vogel 			u8 reserved[12];
1209*61ae650dSJack F Vogel 			u8 data[4];
1210*61ae650dSJack F Vogel 		} v4;
1211*61ae650dSJack F Vogel 		struct {
1212*61ae650dSJack F Vogel 			u8 data[16];
1213*61ae650dSJack F Vogel 		} v6;
1214*61ae650dSJack F Vogel 	} ipaddr;
1215*61ae650dSJack F Vogel 	__le16	flags;
1216*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_SHIFT			0
1217*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_MASK			(0x3F << \
1218*61ae650dSJack F Vogel 					I40E_AQC_ADD_CLOUD_FILTER_SHIFT)
1219*61ae650dSJack F Vogel /* 0x0000 reserved */
1220*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_OIP			0x0001
1221*61ae650dSJack F Vogel /* 0x0002 reserved */
1222*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN		0x0003
1223*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN_TEN_ID	0x0004
1224*61ae650dSJack F Vogel /* 0x0005 reserved */
1225*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_TEN_ID		0x0006
1226*61ae650dSJack F Vogel /* 0x0007 reserved */
1227*61ae650dSJack F Vogel /* 0x0008 reserved */
1228*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_OMAC			0x0009
1229*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IMAC			0x000A
1230*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC	0x000B
1231*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IIP			0x000C
1232*61ae650dSJack F Vogel 
1233*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE		0x0080
1234*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_VNK_SHIFT			6
1235*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_VNK_MASK			0x00C0
1236*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FLAGS_IPV4			0
1237*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FLAGS_IPV6			0x0100
1238*61ae650dSJack F Vogel 
1239*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT		9
1240*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_MASK		0x1E00
1241*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_XVLAN		0
1242*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC		1
1243*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_NGE			2
1244*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_IP			3
1245*61ae650dSJack F Vogel 
1246*61ae650dSJack F Vogel 	__le32	tenant_id;
1247*61ae650dSJack F Vogel 	u8	reserved[4];
1248*61ae650dSJack F Vogel 	__le16	queue_number;
1249*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_QUEUE_SHIFT		0
1250*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_QUEUE_MASK		(0x3F << \
1251*61ae650dSJack F Vogel 						 I40E_AQC_ADD_CLOUD_QUEUE_SHIFT)
1252*61ae650dSJack F Vogel 	u8	reserved2[14];
1253*61ae650dSJack F Vogel 	/* response section */
1254*61ae650dSJack F Vogel 	u8	allocation_result;
1255*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_SUCCESS	0x0
1256*61ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_FAIL		0xFF
1257*61ae650dSJack F Vogel 	u8	response_reserved[7];
1258*61ae650dSJack F Vogel };
1259*61ae650dSJack F Vogel 
1260*61ae650dSJack F Vogel struct i40e_aqc_remove_cloud_filters_completion {
1261*61ae650dSJack F Vogel 	__le16 perfect_ovlan_used;
1262*61ae650dSJack F Vogel 	__le16 perfect_ovlan_free;
1263*61ae650dSJack F Vogel 	__le16 vlan_used;
1264*61ae650dSJack F Vogel 	__le16 vlan_free;
1265*61ae650dSJack F Vogel 	__le32 addr_high;
1266*61ae650dSJack F Vogel 	__le32 addr_low;
1267*61ae650dSJack F Vogel };
1268*61ae650dSJack F Vogel 
1269*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion);
1270*61ae650dSJack F Vogel 
1271*61ae650dSJack F Vogel /* Add Mirror Rule (indirect or direct 0x0260)
1272*61ae650dSJack F Vogel  * Delete Mirror Rule (indirect or direct 0x0261)
1273*61ae650dSJack F Vogel  * note: some rule types (4,5) do not use an external buffer.
1274*61ae650dSJack F Vogel  *       take care to set the flags correctly.
1275*61ae650dSJack F Vogel  */
1276*61ae650dSJack F Vogel struct i40e_aqc_add_delete_mirror_rule {
1277*61ae650dSJack F Vogel 	__le16 seid;
1278*61ae650dSJack F Vogel 	__le16 rule_type;
1279*61ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_SHIFT		0
1280*61ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_MASK		(0x7 << \
1281*61ae650dSJack F Vogel 						I40E_AQC_MIRROR_RULE_TYPE_SHIFT)
1282*61ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_VPORT_INGRESS	1
1283*61ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_VPORT_EGRESS	2
1284*61ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_VLAN		3
1285*61ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_ALL_INGRESS	4
1286*61ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_ALL_EGRESS	5
1287*61ae650dSJack F Vogel 	__le16 num_entries;
1288*61ae650dSJack F Vogel 	__le16 destination;  /* VSI for add, rule id for delete */
1289*61ae650dSJack F Vogel 	__le32 addr_high;    /* address of array of 2-byte VSI or VLAN ids */
1290*61ae650dSJack F Vogel 	__le32 addr_low;
1291*61ae650dSJack F Vogel };
1292*61ae650dSJack F Vogel 
1293*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_delete_mirror_rule);
1294*61ae650dSJack F Vogel 
1295*61ae650dSJack F Vogel struct i40e_aqc_add_delete_mirror_rule_completion {
1296*61ae650dSJack F Vogel 	u8	reserved[2];
1297*61ae650dSJack F Vogel 	__le16	rule_id;  /* only used on add */
1298*61ae650dSJack F Vogel 	__le16	mirror_rules_used;
1299*61ae650dSJack F Vogel 	__le16	mirror_rules_free;
1300*61ae650dSJack F Vogel 	__le32	addr_high;
1301*61ae650dSJack F Vogel 	__le32	addr_low;
1302*61ae650dSJack F Vogel };
1303*61ae650dSJack F Vogel 
1304*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_delete_mirror_rule_completion);
1305*61ae650dSJack F Vogel 
1306*61ae650dSJack F Vogel /* DCB 0x03xx*/
1307*61ae650dSJack F Vogel 
1308*61ae650dSJack F Vogel /* PFC Ignore (direct 0x0301)
1309*61ae650dSJack F Vogel  *    the command and response use the same descriptor structure
1310*61ae650dSJack F Vogel  */
1311*61ae650dSJack F Vogel struct i40e_aqc_pfc_ignore {
1312*61ae650dSJack F Vogel 	u8	tc_bitmap;
1313*61ae650dSJack F Vogel 	u8	command_flags; /* unused on response */
1314*61ae650dSJack F Vogel #define I40E_AQC_PFC_IGNORE_SET		0x80
1315*61ae650dSJack F Vogel #define I40E_AQC_PFC_IGNORE_CLEAR	0x0
1316*61ae650dSJack F Vogel 	u8	reserved[14];
1317*61ae650dSJack F Vogel };
1318*61ae650dSJack F Vogel 
1319*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_pfc_ignore);
1320*61ae650dSJack F Vogel 
1321*61ae650dSJack F Vogel /* DCB Update (direct 0x0302) uses the i40e_aq_desc structure
1322*61ae650dSJack F Vogel  * with no parameters
1323*61ae650dSJack F Vogel  */
1324*61ae650dSJack F Vogel 
1325*61ae650dSJack F Vogel /* TX scheduler 0x04xx */
1326*61ae650dSJack F Vogel 
1327*61ae650dSJack F Vogel /* Almost all the indirect commands use
1328*61ae650dSJack F Vogel  * this generic struct to pass the SEID in param0
1329*61ae650dSJack F Vogel  */
1330*61ae650dSJack F Vogel struct i40e_aqc_tx_sched_ind {
1331*61ae650dSJack F Vogel 	__le16	vsi_seid;
1332*61ae650dSJack F Vogel 	u8	reserved[6];
1333*61ae650dSJack F Vogel 	__le32	addr_high;
1334*61ae650dSJack F Vogel 	__le32	addr_low;
1335*61ae650dSJack F Vogel };
1336*61ae650dSJack F Vogel 
1337*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_tx_sched_ind);
1338*61ae650dSJack F Vogel 
1339*61ae650dSJack F Vogel /* Several commands respond with a set of queue set handles */
1340*61ae650dSJack F Vogel struct i40e_aqc_qs_handles_resp {
1341*61ae650dSJack F Vogel 	__le16 qs_handles[8];
1342*61ae650dSJack F Vogel };
1343*61ae650dSJack F Vogel 
1344*61ae650dSJack F Vogel /* Configure VSI BW limits (direct 0x0400) */
1345*61ae650dSJack F Vogel struct i40e_aqc_configure_vsi_bw_limit {
1346*61ae650dSJack F Vogel 	__le16	vsi_seid;
1347*61ae650dSJack F Vogel 	u8	reserved[2];
1348*61ae650dSJack F Vogel 	__le16	credit;
1349*61ae650dSJack F Vogel 	u8	reserved1[2];
1350*61ae650dSJack F Vogel 	u8	max_credit; /* 0-3, limit = 2^max */
1351*61ae650dSJack F Vogel 	u8	reserved2[7];
1352*61ae650dSJack F Vogel };
1353*61ae650dSJack F Vogel 
1354*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_configure_vsi_bw_limit);
1355*61ae650dSJack F Vogel 
1356*61ae650dSJack F Vogel /* Configure VSI Bandwidth Limit per Traffic Type (indirect 0x0406)
1357*61ae650dSJack F Vogel  *    responds with i40e_aqc_qs_handles_resp
1358*61ae650dSJack F Vogel  */
1359*61ae650dSJack F Vogel struct i40e_aqc_configure_vsi_ets_sla_bw_data {
1360*61ae650dSJack F Vogel 	u8	tc_valid_bits;
1361*61ae650dSJack F Vogel 	u8	reserved[15];
1362*61ae650dSJack F Vogel 	__le16	tc_bw_credits[8]; /* FW writesback QS handles here */
1363*61ae650dSJack F Vogel 
1364*61ae650dSJack F Vogel 	/* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
1365*61ae650dSJack F Vogel 	__le16	tc_bw_max[2];
1366*61ae650dSJack F Vogel 	u8	reserved1[28];
1367*61ae650dSJack F Vogel };
1368*61ae650dSJack F Vogel 
1369*61ae650dSJack F Vogel /* Configure VSI Bandwidth Allocation per Traffic Type (indirect 0x0407)
1370*61ae650dSJack F Vogel  *    responds with i40e_aqc_qs_handles_resp
1371*61ae650dSJack F Vogel  */
1372*61ae650dSJack F Vogel struct i40e_aqc_configure_vsi_tc_bw_data {
1373*61ae650dSJack F Vogel 	u8	tc_valid_bits;
1374*61ae650dSJack F Vogel 	u8	reserved[3];
1375*61ae650dSJack F Vogel 	u8	tc_bw_credits[8];
1376*61ae650dSJack F Vogel 	u8	reserved1[4];
1377*61ae650dSJack F Vogel 	__le16	qs_handles[8];
1378*61ae650dSJack F Vogel };
1379*61ae650dSJack F Vogel 
1380*61ae650dSJack F Vogel /* Query vsi bw configuration (indirect 0x0408) */
1381*61ae650dSJack F Vogel struct i40e_aqc_query_vsi_bw_config_resp {
1382*61ae650dSJack F Vogel 	u8	tc_valid_bits;
1383*61ae650dSJack F Vogel 	u8	tc_suspended_bits;
1384*61ae650dSJack F Vogel 	u8	reserved[14];
1385*61ae650dSJack F Vogel 	__le16	qs_handles[8];
1386*61ae650dSJack F Vogel 	u8	reserved1[4];
1387*61ae650dSJack F Vogel 	__le16	port_bw_limit;
1388*61ae650dSJack F Vogel 	u8	reserved2[2];
1389*61ae650dSJack F Vogel 	u8	max_bw; /* 0-3, limit = 2^max */
1390*61ae650dSJack F Vogel 	u8	reserved3[23];
1391*61ae650dSJack F Vogel };
1392*61ae650dSJack F Vogel 
1393*61ae650dSJack F Vogel /* Query VSI Bandwidth Allocation per Traffic Type (indirect 0x040A) */
1394*61ae650dSJack F Vogel struct i40e_aqc_query_vsi_ets_sla_config_resp {
1395*61ae650dSJack F Vogel 	u8	tc_valid_bits;
1396*61ae650dSJack F Vogel 	u8	reserved[3];
1397*61ae650dSJack F Vogel 	u8	share_credits[8];
1398*61ae650dSJack F Vogel 	__le16	credits[8];
1399*61ae650dSJack F Vogel 
1400*61ae650dSJack F Vogel 	/* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
1401*61ae650dSJack F Vogel 	__le16	tc_bw_max[2];
1402*61ae650dSJack F Vogel };
1403*61ae650dSJack F Vogel 
1404*61ae650dSJack F Vogel /* Configure Switching Component Bandwidth Limit (direct 0x0410) */
1405*61ae650dSJack F Vogel struct i40e_aqc_configure_switching_comp_bw_limit {
1406*61ae650dSJack F Vogel 	__le16	seid;
1407*61ae650dSJack F Vogel 	u8	reserved[2];
1408*61ae650dSJack F Vogel 	__le16	credit;
1409*61ae650dSJack F Vogel 	u8	reserved1[2];
1410*61ae650dSJack F Vogel 	u8	max_bw; /* 0-3, limit = 2^max */
1411*61ae650dSJack F Vogel 	u8	reserved2[7];
1412*61ae650dSJack F Vogel };
1413*61ae650dSJack F Vogel 
1414*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_configure_switching_comp_bw_limit);
1415*61ae650dSJack F Vogel 
1416*61ae650dSJack F Vogel /* Enable  Physical Port ETS (indirect 0x0413)
1417*61ae650dSJack F Vogel  * Modify  Physical Port ETS (indirect 0x0414)
1418*61ae650dSJack F Vogel  * Disable Physical Port ETS (indirect 0x0415)
1419*61ae650dSJack F Vogel  */
1420*61ae650dSJack F Vogel struct i40e_aqc_configure_switching_comp_ets_data {
1421*61ae650dSJack F Vogel 	u8	reserved[4];
1422*61ae650dSJack F Vogel 	u8	tc_valid_bits;
1423*61ae650dSJack F Vogel 	u8	seepage;
1424*61ae650dSJack F Vogel #define I40E_AQ_ETS_SEEPAGE_EN_MASK	0x1
1425*61ae650dSJack F Vogel 	u8	tc_strict_priority_flags;
1426*61ae650dSJack F Vogel 	u8	reserved1[17];
1427*61ae650dSJack F Vogel 	u8	tc_bw_share_credits[8];
1428*61ae650dSJack F Vogel 	u8	reserved2[96];
1429*61ae650dSJack F Vogel };
1430*61ae650dSJack F Vogel 
1431*61ae650dSJack F Vogel /* Configure Switching Component Bandwidth Limits per Tc (indirect 0x0416) */
1432*61ae650dSJack F Vogel struct i40e_aqc_configure_switching_comp_ets_bw_limit_data {
1433*61ae650dSJack F Vogel 	u8	tc_valid_bits;
1434*61ae650dSJack F Vogel 	u8	reserved[15];
1435*61ae650dSJack F Vogel 	__le16	tc_bw_credit[8];
1436*61ae650dSJack F Vogel 
1437*61ae650dSJack F Vogel 	/* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
1438*61ae650dSJack F Vogel 	__le16	tc_bw_max[2];
1439*61ae650dSJack F Vogel 	u8	reserved1[28];
1440*61ae650dSJack F Vogel };
1441*61ae650dSJack F Vogel 
1442*61ae650dSJack F Vogel /* Configure Switching Component Bandwidth Allocation per Tc
1443*61ae650dSJack F Vogel  * (indirect 0x0417)
1444*61ae650dSJack F Vogel  */
1445*61ae650dSJack F Vogel struct i40e_aqc_configure_switching_comp_bw_config_data {
1446*61ae650dSJack F Vogel 	u8	tc_valid_bits;
1447*61ae650dSJack F Vogel 	u8	reserved[2];
1448*61ae650dSJack F Vogel 	u8	absolute_credits; /* bool */
1449*61ae650dSJack F Vogel 	u8	tc_bw_share_credits[8];
1450*61ae650dSJack F Vogel 	u8	reserved1[20];
1451*61ae650dSJack F Vogel };
1452*61ae650dSJack F Vogel 
1453*61ae650dSJack F Vogel /* Query Switching Component Configuration (indirect 0x0418) */
1454*61ae650dSJack F Vogel struct i40e_aqc_query_switching_comp_ets_config_resp {
1455*61ae650dSJack F Vogel 	u8	tc_valid_bits;
1456*61ae650dSJack F Vogel 	u8	reserved[35];
1457*61ae650dSJack F Vogel 	__le16	port_bw_limit;
1458*61ae650dSJack F Vogel 	u8	reserved1[2];
1459*61ae650dSJack F Vogel 	u8	tc_bw_max; /* 0-3, limit = 2^max */
1460*61ae650dSJack F Vogel 	u8	reserved2[23];
1461*61ae650dSJack F Vogel };
1462*61ae650dSJack F Vogel 
1463*61ae650dSJack F Vogel /* Query PhysicalPort ETS Configuration (indirect 0x0419) */
1464*61ae650dSJack F Vogel struct i40e_aqc_query_port_ets_config_resp {
1465*61ae650dSJack F Vogel 	u8	reserved[4];
1466*61ae650dSJack F Vogel 	u8	tc_valid_bits;
1467*61ae650dSJack F Vogel 	u8	reserved1;
1468*61ae650dSJack F Vogel 	u8	tc_strict_priority_bits;
1469*61ae650dSJack F Vogel 	u8	reserved2;
1470*61ae650dSJack F Vogel 	u8	tc_bw_share_credits[8];
1471*61ae650dSJack F Vogel 	__le16	tc_bw_limits[8];
1472*61ae650dSJack F Vogel 
1473*61ae650dSJack F Vogel 	/* 4 bits per tc 0-7, 4th bit reserved, limit = 2^max */
1474*61ae650dSJack F Vogel 	__le16	tc_bw_max[2];
1475*61ae650dSJack F Vogel 	u8	reserved3[32];
1476*61ae650dSJack F Vogel };
1477*61ae650dSJack F Vogel 
1478*61ae650dSJack F Vogel /* Query Switching Component Bandwidth Allocation per Traffic Type
1479*61ae650dSJack F Vogel  * (indirect 0x041A)
1480*61ae650dSJack F Vogel  */
1481*61ae650dSJack F Vogel struct i40e_aqc_query_switching_comp_bw_config_resp {
1482*61ae650dSJack F Vogel 	u8	tc_valid_bits;
1483*61ae650dSJack F Vogel 	u8	reserved[2];
1484*61ae650dSJack F Vogel 	u8	absolute_credits_enable; /* bool */
1485*61ae650dSJack F Vogel 	u8	tc_bw_share_credits[8];
1486*61ae650dSJack F Vogel 	__le16	tc_bw_limits[8];
1487*61ae650dSJack F Vogel 
1488*61ae650dSJack F Vogel 	/* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
1489*61ae650dSJack F Vogel 	__le16	tc_bw_max[2];
1490*61ae650dSJack F Vogel };
1491*61ae650dSJack F Vogel 
1492*61ae650dSJack F Vogel /* Suspend/resume port TX traffic
1493*61ae650dSJack F Vogel  * (direct 0x041B and 0x041C) uses the generic SEID struct
1494*61ae650dSJack F Vogel  */
1495*61ae650dSJack F Vogel 
1496*61ae650dSJack F Vogel /* Configure partition BW
1497*61ae650dSJack F Vogel  * (indirect 0x041D)
1498*61ae650dSJack F Vogel  */
1499*61ae650dSJack F Vogel struct i40e_aqc_configure_partition_bw_data {
1500*61ae650dSJack F Vogel 	__le16	pf_valid_bits;
1501*61ae650dSJack F Vogel 	u8	min_bw[16];      /* guaranteed bandwidth */
1502*61ae650dSJack F Vogel 	u8	max_bw[16];      /* bandwidth limit */
1503*61ae650dSJack F Vogel };
1504*61ae650dSJack F Vogel 
1505*61ae650dSJack F Vogel /* Get and set the active HMC resource profile and status.
1506*61ae650dSJack F Vogel  * (direct 0x0500) and (direct 0x0501)
1507*61ae650dSJack F Vogel  */
1508*61ae650dSJack F Vogel struct i40e_aq_get_set_hmc_resource_profile {
1509*61ae650dSJack F Vogel 	u8	pm_profile;
1510*61ae650dSJack F Vogel 	u8	pe_vf_enabled;
1511*61ae650dSJack F Vogel 	u8	reserved[14];
1512*61ae650dSJack F Vogel };
1513*61ae650dSJack F Vogel 
1514*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aq_get_set_hmc_resource_profile);
1515*61ae650dSJack F Vogel 
1516*61ae650dSJack F Vogel enum i40e_aq_hmc_profile {
1517*61ae650dSJack F Vogel 	/* I40E_HMC_PROFILE_NO_CHANGE    = 0, reserved */
1518*61ae650dSJack F Vogel 	I40E_HMC_PROFILE_DEFAULT	= 1,
1519*61ae650dSJack F Vogel 	I40E_HMC_PROFILE_FAVOR_VF	= 2,
1520*61ae650dSJack F Vogel 	I40E_HMC_PROFILE_EQUAL		= 3,
1521*61ae650dSJack F Vogel };
1522*61ae650dSJack F Vogel 
1523*61ae650dSJack F Vogel #define I40E_AQ_GET_HMC_RESOURCE_PROFILE_PM_MASK	0xF
1524*61ae650dSJack F Vogel #define I40E_AQ_GET_HMC_RESOURCE_PROFILE_COUNT_MASK	0x3F
1525*61ae650dSJack F Vogel 
1526*61ae650dSJack F Vogel /* Get PHY Abilities (indirect 0x0600) uses the generic indirect struct */
1527*61ae650dSJack F Vogel 
1528*61ae650dSJack F Vogel /* set in param0 for get phy abilities to report qualified modules */
1529*61ae650dSJack F Vogel #define I40E_AQ_PHY_REPORT_QUALIFIED_MODULES	0x0001
1530*61ae650dSJack F Vogel #define I40E_AQ_PHY_REPORT_INITIAL_VALUES	0x0002
1531*61ae650dSJack F Vogel 
1532*61ae650dSJack F Vogel enum i40e_aq_phy_type {
1533*61ae650dSJack F Vogel 	I40E_PHY_TYPE_SGMII			= 0x0,
1534*61ae650dSJack F Vogel 	I40E_PHY_TYPE_1000BASE_KX		= 0x1,
1535*61ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_KX4		= 0x2,
1536*61ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_KR		= 0x3,
1537*61ae650dSJack F Vogel 	I40E_PHY_TYPE_40GBASE_KR4		= 0x4,
1538*61ae650dSJack F Vogel 	I40E_PHY_TYPE_XAUI			= 0x5,
1539*61ae650dSJack F Vogel 	I40E_PHY_TYPE_XFI			= 0x6,
1540*61ae650dSJack F Vogel 	I40E_PHY_TYPE_SFI			= 0x7,
1541*61ae650dSJack F Vogel 	I40E_PHY_TYPE_XLAUI			= 0x8,
1542*61ae650dSJack F Vogel 	I40E_PHY_TYPE_XLPPI			= 0x9,
1543*61ae650dSJack F Vogel 	I40E_PHY_TYPE_40GBASE_CR4_CU		= 0xA,
1544*61ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_CR1_CU		= 0xB,
1545*61ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_AOC		= 0xC,
1546*61ae650dSJack F Vogel 	I40E_PHY_TYPE_40GBASE_AOC		= 0xD,
1547*61ae650dSJack F Vogel 	I40E_PHY_TYPE_100BASE_TX		= 0x11,
1548*61ae650dSJack F Vogel 	I40E_PHY_TYPE_1000BASE_T		= 0x12,
1549*61ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_T			= 0x13,
1550*61ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_SR		= 0x14,
1551*61ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_LR		= 0x15,
1552*61ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_SFPP_CU		= 0x16,
1553*61ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_CR1		= 0x17,
1554*61ae650dSJack F Vogel 	I40E_PHY_TYPE_40GBASE_CR4		= 0x18,
1555*61ae650dSJack F Vogel 	I40E_PHY_TYPE_40GBASE_SR4		= 0x19,
1556*61ae650dSJack F Vogel 	I40E_PHY_TYPE_40GBASE_LR4		= 0x1A,
1557*61ae650dSJack F Vogel 	I40E_PHY_TYPE_1000BASE_SX		= 0x1B,
1558*61ae650dSJack F Vogel 	I40E_PHY_TYPE_1000BASE_LX		= 0x1C,
1559*61ae650dSJack F Vogel 	I40E_PHY_TYPE_1000BASE_T_OPTICAL	= 0x1D,
1560*61ae650dSJack F Vogel 	I40E_PHY_TYPE_20GBASE_KR2		= 0x1E,
1561*61ae650dSJack F Vogel 	I40E_PHY_TYPE_MAX
1562*61ae650dSJack F Vogel };
1563*61ae650dSJack F Vogel 
1564*61ae650dSJack F Vogel #define I40E_LINK_SPEED_100MB_SHIFT	0x1
1565*61ae650dSJack F Vogel #define I40E_LINK_SPEED_1000MB_SHIFT	0x2
1566*61ae650dSJack F Vogel #define I40E_LINK_SPEED_10GB_SHIFT	0x3
1567*61ae650dSJack F Vogel #define I40E_LINK_SPEED_40GB_SHIFT	0x4
1568*61ae650dSJack F Vogel #define I40E_LINK_SPEED_20GB_SHIFT	0x5
1569*61ae650dSJack F Vogel 
1570*61ae650dSJack F Vogel enum i40e_aq_link_speed {
1571*61ae650dSJack F Vogel 	I40E_LINK_SPEED_UNKNOWN	= 0,
1572*61ae650dSJack F Vogel 	I40E_LINK_SPEED_100MB	= (1 << I40E_LINK_SPEED_100MB_SHIFT),
1573*61ae650dSJack F Vogel 	I40E_LINK_SPEED_1GB	= (1 << I40E_LINK_SPEED_1000MB_SHIFT),
1574*61ae650dSJack F Vogel 	I40E_LINK_SPEED_10GB	= (1 << I40E_LINK_SPEED_10GB_SHIFT),
1575*61ae650dSJack F Vogel 	I40E_LINK_SPEED_40GB	= (1 << I40E_LINK_SPEED_40GB_SHIFT),
1576*61ae650dSJack F Vogel 	I40E_LINK_SPEED_20GB	= (1 << I40E_LINK_SPEED_20GB_SHIFT)
1577*61ae650dSJack F Vogel };
1578*61ae650dSJack F Vogel 
1579*61ae650dSJack F Vogel struct i40e_aqc_module_desc {
1580*61ae650dSJack F Vogel 	u8 oui[3];
1581*61ae650dSJack F Vogel 	u8 reserved1;
1582*61ae650dSJack F Vogel 	u8 part_number[16];
1583*61ae650dSJack F Vogel 	u8 revision[4];
1584*61ae650dSJack F Vogel 	u8 reserved2[8];
1585*61ae650dSJack F Vogel };
1586*61ae650dSJack F Vogel 
1587*61ae650dSJack F Vogel struct i40e_aq_get_phy_abilities_resp {
1588*61ae650dSJack F Vogel 	__le32	phy_type;       /* bitmap using the above enum for offsets */
1589*61ae650dSJack F Vogel 	u8	link_speed;     /* bitmap using the above enum bit patterns */
1590*61ae650dSJack F Vogel 	u8	abilities;
1591*61ae650dSJack F Vogel #define I40E_AQ_PHY_FLAG_PAUSE_TX	0x01
1592*61ae650dSJack F Vogel #define I40E_AQ_PHY_FLAG_PAUSE_RX	0x02
1593*61ae650dSJack F Vogel #define I40E_AQ_PHY_FLAG_LOW_POWER	0x04
1594*61ae650dSJack F Vogel #define I40E_AQ_PHY_LINK_ENABLED	0x08
1595*61ae650dSJack F Vogel #define I40E_AQ_PHY_AN_ENABLED		0x10
1596*61ae650dSJack F Vogel #define I40E_AQ_PHY_FLAG_MODULE_QUAL	0x20
1597*61ae650dSJack F Vogel 	__le16	eee_capability;
1598*61ae650dSJack F Vogel #define I40E_AQ_EEE_100BASE_TX		0x0002
1599*61ae650dSJack F Vogel #define I40E_AQ_EEE_1000BASE_T		0x0004
1600*61ae650dSJack F Vogel #define I40E_AQ_EEE_10GBASE_T		0x0008
1601*61ae650dSJack F Vogel #define I40E_AQ_EEE_1000BASE_KX		0x0010
1602*61ae650dSJack F Vogel #define I40E_AQ_EEE_10GBASE_KX4		0x0020
1603*61ae650dSJack F Vogel #define I40E_AQ_EEE_10GBASE_KR		0x0040
1604*61ae650dSJack F Vogel 	__le32	eeer_val;
1605*61ae650dSJack F Vogel 	u8	d3_lpan;
1606*61ae650dSJack F Vogel #define I40E_AQ_SET_PHY_D3_LPAN_ENA	0x01
1607*61ae650dSJack F Vogel 	u8	reserved[3];
1608*61ae650dSJack F Vogel 	u8	phy_id[4];
1609*61ae650dSJack F Vogel 	u8	module_type[3];
1610*61ae650dSJack F Vogel 	u8	qualified_module_count;
1611*61ae650dSJack F Vogel #define I40E_AQ_PHY_MAX_QMS		16
1612*61ae650dSJack F Vogel 	struct i40e_aqc_module_desc	qualified_module[I40E_AQ_PHY_MAX_QMS];
1613*61ae650dSJack F Vogel };
1614*61ae650dSJack F Vogel 
1615*61ae650dSJack F Vogel /* Set PHY Config (direct 0x0601) */
1616*61ae650dSJack F Vogel struct i40e_aq_set_phy_config { /* same bits as above in all */
1617*61ae650dSJack F Vogel 	__le32	phy_type;
1618*61ae650dSJack F Vogel 	u8	link_speed;
1619*61ae650dSJack F Vogel 	u8	abilities;
1620*61ae650dSJack F Vogel /* bits 0-2 use the values from get_phy_abilities_resp */
1621*61ae650dSJack F Vogel #define I40E_AQ_PHY_ENABLE_LINK		0x08
1622*61ae650dSJack F Vogel #define I40E_AQ_PHY_ENABLE_AN		0x10
1623*61ae650dSJack F Vogel #define I40E_AQ_PHY_ENABLE_ATOMIC_LINK	0x20
1624*61ae650dSJack F Vogel 	__le16	eee_capability;
1625*61ae650dSJack F Vogel 	__le32	eeer;
1626*61ae650dSJack F Vogel 	u8	low_power_ctrl;
1627*61ae650dSJack F Vogel 	u8	reserved[3];
1628*61ae650dSJack F Vogel };
1629*61ae650dSJack F Vogel 
1630*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config);
1631*61ae650dSJack F Vogel 
1632*61ae650dSJack F Vogel /* Set MAC Config command data structure (direct 0x0603) */
1633*61ae650dSJack F Vogel struct i40e_aq_set_mac_config {
1634*61ae650dSJack F Vogel 	__le16	max_frame_size;
1635*61ae650dSJack F Vogel 	u8	params;
1636*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_CRC_EN		0x04
1637*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_MASK	0x78
1638*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_SHIFT	3
1639*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_NONE	0x0
1640*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_1B_13TX	0xF
1641*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_9TX	0x9
1642*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_4TX	0x8
1643*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_7TX	0x7
1644*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_2DW_3TX	0x6
1645*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_1TX	0x5
1646*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_2TX	0x4
1647*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_7DW_3TX	0x3
1648*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_4DW_1TX	0x2
1649*61ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_9DW_1TX	0x1
1650*61ae650dSJack F Vogel 	u8	tx_timer_priority; /* bitmap */
1651*61ae650dSJack F Vogel 	__le16	tx_timer_value;
1652*61ae650dSJack F Vogel 	__le16	fc_refresh_threshold;
1653*61ae650dSJack F Vogel 	u8	reserved[8];
1654*61ae650dSJack F Vogel };
1655*61ae650dSJack F Vogel 
1656*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aq_set_mac_config);
1657*61ae650dSJack F Vogel 
1658*61ae650dSJack F Vogel /* Restart Auto-Negotiation (direct 0x605) */
1659*61ae650dSJack F Vogel struct i40e_aqc_set_link_restart_an {
1660*61ae650dSJack F Vogel 	u8	command;
1661*61ae650dSJack F Vogel #define I40E_AQ_PHY_RESTART_AN	0x02
1662*61ae650dSJack F Vogel #define I40E_AQ_PHY_LINK_ENABLE	0x04
1663*61ae650dSJack F Vogel 	u8	reserved[15];
1664*61ae650dSJack F Vogel };
1665*61ae650dSJack F Vogel 
1666*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_link_restart_an);
1667*61ae650dSJack F Vogel 
1668*61ae650dSJack F Vogel /* Get Link Status cmd & response data structure (direct 0x0607) */
1669*61ae650dSJack F Vogel struct i40e_aqc_get_link_status {
1670*61ae650dSJack F Vogel 	__le16	command_flags; /* only field set on command */
1671*61ae650dSJack F Vogel #define I40E_AQ_LSE_MASK		0x3
1672*61ae650dSJack F Vogel #define I40E_AQ_LSE_NOP			0x0
1673*61ae650dSJack F Vogel #define I40E_AQ_LSE_DISABLE		0x2
1674*61ae650dSJack F Vogel #define I40E_AQ_LSE_ENABLE		0x3
1675*61ae650dSJack F Vogel /* only response uses this flag */
1676*61ae650dSJack F Vogel #define I40E_AQ_LSE_IS_ENABLED		0x1
1677*61ae650dSJack F Vogel 	u8	phy_type;    /* i40e_aq_phy_type   */
1678*61ae650dSJack F Vogel 	u8	link_speed;  /* i40e_aq_link_speed */
1679*61ae650dSJack F Vogel 	u8	link_info;
1680*61ae650dSJack F Vogel #define I40E_AQ_LINK_UP			0x01
1681*61ae650dSJack F Vogel #define I40E_AQ_LINK_FAULT		0x02
1682*61ae650dSJack F Vogel #define I40E_AQ_LINK_FAULT_TX		0x04
1683*61ae650dSJack F Vogel #define I40E_AQ_LINK_FAULT_RX		0x08
1684*61ae650dSJack F Vogel #define I40E_AQ_LINK_FAULT_REMOTE	0x10
1685*61ae650dSJack F Vogel #define I40E_AQ_MEDIA_AVAILABLE		0x40
1686*61ae650dSJack F Vogel #define I40E_AQ_SIGNAL_DETECT		0x80
1687*61ae650dSJack F Vogel 	u8	an_info;
1688*61ae650dSJack F Vogel #define I40E_AQ_AN_COMPLETED		0x01
1689*61ae650dSJack F Vogel #define I40E_AQ_LP_AN_ABILITY		0x02
1690*61ae650dSJack F Vogel #define I40E_AQ_PD_FAULT		0x04
1691*61ae650dSJack F Vogel #define I40E_AQ_FEC_EN			0x08
1692*61ae650dSJack F Vogel #define I40E_AQ_PHY_LOW_POWER		0x10
1693*61ae650dSJack F Vogel #define I40E_AQ_LINK_PAUSE_TX		0x20
1694*61ae650dSJack F Vogel #define I40E_AQ_LINK_PAUSE_RX		0x40
1695*61ae650dSJack F Vogel #define I40E_AQ_QUALIFIED_MODULE	0x80
1696*61ae650dSJack F Vogel 	u8	ext_info;
1697*61ae650dSJack F Vogel #define I40E_AQ_LINK_PHY_TEMP_ALARM	0x01
1698*61ae650dSJack F Vogel #define I40E_AQ_LINK_XCESSIVE_ERRORS	0x02
1699*61ae650dSJack F Vogel #define I40E_AQ_LINK_TX_SHIFT		0x02
1700*61ae650dSJack F Vogel #define I40E_AQ_LINK_TX_MASK		(0x03 << I40E_AQ_LINK_TX_SHIFT)
1701*61ae650dSJack F Vogel #define I40E_AQ_LINK_TX_ACTIVE		0x00
1702*61ae650dSJack F Vogel #define I40E_AQ_LINK_TX_DRAINED		0x01
1703*61ae650dSJack F Vogel #define I40E_AQ_LINK_TX_FLUSHED		0x03
1704*61ae650dSJack F Vogel #define I40E_AQ_LINK_FORCED_40G		0x10
1705*61ae650dSJack F Vogel 	u8	loopback; /* use defines from i40e_aqc_set_lb_mode */
1706*61ae650dSJack F Vogel 	__le16	max_frame_size;
1707*61ae650dSJack F Vogel 	u8	config;
1708*61ae650dSJack F Vogel #define I40E_AQ_CONFIG_CRC_ENA		0x04
1709*61ae650dSJack F Vogel #define I40E_AQ_CONFIG_PACING_MASK	0x78
1710*61ae650dSJack F Vogel 	u8	reserved[5];
1711*61ae650dSJack F Vogel };
1712*61ae650dSJack F Vogel 
1713*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_link_status);
1714*61ae650dSJack F Vogel 
1715*61ae650dSJack F Vogel /* Set event mask command (direct 0x613) */
1716*61ae650dSJack F Vogel struct i40e_aqc_set_phy_int_mask {
1717*61ae650dSJack F Vogel 	u8	reserved[8];
1718*61ae650dSJack F Vogel 	__le16	event_mask;
1719*61ae650dSJack F Vogel #define I40E_AQ_EVENT_LINK_UPDOWN	0x0002
1720*61ae650dSJack F Vogel #define I40E_AQ_EVENT_MEDIA_NA		0x0004
1721*61ae650dSJack F Vogel #define I40E_AQ_EVENT_LINK_FAULT	0x0008
1722*61ae650dSJack F Vogel #define I40E_AQ_EVENT_PHY_TEMP_ALARM	0x0010
1723*61ae650dSJack F Vogel #define I40E_AQ_EVENT_EXCESSIVE_ERRORS	0x0020
1724*61ae650dSJack F Vogel #define I40E_AQ_EVENT_SIGNAL_DETECT	0x0040
1725*61ae650dSJack F Vogel #define I40E_AQ_EVENT_AN_COMPLETED	0x0080
1726*61ae650dSJack F Vogel #define I40E_AQ_EVENT_MODULE_QUAL_FAIL	0x0100
1727*61ae650dSJack F Vogel #define I40E_AQ_EVENT_PORT_TX_SUSPENDED	0x0200
1728*61ae650dSJack F Vogel 	u8	reserved1[6];
1729*61ae650dSJack F Vogel };
1730*61ae650dSJack F Vogel 
1731*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_phy_int_mask);
1732*61ae650dSJack F Vogel 
1733*61ae650dSJack F Vogel /* Get Local AN advt register (direct 0x0614)
1734*61ae650dSJack F Vogel  * Set Local AN advt register (direct 0x0615)
1735*61ae650dSJack F Vogel  * Get Link Partner AN advt register (direct 0x0616)
1736*61ae650dSJack F Vogel  */
1737*61ae650dSJack F Vogel struct i40e_aqc_an_advt_reg {
1738*61ae650dSJack F Vogel 	__le32	local_an_reg0;
1739*61ae650dSJack F Vogel 	__le16	local_an_reg1;
1740*61ae650dSJack F Vogel 	u8	reserved[10];
1741*61ae650dSJack F Vogel };
1742*61ae650dSJack F Vogel 
1743*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_an_advt_reg);
1744*61ae650dSJack F Vogel 
1745*61ae650dSJack F Vogel /* Set Loopback mode (0x0618) */
1746*61ae650dSJack F Vogel struct i40e_aqc_set_lb_mode {
1747*61ae650dSJack F Vogel 	__le16	lb_mode;
1748*61ae650dSJack F Vogel #define I40E_AQ_LB_PHY_LOCAL	0x01
1749*61ae650dSJack F Vogel #define I40E_AQ_LB_PHY_REMOTE	0x02
1750*61ae650dSJack F Vogel #define I40E_AQ_LB_MAC_LOCAL	0x04
1751*61ae650dSJack F Vogel 	u8	reserved[14];
1752*61ae650dSJack F Vogel };
1753*61ae650dSJack F Vogel 
1754*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_lb_mode);
1755*61ae650dSJack F Vogel 
1756*61ae650dSJack F Vogel /* Set PHY Debug command (0x0622) */
1757*61ae650dSJack F Vogel struct i40e_aqc_set_phy_debug {
1758*61ae650dSJack F Vogel 	u8	command_flags;
1759*61ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_INTERNAL	0x02
1760*61ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SHIFT	2
1761*61ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_MASK	(0x03 << \
1762*61ae650dSJack F Vogel 					I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SHIFT)
1763*61ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_NONE	0x00
1764*61ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_HARD	0x01
1765*61ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SOFT	0x02
1766*61ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_DISABLE_LINK_FW	0x10
1767*61ae650dSJack F Vogel 	u8	reserved[15];
1768*61ae650dSJack F Vogel };
1769*61ae650dSJack F Vogel 
1770*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_phy_debug);
1771*61ae650dSJack F Vogel 
1772*61ae650dSJack F Vogel enum i40e_aq_phy_reg_type {
1773*61ae650dSJack F Vogel 	I40E_AQC_PHY_REG_INTERNAL	= 0x1,
1774*61ae650dSJack F Vogel 	I40E_AQC_PHY_REG_EXERNAL_BASET	= 0x2,
1775*61ae650dSJack F Vogel 	I40E_AQC_PHY_REG_EXERNAL_MODULE	= 0x3
1776*61ae650dSJack F Vogel };
1777*61ae650dSJack F Vogel 
1778*61ae650dSJack F Vogel /* NVM Read command (indirect 0x0701)
1779*61ae650dSJack F Vogel  * NVM Erase commands (direct 0x0702)
1780*61ae650dSJack F Vogel  * NVM Update commands (indirect 0x0703)
1781*61ae650dSJack F Vogel  */
1782*61ae650dSJack F Vogel struct i40e_aqc_nvm_update {
1783*61ae650dSJack F Vogel 	u8	command_flags;
1784*61ae650dSJack F Vogel #define I40E_AQ_NVM_LAST_CMD	0x01
1785*61ae650dSJack F Vogel #define I40E_AQ_NVM_FLASH_ONLY	0x80
1786*61ae650dSJack F Vogel 	u8	module_pointer;
1787*61ae650dSJack F Vogel 	__le16	length;
1788*61ae650dSJack F Vogel 	__le32	offset;
1789*61ae650dSJack F Vogel 	__le32	addr_high;
1790*61ae650dSJack F Vogel 	__le32	addr_low;
1791*61ae650dSJack F Vogel };
1792*61ae650dSJack F Vogel 
1793*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update);
1794*61ae650dSJack F Vogel 
1795*61ae650dSJack F Vogel /* NVM Config Read (indirect 0x0704) */
1796*61ae650dSJack F Vogel struct i40e_aqc_nvm_config_read {
1797*61ae650dSJack F Vogel 	__le16	cmd_flags;
1798*61ae650dSJack F Vogel #define ANVM_SINGLE_OR_MULTIPLE_FEATURES_MASK	1
1799*61ae650dSJack F Vogel #define ANVM_READ_SINGLE_FEATURE		0
1800*61ae650dSJack F Vogel #define ANVM_READ_MULTIPLE_FEATURES		1
1801*61ae650dSJack F Vogel 	__le16	element_count;
1802*61ae650dSJack F Vogel 	__le16	element_id; /* Feature/field ID */
1803*61ae650dSJack F Vogel 	u8	reserved[2];
1804*61ae650dSJack F Vogel 	__le32	address_high;
1805*61ae650dSJack F Vogel 	__le32	address_low;
1806*61ae650dSJack F Vogel };
1807*61ae650dSJack F Vogel 
1808*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_read);
1809*61ae650dSJack F Vogel 
1810*61ae650dSJack F Vogel /* NVM Config Write (indirect 0x0705) */
1811*61ae650dSJack F Vogel struct i40e_aqc_nvm_config_write {
1812*61ae650dSJack F Vogel 	__le16	cmd_flags;
1813*61ae650dSJack F Vogel 	__le16	element_count;
1814*61ae650dSJack F Vogel 	u8	reserved[4];
1815*61ae650dSJack F Vogel 	__le32	address_high;
1816*61ae650dSJack F Vogel 	__le32	address_low;
1817*61ae650dSJack F Vogel };
1818*61ae650dSJack F Vogel 
1819*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_write);
1820*61ae650dSJack F Vogel 
1821*61ae650dSJack F Vogel struct i40e_aqc_nvm_config_data_feature {
1822*61ae650dSJack F Vogel 	__le16 feature_id;
1823*61ae650dSJack F Vogel 	__le16 instance_id;
1824*61ae650dSJack F Vogel 	__le16 feature_options;
1825*61ae650dSJack F Vogel 	__le16 feature_selection;
1826*61ae650dSJack F Vogel };
1827*61ae650dSJack F Vogel 
1828*61ae650dSJack F Vogel struct i40e_aqc_nvm_config_data_immediate_field {
1829*61ae650dSJack F Vogel #define ANVM_FEATURE_OR_IMMEDIATE_MASK	0x2
1830*61ae650dSJack F Vogel 	__le16 field_id;
1831*61ae650dSJack F Vogel 	__le16 instance_id;
1832*61ae650dSJack F Vogel 	__le16 field_options;
1833*61ae650dSJack F Vogel 	__le16 field_value;
1834*61ae650dSJack F Vogel };
1835*61ae650dSJack F Vogel 
1836*61ae650dSJack F Vogel /* Send to PF command (indirect 0x0801) id is only used by PF
1837*61ae650dSJack F Vogel  * Send to VF command (indirect 0x0802) id is only used by PF
1838*61ae650dSJack F Vogel  * Send to Peer PF command (indirect 0x0803)
1839*61ae650dSJack F Vogel  */
1840*61ae650dSJack F Vogel struct i40e_aqc_pf_vf_message {
1841*61ae650dSJack F Vogel 	__le32	id;
1842*61ae650dSJack F Vogel 	u8	reserved[4];
1843*61ae650dSJack F Vogel 	__le32	addr_high;
1844*61ae650dSJack F Vogel 	__le32	addr_low;
1845*61ae650dSJack F Vogel };
1846*61ae650dSJack F Vogel 
1847*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_pf_vf_message);
1848*61ae650dSJack F Vogel 
1849*61ae650dSJack F Vogel /* Alternate structure */
1850*61ae650dSJack F Vogel 
1851*61ae650dSJack F Vogel /* Direct write (direct 0x0900)
1852*61ae650dSJack F Vogel  * Direct read (direct 0x0902)
1853*61ae650dSJack F Vogel  */
1854*61ae650dSJack F Vogel struct i40e_aqc_alternate_write {
1855*61ae650dSJack F Vogel 	__le32 address0;
1856*61ae650dSJack F Vogel 	__le32 data0;
1857*61ae650dSJack F Vogel 	__le32 address1;
1858*61ae650dSJack F Vogel 	__le32 data1;
1859*61ae650dSJack F Vogel };
1860*61ae650dSJack F Vogel 
1861*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_write);
1862*61ae650dSJack F Vogel 
1863*61ae650dSJack F Vogel /* Indirect write (indirect 0x0901)
1864*61ae650dSJack F Vogel  * Indirect read (indirect 0x0903)
1865*61ae650dSJack F Vogel  */
1866*61ae650dSJack F Vogel 
1867*61ae650dSJack F Vogel struct i40e_aqc_alternate_ind_write {
1868*61ae650dSJack F Vogel 	__le32 address;
1869*61ae650dSJack F Vogel 	__le32 length;
1870*61ae650dSJack F Vogel 	__le32 addr_high;
1871*61ae650dSJack F Vogel 	__le32 addr_low;
1872*61ae650dSJack F Vogel };
1873*61ae650dSJack F Vogel 
1874*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_ind_write);
1875*61ae650dSJack F Vogel 
1876*61ae650dSJack F Vogel /* Done alternate write (direct 0x0904)
1877*61ae650dSJack F Vogel  * uses i40e_aq_desc
1878*61ae650dSJack F Vogel  */
1879*61ae650dSJack F Vogel struct i40e_aqc_alternate_write_done {
1880*61ae650dSJack F Vogel 	__le16	cmd_flags;
1881*61ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_BIOS_MASK	1
1882*61ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_BIOS_LEGACY	0
1883*61ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_BIOS_UEFI	1
1884*61ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_RESET_NEEDED		2
1885*61ae650dSJack F Vogel 	u8	reserved[14];
1886*61ae650dSJack F Vogel };
1887*61ae650dSJack F Vogel 
1888*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_write_done);
1889*61ae650dSJack F Vogel 
1890*61ae650dSJack F Vogel /* Set OEM mode (direct 0x0905) */
1891*61ae650dSJack F Vogel struct i40e_aqc_alternate_set_mode {
1892*61ae650dSJack F Vogel 	__le32	mode;
1893*61ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_NONE	0
1894*61ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_OEM	1
1895*61ae650dSJack F Vogel 	u8	reserved[12];
1896*61ae650dSJack F Vogel };
1897*61ae650dSJack F Vogel 
1898*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_set_mode);
1899*61ae650dSJack F Vogel 
1900*61ae650dSJack F Vogel /* Clear port Alternate RAM (direct 0x0906) uses i40e_aq_desc */
1901*61ae650dSJack F Vogel 
1902*61ae650dSJack F Vogel /* async events 0x10xx */
1903*61ae650dSJack F Vogel 
1904*61ae650dSJack F Vogel /* Lan Queue Overflow Event (direct, 0x1001) */
1905*61ae650dSJack F Vogel struct i40e_aqc_lan_overflow {
1906*61ae650dSJack F Vogel 	__le32	prtdcb_rupto;
1907*61ae650dSJack F Vogel 	__le32	otx_ctl;
1908*61ae650dSJack F Vogel 	u8	reserved[8];
1909*61ae650dSJack F Vogel };
1910*61ae650dSJack F Vogel 
1911*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lan_overflow);
1912*61ae650dSJack F Vogel 
1913*61ae650dSJack F Vogel /* Get LLDP MIB (indirect 0x0A00) */
1914*61ae650dSJack F Vogel struct i40e_aqc_lldp_get_mib {
1915*61ae650dSJack F Vogel 	u8	type;
1916*61ae650dSJack F Vogel 	u8	reserved1;
1917*61ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_TYPE_MASK		0x3
1918*61ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_LOCAL			0x0
1919*61ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_REMOTE			0x1
1920*61ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_LOCAL_AND_REMOTE	0x2
1921*61ae650dSJack F Vogel #define I40E_AQ_LLDP_BRIDGE_TYPE_MASK		0xC
1922*61ae650dSJack F Vogel #define I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT		0x2
1923*61ae650dSJack F Vogel #define I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE	0x0
1924*61ae650dSJack F Vogel #define I40E_AQ_LLDP_BRIDGE_TYPE_NON_TPMR	0x1
1925*61ae650dSJack F Vogel #define I40E_AQ_LLDP_TX_SHIFT			0x4
1926*61ae650dSJack F Vogel #define I40E_AQ_LLDP_TX_MASK			(0x03 << I40E_AQ_LLDP_TX_SHIFT)
1927*61ae650dSJack F Vogel /* TX pause flags use I40E_AQ_LINK_TX_* above */
1928*61ae650dSJack F Vogel 	__le16	local_len;
1929*61ae650dSJack F Vogel 	__le16	remote_len;
1930*61ae650dSJack F Vogel 	u8	reserved2[2];
1931*61ae650dSJack F Vogel 	__le32	addr_high;
1932*61ae650dSJack F Vogel 	__le32	addr_low;
1933*61ae650dSJack F Vogel };
1934*61ae650dSJack F Vogel 
1935*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_get_mib);
1936*61ae650dSJack F Vogel 
1937*61ae650dSJack F Vogel /* Configure LLDP MIB Change Event (direct 0x0A01)
1938*61ae650dSJack F Vogel  * also used for the event (with type in the command field)
1939*61ae650dSJack F Vogel  */
1940*61ae650dSJack F Vogel struct i40e_aqc_lldp_update_mib {
1941*61ae650dSJack F Vogel 	u8	command;
1942*61ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_UPDATE_ENABLE	0x0
1943*61ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_UPDATE_DISABLE	0x1
1944*61ae650dSJack F Vogel 	u8	reserved[7];
1945*61ae650dSJack F Vogel 	__le32	addr_high;
1946*61ae650dSJack F Vogel 	__le32	addr_low;
1947*61ae650dSJack F Vogel };
1948*61ae650dSJack F Vogel 
1949*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_mib);
1950*61ae650dSJack F Vogel 
1951*61ae650dSJack F Vogel /* Add LLDP TLV (indirect 0x0A02)
1952*61ae650dSJack F Vogel  * Delete LLDP TLV (indirect 0x0A04)
1953*61ae650dSJack F Vogel  */
1954*61ae650dSJack F Vogel struct i40e_aqc_lldp_add_tlv {
1955*61ae650dSJack F Vogel 	u8	type; /* only nearest bridge and non-TPMR from 0x0A00 */
1956*61ae650dSJack F Vogel 	u8	reserved1[1];
1957*61ae650dSJack F Vogel 	__le16	len;
1958*61ae650dSJack F Vogel 	u8	reserved2[4];
1959*61ae650dSJack F Vogel 	__le32	addr_high;
1960*61ae650dSJack F Vogel 	__le32	addr_low;
1961*61ae650dSJack F Vogel };
1962*61ae650dSJack F Vogel 
1963*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_add_tlv);
1964*61ae650dSJack F Vogel 
1965*61ae650dSJack F Vogel /* Update LLDP TLV (indirect 0x0A03) */
1966*61ae650dSJack F Vogel struct i40e_aqc_lldp_update_tlv {
1967*61ae650dSJack F Vogel 	u8	type; /* only nearest bridge and non-TPMR from 0x0A00 */
1968*61ae650dSJack F Vogel 	u8	reserved;
1969*61ae650dSJack F Vogel 	__le16	old_len;
1970*61ae650dSJack F Vogel 	__le16	new_offset;
1971*61ae650dSJack F Vogel 	__le16	new_len;
1972*61ae650dSJack F Vogel 	__le32	addr_high;
1973*61ae650dSJack F Vogel 	__le32	addr_low;
1974*61ae650dSJack F Vogel };
1975*61ae650dSJack F Vogel 
1976*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_tlv);
1977*61ae650dSJack F Vogel 
1978*61ae650dSJack F Vogel /* Stop LLDP (direct 0x0A05) */
1979*61ae650dSJack F Vogel struct i40e_aqc_lldp_stop {
1980*61ae650dSJack F Vogel 	u8	command;
1981*61ae650dSJack F Vogel #define I40E_AQ_LLDP_AGENT_STOP		0x0
1982*61ae650dSJack F Vogel #define I40E_AQ_LLDP_AGENT_SHUTDOWN	0x1
1983*61ae650dSJack F Vogel 	u8	reserved[15];
1984*61ae650dSJack F Vogel };
1985*61ae650dSJack F Vogel 
1986*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop);
1987*61ae650dSJack F Vogel 
1988*61ae650dSJack F Vogel /* Start LLDP (direct 0x0A06) */
1989*61ae650dSJack F Vogel 
1990*61ae650dSJack F Vogel struct i40e_aqc_lldp_start {
1991*61ae650dSJack F Vogel 	u8	command;
1992*61ae650dSJack F Vogel #define I40E_AQ_LLDP_AGENT_START	0x1
1993*61ae650dSJack F Vogel 	u8	reserved[15];
1994*61ae650dSJack F Vogel };
1995*61ae650dSJack F Vogel 
1996*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
1997*61ae650dSJack F Vogel 
1998*61ae650dSJack F Vogel /* Apply MIB changes (0x0A07)
1999*61ae650dSJack F Vogel  * uses the generic struc as it contains no data
2000*61ae650dSJack F Vogel  */
2001*61ae650dSJack F Vogel 
2002*61ae650dSJack F Vogel /* Add Udp Tunnel command and completion (direct 0x0B00) */
2003*61ae650dSJack F Vogel struct i40e_aqc_add_udp_tunnel {
2004*61ae650dSJack F Vogel 	__le16	udp_port;
2005*61ae650dSJack F Vogel 	u8	reserved0[3];
2006*61ae650dSJack F Vogel 	u8	protocol_type;
2007*61ae650dSJack F Vogel #define I40E_AQC_TUNNEL_TYPE_VXLAN	0x00
2008*61ae650dSJack F Vogel #define I40E_AQC_TUNNEL_TYPE_NGE	0x01
2009*61ae650dSJack F Vogel #define I40E_AQC_TUNNEL_TYPE_TEREDO	0x10
2010*61ae650dSJack F Vogel 	u8	reserved1[10];
2011*61ae650dSJack F Vogel };
2012*61ae650dSJack F Vogel 
2013*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel);
2014*61ae650dSJack F Vogel 
2015*61ae650dSJack F Vogel struct i40e_aqc_add_udp_tunnel_completion {
2016*61ae650dSJack F Vogel 	__le16 udp_port;
2017*61ae650dSJack F Vogel 	u8	filter_entry_index;
2018*61ae650dSJack F Vogel 	u8	multiple_pfs;
2019*61ae650dSJack F Vogel #define I40E_AQC_SINGLE_PF		0x0
2020*61ae650dSJack F Vogel #define I40E_AQC_MULTIPLE_PFS		0x1
2021*61ae650dSJack F Vogel 	u8	total_filters;
2022*61ae650dSJack F Vogel 	u8	reserved[11];
2023*61ae650dSJack F Vogel };
2024*61ae650dSJack F Vogel 
2025*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel_completion);
2026*61ae650dSJack F Vogel 
2027*61ae650dSJack F Vogel /* remove UDP Tunnel command (0x0B01) */
2028*61ae650dSJack F Vogel struct i40e_aqc_remove_udp_tunnel {
2029*61ae650dSJack F Vogel 	u8	reserved[2];
2030*61ae650dSJack F Vogel 	u8	index; /* 0 to 15 */
2031*61ae650dSJack F Vogel 	u8	reserved2[13];
2032*61ae650dSJack F Vogel };
2033*61ae650dSJack F Vogel 
2034*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_udp_tunnel);
2035*61ae650dSJack F Vogel 
2036*61ae650dSJack F Vogel struct i40e_aqc_del_udp_tunnel_completion {
2037*61ae650dSJack F Vogel 	__le16	udp_port;
2038*61ae650dSJack F Vogel 	u8	index; /* 0 to 15 */
2039*61ae650dSJack F Vogel 	u8	multiple_pfs;
2040*61ae650dSJack F Vogel 	u8	total_filters_used;
2041*61ae650dSJack F Vogel 	u8	reserved1[11];
2042*61ae650dSJack F Vogel };
2043*61ae650dSJack F Vogel 
2044*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion);
2045*61ae650dSJack F Vogel 
2046*61ae650dSJack F Vogel /* tunnel key structure 0x0B10 */
2047*61ae650dSJack F Vogel 
2048*61ae650dSJack F Vogel struct i40e_aqc_tunnel_key_structure {
2049*61ae650dSJack F Vogel 	u8	key1_off;
2050*61ae650dSJack F Vogel 	u8	key2_off;
2051*61ae650dSJack F Vogel 	u8	key1_len;  /* 0 to 15 */
2052*61ae650dSJack F Vogel 	u8	key2_len;  /* 0 to 15 */
2053*61ae650dSJack F Vogel 	u8	flags;
2054*61ae650dSJack F Vogel #define I40E_AQC_TUNNEL_KEY_STRUCT_OVERRIDE	0x01
2055*61ae650dSJack F Vogel /* response flags */
2056*61ae650dSJack F Vogel #define I40E_AQC_TUNNEL_KEY_STRUCT_SUCCESS	0x01
2057*61ae650dSJack F Vogel #define I40E_AQC_TUNNEL_KEY_STRUCT_MODIFIED	0x02
2058*61ae650dSJack F Vogel #define I40E_AQC_TUNNEL_KEY_STRUCT_OVERRIDDEN	0x03
2059*61ae650dSJack F Vogel 	u8	network_key_index;
2060*61ae650dSJack F Vogel #define I40E_AQC_NETWORK_KEY_INDEX_VXLAN		0x0
2061*61ae650dSJack F Vogel #define I40E_AQC_NETWORK_KEY_INDEX_NGE			0x1
2062*61ae650dSJack F Vogel #define I40E_AQC_NETWORK_KEY_INDEX_FLEX_MAC_IN_UDP	0x2
2063*61ae650dSJack F Vogel #define I40E_AQC_NETWORK_KEY_INDEX_GRE			0x3
2064*61ae650dSJack F Vogel 	u8	reserved[10];
2065*61ae650dSJack F Vogel };
2066*61ae650dSJack F Vogel 
2067*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_tunnel_key_structure);
2068*61ae650dSJack F Vogel 
2069*61ae650dSJack F Vogel /* OEM mode commands (direct 0xFE0x) */
2070*61ae650dSJack F Vogel struct i40e_aqc_oem_param_change {
2071*61ae650dSJack F Vogel 	__le32	param_type;
2072*61ae650dSJack F Vogel #define I40E_AQ_OEM_PARAM_TYPE_PF_CTL	0
2073*61ae650dSJack F Vogel #define I40E_AQ_OEM_PARAM_TYPE_BW_CTL	1
2074*61ae650dSJack F Vogel #define I40E_AQ_OEM_PARAM_MAC		2
2075*61ae650dSJack F Vogel 	__le32	param_value1;
2076*61ae650dSJack F Vogel 	u8	param_value2[8];
2077*61ae650dSJack F Vogel };
2078*61ae650dSJack F Vogel 
2079*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_oem_param_change);
2080*61ae650dSJack F Vogel 
2081*61ae650dSJack F Vogel struct i40e_aqc_oem_state_change {
2082*61ae650dSJack F Vogel 	__le32	state;
2083*61ae650dSJack F Vogel #define I40E_AQ_OEM_STATE_LINK_DOWN	0x0
2084*61ae650dSJack F Vogel #define I40E_AQ_OEM_STATE_LINK_UP	0x1
2085*61ae650dSJack F Vogel 	u8	reserved[12];
2086*61ae650dSJack F Vogel };
2087*61ae650dSJack F Vogel 
2088*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_oem_state_change);
2089*61ae650dSJack F Vogel 
2090*61ae650dSJack F Vogel /* debug commands */
2091*61ae650dSJack F Vogel 
2092*61ae650dSJack F Vogel /* get device id (0xFF00) uses the generic structure */
2093*61ae650dSJack F Vogel 
2094*61ae650dSJack F Vogel /* set test more (0xFF01, internal) */
2095*61ae650dSJack F Vogel 
2096*61ae650dSJack F Vogel struct i40e_acq_set_test_mode {
2097*61ae650dSJack F Vogel 	u8	mode;
2098*61ae650dSJack F Vogel #define I40E_AQ_TEST_PARTIAL	0
2099*61ae650dSJack F Vogel #define I40E_AQ_TEST_FULL	1
2100*61ae650dSJack F Vogel #define I40E_AQ_TEST_NVM	2
2101*61ae650dSJack F Vogel 	u8	reserved[3];
2102*61ae650dSJack F Vogel 	u8	command;
2103*61ae650dSJack F Vogel #define I40E_AQ_TEST_OPEN	0
2104*61ae650dSJack F Vogel #define I40E_AQ_TEST_CLOSE	1
2105*61ae650dSJack F Vogel #define I40E_AQ_TEST_INC	2
2106*61ae650dSJack F Vogel 	u8	reserved2[3];
2107*61ae650dSJack F Vogel 	__le32	address_high;
2108*61ae650dSJack F Vogel 	__le32	address_low;
2109*61ae650dSJack F Vogel };
2110*61ae650dSJack F Vogel 
2111*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_acq_set_test_mode);
2112*61ae650dSJack F Vogel 
2113*61ae650dSJack F Vogel /* Debug Read Register command (0xFF03)
2114*61ae650dSJack F Vogel  * Debug Write Register command (0xFF04)
2115*61ae650dSJack F Vogel  */
2116*61ae650dSJack F Vogel struct i40e_aqc_debug_reg_read_write {
2117*61ae650dSJack F Vogel 	__le32 reserved;
2118*61ae650dSJack F Vogel 	__le32 address;
2119*61ae650dSJack F Vogel 	__le32 value_high;
2120*61ae650dSJack F Vogel 	__le32 value_low;
2121*61ae650dSJack F Vogel };
2122*61ae650dSJack F Vogel 
2123*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_reg_read_write);
2124*61ae650dSJack F Vogel 
2125*61ae650dSJack F Vogel /* Scatter/gather Reg Read  (indirect 0xFF05)
2126*61ae650dSJack F Vogel  * Scatter/gather Reg Write (indirect 0xFF06)
2127*61ae650dSJack F Vogel  */
2128*61ae650dSJack F Vogel 
2129*61ae650dSJack F Vogel /* i40e_aq_desc is used for the command */
2130*61ae650dSJack F Vogel struct i40e_aqc_debug_reg_sg_element_data {
2131*61ae650dSJack F Vogel 	__le32 address;
2132*61ae650dSJack F Vogel 	__le32 value;
2133*61ae650dSJack F Vogel };
2134*61ae650dSJack F Vogel 
2135*61ae650dSJack F Vogel /* Debug Modify register (direct 0xFF07) */
2136*61ae650dSJack F Vogel struct i40e_aqc_debug_modify_reg {
2137*61ae650dSJack F Vogel 	__le32 address;
2138*61ae650dSJack F Vogel 	__le32 value;
2139*61ae650dSJack F Vogel 	__le32 clear_mask;
2140*61ae650dSJack F Vogel 	__le32 set_mask;
2141*61ae650dSJack F Vogel };
2142*61ae650dSJack F Vogel 
2143*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_reg);
2144*61ae650dSJack F Vogel 
2145*61ae650dSJack F Vogel /* dump internal data (0xFF08, indirect) */
2146*61ae650dSJack F Vogel 
2147*61ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_AUX		0
2148*61ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_SWITCH_FLU	1
2149*61ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_TXSCHED	2
2150*61ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_HMC		3
2151*61ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_MAC0		4
2152*61ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_MAC1		5
2153*61ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_MAC2		6
2154*61ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_MAC3		7
2155*61ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_DCB		8
2156*61ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_EMP_MEM	9
2157*61ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_PKT_BUF	10
2158*61ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_ALTRAM	11
2159*61ae650dSJack F Vogel 
2160*61ae650dSJack F Vogel struct i40e_aqc_debug_dump_internals {
2161*61ae650dSJack F Vogel 	u8	cluster_id;
2162*61ae650dSJack F Vogel 	u8	table_id;
2163*61ae650dSJack F Vogel 	__le16	data_size;
2164*61ae650dSJack F Vogel 	__le32	idx;
2165*61ae650dSJack F Vogel 	__le32	address_high;
2166*61ae650dSJack F Vogel 	__le32	address_low;
2167*61ae650dSJack F Vogel };
2168*61ae650dSJack F Vogel 
2169*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_dump_internals);
2170*61ae650dSJack F Vogel 
2171*61ae650dSJack F Vogel struct i40e_aqc_debug_modify_internals {
2172*61ae650dSJack F Vogel 	u8	cluster_id;
2173*61ae650dSJack F Vogel 	u8	cluster_specific_params[7];
2174*61ae650dSJack F Vogel 	__le32	address_high;
2175*61ae650dSJack F Vogel 	__le32	address_low;
2176*61ae650dSJack F Vogel };
2177*61ae650dSJack F Vogel 
2178*61ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_internals);
2179*61ae650dSJack F Vogel 
2180*61ae650dSJack F Vogel #endif
2181