xref: /freebsd/sys/dev/ixl/i40e_adminq_cmd.h (revision 71625ec9ad2a9bc8c09784fbd23b759830e0ee5f)
161ae650dSJack F Vogel /******************************************************************************
261ae650dSJack F Vogel 
3f4cc2d17SEric Joyner   Copyright (c) 2013-2018, Intel Corporation
461ae650dSJack F Vogel   All rights reserved.
561ae650dSJack F Vogel 
661ae650dSJack F Vogel   Redistribution and use in source and binary forms, with or without
761ae650dSJack F Vogel   modification, are permitted provided that the following conditions are met:
861ae650dSJack F Vogel 
961ae650dSJack F Vogel    1. Redistributions of source code must retain the above copyright notice,
1061ae650dSJack F Vogel       this list of conditions and the following disclaimer.
1161ae650dSJack F Vogel 
1261ae650dSJack F Vogel    2. Redistributions in binary form must reproduce the above copyright
1361ae650dSJack F Vogel       notice, this list of conditions and the following disclaimer in the
1461ae650dSJack F Vogel       documentation and/or other materials provided with the distribution.
1561ae650dSJack F Vogel 
1661ae650dSJack F Vogel    3. Neither the name of the Intel Corporation nor the names of its
1761ae650dSJack F Vogel       contributors may be used to endorse or promote products derived from
1861ae650dSJack F Vogel       this software without specific prior written permission.
1961ae650dSJack F Vogel 
2061ae650dSJack F Vogel   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2161ae650dSJack F Vogel   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2261ae650dSJack F Vogel   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2361ae650dSJack F Vogel   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
2461ae650dSJack F Vogel   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2561ae650dSJack F Vogel   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2661ae650dSJack F Vogel   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2761ae650dSJack F Vogel   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2861ae650dSJack F Vogel   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2961ae650dSJack F Vogel   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3061ae650dSJack F Vogel   POSSIBILITY OF SUCH DAMAGE.
3161ae650dSJack F Vogel 
3261ae650dSJack F Vogel ******************************************************************************/
3361ae650dSJack F Vogel 
3461ae650dSJack F Vogel #ifndef _I40E_ADMINQ_CMD_H_
3561ae650dSJack F Vogel #define _I40E_ADMINQ_CMD_H_
3661ae650dSJack F Vogel 
3761ae650dSJack F Vogel /* This header file defines the i40e Admin Queue commands and is shared between
3861ae650dSJack F Vogel  * i40e Firmware and Software.
3961ae650dSJack F Vogel  *
4061ae650dSJack F Vogel  * This file needs to comply with the Linux Kernel coding style.
4161ae650dSJack F Vogel  */
4261ae650dSJack F Vogel 
43ceebc2f3SEric Joyner 
4461ae650dSJack F Vogel #define I40E_FW_API_VERSION_MAJOR	0x0001
45abf77452SKrzysztof Galazka #define I40E_FW_API_VERSION_MINOR_X722	0x000C
46*ba2f531fSKrzysztof Galazka #define I40E_FW_API_VERSION_MINOR_X710	0x000F
47ceebc2f3SEric Joyner 
48ceebc2f3SEric Joyner #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
49ceebc2f3SEric Joyner 					I40E_FW_API_VERSION_MINOR_X710 : \
50ceebc2f3SEric Joyner 					I40E_FW_API_VERSION_MINOR_X722)
51ceebc2f3SEric Joyner 
52ceebc2f3SEric Joyner /* API version 1.7 implements additional link and PHY-specific APIs  */
53ceebc2f3SEric Joyner #define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007
54b4a7ce06SEric Joyner /* API version 1.9 for X722 implements additional link and PHY-specific APIs */
55b4a7ce06SEric Joyner #define I40E_MINOR_VER_GET_LINK_INFO_X722 0x0009
56b4a7ce06SEric Joyner /* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */
57b4a7ce06SEric Joyner #define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006
58b4a7ce06SEric Joyner /* API version 1.10 for X722 devices adds ability to request FEC encoding */
59b4a7ce06SEric Joyner #define I40E_MINOR_VER_FW_REQUEST_FEC_X722 0x000A
6061ae650dSJack F Vogel 
6161ae650dSJack F Vogel struct i40e_aq_desc {
6261ae650dSJack F Vogel 	__le16 flags;
6361ae650dSJack F Vogel 	__le16 opcode;
6461ae650dSJack F Vogel 	__le16 datalen;
6561ae650dSJack F Vogel 	__le16 retval;
6661ae650dSJack F Vogel 	__le32 cookie_high;
6761ae650dSJack F Vogel 	__le32 cookie_low;
6861ae650dSJack F Vogel 	union {
6961ae650dSJack F Vogel 		struct {
7061ae650dSJack F Vogel 			__le32 param0;
7161ae650dSJack F Vogel 			__le32 param1;
7261ae650dSJack F Vogel 			__le32 param2;
7361ae650dSJack F Vogel 			__le32 param3;
7461ae650dSJack F Vogel 		} internal;
7561ae650dSJack F Vogel 		struct {
7661ae650dSJack F Vogel 			__le32 param0;
7761ae650dSJack F Vogel 			__le32 param1;
7861ae650dSJack F Vogel 			__le32 addr_high;
7961ae650dSJack F Vogel 			__le32 addr_low;
8061ae650dSJack F Vogel 		} external;
8161ae650dSJack F Vogel 		u8 raw[16];
8261ae650dSJack F Vogel 	} params;
8361ae650dSJack F Vogel };
8461ae650dSJack F Vogel 
8561ae650dSJack F Vogel /* Flags sub-structure
8661ae650dSJack F Vogel  * |0  |1  |2  |3  |4  |5  |6  |7  |8  |9  |10 |11 |12 |13 |14 |15 |
8761ae650dSJack F Vogel  * |DD |CMP|ERR|VFE| * *  RESERVED * * |LB |RD |VFC|BUF|SI |EI |FE |
8861ae650dSJack F Vogel  */
8961ae650dSJack F Vogel 
9061ae650dSJack F Vogel /* command flags and offsets*/
9161ae650dSJack F Vogel #define I40E_AQ_FLAG_DD_SHIFT	0
9261ae650dSJack F Vogel #define I40E_AQ_FLAG_CMP_SHIFT	1
9361ae650dSJack F Vogel #define I40E_AQ_FLAG_ERR_SHIFT	2
9461ae650dSJack F Vogel #define I40E_AQ_FLAG_VFE_SHIFT	3
9561ae650dSJack F Vogel #define I40E_AQ_FLAG_LB_SHIFT	9
9661ae650dSJack F Vogel #define I40E_AQ_FLAG_RD_SHIFT	10
9761ae650dSJack F Vogel #define I40E_AQ_FLAG_VFC_SHIFT	11
9861ae650dSJack F Vogel #define I40E_AQ_FLAG_BUF_SHIFT	12
9961ae650dSJack F Vogel #define I40E_AQ_FLAG_SI_SHIFT	13
10061ae650dSJack F Vogel #define I40E_AQ_FLAG_EI_SHIFT	14
10161ae650dSJack F Vogel #define I40E_AQ_FLAG_FE_SHIFT	15
10261ae650dSJack F Vogel 
10361ae650dSJack F Vogel #define I40E_AQ_FLAG_DD		(1 << I40E_AQ_FLAG_DD_SHIFT)  /* 0x1    */
10461ae650dSJack F Vogel #define I40E_AQ_FLAG_CMP	(1 << I40E_AQ_FLAG_CMP_SHIFT) /* 0x2    */
10561ae650dSJack F Vogel #define I40E_AQ_FLAG_ERR	(1 << I40E_AQ_FLAG_ERR_SHIFT) /* 0x4    */
10661ae650dSJack F Vogel #define I40E_AQ_FLAG_VFE	(1 << I40E_AQ_FLAG_VFE_SHIFT) /* 0x8    */
10761ae650dSJack F Vogel #define I40E_AQ_FLAG_LB		(1 << I40E_AQ_FLAG_LB_SHIFT)  /* 0x200  */
10861ae650dSJack F Vogel #define I40E_AQ_FLAG_RD		(1 << I40E_AQ_FLAG_RD_SHIFT)  /* 0x400  */
10961ae650dSJack F Vogel #define I40E_AQ_FLAG_VFC	(1 << I40E_AQ_FLAG_VFC_SHIFT) /* 0x800  */
11061ae650dSJack F Vogel #define I40E_AQ_FLAG_BUF	(1 << I40E_AQ_FLAG_BUF_SHIFT) /* 0x1000 */
11161ae650dSJack F Vogel #define I40E_AQ_FLAG_SI		(1 << I40E_AQ_FLAG_SI_SHIFT)  /* 0x2000 */
11261ae650dSJack F Vogel #define I40E_AQ_FLAG_EI		(1 << I40E_AQ_FLAG_EI_SHIFT)  /* 0x4000 */
11361ae650dSJack F Vogel #define I40E_AQ_FLAG_FE		(1 << I40E_AQ_FLAG_FE_SHIFT)  /* 0x8000 */
11461ae650dSJack F Vogel 
11561ae650dSJack F Vogel /* error codes */
11661ae650dSJack F Vogel enum i40e_admin_queue_err {
11761ae650dSJack F Vogel 	I40E_AQ_RC_OK		= 0,  /* success */
11861ae650dSJack F Vogel 	I40E_AQ_RC_EPERM	= 1,  /* Operation not permitted */
11961ae650dSJack F Vogel 	I40E_AQ_RC_ENOENT	= 2,  /* No such element */
12061ae650dSJack F Vogel 	I40E_AQ_RC_ESRCH	= 3,  /* Bad opcode */
12161ae650dSJack F Vogel 	I40E_AQ_RC_EINTR	= 4,  /* operation interrupted */
12261ae650dSJack F Vogel 	I40E_AQ_RC_EIO		= 5,  /* I/O error */
12361ae650dSJack F Vogel 	I40E_AQ_RC_ENXIO	= 6,  /* No such resource */
12461ae650dSJack F Vogel 	I40E_AQ_RC_E2BIG	= 7,  /* Arg too long */
12561ae650dSJack F Vogel 	I40E_AQ_RC_EAGAIN	= 8,  /* Try again */
12661ae650dSJack F Vogel 	I40E_AQ_RC_ENOMEM	= 9,  /* Out of memory */
12761ae650dSJack F Vogel 	I40E_AQ_RC_EACCES	= 10, /* Permission denied */
12861ae650dSJack F Vogel 	I40E_AQ_RC_EFAULT	= 11, /* Bad address */
12961ae650dSJack F Vogel 	I40E_AQ_RC_EBUSY	= 12, /* Device or resource busy */
13061ae650dSJack F Vogel 	I40E_AQ_RC_EEXIST	= 13, /* object already exists */
13161ae650dSJack F Vogel 	I40E_AQ_RC_EINVAL	= 14, /* Invalid argument */
13261ae650dSJack F Vogel 	I40E_AQ_RC_ENOTTY	= 15, /* Not a typewriter */
13361ae650dSJack F Vogel 	I40E_AQ_RC_ENOSPC	= 16, /* No space left or alloc failure */
13461ae650dSJack F Vogel 	I40E_AQ_RC_ENOSYS	= 17, /* Function not implemented */
13561ae650dSJack F Vogel 	I40E_AQ_RC_ERANGE	= 18, /* Parameter out of range */
13661ae650dSJack F Vogel 	I40E_AQ_RC_EFLUSHED	= 19, /* Cmd flushed due to prev cmd error */
13761ae650dSJack F Vogel 	I40E_AQ_RC_BAD_ADDR	= 20, /* Descriptor contains a bad pointer */
13861ae650dSJack F Vogel 	I40E_AQ_RC_EMODE	= 21, /* Op not allowed in current dev mode */
13961ae650dSJack F Vogel 	I40E_AQ_RC_EFBIG	= 22, /* File too large */
14061ae650dSJack F Vogel };
14161ae650dSJack F Vogel 
14261ae650dSJack F Vogel /* Admin Queue command opcodes */
14361ae650dSJack F Vogel enum i40e_admin_queue_opc {
14461ae650dSJack F Vogel 	/* aq commands */
14561ae650dSJack F Vogel 	i40e_aqc_opc_get_version	= 0x0001,
14661ae650dSJack F Vogel 	i40e_aqc_opc_driver_version	= 0x0002,
14761ae650dSJack F Vogel 	i40e_aqc_opc_queue_shutdown	= 0x0003,
14861ae650dSJack F Vogel 	i40e_aqc_opc_set_pf_context	= 0x0004,
14961ae650dSJack F Vogel 
15061ae650dSJack F Vogel 	/* resource ownership */
15161ae650dSJack F Vogel 	i40e_aqc_opc_request_resource	= 0x0008,
15261ae650dSJack F Vogel 	i40e_aqc_opc_release_resource	= 0x0009,
15361ae650dSJack F Vogel 
15461ae650dSJack F Vogel 	i40e_aqc_opc_list_func_capabilities	= 0x000A,
15561ae650dSJack F Vogel 	i40e_aqc_opc_list_dev_capabilities	= 0x000B,
15661ae650dSJack F Vogel 
1574294f337SSean Bruno 	/* Proxy commands */
1584294f337SSean Bruno 	i40e_aqc_opc_set_proxy_config		= 0x0104,
1594294f337SSean Bruno 	i40e_aqc_opc_set_ns_proxy_table_entry	= 0x0105,
1604294f337SSean Bruno 
16161ae650dSJack F Vogel 	/* LAA */
16261ae650dSJack F Vogel 	i40e_aqc_opc_mac_address_read	= 0x0107,
16361ae650dSJack F Vogel 	i40e_aqc_opc_mac_address_write	= 0x0108,
16461ae650dSJack F Vogel 
16561ae650dSJack F Vogel 	/* PXE */
16661ae650dSJack F Vogel 	i40e_aqc_opc_clear_pxe_mode	= 0x0110,
16761ae650dSJack F Vogel 
1684294f337SSean Bruno 	/* WoL commands */
1694294f337SSean Bruno 	i40e_aqc_opc_set_wol_filter	= 0x0120,
1704294f337SSean Bruno 	i40e_aqc_opc_get_wake_reason	= 0x0121,
171cb6b8299SEric Joyner 	i40e_aqc_opc_clear_all_wol_filters = 0x025E,
1724294f337SSean Bruno 
17361ae650dSJack F Vogel 	/* internal switch commands */
17461ae650dSJack F Vogel 	i40e_aqc_opc_get_switch_config		= 0x0200,
17561ae650dSJack F Vogel 	i40e_aqc_opc_add_statistics		= 0x0201,
17661ae650dSJack F Vogel 	i40e_aqc_opc_remove_statistics		= 0x0202,
17761ae650dSJack F Vogel 	i40e_aqc_opc_set_port_parameters	= 0x0203,
17861ae650dSJack F Vogel 	i40e_aqc_opc_get_switch_resource_alloc	= 0x0204,
179fdb6f38aSEric Joyner 	i40e_aqc_opc_set_switch_config		= 0x0205,
180d4683565SEric Joyner 	i40e_aqc_opc_rx_ctl_reg_read		= 0x0206,
181d4683565SEric Joyner 	i40e_aqc_opc_rx_ctl_reg_write		= 0x0207,
18261ae650dSJack F Vogel 
18361ae650dSJack F Vogel 	i40e_aqc_opc_add_vsi			= 0x0210,
18461ae650dSJack F Vogel 	i40e_aqc_opc_update_vsi_parameters	= 0x0211,
18561ae650dSJack F Vogel 	i40e_aqc_opc_get_vsi_parameters		= 0x0212,
18661ae650dSJack F Vogel 
18761ae650dSJack F Vogel 	i40e_aqc_opc_add_pv			= 0x0220,
18861ae650dSJack F Vogel 	i40e_aqc_opc_update_pv_parameters	= 0x0221,
18961ae650dSJack F Vogel 	i40e_aqc_opc_get_pv_parameters		= 0x0222,
19061ae650dSJack F Vogel 
19161ae650dSJack F Vogel 	i40e_aqc_opc_add_veb			= 0x0230,
19261ae650dSJack F Vogel 	i40e_aqc_opc_update_veb_parameters	= 0x0231,
19361ae650dSJack F Vogel 	i40e_aqc_opc_get_veb_parameters		= 0x0232,
19461ae650dSJack F Vogel 
19561ae650dSJack F Vogel 	i40e_aqc_opc_delete_element		= 0x0243,
19661ae650dSJack F Vogel 
19761ae650dSJack F Vogel 	i40e_aqc_opc_add_macvlan		= 0x0250,
19861ae650dSJack F Vogel 	i40e_aqc_opc_remove_macvlan		= 0x0251,
19961ae650dSJack F Vogel 	i40e_aqc_opc_add_vlan			= 0x0252,
20061ae650dSJack F Vogel 	i40e_aqc_opc_remove_vlan		= 0x0253,
20161ae650dSJack F Vogel 	i40e_aqc_opc_set_vsi_promiscuous_modes	= 0x0254,
20261ae650dSJack F Vogel 	i40e_aqc_opc_add_tag			= 0x0255,
20361ae650dSJack F Vogel 	i40e_aqc_opc_remove_tag			= 0x0256,
20461ae650dSJack F Vogel 	i40e_aqc_opc_add_multicast_etag		= 0x0257,
20561ae650dSJack F Vogel 	i40e_aqc_opc_remove_multicast_etag	= 0x0258,
20661ae650dSJack F Vogel 	i40e_aqc_opc_update_tag			= 0x0259,
20761ae650dSJack F Vogel 	i40e_aqc_opc_add_control_packet_filter	= 0x025A,
20861ae650dSJack F Vogel 	i40e_aqc_opc_remove_control_packet_filter	= 0x025B,
20961ae650dSJack F Vogel 	i40e_aqc_opc_add_cloud_filters		= 0x025C,
21061ae650dSJack F Vogel 	i40e_aqc_opc_remove_cloud_filters	= 0x025D,
2114294f337SSean Bruno 	i40e_aqc_opc_clear_wol_switch_filters	= 0x025E,
212b4a7ce06SEric Joyner 	i40e_aqc_opc_replace_cloud_filters	= 0x025F,
21361ae650dSJack F Vogel 
21461ae650dSJack F Vogel 	i40e_aqc_opc_add_mirror_rule	= 0x0260,
21561ae650dSJack F Vogel 	i40e_aqc_opc_delete_mirror_rule	= 0x0261,
21661ae650dSJack F Vogel 
21761ae650dSJack F Vogel 	/* DCB commands */
21861ae650dSJack F Vogel 	i40e_aqc_opc_dcb_ignore_pfc	= 0x0301,
21961ae650dSJack F Vogel 	i40e_aqc_opc_dcb_updated	= 0x0302,
220ceebc2f3SEric Joyner 	i40e_aqc_opc_set_dcb_parameters = 0x0303,
22161ae650dSJack F Vogel 
22261ae650dSJack F Vogel 	/* TX scheduler */
22361ae650dSJack F Vogel 	i40e_aqc_opc_configure_vsi_bw_limit		= 0x0400,
22461ae650dSJack F Vogel 	i40e_aqc_opc_configure_vsi_ets_sla_bw_limit	= 0x0406,
22561ae650dSJack F Vogel 	i40e_aqc_opc_configure_vsi_tc_bw		= 0x0407,
22661ae650dSJack F Vogel 	i40e_aqc_opc_query_vsi_bw_config		= 0x0408,
22761ae650dSJack F Vogel 	i40e_aqc_opc_query_vsi_ets_sla_config		= 0x040A,
22861ae650dSJack F Vogel 	i40e_aqc_opc_configure_switching_comp_bw_limit	= 0x0410,
22961ae650dSJack F Vogel 
23061ae650dSJack F Vogel 	i40e_aqc_opc_enable_switching_comp_ets			= 0x0413,
23161ae650dSJack F Vogel 	i40e_aqc_opc_modify_switching_comp_ets			= 0x0414,
23261ae650dSJack F Vogel 	i40e_aqc_opc_disable_switching_comp_ets			= 0x0415,
23361ae650dSJack F Vogel 	i40e_aqc_opc_configure_switching_comp_ets_bw_limit	= 0x0416,
23461ae650dSJack F Vogel 	i40e_aqc_opc_configure_switching_comp_bw_config		= 0x0417,
23561ae650dSJack F Vogel 	i40e_aqc_opc_query_switching_comp_ets_config		= 0x0418,
23661ae650dSJack F Vogel 	i40e_aqc_opc_query_port_ets_config			= 0x0419,
23761ae650dSJack F Vogel 	i40e_aqc_opc_query_switching_comp_bw_config		= 0x041A,
23861ae650dSJack F Vogel 	i40e_aqc_opc_suspend_port_tx				= 0x041B,
23961ae650dSJack F Vogel 	i40e_aqc_opc_resume_port_tx				= 0x041C,
24061ae650dSJack F Vogel 	i40e_aqc_opc_configure_partition_bw			= 0x041D,
24161ae650dSJack F Vogel 	/* hmc */
24261ae650dSJack F Vogel 	i40e_aqc_opc_query_hmc_resource_profile	= 0x0500,
24361ae650dSJack F Vogel 	i40e_aqc_opc_set_hmc_resource_profile	= 0x0501,
24461ae650dSJack F Vogel 
24561ae650dSJack F Vogel 	/* phy commands*/
24661ae650dSJack F Vogel 	i40e_aqc_opc_get_phy_abilities		= 0x0600,
24761ae650dSJack F Vogel 	i40e_aqc_opc_set_phy_config		= 0x0601,
24861ae650dSJack F Vogel 	i40e_aqc_opc_set_mac_config		= 0x0603,
24961ae650dSJack F Vogel 	i40e_aqc_opc_set_link_restart_an	= 0x0605,
25061ae650dSJack F Vogel 	i40e_aqc_opc_get_link_status		= 0x0607,
25161ae650dSJack F Vogel 	i40e_aqc_opc_set_phy_int_mask		= 0x0613,
25261ae650dSJack F Vogel 	i40e_aqc_opc_get_local_advt_reg		= 0x0614,
25361ae650dSJack F Vogel 	i40e_aqc_opc_set_local_advt_reg		= 0x0615,
25461ae650dSJack F Vogel 	i40e_aqc_opc_get_partner_advt		= 0x0616,
25561ae650dSJack F Vogel 	i40e_aqc_opc_set_lb_modes		= 0x0618,
25661ae650dSJack F Vogel 	i40e_aqc_opc_get_phy_wol_caps		= 0x0621,
25761ae650dSJack F Vogel 	i40e_aqc_opc_set_phy_debug		= 0x0622,
25861ae650dSJack F Vogel 	i40e_aqc_opc_upload_ext_phy_fm		= 0x0625,
259fdb6f38aSEric Joyner 	i40e_aqc_opc_run_phy_activity		= 0x0626,
260ceebc2f3SEric Joyner 	i40e_aqc_opc_set_phy_register		= 0x0628,
261ceebc2f3SEric Joyner 	i40e_aqc_opc_get_phy_register		= 0x0629,
26261ae650dSJack F Vogel 
26361ae650dSJack F Vogel 	/* NVM commands */
26461ae650dSJack F Vogel 	i40e_aqc_opc_nvm_read			= 0x0701,
26561ae650dSJack F Vogel 	i40e_aqc_opc_nvm_erase			= 0x0702,
26661ae650dSJack F Vogel 	i40e_aqc_opc_nvm_update			= 0x0703,
26761ae650dSJack F Vogel 	i40e_aqc_opc_nvm_config_read		= 0x0704,
26861ae650dSJack F Vogel 	i40e_aqc_opc_nvm_config_write		= 0x0705,
269abf77452SKrzysztof Galazka 	i40e_aqc_opc_nvm_update_in_process	= 0x0706,
270abf77452SKrzysztof Galazka 	i40e_aqc_opc_rollback_revision_update	= 0x0707,
271be771cdaSJack F Vogel 	i40e_aqc_opc_oem_post_update		= 0x0720,
272fdb6f38aSEric Joyner 	i40e_aqc_opc_thermal_sensor		= 0x0721,
27361ae650dSJack F Vogel 
27461ae650dSJack F Vogel 	/* virtualization commands */
27561ae650dSJack F Vogel 	i40e_aqc_opc_send_msg_to_pf		= 0x0801,
27661ae650dSJack F Vogel 	i40e_aqc_opc_send_msg_to_vf		= 0x0802,
27761ae650dSJack F Vogel 	i40e_aqc_opc_send_msg_to_peer		= 0x0803,
27861ae650dSJack F Vogel 
27961ae650dSJack F Vogel 	/* alternate structure */
28061ae650dSJack F Vogel 	i40e_aqc_opc_alternate_write		= 0x0900,
28161ae650dSJack F Vogel 	i40e_aqc_opc_alternate_write_indirect	= 0x0901,
28261ae650dSJack F Vogel 	i40e_aqc_opc_alternate_read		= 0x0902,
28361ae650dSJack F Vogel 	i40e_aqc_opc_alternate_read_indirect	= 0x0903,
28461ae650dSJack F Vogel 	i40e_aqc_opc_alternate_write_done	= 0x0904,
28561ae650dSJack F Vogel 	i40e_aqc_opc_alternate_set_mode		= 0x0905,
28661ae650dSJack F Vogel 	i40e_aqc_opc_alternate_clear_port	= 0x0906,
28761ae650dSJack F Vogel 
28861ae650dSJack F Vogel 	/* LLDP commands */
28961ae650dSJack F Vogel 	i40e_aqc_opc_lldp_get_mib	= 0x0A00,
29061ae650dSJack F Vogel 	i40e_aqc_opc_lldp_update_mib	= 0x0A01,
29161ae650dSJack F Vogel 	i40e_aqc_opc_lldp_add_tlv	= 0x0A02,
29261ae650dSJack F Vogel 	i40e_aqc_opc_lldp_update_tlv	= 0x0A03,
29361ae650dSJack F Vogel 	i40e_aqc_opc_lldp_delete_tlv	= 0x0A04,
29461ae650dSJack F Vogel 	i40e_aqc_opc_lldp_stop		= 0x0A05,
29561ae650dSJack F Vogel 	i40e_aqc_opc_lldp_start		= 0x0A06,
296f247dc25SJack F Vogel 	i40e_aqc_opc_get_cee_dcb_cfg	= 0x0A07,
297f247dc25SJack F Vogel 	i40e_aqc_opc_lldp_set_local_mib	= 0x0A08,
298f247dc25SJack F Vogel 	i40e_aqc_opc_lldp_stop_start_spec_agent	= 0x0A09,
299b4a7ce06SEric Joyner 	i40e_aqc_opc_lldp_restore		= 0x0A0A,
30061ae650dSJack F Vogel 
30161ae650dSJack F Vogel 	/* Tunnel commands */
30261ae650dSJack F Vogel 	i40e_aqc_opc_add_udp_tunnel	= 0x0B00,
30361ae650dSJack F Vogel 	i40e_aqc_opc_del_udp_tunnel	= 0x0B01,
3044294f337SSean Bruno 	i40e_aqc_opc_set_rss_key	= 0x0B02,
3054294f337SSean Bruno 	i40e_aqc_opc_set_rss_lut	= 0x0B03,
3064294f337SSean Bruno 	i40e_aqc_opc_get_rss_key	= 0x0B04,
3074294f337SSean Bruno 	i40e_aqc_opc_get_rss_lut	= 0x0B05,
30861ae650dSJack F Vogel 
30961ae650dSJack F Vogel 	/* Async Events */
31061ae650dSJack F Vogel 	i40e_aqc_opc_event_lan_overflow		= 0x1001,
31161ae650dSJack F Vogel 
31261ae650dSJack F Vogel 	/* OEM commands */
31361ae650dSJack F Vogel 	i40e_aqc_opc_oem_parameter_change	= 0xFE00,
31461ae650dSJack F Vogel 	i40e_aqc_opc_oem_device_status_change	= 0xFE01,
315f247dc25SJack F Vogel 	i40e_aqc_opc_oem_ocsd_initialize	= 0xFE02,
316f247dc25SJack F Vogel 	i40e_aqc_opc_oem_ocbb_initialize	= 0xFE03,
31761ae650dSJack F Vogel 
31861ae650dSJack F Vogel 	/* debug commands */
31961ae650dSJack F Vogel 	i40e_aqc_opc_debug_read_reg		= 0xFF03,
32061ae650dSJack F Vogel 	i40e_aqc_opc_debug_write_reg		= 0xFF04,
32161ae650dSJack F Vogel 	i40e_aqc_opc_debug_modify_reg		= 0xFF07,
32261ae650dSJack F Vogel 	i40e_aqc_opc_debug_dump_internals	= 0xFF08,
32361ae650dSJack F Vogel };
32461ae650dSJack F Vogel 
32561ae650dSJack F Vogel /* command structures and indirect data structures */
32661ae650dSJack F Vogel 
32761ae650dSJack F Vogel /* Structure naming conventions:
32861ae650dSJack F Vogel  * - no suffix for direct command descriptor structures
32961ae650dSJack F Vogel  * - _data for indirect sent data
33061ae650dSJack F Vogel  * - _resp for indirect return data (data which is both will use _data)
33161ae650dSJack F Vogel  * - _completion for direct return data
33261ae650dSJack F Vogel  * - _element_ for repeated elements (may also be _data or _resp)
33361ae650dSJack F Vogel  *
33461ae650dSJack F Vogel  * Command structures are expected to overlay the params.raw member of the basic
33561ae650dSJack F Vogel  * descriptor, and as such cannot exceed 16 bytes in length.
33661ae650dSJack F Vogel  */
33761ae650dSJack F Vogel 
33861ae650dSJack F Vogel /* This macro is used to generate a compilation error if a structure
33961ae650dSJack F Vogel  * is not exactly the correct length. It gives a divide by zero error if the
34061ae650dSJack F Vogel  * structure is not of the correct size, otherwise it creates an enum that is
34161ae650dSJack F Vogel  * never used.
34261ae650dSJack F Vogel  */
34361ae650dSJack F Vogel #define I40E_CHECK_STRUCT_LEN(n, X) enum i40e_static_assert_enum_##X \
34461ae650dSJack F Vogel 	{ i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
34561ae650dSJack F Vogel 
34661ae650dSJack F Vogel /* This macro is used extensively to ensure that command structures are 16
34761ae650dSJack F Vogel  * bytes in length as they have to map to the raw array of that size.
34861ae650dSJack F Vogel  */
34961ae650dSJack F Vogel #define I40E_CHECK_CMD_LENGTH(X)	I40E_CHECK_STRUCT_LEN(16, X)
35061ae650dSJack F Vogel 
35161ae650dSJack F Vogel /* internal (0x00XX) commands */
35261ae650dSJack F Vogel 
35361ae650dSJack F Vogel /* Get version (direct 0x0001) */
35461ae650dSJack F Vogel struct i40e_aqc_get_version {
35561ae650dSJack F Vogel 	__le32 rom_ver;
35661ae650dSJack F Vogel 	__le32 fw_build;
35761ae650dSJack F Vogel 	__le16 fw_major;
35861ae650dSJack F Vogel 	__le16 fw_minor;
35961ae650dSJack F Vogel 	__le16 api_major;
36061ae650dSJack F Vogel 	__le16 api_minor;
36161ae650dSJack F Vogel };
36261ae650dSJack F Vogel 
36361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_version);
36461ae650dSJack F Vogel 
36561ae650dSJack F Vogel /* Send driver version (indirect 0x0002) */
36661ae650dSJack F Vogel struct i40e_aqc_driver_version {
36761ae650dSJack F Vogel 	u8	driver_major_ver;
36861ae650dSJack F Vogel 	u8	driver_minor_ver;
36961ae650dSJack F Vogel 	u8	driver_build_ver;
37061ae650dSJack F Vogel 	u8	driver_subbuild_ver;
37161ae650dSJack F Vogel 	u8	reserved[4];
37261ae650dSJack F Vogel 	__le32	address_high;
37361ae650dSJack F Vogel 	__le32	address_low;
37461ae650dSJack F Vogel };
37561ae650dSJack F Vogel 
37661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_driver_version);
37761ae650dSJack F Vogel 
37861ae650dSJack F Vogel /* Queue Shutdown (direct 0x0003) */
37961ae650dSJack F Vogel struct i40e_aqc_queue_shutdown {
38061ae650dSJack F Vogel 	__le32	driver_unloading;
38161ae650dSJack F Vogel #define I40E_AQ_DRIVER_UNLOADING	0x1
38261ae650dSJack F Vogel 	u8	reserved[12];
38361ae650dSJack F Vogel };
38461ae650dSJack F Vogel 
38561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_queue_shutdown);
38661ae650dSJack F Vogel 
38761ae650dSJack F Vogel /* Set PF context (0x0004, direct) */
38861ae650dSJack F Vogel struct i40e_aqc_set_pf_context {
38961ae650dSJack F Vogel 	u8	pf_id;
39061ae650dSJack F Vogel 	u8	reserved[15];
39161ae650dSJack F Vogel };
39261ae650dSJack F Vogel 
39361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_pf_context);
39461ae650dSJack F Vogel 
39561ae650dSJack F Vogel /* Request resource ownership (direct 0x0008)
39661ae650dSJack F Vogel  * Release resource ownership (direct 0x0009)
39761ae650dSJack F Vogel  */
39861ae650dSJack F Vogel #define I40E_AQ_RESOURCE_NVM			1
39961ae650dSJack F Vogel #define I40E_AQ_RESOURCE_SDP			2
40061ae650dSJack F Vogel #define I40E_AQ_RESOURCE_ACCESS_READ		1
40161ae650dSJack F Vogel #define I40E_AQ_RESOURCE_ACCESS_WRITE		2
40261ae650dSJack F Vogel #define I40E_AQ_RESOURCE_NVM_READ_TIMEOUT	3000
40361ae650dSJack F Vogel #define I40E_AQ_RESOURCE_NVM_WRITE_TIMEOUT	180000
40461ae650dSJack F Vogel 
40561ae650dSJack F Vogel struct i40e_aqc_request_resource {
40661ae650dSJack F Vogel 	__le16	resource_id;
40761ae650dSJack F Vogel 	__le16	access_type;
40861ae650dSJack F Vogel 	__le32	timeout;
40961ae650dSJack F Vogel 	__le32	resource_number;
41061ae650dSJack F Vogel 	u8	reserved[4];
41161ae650dSJack F Vogel };
41261ae650dSJack F Vogel 
41361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_request_resource);
41461ae650dSJack F Vogel 
41561ae650dSJack F Vogel /* Get function capabilities (indirect 0x000A)
41661ae650dSJack F Vogel  * Get device capabilities (indirect 0x000B)
41761ae650dSJack F Vogel  */
41861ae650dSJack F Vogel struct i40e_aqc_list_capabilites {
41961ae650dSJack F Vogel 	u8 command_flags;
42061ae650dSJack F Vogel #define I40E_AQ_LIST_CAP_PF_INDEX_EN	1
42161ae650dSJack F Vogel 	u8 pf_index;
42261ae650dSJack F Vogel 	u8 reserved[2];
42361ae650dSJack F Vogel 	__le32 count;
42461ae650dSJack F Vogel 	__le32 addr_high;
42561ae650dSJack F Vogel 	__le32 addr_low;
42661ae650dSJack F Vogel };
42761ae650dSJack F Vogel 
42861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_list_capabilites);
42961ae650dSJack F Vogel 
43061ae650dSJack F Vogel struct i40e_aqc_list_capabilities_element_resp {
43161ae650dSJack F Vogel 	__le16	id;
43261ae650dSJack F Vogel 	u8	major_rev;
43361ae650dSJack F Vogel 	u8	minor_rev;
43461ae650dSJack F Vogel 	__le32	number;
43561ae650dSJack F Vogel 	__le32	logical_id;
43661ae650dSJack F Vogel 	__le32	phys_id;
43761ae650dSJack F Vogel 	u8	reserved[16];
43861ae650dSJack F Vogel };
43961ae650dSJack F Vogel 
44061ae650dSJack F Vogel /* list of caps */
44161ae650dSJack F Vogel 
44261ae650dSJack F Vogel #define I40E_AQ_CAP_ID_SWITCH_MODE	0x0001
44361ae650dSJack F Vogel #define I40E_AQ_CAP_ID_MNG_MODE		0x0002
44461ae650dSJack F Vogel #define I40E_AQ_CAP_ID_NPAR_ACTIVE	0x0003
44561ae650dSJack F Vogel #define I40E_AQ_CAP_ID_OS2BMC_CAP	0x0004
44661ae650dSJack F Vogel #define I40E_AQ_CAP_ID_FUNCTIONS_VALID	0x0005
44761ae650dSJack F Vogel #define I40E_AQ_CAP_ID_ALTERNATE_RAM	0x0006
4487f70bec6SEric Joyner #define I40E_AQ_CAP_ID_WOL_AND_PROXY	0x0008
44961ae650dSJack F Vogel #define I40E_AQ_CAP_ID_SRIOV		0x0012
45061ae650dSJack F Vogel #define I40E_AQ_CAP_ID_VF		0x0013
45161ae650dSJack F Vogel #define I40E_AQ_CAP_ID_VMDQ		0x0014
45261ae650dSJack F Vogel #define I40E_AQ_CAP_ID_8021QBG		0x0015
45361ae650dSJack F Vogel #define I40E_AQ_CAP_ID_8021QBR		0x0016
45461ae650dSJack F Vogel #define I40E_AQ_CAP_ID_VSI		0x0017
45561ae650dSJack F Vogel #define I40E_AQ_CAP_ID_DCB		0x0018
45661ae650dSJack F Vogel #define I40E_AQ_CAP_ID_FCOE		0x0021
457f247dc25SJack F Vogel #define I40E_AQ_CAP_ID_ISCSI		0x0022
45861ae650dSJack F Vogel #define I40E_AQ_CAP_ID_RSS		0x0040
45961ae650dSJack F Vogel #define I40E_AQ_CAP_ID_RXQ		0x0041
46061ae650dSJack F Vogel #define I40E_AQ_CAP_ID_TXQ		0x0042
46161ae650dSJack F Vogel #define I40E_AQ_CAP_ID_MSIX		0x0043
46261ae650dSJack F Vogel #define I40E_AQ_CAP_ID_VF_MSIX		0x0044
46361ae650dSJack F Vogel #define I40E_AQ_CAP_ID_FLOW_DIRECTOR	0x0045
46461ae650dSJack F Vogel #define I40E_AQ_CAP_ID_1588		0x0046
46561ae650dSJack F Vogel #define I40E_AQ_CAP_ID_IWARP		0x0051
46661ae650dSJack F Vogel #define I40E_AQ_CAP_ID_LED		0x0061
46761ae650dSJack F Vogel #define I40E_AQ_CAP_ID_SDP		0x0062
46861ae650dSJack F Vogel #define I40E_AQ_CAP_ID_MDIO		0x0063
4697f70bec6SEric Joyner #define I40E_AQ_CAP_ID_WSR_PROT		0x0064
470abf77452SKrzysztof Galazka #define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS	0x0067
4714294f337SSean Bruno #define I40E_AQ_CAP_ID_NVM_MGMT		0x0080
47261ae650dSJack F Vogel #define I40E_AQ_CAP_ID_FLEX10		0x00F1
47361ae650dSJack F Vogel #define I40E_AQ_CAP_ID_CEM		0x00F2
47461ae650dSJack F Vogel 
47561ae650dSJack F Vogel /* Set CPPM Configuration (direct 0x0103) */
47661ae650dSJack F Vogel struct i40e_aqc_cppm_configuration {
47761ae650dSJack F Vogel 	__le16	command_flags;
47861ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_LTRC	0x0800
47961ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_DMCTH	0x1000
48061ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_DMCTLX	0x2000
48161ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_HPTC	0x4000
48261ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_DMARC	0x8000
48361ae650dSJack F Vogel 	__le16	ttlx;
48461ae650dSJack F Vogel 	__le32	dmacr;
48561ae650dSJack F Vogel 	__le16	dmcth;
48661ae650dSJack F Vogel 	u8	hptc;
48761ae650dSJack F Vogel 	u8	reserved;
48861ae650dSJack F Vogel 	__le32	pfltrc;
48961ae650dSJack F Vogel };
49061ae650dSJack F Vogel 
49161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration);
49261ae650dSJack F Vogel 
49361ae650dSJack F Vogel /* Set ARP Proxy command / response (indirect 0x0104) */
49461ae650dSJack F Vogel struct i40e_aqc_arp_proxy_data {
49561ae650dSJack F Vogel 	__le16	command_flags;
4964294f337SSean Bruno #define I40E_AQ_ARP_INIT_IPV4	0x0800
4974294f337SSean Bruno #define I40E_AQ_ARP_UNSUP_CTL	0x1000
4984294f337SSean Bruno #define I40E_AQ_ARP_ENA		0x2000
4994294f337SSean Bruno #define I40E_AQ_ARP_ADD_IPV4	0x4000
5004294f337SSean Bruno #define I40E_AQ_ARP_DEL_IPV4	0x8000
50161ae650dSJack F Vogel 	__le16	table_id;
5024294f337SSean Bruno 	__le32	enabled_offloads;
5034294f337SSean Bruno #define I40E_AQ_ARP_DIRECTED_OFFLOAD_ENABLE	0x00000020
5044294f337SSean Bruno #define I40E_AQ_ARP_OFFLOAD_ENABLE		0x00000800
50561ae650dSJack F Vogel 	__le32	ip_addr;
50661ae650dSJack F Vogel 	u8	mac_addr[6];
507f247dc25SJack F Vogel 	u8	reserved[2];
50861ae650dSJack F Vogel };
50961ae650dSJack F Vogel 
510f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x14, i40e_aqc_arp_proxy_data);
511f247dc25SJack F Vogel 
51261ae650dSJack F Vogel /* Set NS Proxy Table Entry Command (indirect 0x0105) */
51361ae650dSJack F Vogel struct i40e_aqc_ns_proxy_data {
51461ae650dSJack F Vogel 	__le16	table_idx_mac_addr_0;
51561ae650dSJack F Vogel 	__le16	table_idx_mac_addr_1;
51661ae650dSJack F Vogel 	__le16	table_idx_ipv6_0;
51761ae650dSJack F Vogel 	__le16	table_idx_ipv6_1;
51861ae650dSJack F Vogel 	__le16	control;
5194294f337SSean Bruno #define I40E_AQ_NS_PROXY_ADD_0		0x0001
5204294f337SSean Bruno #define I40E_AQ_NS_PROXY_DEL_0		0x0002
5214294f337SSean Bruno #define I40E_AQ_NS_PROXY_ADD_1		0x0004
5224294f337SSean Bruno #define I40E_AQ_NS_PROXY_DEL_1		0x0008
5234294f337SSean Bruno #define I40E_AQ_NS_PROXY_ADD_IPV6_0	0x0010
5244294f337SSean Bruno #define I40E_AQ_NS_PROXY_DEL_IPV6_0	0x0020
5254294f337SSean Bruno #define I40E_AQ_NS_PROXY_ADD_IPV6_1	0x0040
5264294f337SSean Bruno #define I40E_AQ_NS_PROXY_DEL_IPV6_1	0x0080
5274294f337SSean Bruno #define I40E_AQ_NS_PROXY_COMMAND_SEQ	0x0100
5284294f337SSean Bruno #define I40E_AQ_NS_PROXY_INIT_IPV6_TBL	0x0200
5294294f337SSean Bruno #define I40E_AQ_NS_PROXY_INIT_MAC_TBL	0x0400
5304294f337SSean Bruno #define I40E_AQ_NS_PROXY_OFFLOAD_ENABLE	0x0800
5314294f337SSean Bruno #define I40E_AQ_NS_PROXY_DIRECTED_OFFLOAD_ENABLE	0x1000
53261ae650dSJack F Vogel 	u8	mac_addr_0[6];
53361ae650dSJack F Vogel 	u8	mac_addr_1[6];
53461ae650dSJack F Vogel 	u8	local_mac_addr[6];
53561ae650dSJack F Vogel 	u8	ipv6_addr_0[16]; /* Warning! spec specifies BE byte order */
53661ae650dSJack F Vogel 	u8	ipv6_addr_1[16];
53761ae650dSJack F Vogel };
53861ae650dSJack F Vogel 
539f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x3c, i40e_aqc_ns_proxy_data);
540f247dc25SJack F Vogel 
54161ae650dSJack F Vogel /* Manage LAA Command (0x0106) - obsolete */
54261ae650dSJack F Vogel struct i40e_aqc_mng_laa {
54361ae650dSJack F Vogel 	__le16	command_flags;
54461ae650dSJack F Vogel #define I40E_AQ_LAA_FLAG_WR	0x8000
54561ae650dSJack F Vogel 	u8	reserved[2];
54661ae650dSJack F Vogel 	__le32	sal;
54761ae650dSJack F Vogel 	__le16	sah;
54861ae650dSJack F Vogel 	u8	reserved2[6];
54961ae650dSJack F Vogel };
55061ae650dSJack F Vogel 
551f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_mng_laa);
552f247dc25SJack F Vogel 
55361ae650dSJack F Vogel /* Manage MAC Address Read Command (indirect 0x0107) */
55461ae650dSJack F Vogel struct i40e_aqc_mac_address_read {
55561ae650dSJack F Vogel 	__le16	command_flags;
55661ae650dSJack F Vogel #define I40E_AQC_LAN_ADDR_VALID		0x10
55761ae650dSJack F Vogel #define I40E_AQC_SAN_ADDR_VALID		0x20
55861ae650dSJack F Vogel #define I40E_AQC_PORT_ADDR_VALID	0x40
55961ae650dSJack F Vogel #define I40E_AQC_WOL_ADDR_VALID		0x80
560be771cdaSJack F Vogel #define I40E_AQC_MC_MAG_EN_VALID	0x100
561cb6b8299SEric Joyner #define I40E_AQC_WOL_PRESERVE_STATUS	0x200
562cb6b8299SEric Joyner #define I40E_AQC_ADDR_VALID_MASK	0x3F0
56361ae650dSJack F Vogel 	u8	reserved[6];
56461ae650dSJack F Vogel 	__le32	addr_high;
56561ae650dSJack F Vogel 	__le32	addr_low;
56661ae650dSJack F Vogel };
56761ae650dSJack F Vogel 
56861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_mac_address_read);
56961ae650dSJack F Vogel 
57061ae650dSJack F Vogel struct i40e_aqc_mac_address_read_data {
57161ae650dSJack F Vogel 	u8 pf_lan_mac[6];
57261ae650dSJack F Vogel 	u8 pf_san_mac[6];
57361ae650dSJack F Vogel 	u8 port_mac[6];
57461ae650dSJack F Vogel 	u8 pf_wol_mac[6];
57561ae650dSJack F Vogel };
57661ae650dSJack F Vogel 
57761ae650dSJack F Vogel I40E_CHECK_STRUCT_LEN(24, i40e_aqc_mac_address_read_data);
57861ae650dSJack F Vogel 
57961ae650dSJack F Vogel /* Manage MAC Address Write Command (0x0108) */
58061ae650dSJack F Vogel struct i40e_aqc_mac_address_write {
58161ae650dSJack F Vogel 	__le16	command_flags;
5824294f337SSean Bruno #define I40E_AQC_MC_MAG_EN		0x0100
583cb6b8299SEric Joyner #define I40E_AQC_WOL_PRESERVE_ON_PFR	0x0200
58461ae650dSJack F Vogel #define I40E_AQC_WRITE_TYPE_LAA_ONLY	0x0000
58561ae650dSJack F Vogel #define I40E_AQC_WRITE_TYPE_LAA_WOL	0x4000
58661ae650dSJack F Vogel #define I40E_AQC_WRITE_TYPE_PORT	0x8000
587be771cdaSJack F Vogel #define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG	0xC000
588be771cdaSJack F Vogel #define I40E_AQC_WRITE_TYPE_MASK	0xC000
589be771cdaSJack F Vogel 
59061ae650dSJack F Vogel 	__le16	mac_sah;
59161ae650dSJack F Vogel 	__le32	mac_sal;
59261ae650dSJack F Vogel 	u8	reserved[8];
59361ae650dSJack F Vogel };
59461ae650dSJack F Vogel 
59561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_mac_address_write);
59661ae650dSJack F Vogel 
59761ae650dSJack F Vogel /* PXE commands (0x011x) */
59861ae650dSJack F Vogel 
59961ae650dSJack F Vogel /* Clear PXE Command and response  (direct 0x0110) */
60061ae650dSJack F Vogel struct i40e_aqc_clear_pxe {
60161ae650dSJack F Vogel 	u8	rx_cnt;
60261ae650dSJack F Vogel 	u8	reserved[15];
60361ae650dSJack F Vogel };
60461ae650dSJack F Vogel 
60561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_clear_pxe);
60661ae650dSJack F Vogel 
6074294f337SSean Bruno /* Set WoL Filter (0x0120) */
6084294f337SSean Bruno 
6094294f337SSean Bruno struct i40e_aqc_set_wol_filter {
6104294f337SSean Bruno 	__le16 filter_index;
6114294f337SSean Bruno #define I40E_AQC_MAX_NUM_WOL_FILTERS	8
6124294f337SSean Bruno #define I40E_AQC_SET_WOL_FILTER_TYPE_MAGIC_SHIFT	15
6134294f337SSean Bruno #define I40E_AQC_SET_WOL_FILTER_TYPE_MAGIC_MASK	(0x1 << \
6144294f337SSean Bruno 		I40E_AQC_SET_WOL_FILTER_TYPE_MAGIC_SHIFT)
6154294f337SSean Bruno 
6164294f337SSean Bruno #define I40E_AQC_SET_WOL_FILTER_INDEX_SHIFT		0
6174294f337SSean Bruno #define I40E_AQC_SET_WOL_FILTER_INDEX_MASK	(0x7 << \
6184294f337SSean Bruno 		I40E_AQC_SET_WOL_FILTER_INDEX_SHIFT)
6194294f337SSean Bruno 	__le16 cmd_flags;
6204294f337SSean Bruno #define I40E_AQC_SET_WOL_FILTER				0x8000
6214294f337SSean Bruno #define I40E_AQC_SET_WOL_FILTER_NO_TCO_WOL		0x4000
622cb6b8299SEric Joyner #define I40E_AQC_SET_WOL_FILTER_WOL_PRESERVE_ON_PFR	0x2000
6234294f337SSean Bruno #define I40E_AQC_SET_WOL_FILTER_ACTION_CLEAR		0
6244294f337SSean Bruno #define I40E_AQC_SET_WOL_FILTER_ACTION_SET		1
6254294f337SSean Bruno 	__le16 valid_flags;
6264294f337SSean Bruno #define I40E_AQC_SET_WOL_FILTER_ACTION_VALID		0x8000
6274294f337SSean Bruno #define I40E_AQC_SET_WOL_FILTER_NO_TCO_ACTION_VALID	0x4000
6284294f337SSean Bruno 	u8 reserved[2];
6294294f337SSean Bruno 	__le32	address_high;
6304294f337SSean Bruno 	__le32	address_low;
6314294f337SSean Bruno };
6324294f337SSean Bruno 
6334294f337SSean Bruno I40E_CHECK_CMD_LENGTH(i40e_aqc_set_wol_filter);
6344294f337SSean Bruno 
6354294f337SSean Bruno struct i40e_aqc_set_wol_filter_data {
6364294f337SSean Bruno 	u8 filter[128];
6374294f337SSean Bruno 	u8 mask[16];
6384294f337SSean Bruno };
6394294f337SSean Bruno 
6404294f337SSean Bruno I40E_CHECK_STRUCT_LEN(0x90, i40e_aqc_set_wol_filter_data);
6414294f337SSean Bruno 
6424294f337SSean Bruno /* Get Wake Reason (0x0121) */
6434294f337SSean Bruno 
6444294f337SSean Bruno struct i40e_aqc_get_wake_reason_completion {
6454294f337SSean Bruno 	u8 reserved_1[2];
6464294f337SSean Bruno 	__le16 wake_reason;
6474294f337SSean Bruno #define I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_MATCHED_INDEX_SHIFT	0
6484294f337SSean Bruno #define I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_MATCHED_INDEX_MASK (0xFF << \
6494294f337SSean Bruno 		I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_MATCHED_INDEX_SHIFT)
6504294f337SSean Bruno #define I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_RESERVED_SHIFT	8
6514294f337SSean Bruno #define I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_RESERVED_MASK	(0xFF << \
6524294f337SSean Bruno 		I40E_AQC_GET_WAKE_UP_REASON_WOL_REASON_RESERVED_SHIFT)
6534294f337SSean Bruno 	u8 reserved_2[12];
6544294f337SSean Bruno };
6554294f337SSean Bruno 
6564294f337SSean Bruno I40E_CHECK_CMD_LENGTH(i40e_aqc_get_wake_reason_completion);
6574294f337SSean Bruno 
65861ae650dSJack F Vogel /* Switch configuration commands (0x02xx) */
65961ae650dSJack F Vogel 
66061ae650dSJack F Vogel /* Used by many indirect commands that only pass an seid and a buffer in the
66161ae650dSJack F Vogel  * command
66261ae650dSJack F Vogel  */
66361ae650dSJack F Vogel struct i40e_aqc_switch_seid {
66461ae650dSJack F Vogel 	__le16	seid;
66561ae650dSJack F Vogel 	u8	reserved[6];
66661ae650dSJack F Vogel 	__le32	addr_high;
66761ae650dSJack F Vogel 	__le32	addr_low;
66861ae650dSJack F Vogel };
66961ae650dSJack F Vogel 
67061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_switch_seid);
67161ae650dSJack F Vogel 
67261ae650dSJack F Vogel /* Get Switch Configuration command (indirect 0x0200)
67361ae650dSJack F Vogel  * uses i40e_aqc_switch_seid for the descriptor
67461ae650dSJack F Vogel  */
67561ae650dSJack F Vogel struct i40e_aqc_get_switch_config_header_resp {
67661ae650dSJack F Vogel 	__le16	num_reported;
67761ae650dSJack F Vogel 	__le16	num_total;
67861ae650dSJack F Vogel 	u8	reserved[12];
67961ae650dSJack F Vogel };
68061ae650dSJack F Vogel 
681f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_switch_config_header_resp);
682f247dc25SJack F Vogel 
68361ae650dSJack F Vogel struct i40e_aqc_switch_config_element_resp {
68461ae650dSJack F Vogel 	u8	element_type;
68561ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_MAC	1
68661ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_PF		2
68761ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_VF		3
68861ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_EMP	4
68961ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_BMC	5
69061ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_PV		16
69161ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_VEB	17
69261ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_PA		18
69361ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_VSI	19
69461ae650dSJack F Vogel 	u8	revision;
69561ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_REV_1		1
69661ae650dSJack F Vogel 	__le16	seid;
69761ae650dSJack F Vogel 	__le16	uplink_seid;
69861ae650dSJack F Vogel 	__le16	downlink_seid;
69961ae650dSJack F Vogel 	u8	reserved[3];
70061ae650dSJack F Vogel 	u8	connection_type;
70161ae650dSJack F Vogel #define I40E_AQ_CONN_TYPE_REGULAR	0x1
70261ae650dSJack F Vogel #define I40E_AQ_CONN_TYPE_DEFAULT	0x2
70361ae650dSJack F Vogel #define I40E_AQ_CONN_TYPE_CASCADED	0x3
70461ae650dSJack F Vogel 	__le16	scheduler_id;
70561ae650dSJack F Vogel 	__le16	element_info;
70661ae650dSJack F Vogel };
70761ae650dSJack F Vogel 
708f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_config_element_resp);
709f247dc25SJack F Vogel 
71061ae650dSJack F Vogel /* Get Switch Configuration (indirect 0x0200)
71161ae650dSJack F Vogel  *    an array of elements are returned in the response buffer
71261ae650dSJack F Vogel  *    the first in the array is the header, remainder are elements
71361ae650dSJack F Vogel  */
71461ae650dSJack F Vogel struct i40e_aqc_get_switch_config_resp {
71561ae650dSJack F Vogel 	struct i40e_aqc_get_switch_config_header_resp	header;
71661ae650dSJack F Vogel 	struct i40e_aqc_switch_config_element_resp	element[1];
71761ae650dSJack F Vogel };
71861ae650dSJack F Vogel 
719f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_switch_config_resp);
720f247dc25SJack F Vogel 
72161ae650dSJack F Vogel /* Add Statistics (direct 0x0201)
72261ae650dSJack F Vogel  * Remove Statistics (direct 0x0202)
72361ae650dSJack F Vogel  */
72461ae650dSJack F Vogel struct i40e_aqc_add_remove_statistics {
72561ae650dSJack F Vogel 	__le16	seid;
72661ae650dSJack F Vogel 	__le16	vlan;
72761ae650dSJack F Vogel 	__le16	stat_index;
72861ae650dSJack F Vogel 	u8	reserved[10];
72961ae650dSJack F Vogel };
73061ae650dSJack F Vogel 
73161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_statistics);
73261ae650dSJack F Vogel 
73361ae650dSJack F Vogel /* Set Port Parameters command (direct 0x0203) */
73461ae650dSJack F Vogel struct i40e_aqc_set_port_parameters {
73561ae650dSJack F Vogel 	__le16	command_flags;
73661ae650dSJack F Vogel #define I40E_AQ_SET_P_PARAMS_SAVE_BAD_PACKETS	1
73761ae650dSJack F Vogel #define I40E_AQ_SET_P_PARAMS_PAD_SHORT_PACKETS	2 /* must set! */
73861ae650dSJack F Vogel #define I40E_AQ_SET_P_PARAMS_DOUBLE_VLAN_ENA	4
73961ae650dSJack F Vogel 	__le16	bad_frame_vsi;
7404294f337SSean Bruno #define I40E_AQ_SET_P_PARAMS_BFRAME_SEID_SHIFT	0x0
7414294f337SSean Bruno #define I40E_AQ_SET_P_PARAMS_BFRAME_SEID_MASK	0x3FF
74261ae650dSJack F Vogel 	__le16	default_seid;        /* reserved for command */
74361ae650dSJack F Vogel 	u8	reserved[10];
74461ae650dSJack F Vogel };
74561ae650dSJack F Vogel 
74661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_port_parameters);
74761ae650dSJack F Vogel 
74861ae650dSJack F Vogel /* Get Switch Resource Allocation (indirect 0x0204) */
74961ae650dSJack F Vogel struct i40e_aqc_get_switch_resource_alloc {
75061ae650dSJack F Vogel 	u8	num_entries;         /* reserved for command */
75161ae650dSJack F Vogel 	u8	reserved[7];
75261ae650dSJack F Vogel 	__le32	addr_high;
75361ae650dSJack F Vogel 	__le32	addr_low;
75461ae650dSJack F Vogel };
75561ae650dSJack F Vogel 
75661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_switch_resource_alloc);
75761ae650dSJack F Vogel 
75861ae650dSJack F Vogel /* expect an array of these structs in the response buffer */
75961ae650dSJack F Vogel struct i40e_aqc_switch_resource_alloc_element_resp {
76061ae650dSJack F Vogel 	u8	resource_type;
76161ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VEB		0x0
76261ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VSI		0x1
76361ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_MACADDR		0x2
76461ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_STAG		0x3
76561ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_ETAG		0x4
76661ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_MULTICAST_HASH	0x5
76761ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_UNICAST_HASH	0x6
76861ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VLAN		0x7
76961ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VSI_LIST_ENTRY	0x8
77061ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_ETAG_LIST_ENTRY	0x9
77161ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VLAN_STAT_POOL	0xA
77261ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_MIRROR_RULE	0xB
77361ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_QUEUE_SETS	0xC
77461ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VLAN_FILTERS	0xD
77561ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_INNER_MAC_FILTERS	0xF
77661ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_IP_FILTERS	0x10
77761ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_GRE_VN_KEYS	0x11
77861ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VN2_KEYS		0x12
77961ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_TUNNEL_PORTS	0x13
78061ae650dSJack F Vogel 	u8	reserved1;
78161ae650dSJack F Vogel 	__le16	guaranteed;
78261ae650dSJack F Vogel 	__le16	total;
78361ae650dSJack F Vogel 	__le16	used;
78461ae650dSJack F Vogel 	__le16	total_unalloced;
78561ae650dSJack F Vogel 	u8	reserved2[6];
78661ae650dSJack F Vogel };
78761ae650dSJack F Vogel 
788f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_resource_alloc_element_resp);
789f247dc25SJack F Vogel 
790fdb6f38aSEric Joyner /* Set Switch Configuration (direct 0x0205) */
791fdb6f38aSEric Joyner struct i40e_aqc_set_switch_config {
792fdb6f38aSEric Joyner 	__le16	flags;
7934294f337SSean Bruno /* flags used for both fields below */
794fdb6f38aSEric Joyner #define I40E_AQ_SET_SWITCH_CFG_PROMISC		0x0001
795fdb6f38aSEric Joyner #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER	0x0002
796ceebc2f3SEric Joyner #define I40E_AQ_SET_SWITCH_CFG_HW_ATR_EVICT	0x0004
797abf77452SKrzysztof Galazka #define I40E_AQ_SET_SWITCH_CFG_OUTER_VLAN	0x0008
798fdb6f38aSEric Joyner 	__le16	valid_flags;
799ceebc2f3SEric Joyner 	/* The ethertype in switch_tag is dropped on ingress and used
800ceebc2f3SEric Joyner 	 * internally by the switch. Set this to zero for the default
801ceebc2f3SEric Joyner 	 * of 0x88a8 (802.1ad). Should be zero for firmware API
802ceebc2f3SEric Joyner 	 * versions lower than 1.7.
803ceebc2f3SEric Joyner 	 */
804ceebc2f3SEric Joyner 	__le16	switch_tag;
805ceebc2f3SEric Joyner 	/* The ethertypes in first_tag and second_tag are used to
806ceebc2f3SEric Joyner 	 * match the outer and inner VLAN tags (respectively) when HW
807ceebc2f3SEric Joyner 	 * double VLAN tagging is enabled via the set port parameters
808ceebc2f3SEric Joyner 	 * AQ command. Otherwise these are both ignored. Set them to
809ceebc2f3SEric Joyner 	 * zero for their defaults of 0x8100 (802.1Q). Should be zero
810ceebc2f3SEric Joyner 	 * for firmware API versions lower than 1.7.
811ceebc2f3SEric Joyner 	 */
812ceebc2f3SEric Joyner 	__le16	first_tag;
813ceebc2f3SEric Joyner 	__le16	second_tag;
814ceebc2f3SEric Joyner 	/* Next byte is split into following:
815ceebc2f3SEric Joyner 	 * Bit 7    : 0 : No action, 1: Switch to mode defined by bits 6:0
816ceebc2f3SEric Joyner 	 * Bit 6    : 0 : Destination Port, 1: source port
817ceebc2f3SEric Joyner 	 * Bit 5..4 : L4 type
818ceebc2f3SEric Joyner 	 * 0: rsvd
819ceebc2f3SEric Joyner 	 * 1: TCP
820ceebc2f3SEric Joyner 	 * 2: UDP
821ceebc2f3SEric Joyner 	 * 3: Both TCP and UDP
822ceebc2f3SEric Joyner 	 * Bits 3:0 Mode
823ceebc2f3SEric Joyner 	 * 0: default mode
824ceebc2f3SEric Joyner 	 * 1: L4 port only mode
825ceebc2f3SEric Joyner 	 * 2: non-tunneled mode
826ceebc2f3SEric Joyner 	 * 3: tunneled mode
827ceebc2f3SEric Joyner 	 */
828ceebc2f3SEric Joyner #define I40E_AQ_SET_SWITCH_BIT7_VALID		0x80
829ceebc2f3SEric Joyner 
830ceebc2f3SEric Joyner #define I40E_AQ_SET_SWITCH_L4_SRC_PORT		0x40
831ceebc2f3SEric Joyner 
832ceebc2f3SEric Joyner #define I40E_AQ_SET_SWITCH_L4_TYPE_RSVD		0x00
833ceebc2f3SEric Joyner #define I40E_AQ_SET_SWITCH_L4_TYPE_TCP		0x10
834ceebc2f3SEric Joyner #define I40E_AQ_SET_SWITCH_L4_TYPE_UDP		0x20
835ceebc2f3SEric Joyner #define I40E_AQ_SET_SWITCH_L4_TYPE_BOTH		0x30
836ceebc2f3SEric Joyner 
837ceebc2f3SEric Joyner #define I40E_AQ_SET_SWITCH_MODE_DEFAULT		0x00
838ceebc2f3SEric Joyner #define I40E_AQ_SET_SWITCH_MODE_L4_PORT		0x01
839ceebc2f3SEric Joyner #define I40E_AQ_SET_SWITCH_MODE_NON_TUNNEL	0x02
840ceebc2f3SEric Joyner #define I40E_AQ_SET_SWITCH_MODE_TUNNEL		0x03
841ceebc2f3SEric Joyner 	u8	mode;
842ceebc2f3SEric Joyner 	u8	rsvd5[5];
843fdb6f38aSEric Joyner };
844fdb6f38aSEric Joyner 
845fdb6f38aSEric Joyner I40E_CHECK_CMD_LENGTH(i40e_aqc_set_switch_config);
846fdb6f38aSEric Joyner 
847d4683565SEric Joyner /* Read Receive control registers  (direct 0x0206)
848d4683565SEric Joyner  * Write Receive control registers (direct 0x0207)
849d4683565SEric Joyner  *     used for accessing Rx control registers that can be
850d4683565SEric Joyner  *     slow and need special handling when under high Rx load
851d4683565SEric Joyner  */
852d4683565SEric Joyner struct i40e_aqc_rx_ctl_reg_read_write {
853d4683565SEric Joyner 	__le32 reserved1;
854d4683565SEric Joyner 	__le32 address;
855d4683565SEric Joyner 	__le32 reserved2;
856d4683565SEric Joyner 	__le32 value;
857d4683565SEric Joyner };
858d4683565SEric Joyner 
859d4683565SEric Joyner I40E_CHECK_CMD_LENGTH(i40e_aqc_rx_ctl_reg_read_write);
860d4683565SEric Joyner 
86161ae650dSJack F Vogel /* Add VSI (indirect 0x0210)
86261ae650dSJack F Vogel  *    this indirect command uses struct i40e_aqc_vsi_properties_data
86361ae650dSJack F Vogel  *    as the indirect buffer (128 bytes)
86461ae650dSJack F Vogel  *
86561ae650dSJack F Vogel  * Update VSI (indirect 0x211)
86661ae650dSJack F Vogel  *     uses the same data structure as Add VSI
86761ae650dSJack F Vogel  *
86861ae650dSJack F Vogel  * Get VSI (indirect 0x0212)
86961ae650dSJack F Vogel  *     uses the same completion and data structure as Add VSI
87061ae650dSJack F Vogel  */
87161ae650dSJack F Vogel struct i40e_aqc_add_get_update_vsi {
87261ae650dSJack F Vogel 	__le16	uplink_seid;
87361ae650dSJack F Vogel 	u8	connection_type;
87461ae650dSJack F Vogel #define I40E_AQ_VSI_CONN_TYPE_NORMAL	0x1
87561ae650dSJack F Vogel #define I40E_AQ_VSI_CONN_TYPE_DEFAULT	0x2
87661ae650dSJack F Vogel #define I40E_AQ_VSI_CONN_TYPE_CASCADED	0x3
87761ae650dSJack F Vogel 	u8	reserved1;
87861ae650dSJack F Vogel 	u8	vf_id;
87961ae650dSJack F Vogel 	u8	reserved2;
88061ae650dSJack F Vogel 	__le16	vsi_flags;
88161ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_SHIFT		0x0
88261ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_MASK		(0x3 << I40E_AQ_VSI_TYPE_SHIFT)
88361ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_VF		0x0
88461ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_VMDQ2		0x1
88561ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_PF		0x2
88661ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_EMP_MNG	0x3
88761ae650dSJack F Vogel #define I40E_AQ_VSI_FLAG_CASCADED_PV	0x4
88861ae650dSJack F Vogel 	__le32	addr_high;
88961ae650dSJack F Vogel 	__le32	addr_low;
89061ae650dSJack F Vogel };
89161ae650dSJack F Vogel 
89261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_get_update_vsi);
89361ae650dSJack F Vogel 
89461ae650dSJack F Vogel struct i40e_aqc_add_get_update_vsi_completion {
89561ae650dSJack F Vogel 	__le16 seid;
89661ae650dSJack F Vogel 	__le16 vsi_number;
89761ae650dSJack F Vogel 	__le16 vsi_used;
89861ae650dSJack F Vogel 	__le16 vsi_free;
89961ae650dSJack F Vogel 	__le32 addr_high;
90061ae650dSJack F Vogel 	__le32 addr_low;
90161ae650dSJack F Vogel };
90261ae650dSJack F Vogel 
90361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_get_update_vsi_completion);
90461ae650dSJack F Vogel 
90561ae650dSJack F Vogel struct i40e_aqc_vsi_properties_data {
90661ae650dSJack F Vogel 	/* first 96 byte are written by SW */
90761ae650dSJack F Vogel 	__le16	valid_sections;
90861ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_SWITCH_VALID		0x0001
90961ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_SECURITY_VALID		0x0002
91061ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_VLAN_VALID		0x0004
91161ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_CAS_PV_VALID		0x0008
91261ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_INGRESS_UP_VALID	0x0010
91361ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_EGRESS_UP_VALID	0x0020
91461ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_QUEUE_MAP_VALID	0x0040
91561ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_QUEUE_OPT_VALID	0x0080
91661ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_OUTER_UP_VALID		0x0100
91761ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_SCHED_VALID		0x0200
91861ae650dSJack F Vogel 	/* switch section */
91961ae650dSJack F Vogel 	__le16	switch_id; /* 12bit id combined with flags below */
92061ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_SHIFT		0x0000
92161ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_MASK		(0xFFF << I40E_AQ_VSI_SW_ID_SHIFT)
92261ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_FLAG_NOT_STAG	0x1000
92361ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB	0x2000
92461ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_FLAG_LOCAL_LB	0x4000
92561ae650dSJack F Vogel 	u8	sw_reserved[2];
92661ae650dSJack F Vogel 	/* security section */
92761ae650dSJack F Vogel 	u8	sec_flags;
92861ae650dSJack F Vogel #define I40E_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD	0x01
92961ae650dSJack F Vogel #define I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK	0x02
93061ae650dSJack F Vogel #define I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK	0x04
93161ae650dSJack F Vogel 	u8	sec_reserved;
93261ae650dSJack F Vogel 	/* VLAN section */
93361ae650dSJack F Vogel 	__le16	pvid; /* VLANS include priority bits */
934abf77452SKrzysztof Galazka 	__le16	outer_vlan;
93561ae650dSJack F Vogel 	u8	port_vlan_flags;
93661ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_SHIFT	0x00
93761ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_MASK	(0x03 << \
93861ae650dSJack F Vogel 					 I40E_AQ_VSI_PVLAN_MODE_SHIFT)
93961ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_TAGGED	0x01
94061ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_UNTAGGED	0x02
94161ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_ALL	0x03
94261ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_INSERT_PVID	0x04
94361ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_SHIFT	0x03
94461ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_MASK	(0x3 << \
94561ae650dSJack F Vogel 					 I40E_AQ_VSI_PVLAN_EMOD_SHIFT)
94661ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH	0x0
94761ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP	0x08
94861ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_STR	0x10
94961ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING	0x18
950abf77452SKrzysztof Galazka 	u8	outer_vlan_flags;
951abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_MODE_SHIFT	0x00
952abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_MODE_MASK	(0x03 << \
953abf77452SKrzysztof Galazka 					 I40E_AQ_VSI_OVLAN_MODE_SHIFT)
954abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_MODE_UNTAGGED	0x01
955abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_MODE_TAGGED	0x02
956abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_MODE_ALL	0x03
957abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_INSERT_PVID	0x04
958abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_EMOD_SHIFT	0x03
959abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_EMOD_MASK	(0x03 <<\
960abf77452SKrzysztof Galazka 					 I40E_AQ_VSI_OVLAN_EMOD_SHIFT)
961abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_EMOD_SHOW_ALL	0x00
962abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_EMOD_SHOW_UP	0x01
963abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_EMOD_HIDE_ALL	0x02
964abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_EMOD_NOTHING	0x03
965abf77452SKrzysztof Galazka #define I40E_AQ_VSI_OVLAN_CTRL_ENA	0x04
966abf77452SKrzysztof Galazka 
967abf77452SKrzysztof Galazka 	u8	pvlan_reserved[2];
96861ae650dSJack F Vogel 	/* ingress egress up sections */
96961ae650dSJack F Vogel 	__le32	ingress_table; /* bitmap, 3 bits per up */
97061ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT	0
97161ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP0_MASK	(0x7 << \
97261ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP0_SHIFT)
97361ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP1_SHIFT	3
97461ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP1_MASK	(0x7 << \
97561ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP1_SHIFT)
97661ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP2_SHIFT	6
97761ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP2_MASK	(0x7 << \
97861ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP2_SHIFT)
97961ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP3_SHIFT	9
98061ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP3_MASK	(0x7 << \
98161ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP3_SHIFT)
98261ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP4_SHIFT	12
98361ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP4_MASK	(0x7 << \
98461ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP4_SHIFT)
98561ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP5_SHIFT	15
98661ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP5_MASK	(0x7 << \
98761ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP5_SHIFT)
98861ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP6_SHIFT	18
98961ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP6_MASK	(0x7 << \
99061ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP6_SHIFT)
99161ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP7_SHIFT	21
99261ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP7_MASK	(0x7 << \
99361ae650dSJack F Vogel 					 I40E_AQ_VSI_UP_TABLE_UP7_SHIFT)
99461ae650dSJack F Vogel 	__le32	egress_table;   /* same defines as for ingress table */
99561ae650dSJack F Vogel 	/* cascaded PV section */
99661ae650dSJack F Vogel 	__le16	cas_pv_tag;
99761ae650dSJack F Vogel 	u8	cas_pv_flags;
99861ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_SHIFT		0x00
99961ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_MASK		(0x03 << \
100061ae650dSJack F Vogel 						 I40E_AQ_VSI_CAS_PV_TAGX_SHIFT)
100161ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_LEAVE		0x00
100261ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_REMOVE		0x01
100361ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_COPY		0x02
100461ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_INSERT_TAG		0x10
100561ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_ETAG_PRUNE		0x20
100661ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_ACCEPT_HOST_TAG	0x40
100761ae650dSJack F Vogel 	u8	cas_pv_reserved;
100861ae650dSJack F Vogel 	/* queue mapping section */
100961ae650dSJack F Vogel 	__le16	mapping_flags;
101061ae650dSJack F Vogel #define I40E_AQ_VSI_QUE_MAP_CONTIG	0x0
101161ae650dSJack F Vogel #define I40E_AQ_VSI_QUE_MAP_NONCONTIG	0x1
101261ae650dSJack F Vogel 	__le16	queue_mapping[16];
101361ae650dSJack F Vogel #define I40E_AQ_VSI_QUEUE_SHIFT		0x0
101461ae650dSJack F Vogel #define I40E_AQ_VSI_QUEUE_MASK		(0x7FF << I40E_AQ_VSI_QUEUE_SHIFT)
101561ae650dSJack F Vogel 	__le16	tc_mapping[8];
101661ae650dSJack F Vogel #define I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT	0
101761ae650dSJack F Vogel #define I40E_AQ_VSI_TC_QUE_OFFSET_MASK	(0x1FF << \
101861ae650dSJack F Vogel 					 I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT)
101961ae650dSJack F Vogel #define I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT	9
102061ae650dSJack F Vogel #define I40E_AQ_VSI_TC_QUE_NUMBER_MASK	(0x7 << \
102161ae650dSJack F Vogel 					 I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT)
102261ae650dSJack F Vogel 	/* queueing option section */
102361ae650dSJack F Vogel 	u8	queueing_opt_flags;
10244294f337SSean Bruno #define I40E_AQ_VSI_QUE_OPT_MULTICAST_UDP_ENA	0x04
10254294f337SSean Bruno #define I40E_AQ_VSI_QUE_OPT_UNICAST_UDP_ENA	0x08
102661ae650dSJack F Vogel #define I40E_AQ_VSI_QUE_OPT_TCP_ENA	0x10
102761ae650dSJack F Vogel #define I40E_AQ_VSI_QUE_OPT_FCOE_ENA	0x20
10284294f337SSean Bruno #define I40E_AQ_VSI_QUE_OPT_RSS_LUT_PF	0x00
10294294f337SSean Bruno #define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI	0x40
103061ae650dSJack F Vogel 	u8	queueing_opt_reserved[3];
103161ae650dSJack F Vogel 	/* scheduler section */
103261ae650dSJack F Vogel 	u8	up_enable_bits;
103361ae650dSJack F Vogel 	u8	sched_reserved;
103461ae650dSJack F Vogel 	/* outer up section */
1035d4683565SEric Joyner 	__le32	outer_up_table; /* same structure and defines as ingress tbl */
103661ae650dSJack F Vogel 	u8	cmd_reserved[8];
103761ae650dSJack F Vogel 	/* last 32 bytes are written by FW */
103861ae650dSJack F Vogel 	__le16	qs_handle[8];
103961ae650dSJack F Vogel #define I40E_AQ_VSI_QS_HANDLE_INVALID	0xFFFF
104061ae650dSJack F Vogel 	__le16	stat_counter_idx;
104161ae650dSJack F Vogel 	__le16	sched_id;
104261ae650dSJack F Vogel 	u8	resp_reserved[12];
104361ae650dSJack F Vogel };
104461ae650dSJack F Vogel 
104561ae650dSJack F Vogel I40E_CHECK_STRUCT_LEN(128, i40e_aqc_vsi_properties_data);
104661ae650dSJack F Vogel 
104761ae650dSJack F Vogel /* Add Port Virtualizer (direct 0x0220)
104861ae650dSJack F Vogel  * also used for update PV (direct 0x0221) but only flags are used
104961ae650dSJack F Vogel  * (IS_CTRL_PORT only works on add PV)
105061ae650dSJack F Vogel  */
105161ae650dSJack F Vogel struct i40e_aqc_add_update_pv {
105261ae650dSJack F Vogel 	__le16	command_flags;
105361ae650dSJack F Vogel #define I40E_AQC_PV_FLAG_PV_TYPE		0x1
105461ae650dSJack F Vogel #define I40E_AQC_PV_FLAG_FWD_UNKNOWN_STAG_EN	0x2
105561ae650dSJack F Vogel #define I40E_AQC_PV_FLAG_FWD_UNKNOWN_ETAG_EN	0x4
105661ae650dSJack F Vogel #define I40E_AQC_PV_FLAG_IS_CTRL_PORT		0x8
105761ae650dSJack F Vogel 	__le16	uplink_seid;
105861ae650dSJack F Vogel 	__le16	connected_seid;
105961ae650dSJack F Vogel 	u8	reserved[10];
106061ae650dSJack F Vogel };
106161ae650dSJack F Vogel 
106261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_update_pv);
106361ae650dSJack F Vogel 
106461ae650dSJack F Vogel struct i40e_aqc_add_update_pv_completion {
106561ae650dSJack F Vogel 	/* reserved for update; for add also encodes error if rc == ENOSPC */
106661ae650dSJack F Vogel 	__le16	pv_seid;
106761ae650dSJack F Vogel #define I40E_AQC_PV_ERR_FLAG_NO_PV	0x1
106861ae650dSJack F Vogel #define I40E_AQC_PV_ERR_FLAG_NO_SCHED	0x2
106961ae650dSJack F Vogel #define I40E_AQC_PV_ERR_FLAG_NO_COUNTER	0x4
107061ae650dSJack F Vogel #define I40E_AQC_PV_ERR_FLAG_NO_ENTRY	0x8
107161ae650dSJack F Vogel 	u8	reserved[14];
107261ae650dSJack F Vogel };
107361ae650dSJack F Vogel 
107461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_update_pv_completion);
107561ae650dSJack F Vogel 
107661ae650dSJack F Vogel /* Get PV Params (direct 0x0222)
107761ae650dSJack F Vogel  * uses i40e_aqc_switch_seid for the descriptor
107861ae650dSJack F Vogel  */
107961ae650dSJack F Vogel 
108061ae650dSJack F Vogel struct i40e_aqc_get_pv_params_completion {
108161ae650dSJack F Vogel 	__le16	seid;
108261ae650dSJack F Vogel 	__le16	default_stag;
108361ae650dSJack F Vogel 	__le16	pv_flags; /* same flags as add_pv */
108461ae650dSJack F Vogel #define I40E_AQC_GET_PV_PV_TYPE			0x1
108561ae650dSJack F Vogel #define I40E_AQC_GET_PV_FRWD_UNKNOWN_STAG	0x2
108661ae650dSJack F Vogel #define I40E_AQC_GET_PV_FRWD_UNKNOWN_ETAG	0x4
108761ae650dSJack F Vogel 	u8	reserved[8];
108861ae650dSJack F Vogel 	__le16	default_port_seid;
108961ae650dSJack F Vogel };
109061ae650dSJack F Vogel 
109161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_pv_params_completion);
109261ae650dSJack F Vogel 
109361ae650dSJack F Vogel /* Add VEB (direct 0x0230) */
109461ae650dSJack F Vogel struct i40e_aqc_add_veb {
109561ae650dSJack F Vogel 	__le16	uplink_seid;
109661ae650dSJack F Vogel 	__le16	downlink_seid;
109761ae650dSJack F Vogel 	__le16	veb_flags;
109861ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_FLOATING		0x1
109961ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_PORT_TYPE_SHIFT	1
110061ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_PORT_TYPE_MASK		(0x3 << \
110161ae650dSJack F Vogel 					I40E_AQC_ADD_VEB_PORT_TYPE_SHIFT)
110261ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_PORT_TYPE_DEFAULT	0x2
110361ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_PORT_TYPE_DATA		0x4
1104fdb6f38aSEric Joyner #define I40E_AQC_ADD_VEB_ENABLE_L2_FILTER	0x8     /* deprecated */
1105fdb6f38aSEric Joyner #define I40E_AQC_ADD_VEB_ENABLE_DISABLE_STATS	0x10
110661ae650dSJack F Vogel 	u8	enable_tcs;
110761ae650dSJack F Vogel 	u8	reserved[9];
110861ae650dSJack F Vogel };
110961ae650dSJack F Vogel 
111061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_veb);
111161ae650dSJack F Vogel 
111261ae650dSJack F Vogel struct i40e_aqc_add_veb_completion {
111361ae650dSJack F Vogel 	u8	reserved[6];
111461ae650dSJack F Vogel 	__le16	switch_seid;
111561ae650dSJack F Vogel 	/* also encodes error if rc == ENOSPC; codes are the same as add_pv */
111661ae650dSJack F Vogel 	__le16	veb_seid;
111761ae650dSJack F Vogel #define I40E_AQC_VEB_ERR_FLAG_NO_VEB		0x1
111861ae650dSJack F Vogel #define I40E_AQC_VEB_ERR_FLAG_NO_SCHED		0x2
111961ae650dSJack F Vogel #define I40E_AQC_VEB_ERR_FLAG_NO_COUNTER	0x4
112061ae650dSJack F Vogel #define I40E_AQC_VEB_ERR_FLAG_NO_ENTRY		0x8
112161ae650dSJack F Vogel 	__le16	statistic_index;
112261ae650dSJack F Vogel 	__le16	vebs_used;
112361ae650dSJack F Vogel 	__le16	vebs_free;
112461ae650dSJack F Vogel };
112561ae650dSJack F Vogel 
112661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_veb_completion);
112761ae650dSJack F Vogel 
112861ae650dSJack F Vogel /* Get VEB Parameters (direct 0x0232)
112961ae650dSJack F Vogel  * uses i40e_aqc_switch_seid for the descriptor
113061ae650dSJack F Vogel  */
113161ae650dSJack F Vogel struct i40e_aqc_get_veb_parameters_completion {
113261ae650dSJack F Vogel 	__le16	seid;
113361ae650dSJack F Vogel 	__le16	switch_id;
113461ae650dSJack F Vogel 	__le16	veb_flags; /* only the first/last flags from 0x0230 is valid */
113561ae650dSJack F Vogel 	__le16	statistic_index;
113661ae650dSJack F Vogel 	__le16	vebs_used;
113761ae650dSJack F Vogel 	__le16	vebs_free;
113861ae650dSJack F Vogel 	u8	reserved[4];
113961ae650dSJack F Vogel };
114061ae650dSJack F Vogel 
114161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_veb_parameters_completion);
114261ae650dSJack F Vogel 
114361ae650dSJack F Vogel /* Delete Element (direct 0x0243)
114461ae650dSJack F Vogel  * uses the generic i40e_aqc_switch_seid
114561ae650dSJack F Vogel  */
114661ae650dSJack F Vogel 
114761ae650dSJack F Vogel /* Add MAC-VLAN (indirect 0x0250) */
114861ae650dSJack F Vogel 
114961ae650dSJack F Vogel /* used for the command for most vlan commands */
115061ae650dSJack F Vogel struct i40e_aqc_macvlan {
115161ae650dSJack F Vogel 	__le16	num_addresses;
115261ae650dSJack F Vogel 	__le16	seid[3];
115361ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_SEID_NUM_SHIFT	0
115461ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_SEID_NUM_MASK	(0x3FF << \
115561ae650dSJack F Vogel 					I40E_AQC_MACVLAN_CMD_SEID_NUM_SHIFT)
115661ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_SEID_VALID		0x8000
115761ae650dSJack F Vogel 	__le32	addr_high;
115861ae650dSJack F Vogel 	__le32	addr_low;
115961ae650dSJack F Vogel };
116061ae650dSJack F Vogel 
116161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_macvlan);
116261ae650dSJack F Vogel 
116361ae650dSJack F Vogel /* indirect data for command and response */
116461ae650dSJack F Vogel struct i40e_aqc_add_macvlan_element_data {
116561ae650dSJack F Vogel 	u8	mac_addr[6];
116661ae650dSJack F Vogel 	__le16	vlan_tag;
116761ae650dSJack F Vogel 	__le16	flags;
116861ae650dSJack F Vogel #define I40E_AQC_MACVLAN_ADD_PERFECT_MATCH	0x0001
116961ae650dSJack F Vogel #define I40E_AQC_MACVLAN_ADD_HASH_MATCH		0x0002
117061ae650dSJack F Vogel #define I40E_AQC_MACVLAN_ADD_IGNORE_VLAN	0x0004
117161ae650dSJack F Vogel #define I40E_AQC_MACVLAN_ADD_TO_QUEUE		0x0008
1172fdb6f38aSEric Joyner #define I40E_AQC_MACVLAN_ADD_USE_SHARED_MAC	0x0010
117361ae650dSJack F Vogel 	__le16	queue_number;
117461ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_QUEUE_SHIFT	0
117561ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_QUEUE_MASK		(0x7FF << \
117661ae650dSJack F Vogel 					I40E_AQC_MACVLAN_CMD_SEID_NUM_SHIFT)
117761ae650dSJack F Vogel 	/* response section */
117861ae650dSJack F Vogel 	u8	match_method;
117961ae650dSJack F Vogel #define I40E_AQC_MM_PERFECT_MATCH	0x01
118061ae650dSJack F Vogel #define I40E_AQC_MM_HASH_MATCH		0x02
118161ae650dSJack F Vogel #define I40E_AQC_MM_ERR_NO_RES		0xFF
118261ae650dSJack F Vogel 	u8	reserved1[3];
118361ae650dSJack F Vogel };
118461ae650dSJack F Vogel 
118561ae650dSJack F Vogel struct i40e_aqc_add_remove_macvlan_completion {
118661ae650dSJack F Vogel 	__le16 perfect_mac_used;
118761ae650dSJack F Vogel 	__le16 perfect_mac_free;
118861ae650dSJack F Vogel 	__le16 unicast_hash_free;
118961ae650dSJack F Vogel 	__le16 multicast_hash_free;
119061ae650dSJack F Vogel 	__le32 addr_high;
119161ae650dSJack F Vogel 	__le32 addr_low;
119261ae650dSJack F Vogel };
119361ae650dSJack F Vogel 
119461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_macvlan_completion);
119561ae650dSJack F Vogel 
119661ae650dSJack F Vogel /* Remove MAC-VLAN (indirect 0x0251)
119761ae650dSJack F Vogel  * uses i40e_aqc_macvlan for the descriptor
119861ae650dSJack F Vogel  * data points to an array of num_addresses of elements
119961ae650dSJack F Vogel  */
120061ae650dSJack F Vogel 
120161ae650dSJack F Vogel struct i40e_aqc_remove_macvlan_element_data {
120261ae650dSJack F Vogel 	u8	mac_addr[6];
120361ae650dSJack F Vogel 	__le16	vlan_tag;
120461ae650dSJack F Vogel 	u8	flags;
120561ae650dSJack F Vogel #define I40E_AQC_MACVLAN_DEL_PERFECT_MATCH	0x01
120661ae650dSJack F Vogel #define I40E_AQC_MACVLAN_DEL_HASH_MATCH		0x02
120761ae650dSJack F Vogel #define I40E_AQC_MACVLAN_DEL_IGNORE_VLAN	0x08
120861ae650dSJack F Vogel #define I40E_AQC_MACVLAN_DEL_ALL_VSIS		0x10
120961ae650dSJack F Vogel 	u8	reserved[3];
121061ae650dSJack F Vogel 	/* reply section */
121161ae650dSJack F Vogel 	u8	error_code;
121261ae650dSJack F Vogel #define I40E_AQC_REMOVE_MACVLAN_SUCCESS		0x0
121361ae650dSJack F Vogel #define I40E_AQC_REMOVE_MACVLAN_FAIL		0xFF
121461ae650dSJack F Vogel 	u8	reply_reserved[3];
121561ae650dSJack F Vogel };
121661ae650dSJack F Vogel 
121761ae650dSJack F Vogel /* Add VLAN (indirect 0x0252)
121861ae650dSJack F Vogel  * Remove VLAN (indirect 0x0253)
121961ae650dSJack F Vogel  * use the generic i40e_aqc_macvlan for the command
122061ae650dSJack F Vogel  */
122161ae650dSJack F Vogel struct i40e_aqc_add_remove_vlan_element_data {
122261ae650dSJack F Vogel 	__le16	vlan_tag;
122361ae650dSJack F Vogel 	u8	vlan_flags;
122461ae650dSJack F Vogel /* flags for add VLAN */
122561ae650dSJack F Vogel #define I40E_AQC_ADD_VLAN_LOCAL			0x1
122661ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_SHIFT		1
122761ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_MASK	(0x3 << I40E_AQC_ADD_PVLAN_TYPE_SHIFT)
122861ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_REGULAR		0x0
122961ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_PRIMARY		0x2
123061ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_SECONDARY	0x4
123161ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_SHIFT		3
123261ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_MASK	(0x3 << I40E_AQC_VLAN_PTYPE_SHIFT)
123361ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_REGULAR_VSI		0x0
123461ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_PROMISC_VSI		0x8
123561ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_COMMUNITY_VSI	0x10
123661ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_ISOLATED_VSI	0x18
123761ae650dSJack F Vogel /* flags for remove VLAN */
123861ae650dSJack F Vogel #define I40E_AQC_REMOVE_VLAN_ALL	0x1
123961ae650dSJack F Vogel 	u8	reserved;
124061ae650dSJack F Vogel 	u8	result;
124161ae650dSJack F Vogel /* flags for add VLAN */
124261ae650dSJack F Vogel #define I40E_AQC_ADD_VLAN_SUCCESS	0x0
124361ae650dSJack F Vogel #define I40E_AQC_ADD_VLAN_FAIL_REQUEST	0xFE
124461ae650dSJack F Vogel #define I40E_AQC_ADD_VLAN_FAIL_RESOURCE	0xFF
124561ae650dSJack F Vogel /* flags for remove VLAN */
124661ae650dSJack F Vogel #define I40E_AQC_REMOVE_VLAN_SUCCESS	0x0
124761ae650dSJack F Vogel #define I40E_AQC_REMOVE_VLAN_FAIL	0xFF
124861ae650dSJack F Vogel 	u8	reserved1[3];
124961ae650dSJack F Vogel };
125061ae650dSJack F Vogel 
125161ae650dSJack F Vogel struct i40e_aqc_add_remove_vlan_completion {
125261ae650dSJack F Vogel 	u8	reserved[4];
125361ae650dSJack F Vogel 	__le16	vlans_used;
125461ae650dSJack F Vogel 	__le16	vlans_free;
125561ae650dSJack F Vogel 	__le32	addr_high;
125661ae650dSJack F Vogel 	__le32	addr_low;
125761ae650dSJack F Vogel };
125861ae650dSJack F Vogel 
125961ae650dSJack F Vogel /* Set VSI Promiscuous Modes (direct 0x0254) */
126061ae650dSJack F Vogel struct i40e_aqc_set_vsi_promiscuous_modes {
126161ae650dSJack F Vogel 	__le16	promiscuous_flags;
126261ae650dSJack F Vogel 	__le16	valid_flags;
126361ae650dSJack F Vogel /* flags used for both fields above */
126461ae650dSJack F Vogel #define I40E_AQC_SET_VSI_PROMISC_UNICAST	0x01
126561ae650dSJack F Vogel #define I40E_AQC_SET_VSI_PROMISC_MULTICAST	0x02
126661ae650dSJack F Vogel #define I40E_AQC_SET_VSI_PROMISC_BROADCAST	0x04
126761ae650dSJack F Vogel #define I40E_AQC_SET_VSI_DEFAULT		0x08
126861ae650dSJack F Vogel #define I40E_AQC_SET_VSI_PROMISC_VLAN		0x10
1269abf77452SKrzysztof Galazka #define I40E_AQC_SET_VSI_PROMISC_RX_ONLY	0x8000
127061ae650dSJack F Vogel 	__le16	seid;
127161ae650dSJack F Vogel #define I40E_AQC_VSI_PROM_CMD_SEID_MASK		0x3FF
127261ae650dSJack F Vogel 	__le16	vlan_tag;
1273be771cdaSJack F Vogel #define I40E_AQC_SET_VSI_VLAN_MASK		0x0FFF
127461ae650dSJack F Vogel #define I40E_AQC_SET_VSI_VLAN_VALID		0x8000
127561ae650dSJack F Vogel 	u8	reserved[8];
127661ae650dSJack F Vogel };
127761ae650dSJack F Vogel 
127861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_vsi_promiscuous_modes);
127961ae650dSJack F Vogel 
128061ae650dSJack F Vogel /* Add S/E-tag command (direct 0x0255)
128161ae650dSJack F Vogel  * Uses generic i40e_aqc_add_remove_tag_completion for completion
128261ae650dSJack F Vogel  */
128361ae650dSJack F Vogel struct i40e_aqc_add_tag {
128461ae650dSJack F Vogel 	__le16	flags;
128561ae650dSJack F Vogel #define I40E_AQC_ADD_TAG_FLAG_TO_QUEUE		0x0001
128661ae650dSJack F Vogel 	__le16	seid;
128761ae650dSJack F Vogel #define I40E_AQC_ADD_TAG_CMD_SEID_NUM_SHIFT	0
128861ae650dSJack F Vogel #define I40E_AQC_ADD_TAG_CMD_SEID_NUM_MASK	(0x3FF << \
128961ae650dSJack F Vogel 					I40E_AQC_ADD_TAG_CMD_SEID_NUM_SHIFT)
129061ae650dSJack F Vogel 	__le16	tag;
129161ae650dSJack F Vogel 	__le16	queue_number;
129261ae650dSJack F Vogel 	u8	reserved[8];
129361ae650dSJack F Vogel };
129461ae650dSJack F Vogel 
129561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_tag);
129661ae650dSJack F Vogel 
129761ae650dSJack F Vogel struct i40e_aqc_add_remove_tag_completion {
129861ae650dSJack F Vogel 	u8	reserved[12];
129961ae650dSJack F Vogel 	__le16	tags_used;
130061ae650dSJack F Vogel 	__le16	tags_free;
130161ae650dSJack F Vogel };
130261ae650dSJack F Vogel 
130361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_tag_completion);
130461ae650dSJack F Vogel 
130561ae650dSJack F Vogel /* Remove S/E-tag command (direct 0x0256)
130661ae650dSJack F Vogel  * Uses generic i40e_aqc_add_remove_tag_completion for completion
130761ae650dSJack F Vogel  */
130861ae650dSJack F Vogel struct i40e_aqc_remove_tag {
130961ae650dSJack F Vogel 	__le16	seid;
131061ae650dSJack F Vogel #define I40E_AQC_REMOVE_TAG_CMD_SEID_NUM_SHIFT	0
131161ae650dSJack F Vogel #define I40E_AQC_REMOVE_TAG_CMD_SEID_NUM_MASK	(0x3FF << \
131261ae650dSJack F Vogel 					I40E_AQC_REMOVE_TAG_CMD_SEID_NUM_SHIFT)
131361ae650dSJack F Vogel 	__le16	tag;
131461ae650dSJack F Vogel 	u8	reserved[12];
131561ae650dSJack F Vogel };
131661ae650dSJack F Vogel 
1317f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_tag);
1318f247dc25SJack F Vogel 
131961ae650dSJack F Vogel /* Add multicast E-Tag (direct 0x0257)
132061ae650dSJack F Vogel  * del multicast E-Tag (direct 0x0258) only uses pv_seid and etag fields
132161ae650dSJack F Vogel  * and no external data
132261ae650dSJack F Vogel  */
132361ae650dSJack F Vogel struct i40e_aqc_add_remove_mcast_etag {
132461ae650dSJack F Vogel 	__le16	pv_seid;
132561ae650dSJack F Vogel 	__le16	etag;
132661ae650dSJack F Vogel 	u8	num_unicast_etags;
132761ae650dSJack F Vogel 	u8	reserved[3];
132861ae650dSJack F Vogel 	__le32	addr_high;          /* address of array of 2-byte s-tags */
132961ae650dSJack F Vogel 	__le32	addr_low;
133061ae650dSJack F Vogel };
133161ae650dSJack F Vogel 
133261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_mcast_etag);
133361ae650dSJack F Vogel 
133461ae650dSJack F Vogel struct i40e_aqc_add_remove_mcast_etag_completion {
133561ae650dSJack F Vogel 	u8	reserved[4];
133661ae650dSJack F Vogel 	__le16	mcast_etags_used;
133761ae650dSJack F Vogel 	__le16	mcast_etags_free;
133861ae650dSJack F Vogel 	__le32	addr_high;
133961ae650dSJack F Vogel 	__le32	addr_low;
134061ae650dSJack F Vogel 
134161ae650dSJack F Vogel };
134261ae650dSJack F Vogel 
134361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_mcast_etag_completion);
134461ae650dSJack F Vogel 
134561ae650dSJack F Vogel /* Update S/E-Tag (direct 0x0259) */
134661ae650dSJack F Vogel struct i40e_aqc_update_tag {
134761ae650dSJack F Vogel 	__le16	seid;
134861ae650dSJack F Vogel #define I40E_AQC_UPDATE_TAG_CMD_SEID_NUM_SHIFT	0
134961ae650dSJack F Vogel #define I40E_AQC_UPDATE_TAG_CMD_SEID_NUM_MASK	(0x3FF << \
135061ae650dSJack F Vogel 					I40E_AQC_UPDATE_TAG_CMD_SEID_NUM_SHIFT)
135161ae650dSJack F Vogel 	__le16	old_tag;
135261ae650dSJack F Vogel 	__le16	new_tag;
135361ae650dSJack F Vogel 	u8	reserved[10];
135461ae650dSJack F Vogel };
135561ae650dSJack F Vogel 
135661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_update_tag);
135761ae650dSJack F Vogel 
135861ae650dSJack F Vogel struct i40e_aqc_update_tag_completion {
135961ae650dSJack F Vogel 	u8	reserved[12];
136061ae650dSJack F Vogel 	__le16	tags_used;
136161ae650dSJack F Vogel 	__le16	tags_free;
136261ae650dSJack F Vogel };
136361ae650dSJack F Vogel 
136461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_update_tag_completion);
136561ae650dSJack F Vogel 
136661ae650dSJack F Vogel /* Add Control Packet filter (direct 0x025A)
136761ae650dSJack F Vogel  * Remove Control Packet filter (direct 0x025B)
136861ae650dSJack F Vogel  * uses the i40e_aqc_add_oveb_cloud,
136961ae650dSJack F Vogel  * and the generic direct completion structure
137061ae650dSJack F Vogel  */
137161ae650dSJack F Vogel struct i40e_aqc_add_remove_control_packet_filter {
137261ae650dSJack F Vogel 	u8	mac[6];
137361ae650dSJack F Vogel 	__le16	etype;
137461ae650dSJack F Vogel 	__le16	flags;
137561ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC	0x0001
137661ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP		0x0002
137761ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TO_QUEUE	0x0004
137861ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX		0x0008
137961ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_RX		0x0000
138061ae650dSJack F Vogel 	__le16	seid;
138161ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_CMD_SEID_NUM_SHIFT	0
138261ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_CMD_SEID_NUM_MASK	(0x3FF << \
138361ae650dSJack F Vogel 				I40E_AQC_ADD_CONTROL_PACKET_CMD_SEID_NUM_SHIFT)
138461ae650dSJack F Vogel 	__le16	queue;
138561ae650dSJack F Vogel 	u8	reserved[2];
138661ae650dSJack F Vogel };
138761ae650dSJack F Vogel 
138861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_control_packet_filter);
138961ae650dSJack F Vogel 
139061ae650dSJack F Vogel struct i40e_aqc_add_remove_control_packet_filter_completion {
139161ae650dSJack F Vogel 	__le16	mac_etype_used;
139261ae650dSJack F Vogel 	__le16	etype_used;
139361ae650dSJack F Vogel 	__le16	mac_etype_free;
139461ae650dSJack F Vogel 	__le16	etype_free;
139561ae650dSJack F Vogel 	u8	reserved[8];
139661ae650dSJack F Vogel };
139761ae650dSJack F Vogel 
139861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_control_packet_filter_completion);
139961ae650dSJack F Vogel 
140061ae650dSJack F Vogel /* Add Cloud filters (indirect 0x025C)
140161ae650dSJack F Vogel  * Remove Cloud filters (indirect 0x025D)
140261ae650dSJack F Vogel  * uses the i40e_aqc_add_remove_cloud_filters,
140361ae650dSJack F Vogel  * and the generic indirect completion structure
140461ae650dSJack F Vogel  */
140561ae650dSJack F Vogel struct i40e_aqc_add_remove_cloud_filters {
140661ae650dSJack F Vogel 	u8	num_filters;
140761ae650dSJack F Vogel 	u8	reserved;
140861ae650dSJack F Vogel 	__le16	seid;
140961ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT	0
141061ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK	(0x3FF << \
141161ae650dSJack F Vogel 					I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT)
1412b4a7ce06SEric Joyner 	u8	big_buffer_flag;
1413b4a7ce06SEric Joyner #define I40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER	1
1414b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_CMD_BB		1
1415b4a7ce06SEric Joyner 	u8	reserved2[3];
141661ae650dSJack F Vogel 	__le32	addr_high;
141761ae650dSJack F Vogel 	__le32	addr_low;
141861ae650dSJack F Vogel };
141961ae650dSJack F Vogel 
142061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_cloud_filters);
142161ae650dSJack F Vogel 
1422b4a7ce06SEric Joyner struct i40e_aqc_cloud_filters_element_data {
142361ae650dSJack F Vogel 	u8	outer_mac[6];
142461ae650dSJack F Vogel 	u8	inner_mac[6];
142561ae650dSJack F Vogel 	__le16	inner_vlan;
142661ae650dSJack F Vogel 	union {
142761ae650dSJack F Vogel 		struct {
142861ae650dSJack F Vogel 			u8 reserved[12];
142961ae650dSJack F Vogel 			u8 data[4];
143061ae650dSJack F Vogel 		} v4;
143161ae650dSJack F Vogel 		struct {
143261ae650dSJack F Vogel 			u8 data[16];
143361ae650dSJack F Vogel 		} v6;
1434b4a7ce06SEric Joyner 		struct {
1435b4a7ce06SEric Joyner 			__le16 data[8];
1436b4a7ce06SEric Joyner 		} raw_v6;
143761ae650dSJack F Vogel 	} ipaddr;
143861ae650dSJack F Vogel 	__le16	flags;
143961ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_SHIFT			0
144061ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_MASK	(0x3F << \
144161ae650dSJack F Vogel 					I40E_AQC_ADD_CLOUD_FILTER_SHIFT)
144261ae650dSJack F Vogel /* 0x0000 reserved */
1443b4a7ce06SEric Joyner /* 0x0001 reserved */
144461ae650dSJack F Vogel /* 0x0002 reserved */
144561ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN		0x0003
144661ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN_TEN_ID	0x0004
144761ae650dSJack F Vogel /* 0x0005 reserved */
144861ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_TEN_ID		0x0006
144961ae650dSJack F Vogel /* 0x0007 reserved */
145061ae650dSJack F Vogel /* 0x0008 reserved */
145161ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_OMAC			0x0009
145261ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IMAC			0x000A
145361ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC	0x000B
145461ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IIP			0x000C
1455abf77452SKrzysztof Galazka #define I40E_AQC_ADD_CLOUD_FILTER_OIP1			0x0010
1456abf77452SKrzysztof Galazka #define I40E_AQC_ADD_CLOUD_FILTER_OIP2			0x0012
1457b4a7ce06SEric Joyner /* 0x000D reserved */
1458b4a7ce06SEric Joyner /* 0x000E reserved */
1459b4a7ce06SEric Joyner /* 0x000F reserved */
1460b4a7ce06SEric Joyner /* 0x0010 to 0x0017 is for custom filters */
1461b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT		0x0010 /* Dest IP + L4 Port */
1462b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT		0x0011 /* Dest MAC + L4 Port */
1463b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT		0x0012 /* Dest MAC + VLAN + L4 Port */
146461ae650dSJack F Vogel 
146561ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE		0x0080
146661ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_VNK_SHIFT			6
146761ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_VNK_MASK			0x00C0
146861ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FLAGS_IPV4			0
146961ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FLAGS_IPV6			0x0100
147061ae650dSJack F Vogel 
147161ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT		9
147261ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_MASK		0x1E00
1473fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_TNL_TYPE_VXLAN		0
147461ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC		1
1475fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_TNL_TYPE_GENEVE		2
147661ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_IP			3
1477fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_TNL_TYPE_RESERVED		4
1478fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_TNL_TYPE_VXLAN_GPE		5
1479fdb6f38aSEric Joyner 
1480fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_FLAGS_SHARED_OUTER_MAC	0x2000
1481fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_FLAGS_SHARED_INNER_MAC	0x4000
1482fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_FLAGS_SHARED_OUTER_IP	0x8000
148361ae650dSJack F Vogel 
148461ae650dSJack F Vogel 	__le32	tenant_id;
148561ae650dSJack F Vogel 	u8	reserved[4];
148661ae650dSJack F Vogel 	__le16	queue_number;
148761ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_QUEUE_SHIFT		0
1488f247dc25SJack F Vogel #define I40E_AQC_ADD_CLOUD_QUEUE_MASK		(0x7FF << \
148961ae650dSJack F Vogel 						 I40E_AQC_ADD_CLOUD_QUEUE_SHIFT)
149061ae650dSJack F Vogel 	u8	reserved2[14];
149161ae650dSJack F Vogel 	/* response section */
149261ae650dSJack F Vogel 	u8	allocation_result;
149361ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_SUCCESS	0x0
149461ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_FAIL		0xFF
149561ae650dSJack F Vogel 	u8	response_reserved[7];
149661ae650dSJack F Vogel };
149761ae650dSJack F Vogel 
1498b4a7ce06SEric Joyner /* i40e_aqc_add_rm_cloud_filt_elem_ext is used when
1499b4a7ce06SEric Joyner  * I40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER flag is set.
1500b4a7ce06SEric Joyner  */
1501b4a7ce06SEric Joyner struct i40e_aqc_add_rm_cloud_filt_elem_ext {
1502b4a7ce06SEric Joyner 	struct i40e_aqc_cloud_filters_element_data element;
1503b4a7ce06SEric Joyner 	u16     general_fields[32];
1504b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD0	0
1505b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD1	1
1506b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD2	2
1507b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD0	3
1508b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD1	4
1509b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD2	5
1510b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD0	6
1511b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD1	7
1512b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD2	8
1513b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD0	9
1514b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD1	10
1515b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD2	11
1516b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD0	12
1517b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD1	13
1518b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD2	14
1519b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0	15
1520b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD1	16
1521b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD2	17
1522b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD3	18
1523b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4	19
1524b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD5	20
1525b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD6	21
1526b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD7	22
1527b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD0	23
1528b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD1	24
1529b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD2	25
1530b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD3	26
1531b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD4	27
1532b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD5	28
1533b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD6	29
1534b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD7	30
1535b4a7ce06SEric Joyner };
1536b4a7ce06SEric Joyner 
1537b4a7ce06SEric Joyner I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_cloud_filters_element_data);
1538b4a7ce06SEric Joyner 
1539b4a7ce06SEric Joyner /* i40e_aqc_cloud_filters_element_bb is used when
1540b4a7ce06SEric Joyner  * I40E_AQC_CLOUD_CMD_BB flag is set.
1541b4a7ce06SEric Joyner  */
1542b4a7ce06SEric Joyner struct i40e_aqc_cloud_filters_element_bb {
1543b4a7ce06SEric Joyner 	struct i40e_aqc_cloud_filters_element_data element;
1544b4a7ce06SEric Joyner 	u16     general_fields[32];
1545b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD0	0
1546b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD1	1
1547b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD2	2
1548b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD0	3
1549b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD1	4
1550b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD2	5
1551b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD0	6
1552b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD1	7
1553b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD2	8
1554b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD0	9
1555b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD1	10
1556b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD2	11
1557b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD0	12
1558b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD1	13
1559b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD2	14
1560b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0	15
1561b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD1	16
1562b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD2	17
1563b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD3	18
1564b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4	19
1565b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD5	20
1566b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD6	21
1567b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD7	22
1568b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD0	23
1569b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD1	24
1570b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD2	25
1571b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD3	26
1572b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD4	27
1573b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD5	28
1574b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD6	29
1575b4a7ce06SEric Joyner #define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD7	30
1576b4a7ce06SEric Joyner };
1577b4a7ce06SEric Joyner 
1578b4a7ce06SEric Joyner I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_cloud_filters_element_bb);
1579b4a7ce06SEric Joyner 
158061ae650dSJack F Vogel struct i40e_aqc_remove_cloud_filters_completion {
158161ae650dSJack F Vogel 	__le16 perfect_ovlan_used;
158261ae650dSJack F Vogel 	__le16 perfect_ovlan_free;
158361ae650dSJack F Vogel 	__le16 vlan_used;
158461ae650dSJack F Vogel 	__le16 vlan_free;
158561ae650dSJack F Vogel 	__le32 addr_high;
158661ae650dSJack F Vogel 	__le32 addr_low;
158761ae650dSJack F Vogel };
158861ae650dSJack F Vogel 
158961ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion);
159061ae650dSJack F Vogel 
1591b4a7ce06SEric Joyner /* Replace filter Command 0x025F
1592b4a7ce06SEric Joyner  * uses the i40e_aqc_replace_cloud_filters,
1593b4a7ce06SEric Joyner  * and the generic indirect completion structure
1594b4a7ce06SEric Joyner  */
1595b4a7ce06SEric Joyner struct i40e_filter_data {
1596b4a7ce06SEric Joyner 	u8 filter_type;
1597b4a7ce06SEric Joyner 	u8 input[3];
1598b4a7ce06SEric Joyner };
1599b4a7ce06SEric Joyner 
1600b4a7ce06SEric Joyner I40E_CHECK_STRUCT_LEN(4, i40e_filter_data);
1601b4a7ce06SEric Joyner 
1602b4a7ce06SEric Joyner struct i40e_aqc_replace_cloud_filters_cmd {
1603b4a7ce06SEric Joyner 	u8	valid_flags;
1604b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_L1_FILTER		0x0
1605b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_FILTER		0x1
1606b4a7ce06SEric Joyner #define I40E_AQC_GET_CLOUD_FILTERS		0x2
1607b4a7ce06SEric Joyner #define I40E_AQC_MIRROR_CLOUD_FILTER		0x4
1608b4a7ce06SEric Joyner #define I40E_AQC_HIGH_PRIORITY_CLOUD_FILTER	0x8
1609b4a7ce06SEric Joyner 	u8	old_filter_type;
1610b4a7ce06SEric Joyner 	u8	new_filter_type;
1611b4a7ce06SEric Joyner 	u8	tr_bit;
1612b4a7ce06SEric Joyner 	u8	tr_bit2;
1613b4a7ce06SEric Joyner 	u8	reserved[3];
1614b4a7ce06SEric Joyner 	__le32 addr_high;
1615b4a7ce06SEric Joyner 	__le32 addr_low;
1616b4a7ce06SEric Joyner };
1617b4a7ce06SEric Joyner 
1618b4a7ce06SEric Joyner I40E_CHECK_CMD_LENGTH(i40e_aqc_replace_cloud_filters_cmd);
1619b4a7ce06SEric Joyner 
1620b4a7ce06SEric Joyner struct i40e_aqc_replace_cloud_filters_cmd_buf {
1621b4a7ce06SEric Joyner 	u8	data[32];
1622b4a7ce06SEric Joyner /* Filter type INPUT codes*/
1623b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_ENTRIES_MAX	3
1624b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_VALIDATED	(1 << 7UL)
1625b4a7ce06SEric Joyner 
1626b4a7ce06SEric Joyner /* Field Vector offsets */
1627b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_MAC_DA		0
1628b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_STAG_ETH		6
1629b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_STAG		7
1630b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_VLAN		8
1631b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_STAG_OVLAN		9
1632b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_STAG_IVLAN		10
1633b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_TUNNLE_KEY		11
1634b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_IMAC		12
1635b4a7ce06SEric Joyner /* big FLU */
1636b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_IP_DA		14
1637b4a7ce06SEric Joyner /* big FLU */
1638b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_OIP_DA		15
1639b4a7ce06SEric Joyner 
1640b4a7ce06SEric Joyner #define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_INNER_VLAN		37
1641b4a7ce06SEric Joyner 	struct i40e_filter_data	filters[8];
1642b4a7ce06SEric Joyner };
1643b4a7ce06SEric Joyner 
1644b4a7ce06SEric Joyner I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_replace_cloud_filters_cmd_buf);
1645b4a7ce06SEric Joyner 
164661ae650dSJack F Vogel /* Add Mirror Rule (indirect or direct 0x0260)
164761ae650dSJack F Vogel  * Delete Mirror Rule (indirect or direct 0x0261)
164861ae650dSJack F Vogel  * note: some rule types (4,5) do not use an external buffer.
164961ae650dSJack F Vogel  *       take care to set the flags correctly.
165061ae650dSJack F Vogel  */
165161ae650dSJack F Vogel struct i40e_aqc_add_delete_mirror_rule {
165261ae650dSJack F Vogel 	__le16 seid;
165361ae650dSJack F Vogel 	__le16 rule_type;
165461ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_SHIFT		0
165561ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_MASK		(0x7 << \
165661ae650dSJack F Vogel 						I40E_AQC_MIRROR_RULE_TYPE_SHIFT)
165761ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_VPORT_INGRESS	1
165861ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_VPORT_EGRESS	2
165961ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_VLAN		3
166061ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_ALL_INGRESS	4
166161ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_ALL_EGRESS	5
166261ae650dSJack F Vogel 	__le16 num_entries;
166361ae650dSJack F Vogel 	__le16 destination;  /* VSI for add, rule id for delete */
166461ae650dSJack F Vogel 	__le32 addr_high;    /* address of array of 2-byte VSI or VLAN ids */
166561ae650dSJack F Vogel 	__le32 addr_low;
166661ae650dSJack F Vogel };
166761ae650dSJack F Vogel 
166861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_delete_mirror_rule);
166961ae650dSJack F Vogel 
167061ae650dSJack F Vogel struct i40e_aqc_add_delete_mirror_rule_completion {
167161ae650dSJack F Vogel 	u8	reserved[2];
167261ae650dSJack F Vogel 	__le16	rule_id;  /* only used on add */
167361ae650dSJack F Vogel 	__le16	mirror_rules_used;
167461ae650dSJack F Vogel 	__le16	mirror_rules_free;
167561ae650dSJack F Vogel 	__le32	addr_high;
167661ae650dSJack F Vogel 	__le32	addr_low;
167761ae650dSJack F Vogel };
167861ae650dSJack F Vogel 
167961ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_delete_mirror_rule_completion);
168061ae650dSJack F Vogel 
168161ae650dSJack F Vogel /* DCB 0x03xx*/
168261ae650dSJack F Vogel 
168361ae650dSJack F Vogel /* PFC Ignore (direct 0x0301)
168461ae650dSJack F Vogel  *    the command and response use the same descriptor structure
168561ae650dSJack F Vogel  */
168661ae650dSJack F Vogel struct i40e_aqc_pfc_ignore {
168761ae650dSJack F Vogel 	u8	tc_bitmap;
168861ae650dSJack F Vogel 	u8	command_flags; /* unused on response */
168961ae650dSJack F Vogel #define I40E_AQC_PFC_IGNORE_SET		0x80
169061ae650dSJack F Vogel #define I40E_AQC_PFC_IGNORE_CLEAR	0x0
169161ae650dSJack F Vogel 	u8	reserved[14];
169261ae650dSJack F Vogel };
169361ae650dSJack F Vogel 
169461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_pfc_ignore);
169561ae650dSJack F Vogel 
169661ae650dSJack F Vogel /* DCB Update (direct 0x0302) uses the i40e_aq_desc structure
169761ae650dSJack F Vogel  * with no parameters
169861ae650dSJack F Vogel  */
169961ae650dSJack F Vogel 
170061ae650dSJack F Vogel /* TX scheduler 0x04xx */
170161ae650dSJack F Vogel 
170261ae650dSJack F Vogel /* Almost all the indirect commands use
170361ae650dSJack F Vogel  * this generic struct to pass the SEID in param0
170461ae650dSJack F Vogel  */
170561ae650dSJack F Vogel struct i40e_aqc_tx_sched_ind {
170661ae650dSJack F Vogel 	__le16	vsi_seid;
170761ae650dSJack F Vogel 	u8	reserved[6];
170861ae650dSJack F Vogel 	__le32	addr_high;
170961ae650dSJack F Vogel 	__le32	addr_low;
171061ae650dSJack F Vogel };
171161ae650dSJack F Vogel 
171261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_tx_sched_ind);
171361ae650dSJack F Vogel 
171461ae650dSJack F Vogel /* Several commands respond with a set of queue set handles */
171561ae650dSJack F Vogel struct i40e_aqc_qs_handles_resp {
171661ae650dSJack F Vogel 	__le16 qs_handles[8];
171761ae650dSJack F Vogel };
171861ae650dSJack F Vogel 
171961ae650dSJack F Vogel /* Configure VSI BW limits (direct 0x0400) */
172061ae650dSJack F Vogel struct i40e_aqc_configure_vsi_bw_limit {
172161ae650dSJack F Vogel 	__le16	vsi_seid;
172261ae650dSJack F Vogel 	u8	reserved[2];
172361ae650dSJack F Vogel 	__le16	credit;
172461ae650dSJack F Vogel 	u8	reserved1[2];
172561ae650dSJack F Vogel 	u8	max_credit; /* 0-3, limit = 2^max */
172661ae650dSJack F Vogel 	u8	reserved2[7];
172761ae650dSJack F Vogel };
172861ae650dSJack F Vogel 
172961ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_configure_vsi_bw_limit);
173061ae650dSJack F Vogel 
173161ae650dSJack F Vogel /* Configure VSI Bandwidth Limit per Traffic Type (indirect 0x0406)
173261ae650dSJack F Vogel  *    responds with i40e_aqc_qs_handles_resp
173361ae650dSJack F Vogel  */
173461ae650dSJack F Vogel struct i40e_aqc_configure_vsi_ets_sla_bw_data {
173561ae650dSJack F Vogel 	u8	tc_valid_bits;
173661ae650dSJack F Vogel 	u8	reserved[15];
173761ae650dSJack F Vogel 	__le16	tc_bw_credits[8]; /* FW writesback QS handles here */
173861ae650dSJack F Vogel 
173961ae650dSJack F Vogel 	/* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
174061ae650dSJack F Vogel 	__le16	tc_bw_max[2];
174161ae650dSJack F Vogel 	u8	reserved1[28];
174261ae650dSJack F Vogel };
174361ae650dSJack F Vogel 
1744f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_configure_vsi_ets_sla_bw_data);
1745f247dc25SJack F Vogel 
174661ae650dSJack F Vogel /* Configure VSI Bandwidth Allocation per Traffic Type (indirect 0x0407)
174761ae650dSJack F Vogel  *    responds with i40e_aqc_qs_handles_resp
174861ae650dSJack F Vogel  */
174961ae650dSJack F Vogel struct i40e_aqc_configure_vsi_tc_bw_data {
175061ae650dSJack F Vogel 	u8	tc_valid_bits;
175161ae650dSJack F Vogel 	u8	reserved[3];
175261ae650dSJack F Vogel 	u8	tc_bw_credits[8];
175361ae650dSJack F Vogel 	u8	reserved1[4];
175461ae650dSJack F Vogel 	__le16	qs_handles[8];
175561ae650dSJack F Vogel };
175661ae650dSJack F Vogel 
1757f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_configure_vsi_tc_bw_data);
1758f247dc25SJack F Vogel 
175961ae650dSJack F Vogel /* Query vsi bw configuration (indirect 0x0408) */
176061ae650dSJack F Vogel struct i40e_aqc_query_vsi_bw_config_resp {
176161ae650dSJack F Vogel 	u8	tc_valid_bits;
176261ae650dSJack F Vogel 	u8	tc_suspended_bits;
176361ae650dSJack F Vogel 	u8	reserved[14];
176461ae650dSJack F Vogel 	__le16	qs_handles[8];
176561ae650dSJack F Vogel 	u8	reserved1[4];
176661ae650dSJack F Vogel 	__le16	port_bw_limit;
176761ae650dSJack F Vogel 	u8	reserved2[2];
176861ae650dSJack F Vogel 	u8	max_bw; /* 0-3, limit = 2^max */
176961ae650dSJack F Vogel 	u8	reserved3[23];
177061ae650dSJack F Vogel };
177161ae650dSJack F Vogel 
1772f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_query_vsi_bw_config_resp);
1773f247dc25SJack F Vogel 
177461ae650dSJack F Vogel /* Query VSI Bandwidth Allocation per Traffic Type (indirect 0x040A) */
177561ae650dSJack F Vogel struct i40e_aqc_query_vsi_ets_sla_config_resp {
177661ae650dSJack F Vogel 	u8	tc_valid_bits;
177761ae650dSJack F Vogel 	u8	reserved[3];
177861ae650dSJack F Vogel 	u8	share_credits[8];
177961ae650dSJack F Vogel 	__le16	credits[8];
178061ae650dSJack F Vogel 
178161ae650dSJack F Vogel 	/* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
178261ae650dSJack F Vogel 	__le16	tc_bw_max[2];
178361ae650dSJack F Vogel };
178461ae650dSJack F Vogel 
1785f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_query_vsi_ets_sla_config_resp);
1786f247dc25SJack F Vogel 
178761ae650dSJack F Vogel /* Configure Switching Component Bandwidth Limit (direct 0x0410) */
178861ae650dSJack F Vogel struct i40e_aqc_configure_switching_comp_bw_limit {
178961ae650dSJack F Vogel 	__le16	seid;
179061ae650dSJack F Vogel 	u8	reserved[2];
179161ae650dSJack F Vogel 	__le16	credit;
179261ae650dSJack F Vogel 	u8	reserved1[2];
179361ae650dSJack F Vogel 	u8	max_bw; /* 0-3, limit = 2^max */
179461ae650dSJack F Vogel 	u8	reserved2[7];
179561ae650dSJack F Vogel };
179661ae650dSJack F Vogel 
179761ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_configure_switching_comp_bw_limit);
179861ae650dSJack F Vogel 
179961ae650dSJack F Vogel /* Enable  Physical Port ETS (indirect 0x0413)
180061ae650dSJack F Vogel  * Modify  Physical Port ETS (indirect 0x0414)
180161ae650dSJack F Vogel  * Disable Physical Port ETS (indirect 0x0415)
180261ae650dSJack F Vogel  */
180361ae650dSJack F Vogel struct i40e_aqc_configure_switching_comp_ets_data {
180461ae650dSJack F Vogel 	u8	reserved[4];
180561ae650dSJack F Vogel 	u8	tc_valid_bits;
180661ae650dSJack F Vogel 	u8	seepage;
180761ae650dSJack F Vogel #define I40E_AQ_ETS_SEEPAGE_EN_MASK	0x1
180861ae650dSJack F Vogel 	u8	tc_strict_priority_flags;
180961ae650dSJack F Vogel 	u8	reserved1[17];
181061ae650dSJack F Vogel 	u8	tc_bw_share_credits[8];
181161ae650dSJack F Vogel 	u8	reserved2[96];
181261ae650dSJack F Vogel };
181361ae650dSJack F Vogel 
1814f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_configure_switching_comp_ets_data);
1815f247dc25SJack F Vogel 
181661ae650dSJack F Vogel /* Configure Switching Component Bandwidth Limits per Tc (indirect 0x0416) */
181761ae650dSJack F Vogel struct i40e_aqc_configure_switching_comp_ets_bw_limit_data {
181861ae650dSJack F Vogel 	u8	tc_valid_bits;
181961ae650dSJack F Vogel 	u8	reserved[15];
182061ae650dSJack F Vogel 	__le16	tc_bw_credit[8];
182161ae650dSJack F Vogel 
182261ae650dSJack F Vogel 	/* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
182361ae650dSJack F Vogel 	__le16	tc_bw_max[2];
182461ae650dSJack F Vogel 	u8	reserved1[28];
182561ae650dSJack F Vogel };
182661ae650dSJack F Vogel 
1827d4683565SEric Joyner I40E_CHECK_STRUCT_LEN(0x40,
1828d4683565SEric Joyner 		      i40e_aqc_configure_switching_comp_ets_bw_limit_data);
1829f247dc25SJack F Vogel 
183061ae650dSJack F Vogel /* Configure Switching Component Bandwidth Allocation per Tc
183161ae650dSJack F Vogel  * (indirect 0x0417)
183261ae650dSJack F Vogel  */
183361ae650dSJack F Vogel struct i40e_aqc_configure_switching_comp_bw_config_data {
183461ae650dSJack F Vogel 	u8	tc_valid_bits;
183561ae650dSJack F Vogel 	u8	reserved[2];
183661ae650dSJack F Vogel 	u8	absolute_credits; /* bool */
183761ae650dSJack F Vogel 	u8	tc_bw_share_credits[8];
183861ae650dSJack F Vogel 	u8	reserved1[20];
183961ae650dSJack F Vogel };
184061ae650dSJack F Vogel 
1841f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_configure_switching_comp_bw_config_data);
1842f247dc25SJack F Vogel 
184361ae650dSJack F Vogel /* Query Switching Component Configuration (indirect 0x0418) */
184461ae650dSJack F Vogel struct i40e_aqc_query_switching_comp_ets_config_resp {
184561ae650dSJack F Vogel 	u8	tc_valid_bits;
184661ae650dSJack F Vogel 	u8	reserved[35];
184761ae650dSJack F Vogel 	__le16	port_bw_limit;
184861ae650dSJack F Vogel 	u8	reserved1[2];
184961ae650dSJack F Vogel 	u8	tc_bw_max; /* 0-3, limit = 2^max */
185061ae650dSJack F Vogel 	u8	reserved2[23];
185161ae650dSJack F Vogel };
185261ae650dSJack F Vogel 
1853f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_query_switching_comp_ets_config_resp);
1854f247dc25SJack F Vogel 
185561ae650dSJack F Vogel /* Query PhysicalPort ETS Configuration (indirect 0x0419) */
185661ae650dSJack F Vogel struct i40e_aqc_query_port_ets_config_resp {
185761ae650dSJack F Vogel 	u8	reserved[4];
185861ae650dSJack F Vogel 	u8	tc_valid_bits;
185961ae650dSJack F Vogel 	u8	reserved1;
186061ae650dSJack F Vogel 	u8	tc_strict_priority_bits;
186161ae650dSJack F Vogel 	u8	reserved2;
186261ae650dSJack F Vogel 	u8	tc_bw_share_credits[8];
186361ae650dSJack F Vogel 	__le16	tc_bw_limits[8];
186461ae650dSJack F Vogel 
186561ae650dSJack F Vogel 	/* 4 bits per tc 0-7, 4th bit reserved, limit = 2^max */
186661ae650dSJack F Vogel 	__le16	tc_bw_max[2];
186761ae650dSJack F Vogel 	u8	reserved3[32];
186861ae650dSJack F Vogel };
186961ae650dSJack F Vogel 
1870f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x44, i40e_aqc_query_port_ets_config_resp);
1871f247dc25SJack F Vogel 
187261ae650dSJack F Vogel /* Query Switching Component Bandwidth Allocation per Traffic Type
187361ae650dSJack F Vogel  * (indirect 0x041A)
187461ae650dSJack F Vogel  */
187561ae650dSJack F Vogel struct i40e_aqc_query_switching_comp_bw_config_resp {
187661ae650dSJack F Vogel 	u8	tc_valid_bits;
187761ae650dSJack F Vogel 	u8	reserved[2];
187861ae650dSJack F Vogel 	u8	absolute_credits_enable; /* bool */
187961ae650dSJack F Vogel 	u8	tc_bw_share_credits[8];
188061ae650dSJack F Vogel 	__le16	tc_bw_limits[8];
188161ae650dSJack F Vogel 
188261ae650dSJack F Vogel 	/* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
188361ae650dSJack F Vogel 	__le16	tc_bw_max[2];
188461ae650dSJack F Vogel };
188561ae650dSJack F Vogel 
1886f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_query_switching_comp_bw_config_resp);
1887f247dc25SJack F Vogel 
188861ae650dSJack F Vogel /* Suspend/resume port TX traffic
188961ae650dSJack F Vogel  * (direct 0x041B and 0x041C) uses the generic SEID struct
189061ae650dSJack F Vogel  */
189161ae650dSJack F Vogel 
189261ae650dSJack F Vogel /* Configure partition BW
189361ae650dSJack F Vogel  * (indirect 0x041D)
189461ae650dSJack F Vogel  */
189561ae650dSJack F Vogel struct i40e_aqc_configure_partition_bw_data {
189661ae650dSJack F Vogel 	__le16	pf_valid_bits;
189761ae650dSJack F Vogel 	u8	min_bw[16];      /* guaranteed bandwidth */
189861ae650dSJack F Vogel 	u8	max_bw[16];      /* bandwidth limit */
189961ae650dSJack F Vogel };
190061ae650dSJack F Vogel 
1901f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x22, i40e_aqc_configure_partition_bw_data);
1902f247dc25SJack F Vogel 
190361ae650dSJack F Vogel /* Get and set the active HMC resource profile and status.
190461ae650dSJack F Vogel  * (direct 0x0500) and (direct 0x0501)
190561ae650dSJack F Vogel  */
190661ae650dSJack F Vogel struct i40e_aq_get_set_hmc_resource_profile {
190761ae650dSJack F Vogel 	u8	pm_profile;
190861ae650dSJack F Vogel 	u8	pe_vf_enabled;
190961ae650dSJack F Vogel 	u8	reserved[14];
191061ae650dSJack F Vogel };
191161ae650dSJack F Vogel 
191261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aq_get_set_hmc_resource_profile);
191361ae650dSJack F Vogel 
191461ae650dSJack F Vogel enum i40e_aq_hmc_profile {
191561ae650dSJack F Vogel 	/* I40E_HMC_PROFILE_NO_CHANGE	= 0, reserved */
191661ae650dSJack F Vogel 	I40E_HMC_PROFILE_DEFAULT	= 1,
191761ae650dSJack F Vogel 	I40E_HMC_PROFILE_FAVOR_VF	= 2,
191861ae650dSJack F Vogel 	I40E_HMC_PROFILE_EQUAL		= 3,
191961ae650dSJack F Vogel };
192061ae650dSJack F Vogel 
192161ae650dSJack F Vogel /* Get PHY Abilities (indirect 0x0600) uses the generic indirect struct */
192261ae650dSJack F Vogel 
192361ae650dSJack F Vogel /* set in param0 for get phy abilities to report qualified modules */
192461ae650dSJack F Vogel #define I40E_AQ_PHY_REPORT_QUALIFIED_MODULES	0x0001
192561ae650dSJack F Vogel #define I40E_AQ_PHY_REPORT_INITIAL_VALUES	0x0002
192661ae650dSJack F Vogel 
192761ae650dSJack F Vogel enum i40e_aq_phy_type {
192861ae650dSJack F Vogel 	I40E_PHY_TYPE_SGMII			= 0x0,
192961ae650dSJack F Vogel 	I40E_PHY_TYPE_1000BASE_KX		= 0x1,
193061ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_KX4		= 0x2,
193161ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_KR		= 0x3,
193261ae650dSJack F Vogel 	I40E_PHY_TYPE_40GBASE_KR4		= 0x4,
193361ae650dSJack F Vogel 	I40E_PHY_TYPE_XAUI			= 0x5,
193461ae650dSJack F Vogel 	I40E_PHY_TYPE_XFI			= 0x6,
193561ae650dSJack F Vogel 	I40E_PHY_TYPE_SFI			= 0x7,
193661ae650dSJack F Vogel 	I40E_PHY_TYPE_XLAUI			= 0x8,
193761ae650dSJack F Vogel 	I40E_PHY_TYPE_XLPPI			= 0x9,
193861ae650dSJack F Vogel 	I40E_PHY_TYPE_40GBASE_CR4_CU		= 0xA,
193961ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_CR1_CU		= 0xB,
194061ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_AOC		= 0xC,
194161ae650dSJack F Vogel 	I40E_PHY_TYPE_40GBASE_AOC		= 0xD,
1942ceebc2f3SEric Joyner 	I40E_PHY_TYPE_UNRECOGNIZED		= 0xE,
1943ceebc2f3SEric Joyner 	I40E_PHY_TYPE_UNSUPPORTED		= 0xF,
194461ae650dSJack F Vogel 	I40E_PHY_TYPE_100BASE_TX		= 0x11,
194561ae650dSJack F Vogel 	I40E_PHY_TYPE_1000BASE_T		= 0x12,
194661ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_T			= 0x13,
194761ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_SR		= 0x14,
194861ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_LR		= 0x15,
194961ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_SFPP_CU		= 0x16,
195061ae650dSJack F Vogel 	I40E_PHY_TYPE_10GBASE_CR1		= 0x17,
195161ae650dSJack F Vogel 	I40E_PHY_TYPE_40GBASE_CR4		= 0x18,
195261ae650dSJack F Vogel 	I40E_PHY_TYPE_40GBASE_SR4		= 0x19,
195361ae650dSJack F Vogel 	I40E_PHY_TYPE_40GBASE_LR4		= 0x1A,
195461ae650dSJack F Vogel 	I40E_PHY_TYPE_1000BASE_SX		= 0x1B,
195561ae650dSJack F Vogel 	I40E_PHY_TYPE_1000BASE_LX		= 0x1C,
195661ae650dSJack F Vogel 	I40E_PHY_TYPE_1000BASE_T_OPTICAL	= 0x1D,
195761ae650dSJack F Vogel 	I40E_PHY_TYPE_20GBASE_KR2		= 0x1E,
19584294f337SSean Bruno 	I40E_PHY_TYPE_25GBASE_KR		= 0x1F,
19594294f337SSean Bruno 	I40E_PHY_TYPE_25GBASE_CR		= 0x20,
19604294f337SSean Bruno 	I40E_PHY_TYPE_25GBASE_SR		= 0x21,
19614294f337SSean Bruno 	I40E_PHY_TYPE_25GBASE_LR		= 0x22,
1962ceebc2f3SEric Joyner 	I40E_PHY_TYPE_25GBASE_AOC		= 0x23,
1963ceebc2f3SEric Joyner 	I40E_PHY_TYPE_25GBASE_ACC		= 0x24,
1964abf77452SKrzysztof Galazka 	I40E_PHY_TYPE_2_5GBASE_T		= 0x26,
1965abf77452SKrzysztof Galazka 	I40E_PHY_TYPE_5GBASE_T			= 0x27,
1966abf77452SKrzysztof Galazka 	I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS	= 0x30,
1967abf77452SKrzysztof Galazka 	I40E_PHY_TYPE_5GBASE_T_LINK_STATUS	= 0x31,
1968ceebc2f3SEric Joyner 	I40E_PHY_TYPE_MAX,
1969ceebc2f3SEric Joyner 	I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP	= 0xFD,
1970ceebc2f3SEric Joyner 	I40E_PHY_TYPE_EMPTY			= 0xFE,
1971ceebc2f3SEric Joyner 	I40E_PHY_TYPE_DEFAULT			= 0xFF,
197261ae650dSJack F Vogel };
197361ae650dSJack F Vogel 
1974ceebc2f3SEric Joyner #define I40E_PHY_TYPES_BITMASK (BIT_ULL(I40E_PHY_TYPE_SGMII) | \
1975ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_1000BASE_KX) | \
1976ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_10GBASE_KX4) | \
1977ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_10GBASE_KR) | \
1978ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_40GBASE_KR4) | \
1979ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_XAUI) | \
1980ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_XFI) | \
1981ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_SFI) | \
1982ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_XLAUI) | \
1983ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_XLPPI) | \
1984ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_40GBASE_CR4_CU) | \
1985ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1_CU) | \
1986ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_10GBASE_AOC) | \
1987ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_40GBASE_AOC) | \
1988ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_UNRECOGNIZED) | \
1989ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_UNSUPPORTED) | \
1990ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_100BASE_TX) | \
1991ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_1000BASE_T) | \
1992ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_10GBASE_T) | \
1993ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_10GBASE_SR) | \
1994ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_10GBASE_LR) | \
1995ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_10GBASE_SFPP_CU) | \
1996ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1) | \
1997ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_40GBASE_CR4) | \
1998ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_40GBASE_SR4) | \
1999ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_40GBASE_LR4) | \
2000ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_1000BASE_SX) | \
2001ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_1000BASE_LX) | \
2002ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_1000BASE_T_OPTICAL) | \
2003ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_20GBASE_KR2) | \
2004ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_25GBASE_KR) | \
2005ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_25GBASE_CR) | \
2006ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_25GBASE_SR) | \
2007ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_25GBASE_LR) | \
2008ceebc2f3SEric Joyner 				BIT_ULL(I40E_PHY_TYPE_25GBASE_AOC) | \
20092984a8ddSEric Joyner 				BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC) | \
20102984a8ddSEric Joyner 				BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T) | \
20112984a8ddSEric Joyner 				BIT_ULL(I40E_PHY_TYPE_5GBASE_T))
2012ceebc2f3SEric Joyner 
20132984a8ddSEric Joyner #define I40E_LINK_SPEED_2_5GB_SHIFT	0x0
201461ae650dSJack F Vogel #define I40E_LINK_SPEED_100MB_SHIFT	0x1
201561ae650dSJack F Vogel #define I40E_LINK_SPEED_1000MB_SHIFT	0x2
201661ae650dSJack F Vogel #define I40E_LINK_SPEED_10GB_SHIFT	0x3
201761ae650dSJack F Vogel #define I40E_LINK_SPEED_40GB_SHIFT	0x4
201861ae650dSJack F Vogel #define I40E_LINK_SPEED_20GB_SHIFT	0x5
20194294f337SSean Bruno #define I40E_LINK_SPEED_25GB_SHIFT	0x6
20202984a8ddSEric Joyner #define I40E_LINK_SPEED_5GB_SHIFT	0x7
202161ae650dSJack F Vogel 
202261ae650dSJack F Vogel enum i40e_aq_link_speed {
202361ae650dSJack F Vogel 	I40E_LINK_SPEED_UNKNOWN	= 0,
202461ae650dSJack F Vogel 	I40E_LINK_SPEED_100MB	= (1 << I40E_LINK_SPEED_100MB_SHIFT),
202561ae650dSJack F Vogel 	I40E_LINK_SPEED_1GB	= (1 << I40E_LINK_SPEED_1000MB_SHIFT),
20262984a8ddSEric Joyner 	I40E_LINK_SPEED_2_5GB	= (1 << I40E_LINK_SPEED_2_5GB_SHIFT),
20272984a8ddSEric Joyner 	I40E_LINK_SPEED_5GB	= (1 << I40E_LINK_SPEED_5GB_SHIFT),
202861ae650dSJack F Vogel 	I40E_LINK_SPEED_10GB	= (1 << I40E_LINK_SPEED_10GB_SHIFT),
202961ae650dSJack F Vogel 	I40E_LINK_SPEED_40GB	= (1 << I40E_LINK_SPEED_40GB_SHIFT),
20304294f337SSean Bruno 	I40E_LINK_SPEED_20GB	= (1 << I40E_LINK_SPEED_20GB_SHIFT),
20314294f337SSean Bruno 	I40E_LINK_SPEED_25GB	= (1 << I40E_LINK_SPEED_25GB_SHIFT),
203261ae650dSJack F Vogel };
203361ae650dSJack F Vogel 
203461ae650dSJack F Vogel struct i40e_aqc_module_desc {
203561ae650dSJack F Vogel 	u8 oui[3];
203661ae650dSJack F Vogel 	u8 reserved1;
203761ae650dSJack F Vogel 	u8 part_number[16];
203861ae650dSJack F Vogel 	u8 revision[4];
203961ae650dSJack F Vogel 	u8 reserved2[8];
204061ae650dSJack F Vogel };
204161ae650dSJack F Vogel 
2042f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_module_desc);
2043f247dc25SJack F Vogel 
204461ae650dSJack F Vogel struct i40e_aq_get_phy_abilities_resp {
204561ae650dSJack F Vogel 	__le32	phy_type;       /* bitmap using the above enum for offsets */
204661ae650dSJack F Vogel 	u8	link_speed;     /* bitmap using the above enum bit patterns */
204761ae650dSJack F Vogel 	u8	abilities;
204861ae650dSJack F Vogel #define I40E_AQ_PHY_FLAG_PAUSE_TX	0x01
204961ae650dSJack F Vogel #define I40E_AQ_PHY_FLAG_PAUSE_RX	0x02
205061ae650dSJack F Vogel #define I40E_AQ_PHY_FLAG_LOW_POWER	0x04
205161ae650dSJack F Vogel #define I40E_AQ_PHY_LINK_ENABLED	0x08
205261ae650dSJack F Vogel #define I40E_AQ_PHY_AN_ENABLED		0x10
205361ae650dSJack F Vogel #define I40E_AQ_PHY_FLAG_MODULE_QUAL	0x20
2054cb6b8299SEric Joyner #define I40E_AQ_PHY_FEC_ABILITY_KR	0x40
2055cb6b8299SEric Joyner #define I40E_AQ_PHY_FEC_ABILITY_RS	0x80
205661ae650dSJack F Vogel 	__le16	eee_capability;
2057b4a7ce06SEric Joyner #define I40E_AQ_EEE_AUTO		0x0001
205861ae650dSJack F Vogel #define I40E_AQ_EEE_100BASE_TX		0x0002
205961ae650dSJack F Vogel #define I40E_AQ_EEE_1000BASE_T		0x0004
206061ae650dSJack F Vogel #define I40E_AQ_EEE_10GBASE_T		0x0008
206161ae650dSJack F Vogel #define I40E_AQ_EEE_1000BASE_KX		0x0010
206261ae650dSJack F Vogel #define I40E_AQ_EEE_10GBASE_KX4		0x0020
206361ae650dSJack F Vogel #define I40E_AQ_EEE_10GBASE_KR		0x0040
20642984a8ddSEric Joyner #define I40E_AQ_EEE_2_5GBASE_T		0x0100
20652984a8ddSEric Joyner #define I40E_AQ_EEE_5GBASE_T		0x0200
206661ae650dSJack F Vogel 	__le32	eeer_val;
206761ae650dSJack F Vogel 	u8	d3_lpan;
206861ae650dSJack F Vogel #define I40E_AQ_SET_PHY_D3_LPAN_ENA	0x01
20694294f337SSean Bruno 	u8	phy_type_ext;
2070cb6b8299SEric Joyner #define I40E_AQ_PHY_TYPE_EXT_25G_KR	0x01
2071cb6b8299SEric Joyner #define I40E_AQ_PHY_TYPE_EXT_25G_CR	0x02
20724294f337SSean Bruno #define I40E_AQ_PHY_TYPE_EXT_25G_SR	0x04
20734294f337SSean Bruno #define I40E_AQ_PHY_TYPE_EXT_25G_LR	0x08
2074ceebc2f3SEric Joyner #define I40E_AQ_PHY_TYPE_EXT_25G_AOC	0x10
2075ceebc2f3SEric Joyner #define I40E_AQ_PHY_TYPE_EXT_25G_ACC	0x20
20762984a8ddSEric Joyner #define I40E_AQ_PHY_TYPE_EXT_2_5GBASE_T	0x40
20772984a8ddSEric Joyner #define I40E_AQ_PHY_TYPE_EXT_5GBASE_T	0x80
2078cb6b8299SEric Joyner 	u8	fec_cfg_curr_mod_ext_info;
2079cb6b8299SEric Joyner #define I40E_AQ_ENABLE_FEC_KR		0x01
2080cb6b8299SEric Joyner #define I40E_AQ_ENABLE_FEC_RS		0x02
2081cb6b8299SEric Joyner #define I40E_AQ_REQUEST_FEC_KR		0x04
2082cb6b8299SEric Joyner #define I40E_AQ_REQUEST_FEC_RS		0x08
2083cb6b8299SEric Joyner #define I40E_AQ_ENABLE_FEC_AUTO		0x10
2084cb6b8299SEric Joyner #define I40E_AQ_FEC
2085cb6b8299SEric Joyner #define I40E_AQ_MODULE_TYPE_EXT_MASK	0xE0
2086cb6b8299SEric Joyner #define I40E_AQ_MODULE_TYPE_EXT_SHIFT	5
2087cb6b8299SEric Joyner 
20884294f337SSean Bruno 	u8	ext_comp_code;
208961ae650dSJack F Vogel 	u8	phy_id[4];
209061ae650dSJack F Vogel 	u8	module_type[3];
209161ae650dSJack F Vogel 	u8	qualified_module_count;
209261ae650dSJack F Vogel #define I40E_AQ_PHY_MAX_QMS		16
209361ae650dSJack F Vogel 	struct i40e_aqc_module_desc	qualified_module[I40E_AQ_PHY_MAX_QMS];
209461ae650dSJack F Vogel };
209561ae650dSJack F Vogel 
2096f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x218, i40e_aq_get_phy_abilities_resp);
2097f247dc25SJack F Vogel 
209861ae650dSJack F Vogel /* Set PHY Config (direct 0x0601) */
209961ae650dSJack F Vogel struct i40e_aq_set_phy_config { /* same bits as above in all */
210061ae650dSJack F Vogel 	__le32	phy_type;
210161ae650dSJack F Vogel 	u8	link_speed;
210261ae650dSJack F Vogel 	u8	abilities;
210361ae650dSJack F Vogel /* bits 0-2 use the values from get_phy_abilities_resp */
210461ae650dSJack F Vogel #define I40E_AQ_PHY_ENABLE_LINK		0x08
210561ae650dSJack F Vogel #define I40E_AQ_PHY_ENABLE_AN		0x10
210661ae650dSJack F Vogel #define I40E_AQ_PHY_ENABLE_ATOMIC_LINK	0x20
210761ae650dSJack F Vogel 	__le16	eee_capability;
210861ae650dSJack F Vogel 	__le32	eeer;
210961ae650dSJack F Vogel 	u8	low_power_ctrl;
21104294f337SSean Bruno 	u8	phy_type_ext;
2111cb6b8299SEric Joyner 	u8	fec_config;
2112cb6b8299SEric Joyner #define I40E_AQ_SET_FEC_ABILITY_KR	BIT(0)
2113cb6b8299SEric Joyner #define I40E_AQ_SET_FEC_ABILITY_RS	BIT(1)
2114cb6b8299SEric Joyner #define I40E_AQ_SET_FEC_REQUEST_KR	BIT(2)
2115cb6b8299SEric Joyner #define I40E_AQ_SET_FEC_REQUEST_RS	BIT(3)
2116cb6b8299SEric Joyner #define I40E_AQ_SET_FEC_AUTO		BIT(4)
2117cb6b8299SEric Joyner #define I40E_AQ_PHY_FEC_CONFIG_SHIFT	0x0
2118cb6b8299SEric Joyner #define I40E_AQ_PHY_FEC_CONFIG_MASK	(0x1F << I40E_AQ_PHY_FEC_CONFIG_SHIFT)
2119cb6b8299SEric Joyner 	u8	reserved;
212061ae650dSJack F Vogel };
212161ae650dSJack F Vogel 
212261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config);
212361ae650dSJack F Vogel 
212461ae650dSJack F Vogel /* Set MAC Config command data structure (direct 0x0603) */
212561ae650dSJack F Vogel struct i40e_aq_set_mac_config {
212661ae650dSJack F Vogel 	__le16	max_frame_size;
212761ae650dSJack F Vogel 	u8	params;
212861ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_CRC_EN			0x04
212961ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_MASK		0x78
213061ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_SHIFT		3
213161ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_NONE		0x0
213261ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_1B_13TX		0xF
213361ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_9TX		0x9
213461ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_4TX		0x8
213561ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_7TX		0x7
213661ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_2DW_3TX		0x6
213761ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_1TX		0x5
213861ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_2TX		0x4
213961ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_7DW_3TX		0x3
214061ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_4DW_1TX		0x2
214161ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_9DW_1TX		0x1
2142b4a7ce06SEric Joyner #define I40E_AQ_SET_MAC_CONFIG_DROP_BLOCKING_PACKET_EN	0x80
214361ae650dSJack F Vogel 	u8	tx_timer_priority; /* bitmap */
214461ae650dSJack F Vogel 	__le16	tx_timer_value;
214561ae650dSJack F Vogel 	__le16	fc_refresh_threshold;
214661ae650dSJack F Vogel 	u8	reserved[8];
214761ae650dSJack F Vogel };
214861ae650dSJack F Vogel 
214961ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aq_set_mac_config);
215061ae650dSJack F Vogel 
215161ae650dSJack F Vogel /* Restart Auto-Negotiation (direct 0x605) */
215261ae650dSJack F Vogel struct i40e_aqc_set_link_restart_an {
215361ae650dSJack F Vogel 	u8	command;
215461ae650dSJack F Vogel #define I40E_AQ_PHY_RESTART_AN	0x02
215561ae650dSJack F Vogel #define I40E_AQ_PHY_LINK_ENABLE	0x04
215661ae650dSJack F Vogel 	u8	reserved[15];
215761ae650dSJack F Vogel };
215861ae650dSJack F Vogel 
215961ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_link_restart_an);
216061ae650dSJack F Vogel 
216161ae650dSJack F Vogel /* Get Link Status cmd & response data structure (direct 0x0607) */
216261ae650dSJack F Vogel struct i40e_aqc_get_link_status {
216361ae650dSJack F Vogel 	__le16	command_flags; /* only field set on command */
216461ae650dSJack F Vogel #define I40E_AQ_LSE_MASK		0x3
216561ae650dSJack F Vogel #define I40E_AQ_LSE_NOP			0x0
216661ae650dSJack F Vogel #define I40E_AQ_LSE_DISABLE		0x2
216761ae650dSJack F Vogel #define I40E_AQ_LSE_ENABLE		0x3
216861ae650dSJack F Vogel /* only response uses this flag */
216961ae650dSJack F Vogel #define I40E_AQ_LSE_IS_ENABLED		0x1
217061ae650dSJack F Vogel 	u8	phy_type;    /* i40e_aq_phy_type   */
217161ae650dSJack F Vogel 	u8	link_speed;  /* i40e_aq_link_speed */
217261ae650dSJack F Vogel 	u8	link_info;
2173be771cdaSJack F Vogel #define I40E_AQ_LINK_UP			0x01    /* obsolete */
2174be771cdaSJack F Vogel #define I40E_AQ_LINK_UP_FUNCTION	0x01
217561ae650dSJack F Vogel #define I40E_AQ_LINK_FAULT		0x02
217661ae650dSJack F Vogel #define I40E_AQ_LINK_FAULT_TX		0x04
217761ae650dSJack F Vogel #define I40E_AQ_LINK_FAULT_RX		0x08
217861ae650dSJack F Vogel #define I40E_AQ_LINK_FAULT_REMOTE	0x10
2179be771cdaSJack F Vogel #define I40E_AQ_LINK_UP_PORT		0x20
218061ae650dSJack F Vogel #define I40E_AQ_MEDIA_AVAILABLE		0x40
218161ae650dSJack F Vogel #define I40E_AQ_SIGNAL_DETECT		0x80
218261ae650dSJack F Vogel 	u8	an_info;
218361ae650dSJack F Vogel #define I40E_AQ_AN_COMPLETED		0x01
218461ae650dSJack F Vogel #define I40E_AQ_LP_AN_ABILITY		0x02
218561ae650dSJack F Vogel #define I40E_AQ_PD_FAULT		0x04
218661ae650dSJack F Vogel #define I40E_AQ_FEC_EN			0x08
218761ae650dSJack F Vogel #define I40E_AQ_PHY_LOW_POWER		0x10
218861ae650dSJack F Vogel #define I40E_AQ_LINK_PAUSE_TX		0x20
218961ae650dSJack F Vogel #define I40E_AQ_LINK_PAUSE_RX		0x40
219061ae650dSJack F Vogel #define I40E_AQ_QUALIFIED_MODULE	0x80
219161ae650dSJack F Vogel 	u8	ext_info;
219261ae650dSJack F Vogel #define I40E_AQ_LINK_PHY_TEMP_ALARM	0x01
219361ae650dSJack F Vogel #define I40E_AQ_LINK_XCESSIVE_ERRORS	0x02
219461ae650dSJack F Vogel #define I40E_AQ_LINK_TX_SHIFT		0x02
219561ae650dSJack F Vogel #define I40E_AQ_LINK_TX_MASK		(0x03 << I40E_AQ_LINK_TX_SHIFT)
219661ae650dSJack F Vogel #define I40E_AQ_LINK_TX_ACTIVE		0x00
219761ae650dSJack F Vogel #define I40E_AQ_LINK_TX_DRAINED		0x01
219861ae650dSJack F Vogel #define I40E_AQ_LINK_TX_FLUSHED		0x03
219961ae650dSJack F Vogel #define I40E_AQ_LINK_FORCED_40G		0x10
22004294f337SSean Bruno /* 25G Error Codes */
22014294f337SSean Bruno #define I40E_AQ_25G_NO_ERR		0X00
22024294f337SSean Bruno #define I40E_AQ_25G_NOT_PRESENT		0X01
22034294f337SSean Bruno #define I40E_AQ_25G_NVM_CRC_ERR		0X02
22044294f337SSean Bruno #define I40E_AQ_25G_SBUS_UCODE_ERR	0X03
22054294f337SSean Bruno #define I40E_AQ_25G_SERDES_UCODE_ERR	0X04
22064294f337SSean Bruno #define I40E_AQ_25G_NIMB_UCODE_ERR	0X05
220761ae650dSJack F Vogel 	u8	loopback; /* use defines from i40e_aqc_set_lb_mode */
2208ceebc2f3SEric Joyner /* Since firmware API 1.7 loopback field keeps power class info as well */
2209ceebc2f3SEric Joyner #define I40E_AQ_LOOPBACK_MASK		0x07
2210ceebc2f3SEric Joyner #define I40E_AQ_PWR_CLASS_SHIFT_LB	6
2211ceebc2f3SEric Joyner #define I40E_AQ_PWR_CLASS_MASK_LB	(0x03 << I40E_AQ_PWR_CLASS_SHIFT_LB)
221261ae650dSJack F Vogel 	__le16	max_frame_size;
221361ae650dSJack F Vogel 	u8	config;
2214cb6b8299SEric Joyner #define I40E_AQ_CONFIG_FEC_KR_ENA	0x01
2215cb6b8299SEric Joyner #define I40E_AQ_CONFIG_FEC_RS_ENA	0x02
221661ae650dSJack F Vogel #define I40E_AQ_CONFIG_CRC_ENA		0x04
221761ae650dSJack F Vogel #define I40E_AQ_CONFIG_PACING_MASK	0x78
2218ceebc2f3SEric Joyner 	union {
2219ceebc2f3SEric Joyner 		struct {
22204294f337SSean Bruno 			u8	power_desc;
2221fdb6f38aSEric Joyner #define I40E_AQ_LINK_POWER_CLASS_1	0x00
2222fdb6f38aSEric Joyner #define I40E_AQ_LINK_POWER_CLASS_2	0x01
2223fdb6f38aSEric Joyner #define I40E_AQ_LINK_POWER_CLASS_3	0x02
2224fdb6f38aSEric Joyner #define I40E_AQ_LINK_POWER_CLASS_4	0x03
22254294f337SSean Bruno #define I40E_AQ_PWR_CLASS_MASK		0x03
2226fdb6f38aSEric Joyner 			u8	reserved[4];
222761ae650dSJack F Vogel 		};
2228ceebc2f3SEric Joyner 		struct {
2229ceebc2f3SEric Joyner 			u8	link_type[4];
2230ceebc2f3SEric Joyner 			u8	link_type_ext;
2231ceebc2f3SEric Joyner 		};
2232ceebc2f3SEric Joyner 	};
2233ceebc2f3SEric Joyner };
223461ae650dSJack F Vogel 
223561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_link_status);
223661ae650dSJack F Vogel 
223761ae650dSJack F Vogel /* Set event mask command (direct 0x613) */
223861ae650dSJack F Vogel struct i40e_aqc_set_phy_int_mask {
223961ae650dSJack F Vogel 	u8	reserved[8];
224061ae650dSJack F Vogel 	__le16	event_mask;
224161ae650dSJack F Vogel #define I40E_AQ_EVENT_LINK_UPDOWN	0x0002
224261ae650dSJack F Vogel #define I40E_AQ_EVENT_MEDIA_NA		0x0004
224361ae650dSJack F Vogel #define I40E_AQ_EVENT_LINK_FAULT	0x0008
224461ae650dSJack F Vogel #define I40E_AQ_EVENT_PHY_TEMP_ALARM	0x0010
224561ae650dSJack F Vogel #define I40E_AQ_EVENT_EXCESSIVE_ERRORS	0x0020
224661ae650dSJack F Vogel #define I40E_AQ_EVENT_SIGNAL_DETECT	0x0040
224761ae650dSJack F Vogel #define I40E_AQ_EVENT_AN_COMPLETED	0x0080
224861ae650dSJack F Vogel #define I40E_AQ_EVENT_MODULE_QUAL_FAIL	0x0100
224961ae650dSJack F Vogel #define I40E_AQ_EVENT_PORT_TX_SUSPENDED	0x0200
225061ae650dSJack F Vogel 	u8	reserved1[6];
225161ae650dSJack F Vogel };
225261ae650dSJack F Vogel 
225361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_phy_int_mask);
225461ae650dSJack F Vogel 
225561ae650dSJack F Vogel /* Get Local AN advt register (direct 0x0614)
225661ae650dSJack F Vogel  * Set Local AN advt register (direct 0x0615)
225761ae650dSJack F Vogel  * Get Link Partner AN advt register (direct 0x0616)
225861ae650dSJack F Vogel  */
225961ae650dSJack F Vogel struct i40e_aqc_an_advt_reg {
226061ae650dSJack F Vogel 	__le32	local_an_reg0;
226161ae650dSJack F Vogel 	__le16	local_an_reg1;
226261ae650dSJack F Vogel 	u8	reserved[10];
226361ae650dSJack F Vogel };
226461ae650dSJack F Vogel 
226561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_an_advt_reg);
226661ae650dSJack F Vogel 
226761ae650dSJack F Vogel /* Set Loopback mode (0x0618) */
226861ae650dSJack F Vogel struct i40e_aqc_set_lb_mode {
2269ceebc2f3SEric Joyner 	u8	lb_level;
2270ceebc2f3SEric Joyner #define I40E_AQ_LB_NONE	0
2271ceebc2f3SEric Joyner #define I40E_AQ_LB_MAC	1
2272ceebc2f3SEric Joyner #define I40E_AQ_LB_SERDES	2
2273ceebc2f3SEric Joyner #define I40E_AQ_LB_PHY_INT	3
2274ceebc2f3SEric Joyner #define I40E_AQ_LB_PHY_EXT	4
2275b4a7ce06SEric Joyner #define I40E_AQ_LB_BASE_T_PCS	5
2276b4a7ce06SEric Joyner #define I40E_AQ_LB_BASE_T_EXT	6
227761ae650dSJack F Vogel #define I40E_AQ_LB_PHY_LOCAL	0x01
227861ae650dSJack F Vogel #define I40E_AQ_LB_PHY_REMOTE	0x02
227961ae650dSJack F Vogel #define I40E_AQ_LB_MAC_LOCAL	0x04
2280ceebc2f3SEric Joyner 	u8	lb_type;
2281ceebc2f3SEric Joyner #define I40E_AQ_LB_LOCAL	0
2282ceebc2f3SEric Joyner #define I40E_AQ_LB_FAR	0x01
2283ceebc2f3SEric Joyner 	u8	speed;
2284ceebc2f3SEric Joyner #define I40E_AQ_LB_SPEED_NONE	0
2285ceebc2f3SEric Joyner #define I40E_AQ_LB_SPEED_1G	1
2286ceebc2f3SEric Joyner #define I40E_AQ_LB_SPEED_10G	2
2287ceebc2f3SEric Joyner #define I40E_AQ_LB_SPEED_40G	3
2288ceebc2f3SEric Joyner #define I40E_AQ_LB_SPEED_20G	4
2289ceebc2f3SEric Joyner 	u8	force_speed;
2290ceebc2f3SEric Joyner 	u8	reserved[12];
229161ae650dSJack F Vogel };
229261ae650dSJack F Vogel 
229361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_lb_mode);
229461ae650dSJack F Vogel 
229561ae650dSJack F Vogel /* Set PHY Debug command (0x0622) */
229661ae650dSJack F Vogel struct i40e_aqc_set_phy_debug {
229761ae650dSJack F Vogel 	u8	command_flags;
229861ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_INTERNAL	0x02
229961ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SHIFT	2
230061ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_MASK	(0x03 << \
230161ae650dSJack F Vogel 					I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SHIFT)
230261ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_NONE	0x00
230361ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_HARD	0x01
230461ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SOFT	0x02
23054294f337SSean Bruno /* Disable link manageability on a single port */
230661ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_DISABLE_LINK_FW	0x10
23074294f337SSean Bruno /* Disable link manageability on all ports needs both bits 4 and 5 */
23084294f337SSean Bruno #define I40E_AQ_PHY_DEBUG_DISABLE_ALL_LINK_FW	0x20
230961ae650dSJack F Vogel 	u8	reserved[15];
231061ae650dSJack F Vogel };
231161ae650dSJack F Vogel 
231261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_phy_debug);
231361ae650dSJack F Vogel 
231461ae650dSJack F Vogel enum i40e_aq_phy_reg_type {
231561ae650dSJack F Vogel 	I40E_AQC_PHY_REG_INTERNAL	= 0x1,
231661ae650dSJack F Vogel 	I40E_AQC_PHY_REG_EXERNAL_BASET	= 0x2,
231761ae650dSJack F Vogel 	I40E_AQC_PHY_REG_EXERNAL_MODULE	= 0x3
231861ae650dSJack F Vogel };
231961ae650dSJack F Vogel 
23202984a8ddSEric Joyner #pragma pack(1)
2321fdb6f38aSEric Joyner /* Run PHY Activity (0x0626) */
2322fdb6f38aSEric Joyner struct i40e_aqc_run_phy_activity {
23232984a8ddSEric Joyner 	u8	cmd_flags;
2324fdb6f38aSEric Joyner 	__le16	activity_id;
23252984a8ddSEric Joyner #define I40E_AQ_RUN_PHY_ACT_ID_USR_DFND			0x10
23262984a8ddSEric Joyner 	u8	reserved;
23272984a8ddSEric Joyner 	union {
23282984a8ddSEric Joyner 		struct {
23292984a8ddSEric Joyner 			__le32  dnl_opcode;
23302984a8ddSEric Joyner #define I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT_DUR	0x801a
23312984a8ddSEric Joyner #define I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT	0x801b
23322984a8ddSEric Joyner #define I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_DUR	0x1801b
2333fdb6f38aSEric Joyner 			__le32  data;
2334fdb6f38aSEric Joyner 			u8	reserved2[4];
23352984a8ddSEric Joyner 		} cmd;
23362984a8ddSEric Joyner 		struct {
23372984a8ddSEric Joyner 			__le32	cmd_status;
23382984a8ddSEric Joyner #define I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC		0x4
23392984a8ddSEric Joyner #define I40E_AQ_RUN_PHY_ACT_CMD_STAT_MASK		0xFFFF
23402984a8ddSEric Joyner 			__le32	data0;
23412984a8ddSEric Joyner 			__le32	data1;
23422984a8ddSEric Joyner 		} resp;
23432984a8ddSEric Joyner 	} params;
2344fdb6f38aSEric Joyner };
23452984a8ddSEric Joyner #pragma pack()
2346fdb6f38aSEric Joyner 
2347fdb6f38aSEric Joyner I40E_CHECK_CMD_LENGTH(i40e_aqc_run_phy_activity);
2348fdb6f38aSEric Joyner 
2349ceebc2f3SEric Joyner /* Set PHY Register command (0x0628) */
2350ceebc2f3SEric Joyner /* Get PHY Register command (0x0629) */
2351ceebc2f3SEric Joyner struct i40e_aqc_phy_register_access {
2352ceebc2f3SEric Joyner 	u8	phy_interface;
2353ceebc2f3SEric Joyner #define I40E_AQ_PHY_REG_ACCESS_INTERNAL	0
2354ceebc2f3SEric Joyner #define I40E_AQ_PHY_REG_ACCESS_EXTERNAL	1
2355ceebc2f3SEric Joyner #define I40E_AQ_PHY_REG_ACCESS_EXTERNAL_MODULE	2
2356ceebc2f3SEric Joyner 	u8	dev_addres;
2357b4a7ce06SEric Joyner 	u8	cmd_flags;
2358b4a7ce06SEric Joyner #define I40E_AQ_PHY_REG_ACCESS_DONT_CHANGE_QSFP_PAGE	0x01
2359b4a7ce06SEric Joyner #define I40E_AQ_PHY_REG_ACCESS_SET_MDIO_IF_NUMBER	0x02
2360b4a7ce06SEric Joyner #define I40E_AQ_PHY_REG_ACCESS_MDIO_IF_NUMBER_SHIFT	2
2361b4a7ce06SEric Joyner #define I40E_AQ_PHY_REG_ACCESS_MDIO_IF_NUMBER_MASK	(0x3 << \
2362b4a7ce06SEric Joyner 		I40E_AQ_PHY_REG_ACCESS_MDIO_IF_NUMBER_SHIFT)
2363b4a7ce06SEric Joyner 	u8	reserved1;
2364ceebc2f3SEric Joyner 	__le32	reg_address;
2365ceebc2f3SEric Joyner 	__le32	reg_value;
2366ceebc2f3SEric Joyner 	u8	reserved2[4];
2367ceebc2f3SEric Joyner };
2368ceebc2f3SEric Joyner 
2369ceebc2f3SEric Joyner I40E_CHECK_CMD_LENGTH(i40e_aqc_phy_register_access);
2370ceebc2f3SEric Joyner 
237161ae650dSJack F Vogel /* NVM Read command (indirect 0x0701)
237261ae650dSJack F Vogel  * NVM Erase commands (direct 0x0702)
237361ae650dSJack F Vogel  * NVM Update commands (indirect 0x0703)
237461ae650dSJack F Vogel  */
237561ae650dSJack F Vogel struct i40e_aqc_nvm_update {
237661ae650dSJack F Vogel 	u8	command_flags;
237761ae650dSJack F Vogel #define I40E_AQ_NVM_LAST_CMD			0x01
2378b4a7ce06SEric Joyner #define I40E_AQ_NVM_REARRANGE_TO_FLAT		0x20
2379b4a7ce06SEric Joyner #define I40E_AQ_NVM_REARRANGE_TO_STRUCT		0x40
238061ae650dSJack F Vogel #define I40E_AQ_NVM_FLASH_ONLY			0x80
2381ceebc2f3SEric Joyner #define I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT	1
2382ceebc2f3SEric Joyner #define I40E_AQ_NVM_PRESERVATION_FLAGS_MASK	0x03
2383ceebc2f3SEric Joyner #define I40E_AQ_NVM_PRESERVATION_FLAGS_SELECTED	0x03
2384ceebc2f3SEric Joyner #define I40E_AQ_NVM_PRESERVATION_FLAGS_ALL	0x01
238561ae650dSJack F Vogel 	u8	module_pointer;
238661ae650dSJack F Vogel 	__le16	length;
238761ae650dSJack F Vogel 	__le32	offset;
238861ae650dSJack F Vogel 	__le32	addr_high;
238961ae650dSJack F Vogel 	__le32	addr_low;
239061ae650dSJack F Vogel };
239161ae650dSJack F Vogel 
239261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update);
239361ae650dSJack F Vogel 
239461ae650dSJack F Vogel /* NVM Config Read (indirect 0x0704) */
239561ae650dSJack F Vogel struct i40e_aqc_nvm_config_read {
239661ae650dSJack F Vogel 	__le16	cmd_flags;
2397f247dc25SJack F Vogel #define I40E_AQ_ANVM_SINGLE_OR_MULTIPLE_FEATURES_MASK	1
2398f247dc25SJack F Vogel #define I40E_AQ_ANVM_READ_SINGLE_FEATURE		0
2399f247dc25SJack F Vogel #define I40E_AQ_ANVM_READ_MULTIPLE_FEATURES		1
240061ae650dSJack F Vogel 	__le16	element_count;
240161ae650dSJack F Vogel 	__le16	element_id;	/* Feature/field ID */
2402f247dc25SJack F Vogel 	__le16	element_id_msw;	/* MSWord of field ID */
240361ae650dSJack F Vogel 	__le32	address_high;
240461ae650dSJack F Vogel 	__le32	address_low;
240561ae650dSJack F Vogel };
240661ae650dSJack F Vogel 
240761ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_read);
240861ae650dSJack F Vogel 
240961ae650dSJack F Vogel /* NVM Config Write (indirect 0x0705) */
241061ae650dSJack F Vogel struct i40e_aqc_nvm_config_write {
241161ae650dSJack F Vogel 	__le16	cmd_flags;
241261ae650dSJack F Vogel 	__le16	element_count;
241361ae650dSJack F Vogel 	u8	reserved[4];
241461ae650dSJack F Vogel 	__le32	address_high;
241561ae650dSJack F Vogel 	__le32	address_low;
241661ae650dSJack F Vogel };
241761ae650dSJack F Vogel 
241861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_write);
241961ae650dSJack F Vogel 
2420f247dc25SJack F Vogel /* Used for 0x0704 as well as for 0x0705 commands */
2421f247dc25SJack F Vogel #define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT		1
2422d4683565SEric Joyner #define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_MASK \
2423d4683565SEric Joyner 				(1 << I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT)
2424f247dc25SJack F Vogel #define I40E_AQ_ANVM_FEATURE		0
2425f247dc25SJack F Vogel #define I40E_AQ_ANVM_IMMEDIATE_FIELD	(1 << FEATURE_OR_IMMEDIATE_SHIFT)
242661ae650dSJack F Vogel struct i40e_aqc_nvm_config_data_feature {
242761ae650dSJack F Vogel 	__le16 feature_id;
2428f247dc25SJack F Vogel #define I40E_AQ_ANVM_FEATURE_OPTION_OEM_ONLY		0x01
2429f247dc25SJack F Vogel #define I40E_AQ_ANVM_FEATURE_OPTION_DWORD_MAP		0x08
2430f247dc25SJack F Vogel #define I40E_AQ_ANVM_FEATURE_OPTION_POR_CSR		0x10
243161ae650dSJack F Vogel 	__le16 feature_options;
243261ae650dSJack F Vogel 	__le16 feature_selection;
243361ae650dSJack F Vogel };
243461ae650dSJack F Vogel 
2435f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature);
2436f247dc25SJack F Vogel 
2437abf77452SKrzysztof Galazka /* NVM Update in Process (direct 0x0706) */
2438abf77452SKrzysztof Galazka struct i40e_aqc_nvm_update_in_process {
2439abf77452SKrzysztof Galazka 	u8	command;
2440abf77452SKrzysztof Galazka #define I40E_AQ_UPDATE_FLOW_END			0x0
2441abf77452SKrzysztof Galazka #define I40E_AQ_UPDATE_FLOW_START		0x1
2442abf77452SKrzysztof Galazka 	u8	reserved[15];
2443abf77452SKrzysztof Galazka };
2444abf77452SKrzysztof Galazka 
2445abf77452SKrzysztof Galazka I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update_in_process);
2446abf77452SKrzysztof Galazka 
244761ae650dSJack F Vogel struct i40e_aqc_nvm_config_data_immediate_field {
2448f247dc25SJack F Vogel 	__le32 field_id;
2449f247dc25SJack F Vogel 	__le32 field_value;
245061ae650dSJack F Vogel 	__le16 field_options;
2451f247dc25SJack F Vogel 	__le16 reserved;
245261ae650dSJack F Vogel };
245361ae650dSJack F Vogel 
2454f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field);
2455f247dc25SJack F Vogel 
2456abf77452SKrzysztof Galazka /* Minimal Rollback Revision Update (direct 0x0707) */
2457abf77452SKrzysztof Galazka struct i40e_aqc_rollback_revision_update {
2458abf77452SKrzysztof Galazka 	u8	optin_mode; /* bool */
2459abf77452SKrzysztof Galazka #define I40E_AQ_RREV_OPTIN_MODE			0x01
2460abf77452SKrzysztof Galazka 	u8	module_selected;
2461abf77452SKrzysztof Galazka #define I40E_AQ_RREV_MODULE_PCIE_ANALOG			0
2462abf77452SKrzysztof Galazka #define I40E_AQ_RREV_MODULE_PHY_ANALOG			1
2463abf77452SKrzysztof Galazka #define I40E_AQ_RREV_MODULE_OPTION_ROM			2
2464abf77452SKrzysztof Galazka #define I40E_AQ_RREV_MODULE_EMP_IMAGE			3
2465abf77452SKrzysztof Galazka #define I40E_AQ_RREV_MODULE_PE_IMAGE			4
2466abf77452SKrzysztof Galazka #define I40E_AQ_RREV_MODULE_PHY_PLL_O_CONFIGURATION	5
2467abf77452SKrzysztof Galazka #define I40E_AQ_RREV_MODULE_PHY_0_CONFIGURATION		6
2468abf77452SKrzysztof Galazka #define I40E_AQ_RREV_MODULE_PHY_PLL_1_CONFIGURATION	7
2469abf77452SKrzysztof Galazka #define I40E_AQ_RREV_MODULE_PHY_1_CONFIGURATION		8
2470abf77452SKrzysztof Galazka 	u8	reserved1[2];
2471abf77452SKrzysztof Galazka 	u32	min_rrev;
2472abf77452SKrzysztof Galazka 	u8	reserved2[8];
2473abf77452SKrzysztof Galazka };
2474abf77452SKrzysztof Galazka 
2475abf77452SKrzysztof Galazka I40E_CHECK_CMD_LENGTH(i40e_aqc_rollback_revision_update);
2476abf77452SKrzysztof Galazka 
2477be771cdaSJack F Vogel /* OEM Post Update (indirect 0x0720)
2478be771cdaSJack F Vogel  * no command data struct used
2479be771cdaSJack F Vogel  */
2480be771cdaSJack F Vogel struct i40e_aqc_nvm_oem_post_update {
2481be771cdaSJack F Vogel #define I40E_AQ_NVM_OEM_POST_UPDATE_EXTERNAL_DATA	0x01
2482be771cdaSJack F Vogel 	u8 sel_data;
2483be771cdaSJack F Vogel 	u8 reserved[7];
2484be771cdaSJack F Vogel };
2485be771cdaSJack F Vogel 
2486be771cdaSJack F Vogel I40E_CHECK_STRUCT_LEN(0x8, i40e_aqc_nvm_oem_post_update);
2487be771cdaSJack F Vogel 
2488be771cdaSJack F Vogel struct i40e_aqc_nvm_oem_post_update_buffer {
2489be771cdaSJack F Vogel 	u8 str_len;
2490be771cdaSJack F Vogel 	u8 dev_addr;
2491be771cdaSJack F Vogel 	__le16 eeprom_addr;
2492be771cdaSJack F Vogel 	u8 data[36];
2493be771cdaSJack F Vogel };
2494be771cdaSJack F Vogel 
2495be771cdaSJack F Vogel I40E_CHECK_STRUCT_LEN(0x28, i40e_aqc_nvm_oem_post_update_buffer);
2496be771cdaSJack F Vogel 
2497fdb6f38aSEric Joyner /* Thermal Sensor (indirect 0x0721)
2498fdb6f38aSEric Joyner  *     read or set thermal sensor configs and values
2499fdb6f38aSEric Joyner  *     takes a sensor and command specific data buffer, not detailed here
2500fdb6f38aSEric Joyner  */
2501fdb6f38aSEric Joyner struct i40e_aqc_thermal_sensor {
2502fdb6f38aSEric Joyner 	u8 sensor_action;
2503fdb6f38aSEric Joyner #define I40E_AQ_THERMAL_SENSOR_READ_CONFIG	0
2504fdb6f38aSEric Joyner #define I40E_AQ_THERMAL_SENSOR_SET_CONFIG	1
2505fdb6f38aSEric Joyner #define I40E_AQ_THERMAL_SENSOR_READ_TEMP	2
2506fdb6f38aSEric Joyner 	u8 reserved[7];
2507fdb6f38aSEric Joyner 	__le32	addr_high;
2508fdb6f38aSEric Joyner 	__le32	addr_low;
2509fdb6f38aSEric Joyner };
2510fdb6f38aSEric Joyner 
2511fdb6f38aSEric Joyner I40E_CHECK_CMD_LENGTH(i40e_aqc_thermal_sensor);
2512fdb6f38aSEric Joyner 
251361ae650dSJack F Vogel /* Send to PF command (indirect 0x0801) id is only used by PF
251461ae650dSJack F Vogel  * Send to VF command (indirect 0x0802) id is only used by PF
251561ae650dSJack F Vogel  * Send to Peer PF command (indirect 0x0803)
251661ae650dSJack F Vogel  */
251761ae650dSJack F Vogel struct i40e_aqc_pf_vf_message {
251861ae650dSJack F Vogel 	__le32	id;
251961ae650dSJack F Vogel 	u8	reserved[4];
252061ae650dSJack F Vogel 	__le32	addr_high;
252161ae650dSJack F Vogel 	__le32	addr_low;
252261ae650dSJack F Vogel };
252361ae650dSJack F Vogel 
252461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_pf_vf_message);
252561ae650dSJack F Vogel 
252661ae650dSJack F Vogel /* Alternate structure */
252761ae650dSJack F Vogel 
252861ae650dSJack F Vogel /* Direct write (direct 0x0900)
252961ae650dSJack F Vogel  * Direct read (direct 0x0902)
253061ae650dSJack F Vogel  */
253161ae650dSJack F Vogel struct i40e_aqc_alternate_write {
253261ae650dSJack F Vogel 	__le32 address0;
253361ae650dSJack F Vogel 	__le32 data0;
253461ae650dSJack F Vogel 	__le32 address1;
253561ae650dSJack F Vogel 	__le32 data1;
253661ae650dSJack F Vogel };
253761ae650dSJack F Vogel 
253861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_write);
253961ae650dSJack F Vogel 
254061ae650dSJack F Vogel /* Indirect write (indirect 0x0901)
254161ae650dSJack F Vogel  * Indirect read (indirect 0x0903)
254261ae650dSJack F Vogel  */
254361ae650dSJack F Vogel 
254461ae650dSJack F Vogel struct i40e_aqc_alternate_ind_write {
254561ae650dSJack F Vogel 	__le32 address;
254661ae650dSJack F Vogel 	__le32 length;
254761ae650dSJack F Vogel 	__le32 addr_high;
254861ae650dSJack F Vogel 	__le32 addr_low;
254961ae650dSJack F Vogel };
255061ae650dSJack F Vogel 
255161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_ind_write);
255261ae650dSJack F Vogel 
255361ae650dSJack F Vogel /* Done alternate write (direct 0x0904)
255461ae650dSJack F Vogel  * uses i40e_aq_desc
255561ae650dSJack F Vogel  */
255661ae650dSJack F Vogel struct i40e_aqc_alternate_write_done {
255761ae650dSJack F Vogel 	__le16	cmd_flags;
255861ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_BIOS_MASK	1
255961ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_BIOS_LEGACY	0
256061ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_BIOS_UEFI	1
256161ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_RESET_NEEDED		2
256261ae650dSJack F Vogel 	u8	reserved[14];
256361ae650dSJack F Vogel };
256461ae650dSJack F Vogel 
256561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_write_done);
256661ae650dSJack F Vogel 
256761ae650dSJack F Vogel /* Set OEM mode (direct 0x0905) */
256861ae650dSJack F Vogel struct i40e_aqc_alternate_set_mode {
256961ae650dSJack F Vogel 	__le32	mode;
257061ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_NONE	0
257161ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_OEM	1
257261ae650dSJack F Vogel 	u8	reserved[12];
257361ae650dSJack F Vogel };
257461ae650dSJack F Vogel 
257561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_set_mode);
257661ae650dSJack F Vogel 
257761ae650dSJack F Vogel /* Clear port Alternate RAM (direct 0x0906) uses i40e_aq_desc */
257861ae650dSJack F Vogel 
257961ae650dSJack F Vogel /* async events 0x10xx */
258061ae650dSJack F Vogel 
258161ae650dSJack F Vogel /* Lan Queue Overflow Event (direct, 0x1001) */
258261ae650dSJack F Vogel struct i40e_aqc_lan_overflow {
258361ae650dSJack F Vogel 	__le32	prtdcb_rupto;
258461ae650dSJack F Vogel 	__le32	otx_ctl;
258561ae650dSJack F Vogel 	u8	reserved[8];
258661ae650dSJack F Vogel };
258761ae650dSJack F Vogel 
258861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lan_overflow);
258961ae650dSJack F Vogel 
259061ae650dSJack F Vogel /* Get LLDP MIB (indirect 0x0A00) */
259161ae650dSJack F Vogel struct i40e_aqc_lldp_get_mib {
259261ae650dSJack F Vogel 	u8	type;
259361ae650dSJack F Vogel 	u8	reserved1;
259461ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_TYPE_MASK		0x3
259561ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_LOCAL			0x0
259661ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_REMOTE			0x1
259761ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_LOCAL_AND_REMOTE	0x2
259861ae650dSJack F Vogel #define I40E_AQ_LLDP_BRIDGE_TYPE_MASK		0xC
259961ae650dSJack F Vogel #define I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT		0x2
260061ae650dSJack F Vogel #define I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE	0x0
260161ae650dSJack F Vogel #define I40E_AQ_LLDP_BRIDGE_TYPE_NON_TPMR	0x1
260261ae650dSJack F Vogel #define I40E_AQ_LLDP_TX_SHIFT			0x4
260361ae650dSJack F Vogel #define I40E_AQ_LLDP_TX_MASK			(0x03 << I40E_AQ_LLDP_TX_SHIFT)
260461ae650dSJack F Vogel /* TX pause flags use I40E_AQ_LINK_TX_* above */
260561ae650dSJack F Vogel 	__le16	local_len;
260661ae650dSJack F Vogel 	__le16	remote_len;
260761ae650dSJack F Vogel 	u8	reserved2[2];
260861ae650dSJack F Vogel 	__le32	addr_high;
260961ae650dSJack F Vogel 	__le32	addr_low;
261061ae650dSJack F Vogel };
261161ae650dSJack F Vogel 
261261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_get_mib);
261361ae650dSJack F Vogel 
261461ae650dSJack F Vogel /* Configure LLDP MIB Change Event (direct 0x0A01)
261561ae650dSJack F Vogel  * also used for the event (with type in the command field)
261661ae650dSJack F Vogel  */
261761ae650dSJack F Vogel struct i40e_aqc_lldp_update_mib {
261861ae650dSJack F Vogel 	u8	command;
261961ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_UPDATE_ENABLE	0x0
262061ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_UPDATE_DISABLE	0x1
262161ae650dSJack F Vogel 	u8	reserved[7];
262261ae650dSJack F Vogel 	__le32	addr_high;
262361ae650dSJack F Vogel 	__le32	addr_low;
262461ae650dSJack F Vogel };
262561ae650dSJack F Vogel 
262661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_mib);
262761ae650dSJack F Vogel 
262861ae650dSJack F Vogel /* Add LLDP TLV (indirect 0x0A02)
262961ae650dSJack F Vogel  * Delete LLDP TLV (indirect 0x0A04)
263061ae650dSJack F Vogel  */
263161ae650dSJack F Vogel struct i40e_aqc_lldp_add_tlv {
263261ae650dSJack F Vogel 	u8	type; /* only nearest bridge and non-TPMR from 0x0A00 */
263361ae650dSJack F Vogel 	u8	reserved1[1];
263461ae650dSJack F Vogel 	__le16	len;
263561ae650dSJack F Vogel 	u8	reserved2[4];
263661ae650dSJack F Vogel 	__le32	addr_high;
263761ae650dSJack F Vogel 	__le32	addr_low;
263861ae650dSJack F Vogel };
263961ae650dSJack F Vogel 
264061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_add_tlv);
264161ae650dSJack F Vogel 
264261ae650dSJack F Vogel /* Update LLDP TLV (indirect 0x0A03) */
264361ae650dSJack F Vogel struct i40e_aqc_lldp_update_tlv {
264461ae650dSJack F Vogel 	u8	type; /* only nearest bridge and non-TPMR from 0x0A00 */
264561ae650dSJack F Vogel 	u8	reserved;
264661ae650dSJack F Vogel 	__le16	old_len;
264761ae650dSJack F Vogel 	__le16	new_offset;
264861ae650dSJack F Vogel 	__le16	new_len;
264961ae650dSJack F Vogel 	__le32	addr_high;
265061ae650dSJack F Vogel 	__le32	addr_low;
265161ae650dSJack F Vogel };
265261ae650dSJack F Vogel 
265361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_tlv);
265461ae650dSJack F Vogel 
265561ae650dSJack F Vogel /* Stop LLDP (direct 0x0A05) */
265661ae650dSJack F Vogel struct i40e_aqc_lldp_stop {
265761ae650dSJack F Vogel 	u8	command;
265861ae650dSJack F Vogel #define I40E_AQ_LLDP_AGENT_STOP			0x0
265961ae650dSJack F Vogel #define I40E_AQ_LLDP_AGENT_SHUTDOWN		0x1
2660b4a7ce06SEric Joyner #define I40E_AQ_LLDP_AGENT_STOP_PERSIST		0x2
266161ae650dSJack F Vogel 	u8	reserved[15];
266261ae650dSJack F Vogel };
266361ae650dSJack F Vogel 
266461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop);
266561ae650dSJack F Vogel 
266661ae650dSJack F Vogel /* Start LLDP (direct 0x0A06) */
266761ae650dSJack F Vogel struct i40e_aqc_lldp_start {
266861ae650dSJack F Vogel 	u8	command;
266961ae650dSJack F Vogel #define I40E_AQ_LLDP_AGENT_START		0x1
2670b4a7ce06SEric Joyner #define I40E_AQ_LLDP_AGENT_START_PERSIST	0x2
267161ae650dSJack F Vogel 	u8	reserved[15];
267261ae650dSJack F Vogel };
267361ae650dSJack F Vogel 
267461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
267561ae650dSJack F Vogel 
2676ceebc2f3SEric Joyner /* Set DCB (direct 0x0303) */
2677ceebc2f3SEric Joyner struct i40e_aqc_set_dcb_parameters {
2678ceebc2f3SEric Joyner 	u8 command;
2679ceebc2f3SEric Joyner #define I40E_AQ_DCB_SET_AGENT	0x1
2680ceebc2f3SEric Joyner #define I40E_DCB_VALID		0x1
2681ceebc2f3SEric Joyner 	u8 valid_flags;
2682ceebc2f3SEric Joyner 	u8 reserved[14];
2683ceebc2f3SEric Joyner };
2684ceebc2f3SEric Joyner 
2685ceebc2f3SEric Joyner I40E_CHECK_CMD_LENGTH(i40e_aqc_set_dcb_parameters);
2686ceebc2f3SEric Joyner 
2687f247dc25SJack F Vogel /* Get CEE DCBX Oper Config (0x0A07)
2688f247dc25SJack F Vogel  * uses the generic descriptor struct
2689f247dc25SJack F Vogel  * returns below as indirect response
269061ae650dSJack F Vogel  */
269161ae650dSJack F Vogel 
2692f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_FCOE_SHIFT	0x0
2693f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_FCOE_MASK	(0x7 << I40E_AQC_CEE_APP_FCOE_SHIFT)
2694f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_ISCSI_SHIFT	0x3
2695f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_ISCSI_MASK	(0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT)
2696f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_FIP_SHIFT	0x8
2697f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_FIP_MASK	(0x7 << I40E_AQC_CEE_APP_FIP_SHIFT)
2698be771cdaSJack F Vogel 
2699f247dc25SJack F Vogel #define I40E_AQC_CEE_PG_STATUS_SHIFT	0x0
2700f247dc25SJack F Vogel #define I40E_AQC_CEE_PG_STATUS_MASK	(0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT)
2701f247dc25SJack F Vogel #define I40E_AQC_CEE_PFC_STATUS_SHIFT	0x3
2702f247dc25SJack F Vogel #define I40E_AQC_CEE_PFC_STATUS_MASK	(0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT)
2703f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_STATUS_SHIFT	0x8
2704f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_STATUS_MASK	(0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT)
2705be771cdaSJack F Vogel #define I40E_AQC_CEE_FCOE_STATUS_SHIFT	0x8
2706be771cdaSJack F Vogel #define I40E_AQC_CEE_FCOE_STATUS_MASK	(0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT)
2707be771cdaSJack F Vogel #define I40E_AQC_CEE_ISCSI_STATUS_SHIFT	0xB
2708be771cdaSJack F Vogel #define I40E_AQC_CEE_ISCSI_STATUS_MASK	(0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT)
2709be771cdaSJack F Vogel #define I40E_AQC_CEE_FIP_STATUS_SHIFT	0x10
2710be771cdaSJack F Vogel #define I40E_AQC_CEE_FIP_STATUS_MASK	(0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT)
2711be771cdaSJack F Vogel 
2712be771cdaSJack F Vogel /* struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with
2713be771cdaSJack F Vogel  * word boundary layout issues, which the Linux compilers silently deal
2714be771cdaSJack F Vogel  * with by adding padding, making the actual struct larger than designed.
2715be771cdaSJack F Vogel  * However, the FW compiler for the NIC is less lenient and complains
2716be771cdaSJack F Vogel  * about the struct.  Hence, the struct defined here has an extra byte in
2717be771cdaSJack F Vogel  * fields reserved3 and reserved4 to directly acknowledge that padding,
2718be771cdaSJack F Vogel  * and the new length is used in the length check macro.
2719be771cdaSJack F Vogel  */
2720f247dc25SJack F Vogel struct i40e_aqc_get_cee_dcb_cfg_v1_resp {
2721f247dc25SJack F Vogel 	u8	reserved1;
2722f247dc25SJack F Vogel 	u8	oper_num_tc;
2723f247dc25SJack F Vogel 	u8	oper_prio_tc[4];
2724f247dc25SJack F Vogel 	u8	reserved2;
2725f247dc25SJack F Vogel 	u8	oper_tc_bw[8];
2726f247dc25SJack F Vogel 	u8	oper_pfc_en;
2727be771cdaSJack F Vogel 	u8	reserved3[2];
2728f247dc25SJack F Vogel 	__le16	oper_app_prio;
2729be771cdaSJack F Vogel 	u8	reserved4[2];
2730f247dc25SJack F Vogel 	__le16	tlv_status;
2731f247dc25SJack F Vogel };
2732f247dc25SJack F Vogel 
2733f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x18, i40e_aqc_get_cee_dcb_cfg_v1_resp);
2734f247dc25SJack F Vogel 
2735f247dc25SJack F Vogel struct i40e_aqc_get_cee_dcb_cfg_resp {
2736f247dc25SJack F Vogel 	u8	oper_num_tc;
2737f247dc25SJack F Vogel 	u8	oper_prio_tc[4];
2738f247dc25SJack F Vogel 	u8	oper_tc_bw[8];
2739f247dc25SJack F Vogel 	u8	oper_pfc_en;
2740f247dc25SJack F Vogel 	__le16	oper_app_prio;
2741f247dc25SJack F Vogel 	__le32	tlv_status;
2742f247dc25SJack F Vogel 	u8	reserved[12];
2743f247dc25SJack F Vogel };
2744f247dc25SJack F Vogel 
2745f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_cee_dcb_cfg_resp);
2746f247dc25SJack F Vogel 
2747f247dc25SJack F Vogel /*	Set Local LLDP MIB (indirect 0x0A08)
2748f247dc25SJack F Vogel  *	Used to replace the local MIB of a given LLDP agent. e.g. DCBx
2749f247dc25SJack F Vogel  */
2750f247dc25SJack F Vogel struct i40e_aqc_lldp_set_local_mib {
2751f247dc25SJack F Vogel #define SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT	0
2752ac83ea83SEric Joyner #define SET_LOCAL_MIB_AC_TYPE_DCBX_MASK	(1 << \
2753ac83ea83SEric Joyner 					SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT)
2754ac83ea83SEric Joyner #define SET_LOCAL_MIB_AC_TYPE_LOCAL_MIB	0x0
2755ac83ea83SEric Joyner #define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT	(1)
2756ac83ea83SEric Joyner #define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_MASK	(1 << \
2757ac83ea83SEric Joyner 				SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT)
2758ac83ea83SEric Joyner #define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS		0x1
2759f247dc25SJack F Vogel 	u8	type;
2760f247dc25SJack F Vogel 	u8	reserved0;
2761f247dc25SJack F Vogel 	__le16	length;
2762f247dc25SJack F Vogel 	u8	reserved1[4];
2763f247dc25SJack F Vogel 	__le32	address_high;
2764f247dc25SJack F Vogel 	__le32	address_low;
2765f247dc25SJack F Vogel };
2766f247dc25SJack F Vogel 
2767f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_set_local_mib);
2768f247dc25SJack F Vogel 
2769223d846dSEric Joyner struct i40e_aqc_lldp_set_local_mib_resp {
2770223d846dSEric Joyner #define SET_LOCAL_MIB_RESP_EVENT_TRIGGERED_MASK      0x01
2771223d846dSEric Joyner 	u8  status;
2772223d846dSEric Joyner 	u8  reserved[15];
2773223d846dSEric Joyner };
2774223d846dSEric Joyner 
2775223d846dSEric Joyner I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_lldp_set_local_mib_resp);
2776223d846dSEric Joyner 
2777f247dc25SJack F Vogel /*	Stop/Start LLDP Agent (direct 0x0A09)
2778f247dc25SJack F Vogel  *	Used for stopping/starting specific LLDP agent. e.g. DCBx
2779f247dc25SJack F Vogel  */
2780f247dc25SJack F Vogel struct i40e_aqc_lldp_stop_start_specific_agent {
2781f247dc25SJack F Vogel #define I40E_AQC_START_SPECIFIC_AGENT_SHIFT	0
2782d4683565SEric Joyner #define I40E_AQC_START_SPECIFIC_AGENT_MASK \
2783d4683565SEric Joyner 				(1 << I40E_AQC_START_SPECIFIC_AGENT_SHIFT)
2784f247dc25SJack F Vogel 	u8	command;
2785f247dc25SJack F Vogel 	u8	reserved[15];
2786f247dc25SJack F Vogel };
2787f247dc25SJack F Vogel 
2788f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop_start_specific_agent);
2789f247dc25SJack F Vogel 
2790b4a7ce06SEric Joyner /* Restore LLDP Agent factory settings (direct 0x0A0A) */
2791b4a7ce06SEric Joyner struct i40e_aqc_lldp_restore {
2792b4a7ce06SEric Joyner 	u8	command;
2793b4a7ce06SEric Joyner #define I40E_AQ_LLDP_AGENT_RESTORE_NOT		0x0
2794b4a7ce06SEric Joyner #define I40E_AQ_LLDP_AGENT_RESTORE		0x1
2795b4a7ce06SEric Joyner 	u8	reserved[15];
2796b4a7ce06SEric Joyner };
2797b4a7ce06SEric Joyner 
2798b4a7ce06SEric Joyner I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_restore);
2799b4a7ce06SEric Joyner 
280061ae650dSJack F Vogel /* Add Udp Tunnel command and completion (direct 0x0B00) */
280161ae650dSJack F Vogel struct i40e_aqc_add_udp_tunnel {
280261ae650dSJack F Vogel 	__le16	udp_port;
280361ae650dSJack F Vogel 	u8	reserved0[3];
280461ae650dSJack F Vogel 	u8	protocol_type;
280561ae650dSJack F Vogel #define I40E_AQC_TUNNEL_TYPE_VXLAN	0x00
280661ae650dSJack F Vogel #define I40E_AQC_TUNNEL_TYPE_NGE	0x01
280761ae650dSJack F Vogel #define I40E_AQC_TUNNEL_TYPE_TEREDO	0x10
2808fdb6f38aSEric Joyner #define I40E_AQC_TUNNEL_TYPE_VXLAN_GPE	0x11
280961ae650dSJack F Vogel 	u8	reserved1[10];
281061ae650dSJack F Vogel };
281161ae650dSJack F Vogel 
281261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel);
281361ae650dSJack F Vogel 
281461ae650dSJack F Vogel struct i40e_aqc_add_udp_tunnel_completion {
281561ae650dSJack F Vogel 	__le16	udp_port;
281661ae650dSJack F Vogel 	u8	filter_entry_index;
281761ae650dSJack F Vogel 	u8	multiple_pfs;
281861ae650dSJack F Vogel #define I40E_AQC_SINGLE_PF		0x0
281961ae650dSJack F Vogel #define I40E_AQC_MULTIPLE_PFS		0x1
282061ae650dSJack F Vogel 	u8	total_filters;
282161ae650dSJack F Vogel 	u8	reserved[11];
282261ae650dSJack F Vogel };
282361ae650dSJack F Vogel 
282461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel_completion);
282561ae650dSJack F Vogel 
282661ae650dSJack F Vogel /* remove UDP Tunnel command (0x0B01) */
282761ae650dSJack F Vogel struct i40e_aqc_remove_udp_tunnel {
282861ae650dSJack F Vogel 	u8	reserved[2];
282961ae650dSJack F Vogel 	u8	index; /* 0 to 15 */
283061ae650dSJack F Vogel 	u8	reserved2[13];
283161ae650dSJack F Vogel };
283261ae650dSJack F Vogel 
283361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_udp_tunnel);
283461ae650dSJack F Vogel 
283561ae650dSJack F Vogel struct i40e_aqc_del_udp_tunnel_completion {
283661ae650dSJack F Vogel 	__le16	udp_port;
283761ae650dSJack F Vogel 	u8	index; /* 0 to 15 */
283861ae650dSJack F Vogel 	u8	multiple_pfs;
283961ae650dSJack F Vogel 	u8	total_filters_used;
284061ae650dSJack F Vogel 	u8	reserved1[11];
284161ae650dSJack F Vogel };
284261ae650dSJack F Vogel 
284361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion);
284461ae650dSJack F Vogel 
28454294f337SSean Bruno struct i40e_aqc_get_set_rss_key {
28464294f337SSean Bruno #define I40E_AQC_SET_RSS_KEY_VSI_VALID		(0x1 << 15)
28474294f337SSean Bruno #define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT	0
28484294f337SSean Bruno #define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK	(0x3FF << \
28494294f337SSean Bruno 					I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT)
28504294f337SSean Bruno 	__le16	vsi_id;
28514294f337SSean Bruno 	u8	reserved[6];
28524294f337SSean Bruno 	__le32	addr_high;
28534294f337SSean Bruno 	__le32	addr_low;
28544294f337SSean Bruno };
28554294f337SSean Bruno 
28564294f337SSean Bruno I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key);
28574294f337SSean Bruno 
28584294f337SSean Bruno struct i40e_aqc_get_set_rss_key_data {
28594294f337SSean Bruno 	u8 standard_rss_key[0x28];
28604294f337SSean Bruno 	u8 extended_hash_key[0xc];
28614294f337SSean Bruno };
28624294f337SSean Bruno 
28634294f337SSean Bruno I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data);
28644294f337SSean Bruno 
28654294f337SSean Bruno struct  i40e_aqc_get_set_rss_lut {
28664294f337SSean Bruno #define I40E_AQC_SET_RSS_LUT_VSI_VALID		(0x1 << 15)
28674294f337SSean Bruno #define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT	0
28684294f337SSean Bruno #define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK	(0x3FF << \
28694294f337SSean Bruno 					I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT)
28704294f337SSean Bruno 	__le16	vsi_id;
28714294f337SSean Bruno #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT	0
28724294f337SSean Bruno #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK	(0x1 << \
28734294f337SSean Bruno 					I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT)
28744294f337SSean Bruno 
28754294f337SSean Bruno #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI	0
28764294f337SSean Bruno #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF	1
28774294f337SSean Bruno 	__le16	flags;
28784294f337SSean Bruno 	u8	reserved[4];
28794294f337SSean Bruno 	__le32	addr_high;
28804294f337SSean Bruno 	__le32	addr_low;
28814294f337SSean Bruno };
28824294f337SSean Bruno 
28834294f337SSean Bruno I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut);
28844294f337SSean Bruno 
288561ae650dSJack F Vogel /* tunnel key structure 0x0B10 */
288661ae650dSJack F Vogel 
288761ae650dSJack F Vogel struct i40e_aqc_tunnel_key_structure {
288861ae650dSJack F Vogel 	u8	key1_off;
288961ae650dSJack F Vogel 	u8	key2_off;
289061ae650dSJack F Vogel 	u8	key1_len;  /* 0 to 15 */
289161ae650dSJack F Vogel 	u8	key2_len;  /* 0 to 15 */
289261ae650dSJack F Vogel 	u8	flags;
289361ae650dSJack F Vogel #define I40E_AQC_TUNNEL_KEY_STRUCT_OVERRIDE	0x01
289461ae650dSJack F Vogel /* response flags */
289561ae650dSJack F Vogel #define I40E_AQC_TUNNEL_KEY_STRUCT_SUCCESS	0x01
289661ae650dSJack F Vogel #define I40E_AQC_TUNNEL_KEY_STRUCT_MODIFIED	0x02
289761ae650dSJack F Vogel #define I40E_AQC_TUNNEL_KEY_STRUCT_OVERRIDDEN	0x03
289861ae650dSJack F Vogel 	u8	network_key_index;
289961ae650dSJack F Vogel #define I40E_AQC_NETWORK_KEY_INDEX_VXLAN		0x0
290061ae650dSJack F Vogel #define I40E_AQC_NETWORK_KEY_INDEX_NGE			0x1
290161ae650dSJack F Vogel #define I40E_AQC_NETWORK_KEY_INDEX_FLEX_MAC_IN_UDP	0x2
290261ae650dSJack F Vogel #define I40E_AQC_NETWORK_KEY_INDEX_GRE			0x3
290361ae650dSJack F Vogel 	u8	reserved[10];
290461ae650dSJack F Vogel };
290561ae650dSJack F Vogel 
290661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_tunnel_key_structure);
290761ae650dSJack F Vogel 
290861ae650dSJack F Vogel /* OEM mode commands (direct 0xFE0x) */
290961ae650dSJack F Vogel struct i40e_aqc_oem_param_change {
291061ae650dSJack F Vogel 	__le32	param_type;
291161ae650dSJack F Vogel #define I40E_AQ_OEM_PARAM_TYPE_PF_CTL	0
291261ae650dSJack F Vogel #define I40E_AQ_OEM_PARAM_TYPE_BW_CTL	1
291361ae650dSJack F Vogel #define I40E_AQ_OEM_PARAM_MAC		2
291461ae650dSJack F Vogel 	__le32	param_value1;
2915f247dc25SJack F Vogel 	__le16	param_value2;
2916f247dc25SJack F Vogel 	u8	reserved[6];
291761ae650dSJack F Vogel };
291861ae650dSJack F Vogel 
291961ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_oem_param_change);
292061ae650dSJack F Vogel 
292161ae650dSJack F Vogel struct i40e_aqc_oem_state_change {
292261ae650dSJack F Vogel 	__le32	state;
292361ae650dSJack F Vogel #define I40E_AQ_OEM_STATE_LINK_DOWN	0x0
292461ae650dSJack F Vogel #define I40E_AQ_OEM_STATE_LINK_UP	0x1
292561ae650dSJack F Vogel 	u8	reserved[12];
292661ae650dSJack F Vogel };
292761ae650dSJack F Vogel 
292861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_oem_state_change);
292961ae650dSJack F Vogel 
2930f247dc25SJack F Vogel /* Initialize OCSD (0xFE02, direct) */
2931f247dc25SJack F Vogel struct i40e_aqc_opc_oem_ocsd_initialize {
2932f247dc25SJack F Vogel 	u8 type_status;
2933f247dc25SJack F Vogel 	u8 reserved1[3];
2934f247dc25SJack F Vogel 	__le32 ocsd_memory_block_addr_high;
2935f247dc25SJack F Vogel 	__le32 ocsd_memory_block_addr_low;
2936f247dc25SJack F Vogel 	__le32 requested_update_interval;
2937f247dc25SJack F Vogel };
2938f247dc25SJack F Vogel 
2939f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_opc_oem_ocsd_initialize);
2940f247dc25SJack F Vogel 
2941f247dc25SJack F Vogel /* Initialize OCBB  (0xFE03, direct) */
2942f247dc25SJack F Vogel struct i40e_aqc_opc_oem_ocbb_initialize {
2943f247dc25SJack F Vogel 	u8 type_status;
2944f247dc25SJack F Vogel 	u8 reserved1[3];
2945f247dc25SJack F Vogel 	__le32 ocbb_memory_block_addr_high;
2946f247dc25SJack F Vogel 	__le32 ocbb_memory_block_addr_low;
2947f247dc25SJack F Vogel 	u8 reserved2[4];
2948f247dc25SJack F Vogel };
2949f247dc25SJack F Vogel 
2950f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_opc_oem_ocbb_initialize);
2951f247dc25SJack F Vogel 
295261ae650dSJack F Vogel /* debug commands */
295361ae650dSJack F Vogel 
295461ae650dSJack F Vogel /* get device id (0xFF00) uses the generic structure */
295561ae650dSJack F Vogel 
295661ae650dSJack F Vogel /* set test more (0xFF01, internal) */
295761ae650dSJack F Vogel 
295861ae650dSJack F Vogel struct i40e_acq_set_test_mode {
295961ae650dSJack F Vogel 	u8	mode;
296061ae650dSJack F Vogel #define I40E_AQ_TEST_PARTIAL	0
296161ae650dSJack F Vogel #define I40E_AQ_TEST_FULL	1
296261ae650dSJack F Vogel #define I40E_AQ_TEST_NVM	2
296361ae650dSJack F Vogel 	u8	reserved[3];
296461ae650dSJack F Vogel 	u8	command;
296561ae650dSJack F Vogel #define I40E_AQ_TEST_OPEN	0
296661ae650dSJack F Vogel #define I40E_AQ_TEST_CLOSE	1
296761ae650dSJack F Vogel #define I40E_AQ_TEST_INC	2
296861ae650dSJack F Vogel 	u8	reserved2[3];
296961ae650dSJack F Vogel 	__le32	address_high;
297061ae650dSJack F Vogel 	__le32	address_low;
297161ae650dSJack F Vogel };
297261ae650dSJack F Vogel 
297361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_acq_set_test_mode);
297461ae650dSJack F Vogel 
297561ae650dSJack F Vogel /* Debug Read Register command (0xFF03)
297661ae650dSJack F Vogel  * Debug Write Register command (0xFF04)
297761ae650dSJack F Vogel  */
297861ae650dSJack F Vogel struct i40e_aqc_debug_reg_read_write {
297961ae650dSJack F Vogel 	__le32 reserved;
298061ae650dSJack F Vogel 	__le32 address;
298161ae650dSJack F Vogel 	__le32 value_high;
298261ae650dSJack F Vogel 	__le32 value_low;
298361ae650dSJack F Vogel };
298461ae650dSJack F Vogel 
298561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_reg_read_write);
298661ae650dSJack F Vogel 
298761ae650dSJack F Vogel /* Scatter/gather Reg Read  (indirect 0xFF05)
298861ae650dSJack F Vogel  * Scatter/gather Reg Write (indirect 0xFF06)
298961ae650dSJack F Vogel  */
299061ae650dSJack F Vogel 
299161ae650dSJack F Vogel /* i40e_aq_desc is used for the command */
299261ae650dSJack F Vogel struct i40e_aqc_debug_reg_sg_element_data {
299361ae650dSJack F Vogel 	__le32 address;
299461ae650dSJack F Vogel 	__le32 value;
299561ae650dSJack F Vogel };
299661ae650dSJack F Vogel 
299761ae650dSJack F Vogel /* Debug Modify register (direct 0xFF07) */
299861ae650dSJack F Vogel struct i40e_aqc_debug_modify_reg {
299961ae650dSJack F Vogel 	__le32 address;
300061ae650dSJack F Vogel 	__le32 value;
300161ae650dSJack F Vogel 	__le32 clear_mask;
300261ae650dSJack F Vogel 	__le32 set_mask;
300361ae650dSJack F Vogel };
300461ae650dSJack F Vogel 
300561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_reg);
300661ae650dSJack F Vogel 
300761ae650dSJack F Vogel /* dump internal data (0xFF08, indirect) */
300861ae650dSJack F Vogel 
300961ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_AUX		0
301061ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_SWITCH_FLU	1
301161ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_TXSCHED	2
301261ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_HMC		3
301361ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_MAC0		4
301461ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_MAC1		5
301561ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_MAC2		6
301661ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_MAC3		7
301761ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_DCB		8
301861ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_EMP_MEM	9
301961ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_PKT_BUF	10
302061ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_ALTRAM	11
302161ae650dSJack F Vogel 
302261ae650dSJack F Vogel struct i40e_aqc_debug_dump_internals {
302361ae650dSJack F Vogel 	u8	cluster_id;
302461ae650dSJack F Vogel 	u8	table_id;
302561ae650dSJack F Vogel 	__le16	data_size;
302661ae650dSJack F Vogel 	__le32	idx;
302761ae650dSJack F Vogel 	__le32	address_high;
302861ae650dSJack F Vogel 	__le32	address_low;
302961ae650dSJack F Vogel };
303061ae650dSJack F Vogel 
303161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_dump_internals);
303261ae650dSJack F Vogel 
303361ae650dSJack F Vogel struct i40e_aqc_debug_modify_internals {
303461ae650dSJack F Vogel 	u8	cluster_id;
303561ae650dSJack F Vogel 	u8	cluster_specific_params[7];
303661ae650dSJack F Vogel 	__le32	address_high;
303761ae650dSJack F Vogel 	__le32	address_low;
303861ae650dSJack F Vogel };
303961ae650dSJack F Vogel 
304061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_internals);
304161ae650dSJack F Vogel 
3042223d846dSEric Joyner #endif /* _I40E_ADMINQ_CMD_H_ */
3043