1ae06c70bSJeff Kirsher /* SPDX-License-Identifier: GPL-2.0 */
290bc8e00SArkadiusz Kubalewski /* Copyright(c) 2013 - 2021 Intel Corporation. */
356a62fc8SJesse Brandeburg 
456a62fc8SJesse Brandeburg #ifndef _I40E_ADMINQ_CMD_H_
556a62fc8SJesse Brandeburg #define _I40E_ADMINQ_CMD_H_
656a62fc8SJesse Brandeburg 
7*e77220eeSIvan Vecera #include <linux/bits.h>
8*e77220eeSIvan Vecera 
956a62fc8SJesse Brandeburg /* This header file defines the i40e Admin Queue commands and is shared between
1056a62fc8SJesse Brandeburg  * i40e Firmware and Software.
1156a62fc8SJesse Brandeburg  *
1256a62fc8SJesse Brandeburg  * This file needs to comply with the Linux Kernel coding style.
1356a62fc8SJesse Brandeburg  */
1456a62fc8SJesse Brandeburg 
1556a62fc8SJesse Brandeburg #define I40E_FW_API_VERSION_MAJOR	0x0001
169c83ca8aSMateusz Palczewski #define I40E_FW_API_VERSION_MINOR_X722	0x000C
179c83ca8aSMateusz Palczewski #define I40E_FW_API_VERSION_MINOR_X710	0x000F
1822b96551SMitch Williams 
1922b96551SMitch Williams #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
2022b96551SMitch Williams 					I40E_FW_API_VERSION_MINOR_X710 : \
2122b96551SMitch Williams 					I40E_FW_API_VERSION_MINOR_X722)
2222b96551SMitch Williams 
2322b96551SMitch Williams /* API version 1.7 implements additional link and PHY-specific APIs  */
2422b96551SMitch Williams #define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007
256acab13bSJacob Keller /* API version 1.9 for X722 implements additional link and PHY-specific APIs */
266acab13bSJacob Keller #define I40E_MINOR_VER_GET_LINK_INFO_X722 0x0009
27de10933eSKrzysztof Galazka /* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */
28de10933eSKrzysztof Galazka #define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006
2930cf856aSJaroslaw Gawin /* API version 1.10 for X722 devices adds ability to request FEC encoding */
3030cf856aSJaroslaw Gawin #define I40E_MINOR_VER_FW_REQUEST_FEC_X722 0x000A
3156a62fc8SJesse Brandeburg 
3256a62fc8SJesse Brandeburg struct i40e_aq_desc {
3356a62fc8SJesse Brandeburg 	__le16 flags;
3456a62fc8SJesse Brandeburg 	__le16 opcode;
3556a62fc8SJesse Brandeburg 	__le16 datalen;
3656a62fc8SJesse Brandeburg 	__le16 retval;
3756a62fc8SJesse Brandeburg 	__le32 cookie_high;
3856a62fc8SJesse Brandeburg 	__le32 cookie_low;
3956a62fc8SJesse Brandeburg 	union {
4056a62fc8SJesse Brandeburg 		struct {
4156a62fc8SJesse Brandeburg 			__le32 param0;
4256a62fc8SJesse Brandeburg 			__le32 param1;
4356a62fc8SJesse Brandeburg 			__le32 param2;
4456a62fc8SJesse Brandeburg 			__le32 param3;
4556a62fc8SJesse Brandeburg 		} internal;
4656a62fc8SJesse Brandeburg 		struct {
4756a62fc8SJesse Brandeburg 			__le32 param0;
4856a62fc8SJesse Brandeburg 			__le32 param1;
4956a62fc8SJesse Brandeburg 			__le32 addr_high;
5056a62fc8SJesse Brandeburg 			__le32 addr_low;
5156a62fc8SJesse Brandeburg 		} external;
5256a62fc8SJesse Brandeburg 		u8 raw[16];
5356a62fc8SJesse Brandeburg 	} params;
5456a62fc8SJesse Brandeburg };
5556a62fc8SJesse Brandeburg 
5656a62fc8SJesse Brandeburg /* Flags sub-structure
5756a62fc8SJesse Brandeburg  * |0  |1  |2  |3  |4  |5  |6  |7  |8  |9  |10 |11 |12 |13 |14 |15 |
5856a62fc8SJesse Brandeburg  * |DD |CMP|ERR|VFE| * *  RESERVED * * |LB |RD |VFC|BUF|SI |EI |FE |
5956a62fc8SJesse Brandeburg  */
6056a62fc8SJesse Brandeburg 
6156a62fc8SJesse Brandeburg /* command flags and offsets*/
6256a62fc8SJesse Brandeburg #define I40E_AQ_FLAG_ERR_SHIFT	2
6356a62fc8SJesse Brandeburg #define I40E_AQ_FLAG_LB_SHIFT	9
6456a62fc8SJesse Brandeburg #define I40E_AQ_FLAG_RD_SHIFT	10
6556a62fc8SJesse Brandeburg #define I40E_AQ_FLAG_BUF_SHIFT	12
6656a62fc8SJesse Brandeburg #define I40E_AQ_FLAG_SI_SHIFT	13
6756a62fc8SJesse Brandeburg 
682101bac2SJacob Keller #define I40E_AQ_FLAG_ERR	BIT(I40E_AQ_FLAG_ERR_SHIFT) /* 0x4    */
692101bac2SJacob Keller #define I40E_AQ_FLAG_LB		BIT(I40E_AQ_FLAG_LB_SHIFT)  /* 0x200  */
702101bac2SJacob Keller #define I40E_AQ_FLAG_RD		BIT(I40E_AQ_FLAG_RD_SHIFT)  /* 0x400  */
712101bac2SJacob Keller #define I40E_AQ_FLAG_BUF	BIT(I40E_AQ_FLAG_BUF_SHIFT) /* 0x1000 */
722101bac2SJacob Keller #define I40E_AQ_FLAG_SI		BIT(I40E_AQ_FLAG_SI_SHIFT)  /* 0x2000 */
7356a62fc8SJesse Brandeburg 
7456a62fc8SJesse Brandeburg /* error codes */
7556a62fc8SJesse Brandeburg enum i40e_admin_queue_err {
7656a62fc8SJesse Brandeburg 	I40E_AQ_RC_OK		= 0,  /* success */
7756a62fc8SJesse Brandeburg 	I40E_AQ_RC_EPERM	= 1,  /* Operation not permitted */
7856a62fc8SJesse Brandeburg 	I40E_AQ_RC_ENOENT	= 2,  /* No such element */
7956a62fc8SJesse Brandeburg 	I40E_AQ_RC_ESRCH	= 3,  /* Bad opcode */
8056a62fc8SJesse Brandeburg 	I40E_AQ_RC_EINTR	= 4,  /* operation interrupted */
8156a62fc8SJesse Brandeburg 	I40E_AQ_RC_EIO		= 5,  /* I/O error */
8256a62fc8SJesse Brandeburg 	I40E_AQ_RC_ENXIO	= 6,  /* No such resource */
8356a62fc8SJesse Brandeburg 	I40E_AQ_RC_E2BIG	= 7,  /* Arg too long */
8456a62fc8SJesse Brandeburg 	I40E_AQ_RC_EAGAIN	= 8,  /* Try again */
8556a62fc8SJesse Brandeburg 	I40E_AQ_RC_ENOMEM	= 9,  /* Out of memory */
8656a62fc8SJesse Brandeburg 	I40E_AQ_RC_EACCES	= 10, /* Permission denied */
8756a62fc8SJesse Brandeburg 	I40E_AQ_RC_EFAULT	= 11, /* Bad address */
8856a62fc8SJesse Brandeburg 	I40E_AQ_RC_EBUSY	= 12, /* Device or resource busy */
8956a62fc8SJesse Brandeburg 	I40E_AQ_RC_EEXIST	= 13, /* object already exists */
9056a62fc8SJesse Brandeburg 	I40E_AQ_RC_EINVAL	= 14, /* Invalid argument */
9156a62fc8SJesse Brandeburg 	I40E_AQ_RC_ENOTTY	= 15, /* Not a typewriter */
9256a62fc8SJesse Brandeburg 	I40E_AQ_RC_ENOSPC	= 16, /* No space left or alloc failure */
9356a62fc8SJesse Brandeburg 	I40E_AQ_RC_ENOSYS	= 17, /* Function not implemented */
9456a62fc8SJesse Brandeburg 	I40E_AQ_RC_ERANGE	= 18, /* Parameter out of range */
958c570dccSJeff Kirsher 	I40E_AQ_RC_EFLUSHED	= 19, /* Cmd flushed due to prev cmd error */
9656a62fc8SJesse Brandeburg 	I40E_AQ_RC_BAD_ADDR	= 20, /* Descriptor contains a bad pointer */
9756a62fc8SJesse Brandeburg 	I40E_AQ_RC_EMODE	= 21, /* Op not allowed in current dev mode */
9856a62fc8SJesse Brandeburg 	I40E_AQ_RC_EFBIG	= 22, /* File too large */
9956a62fc8SJesse Brandeburg };
10056a62fc8SJesse Brandeburg 
10156a62fc8SJesse Brandeburg /* Admin Queue command opcodes */
10256a62fc8SJesse Brandeburg enum i40e_admin_queue_opc {
10356a62fc8SJesse Brandeburg 	/* aq commands */
10456a62fc8SJesse Brandeburg 	i40e_aqc_opc_get_version	= 0x0001,
10556a62fc8SJesse Brandeburg 	i40e_aqc_opc_driver_version	= 0x0002,
10656a62fc8SJesse Brandeburg 	i40e_aqc_opc_queue_shutdown	= 0x0003,
107f94234eeSShannon Nelson 	i40e_aqc_opc_set_pf_context	= 0x0004,
10856a62fc8SJesse Brandeburg 
10956a62fc8SJesse Brandeburg 	/* resource ownership */
11056a62fc8SJesse Brandeburg 	i40e_aqc_opc_request_resource	= 0x0008,
11156a62fc8SJesse Brandeburg 	i40e_aqc_opc_release_resource	= 0x0009,
11256a62fc8SJesse Brandeburg 
11356a62fc8SJesse Brandeburg 	i40e_aqc_opc_list_func_capabilities	= 0x000A,
11456a62fc8SJesse Brandeburg 	i40e_aqc_opc_list_dev_capabilities	= 0x000B,
11556a62fc8SJesse Brandeburg 
116d60be2caSShannon Nelson 	/* Proxy commands */
117d60be2caSShannon Nelson 	i40e_aqc_opc_set_proxy_config		= 0x0104,
118d60be2caSShannon Nelson 	i40e_aqc_opc_set_ns_proxy_table_entry	= 0x0105,
119d60be2caSShannon Nelson 
12056a62fc8SJesse Brandeburg 	/* LAA */
12156a62fc8SJesse Brandeburg 	i40e_aqc_opc_mac_address_read	= 0x0107,
12256a62fc8SJesse Brandeburg 	i40e_aqc_opc_mac_address_write	= 0x0108,
12356a62fc8SJesse Brandeburg 
124981b7545SShannon Nelson 	/* PXE */
125981b7545SShannon Nelson 	i40e_aqc_opc_clear_pxe_mode	= 0x0110,
126981b7545SShannon Nelson 
127d60be2caSShannon Nelson 	/* WoL commands */
128d60be2caSShannon Nelson 	i40e_aqc_opc_set_wol_filter	= 0x0120,
129d60be2caSShannon Nelson 	i40e_aqc_opc_get_wake_reason	= 0x0121,
130d60be2caSShannon Nelson 
13156a62fc8SJesse Brandeburg 	/* internal switch commands */
13256a62fc8SJesse Brandeburg 	i40e_aqc_opc_get_switch_config		= 0x0200,
13356a62fc8SJesse Brandeburg 	i40e_aqc_opc_add_statistics		= 0x0201,
13456a62fc8SJesse Brandeburg 	i40e_aqc_opc_remove_statistics		= 0x0202,
13556a62fc8SJesse Brandeburg 	i40e_aqc_opc_set_port_parameters	= 0x0203,
13656a62fc8SJesse Brandeburg 	i40e_aqc_opc_get_switch_resource_alloc	= 0x0204,
137fa5623a6SShannon Nelson 	i40e_aqc_opc_set_switch_config		= 0x0205,
13833365143SShannon Nelson 	i40e_aqc_opc_rx_ctl_reg_read		= 0x0206,
13933365143SShannon Nelson 	i40e_aqc_opc_rx_ctl_reg_write		= 0x0207,
14056a62fc8SJesse Brandeburg 
14156a62fc8SJesse Brandeburg 	i40e_aqc_opc_add_vsi			= 0x0210,
14256a62fc8SJesse Brandeburg 	i40e_aqc_opc_update_vsi_parameters	= 0x0211,
14356a62fc8SJesse Brandeburg 	i40e_aqc_opc_get_vsi_parameters		= 0x0212,
14456a62fc8SJesse Brandeburg 
14556a62fc8SJesse Brandeburg 	i40e_aqc_opc_add_pv			= 0x0220,
14656a62fc8SJesse Brandeburg 	i40e_aqc_opc_update_pv_parameters	= 0x0221,
14756a62fc8SJesse Brandeburg 	i40e_aqc_opc_get_pv_parameters		= 0x0222,
14856a62fc8SJesse Brandeburg 
14956a62fc8SJesse Brandeburg 	i40e_aqc_opc_add_veb			= 0x0230,
15056a62fc8SJesse Brandeburg 	i40e_aqc_opc_update_veb_parameters	= 0x0231,
15156a62fc8SJesse Brandeburg 	i40e_aqc_opc_get_veb_parameters		= 0x0232,
15256a62fc8SJesse Brandeburg 
15356a62fc8SJesse Brandeburg 	i40e_aqc_opc_delete_element		= 0x0243,
15456a62fc8SJesse Brandeburg 
15556a62fc8SJesse Brandeburg 	i40e_aqc_opc_add_macvlan		= 0x0250,
15656a62fc8SJesse Brandeburg 	i40e_aqc_opc_remove_macvlan		= 0x0251,
15756a62fc8SJesse Brandeburg 	i40e_aqc_opc_add_vlan			= 0x0252,
15856a62fc8SJesse Brandeburg 	i40e_aqc_opc_remove_vlan		= 0x0253,
15956a62fc8SJesse Brandeburg 	i40e_aqc_opc_set_vsi_promiscuous_modes	= 0x0254,
16056a62fc8SJesse Brandeburg 	i40e_aqc_opc_add_tag			= 0x0255,
16156a62fc8SJesse Brandeburg 	i40e_aqc_opc_remove_tag			= 0x0256,
16256a62fc8SJesse Brandeburg 	i40e_aqc_opc_add_multicast_etag		= 0x0257,
16356a62fc8SJesse Brandeburg 	i40e_aqc_opc_remove_multicast_etag	= 0x0258,
16456a62fc8SJesse Brandeburg 	i40e_aqc_opc_update_tag			= 0x0259,
16556a62fc8SJesse Brandeburg 	i40e_aqc_opc_add_control_packet_filter	= 0x025A,
16656a62fc8SJesse Brandeburg 	i40e_aqc_opc_remove_control_packet_filter	= 0x025B,
16756a62fc8SJesse Brandeburg 	i40e_aqc_opc_add_cloud_filters		= 0x025C,
16856a62fc8SJesse Brandeburg 	i40e_aqc_opc_remove_cloud_filters	= 0x025D,
169d60be2caSShannon Nelson 	i40e_aqc_opc_clear_wol_switch_filters	= 0x025E,
17056a62fc8SJesse Brandeburg 
17156a62fc8SJesse Brandeburg 	i40e_aqc_opc_add_mirror_rule	= 0x0260,
17256a62fc8SJesse Brandeburg 	i40e_aqc_opc_delete_mirror_rule	= 0x0261,
17356a62fc8SJesse Brandeburg 
174329e5983SJingjing Wu 	/* Dynamic Device Personalization */
1751d5c960cSJingjing Wu 	i40e_aqc_opc_write_personalization_profile	= 0x0270,
1761d5c960cSJingjing Wu 	i40e_aqc_opc_get_personalization_profile_list	= 0x0271,
1771d5c960cSJingjing Wu 
17856a62fc8SJesse Brandeburg 	/* DCB commands */
17956a62fc8SJesse Brandeburg 	i40e_aqc_opc_dcb_ignore_pfc	= 0x0301,
18056a62fc8SJesse Brandeburg 	i40e_aqc_opc_dcb_updated	= 0x0302,
181b6a02a6fSUpasana Menon 	i40e_aqc_opc_set_dcb_parameters = 0x0303,
18256a62fc8SJesse Brandeburg 
18356a62fc8SJesse Brandeburg 	/* TX scheduler */
18456a62fc8SJesse Brandeburg 	i40e_aqc_opc_configure_vsi_bw_limit		= 0x0400,
18556a62fc8SJesse Brandeburg 	i40e_aqc_opc_configure_vsi_ets_sla_bw_limit	= 0x0406,
18656a62fc8SJesse Brandeburg 	i40e_aqc_opc_configure_vsi_tc_bw		= 0x0407,
18756a62fc8SJesse Brandeburg 	i40e_aqc_opc_query_vsi_bw_config		= 0x0408,
18856a62fc8SJesse Brandeburg 	i40e_aqc_opc_query_vsi_ets_sla_config		= 0x040A,
18956a62fc8SJesse Brandeburg 	i40e_aqc_opc_configure_switching_comp_bw_limit	= 0x0410,
19056a62fc8SJesse Brandeburg 
19156a62fc8SJesse Brandeburg 	i40e_aqc_opc_enable_switching_comp_ets			= 0x0413,
19256a62fc8SJesse Brandeburg 	i40e_aqc_opc_modify_switching_comp_ets			= 0x0414,
19356a62fc8SJesse Brandeburg 	i40e_aqc_opc_disable_switching_comp_ets			= 0x0415,
19456a62fc8SJesse Brandeburg 	i40e_aqc_opc_configure_switching_comp_ets_bw_limit	= 0x0416,
19556a62fc8SJesse Brandeburg 	i40e_aqc_opc_configure_switching_comp_bw_config		= 0x0417,
19656a62fc8SJesse Brandeburg 	i40e_aqc_opc_query_switching_comp_ets_config		= 0x0418,
19756a62fc8SJesse Brandeburg 	i40e_aqc_opc_query_port_ets_config			= 0x0419,
19856a62fc8SJesse Brandeburg 	i40e_aqc_opc_query_switching_comp_bw_config		= 0x041A,
19956a62fc8SJesse Brandeburg 	i40e_aqc_opc_suspend_port_tx				= 0x041B,
20056a62fc8SJesse Brandeburg 	i40e_aqc_opc_resume_port_tx				= 0x041C,
201befc229cSShannon Nelson 	i40e_aqc_opc_configure_partition_bw			= 0x041D,
2027d94906bSCarolyn Wyborny 	/* hmc */
2037d94906bSCarolyn Wyborny 	i40e_aqc_opc_query_hmc_resource_profile	= 0x0500,
2047d94906bSCarolyn Wyborny 	i40e_aqc_opc_set_hmc_resource_profile	= 0x0501,
20556a62fc8SJesse Brandeburg 
20656a62fc8SJesse Brandeburg 	/* phy commands*/
20756a62fc8SJesse Brandeburg 	i40e_aqc_opc_get_phy_abilities		= 0x0600,
20856a62fc8SJesse Brandeburg 	i40e_aqc_opc_set_phy_config		= 0x0601,
20956a62fc8SJesse Brandeburg 	i40e_aqc_opc_set_mac_config		= 0x0603,
21056a62fc8SJesse Brandeburg 	i40e_aqc_opc_set_link_restart_an	= 0x0605,
21156a62fc8SJesse Brandeburg 	i40e_aqc_opc_get_link_status		= 0x0607,
21256a62fc8SJesse Brandeburg 	i40e_aqc_opc_set_phy_int_mask		= 0x0613,
21356a62fc8SJesse Brandeburg 	i40e_aqc_opc_get_local_advt_reg		= 0x0614,
21456a62fc8SJesse Brandeburg 	i40e_aqc_opc_set_local_advt_reg		= 0x0615,
21556a62fc8SJesse Brandeburg 	i40e_aqc_opc_get_partner_advt		= 0x0616,
21656a62fc8SJesse Brandeburg 	i40e_aqc_opc_set_lb_modes		= 0x0618,
21756a62fc8SJesse Brandeburg 	i40e_aqc_opc_get_phy_wol_caps		= 0x0621,
218f94234eeSShannon Nelson 	i40e_aqc_opc_set_phy_debug		= 0x0622,
21956a62fc8SJesse Brandeburg 	i40e_aqc_opc_upload_ext_phy_fm		= 0x0625,
2205394f02fSShannon Nelson 	i40e_aqc_opc_run_phy_activity		= 0x0626,
2219c0e5cafSFilip Sadowski 	i40e_aqc_opc_set_phy_register		= 0x0628,
2229c0e5cafSFilip Sadowski 	i40e_aqc_opc_get_phy_register		= 0x0629,
22356a62fc8SJesse Brandeburg 
22456a62fc8SJesse Brandeburg 	/* NVM commands */
22556a62fc8SJesse Brandeburg 	i40e_aqc_opc_nvm_read			= 0x0701,
22656a62fc8SJesse Brandeburg 	i40e_aqc_opc_nvm_erase			= 0x0702,
22756a62fc8SJesse Brandeburg 	i40e_aqc_opc_nvm_update			= 0x0703,
228f94234eeSShannon Nelson 	i40e_aqc_opc_nvm_config_read		= 0x0704,
229f94234eeSShannon Nelson 	i40e_aqc_opc_nvm_config_write		= 0x0705,
23000ada50dSMichal Kosiarz 	i40e_aqc_opc_oem_post_update		= 0x0720,
2316774faf9SShannon Nelson 	i40e_aqc_opc_thermal_sensor		= 0x0721,
23256a62fc8SJesse Brandeburg 
23356a62fc8SJesse Brandeburg 	/* virtualization commands */
23456a62fc8SJesse Brandeburg 	i40e_aqc_opc_send_msg_to_pf		= 0x0801,
23556a62fc8SJesse Brandeburg 	i40e_aqc_opc_send_msg_to_vf		= 0x0802,
23656a62fc8SJesse Brandeburg 	i40e_aqc_opc_send_msg_to_peer		= 0x0803,
23756a62fc8SJesse Brandeburg 
23856a62fc8SJesse Brandeburg 	/* alternate structure */
23956a62fc8SJesse Brandeburg 	i40e_aqc_opc_alternate_write		= 0x0900,
24056a62fc8SJesse Brandeburg 	i40e_aqc_opc_alternate_write_indirect	= 0x0901,
24156a62fc8SJesse Brandeburg 	i40e_aqc_opc_alternate_read		= 0x0902,
24256a62fc8SJesse Brandeburg 	i40e_aqc_opc_alternate_read_indirect	= 0x0903,
24356a62fc8SJesse Brandeburg 	i40e_aqc_opc_alternate_write_done	= 0x0904,
24456a62fc8SJesse Brandeburg 	i40e_aqc_opc_alternate_set_mode		= 0x0905,
24556a62fc8SJesse Brandeburg 	i40e_aqc_opc_alternate_clear_port	= 0x0906,
24656a62fc8SJesse Brandeburg 
24756a62fc8SJesse Brandeburg 	/* LLDP commands */
24856a62fc8SJesse Brandeburg 	i40e_aqc_opc_lldp_get_mib	= 0x0A00,
24956a62fc8SJesse Brandeburg 	i40e_aqc_opc_lldp_update_mib	= 0x0A01,
25056a62fc8SJesse Brandeburg 	i40e_aqc_opc_lldp_add_tlv	= 0x0A02,
25156a62fc8SJesse Brandeburg 	i40e_aqc_opc_lldp_update_tlv	= 0x0A03,
25256a62fc8SJesse Brandeburg 	i40e_aqc_opc_lldp_delete_tlv	= 0x0A04,
25356a62fc8SJesse Brandeburg 	i40e_aqc_opc_lldp_stop		= 0x0A05,
25456a62fc8SJesse Brandeburg 	i40e_aqc_opc_lldp_start		= 0x0A06,
2559fa61dd2SNeerav Parikh 	i40e_aqc_opc_get_cee_dcb_cfg	= 0x0A07,
256672415c5SShannon Nelson 	i40e_aqc_opc_lldp_set_local_mib	= 0x0A08,
257672415c5SShannon Nelson 	i40e_aqc_opc_lldp_stop_start_spec_agent	= 0x0A09,
258c65e78f8SAleksandr Loktionov 	i40e_aqc_opc_lldp_restore		= 0x0A0A,
25956a62fc8SJesse Brandeburg 
26056a62fc8SJesse Brandeburg 	/* Tunnel commands */
26156a62fc8SJesse Brandeburg 	i40e_aqc_opc_add_udp_tunnel	= 0x0B00,
26256a62fc8SJesse Brandeburg 	i40e_aqc_opc_del_udp_tunnel	= 0x0B01,
263e50c8d6dSAnjali Singhai Jain 	i40e_aqc_opc_set_rss_key	= 0x0B02,
264e50c8d6dSAnjali Singhai Jain 	i40e_aqc_opc_set_rss_lut	= 0x0B03,
265e50c8d6dSAnjali Singhai Jain 	i40e_aqc_opc_get_rss_key	= 0x0B04,
266e50c8d6dSAnjali Singhai Jain 	i40e_aqc_opc_get_rss_lut	= 0x0B05,
26756a62fc8SJesse Brandeburg 
26856a62fc8SJesse Brandeburg 	/* Async Events */
26956a62fc8SJesse Brandeburg 	i40e_aqc_opc_event_lan_overflow		= 0x1001,
27056a62fc8SJesse Brandeburg 
27156a62fc8SJesse Brandeburg 	/* OEM commands */
27256a62fc8SJesse Brandeburg 	i40e_aqc_opc_oem_parameter_change	= 0xFE00,
27356a62fc8SJesse Brandeburg 	i40e_aqc_opc_oem_device_status_change	= 0xFE01,
274672415c5SShannon Nelson 	i40e_aqc_opc_oem_ocsd_initialize	= 0xFE02,
275672415c5SShannon Nelson 	i40e_aqc_opc_oem_ocbb_initialize	= 0xFE03,
27656a62fc8SJesse Brandeburg 
27756a62fc8SJesse Brandeburg 	/* debug commands */
27856a62fc8SJesse Brandeburg 	i40e_aqc_opc_debug_read_reg		= 0xFF03,
27956a62fc8SJesse Brandeburg 	i40e_aqc_opc_debug_write_reg		= 0xFF04,
28056a62fc8SJesse Brandeburg 	i40e_aqc_opc_debug_modify_reg		= 0xFF07,
28156a62fc8SJesse Brandeburg 	i40e_aqc_opc_debug_dump_internals	= 0xFF08,
28256a62fc8SJesse Brandeburg };
28356a62fc8SJesse Brandeburg 
28456a62fc8SJesse Brandeburg /* command structures and indirect data structures */
28556a62fc8SJesse Brandeburg 
28656a62fc8SJesse Brandeburg /* Structure naming conventions:
28756a62fc8SJesse Brandeburg  * - no suffix for direct command descriptor structures
28856a62fc8SJesse Brandeburg  * - _data for indirect sent data
28956a62fc8SJesse Brandeburg  * - _resp for indirect return data (data which is both will use _data)
29056a62fc8SJesse Brandeburg  * - _completion for direct return data
29156a62fc8SJesse Brandeburg  * - _element_ for repeated elements (may also be _data or _resp)
29256a62fc8SJesse Brandeburg  *
29356a62fc8SJesse Brandeburg  * Command structures are expected to overlay the params.raw member of the basic
29456a62fc8SJesse Brandeburg  * descriptor, and as such cannot exceed 16 bytes in length.
29556a62fc8SJesse Brandeburg  */
29656a62fc8SJesse Brandeburg 
29756a62fc8SJesse Brandeburg /* This macro is used to generate a compilation error if a structure
29856a62fc8SJesse Brandeburg  * is not exactly the correct length. It gives a divide by zero error if the
29956a62fc8SJesse Brandeburg  * structure is not of the correct size, otherwise it creates an enum that is
30056a62fc8SJesse Brandeburg  * never used.
30156a62fc8SJesse Brandeburg  */
30256a62fc8SJesse Brandeburg #define I40E_CHECK_STRUCT_LEN(n, X) enum i40e_static_assert_enum_##X \
30356a62fc8SJesse Brandeburg 	{ i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
30456a62fc8SJesse Brandeburg 
30556a62fc8SJesse Brandeburg /* This macro is used extensively to ensure that command structures are 16
30656a62fc8SJesse Brandeburg  * bytes in length as they have to map to the raw array of that size.
30756a62fc8SJesse Brandeburg  */
30856a62fc8SJesse Brandeburg #define I40E_CHECK_CMD_LENGTH(X)	I40E_CHECK_STRUCT_LEN(16, X)
30956a62fc8SJesse Brandeburg 
31056a62fc8SJesse Brandeburg /* internal (0x00XX) commands */
31156a62fc8SJesse Brandeburg 
31256a62fc8SJesse Brandeburg /* Get version (direct 0x0001) */
31356a62fc8SJesse Brandeburg struct i40e_aqc_get_version {
31456a62fc8SJesse Brandeburg 	__le32 rom_ver;
31556a62fc8SJesse Brandeburg 	__le32 fw_build;
31656a62fc8SJesse Brandeburg 	__le16 fw_major;
31756a62fc8SJesse Brandeburg 	__le16 fw_minor;
31856a62fc8SJesse Brandeburg 	__le16 api_major;
31956a62fc8SJesse Brandeburg 	__le16 api_minor;
32056a62fc8SJesse Brandeburg };
32156a62fc8SJesse Brandeburg 
32256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_get_version);
32356a62fc8SJesse Brandeburg 
324981b7545SShannon Nelson /* Send driver version (indirect 0x0002) */
32556a62fc8SJesse Brandeburg struct i40e_aqc_driver_version {
32656a62fc8SJesse Brandeburg 	u8	driver_major_ver;
32756a62fc8SJesse Brandeburg 	u8	driver_minor_ver;
32856a62fc8SJesse Brandeburg 	u8	driver_build_ver;
32956a62fc8SJesse Brandeburg 	u8	driver_subbuild_ver;
330981b7545SShannon Nelson 	u8	reserved[4];
331981b7545SShannon Nelson 	__le32	address_high;
332981b7545SShannon Nelson 	__le32	address_low;
33356a62fc8SJesse Brandeburg };
33456a62fc8SJesse Brandeburg 
33556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_driver_version);
33656a62fc8SJesse Brandeburg 
33756a62fc8SJesse Brandeburg /* Queue Shutdown (direct 0x0003) */
33856a62fc8SJesse Brandeburg struct i40e_aqc_queue_shutdown {
33956a62fc8SJesse Brandeburg 	__le32	driver_unloading;
34056a62fc8SJesse Brandeburg #define I40E_AQ_DRIVER_UNLOADING	0x1
34156a62fc8SJesse Brandeburg 	u8	reserved[12];
34256a62fc8SJesse Brandeburg };
34356a62fc8SJesse Brandeburg 
34456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_queue_shutdown);
34556a62fc8SJesse Brandeburg 
346f94234eeSShannon Nelson /* Set PF context (0x0004, direct) */
347f94234eeSShannon Nelson struct i40e_aqc_set_pf_context {
348f94234eeSShannon Nelson 	u8	pf_id;
349f94234eeSShannon Nelson 	u8	reserved[15];
350f94234eeSShannon Nelson };
351f94234eeSShannon Nelson 
352f94234eeSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_set_pf_context);
353f94234eeSShannon Nelson 
35456a62fc8SJesse Brandeburg /* Request resource ownership (direct 0x0008)
35556a62fc8SJesse Brandeburg  * Release resource ownership (direct 0x0009)
35656a62fc8SJesse Brandeburg  */
35756a62fc8SJesse Brandeburg struct i40e_aqc_request_resource {
35856a62fc8SJesse Brandeburg 	__le16	resource_id;
35956a62fc8SJesse Brandeburg 	__le16	access_type;
36056a62fc8SJesse Brandeburg 	__le32	timeout;
36156a62fc8SJesse Brandeburg 	__le32	resource_number;
36256a62fc8SJesse Brandeburg 	u8	reserved[4];
36356a62fc8SJesse Brandeburg };
36456a62fc8SJesse Brandeburg 
36556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_request_resource);
36656a62fc8SJesse Brandeburg 
36756a62fc8SJesse Brandeburg /* Get function capabilities (indirect 0x000A)
36856a62fc8SJesse Brandeburg  * Get device capabilities (indirect 0x000B)
36956a62fc8SJesse Brandeburg  */
37056a62fc8SJesse Brandeburg struct i40e_aqc_list_capabilites {
37156a62fc8SJesse Brandeburg 	u8 command_flags;
37256a62fc8SJesse Brandeburg 	u8 pf_index;
37356a62fc8SJesse Brandeburg 	u8 reserved[2];
37456a62fc8SJesse Brandeburg 	__le32 count;
37556a62fc8SJesse Brandeburg 	__le32 addr_high;
37656a62fc8SJesse Brandeburg 	__le32 addr_low;
37756a62fc8SJesse Brandeburg };
37856a62fc8SJesse Brandeburg 
37956a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_list_capabilites);
38056a62fc8SJesse Brandeburg 
38156a62fc8SJesse Brandeburg struct i40e_aqc_list_capabilities_element_resp {
38256a62fc8SJesse Brandeburg 	__le16	id;
38356a62fc8SJesse Brandeburg 	u8	major_rev;
38456a62fc8SJesse Brandeburg 	u8	minor_rev;
38556a62fc8SJesse Brandeburg 	__le32	number;
38656a62fc8SJesse Brandeburg 	__le32	logical_id;
38756a62fc8SJesse Brandeburg 	__le32	phys_id;
38856a62fc8SJesse Brandeburg 	u8	reserved[16];
38956a62fc8SJesse Brandeburg };
39056a62fc8SJesse Brandeburg 
39156a62fc8SJesse Brandeburg /* list of caps */
39256a62fc8SJesse Brandeburg 
39356a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_SWITCH_MODE	0x0001
39456a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_MNG_MODE		0x0002
39556a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_NPAR_ACTIVE	0x0003
39656a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_OS2BMC_CAP	0x0004
39756a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_FUNCTIONS_VALID	0x0005
39856a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_SRIOV		0x0012
39956a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_VF		0x0013
40056a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_VMDQ		0x0014
40156a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_8021QBG		0x0015
40256a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_8021QBR		0x0016
40356a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_VSI		0x0017
40456a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_DCB		0x0018
40556a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_FCOE		0x0021
40635155fe6SShannon Nelson #define I40E_AQ_CAP_ID_ISCSI		0x0022
40756a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_RSS		0x0040
40856a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_RXQ		0x0041
40956a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_TXQ		0x0042
41056a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_MSIX		0x0043
41156a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_VF_MSIX		0x0044
41256a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_FLOW_DIRECTOR	0x0045
41356a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_1588		0x0046
41456a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_IWARP		0x0051
41556a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_LED		0x0061
41656a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_SDP		0x0062
41756a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_MDIO		0x0063
418406e734aSShannon Nelson #define I40E_AQ_CAP_ID_WSR_PROT		0x0064
41968a1c5a7SMichal Kosiarz #define I40E_AQ_CAP_ID_NVM_MGMT		0x0080
42056a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_FLEX10		0x00F1
42156a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_CEM		0x00F2
42256a62fc8SJesse Brandeburg 
42356a62fc8SJesse Brandeburg /* Set CPPM Configuration (direct 0x0103) */
42456a62fc8SJesse Brandeburg struct i40e_aqc_cppm_configuration {
42556a62fc8SJesse Brandeburg 	__le16	command_flags;
42656a62fc8SJesse Brandeburg 	__le16	ttlx;
42756a62fc8SJesse Brandeburg 	__le32	dmacr;
42856a62fc8SJesse Brandeburg 	__le16	dmcth;
42956a62fc8SJesse Brandeburg 	u8	hptc;
43056a62fc8SJesse Brandeburg 	u8	reserved;
43156a62fc8SJesse Brandeburg 	__le32	pfltrc;
43256a62fc8SJesse Brandeburg };
43356a62fc8SJesse Brandeburg 
43456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration);
43556a62fc8SJesse Brandeburg 
43656a62fc8SJesse Brandeburg /* Set ARP Proxy command / response (indirect 0x0104) */
43756a62fc8SJesse Brandeburg struct i40e_aqc_arp_proxy_data {
43856a62fc8SJesse Brandeburg 	__le16	command_flags;
43956a62fc8SJesse Brandeburg 	__le16	table_id;
440b7eeef49SCarolyn Wyborny 	__le32	enabled_offloads;
44156a62fc8SJesse Brandeburg 	__le32	ip_addr;
44256a62fc8SJesse Brandeburg 	u8	mac_addr[6];
443672415c5SShannon Nelson 	u8	reserved[2];
44456a62fc8SJesse Brandeburg };
44556a62fc8SJesse Brandeburg 
4468d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x14, i40e_aqc_arp_proxy_data);
4478d5e33adSShannon Nelson 
44856a62fc8SJesse Brandeburg /* Set NS Proxy Table Entry Command (indirect 0x0105) */
44956a62fc8SJesse Brandeburg struct i40e_aqc_ns_proxy_data {
45056a62fc8SJesse Brandeburg 	__le16	table_idx_mac_addr_0;
45156a62fc8SJesse Brandeburg 	__le16	table_idx_mac_addr_1;
45256a62fc8SJesse Brandeburg 	__le16	table_idx_ipv6_0;
45356a62fc8SJesse Brandeburg 	__le16	table_idx_ipv6_1;
45456a62fc8SJesse Brandeburg 	__le16	control;
45556a62fc8SJesse Brandeburg 	u8	mac_addr_0[6];
45656a62fc8SJesse Brandeburg 	u8	mac_addr_1[6];
45756a62fc8SJesse Brandeburg 	u8	local_mac_addr[6];
45856a62fc8SJesse Brandeburg 	u8	ipv6_addr_0[16]; /* Warning! spec specifies BE byte order */
45956a62fc8SJesse Brandeburg 	u8	ipv6_addr_1[16];
46056a62fc8SJesse Brandeburg };
46156a62fc8SJesse Brandeburg 
4628d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x3c, i40e_aqc_ns_proxy_data);
4638d5e33adSShannon Nelson 
46456a62fc8SJesse Brandeburg /* Manage LAA Command (0x0106) - obsolete */
46556a62fc8SJesse Brandeburg struct i40e_aqc_mng_laa {
46656a62fc8SJesse Brandeburg 	__le16	command_flags;
46756a62fc8SJesse Brandeburg 	u8	reserved[2];
46856a62fc8SJesse Brandeburg 	__le32	sal;
46956a62fc8SJesse Brandeburg 	__le16	sah;
47056a62fc8SJesse Brandeburg 	u8	reserved2[6];
47156a62fc8SJesse Brandeburg };
47256a62fc8SJesse Brandeburg 
4738d5e33adSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_mng_laa);
4748d5e33adSShannon Nelson 
475981b7545SShannon Nelson /* Manage MAC Address Read Command (indirect 0x0107) */
47656a62fc8SJesse Brandeburg struct i40e_aqc_mac_address_read {
47756a62fc8SJesse Brandeburg 	__le16	command_flags;
47856a62fc8SJesse Brandeburg #define I40E_AQC_LAN_ADDR_VALID		0x10
47956a62fc8SJesse Brandeburg #define I40E_AQC_PORT_ADDR_VALID	0x40
48056a62fc8SJesse Brandeburg 	u8	reserved[6];
48156a62fc8SJesse Brandeburg 	__le32	addr_high;
48256a62fc8SJesse Brandeburg 	__le32	addr_low;
48356a62fc8SJesse Brandeburg };
48456a62fc8SJesse Brandeburg 
48556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_mac_address_read);
48656a62fc8SJesse Brandeburg 
48756a62fc8SJesse Brandeburg struct i40e_aqc_mac_address_read_data {
48856a62fc8SJesse Brandeburg 	u8 pf_lan_mac[6];
48956a62fc8SJesse Brandeburg 	u8 pf_san_mac[6];
49056a62fc8SJesse Brandeburg 	u8 port_mac[6];
49156a62fc8SJesse Brandeburg 	u8 pf_wol_mac[6];
49256a62fc8SJesse Brandeburg };
49356a62fc8SJesse Brandeburg 
49456a62fc8SJesse Brandeburg I40E_CHECK_STRUCT_LEN(24, i40e_aqc_mac_address_read_data);
49556a62fc8SJesse Brandeburg 
49656a62fc8SJesse Brandeburg /* Manage MAC Address Write Command (0x0108) */
49756a62fc8SJesse Brandeburg struct i40e_aqc_mac_address_write {
49856a62fc8SJesse Brandeburg 	__le16	command_flags;
4991d68005dSJoshua Hay #define I40E_AQC_MC_MAG_EN		0x0100
5001d68005dSJoshua Hay #define I40E_AQC_WOL_PRESERVE_ON_PFR	0x0200
50156a62fc8SJesse Brandeburg #define I40E_AQC_WRITE_TYPE_LAA_ONLY	0x0000
50256a62fc8SJesse Brandeburg #define I40E_AQC_WRITE_TYPE_LAA_WOL	0x4000
503cb2f65bcSGreg Rose #define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG	0xC000
504cb2f65bcSGreg Rose 
50556a62fc8SJesse Brandeburg 	__le16	mac_sah;
50656a62fc8SJesse Brandeburg 	__le32	mac_sal;
50756a62fc8SJesse Brandeburg 	u8	reserved[8];
50856a62fc8SJesse Brandeburg };
50956a62fc8SJesse Brandeburg 
51056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_mac_address_write);
51156a62fc8SJesse Brandeburg 
512981b7545SShannon Nelson /* PXE commands (0x011x) */
513981b7545SShannon Nelson 
514981b7545SShannon Nelson /* Clear PXE Command and response  (direct 0x0110) */
515981b7545SShannon Nelson struct i40e_aqc_clear_pxe {
516981b7545SShannon Nelson 	u8	rx_cnt;
517981b7545SShannon Nelson 	u8	reserved[15];
518981b7545SShannon Nelson };
519981b7545SShannon Nelson 
520981b7545SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_clear_pxe);
521981b7545SShannon Nelson 
522d60be2caSShannon Nelson /* Set WoL Filter (0x0120) */
523d60be2caSShannon Nelson 
524d60be2caSShannon Nelson struct i40e_aqc_set_wol_filter {
525d60be2caSShannon Nelson 	__le16 filter_index;
526d60be2caSShannon Nelson 
527d60be2caSShannon Nelson 	__le16 cmd_flags;
528d60be2caSShannon Nelson 	__le16 valid_flags;
529d60be2caSShannon Nelson 	u8 reserved[2];
530d60be2caSShannon Nelson 	__le32	address_high;
531d60be2caSShannon Nelson 	__le32	address_low;
532d60be2caSShannon Nelson };
533d60be2caSShannon Nelson 
534d60be2caSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_set_wol_filter);
535d60be2caSShannon Nelson 
536d60be2caSShannon Nelson struct i40e_aqc_set_wol_filter_data {
537d60be2caSShannon Nelson 	u8 filter[128];
538d60be2caSShannon Nelson 	u8 mask[16];
539d60be2caSShannon Nelson };
540d60be2caSShannon Nelson 
541d60be2caSShannon Nelson I40E_CHECK_STRUCT_LEN(0x90, i40e_aqc_set_wol_filter_data);
542d60be2caSShannon Nelson 
543d60be2caSShannon Nelson /* Get Wake Reason (0x0121) */
544d60be2caSShannon Nelson 
545d60be2caSShannon Nelson struct i40e_aqc_get_wake_reason_completion {
546d60be2caSShannon Nelson 	u8 reserved_1[2];
547d60be2caSShannon Nelson 	__le16 wake_reason;
548d60be2caSShannon Nelson 	u8 reserved_2[12];
549d60be2caSShannon Nelson };
550d60be2caSShannon Nelson 
551d60be2caSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_get_wake_reason_completion);
552d60be2caSShannon Nelson 
55356a62fc8SJesse Brandeburg /* Switch configuration commands (0x02xx) */
55456a62fc8SJesse Brandeburg 
55556a62fc8SJesse Brandeburg /* Used by many indirect commands that only pass an seid and a buffer in the
55656a62fc8SJesse Brandeburg  * command
55756a62fc8SJesse Brandeburg  */
55856a62fc8SJesse Brandeburg struct i40e_aqc_switch_seid {
55956a62fc8SJesse Brandeburg 	__le16	seid;
56056a62fc8SJesse Brandeburg 	u8	reserved[6];
56156a62fc8SJesse Brandeburg 	__le32	addr_high;
56256a62fc8SJesse Brandeburg 	__le32	addr_low;
56356a62fc8SJesse Brandeburg };
56456a62fc8SJesse Brandeburg 
56556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_switch_seid);
56656a62fc8SJesse Brandeburg 
56756a62fc8SJesse Brandeburg /* Get Switch Configuration command (indirect 0x0200)
56856a62fc8SJesse Brandeburg  * uses i40e_aqc_switch_seid for the descriptor
56956a62fc8SJesse Brandeburg  */
57056a62fc8SJesse Brandeburg struct i40e_aqc_get_switch_config_header_resp {
57156a62fc8SJesse Brandeburg 	__le16	num_reported;
57256a62fc8SJesse Brandeburg 	__le16	num_total;
57356a62fc8SJesse Brandeburg 	u8	reserved[12];
57456a62fc8SJesse Brandeburg };
57556a62fc8SJesse Brandeburg 
5768d5e33adSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_get_switch_config_header_resp);
5778d5e33adSShannon Nelson 
57856a62fc8SJesse Brandeburg struct i40e_aqc_switch_config_element_resp {
57956a62fc8SJesse Brandeburg 	u8	element_type;
58056a62fc8SJesse Brandeburg 	u8	revision;
58156a62fc8SJesse Brandeburg 	__le16	seid;
58256a62fc8SJesse Brandeburg 	__le16	uplink_seid;
58356a62fc8SJesse Brandeburg 	__le16	downlink_seid;
58456a62fc8SJesse Brandeburg 	u8	reserved[3];
58556a62fc8SJesse Brandeburg 	u8	connection_type;
58656a62fc8SJesse Brandeburg 	__le16	scheduler_id;
58756a62fc8SJesse Brandeburg 	__le16	element_info;
58856a62fc8SJesse Brandeburg };
58956a62fc8SJesse Brandeburg 
5908d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_config_element_resp);
5918d5e33adSShannon Nelson 
59256a62fc8SJesse Brandeburg /* Get Switch Configuration (indirect 0x0200)
59356a62fc8SJesse Brandeburg  *    an array of elements are returned in the response buffer
59456a62fc8SJesse Brandeburg  *    the first in the array is the header, remainder are elements
59556a62fc8SJesse Brandeburg  */
59656a62fc8SJesse Brandeburg struct i40e_aqc_get_switch_config_resp {
59756a62fc8SJesse Brandeburg 	struct i40e_aqc_get_switch_config_header_resp	header;
59856a62fc8SJesse Brandeburg 	struct i40e_aqc_switch_config_element_resp	element[1];
59956a62fc8SJesse Brandeburg };
60056a62fc8SJesse Brandeburg 
6018d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_switch_config_resp);
6028d5e33adSShannon Nelson 
60356a62fc8SJesse Brandeburg /* Add Statistics (direct 0x0201)
60456a62fc8SJesse Brandeburg  * Remove Statistics (direct 0x0202)
60556a62fc8SJesse Brandeburg  */
60656a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_statistics {
60756a62fc8SJesse Brandeburg 	__le16	seid;
60856a62fc8SJesse Brandeburg 	__le16	vlan;
60956a62fc8SJesse Brandeburg 	__le16	stat_index;
61056a62fc8SJesse Brandeburg 	u8	reserved[10];
61156a62fc8SJesse Brandeburg };
61256a62fc8SJesse Brandeburg 
61356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_statistics);
61456a62fc8SJesse Brandeburg 
61556a62fc8SJesse Brandeburg /* Set Port Parameters command (direct 0x0203) */
61656a62fc8SJesse Brandeburg struct i40e_aqc_set_port_parameters {
61756a62fc8SJesse Brandeburg 	__le16	command_flags;
61856a62fc8SJesse Brandeburg 	__le16	bad_frame_vsi;
61956a62fc8SJesse Brandeburg 	__le16	default_seid;        /* reserved for command */
62056a62fc8SJesse Brandeburg 	u8	reserved[10];
62156a62fc8SJesse Brandeburg };
62256a62fc8SJesse Brandeburg 
62356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_set_port_parameters);
62456a62fc8SJesse Brandeburg 
62556a62fc8SJesse Brandeburg /* Get Switch Resource Allocation (indirect 0x0204) */
62656a62fc8SJesse Brandeburg struct i40e_aqc_get_switch_resource_alloc {
62756a62fc8SJesse Brandeburg 	u8	num_entries;         /* reserved for command */
62856a62fc8SJesse Brandeburg 	u8	reserved[7];
62956a62fc8SJesse Brandeburg 	__le32	addr_high;
63056a62fc8SJesse Brandeburg 	__le32	addr_low;
63156a62fc8SJesse Brandeburg };
63256a62fc8SJesse Brandeburg 
63356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_get_switch_resource_alloc);
63456a62fc8SJesse Brandeburg 
63556a62fc8SJesse Brandeburg /* expect an array of these structs in the response buffer */
63656a62fc8SJesse Brandeburg struct i40e_aqc_switch_resource_alloc_element_resp {
63756a62fc8SJesse Brandeburg 	u8	resource_type;
63856a62fc8SJesse Brandeburg 	u8	reserved1;
63956a62fc8SJesse Brandeburg 	__le16	guaranteed;
64056a62fc8SJesse Brandeburg 	__le16	total;
64156a62fc8SJesse Brandeburg 	__le16	used;
64256a62fc8SJesse Brandeburg 	__le16	total_unalloced;
64356a62fc8SJesse Brandeburg 	u8	reserved2[6];
64456a62fc8SJesse Brandeburg };
64556a62fc8SJesse Brandeburg 
6468d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_resource_alloc_element_resp);
6478d5e33adSShannon Nelson 
648fa5623a6SShannon Nelson /* Set Switch Configuration (direct 0x0205) */
649fa5623a6SShannon Nelson struct i40e_aqc_set_switch_config {
650fa5623a6SShannon Nelson 	__le16	flags;
651d60be2caSShannon Nelson /* flags used for both fields below */
652fa5623a6SShannon Nelson #define I40E_AQ_SET_SWITCH_CFG_PROMISC		0x0001
653fa5623a6SShannon Nelson 	__le16	valid_flags;
654ab243ec9SScott Peterson 	/* The ethertype in switch_tag is dropped on ingress and used
655ab243ec9SScott Peterson 	 * internally by the switch. Set this to zero for the default
656ab243ec9SScott Peterson 	 * of 0x88a8 (802.1ad). Should be zero for firmware API
657ab243ec9SScott Peterson 	 * versions lower than 1.7.
658ab243ec9SScott Peterson 	 */
659ab243ec9SScott Peterson 	__le16	switch_tag;
660ab243ec9SScott Peterson 	/* The ethertypes in first_tag and second_tag are used to
661ab243ec9SScott Peterson 	 * match the outer and inner VLAN tags (respectively) when HW
662ab243ec9SScott Peterson 	 * double VLAN tagging is enabled via the set port parameters
663ab243ec9SScott Peterson 	 * AQ command. Otherwise these are both ignored. Set them to
664ab243ec9SScott Peterson 	 * zero for their defaults of 0x8100 (802.1Q). Should be zero
665ab243ec9SScott Peterson 	 * for firmware API versions lower than 1.7.
666ab243ec9SScott Peterson 	 */
667ab243ec9SScott Peterson 	__le16	first_tag;
668ab243ec9SScott Peterson 	__le16	second_tag;
6695efe0c6cSAmritha Nambiar 	/* Next byte is split into following:
6705efe0c6cSAmritha Nambiar 	 * Bit 7    : 0 : No action, 1: Switch to mode defined by bits 6:0
6715efe0c6cSAmritha Nambiar 	 * Bit 6    : 0 : Destination Port, 1: source port
6725efe0c6cSAmritha Nambiar 	 * Bit 5..4 : L4 type
6735efe0c6cSAmritha Nambiar 	 * 0: rsvd
6745efe0c6cSAmritha Nambiar 	 * 1: TCP
6755efe0c6cSAmritha Nambiar 	 * 2: UDP
6765efe0c6cSAmritha Nambiar 	 * 3: Both TCP and UDP
6775efe0c6cSAmritha Nambiar 	 * Bits 3:0 Mode
6785efe0c6cSAmritha Nambiar 	 * 0: default mode
6795efe0c6cSAmritha Nambiar 	 * 1: L4 port only mode
6805efe0c6cSAmritha Nambiar 	 * 2: non-tunneled mode
6815efe0c6cSAmritha Nambiar 	 * 3: tunneled mode
6825efe0c6cSAmritha Nambiar 	 */
6835efe0c6cSAmritha Nambiar #define I40E_AQ_SET_SWITCH_BIT7_VALID		0x80
6845efe0c6cSAmritha Nambiar 
6855efe0c6cSAmritha Nambiar 
6865efe0c6cSAmritha Nambiar #define I40E_AQ_SET_SWITCH_L4_TYPE_TCP		0x10
6875efe0c6cSAmritha Nambiar 
6885efe0c6cSAmritha Nambiar #define I40E_AQ_SET_SWITCH_MODE_NON_TUNNEL	0x02
6895efe0c6cSAmritha Nambiar 	u8	mode;
6905efe0c6cSAmritha Nambiar 	u8	rsvd5[5];
691fa5623a6SShannon Nelson };
692fa5623a6SShannon Nelson 
693fa5623a6SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_set_switch_config);
694fa5623a6SShannon Nelson 
69533365143SShannon Nelson /* Read Receive control registers  (direct 0x0206)
69633365143SShannon Nelson  * Write Receive control registers (direct 0x0207)
69733365143SShannon Nelson  *     used for accessing Rx control registers that can be
69833365143SShannon Nelson  *     slow and need special handling when under high Rx load
69933365143SShannon Nelson  */
70033365143SShannon Nelson struct i40e_aqc_rx_ctl_reg_read_write {
70133365143SShannon Nelson 	__le32 reserved1;
70233365143SShannon Nelson 	__le32 address;
70333365143SShannon Nelson 	__le32 reserved2;
70433365143SShannon Nelson 	__le32 value;
70533365143SShannon Nelson };
70633365143SShannon Nelson 
70733365143SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_rx_ctl_reg_read_write);
70833365143SShannon Nelson 
709981b7545SShannon Nelson /* Add VSI (indirect 0x0210)
71056a62fc8SJesse Brandeburg  *    this indirect command uses struct i40e_aqc_vsi_properties_data
71156a62fc8SJesse Brandeburg  *    as the indirect buffer (128 bytes)
71256a62fc8SJesse Brandeburg  *
713981b7545SShannon Nelson  * Update VSI (indirect 0x211)
714981b7545SShannon Nelson  *     uses the same data structure as Add VSI
715981b7545SShannon Nelson  *
716981b7545SShannon Nelson  * Get VSI (indirect 0x0212)
717981b7545SShannon Nelson  *     uses the same completion and data structure as Add VSI
71856a62fc8SJesse Brandeburg  */
71956a62fc8SJesse Brandeburg struct i40e_aqc_add_get_update_vsi {
72056a62fc8SJesse Brandeburg 	__le16	uplink_seid;
72156a62fc8SJesse Brandeburg 	u8	connection_type;
72256a62fc8SJesse Brandeburg #define I40E_AQ_VSI_CONN_TYPE_NORMAL	0x1
72356a62fc8SJesse Brandeburg 	u8	reserved1;
72456a62fc8SJesse Brandeburg 	u8	vf_id;
72556a62fc8SJesse Brandeburg 	u8	reserved2;
72656a62fc8SJesse Brandeburg 	__le16	vsi_flags;
72756a62fc8SJesse Brandeburg #define I40E_AQ_VSI_TYPE_VF		0x0
72856a62fc8SJesse Brandeburg #define I40E_AQ_VSI_TYPE_VMDQ2		0x1
72956a62fc8SJesse Brandeburg #define I40E_AQ_VSI_TYPE_PF		0x2
73056a62fc8SJesse Brandeburg 	__le32	addr_high;
73156a62fc8SJesse Brandeburg 	__le32	addr_low;
73256a62fc8SJesse Brandeburg };
73356a62fc8SJesse Brandeburg 
73456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_get_update_vsi);
73556a62fc8SJesse Brandeburg 
73656a62fc8SJesse Brandeburg struct i40e_aqc_add_get_update_vsi_completion {
73756a62fc8SJesse Brandeburg 	__le16 seid;
73856a62fc8SJesse Brandeburg 	__le16 vsi_number;
73956a62fc8SJesse Brandeburg 	__le16 vsi_used;
74056a62fc8SJesse Brandeburg 	__le16 vsi_free;
74156a62fc8SJesse Brandeburg 	__le32 addr_high;
74256a62fc8SJesse Brandeburg 	__le32 addr_low;
74356a62fc8SJesse Brandeburg };
74456a62fc8SJesse Brandeburg 
74556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_get_update_vsi_completion);
74656a62fc8SJesse Brandeburg 
74756a62fc8SJesse Brandeburg struct i40e_aqc_vsi_properties_data {
74856a62fc8SJesse Brandeburg 	/* first 96 byte are written by SW */
74956a62fc8SJesse Brandeburg 	__le16	valid_sections;
75056a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PROP_SWITCH_VALID		0x0001
75156a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PROP_SECURITY_VALID		0x0002
75256a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PROP_VLAN_VALID		0x0004
75356a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PROP_QUEUE_MAP_VALID	0x0040
75456a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PROP_QUEUE_OPT_VALID	0x0080
75556a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PROP_SCHED_VALID		0x0200
75656a62fc8SJesse Brandeburg 	/* switch section */
75756a62fc8SJesse Brandeburg 	__le16	switch_id; /* 12bit id combined with flags below */
75856a62fc8SJesse Brandeburg #define I40E_AQ_VSI_SW_ID_SHIFT		0x0000
75956a62fc8SJesse Brandeburg #define I40E_AQ_VSI_SW_ID_MASK		(0xFFF << I40E_AQ_VSI_SW_ID_SHIFT)
76056a62fc8SJesse Brandeburg #define I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB	0x2000
76156a62fc8SJesse Brandeburg #define I40E_AQ_VSI_SW_ID_FLAG_LOCAL_LB	0x4000
76256a62fc8SJesse Brandeburg 	u8	sw_reserved[2];
76356a62fc8SJesse Brandeburg 	/* security section */
76456a62fc8SJesse Brandeburg 	u8	sec_flags;
76556a62fc8SJesse Brandeburg #define I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK	0x02
76656a62fc8SJesse Brandeburg #define I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK	0x04
76756a62fc8SJesse Brandeburg 	u8	sec_reserved;
76856a62fc8SJesse Brandeburg 	/* VLAN section */
76956a62fc8SJesse Brandeburg 	__le16	pvid; /* VLANS include priority bits */
77056a62fc8SJesse Brandeburg 	__le16	fcoe_pvid;
77156a62fc8SJesse Brandeburg 	u8	port_vlan_flags;
77256a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_MODE_SHIFT	0x00
77356a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_MODE_MASK	(0x03 << \
77456a62fc8SJesse Brandeburg 					 I40E_AQ_VSI_PVLAN_MODE_SHIFT)
77556a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_MODE_TAGGED	0x01
77656a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_MODE_ALL	0x03
77756a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_INSERT_PVID	0x04
77856a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_EMOD_SHIFT	0x03
77956a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_EMOD_MASK	(0x3 << \
78056a62fc8SJesse Brandeburg 					 I40E_AQ_VSI_PVLAN_EMOD_SHIFT)
78156a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH	0x0
78256a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_EMOD_STR	0x10
78356a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING	0x18
78456a62fc8SJesse Brandeburg 	u8	pvlan_reserved[3];
78556a62fc8SJesse Brandeburg 	/* ingress egress up sections */
78656a62fc8SJesse Brandeburg 	__le32	ingress_table; /* bitmap, 3 bits per up */
78756a62fc8SJesse Brandeburg 	__le32	egress_table;   /* same defines as for ingress table */
78856a62fc8SJesse Brandeburg 	/* cascaded PV section */
78956a62fc8SJesse Brandeburg 	__le16	cas_pv_tag;
79056a62fc8SJesse Brandeburg 	u8	cas_pv_flags;
79156a62fc8SJesse Brandeburg 	u8	cas_pv_reserved;
79256a62fc8SJesse Brandeburg 	/* queue mapping section */
79356a62fc8SJesse Brandeburg 	__le16	mapping_flags;
79456a62fc8SJesse Brandeburg #define I40E_AQ_VSI_QUE_MAP_CONTIG	0x0
79556a62fc8SJesse Brandeburg #define I40E_AQ_VSI_QUE_MAP_NONCONTIG	0x1
79656a62fc8SJesse Brandeburg 	__le16	queue_mapping[16];
79756a62fc8SJesse Brandeburg 	__le16	tc_mapping[8];
79856a62fc8SJesse Brandeburg #define I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT	0
79956a62fc8SJesse Brandeburg #define I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT	9
80056a62fc8SJesse Brandeburg 	/* queueing option section */
80156a62fc8SJesse Brandeburg 	u8	queueing_opt_flags;
80256a62fc8SJesse Brandeburg #define I40E_AQ_VSI_QUE_OPT_TCP_ENA	0x10
803e50c8d6dSAnjali Singhai Jain #define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI	0x40
80456a62fc8SJesse Brandeburg 	u8	queueing_opt_reserved[3];
80556a62fc8SJesse Brandeburg 	/* scheduler section */
80656a62fc8SJesse Brandeburg 	u8	up_enable_bits;
80756a62fc8SJesse Brandeburg 	u8	sched_reserved;
80856a62fc8SJesse Brandeburg 	/* outer up section */
8098c570dccSJeff Kirsher 	__le32	outer_up_table; /* same structure and defines as ingress tbl */
81056a62fc8SJesse Brandeburg 	u8	cmd_reserved[8];
81156a62fc8SJesse Brandeburg 	/* last 32 bytes are written by FW */
81256a62fc8SJesse Brandeburg 	__le16	qs_handle[8];
81356a62fc8SJesse Brandeburg #define I40E_AQ_VSI_QS_HANDLE_INVALID	0xFFFF
81456a62fc8SJesse Brandeburg 	__le16	stat_counter_idx;
81556a62fc8SJesse Brandeburg 	__le16	sched_id;
81656a62fc8SJesse Brandeburg 	u8	resp_reserved[12];
81756a62fc8SJesse Brandeburg };
81856a62fc8SJesse Brandeburg 
81956a62fc8SJesse Brandeburg I40E_CHECK_STRUCT_LEN(128, i40e_aqc_vsi_properties_data);
82056a62fc8SJesse Brandeburg 
82156a62fc8SJesse Brandeburg /* Add Port Virtualizer (direct 0x0220)
82256a62fc8SJesse Brandeburg  * also used for update PV (direct 0x0221) but only flags are used
82356a62fc8SJesse Brandeburg  * (IS_CTRL_PORT only works on add PV)
82456a62fc8SJesse Brandeburg  */
82556a62fc8SJesse Brandeburg struct i40e_aqc_add_update_pv {
82656a62fc8SJesse Brandeburg 	__le16	command_flags;
82756a62fc8SJesse Brandeburg 	__le16	uplink_seid;
82856a62fc8SJesse Brandeburg 	__le16	connected_seid;
82956a62fc8SJesse Brandeburg 	u8	reserved[10];
83056a62fc8SJesse Brandeburg };
83156a62fc8SJesse Brandeburg 
83256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_update_pv);
83356a62fc8SJesse Brandeburg 
83456a62fc8SJesse Brandeburg struct i40e_aqc_add_update_pv_completion {
83556a62fc8SJesse Brandeburg 	/* reserved for update; for add also encodes error if rc == ENOSPC */
83656a62fc8SJesse Brandeburg 	__le16	pv_seid;
83756a62fc8SJesse Brandeburg 	u8	reserved[14];
83856a62fc8SJesse Brandeburg };
83956a62fc8SJesse Brandeburg 
84056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_update_pv_completion);
84156a62fc8SJesse Brandeburg 
84256a62fc8SJesse Brandeburg /* Get PV Params (direct 0x0222)
84356a62fc8SJesse Brandeburg  * uses i40e_aqc_switch_seid for the descriptor
84456a62fc8SJesse Brandeburg  */
84556a62fc8SJesse Brandeburg 
84656a62fc8SJesse Brandeburg struct i40e_aqc_get_pv_params_completion {
84756a62fc8SJesse Brandeburg 	__le16	seid;
84856a62fc8SJesse Brandeburg 	__le16	default_stag;
84956a62fc8SJesse Brandeburg 	__le16	pv_flags; /* same flags as add_pv */
85056a62fc8SJesse Brandeburg 	u8	reserved[8];
85156a62fc8SJesse Brandeburg 	__le16	default_port_seid;
85256a62fc8SJesse Brandeburg };
85356a62fc8SJesse Brandeburg 
85456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_get_pv_params_completion);
85556a62fc8SJesse Brandeburg 
85656a62fc8SJesse Brandeburg /* Add VEB (direct 0x0230) */
85756a62fc8SJesse Brandeburg struct i40e_aqc_add_veb {
85856a62fc8SJesse Brandeburg 	__le16	uplink_seid;
85956a62fc8SJesse Brandeburg 	__le16	downlink_seid;
86056a62fc8SJesse Brandeburg 	__le16	veb_flags;
86156a62fc8SJesse Brandeburg #define I40E_AQC_ADD_VEB_FLOATING		0x1
86256a62fc8SJesse Brandeburg #define I40E_AQC_ADD_VEB_PORT_TYPE_DEFAULT	0x2
86356a62fc8SJesse Brandeburg #define I40E_AQC_ADD_VEB_PORT_TYPE_DATA		0x4
864fa5623a6SShannon Nelson #define I40E_AQC_ADD_VEB_ENABLE_DISABLE_STATS	0x10
86556a62fc8SJesse Brandeburg 	u8	enable_tcs;
86656a62fc8SJesse Brandeburg 	u8	reserved[9];
86756a62fc8SJesse Brandeburg };
86856a62fc8SJesse Brandeburg 
86956a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_veb);
87056a62fc8SJesse Brandeburg 
87156a62fc8SJesse Brandeburg struct i40e_aqc_add_veb_completion {
87256a62fc8SJesse Brandeburg 	u8	reserved[6];
87356a62fc8SJesse Brandeburg 	__le16	switch_seid;
87456a62fc8SJesse Brandeburg 	/* also encodes error if rc == ENOSPC; codes are the same as add_pv */
87556a62fc8SJesse Brandeburg 	__le16	veb_seid;
87656a62fc8SJesse Brandeburg 	__le16	statistic_index;
87756a62fc8SJesse Brandeburg 	__le16	vebs_used;
87856a62fc8SJesse Brandeburg 	__le16	vebs_free;
87956a62fc8SJesse Brandeburg };
88056a62fc8SJesse Brandeburg 
88156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_veb_completion);
88256a62fc8SJesse Brandeburg 
88356a62fc8SJesse Brandeburg /* Get VEB Parameters (direct 0x0232)
88456a62fc8SJesse Brandeburg  * uses i40e_aqc_switch_seid for the descriptor
88556a62fc8SJesse Brandeburg  */
88656a62fc8SJesse Brandeburg struct i40e_aqc_get_veb_parameters_completion {
88756a62fc8SJesse Brandeburg 	__le16	seid;
88856a62fc8SJesse Brandeburg 	__le16	switch_id;
88956a62fc8SJesse Brandeburg 	__le16	veb_flags; /* only the first/last flags from 0x0230 is valid */
89056a62fc8SJesse Brandeburg 	__le16	statistic_index;
89156a62fc8SJesse Brandeburg 	__le16	vebs_used;
89256a62fc8SJesse Brandeburg 	__le16	vebs_free;
89356a62fc8SJesse Brandeburg 	u8	reserved[4];
89456a62fc8SJesse Brandeburg };
89556a62fc8SJesse Brandeburg 
89656a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_get_veb_parameters_completion);
89756a62fc8SJesse Brandeburg 
89856a62fc8SJesse Brandeburg /* Delete Element (direct 0x0243)
89956a62fc8SJesse Brandeburg  * uses the generic i40e_aqc_switch_seid
90056a62fc8SJesse Brandeburg  */
90156a62fc8SJesse Brandeburg 
90256a62fc8SJesse Brandeburg /* Add MAC-VLAN (indirect 0x0250) */
90356a62fc8SJesse Brandeburg 
90456a62fc8SJesse Brandeburg /* used for the command for most vlan commands */
90556a62fc8SJesse Brandeburg struct i40e_aqc_macvlan {
90656a62fc8SJesse Brandeburg 	__le16	num_addresses;
90756a62fc8SJesse Brandeburg 	__le16	seid[3];
90856a62fc8SJesse Brandeburg #define I40E_AQC_MACVLAN_CMD_SEID_VALID		0x8000
90956a62fc8SJesse Brandeburg 	__le32	addr_high;
91056a62fc8SJesse Brandeburg 	__le32	addr_low;
91156a62fc8SJesse Brandeburg };
91256a62fc8SJesse Brandeburg 
91356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_macvlan);
91456a62fc8SJesse Brandeburg 
91556a62fc8SJesse Brandeburg /* indirect data for command and response */
91656a62fc8SJesse Brandeburg struct i40e_aqc_add_macvlan_element_data {
91756a62fc8SJesse Brandeburg 	u8	mac_addr[6];
91856a62fc8SJesse Brandeburg 	__le16	vlan_tag;
91956a62fc8SJesse Brandeburg 	__le16	flags;
92056a62fc8SJesse Brandeburg #define I40E_AQC_MACVLAN_ADD_PERFECT_MATCH	0x0001
92156a62fc8SJesse Brandeburg #define I40E_AQC_MACVLAN_ADD_IGNORE_VLAN	0x0004
92290680779SShannon Nelson #define I40E_AQC_MACVLAN_ADD_USE_SHARED_MAC	0x0010
92356a62fc8SJesse Brandeburg 	__le16	queue_number;
92456a62fc8SJesse Brandeburg 	/* response section */
92556a62fc8SJesse Brandeburg 	u8	match_method;
92656a62fc8SJesse Brandeburg #define I40E_AQC_MM_ERR_NO_RES		0xFF
92756a62fc8SJesse Brandeburg 	u8	reserved1[3];
92856a62fc8SJesse Brandeburg };
92956a62fc8SJesse Brandeburg 
93056a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_macvlan_completion {
93156a62fc8SJesse Brandeburg 	__le16 perfect_mac_used;
93256a62fc8SJesse Brandeburg 	__le16 perfect_mac_free;
93356a62fc8SJesse Brandeburg 	__le16 unicast_hash_free;
93456a62fc8SJesse Brandeburg 	__le16 multicast_hash_free;
93556a62fc8SJesse Brandeburg 	__le32 addr_high;
93656a62fc8SJesse Brandeburg 	__le32 addr_low;
93756a62fc8SJesse Brandeburg };
93856a62fc8SJesse Brandeburg 
93956a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_macvlan_completion);
94056a62fc8SJesse Brandeburg 
94156a62fc8SJesse Brandeburg /* Remove MAC-VLAN (indirect 0x0251)
94256a62fc8SJesse Brandeburg  * uses i40e_aqc_macvlan for the descriptor
94356a62fc8SJesse Brandeburg  * data points to an array of num_addresses of elements
94456a62fc8SJesse Brandeburg  */
94556a62fc8SJesse Brandeburg 
94656a62fc8SJesse Brandeburg struct i40e_aqc_remove_macvlan_element_data {
94756a62fc8SJesse Brandeburg 	u8	mac_addr[6];
94856a62fc8SJesse Brandeburg 	__le16	vlan_tag;
94956a62fc8SJesse Brandeburg 	u8	flags;
95056a62fc8SJesse Brandeburg #define I40E_AQC_MACVLAN_DEL_PERFECT_MATCH	0x01
95156a62fc8SJesse Brandeburg #define I40E_AQC_MACVLAN_DEL_IGNORE_VLAN	0x08
95256a62fc8SJesse Brandeburg 	u8	reserved[3];
95356a62fc8SJesse Brandeburg 	/* reply section */
95456a62fc8SJesse Brandeburg 	u8	error_code;
95556a62fc8SJesse Brandeburg 	u8	reply_reserved[3];
95656a62fc8SJesse Brandeburg };
95756a62fc8SJesse Brandeburg 
95856a62fc8SJesse Brandeburg /* Add VLAN (indirect 0x0252)
95956a62fc8SJesse Brandeburg  * Remove VLAN (indirect 0x0253)
96056a62fc8SJesse Brandeburg  * use the generic i40e_aqc_macvlan for the command
96156a62fc8SJesse Brandeburg  */
96256a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_vlan_element_data {
96356a62fc8SJesse Brandeburg 	__le16	vlan_tag;
96456a62fc8SJesse Brandeburg 	u8	vlan_flags;
96556a62fc8SJesse Brandeburg 	u8	reserved;
96656a62fc8SJesse Brandeburg 	u8	result;
96756a62fc8SJesse Brandeburg 	u8	reserved1[3];
96856a62fc8SJesse Brandeburg };
96956a62fc8SJesse Brandeburg 
97056a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_vlan_completion {
97156a62fc8SJesse Brandeburg 	u8	reserved[4];
97256a62fc8SJesse Brandeburg 	__le16	vlans_used;
97356a62fc8SJesse Brandeburg 	__le16	vlans_free;
97456a62fc8SJesse Brandeburg 	__le32	addr_high;
97556a62fc8SJesse Brandeburg 	__le32	addr_low;
97656a62fc8SJesse Brandeburg };
97756a62fc8SJesse Brandeburg 
97856a62fc8SJesse Brandeburg /* Set VSI Promiscuous Modes (direct 0x0254) */
97956a62fc8SJesse Brandeburg struct i40e_aqc_set_vsi_promiscuous_modes {
98056a62fc8SJesse Brandeburg 	__le16	promiscuous_flags;
98156a62fc8SJesse Brandeburg 	__le16	valid_flags;
98256a62fc8SJesse Brandeburg /* flags used for both fields above */
98356a62fc8SJesse Brandeburg #define I40E_AQC_SET_VSI_PROMISC_UNICAST	0x01
98456a62fc8SJesse Brandeburg #define I40E_AQC_SET_VSI_PROMISC_MULTICAST	0x02
98556a62fc8SJesse Brandeburg #define I40E_AQC_SET_VSI_PROMISC_BROADCAST	0x04
98656a62fc8SJesse Brandeburg #define I40E_AQC_SET_VSI_DEFAULT		0x08
98756a62fc8SJesse Brandeburg #define I40E_AQC_SET_VSI_PROMISC_VLAN		0x10
9884bd5e02aSPrzemyslaw Patynowski #define I40E_AQC_SET_VSI_PROMISC_RX_ONLY	0x8000
98956a62fc8SJesse Brandeburg 	__le16	seid;
9900aebd2d9SShannon Nelson 	__le16	vlan_tag;
9910aebd2d9SShannon Nelson #define I40E_AQC_SET_VSI_VLAN_VALID		0x8000
9920aebd2d9SShannon Nelson 	u8	reserved[8];
99356a62fc8SJesse Brandeburg };
99456a62fc8SJesse Brandeburg 
99556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_set_vsi_promiscuous_modes);
99656a62fc8SJesse Brandeburg 
99756a62fc8SJesse Brandeburg /* Add S/E-tag command (direct 0x0255)
99856a62fc8SJesse Brandeburg  * Uses generic i40e_aqc_add_remove_tag_completion for completion
99956a62fc8SJesse Brandeburg  */
100056a62fc8SJesse Brandeburg struct i40e_aqc_add_tag {
100156a62fc8SJesse Brandeburg 	__le16	flags;
100256a62fc8SJesse Brandeburg 	__le16	seid;
100356a62fc8SJesse Brandeburg 	__le16	tag;
100456a62fc8SJesse Brandeburg 	__le16	queue_number;
100556a62fc8SJesse Brandeburg 	u8	reserved[8];
100656a62fc8SJesse Brandeburg };
100756a62fc8SJesse Brandeburg 
100856a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_tag);
100956a62fc8SJesse Brandeburg 
101056a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_tag_completion {
101156a62fc8SJesse Brandeburg 	u8	reserved[12];
101256a62fc8SJesse Brandeburg 	__le16	tags_used;
101356a62fc8SJesse Brandeburg 	__le16	tags_free;
101456a62fc8SJesse Brandeburg };
101556a62fc8SJesse Brandeburg 
101656a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_tag_completion);
101756a62fc8SJesse Brandeburg 
101856a62fc8SJesse Brandeburg /* Remove S/E-tag command (direct 0x0256)
101956a62fc8SJesse Brandeburg  * Uses generic i40e_aqc_add_remove_tag_completion for completion
102056a62fc8SJesse Brandeburg  */
102156a62fc8SJesse Brandeburg struct i40e_aqc_remove_tag {
102256a62fc8SJesse Brandeburg 	__le16	seid;
102356a62fc8SJesse Brandeburg 	__le16	tag;
102456a62fc8SJesse Brandeburg 	u8	reserved[12];
102556a62fc8SJesse Brandeburg };
102656a62fc8SJesse Brandeburg 
10278d5e33adSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_tag);
10288d5e33adSShannon Nelson 
102956a62fc8SJesse Brandeburg /* Add multicast E-Tag (direct 0x0257)
103056a62fc8SJesse Brandeburg  * del multicast E-Tag (direct 0x0258) only uses pv_seid and etag fields
103156a62fc8SJesse Brandeburg  * and no external data
103256a62fc8SJesse Brandeburg  */
103356a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_mcast_etag {
103456a62fc8SJesse Brandeburg 	__le16	pv_seid;
103556a62fc8SJesse Brandeburg 	__le16	etag;
103656a62fc8SJesse Brandeburg 	u8	num_unicast_etags;
103756a62fc8SJesse Brandeburg 	u8	reserved[3];
103856a62fc8SJesse Brandeburg 	__le32	addr_high;          /* address of array of 2-byte s-tags */
103956a62fc8SJesse Brandeburg 	__le32	addr_low;
104056a62fc8SJesse Brandeburg };
104156a62fc8SJesse Brandeburg 
104256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_mcast_etag);
104356a62fc8SJesse Brandeburg 
104456a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_mcast_etag_completion {
104556a62fc8SJesse Brandeburg 	u8	reserved[4];
104656a62fc8SJesse Brandeburg 	__le16	mcast_etags_used;
104756a62fc8SJesse Brandeburg 	__le16	mcast_etags_free;
104856a62fc8SJesse Brandeburg 	__le32	addr_high;
104956a62fc8SJesse Brandeburg 	__le32	addr_low;
105056a62fc8SJesse Brandeburg 
105156a62fc8SJesse Brandeburg };
105256a62fc8SJesse Brandeburg 
105356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_mcast_etag_completion);
105456a62fc8SJesse Brandeburg 
105556a62fc8SJesse Brandeburg /* Update S/E-Tag (direct 0x0259) */
105656a62fc8SJesse Brandeburg struct i40e_aqc_update_tag {
105756a62fc8SJesse Brandeburg 	__le16	seid;
105856a62fc8SJesse Brandeburg 	__le16	old_tag;
105956a62fc8SJesse Brandeburg 	__le16	new_tag;
106056a62fc8SJesse Brandeburg 	u8	reserved[10];
106156a62fc8SJesse Brandeburg };
106256a62fc8SJesse Brandeburg 
106356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_update_tag);
106456a62fc8SJesse Brandeburg 
106556a62fc8SJesse Brandeburg struct i40e_aqc_update_tag_completion {
106656a62fc8SJesse Brandeburg 	u8	reserved[12];
106756a62fc8SJesse Brandeburg 	__le16	tags_used;
106856a62fc8SJesse Brandeburg 	__le16	tags_free;
106956a62fc8SJesse Brandeburg };
107056a62fc8SJesse Brandeburg 
107156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_update_tag_completion);
107256a62fc8SJesse Brandeburg 
107356a62fc8SJesse Brandeburg /* Add Control Packet filter (direct 0x025A)
107456a62fc8SJesse Brandeburg  * Remove Control Packet filter (direct 0x025B)
107556a62fc8SJesse Brandeburg  * uses the i40e_aqc_add_oveb_cloud,
107656a62fc8SJesse Brandeburg  * and the generic direct completion structure
107756a62fc8SJesse Brandeburg  */
107856a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_control_packet_filter {
107956a62fc8SJesse Brandeburg 	u8	mac[6];
108056a62fc8SJesse Brandeburg 	__le16	etype;
108156a62fc8SJesse Brandeburg 	__le16	flags;
108256a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC	0x0001
108356a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP		0x0002
108456a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX		0x0008
108590bc8e00SArkadiusz Kubalewski #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_RX		0x0000
108656a62fc8SJesse Brandeburg 	__le16	seid;
108756a62fc8SJesse Brandeburg 	__le16	queue;
108856a62fc8SJesse Brandeburg 	u8	reserved[2];
108956a62fc8SJesse Brandeburg };
109056a62fc8SJesse Brandeburg 
109156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_control_packet_filter);
109256a62fc8SJesse Brandeburg 
109356a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_control_packet_filter_completion {
109456a62fc8SJesse Brandeburg 	__le16	mac_etype_used;
109556a62fc8SJesse Brandeburg 	__le16	etype_used;
109656a62fc8SJesse Brandeburg 	__le16	mac_etype_free;
109756a62fc8SJesse Brandeburg 	__le16	etype_free;
109856a62fc8SJesse Brandeburg 	u8	reserved[8];
109956a62fc8SJesse Brandeburg };
110056a62fc8SJesse Brandeburg 
110156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_control_packet_filter_completion);
110256a62fc8SJesse Brandeburg 
110356a62fc8SJesse Brandeburg /* Add Cloud filters (indirect 0x025C)
110456a62fc8SJesse Brandeburg  * Remove Cloud filters (indirect 0x025D)
110556a62fc8SJesse Brandeburg  * uses the i40e_aqc_add_remove_cloud_filters,
110656a62fc8SJesse Brandeburg  * and the generic indirect completion structure
110756a62fc8SJesse Brandeburg  */
110856a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_cloud_filters {
110956a62fc8SJesse Brandeburg 	u8	num_filters;
111056a62fc8SJesse Brandeburg 	u8	reserved;
111156a62fc8SJesse Brandeburg 	__le16	seid;
11122c001523SAmritha Nambiar 	u8	big_buffer_flag;
11132c001523SAmritha Nambiar #define I40E_AQC_ADD_CLOUD_CMD_BB	1
11142c001523SAmritha Nambiar 	u8	reserved2[3];
111556a62fc8SJesse Brandeburg 	__le32	addr_high;
111656a62fc8SJesse Brandeburg 	__le32	addr_low;
111756a62fc8SJesse Brandeburg };
111856a62fc8SJesse Brandeburg 
111956a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_cloud_filters);
112056a62fc8SJesse Brandeburg 
11212c001523SAmritha Nambiar struct i40e_aqc_cloud_filters_element_data {
112256a62fc8SJesse Brandeburg 	u8	outer_mac[6];
112356a62fc8SJesse Brandeburg 	u8	inner_mac[6];
112456a62fc8SJesse Brandeburg 	__le16	inner_vlan;
112556a62fc8SJesse Brandeburg 	union {
112656a62fc8SJesse Brandeburg 		struct {
112756a62fc8SJesse Brandeburg 			u8 reserved[12];
112856a62fc8SJesse Brandeburg 			u8 data[4];
112956a62fc8SJesse Brandeburg 		} v4;
113056a62fc8SJesse Brandeburg 		struct {
113156a62fc8SJesse Brandeburg 			u8 data[16];
113256a62fc8SJesse Brandeburg 		} v6;
11332f4b411aSAmritha Nambiar 		struct {
11342f4b411aSAmritha Nambiar 			__le16 data[8];
11352f4b411aSAmritha Nambiar 		} raw_v6;
113656a62fc8SJesse Brandeburg 	} ipaddr;
113756a62fc8SJesse Brandeburg 	__le16	flags;
1138981b7545SShannon Nelson /* 0x0000 reserved */
1139eaa4950cSJacob Keller /* 0x0001 reserved */
1140981b7545SShannon Nelson /* 0x0002 reserved */
114156a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN		0x0003
1142981b7545SShannon Nelson #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN_TEN_ID	0x0004
1143981b7545SShannon Nelson /* 0x0005 reserved */
114456a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_TEN_ID		0x0006
1145981b7545SShannon Nelson /* 0x0007 reserved */
114656a62fc8SJesse Brandeburg /* 0x0008 reserved */
114756a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CLOUD_FILTER_OMAC			0x0009
114856a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CLOUD_FILTER_IMAC			0x000A
1149981b7545SShannon Nelson #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC	0x000B
1150981b7545SShannon Nelson #define I40E_AQC_ADD_CLOUD_FILTER_IIP			0x000C
11513c734bbbSJacob Keller /* 0x000D reserved */
11523c734bbbSJacob Keller /* 0x000E reserved */
11533c734bbbSJacob Keller /* 0x000F reserved */
11542c001523SAmritha Nambiar /* 0x0010 to 0x0017 is for custom filters */
11552c001523SAmritha Nambiar #define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT		0x0010 /* Dest IP + L4 Port */
11562c001523SAmritha Nambiar #define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT		0x0011 /* Dest MAC + L4 Port */
11572c001523SAmritha Nambiar #define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT		0x0012 /* Dest MAC + VLAN + L4 Port */
1158981b7545SShannon Nelson 
115956a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CLOUD_FLAGS_IPV4			0
116056a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CLOUD_FLAGS_IPV6			0x0100
1161981b7545SShannon Nelson 
1162981b7545SShannon Nelson #define I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT		9
1163981b7545SShannon Nelson #define I40E_AQC_ADD_CLOUD_TNL_TYPE_MASK		0x1E00
116459264253SShannon Nelson #define I40E_AQC_ADD_CLOUD_TNL_TYPE_GENEVE		2
1165981b7545SShannon Nelson 
116690680779SShannon Nelson 
1167981b7545SShannon Nelson 	__le32	tenant_id;
1168981b7545SShannon Nelson 	u8	reserved[4];
116956a62fc8SJesse Brandeburg 	__le16	queue_number;
1170981b7545SShannon Nelson 	u8	reserved2[14];
117156a62fc8SJesse Brandeburg 	/* response section */
117256a62fc8SJesse Brandeburg 	u8	allocation_result;
117356a62fc8SJesse Brandeburg 	u8	response_reserved[7];
117456a62fc8SJesse Brandeburg };
117556a62fc8SJesse Brandeburg 
11762c001523SAmritha Nambiar I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_cloud_filters_element_data);
11772c001523SAmritha Nambiar 
11782c001523SAmritha Nambiar /* i40e_aqc_cloud_filters_element_bb is used when
11792c001523SAmritha Nambiar  * I40E_AQC_CLOUD_CMD_BB flag is set.
11802c001523SAmritha Nambiar  */
11812c001523SAmritha Nambiar struct i40e_aqc_cloud_filters_element_bb {
11822c001523SAmritha Nambiar 	struct i40e_aqc_cloud_filters_element_data element;
11832c001523SAmritha Nambiar 	u16     general_fields[32];
11842c001523SAmritha Nambiar #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0	15
11852c001523SAmritha Nambiar };
11862c001523SAmritha Nambiar 
11872c001523SAmritha Nambiar I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_cloud_filters_element_bb);
11882c001523SAmritha Nambiar 
118956a62fc8SJesse Brandeburg struct i40e_aqc_remove_cloud_filters_completion {
119056a62fc8SJesse Brandeburg 	__le16 perfect_ovlan_used;
119156a62fc8SJesse Brandeburg 	__le16 perfect_ovlan_free;
119256a62fc8SJesse Brandeburg 	__le16 vlan_used;
119356a62fc8SJesse Brandeburg 	__le16 vlan_free;
119456a62fc8SJesse Brandeburg 	__le32 addr_high;
119556a62fc8SJesse Brandeburg 	__le32 addr_low;
119656a62fc8SJesse Brandeburg };
119756a62fc8SJesse Brandeburg 
119856a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion);
119956a62fc8SJesse Brandeburg 
12002c001523SAmritha Nambiar /* Replace filter Command 0x025F
12012c001523SAmritha Nambiar  * uses the i40e_aqc_replace_cloud_filters,
12022c001523SAmritha Nambiar  * and the generic indirect completion structure
12032c001523SAmritha Nambiar  */
12042c001523SAmritha Nambiar struct i40e_filter_data {
12052c001523SAmritha Nambiar 	u8 filter_type;
12062c001523SAmritha Nambiar 	u8 input[3];
12072c001523SAmritha Nambiar };
12082c001523SAmritha Nambiar 
12092c001523SAmritha Nambiar I40E_CHECK_STRUCT_LEN(4, i40e_filter_data);
12102c001523SAmritha Nambiar 
12112c001523SAmritha Nambiar struct i40e_aqc_replace_cloud_filters_cmd {
12122c001523SAmritha Nambiar 	u8      valid_flags;
12132c001523SAmritha Nambiar 	u8      old_filter_type;
12142c001523SAmritha Nambiar 	u8      new_filter_type;
12152c001523SAmritha Nambiar 	u8      tr_bit;
12162c001523SAmritha Nambiar 	u8      reserved[4];
12172c001523SAmritha Nambiar 	__le32 addr_high;
12182c001523SAmritha Nambiar 	__le32 addr_low;
12192c001523SAmritha Nambiar };
12202c001523SAmritha Nambiar 
12212c001523SAmritha Nambiar I40E_CHECK_CMD_LENGTH(i40e_aqc_replace_cloud_filters_cmd);
12222c001523SAmritha Nambiar 
12232c001523SAmritha Nambiar struct i40e_aqc_replace_cloud_filters_cmd_buf {
12242c001523SAmritha Nambiar 	u8      data[32];
12252c001523SAmritha Nambiar 	struct i40e_filter_data filters[8];
12262c001523SAmritha Nambiar };
12272c001523SAmritha Nambiar 
12282c001523SAmritha Nambiar I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_replace_cloud_filters_cmd_buf);
12292c001523SAmritha Nambiar 
123056a62fc8SJesse Brandeburg /* Add Mirror Rule (indirect or direct 0x0260)
123156a62fc8SJesse Brandeburg  * Delete Mirror Rule (indirect or direct 0x0261)
123256a62fc8SJesse Brandeburg  * note: some rule types (4,5) do not use an external buffer.
123356a62fc8SJesse Brandeburg  *       take care to set the flags correctly.
123456a62fc8SJesse Brandeburg  */
123556a62fc8SJesse Brandeburg struct i40e_aqc_add_delete_mirror_rule {
123656a62fc8SJesse Brandeburg 	__le16 seid;
123756a62fc8SJesse Brandeburg 	__le16 rule_type;
123856a62fc8SJesse Brandeburg #define I40E_AQC_MIRROR_RULE_TYPE_SHIFT		0
123956a62fc8SJesse Brandeburg #define I40E_AQC_MIRROR_RULE_TYPE_MASK		(0x7 << \
124056a62fc8SJesse Brandeburg 						I40E_AQC_MIRROR_RULE_TYPE_SHIFT)
124156a62fc8SJesse Brandeburg #define I40E_AQC_MIRROR_RULE_TYPE_VLAN		3
124256a62fc8SJesse Brandeburg #define I40E_AQC_MIRROR_RULE_TYPE_ALL_INGRESS	4
124356a62fc8SJesse Brandeburg #define I40E_AQC_MIRROR_RULE_TYPE_ALL_EGRESS	5
124456a62fc8SJesse Brandeburg 	__le16 num_entries;
124556a62fc8SJesse Brandeburg 	__le16 destination;  /* VSI for add, rule id for delete */
124656a62fc8SJesse Brandeburg 	__le32 addr_high;    /* address of array of 2-byte VSI or VLAN ids */
124756a62fc8SJesse Brandeburg 	__le32 addr_low;
124856a62fc8SJesse Brandeburg };
124956a62fc8SJesse Brandeburg 
125056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_delete_mirror_rule);
125156a62fc8SJesse Brandeburg 
125256a62fc8SJesse Brandeburg struct i40e_aqc_add_delete_mirror_rule_completion {
125356a62fc8SJesse Brandeburg 	u8	reserved[2];
125456a62fc8SJesse Brandeburg 	__le16	rule_id;  /* only used on add */
125556a62fc8SJesse Brandeburg 	__le16	mirror_rules_used;
125656a62fc8SJesse Brandeburg 	__le16	mirror_rules_free;
125756a62fc8SJesse Brandeburg 	__le32	addr_high;
125856a62fc8SJesse Brandeburg 	__le32	addr_low;
125956a62fc8SJesse Brandeburg };
126056a62fc8SJesse Brandeburg 
126156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_delete_mirror_rule_completion);
126256a62fc8SJesse Brandeburg 
1263329e5983SJingjing Wu /* Dynamic Device Personalization */
12641d5c960cSJingjing Wu struct i40e_aqc_write_personalization_profile {
12651d5c960cSJingjing Wu 	u8      flags;
12661d5c960cSJingjing Wu 	u8      reserved[3];
12671d5c960cSJingjing Wu 	__le32  profile_track_id;
12681d5c960cSJingjing Wu 	__le32  addr_high;
12691d5c960cSJingjing Wu 	__le32  addr_low;
12701d5c960cSJingjing Wu };
12711d5c960cSJingjing Wu 
12721d5c960cSJingjing Wu I40E_CHECK_CMD_LENGTH(i40e_aqc_write_personalization_profile);
12731d5c960cSJingjing Wu 
1274329e5983SJingjing Wu struct i40e_aqc_write_ddp_resp {
12751d5c960cSJingjing Wu 	__le32 error_offset;
12761d5c960cSJingjing Wu 	__le32 error_info;
12771d5c960cSJingjing Wu 	__le32 addr_high;
12781d5c960cSJingjing Wu 	__le32 addr_low;
12791d5c960cSJingjing Wu };
12801d5c960cSJingjing Wu 
12811d5c960cSJingjing Wu struct i40e_aqc_get_applied_profiles {
12821d5c960cSJingjing Wu 	u8      flags;
12831d5c960cSJingjing Wu 	u8      rsv[3];
12841d5c960cSJingjing Wu 	__le32  reserved;
12851d5c960cSJingjing Wu 	__le32  addr_high;
12861d5c960cSJingjing Wu 	__le32  addr_low;
12871d5c960cSJingjing Wu };
12881d5c960cSJingjing Wu 
12891d5c960cSJingjing Wu I40E_CHECK_CMD_LENGTH(i40e_aqc_get_applied_profiles);
12901d5c960cSJingjing Wu 
129156a62fc8SJesse Brandeburg /* DCB 0x03xx*/
129256a62fc8SJesse Brandeburg 
129356a62fc8SJesse Brandeburg /* PFC Ignore (direct 0x0301)
129456a62fc8SJesse Brandeburg  *    the command and response use the same descriptor structure
129556a62fc8SJesse Brandeburg  */
129656a62fc8SJesse Brandeburg struct i40e_aqc_pfc_ignore {
129756a62fc8SJesse Brandeburg 	u8	tc_bitmap;
129856a62fc8SJesse Brandeburg 	u8	command_flags; /* unused on response */
129956a62fc8SJesse Brandeburg 	u8	reserved[14];
130056a62fc8SJesse Brandeburg };
130156a62fc8SJesse Brandeburg 
130256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_pfc_ignore);
130356a62fc8SJesse Brandeburg 
130456a62fc8SJesse Brandeburg /* DCB Update (direct 0x0302) uses the i40e_aq_desc structure
130556a62fc8SJesse Brandeburg  * with no parameters
130656a62fc8SJesse Brandeburg  */
130756a62fc8SJesse Brandeburg 
130856a62fc8SJesse Brandeburg /* TX scheduler 0x04xx */
130956a62fc8SJesse Brandeburg 
131056a62fc8SJesse Brandeburg /* Almost all the indirect commands use
131156a62fc8SJesse Brandeburg  * this generic struct to pass the SEID in param0
131256a62fc8SJesse Brandeburg  */
131356a62fc8SJesse Brandeburg struct i40e_aqc_tx_sched_ind {
131456a62fc8SJesse Brandeburg 	__le16	vsi_seid;
131556a62fc8SJesse Brandeburg 	u8	reserved[6];
131656a62fc8SJesse Brandeburg 	__le32	addr_high;
131756a62fc8SJesse Brandeburg 	__le32	addr_low;
131856a62fc8SJesse Brandeburg };
131956a62fc8SJesse Brandeburg 
132056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_tx_sched_ind);
132156a62fc8SJesse Brandeburg 
132256a62fc8SJesse Brandeburg /* Several commands respond with a set of queue set handles */
132356a62fc8SJesse Brandeburg struct i40e_aqc_qs_handles_resp {
132456a62fc8SJesse Brandeburg 	__le16 qs_handles[8];
132556a62fc8SJesse Brandeburg };
132656a62fc8SJesse Brandeburg 
132756a62fc8SJesse Brandeburg /* Configure VSI BW limits (direct 0x0400) */
132856a62fc8SJesse Brandeburg struct i40e_aqc_configure_vsi_bw_limit {
132956a62fc8SJesse Brandeburg 	__le16	vsi_seid;
133056a62fc8SJesse Brandeburg 	u8	reserved[2];
133156a62fc8SJesse Brandeburg 	__le16	credit;
133256a62fc8SJesse Brandeburg 	u8	reserved1[2];
133356a62fc8SJesse Brandeburg 	u8	max_credit; /* 0-3, limit = 2^max */
133456a62fc8SJesse Brandeburg 	u8	reserved2[7];
133556a62fc8SJesse Brandeburg };
133656a62fc8SJesse Brandeburg 
133756a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_configure_vsi_bw_limit);
133856a62fc8SJesse Brandeburg 
133956a62fc8SJesse Brandeburg /* Configure VSI Bandwidth Limit per Traffic Type (indirect 0x0406)
134056a62fc8SJesse Brandeburg  *    responds with i40e_aqc_qs_handles_resp
134156a62fc8SJesse Brandeburg  */
134256a62fc8SJesse Brandeburg struct i40e_aqc_configure_vsi_ets_sla_bw_data {
134356a62fc8SJesse Brandeburg 	u8	tc_valid_bits;
134456a62fc8SJesse Brandeburg 	u8	reserved[15];
134556a62fc8SJesse Brandeburg 	__le16	tc_bw_credits[8]; /* FW writesback QS handles here */
134656a62fc8SJesse Brandeburg 
134756a62fc8SJesse Brandeburg 	/* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
134856a62fc8SJesse Brandeburg 	__le16	tc_bw_max[2];
134956a62fc8SJesse Brandeburg 	u8	reserved1[28];
135056a62fc8SJesse Brandeburg };
135156a62fc8SJesse Brandeburg 
13528d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_configure_vsi_ets_sla_bw_data);
13538d5e33adSShannon Nelson 
135456a62fc8SJesse Brandeburg /* Configure VSI Bandwidth Allocation per Traffic Type (indirect 0x0407)
135556a62fc8SJesse Brandeburg  *    responds with i40e_aqc_qs_handles_resp
135656a62fc8SJesse Brandeburg  */
135756a62fc8SJesse Brandeburg struct i40e_aqc_configure_vsi_tc_bw_data {
135856a62fc8SJesse Brandeburg 	u8	tc_valid_bits;
135956a62fc8SJesse Brandeburg 	u8	reserved[3];
136056a62fc8SJesse Brandeburg 	u8	tc_bw_credits[8];
136156a62fc8SJesse Brandeburg 	u8	reserved1[4];
136256a62fc8SJesse Brandeburg 	__le16	qs_handles[8];
136356a62fc8SJesse Brandeburg };
136456a62fc8SJesse Brandeburg 
13658d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_configure_vsi_tc_bw_data);
13668d5e33adSShannon Nelson 
136756a62fc8SJesse Brandeburg /* Query vsi bw configuration (indirect 0x0408) */
136856a62fc8SJesse Brandeburg struct i40e_aqc_query_vsi_bw_config_resp {
136956a62fc8SJesse Brandeburg 	u8	tc_valid_bits;
137056a62fc8SJesse Brandeburg 	u8	tc_suspended_bits;
137156a62fc8SJesse Brandeburg 	u8	reserved[14];
137256a62fc8SJesse Brandeburg 	__le16	qs_handles[8];
137356a62fc8SJesse Brandeburg 	u8	reserved1[4];
137456a62fc8SJesse Brandeburg 	__le16	port_bw_limit;
137556a62fc8SJesse Brandeburg 	u8	reserved2[2];
137656a62fc8SJesse Brandeburg 	u8	max_bw; /* 0-3, limit = 2^max */
137756a62fc8SJesse Brandeburg 	u8	reserved3[23];
137856a62fc8SJesse Brandeburg };
137956a62fc8SJesse Brandeburg 
13808d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_query_vsi_bw_config_resp);
13818d5e33adSShannon Nelson 
138256a62fc8SJesse Brandeburg /* Query VSI Bandwidth Allocation per Traffic Type (indirect 0x040A) */
138356a62fc8SJesse Brandeburg struct i40e_aqc_query_vsi_ets_sla_config_resp {
138456a62fc8SJesse Brandeburg 	u8	tc_valid_bits;
138556a62fc8SJesse Brandeburg 	u8	reserved[3];
138656a62fc8SJesse Brandeburg 	u8	share_credits[8];
138756a62fc8SJesse Brandeburg 	__le16	credits[8];
138856a62fc8SJesse Brandeburg 
138956a62fc8SJesse Brandeburg 	/* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
139056a62fc8SJesse Brandeburg 	__le16	tc_bw_max[2];
139156a62fc8SJesse Brandeburg };
139256a62fc8SJesse Brandeburg 
13938d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_query_vsi_ets_sla_config_resp);
13948d5e33adSShannon Nelson 
139556a62fc8SJesse Brandeburg /* Configure Switching Component Bandwidth Limit (direct 0x0410) */
139656a62fc8SJesse Brandeburg struct i40e_aqc_configure_switching_comp_bw_limit {
139756a62fc8SJesse Brandeburg 	__le16	seid;
139856a62fc8SJesse Brandeburg 	u8	reserved[2];
139956a62fc8SJesse Brandeburg 	__le16	credit;
140056a62fc8SJesse Brandeburg 	u8	reserved1[2];
140156a62fc8SJesse Brandeburg 	u8	max_bw; /* 0-3, limit = 2^max */
140256a62fc8SJesse Brandeburg 	u8	reserved2[7];
140356a62fc8SJesse Brandeburg };
140456a62fc8SJesse Brandeburg 
140556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_configure_switching_comp_bw_limit);
140656a62fc8SJesse Brandeburg 
140756a62fc8SJesse Brandeburg /* Enable  Physical Port ETS (indirect 0x0413)
140856a62fc8SJesse Brandeburg  * Modify  Physical Port ETS (indirect 0x0414)
140956a62fc8SJesse Brandeburg  * Disable Physical Port ETS (indirect 0x0415)
141056a62fc8SJesse Brandeburg  */
141156a62fc8SJesse Brandeburg struct i40e_aqc_configure_switching_comp_ets_data {
141256a62fc8SJesse Brandeburg 	u8	reserved[4];
141356a62fc8SJesse Brandeburg 	u8	tc_valid_bits;
1414f94234eeSShannon Nelson 	u8	seepage;
141556a62fc8SJesse Brandeburg 	u8	tc_strict_priority_flags;
1416f94234eeSShannon Nelson 	u8	reserved1[17];
141756a62fc8SJesse Brandeburg 	u8	tc_bw_share_credits[8];
1418f94234eeSShannon Nelson 	u8	reserved2[96];
141956a62fc8SJesse Brandeburg };
142056a62fc8SJesse Brandeburg 
14218d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_configure_switching_comp_ets_data);
14228d5e33adSShannon Nelson 
142356a62fc8SJesse Brandeburg /* Configure Switching Component Bandwidth Limits per Tc (indirect 0x0416) */
142456a62fc8SJesse Brandeburg struct i40e_aqc_configure_switching_comp_ets_bw_limit_data {
142556a62fc8SJesse Brandeburg 	u8	tc_valid_bits;
142656a62fc8SJesse Brandeburg 	u8	reserved[15];
142756a62fc8SJesse Brandeburg 	__le16	tc_bw_credit[8];
142856a62fc8SJesse Brandeburg 
142956a62fc8SJesse Brandeburg 	/* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
143056a62fc8SJesse Brandeburg 	__le16	tc_bw_max[2];
143156a62fc8SJesse Brandeburg 	u8	reserved1[28];
143256a62fc8SJesse Brandeburg };
143356a62fc8SJesse Brandeburg 
14348d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x40,
14358d5e33adSShannon Nelson 		      i40e_aqc_configure_switching_comp_ets_bw_limit_data);
14368d5e33adSShannon Nelson 
143756a62fc8SJesse Brandeburg /* Configure Switching Component Bandwidth Allocation per Tc
143856a62fc8SJesse Brandeburg  * (indirect 0x0417)
143956a62fc8SJesse Brandeburg  */
144056a62fc8SJesse Brandeburg struct i40e_aqc_configure_switching_comp_bw_config_data {
144156a62fc8SJesse Brandeburg 	u8	tc_valid_bits;
144256a62fc8SJesse Brandeburg 	u8	reserved[2];
144356a62fc8SJesse Brandeburg 	u8	absolute_credits; /* bool */
144456a62fc8SJesse Brandeburg 	u8	tc_bw_share_credits[8];
144556a62fc8SJesse Brandeburg 	u8	reserved1[20];
144656a62fc8SJesse Brandeburg };
144756a62fc8SJesse Brandeburg 
14488d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_configure_switching_comp_bw_config_data);
14498d5e33adSShannon Nelson 
145056a62fc8SJesse Brandeburg /* Query Switching Component Configuration (indirect 0x0418) */
145156a62fc8SJesse Brandeburg struct i40e_aqc_query_switching_comp_ets_config_resp {
145256a62fc8SJesse Brandeburg 	u8	tc_valid_bits;
145356a62fc8SJesse Brandeburg 	u8	reserved[35];
145456a62fc8SJesse Brandeburg 	__le16	port_bw_limit;
145556a62fc8SJesse Brandeburg 	u8	reserved1[2];
145656a62fc8SJesse Brandeburg 	u8	tc_bw_max; /* 0-3, limit = 2^max */
145756a62fc8SJesse Brandeburg 	u8	reserved2[23];
145856a62fc8SJesse Brandeburg };
145956a62fc8SJesse Brandeburg 
14608d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_query_switching_comp_ets_config_resp);
14618d5e33adSShannon Nelson 
146256a62fc8SJesse Brandeburg /* Query PhysicalPort ETS Configuration (indirect 0x0419) */
146356a62fc8SJesse Brandeburg struct i40e_aqc_query_port_ets_config_resp {
146456a62fc8SJesse Brandeburg 	u8	reserved[4];
146556a62fc8SJesse Brandeburg 	u8	tc_valid_bits;
146656a62fc8SJesse Brandeburg 	u8	reserved1;
146756a62fc8SJesse Brandeburg 	u8	tc_strict_priority_bits;
146856a62fc8SJesse Brandeburg 	u8	reserved2;
146956a62fc8SJesse Brandeburg 	u8	tc_bw_share_credits[8];
147056a62fc8SJesse Brandeburg 	__le16	tc_bw_limits[8];
147156a62fc8SJesse Brandeburg 
147256a62fc8SJesse Brandeburg 	/* 4 bits per tc 0-7, 4th bit reserved, limit = 2^max */
147356a62fc8SJesse Brandeburg 	__le16	tc_bw_max[2];
147456a62fc8SJesse Brandeburg 	u8	reserved3[32];
147556a62fc8SJesse Brandeburg };
147656a62fc8SJesse Brandeburg 
14778d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x44, i40e_aqc_query_port_ets_config_resp);
14788d5e33adSShannon Nelson 
147956a62fc8SJesse Brandeburg /* Query Switching Component Bandwidth Allocation per Traffic Type
148056a62fc8SJesse Brandeburg  * (indirect 0x041A)
148156a62fc8SJesse Brandeburg  */
148256a62fc8SJesse Brandeburg struct i40e_aqc_query_switching_comp_bw_config_resp {
148356a62fc8SJesse Brandeburg 	u8	tc_valid_bits;
148456a62fc8SJesse Brandeburg 	u8	reserved[2];
148556a62fc8SJesse Brandeburg 	u8	absolute_credits_enable; /* bool */
148656a62fc8SJesse Brandeburg 	u8	tc_bw_share_credits[8];
148756a62fc8SJesse Brandeburg 	__le16	tc_bw_limits[8];
148856a62fc8SJesse Brandeburg 
148956a62fc8SJesse Brandeburg 	/* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */
149056a62fc8SJesse Brandeburg 	__le16	tc_bw_max[2];
149156a62fc8SJesse Brandeburg };
149256a62fc8SJesse Brandeburg 
14938d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_query_switching_comp_bw_config_resp);
14948d5e33adSShannon Nelson 
149556a62fc8SJesse Brandeburg /* Suspend/resume port TX traffic
149656a62fc8SJesse Brandeburg  * (direct 0x041B and 0x041C) uses the generic SEID struct
149756a62fc8SJesse Brandeburg  */
149856a62fc8SJesse Brandeburg 
1499befc229cSShannon Nelson /* Configure partition BW
1500befc229cSShannon Nelson  * (indirect 0x041D)
1501befc229cSShannon Nelson  */
1502befc229cSShannon Nelson struct i40e_aqc_configure_partition_bw_data {
1503befc229cSShannon Nelson 	__le16	pf_valid_bits;
1504befc229cSShannon Nelson 	u8	min_bw[16];      /* guaranteed bandwidth */
1505befc229cSShannon Nelson 	u8	max_bw[16];      /* bandwidth limit */
1506befc229cSShannon Nelson };
1507befc229cSShannon Nelson 
15088d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x22, i40e_aqc_configure_partition_bw_data);
15098d5e33adSShannon Nelson 
15107d94906bSCarolyn Wyborny /* Get and set the active HMC resource profile and status.
15117d94906bSCarolyn Wyborny  * (direct 0x0500) and (direct 0x0501)
15127d94906bSCarolyn Wyborny  */
15137d94906bSCarolyn Wyborny struct i40e_aq_get_set_hmc_resource_profile {
15147d94906bSCarolyn Wyborny 	u8	pm_profile;
15157d94906bSCarolyn Wyborny 	u8	pe_vf_enabled;
15167d94906bSCarolyn Wyborny 	u8	reserved[14];
15177d94906bSCarolyn Wyborny };
15187d94906bSCarolyn Wyborny 
15197d94906bSCarolyn Wyborny I40E_CHECK_CMD_LENGTH(i40e_aq_get_set_hmc_resource_profile);
15207d94906bSCarolyn Wyborny 
15217d94906bSCarolyn Wyborny enum i40e_aq_hmc_profile {
15227d94906bSCarolyn Wyborny 	/* I40E_HMC_PROFILE_NO_CHANGE	= 0, reserved */
15237d94906bSCarolyn Wyborny 	I40E_HMC_PROFILE_DEFAULT	= 1,
15247d94906bSCarolyn Wyborny 	I40E_HMC_PROFILE_FAVOR_VF	= 2,
15257d94906bSCarolyn Wyborny 	I40E_HMC_PROFILE_EQUAL		= 3,
15267d94906bSCarolyn Wyborny };
15277d94906bSCarolyn Wyborny 
152856a62fc8SJesse Brandeburg /* Get PHY Abilities (indirect 0x0600) uses the generic indirect struct */
152956a62fc8SJesse Brandeburg 
153056a62fc8SJesse Brandeburg /* set in param0 for get phy abilities to report qualified modules */
153156a62fc8SJesse Brandeburg #define I40E_AQ_PHY_REPORT_QUALIFIED_MODULES	0x0001
153256a62fc8SJesse Brandeburg #define I40E_AQ_PHY_REPORT_INITIAL_VALUES	0x0002
153356a62fc8SJesse Brandeburg 
153456a62fc8SJesse Brandeburg enum i40e_aq_phy_type {
153556a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_SGMII			= 0x0,
153656a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_1000BASE_KX		= 0x1,
153756a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_10GBASE_KX4		= 0x2,
153856a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_10GBASE_KR		= 0x3,
153956a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_40GBASE_KR4		= 0x4,
154056a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_XAUI			= 0x5,
154156a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_XFI			= 0x6,
154256a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_SFI			= 0x7,
154356a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_XLAUI			= 0x8,
154456a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_XLPPI			= 0x9,
154556a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_40GBASE_CR4_CU		= 0xA,
154656a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_10GBASE_CR1_CU		= 0xB,
1547f94234eeSShannon Nelson 	I40E_PHY_TYPE_10GBASE_AOC		= 0xC,
1548f94234eeSShannon Nelson 	I40E_PHY_TYPE_40GBASE_AOC		= 0xD,
1549d60bcc79SFilip Sadowski 	I40E_PHY_TYPE_UNRECOGNIZED		= 0xE,
1550d60bcc79SFilip Sadowski 	I40E_PHY_TYPE_UNSUPPORTED		= 0xF,
155156a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_100BASE_TX		= 0x11,
155256a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_1000BASE_T		= 0x12,
155356a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_10GBASE_T			= 0x13,
155456a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_10GBASE_SR		= 0x14,
155556a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_10GBASE_LR		= 0x15,
155656a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_10GBASE_SFPP_CU		= 0x16,
155756a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_10GBASE_CR1		= 0x17,
155856a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_40GBASE_CR4		= 0x18,
155956a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_40GBASE_SR4		= 0x19,
156056a62fc8SJesse Brandeburg 	I40E_PHY_TYPE_40GBASE_LR4		= 0x1A,
1561f94234eeSShannon Nelson 	I40E_PHY_TYPE_1000BASE_SX		= 0x1B,
1562f94234eeSShannon Nelson 	I40E_PHY_TYPE_1000BASE_LX		= 0x1C,
1563f94234eeSShannon Nelson 	I40E_PHY_TYPE_1000BASE_T_OPTICAL	= 0x1D,
1564f94234eeSShannon Nelson 	I40E_PHY_TYPE_20GBASE_KR2		= 0x1E,
15653123237aSCarolyn Wyborny 	I40E_PHY_TYPE_25GBASE_KR		= 0x1F,
15663123237aSCarolyn Wyborny 	I40E_PHY_TYPE_25GBASE_CR		= 0x20,
15673123237aSCarolyn Wyborny 	I40E_PHY_TYPE_25GBASE_SR		= 0x21,
15683123237aSCarolyn Wyborny 	I40E_PHY_TYPE_25GBASE_LR		= 0x22,
1569211b4c14SSudheer Mogilappagari 	I40E_PHY_TYPE_25GBASE_AOC		= 0x23,
1570211b4c14SSudheer Mogilappagari 	I40E_PHY_TYPE_25GBASE_ACC		= 0x24,
157115395ec4SMateusz Palczewski 	I40E_PHY_TYPE_2_5GBASE_T		= 0x26,
157215395ec4SMateusz Palczewski 	I40E_PHY_TYPE_5GBASE_T			= 0x27,
157315395ec4SMateusz Palczewski 	I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS	= 0x30,
157415395ec4SMateusz Palczewski 	I40E_PHY_TYPE_5GBASE_T_LINK_STATUS	= 0x31,
157560518a04SMitch Williams 	I40E_PHY_TYPE_MAX,
15769a858178SFilip Sadowski 	I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP	= 0xFD,
1577d60bcc79SFilip Sadowski 	I40E_PHY_TYPE_EMPTY			= 0xFE,
1578d60bcc79SFilip Sadowski 	I40E_PHY_TYPE_DEFAULT			= 0xFF,
157956a62fc8SJesse Brandeburg };
158056a62fc8SJesse Brandeburg 
1581c3880bd1SMariusz Stachura #define I40E_PHY_TYPES_BITMASK (BIT_ULL(I40E_PHY_TYPE_SGMII) | \
1582c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_1000BASE_KX) | \
1583c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_10GBASE_KX4) | \
1584c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_10GBASE_KR) | \
1585c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_40GBASE_KR4) | \
1586c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_XAUI) | \
1587c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_XFI) | \
1588c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_SFI) | \
1589c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_XLAUI) | \
1590c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_XLPPI) | \
1591c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_40GBASE_CR4_CU) | \
1592c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1_CU) | \
1593c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_10GBASE_AOC) | \
1594c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_40GBASE_AOC) | \
1595c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_UNRECOGNIZED) | \
1596c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_UNSUPPORTED) | \
1597c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_100BASE_TX) | \
1598c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_1000BASE_T) | \
1599c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_10GBASE_T) | \
1600c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_10GBASE_SR) | \
1601c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_10GBASE_LR) | \
1602c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_10GBASE_SFPP_CU) | \
1603c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1) | \
1604c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_40GBASE_CR4) | \
1605c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_40GBASE_SR4) | \
1606c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_40GBASE_LR4) | \
1607c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_1000BASE_SX) | \
1608c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_1000BASE_LX) | \
1609c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_1000BASE_T_OPTICAL) | \
1610c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_20GBASE_KR2) | \
1611c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_25GBASE_KR) | \
1612c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_25GBASE_CR) | \
1613c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_25GBASE_SR) | \
1614c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_25GBASE_LR) | \
1615c3880bd1SMariusz Stachura 				BIT_ULL(I40E_PHY_TYPE_25GBASE_AOC) | \
16162e45d3f4SAleksandr Loktionov 				BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC) | \
16172e45d3f4SAleksandr Loktionov 				BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T) | \
16182e45d3f4SAleksandr Loktionov 				BIT_ULL(I40E_PHY_TYPE_5GBASE_T))
1619c3880bd1SMariusz Stachura 
16202e45d3f4SAleksandr Loktionov #define I40E_LINK_SPEED_2_5GB_SHIFT	0x0
162156a62fc8SJesse Brandeburg #define I40E_LINK_SPEED_100MB_SHIFT	0x1
162256a62fc8SJesse Brandeburg #define I40E_LINK_SPEED_1000MB_SHIFT	0x2
162356a62fc8SJesse Brandeburg #define I40E_LINK_SPEED_10GB_SHIFT	0x3
162456a62fc8SJesse Brandeburg #define I40E_LINK_SPEED_40GB_SHIFT	0x4
162556a62fc8SJesse Brandeburg #define I40E_LINK_SPEED_20GB_SHIFT	0x5
16263123237aSCarolyn Wyborny #define I40E_LINK_SPEED_25GB_SHIFT	0x6
16272e45d3f4SAleksandr Loktionov #define I40E_LINK_SPEED_5GB_SHIFT	0x7
162856a62fc8SJesse Brandeburg 
162956a62fc8SJesse Brandeburg enum i40e_aq_link_speed {
163056a62fc8SJesse Brandeburg 	I40E_LINK_SPEED_UNKNOWN	= 0,
16312101bac2SJacob Keller 	I40E_LINK_SPEED_100MB	= BIT(I40E_LINK_SPEED_100MB_SHIFT),
16322101bac2SJacob Keller 	I40E_LINK_SPEED_1GB	= BIT(I40E_LINK_SPEED_1000MB_SHIFT),
16332e45d3f4SAleksandr Loktionov 	I40E_LINK_SPEED_2_5GB	= (1 << I40E_LINK_SPEED_2_5GB_SHIFT),
16342e45d3f4SAleksandr Loktionov 	I40E_LINK_SPEED_5GB	= (1 << I40E_LINK_SPEED_5GB_SHIFT),
16352101bac2SJacob Keller 	I40E_LINK_SPEED_10GB	= BIT(I40E_LINK_SPEED_10GB_SHIFT),
16362101bac2SJacob Keller 	I40E_LINK_SPEED_40GB	= BIT(I40E_LINK_SPEED_40GB_SHIFT),
16373123237aSCarolyn Wyborny 	I40E_LINK_SPEED_20GB	= BIT(I40E_LINK_SPEED_20GB_SHIFT),
16383123237aSCarolyn Wyborny 	I40E_LINK_SPEED_25GB	= BIT(I40E_LINK_SPEED_25GB_SHIFT),
163956a62fc8SJesse Brandeburg };
164056a62fc8SJesse Brandeburg 
164156a62fc8SJesse Brandeburg struct i40e_aqc_module_desc {
164256a62fc8SJesse Brandeburg 	u8 oui[3];
164356a62fc8SJesse Brandeburg 	u8 reserved1;
164456a62fc8SJesse Brandeburg 	u8 part_number[16];
164556a62fc8SJesse Brandeburg 	u8 revision[4];
164656a62fc8SJesse Brandeburg 	u8 reserved2[8];
164756a62fc8SJesse Brandeburg };
164856a62fc8SJesse Brandeburg 
16498d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_module_desc);
16508d5e33adSShannon Nelson 
165156a62fc8SJesse Brandeburg struct i40e_aq_get_phy_abilities_resp {
165256a62fc8SJesse Brandeburg 	__le32	phy_type;       /* bitmap using the above enum for offsets */
1653981b7545SShannon Nelson 	u8	link_speed;     /* bitmap using the above enum bit patterns */
165456a62fc8SJesse Brandeburg 	u8	abilities;
165556a62fc8SJesse Brandeburg #define I40E_AQ_PHY_FLAG_PAUSE_TX	0x01
165656a62fc8SJesse Brandeburg #define I40E_AQ_PHY_FLAG_PAUSE_RX	0x02
165756a62fc8SJesse Brandeburg 	__le16	eee_capability;
165856a62fc8SJesse Brandeburg 	__le32	eeer_val;
165956a62fc8SJesse Brandeburg 	u8	d3_lpan;
16603123237aSCarolyn Wyborny 	u8	phy_type_ext;
16613123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_KR	0X01
16623123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_CR	0X02
16633123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_SR	0x04
16643123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_LR	0x08
166560f000a4SCarolyn Wyborny 	u8	fec_cfg_curr_mod_ext_info;
166660f000a4SCarolyn Wyborny #define I40E_AQ_REQUEST_FEC_KR		0x04
166760f000a4SCarolyn Wyborny #define I40E_AQ_REQUEST_FEC_RS		0x08
166860f000a4SCarolyn Wyborny #define I40E_AQ_ENABLE_FEC_AUTO		0x10
166960f000a4SCarolyn Wyborny 
16703123237aSCarolyn Wyborny 	u8	ext_comp_code;
167156a62fc8SJesse Brandeburg 	u8	phy_id[4];
167256a62fc8SJesse Brandeburg 	u8	module_type[3];
167356a62fc8SJesse Brandeburg 	u8	qualified_module_count;
167456a62fc8SJesse Brandeburg #define I40E_AQ_PHY_MAX_QMS		16
167556a62fc8SJesse Brandeburg 	struct i40e_aqc_module_desc	qualified_module[I40E_AQ_PHY_MAX_QMS];
167656a62fc8SJesse Brandeburg };
167756a62fc8SJesse Brandeburg 
16788d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x218, i40e_aq_get_phy_abilities_resp);
16798d5e33adSShannon Nelson 
168056a62fc8SJesse Brandeburg /* Set PHY Config (direct 0x0601) */
168156a62fc8SJesse Brandeburg struct i40e_aq_set_phy_config { /* same bits as above in all */
168256a62fc8SJesse Brandeburg 	__le32	phy_type;
168356a62fc8SJesse Brandeburg 	u8	link_speed;
168456a62fc8SJesse Brandeburg 	u8	abilities;
1685981b7545SShannon Nelson /* bits 0-2 use the values from get_phy_abilities_resp */
1686d5ec9e2cSArkadiusz Kubalewski #define I40E_AQ_PHY_ENABLE_LINK		0x08
1687981b7545SShannon Nelson #define I40E_AQ_PHY_ENABLE_AN		0x10
1688981b7545SShannon Nelson #define I40E_AQ_PHY_ENABLE_ATOMIC_LINK	0x20
168956a62fc8SJesse Brandeburg 	__le16	eee_capability;
169056a62fc8SJesse Brandeburg 	__le32	eeer;
169156a62fc8SJesse Brandeburg 	u8	low_power_ctrl;
16923123237aSCarolyn Wyborny 	u8	phy_type_ext;
16933123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_KR	0X01
16943123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_CR	0X02
16953123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_SR	0x04
16963123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_LR	0x08
169760f000a4SCarolyn Wyborny 	u8	fec_config;
169860f000a4SCarolyn Wyborny #define I40E_AQ_SET_FEC_ABILITY_KR	BIT(0)
169960f000a4SCarolyn Wyborny #define I40E_AQ_SET_FEC_ABILITY_RS	BIT(1)
170060f000a4SCarolyn Wyborny #define I40E_AQ_SET_FEC_REQUEST_KR	BIT(2)
170160f000a4SCarolyn Wyborny #define I40E_AQ_SET_FEC_REQUEST_RS	BIT(3)
170260f000a4SCarolyn Wyborny #define I40E_AQ_SET_FEC_AUTO		BIT(4)
170360f000a4SCarolyn Wyborny #define I40E_AQ_PHY_FEC_CONFIG_SHIFT	0x0
170460f000a4SCarolyn Wyborny #define I40E_AQ_PHY_FEC_CONFIG_MASK	(0x1F << I40E_AQ_PHY_FEC_CONFIG_SHIFT)
170560f000a4SCarolyn Wyborny 	u8	reserved;
170656a62fc8SJesse Brandeburg };
170756a62fc8SJesse Brandeburg 
170856a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config);
170956a62fc8SJesse Brandeburg 
171056a62fc8SJesse Brandeburg /* Set MAC Config command data structure (direct 0x0603) */
171156a62fc8SJesse Brandeburg struct i40e_aq_set_mac_config {
171256a62fc8SJesse Brandeburg 	__le16	max_frame_size;
171356a62fc8SJesse Brandeburg 	u8	params;
171456a62fc8SJesse Brandeburg 	u8	tx_timer_priority; /* bitmap */
171556a62fc8SJesse Brandeburg 	__le16	tx_timer_value;
171656a62fc8SJesse Brandeburg 	__le16	fc_refresh_threshold;
171756a62fc8SJesse Brandeburg 	u8	reserved[8];
171856a62fc8SJesse Brandeburg };
171956a62fc8SJesse Brandeburg 
172056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aq_set_mac_config);
172156a62fc8SJesse Brandeburg 
172256a62fc8SJesse Brandeburg /* Restart Auto-Negotiation (direct 0x605) */
172356a62fc8SJesse Brandeburg struct i40e_aqc_set_link_restart_an {
172456a62fc8SJesse Brandeburg 	u8	command;
172556a62fc8SJesse Brandeburg #define I40E_AQ_PHY_RESTART_AN	0x02
172656a62fc8SJesse Brandeburg #define I40E_AQ_PHY_LINK_ENABLE	0x04
172756a62fc8SJesse Brandeburg 	u8	reserved[15];
172856a62fc8SJesse Brandeburg };
172956a62fc8SJesse Brandeburg 
173056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_set_link_restart_an);
173156a62fc8SJesse Brandeburg 
173256a62fc8SJesse Brandeburg /* Get Link Status cmd & response data structure (direct 0x0607) */
173356a62fc8SJesse Brandeburg struct i40e_aqc_get_link_status {
173456a62fc8SJesse Brandeburg 	__le16	command_flags; /* only field set on command */
173556a62fc8SJesse Brandeburg #define I40E_AQ_LSE_DISABLE		0x2
173656a62fc8SJesse Brandeburg #define I40E_AQ_LSE_ENABLE		0x3
173756a62fc8SJesse Brandeburg /* only response uses this flag */
173856a62fc8SJesse Brandeburg #define I40E_AQ_LSE_IS_ENABLED		0x1
173956a62fc8SJesse Brandeburg 	u8	phy_type;    /* i40e_aq_phy_type   */
174056a62fc8SJesse Brandeburg 	u8	link_speed;  /* i40e_aq_link_speed */
174156a62fc8SJesse Brandeburg 	u8	link_info;
17421d55aa9cSShannon Nelson #define I40E_AQ_LINK_UP			0x01    /* obsolete */
174356a62fc8SJesse Brandeburg #define I40E_AQ_MEDIA_AVAILABLE		0x40
174456a62fc8SJesse Brandeburg 	u8	an_info;
174556a62fc8SJesse Brandeburg #define I40E_AQ_AN_COMPLETED		0x01
174656a62fc8SJesse Brandeburg #define I40E_AQ_LINK_PAUSE_TX		0x20
174756a62fc8SJesse Brandeburg #define I40E_AQ_LINK_PAUSE_RX		0x40
174856a62fc8SJesse Brandeburg #define I40E_AQ_QUALIFIED_MODULE	0x80
174956a62fc8SJesse Brandeburg 	u8	ext_info;
175056a62fc8SJesse Brandeburg 	u8	loopback; /* use defines from i40e_aqc_set_lb_mode */
1751d60bcc79SFilip Sadowski /* Since firmware API 1.7 loopback field keeps power class info as well */
1752d60bcc79SFilip Sadowski #define I40E_AQ_LOOPBACK_MASK		0x07
175356a62fc8SJesse Brandeburg 	__le16	max_frame_size;
175456a62fc8SJesse Brandeburg 	u8	config;
175560f000a4SCarolyn Wyborny #define I40E_AQ_CONFIG_FEC_KR_ENA	0x01
175660f000a4SCarolyn Wyborny #define I40E_AQ_CONFIG_FEC_RS_ENA	0x02
175756a62fc8SJesse Brandeburg #define I40E_AQ_CONFIG_CRC_ENA		0x04
175856a62fc8SJesse Brandeburg #define I40E_AQ_CONFIG_PACING_MASK	0x78
1759d60bcc79SFilip Sadowski 	union {
1760d60bcc79SFilip Sadowski 		struct {
1761d60be2caSShannon Nelson 			u8	power_desc;
17625eb772f7SShannon Nelson 			u8	reserved[4];
176356a62fc8SJesse Brandeburg 		};
1764d60bcc79SFilip Sadowski 		struct {
1765d60bcc79SFilip Sadowski 			u8	link_type[4];
1766d60bcc79SFilip Sadowski 			u8	link_type_ext;
1767d60bcc79SFilip Sadowski 		};
1768d60bcc79SFilip Sadowski 	};
1769d60bcc79SFilip Sadowski };
177056a62fc8SJesse Brandeburg 
177156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_get_link_status);
177256a62fc8SJesse Brandeburg 
177356a62fc8SJesse Brandeburg /* Set event mask command (direct 0x613) */
177456a62fc8SJesse Brandeburg struct i40e_aqc_set_phy_int_mask {
177556a62fc8SJesse Brandeburg 	u8	reserved[8];
177656a62fc8SJesse Brandeburg 	__le16	event_mask;
177756a62fc8SJesse Brandeburg #define I40E_AQ_EVENT_LINK_UPDOWN	0x0002
177856a62fc8SJesse Brandeburg #define I40E_AQ_EVENT_MEDIA_NA		0x0004
177956a62fc8SJesse Brandeburg #define I40E_AQ_EVENT_MODULE_QUAL_FAIL	0x0100
178056a62fc8SJesse Brandeburg 	u8	reserved1[6];
178156a62fc8SJesse Brandeburg };
178256a62fc8SJesse Brandeburg 
178356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_set_phy_int_mask);
178456a62fc8SJesse Brandeburg 
178556a62fc8SJesse Brandeburg /* Get Local AN advt register (direct 0x0614)
178656a62fc8SJesse Brandeburg  * Set Local AN advt register (direct 0x0615)
178756a62fc8SJesse Brandeburg  * Get Link Partner AN advt register (direct 0x0616)
178856a62fc8SJesse Brandeburg  */
178956a62fc8SJesse Brandeburg struct i40e_aqc_an_advt_reg {
179056a62fc8SJesse Brandeburg 	__le32	local_an_reg0;
179156a62fc8SJesse Brandeburg 	__le16	local_an_reg1;
179256a62fc8SJesse Brandeburg 	u8	reserved[10];
179356a62fc8SJesse Brandeburg };
179456a62fc8SJesse Brandeburg 
179556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_an_advt_reg);
179656a62fc8SJesse Brandeburg 
179756a62fc8SJesse Brandeburg /* Set Loopback mode (0x0618) */
179856a62fc8SJesse Brandeburg struct i40e_aqc_set_lb_mode {
179956a62fc8SJesse Brandeburg 	__le16	lb_mode;
1800b1746fbaSTirthendu Sarkar #define I40E_LEGACY_LOOPBACK_NVM_VER	0x6000
1801b1746fbaSTirthendu Sarkar #define I40E_AQ_LB_MAC_LOCAL		0x01
1802b1746fbaSTirthendu Sarkar #define I40E_AQ_LB_PHY_LOCAL		0x05
1803b1746fbaSTirthendu Sarkar #define I40E_AQ_LB_PHY_REMOTE		0x06
1804b1746fbaSTirthendu Sarkar #define I40E_AQ_LB_MAC_LOCAL_LEGACY	0x04
180556a62fc8SJesse Brandeburg 	u8	reserved[14];
180656a62fc8SJesse Brandeburg };
180756a62fc8SJesse Brandeburg 
180856a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_set_lb_mode);
180956a62fc8SJesse Brandeburg 
1810f94234eeSShannon Nelson /* Set PHY Debug command (0x0622) */
1811f94234eeSShannon Nelson struct i40e_aqc_set_phy_debug {
1812f94234eeSShannon Nelson 	u8	command_flags;
181306c0e39bSKevin Scott /* Disable link manageability on a single port */
1814f94234eeSShannon Nelson #define I40E_AQ_PHY_DEBUG_DISABLE_LINK_FW	0x10
181506c0e39bSKevin Scott /* Disable link manageability on all ports */
181606c0e39bSKevin Scott #define I40E_AQ_PHY_DEBUG_DISABLE_ALL_LINK_FW	0x20
181756a62fc8SJesse Brandeburg 	u8	reserved[15];
181856a62fc8SJesse Brandeburg };
181956a62fc8SJesse Brandeburg 
1820f94234eeSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_set_phy_debug);
182156a62fc8SJesse Brandeburg 
182256a62fc8SJesse Brandeburg enum i40e_aq_phy_reg_type {
182356a62fc8SJesse Brandeburg 	I40E_AQC_PHY_REG_INTERNAL	= 0x1,
182456a62fc8SJesse Brandeburg 	I40E_AQC_PHY_REG_EXERNAL_BASET	= 0x2,
182556a62fc8SJesse Brandeburg 	I40E_AQC_PHY_REG_EXERNAL_MODULE	= 0x3
182656a62fc8SJesse Brandeburg };
182756a62fc8SJesse Brandeburg 
18285394f02fSShannon Nelson /* Run PHY Activity (0x0626) */
18295394f02fSShannon Nelson struct i40e_aqc_run_phy_activity {
18305394f02fSShannon Nelson 	__le16  activity_id;
18315394f02fSShannon Nelson 	u8      flags;
18325394f02fSShannon Nelson 	u8      reserved1;
18335394f02fSShannon Nelson 	__le32  control;
18345394f02fSShannon Nelson 	__le32  data;
18355394f02fSShannon Nelson 	u8      reserved2[4];
18365394f02fSShannon Nelson };
18375394f02fSShannon Nelson 
18385394f02fSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_run_phy_activity);
18395394f02fSShannon Nelson 
18409c0e5cafSFilip Sadowski /* Set PHY Register command (0x0628) */
18419c0e5cafSFilip Sadowski /* Get PHY Register command (0x0629) */
18429c0e5cafSFilip Sadowski struct i40e_aqc_phy_register_access {
18439c0e5cafSFilip Sadowski 	u8	phy_interface;
18449c0e5cafSFilip Sadowski #define I40E_AQ_PHY_REG_ACCESS_EXTERNAL	1
18459c0e5cafSFilip Sadowski #define I40E_AQ_PHY_REG_ACCESS_EXTERNAL_MODULE	2
18469c0e5cafSFilip Sadowski 	u8	dev_address;
18470514db37SPiotr Azarewicz 	u8	cmd_flags;
18480514db37SPiotr Azarewicz #define I40E_AQ_PHY_REG_ACCESS_DONT_CHANGE_QSFP_PAGE	0x01
18490514db37SPiotr Azarewicz #define I40E_AQ_PHY_REG_ACCESS_SET_MDIO_IF_NUMBER	0x02
18500514db37SPiotr Azarewicz #define I40E_AQ_PHY_REG_ACCESS_MDIO_IF_NUMBER_SHIFT	2
18510514db37SPiotr Azarewicz #define I40E_AQ_PHY_REG_ACCESS_MDIO_IF_NUMBER_MASK	(0x3 << \
18520514db37SPiotr Azarewicz 		I40E_AQ_PHY_REG_ACCESS_MDIO_IF_NUMBER_SHIFT)
18530514db37SPiotr Azarewicz 	u8	reserved1;
18549c0e5cafSFilip Sadowski 	__le32	reg_address;
18559c0e5cafSFilip Sadowski 	__le32	reg_value;
18569c0e5cafSFilip Sadowski 	u8	reserved2[4];
18579c0e5cafSFilip Sadowski };
18589c0e5cafSFilip Sadowski 
18599c0e5cafSFilip Sadowski I40E_CHECK_CMD_LENGTH(i40e_aqc_phy_register_access);
18609c0e5cafSFilip Sadowski 
186156a62fc8SJesse Brandeburg /* NVM Read command (indirect 0x0701)
186256a62fc8SJesse Brandeburg  * NVM Erase commands (direct 0x0702)
186356a62fc8SJesse Brandeburg  * NVM Update commands (indirect 0x0703)
186456a62fc8SJesse Brandeburg  */
186556a62fc8SJesse Brandeburg struct i40e_aqc_nvm_update {
186656a62fc8SJesse Brandeburg 	u8	command_flags;
186756a62fc8SJesse Brandeburg #define I40E_AQ_NVM_LAST_CMD			0x01
1868f05798b4SPiotr Azarewicz #define I40E_AQ_NVM_REARRANGE_TO_FLAT		0x20
1869f05798b4SPiotr Azarewicz #define I40E_AQ_NVM_REARRANGE_TO_STRUCT		0x40
1870e3a5d6e6SPawel Jablonski #define I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT	1
1871e3a5d6e6SPawel Jablonski #define I40E_AQ_NVM_PRESERVATION_FLAGS_SELECTED	0x03
1872e3a5d6e6SPawel Jablonski #define I40E_AQ_NVM_PRESERVATION_FLAGS_ALL	0x01
187356a62fc8SJesse Brandeburg 	u8	module_pointer;
187456a62fc8SJesse Brandeburg 	__le16	length;
187556a62fc8SJesse Brandeburg 	__le32	offset;
187656a62fc8SJesse Brandeburg 	__le32	addr_high;
187756a62fc8SJesse Brandeburg 	__le32	addr_low;
187856a62fc8SJesse Brandeburg };
187956a62fc8SJesse Brandeburg 
188056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update);
188156a62fc8SJesse Brandeburg 
1882f94234eeSShannon Nelson /* NVM Config Read (indirect 0x0704) */
1883f94234eeSShannon Nelson struct i40e_aqc_nvm_config_read {
1884f94234eeSShannon Nelson 	__le16	cmd_flags;
1885f94234eeSShannon Nelson 	__le16	element_count;
1886f94234eeSShannon Nelson 	__le16	element_id;	/* Feature/field ID */
1887e910ca7cSJeff Kirsher 	__le16	element_id_msw;	/* MSWord of field ID */
1888f94234eeSShannon Nelson 	__le32	address_high;
1889f94234eeSShannon Nelson 	__le32	address_low;
1890f94234eeSShannon Nelson };
1891f94234eeSShannon Nelson 
1892f94234eeSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_read);
1893f94234eeSShannon Nelson 
1894f94234eeSShannon Nelson /* NVM Config Write (indirect 0x0705) */
1895f94234eeSShannon Nelson struct i40e_aqc_nvm_config_write {
1896f94234eeSShannon Nelson 	__le16	cmd_flags;
1897f94234eeSShannon Nelson 	__le16	element_count;
1898f94234eeSShannon Nelson 	u8	reserved[4];
1899f94234eeSShannon Nelson 	__le32	address_high;
1900f94234eeSShannon Nelson 	__le32	address_low;
1901f94234eeSShannon Nelson };
1902f94234eeSShannon Nelson 
1903f94234eeSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_write);
1904f94234eeSShannon Nelson 
1905672415c5SShannon Nelson /* Used for 0x0704 as well as for 0x0705 commands */
1906f94234eeSShannon Nelson struct i40e_aqc_nvm_config_data_feature {
1907f94234eeSShannon Nelson 	__le16 feature_id;
1908f94234eeSShannon Nelson 	__le16 feature_options;
1909f94234eeSShannon Nelson 	__le16 feature_selection;
1910f94234eeSShannon Nelson };
1911f94234eeSShannon Nelson 
1912672415c5SShannon Nelson I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature);
1913672415c5SShannon Nelson 
1914f94234eeSShannon Nelson struct i40e_aqc_nvm_config_data_immediate_field {
1915672415c5SShannon Nelson 	__le32 field_id;
1916672415c5SShannon Nelson 	__le32 field_value;
1917f94234eeSShannon Nelson 	__le16 field_options;
1918672415c5SShannon Nelson 	__le16 reserved;
1919f94234eeSShannon Nelson };
1920f94234eeSShannon Nelson 
1921672415c5SShannon Nelson I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field);
1922672415c5SShannon Nelson 
192300ada50dSMichal Kosiarz /* OEM Post Update (indirect 0x0720)
192400ada50dSMichal Kosiarz  * no command data struct used
192500ada50dSMichal Kosiarz  */
192600ada50dSMichal Kosiarz struct i40e_aqc_nvm_oem_post_update {
192700ada50dSMichal Kosiarz 	u8 sel_data;
192800ada50dSMichal Kosiarz 	u8 reserved[7];
192900ada50dSMichal Kosiarz };
193000ada50dSMichal Kosiarz 
193100ada50dSMichal Kosiarz I40E_CHECK_STRUCT_LEN(0x8, i40e_aqc_nvm_oem_post_update);
193200ada50dSMichal Kosiarz 
193300ada50dSMichal Kosiarz struct i40e_aqc_nvm_oem_post_update_buffer {
193400ada50dSMichal Kosiarz 	u8 str_len;
193500ada50dSMichal Kosiarz 	u8 dev_addr;
193600ada50dSMichal Kosiarz 	__le16 eeprom_addr;
193700ada50dSMichal Kosiarz 	u8 data[36];
193800ada50dSMichal Kosiarz };
193900ada50dSMichal Kosiarz 
194000ada50dSMichal Kosiarz I40E_CHECK_STRUCT_LEN(0x28, i40e_aqc_nvm_oem_post_update_buffer);
194100ada50dSMichal Kosiarz 
19426774faf9SShannon Nelson /* Thermal Sensor (indirect 0x0721)
19436774faf9SShannon Nelson  *     read or set thermal sensor configs and values
19446774faf9SShannon Nelson  *     takes a sensor and command specific data buffer, not detailed here
19456774faf9SShannon Nelson  */
19466774faf9SShannon Nelson struct i40e_aqc_thermal_sensor {
19476774faf9SShannon Nelson 	u8 sensor_action;
19486774faf9SShannon Nelson 	u8 reserved[7];
19496774faf9SShannon Nelson 	__le32	addr_high;
19506774faf9SShannon Nelson 	__le32	addr_low;
19516774faf9SShannon Nelson };
19526774faf9SShannon Nelson 
19536774faf9SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_thermal_sensor);
19546774faf9SShannon Nelson 
195556a62fc8SJesse Brandeburg /* Send to PF command (indirect 0x0801) id is only used by PF
195656a62fc8SJesse Brandeburg  * Send to VF command (indirect 0x0802) id is only used by PF
195756a62fc8SJesse Brandeburg  * Send to Peer PF command (indirect 0x0803)
195856a62fc8SJesse Brandeburg  */
195956a62fc8SJesse Brandeburg struct i40e_aqc_pf_vf_message {
196056a62fc8SJesse Brandeburg 	__le32	id;
196156a62fc8SJesse Brandeburg 	u8	reserved[4];
196256a62fc8SJesse Brandeburg 	__le32	addr_high;
196356a62fc8SJesse Brandeburg 	__le32	addr_low;
196456a62fc8SJesse Brandeburg };
196556a62fc8SJesse Brandeburg 
196656a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_pf_vf_message);
196756a62fc8SJesse Brandeburg 
196856a62fc8SJesse Brandeburg /* Alternate structure */
196956a62fc8SJesse Brandeburg 
197056a62fc8SJesse Brandeburg /* Direct write (direct 0x0900)
197156a62fc8SJesse Brandeburg  * Direct read (direct 0x0902)
197256a62fc8SJesse Brandeburg  */
197356a62fc8SJesse Brandeburg struct i40e_aqc_alternate_write {
197456a62fc8SJesse Brandeburg 	__le32 address0;
197556a62fc8SJesse Brandeburg 	__le32 data0;
197656a62fc8SJesse Brandeburg 	__le32 address1;
197756a62fc8SJesse Brandeburg 	__le32 data1;
197856a62fc8SJesse Brandeburg };
197956a62fc8SJesse Brandeburg 
198056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_write);
198156a62fc8SJesse Brandeburg 
198256a62fc8SJesse Brandeburg /* Indirect write (indirect 0x0901)
198356a62fc8SJesse Brandeburg  * Indirect read (indirect 0x0903)
198456a62fc8SJesse Brandeburg  */
198556a62fc8SJesse Brandeburg 
198656a62fc8SJesse Brandeburg struct i40e_aqc_alternate_ind_write {
198756a62fc8SJesse Brandeburg 	__le32 address;
198856a62fc8SJesse Brandeburg 	__le32 length;
198956a62fc8SJesse Brandeburg 	__le32 addr_high;
199056a62fc8SJesse Brandeburg 	__le32 addr_low;
199156a62fc8SJesse Brandeburg };
199256a62fc8SJesse Brandeburg 
199356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_ind_write);
199456a62fc8SJesse Brandeburg 
199556a62fc8SJesse Brandeburg /* Done alternate write (direct 0x0904)
199656a62fc8SJesse Brandeburg  * uses i40e_aq_desc
199756a62fc8SJesse Brandeburg  */
199856a62fc8SJesse Brandeburg struct i40e_aqc_alternate_write_done {
199956a62fc8SJesse Brandeburg 	__le16	cmd_flags;
200056a62fc8SJesse Brandeburg 	u8	reserved[14];
200156a62fc8SJesse Brandeburg };
200256a62fc8SJesse Brandeburg 
200356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_write_done);
200456a62fc8SJesse Brandeburg 
200556a62fc8SJesse Brandeburg /* Set OEM mode (direct 0x0905) */
200656a62fc8SJesse Brandeburg struct i40e_aqc_alternate_set_mode {
200756a62fc8SJesse Brandeburg 	__le32	mode;
200856a62fc8SJesse Brandeburg 	u8	reserved[12];
200956a62fc8SJesse Brandeburg };
201056a62fc8SJesse Brandeburg 
201156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_set_mode);
201256a62fc8SJesse Brandeburg 
201356a62fc8SJesse Brandeburg /* Clear port Alternate RAM (direct 0x0906) uses i40e_aq_desc */
201456a62fc8SJesse Brandeburg 
201556a62fc8SJesse Brandeburg /* async events 0x10xx */
201656a62fc8SJesse Brandeburg 
201756a62fc8SJesse Brandeburg /* Lan Queue Overflow Event (direct, 0x1001) */
201856a62fc8SJesse Brandeburg struct i40e_aqc_lan_overflow {
201956a62fc8SJesse Brandeburg 	__le32	prtdcb_rupto;
202056a62fc8SJesse Brandeburg 	__le32	otx_ctl;
202156a62fc8SJesse Brandeburg 	u8	reserved[8];
202256a62fc8SJesse Brandeburg };
202356a62fc8SJesse Brandeburg 
202456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lan_overflow);
202556a62fc8SJesse Brandeburg 
202656a62fc8SJesse Brandeburg /* Get LLDP MIB (indirect 0x0A00) */
202756a62fc8SJesse Brandeburg struct i40e_aqc_lldp_get_mib {
202856a62fc8SJesse Brandeburg 	u8	type;
202956a62fc8SJesse Brandeburg 	u8	reserved1;
203056a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_MIB_TYPE_MASK		0x3
203156a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_MIB_LOCAL			0x0
203256a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_MIB_REMOTE			0x1
203356a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_BRIDGE_TYPE_MASK		0xC
203456a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT		0x2
203556a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE	0x0
203656a62fc8SJesse Brandeburg /* TX pause flags use I40E_AQ_LINK_TX_* above */
203756a62fc8SJesse Brandeburg 	__le16	local_len;
203856a62fc8SJesse Brandeburg 	__le16	remote_len;
203956a62fc8SJesse Brandeburg 	u8	reserved2[2];
204056a62fc8SJesse Brandeburg 	__le32	addr_high;
204156a62fc8SJesse Brandeburg 	__le32	addr_low;
204256a62fc8SJesse Brandeburg };
204356a62fc8SJesse Brandeburg 
204456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_get_mib);
204556a62fc8SJesse Brandeburg 
204656a62fc8SJesse Brandeburg /* Configure LLDP MIB Change Event (direct 0x0A01)
204756a62fc8SJesse Brandeburg  * also used for the event (with type in the command field)
204856a62fc8SJesse Brandeburg  */
204956a62fc8SJesse Brandeburg struct i40e_aqc_lldp_update_mib {
205056a62fc8SJesse Brandeburg 	u8	command;
205156a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_MIB_UPDATE_DISABLE	0x1
205256a62fc8SJesse Brandeburg 	u8	reserved[7];
205356a62fc8SJesse Brandeburg 	__le32	addr_high;
205456a62fc8SJesse Brandeburg 	__le32	addr_low;
205556a62fc8SJesse Brandeburg };
205656a62fc8SJesse Brandeburg 
205756a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_mib);
205856a62fc8SJesse Brandeburg 
205956a62fc8SJesse Brandeburg /* Add LLDP TLV (indirect 0x0A02)
206056a62fc8SJesse Brandeburg  * Delete LLDP TLV (indirect 0x0A04)
206156a62fc8SJesse Brandeburg  */
206256a62fc8SJesse Brandeburg struct i40e_aqc_lldp_add_tlv {
206356a62fc8SJesse Brandeburg 	u8	type; /* only nearest bridge and non-TPMR from 0x0A00 */
206456a62fc8SJesse Brandeburg 	u8	reserved1[1];
206556a62fc8SJesse Brandeburg 	__le16	len;
206656a62fc8SJesse Brandeburg 	u8	reserved2[4];
206756a62fc8SJesse Brandeburg 	__le32	addr_high;
206856a62fc8SJesse Brandeburg 	__le32	addr_low;
206956a62fc8SJesse Brandeburg };
207056a62fc8SJesse Brandeburg 
207156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_add_tlv);
207256a62fc8SJesse Brandeburg 
207356a62fc8SJesse Brandeburg /* Update LLDP TLV (indirect 0x0A03) */
207456a62fc8SJesse Brandeburg struct i40e_aqc_lldp_update_tlv {
207556a62fc8SJesse Brandeburg 	u8	type; /* only nearest bridge and non-TPMR from 0x0A00 */
207656a62fc8SJesse Brandeburg 	u8	reserved;
207756a62fc8SJesse Brandeburg 	__le16	old_len;
207856a62fc8SJesse Brandeburg 	__le16	new_offset;
207956a62fc8SJesse Brandeburg 	__le16	new_len;
208056a62fc8SJesse Brandeburg 	__le32	addr_high;
208156a62fc8SJesse Brandeburg 	__le32	addr_low;
208256a62fc8SJesse Brandeburg };
208356a62fc8SJesse Brandeburg 
208456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_tlv);
208556a62fc8SJesse Brandeburg 
208656a62fc8SJesse Brandeburg /* Stop LLDP (direct 0x0A05) */
208756a62fc8SJesse Brandeburg struct i40e_aqc_lldp_stop {
208856a62fc8SJesse Brandeburg 	u8	command;
208956a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_AGENT_SHUTDOWN		0x1
2090c65e78f8SAleksandr Loktionov #define I40E_AQ_LLDP_AGENT_STOP_PERSIST		0x2
209156a62fc8SJesse Brandeburg 	u8	reserved[15];
209256a62fc8SJesse Brandeburg };
209356a62fc8SJesse Brandeburg 
209456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop);
209556a62fc8SJesse Brandeburg 
209656a62fc8SJesse Brandeburg /* Start LLDP (direct 0x0A06) */
209756a62fc8SJesse Brandeburg struct i40e_aqc_lldp_start {
209856a62fc8SJesse Brandeburg 	u8	command;
209956a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_AGENT_START		0x1
2100c65e78f8SAleksandr Loktionov #define I40E_AQ_LLDP_AGENT_START_PERSIST	0x2
210156a62fc8SJesse Brandeburg 	u8	reserved[15];
210256a62fc8SJesse Brandeburg };
210356a62fc8SJesse Brandeburg 
210456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
210556a62fc8SJesse Brandeburg 
2106b6a02a6fSUpasana Menon /* Set DCB (direct 0x0303) */
2107b6a02a6fSUpasana Menon struct i40e_aqc_set_dcb_parameters {
2108b6a02a6fSUpasana Menon 	u8 command;
2109b6a02a6fSUpasana Menon #define I40E_AQ_DCB_SET_AGENT	0x1
2110b6a02a6fSUpasana Menon #define I40E_DCB_VALID		0x1
2111b6a02a6fSUpasana Menon 	u8 valid_flags;
2112b6a02a6fSUpasana Menon 	u8 reserved[14];
2113b6a02a6fSUpasana Menon };
2114b6a02a6fSUpasana Menon 
2115b6a02a6fSUpasana Menon I40E_CHECK_CMD_LENGTH(i40e_aqc_set_dcb_parameters);
2116b6a02a6fSUpasana Menon 
21179fa61dd2SNeerav Parikh /* Get CEE DCBX Oper Config (0x0A07)
21189fa61dd2SNeerav Parikh  * uses the generic descriptor struct
21199fa61dd2SNeerav Parikh  * returns below as indirect response
212056a62fc8SJesse Brandeburg  */
212156a62fc8SJesse Brandeburg 
21229fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_FCOE_SHIFT	0x0
21239fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_FCOE_MASK	(0x7 << I40E_AQC_CEE_APP_FCOE_SHIFT)
21249fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_ISCSI_SHIFT	0x3
21259fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_ISCSI_MASK	(0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT)
21269fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_FIP_SHIFT	0x8
21279fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_FIP_MASK	(0x7 << I40E_AQC_CEE_APP_FIP_SHIFT)
2128725821f3SShannon Nelson 
21299fa61dd2SNeerav Parikh #define I40E_AQC_CEE_PG_STATUS_SHIFT	0x0
21309fa61dd2SNeerav Parikh #define I40E_AQC_CEE_PG_STATUS_MASK	(0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT)
21319fa61dd2SNeerav Parikh #define I40E_AQC_CEE_PFC_STATUS_SHIFT	0x3
21329fa61dd2SNeerav Parikh #define I40E_AQC_CEE_PFC_STATUS_MASK	(0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT)
21339fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_STATUS_SHIFT	0x8
21349fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_STATUS_MASK	(0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT)
2135cb2f65bcSGreg Rose #define I40E_AQC_CEE_FCOE_STATUS_SHIFT	0x8
2136cb2f65bcSGreg Rose #define I40E_AQC_CEE_FCOE_STATUS_MASK	(0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT)
2137725821f3SShannon Nelson #define I40E_AQC_CEE_ISCSI_STATUS_SHIFT	0xB
2138cb2f65bcSGreg Rose #define I40E_AQC_CEE_ISCSI_STATUS_MASK	(0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT)
2139cb2f65bcSGreg Rose #define I40E_AQC_CEE_FIP_STATUS_SHIFT	0x10
2140cb2f65bcSGreg Rose #define I40E_AQC_CEE_FIP_STATUS_MASK	(0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT)
214117351401SShannon Nelson 
214217351401SShannon Nelson /* struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with
214317351401SShannon Nelson  * word boundary layout issues, which the Linux compilers silently deal
214417351401SShannon Nelson  * with by adding padding, making the actual struct larger than designed.
214517351401SShannon Nelson  * However, the FW compiler for the NIC is less lenient and complains
214617351401SShannon Nelson  * about the struct.  Hence, the struct defined here has an extra byte in
214717351401SShannon Nelson  * fields reserved3 and reserved4 to directly acknowledge that padding,
214817351401SShannon Nelson  * and the new length is used in the length check macro.
214917351401SShannon Nelson  */
21509fa61dd2SNeerav Parikh struct i40e_aqc_get_cee_dcb_cfg_v1_resp {
21519fa61dd2SNeerav Parikh 	u8	reserved1;
21529fa61dd2SNeerav Parikh 	u8	oper_num_tc;
21539fa61dd2SNeerav Parikh 	u8	oper_prio_tc[4];
21549fa61dd2SNeerav Parikh 	u8	reserved2;
21559fa61dd2SNeerav Parikh 	u8	oper_tc_bw[8];
21569fa61dd2SNeerav Parikh 	u8	oper_pfc_en;
215717351401SShannon Nelson 	u8	reserved3[2];
21589fa61dd2SNeerav Parikh 	__le16	oper_app_prio;
215917351401SShannon Nelson 	u8	reserved4[2];
21609fa61dd2SNeerav Parikh 	__le16	tlv_status;
21619fa61dd2SNeerav Parikh };
21629fa61dd2SNeerav Parikh 
21639fa61dd2SNeerav Parikh I40E_CHECK_STRUCT_LEN(0x18, i40e_aqc_get_cee_dcb_cfg_v1_resp);
21649fa61dd2SNeerav Parikh 
21659fa61dd2SNeerav Parikh struct i40e_aqc_get_cee_dcb_cfg_resp {
21669fa61dd2SNeerav Parikh 	u8	oper_num_tc;
21679fa61dd2SNeerav Parikh 	u8	oper_prio_tc[4];
21689fa61dd2SNeerav Parikh 	u8	oper_tc_bw[8];
21699fa61dd2SNeerav Parikh 	u8	oper_pfc_en;
21709fa61dd2SNeerav Parikh 	__le16	oper_app_prio;
2171672415c5SShannon Nelson #define I40E_AQC_CEE_APP_FCOE_SHIFT	0x0
2172672415c5SShannon Nelson #define I40E_AQC_CEE_APP_FCOE_MASK	(0x7 << I40E_AQC_CEE_APP_FCOE_SHIFT)
2173672415c5SShannon Nelson #define I40E_AQC_CEE_APP_ISCSI_SHIFT	0x3
2174672415c5SShannon Nelson #define I40E_AQC_CEE_APP_ISCSI_MASK	(0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT)
2175672415c5SShannon Nelson #define I40E_AQC_CEE_APP_FIP_SHIFT	0x8
2176672415c5SShannon Nelson #define I40E_AQC_CEE_APP_FIP_MASK	(0x7 << I40E_AQC_CEE_APP_FIP_SHIFT)
2177672415c5SShannon Nelson #define I40E_AQC_CEE_APP_FIP_MASK	(0x7 << I40E_AQC_CEE_APP_FIP_SHIFT)
21789fa61dd2SNeerav Parikh 	__le32	tlv_status;
2179672415c5SShannon Nelson #define I40E_AQC_CEE_PG_STATUS_SHIFT	0x0
2180672415c5SShannon Nelson #define I40E_AQC_CEE_PG_STATUS_MASK	(0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT)
2181672415c5SShannon Nelson #define I40E_AQC_CEE_PFC_STATUS_SHIFT	0x3
2182672415c5SShannon Nelson #define I40E_AQC_CEE_PFC_STATUS_MASK	(0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT)
2183672415c5SShannon Nelson #define I40E_AQC_CEE_APP_STATUS_SHIFT	0x8
2184672415c5SShannon Nelson #define I40E_AQC_CEE_APP_STATUS_MASK	(0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT)
21859fa61dd2SNeerav Parikh 	u8	reserved[12];
21869fa61dd2SNeerav Parikh };
21879fa61dd2SNeerav Parikh 
21889fa61dd2SNeerav Parikh I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_cee_dcb_cfg_resp);
21899fa61dd2SNeerav Parikh 
2190672415c5SShannon Nelson /*	Set Local LLDP MIB (indirect 0x0A08)
2191672415c5SShannon Nelson  *	Used to replace the local MIB of a given LLDP agent. e.g. DCBx
2192672415c5SShannon Nelson  */
2193672415c5SShannon Nelson struct i40e_aqc_lldp_set_local_mib {
219490bc8e00SArkadiusz Kubalewski #define SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT	0
219590bc8e00SArkadiusz Kubalewski #define SET_LOCAL_MIB_AC_TYPE_DCBX_MASK	(1 << \
219690bc8e00SArkadiusz Kubalewski 					SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT)
219790bc8e00SArkadiusz Kubalewski #define SET_LOCAL_MIB_AC_TYPE_LOCAL_MIB	0x0
219890bc8e00SArkadiusz Kubalewski #define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT	(1)
219990bc8e00SArkadiusz Kubalewski #define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_MASK	(1 << \
220090bc8e00SArkadiusz Kubalewski 				SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT)
220190bc8e00SArkadiusz Kubalewski #define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS		0x1
2202672415c5SShannon Nelson 	u8	type;
2203672415c5SShannon Nelson 	u8	reserved0;
2204672415c5SShannon Nelson 	__le16	length;
2205672415c5SShannon Nelson 	u8	reserved1[4];
2206672415c5SShannon Nelson 	__le32	address_high;
2207672415c5SShannon Nelson 	__le32	address_low;
2208672415c5SShannon Nelson };
2209672415c5SShannon Nelson 
2210672415c5SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_set_local_mib);
2211672415c5SShannon Nelson 
2212672415c5SShannon Nelson /*	Stop/Start LLDP Agent (direct 0x0A09)
2213672415c5SShannon Nelson  *	Used for stopping/starting specific LLDP agent. e.g. DCBx
2214672415c5SShannon Nelson  */
2215672415c5SShannon Nelson struct i40e_aqc_lldp_stop_start_specific_agent {
2216672415c5SShannon Nelson 	u8	command;
2217672415c5SShannon Nelson 	u8	reserved[15];
2218672415c5SShannon Nelson };
2219672415c5SShannon Nelson 
2220672415c5SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop_start_specific_agent);
2221672415c5SShannon Nelson 
2222c65e78f8SAleksandr Loktionov /* Restore LLDP Agent factory settings (direct 0x0A0A) */
2223c65e78f8SAleksandr Loktionov struct i40e_aqc_lldp_restore {
2224c65e78f8SAleksandr Loktionov 	u8	command;
2225c65e78f8SAleksandr Loktionov #define I40E_AQ_LLDP_AGENT_RESTORE		0x1
2226c65e78f8SAleksandr Loktionov 	u8	reserved[15];
2227c65e78f8SAleksandr Loktionov };
2228c65e78f8SAleksandr Loktionov 
2229c65e78f8SAleksandr Loktionov I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_restore);
2230c65e78f8SAleksandr Loktionov 
223156a62fc8SJesse Brandeburg /* Add Udp Tunnel command and completion (direct 0x0B00) */
223256a62fc8SJesse Brandeburg struct i40e_aqc_add_udp_tunnel {
223356a62fc8SJesse Brandeburg 	__le16	udp_port;
22340aebd2d9SShannon Nelson 	u8	reserved0[3];
2235981b7545SShannon Nelson 	u8	protocol_type;
22360aebd2d9SShannon Nelson #define I40E_AQC_TUNNEL_TYPE_VXLAN	0x00
22370aebd2d9SShannon Nelson #define I40E_AQC_TUNNEL_TYPE_NGE	0x01
22380aebd2d9SShannon Nelson 	u8	reserved1[10];
223956a62fc8SJesse Brandeburg };
224056a62fc8SJesse Brandeburg 
224156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel);
224256a62fc8SJesse Brandeburg 
2243981b7545SShannon Nelson struct i40e_aqc_add_udp_tunnel_completion {
2244981b7545SShannon Nelson 	__le16	udp_port;
2245981b7545SShannon Nelson 	u8	filter_entry_index;
2246981b7545SShannon Nelson 	u8	multiple_pfs;
2247981b7545SShannon Nelson 	u8	total_filters;
2248981b7545SShannon Nelson 	u8	reserved[11];
2249981b7545SShannon Nelson };
2250981b7545SShannon Nelson 
2251981b7545SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel_completion);
2252981b7545SShannon Nelson 
225356a62fc8SJesse Brandeburg /* remove UDP Tunnel command (0x0B01) */
225456a62fc8SJesse Brandeburg struct i40e_aqc_remove_udp_tunnel {
225556a62fc8SJesse Brandeburg 	u8	reserved[2];
225656a62fc8SJesse Brandeburg 	u8	index; /* 0 to 15 */
2257981b7545SShannon Nelson 	u8	reserved2[13];
225856a62fc8SJesse Brandeburg };
225956a62fc8SJesse Brandeburg 
226056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_udp_tunnel);
226156a62fc8SJesse Brandeburg 
226256a62fc8SJesse Brandeburg struct i40e_aqc_del_udp_tunnel_completion {
226356a62fc8SJesse Brandeburg 	__le16	udp_port;
226456a62fc8SJesse Brandeburg 	u8	index; /* 0 to 15 */
2265981b7545SShannon Nelson 	u8	multiple_pfs;
2266981b7545SShannon Nelson 	u8	total_filters_used;
2267981b7545SShannon Nelson 	u8	reserved1[11];
226856a62fc8SJesse Brandeburg };
226956a62fc8SJesse Brandeburg 
227056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion);
227156a62fc8SJesse Brandeburg 
2272e50c8d6dSAnjali Singhai Jain struct i40e_aqc_get_set_rss_key {
22732101bac2SJacob Keller #define I40E_AQC_SET_RSS_KEY_VSI_VALID		BIT(15)
2274e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT	0
2275e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK	(0x3FF << \
2276e50c8d6dSAnjali Singhai Jain 					I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT)
2277e50c8d6dSAnjali Singhai Jain 	__le16	vsi_id;
2278e50c8d6dSAnjali Singhai Jain 	u8	reserved[6];
2279e50c8d6dSAnjali Singhai Jain 	__le32	addr_high;
2280e50c8d6dSAnjali Singhai Jain 	__le32	addr_low;
2281e50c8d6dSAnjali Singhai Jain };
2282e50c8d6dSAnjali Singhai Jain 
2283e50c8d6dSAnjali Singhai Jain I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key);
2284e50c8d6dSAnjali Singhai Jain 
2285e50c8d6dSAnjali Singhai Jain struct i40e_aqc_get_set_rss_key_data {
2286e50c8d6dSAnjali Singhai Jain 	u8 standard_rss_key[0x28];
2287e50c8d6dSAnjali Singhai Jain 	u8 extended_hash_key[0xc];
2288e50c8d6dSAnjali Singhai Jain };
2289e50c8d6dSAnjali Singhai Jain 
2290e50c8d6dSAnjali Singhai Jain I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data);
2291e50c8d6dSAnjali Singhai Jain 
2292e50c8d6dSAnjali Singhai Jain struct  i40e_aqc_get_set_rss_lut {
22932101bac2SJacob Keller #define I40E_AQC_SET_RSS_LUT_VSI_VALID		BIT(15)
2294e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT	0
2295e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK	(0x3FF << \
2296e50c8d6dSAnjali Singhai Jain 					I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT)
2297e50c8d6dSAnjali Singhai Jain 	__le16	vsi_id;
2298e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT	0
22992101bac2SJacob Keller #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK	BIT(I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT)
2300e50c8d6dSAnjali Singhai Jain 
2301e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI	0
2302e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF	1
2303e50c8d6dSAnjali Singhai Jain 	__le16	flags;
2304e50c8d6dSAnjali Singhai Jain 	u8	reserved[4];
2305e50c8d6dSAnjali Singhai Jain 	__le32	addr_high;
2306e50c8d6dSAnjali Singhai Jain 	__le32	addr_low;
2307e50c8d6dSAnjali Singhai Jain };
2308e50c8d6dSAnjali Singhai Jain 
2309e50c8d6dSAnjali Singhai Jain I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut);
2310e50c8d6dSAnjali Singhai Jain 
231156a62fc8SJesse Brandeburg /* tunnel key structure 0x0B10 */
2312981b7545SShannon Nelson 
231356a62fc8SJesse Brandeburg struct i40e_aqc_tunnel_key_structure {
2314981b7545SShannon Nelson 	u8	key1_off;
2315981b7545SShannon Nelson 	u8	key2_off;
2316981b7545SShannon Nelson 	u8	key1_len;  /* 0 to 15 */
2317981b7545SShannon Nelson 	u8	key2_len;  /* 0 to 15 */
2318981b7545SShannon Nelson 	u8	flags;
2319981b7545SShannon Nelson 	u8	network_key_index;
2320981b7545SShannon Nelson 	u8	reserved[10];
232156a62fc8SJesse Brandeburg };
232256a62fc8SJesse Brandeburg 
232356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_tunnel_key_structure);
232456a62fc8SJesse Brandeburg 
232556a62fc8SJesse Brandeburg /* OEM mode commands (direct 0xFE0x) */
232656a62fc8SJesse Brandeburg struct i40e_aqc_oem_param_change {
232756a62fc8SJesse Brandeburg 	__le32	param_type;
232856a62fc8SJesse Brandeburg 	__le32	param_value1;
232935155fe6SShannon Nelson 	__le16	param_value2;
233035155fe6SShannon Nelson 	u8	reserved[6];
233156a62fc8SJesse Brandeburg };
233256a62fc8SJesse Brandeburg 
233356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_oem_param_change);
233456a62fc8SJesse Brandeburg 
233556a62fc8SJesse Brandeburg struct i40e_aqc_oem_state_change {
233656a62fc8SJesse Brandeburg 	__le32	state;
233756a62fc8SJesse Brandeburg 	u8	reserved[12];
233856a62fc8SJesse Brandeburg };
233956a62fc8SJesse Brandeburg 
234056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_oem_state_change);
234156a62fc8SJesse Brandeburg 
2342672415c5SShannon Nelson /* Initialize OCSD (0xFE02, direct) */
2343672415c5SShannon Nelson struct i40e_aqc_opc_oem_ocsd_initialize {
2344672415c5SShannon Nelson 	u8 type_status;
2345672415c5SShannon Nelson 	u8 reserved1[3];
2346672415c5SShannon Nelson 	__le32 ocsd_memory_block_addr_high;
2347672415c5SShannon Nelson 	__le32 ocsd_memory_block_addr_low;
2348672415c5SShannon Nelson 	__le32 requested_update_interval;
2349672415c5SShannon Nelson };
2350672415c5SShannon Nelson 
2351672415c5SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_opc_oem_ocsd_initialize);
2352672415c5SShannon Nelson 
2353672415c5SShannon Nelson /* Initialize OCBB  (0xFE03, direct) */
2354672415c5SShannon Nelson struct i40e_aqc_opc_oem_ocbb_initialize {
2355672415c5SShannon Nelson 	u8 type_status;
2356672415c5SShannon Nelson 	u8 reserved1[3];
2357672415c5SShannon Nelson 	__le32 ocbb_memory_block_addr_high;
2358672415c5SShannon Nelson 	__le32 ocbb_memory_block_addr_low;
2359672415c5SShannon Nelson 	u8 reserved2[4];
2360672415c5SShannon Nelson };
2361672415c5SShannon Nelson 
2362672415c5SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_opc_oem_ocbb_initialize);
2363672415c5SShannon Nelson 
236456a62fc8SJesse Brandeburg /* debug commands */
236556a62fc8SJesse Brandeburg 
236656a62fc8SJesse Brandeburg /* get device id (0xFF00) uses the generic structure */
236756a62fc8SJesse Brandeburg 
236856a62fc8SJesse Brandeburg /* set test more (0xFF01, internal) */
236956a62fc8SJesse Brandeburg 
237056a62fc8SJesse Brandeburg struct i40e_acq_set_test_mode {
237156a62fc8SJesse Brandeburg 	u8	mode;
237256a62fc8SJesse Brandeburg 	u8	reserved[3];
237356a62fc8SJesse Brandeburg 	u8	command;
237456a62fc8SJesse Brandeburg 	u8	reserved2[3];
237556a62fc8SJesse Brandeburg 	__le32	address_high;
237656a62fc8SJesse Brandeburg 	__le32	address_low;
237756a62fc8SJesse Brandeburg };
237856a62fc8SJesse Brandeburg 
237956a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_acq_set_test_mode);
238056a62fc8SJesse Brandeburg 
238156a62fc8SJesse Brandeburg /* Debug Read Register command (0xFF03)
238256a62fc8SJesse Brandeburg  * Debug Write Register command (0xFF04)
238356a62fc8SJesse Brandeburg  */
238456a62fc8SJesse Brandeburg struct i40e_aqc_debug_reg_read_write {
238556a62fc8SJesse Brandeburg 	__le32 reserved;
238656a62fc8SJesse Brandeburg 	__le32 address;
238756a62fc8SJesse Brandeburg 	__le32 value_high;
238856a62fc8SJesse Brandeburg 	__le32 value_low;
238956a62fc8SJesse Brandeburg };
239056a62fc8SJesse Brandeburg 
239156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_reg_read_write);
239256a62fc8SJesse Brandeburg 
239356a62fc8SJesse Brandeburg /* Scatter/gather Reg Read  (indirect 0xFF05)
239456a62fc8SJesse Brandeburg  * Scatter/gather Reg Write (indirect 0xFF06)
239556a62fc8SJesse Brandeburg  */
239656a62fc8SJesse Brandeburg 
239756a62fc8SJesse Brandeburg /* i40e_aq_desc is used for the command */
239856a62fc8SJesse Brandeburg struct i40e_aqc_debug_reg_sg_element_data {
239956a62fc8SJesse Brandeburg 	__le32 address;
240056a62fc8SJesse Brandeburg 	__le32 value;
240156a62fc8SJesse Brandeburg };
240256a62fc8SJesse Brandeburg 
240356a62fc8SJesse Brandeburg /* Debug Modify register (direct 0xFF07) */
240456a62fc8SJesse Brandeburg struct i40e_aqc_debug_modify_reg {
240556a62fc8SJesse Brandeburg 	__le32 address;
240656a62fc8SJesse Brandeburg 	__le32 value;
240756a62fc8SJesse Brandeburg 	__le32 clear_mask;
240856a62fc8SJesse Brandeburg 	__le32 set_mask;
240956a62fc8SJesse Brandeburg };
241056a62fc8SJesse Brandeburg 
241156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_reg);
241256a62fc8SJesse Brandeburg 
241356a62fc8SJesse Brandeburg /* dump internal data (0xFF08, indirect) */
241456a62fc8SJesse Brandeburg struct i40e_aqc_debug_dump_internals {
241556a62fc8SJesse Brandeburg 	u8	cluster_id;
241656a62fc8SJesse Brandeburg 	u8	table_id;
241756a62fc8SJesse Brandeburg 	__le16	data_size;
241856a62fc8SJesse Brandeburg 	__le32	idx;
241956a62fc8SJesse Brandeburg 	__le32	address_high;
242056a62fc8SJesse Brandeburg 	__le32	address_low;
242156a62fc8SJesse Brandeburg };
242256a62fc8SJesse Brandeburg 
242356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_dump_internals);
242456a62fc8SJesse Brandeburg 
242556a62fc8SJesse Brandeburg struct i40e_aqc_debug_modify_internals {
242656a62fc8SJesse Brandeburg 	u8	cluster_id;
242756a62fc8SJesse Brandeburg 	u8	cluster_specific_params[7];
242856a62fc8SJesse Brandeburg 	__le32	address_high;
242956a62fc8SJesse Brandeburg 	__le32	address_low;
243056a62fc8SJesse Brandeburg };
243156a62fc8SJesse Brandeburg 
243256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_internals);
243356a62fc8SJesse Brandeburg 
24342f175f55SHelin Zhang #endif /* _I40E_ADMINQ_CMD_H_ */
2435