1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2001-2021 Intel Corporation
5 #ifndef _ICE_ADMINQ_CMD_H_
6 #define _ICE_ADMINQ_CMD_H_
8 /* This header file defines the Admin Queue commands, error codes and
9 * descriptor format. It is shared between Firmware and Software.
12 #define ICE_MAX_VSI 768
13 #define ICE_AQC_TOPO_MAX_LEVEL_NUM 0x9
14 #define ICE_AQ_SET_MAC_FRAME_SIZE_MAX 9728
16 struct ice_aqc_generic {
23 /* Get version (direct 0x0001) */
24 struct ice_aqc_get_ver {
37 /* Send driver version (indirect 0x0002) */
38 struct ice_aqc_driver_ver {
48 /* Queue Shutdown (direct 0x0003) */
49 struct ice_aqc_q_shutdown {
51 #define ICE_AQC_DRIVER_UNLOADING BIT(0)
55 /* Request resource ownership (direct 0x0008)
56 * Release resource ownership (direct 0x0009)
58 struct ice_aqc_req_res {
60 #define ICE_AQC_RES_ID_NVM 1
61 #define ICE_AQC_RES_ID_SDP 2
62 #define ICE_AQC_RES_ID_CHNG_LOCK 3
63 #define ICE_AQC_RES_ID_GLBL_LOCK 4
65 #define ICE_AQC_RES_ACCESS_READ 1
66 #define ICE_AQC_RES_ACCESS_WRITE 2
68 /* Upon successful completion, FW writes this value and driver is
69 * expected to release resource before timeout. This value is provided
73 #define ICE_AQ_RES_NVM_READ_DFLT_TIMEOUT_MS 3000
74 #define ICE_AQ_RES_NVM_WRITE_DFLT_TIMEOUT_MS 180000
75 #define ICE_AQ_RES_CHNG_LOCK_DFLT_TIMEOUT_MS 1000
76 #define ICE_AQ_RES_GLBL_LOCK_DFLT_TIMEOUT_MS 3000
77 /* For SDP: pin ID of the SDP */
79 /* Status is only used for ICE_AQC_RES_ID_GLBL_LOCK */
81 #define ICE_AQ_RES_GLBL_SUCCESS 0
82 #define ICE_AQ_RES_GLBL_IN_PROG 1
83 #define ICE_AQ_RES_GLBL_DONE 2
87 /* Get function capabilities (indirect 0x000A)
88 * Get device capabilities (indirect 0x000B)
90 struct ice_aqc_list_caps {
99 /* Device/Function buffer entry, repeated per reported capability */
100 struct ice_aqc_list_caps_elem {
102 #define ICE_AQC_CAPS_VALID_FUNCTIONS 0x0005
103 #define ICE_AQC_MAX_VALID_FUNCTIONS 0x8
104 #define ICE_AQC_CAPS_VSI 0x0017
105 #define ICE_AQC_CAPS_DCB 0x0018
106 #define ICE_AQC_CAPS_RSS 0x0040
107 #define ICE_AQC_CAPS_RXQS 0x0041
108 #define ICE_AQC_CAPS_TXQS 0x0042
109 #define ICE_AQC_CAPS_MSIX 0x0043
110 #define ICE_AQC_CAPS_FD 0x0045
111 #define ICE_AQC_CAPS_MAX_MTU 0x0047
112 #define ICE_AQC_CAPS_IWARP 0x0051
113 #define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076
114 #define ICE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT 0x0077
115 #define ICE_AQC_CAPS_NVM_MGMT 0x0080
119 /* Number of resources described by this capability */
121 /* Only meaningful for some types of resources */
123 /* Only meaningful for some types of resources */
129 /* Manage MAC address, read command - indirect (0x0107)
130 * This struct is also used for the response
132 struct ice_aqc_manage_mac_read {
133 __le16 flags; /* Zeroed by device driver */
134 #define ICE_AQC_MAN_MAC_LAN_ADDR_VALID BIT(4)
135 #define ICE_AQC_MAN_MAC_SAN_ADDR_VALID BIT(5)
136 #define ICE_AQC_MAN_MAC_PORT_ADDR_VALID BIT(6)
137 #define ICE_AQC_MAN_MAC_WOL_ADDR_VALID BIT(7)
138 #define ICE_AQC_MAN_MAC_MC_MAG_EN BIT(8)
139 #define ICE_AQC_MAN_MAC_WOL_PRESERVE_ON_PFR BIT(9)
140 #define ICE_AQC_MAN_MAC_READ_S 4
141 #define ICE_AQC_MAN_MAC_READ_M (0xF << ICE_AQC_MAN_MAC_READ_S)
143 u8 num_addr; /* Used in response */
149 /* Response buffer format for manage MAC read command */
150 struct ice_aqc_manage_mac_read_resp {
153 #define ICE_AQC_MAN_MAC_ADDR_TYPE_LAN 0
154 #define ICE_AQC_MAN_MAC_ADDR_TYPE_WOL 1
155 u8 mac_addr[ETH_ALEN];
158 /* Manage MAC address, write command - direct (0x0108) */
159 struct ice_aqc_manage_mac_write {
162 #define ICE_AQC_MAN_MAC_WR_MC_MAG_EN BIT(0)
163 #define ICE_AQC_MAN_MAC_WR_WOL_LAA_PFR_KEEP BIT(1)
164 #define ICE_AQC_MAN_MAC_WR_S 6
165 #define ICE_AQC_MAN_MAC_WR_M MAKEMASK(3, ICE_AQC_MAN_MAC_WR_S)
166 #define ICE_AQC_MAN_MAC_UPDATE_LAA 0
167 #define ICE_AQC_MAN_MAC_UPDATE_LAA_WOL BIT(ICE_AQC_MAN_MAC_WR_S)
168 /* byte stream in network order */
169 u8 mac_addr[ETH_ALEN];
174 /* Clear PXE Command and response (direct 0x0110) */
175 struct ice_aqc_clear_pxe {
177 #define ICE_AQC_CLEAR_PXE_RX_CNT 0x2
181 /* Configure No-Drop Policy Command (direct 0x0112) */
182 struct ice_aqc_config_no_drop_policy {
184 #define ICE_AQC_FORCE_NO_DROP BIT(0)
188 /* Get switch configuration (0x0200) */
189 struct ice_aqc_get_sw_cfg {
190 /* Reserved for command and copy of request flags for response */
192 /* First desc in case of command and next_elem in case of response
193 * In case of response, if it is not zero, means all the configuration
194 * was not returned and new command shall be sent with this value in
195 * the 'first desc' field
198 /* Reserved for command, only used for response */
205 /* Each entry in the response buffer is of the following type: */
206 struct ice_aqc_get_sw_cfg_resp_elem {
207 /* VSI/Port Number */
209 #define ICE_AQC_GET_SW_CONF_RESP_VSI_PORT_NUM_S 0
210 #define ICE_AQC_GET_SW_CONF_RESP_VSI_PORT_NUM_M \
211 (0x3FF << ICE_AQC_GET_SW_CONF_RESP_VSI_PORT_NUM_S)
212 #define ICE_AQC_GET_SW_CONF_RESP_TYPE_S 14
213 #define ICE_AQC_GET_SW_CONF_RESP_TYPE_M (0x3 << ICE_AQC_GET_SW_CONF_RESP_TYPE_S)
214 #define ICE_AQC_GET_SW_CONF_RESP_PHYS_PORT 0
215 #define ICE_AQC_GET_SW_CONF_RESP_VIRT_PORT 1
216 #define ICE_AQC_GET_SW_CONF_RESP_VSI 2
218 /* SWID VSI/Port belongs to */
221 /* Bit 14..0 : PF/VF number VSI belongs to
222 * Bit 15 : VF indication bit
225 #define ICE_AQC_GET_SW_CONF_RESP_FUNC_NUM_S 0
226 #define ICE_AQC_GET_SW_CONF_RESP_FUNC_NUM_M \
227 (0x7FFF << ICE_AQC_GET_SW_CONF_RESP_FUNC_NUM_S)
228 #define ICE_AQC_GET_SW_CONF_RESP_IS_VF BIT(15)
231 /* Set Port parameters, (direct, 0x0203) */
232 struct ice_aqc_set_port_params {
234 #define ICE_AQC_SET_P_PARAMS_SAVE_BAD_PACKETS BIT(0)
235 #define ICE_AQC_SET_P_PARAMS_PAD_SHORT_PACKETS BIT(1)
236 #define ICE_AQC_SET_P_PARAMS_DOUBLE_VLAN_ENA BIT(2)
237 __le16 bad_frame_vsi;
238 #define ICE_AQC_SET_P_PARAMS_VSI_S 0
239 #define ICE_AQC_SET_P_PARAMS_VSI_M (0x3FF << ICE_AQC_SET_P_PARAMS_VSI_S)
240 #define ICE_AQC_SET_P_PARAMS_VSI_VALID BIT(15)
242 #define ICE_AQC_SET_P_PARAMS_SWID_S 0
243 #define ICE_AQC_SET_P_PARAMS_SWID_M (0xFF << ICE_AQC_SET_P_PARAMS_SWID_S)
244 #define ICE_AQC_SET_P_PARAMS_LOGI_PORT_ID_S 8
245 #define ICE_AQC_SET_P_PARAMS_LOGI_PORT_ID_M \
246 (0x3F << ICE_AQC_SET_P_PARAMS_LOGI_PORT_ID_S)
247 #define ICE_AQC_SET_P_PARAMS_IS_LOGI_PORT BIT(14)
248 #define ICE_AQC_SET_P_PARAMS_SWID_VALID BIT(15)
252 /* These resource type defines are used for all switch resource
253 * commands where a resource type is required, such as:
254 * Get Resource Allocation command (indirect 0x0204)
255 * Allocate Resources command (indirect 0x0208)
256 * Free Resources command (indirect 0x0209)
257 * Get Allocated Resource Descriptors Command (indirect 0x020A)
259 #define ICE_AQC_RES_TYPE_VEB_COUNTER 0x00
260 #define ICE_AQC_RES_TYPE_VLAN_COUNTER 0x01
261 #define ICE_AQC_RES_TYPE_MIRROR_RULE 0x02
262 #define ICE_AQC_RES_TYPE_VSI_LIST_REP 0x03
263 #define ICE_AQC_RES_TYPE_VSI_LIST_PRUNE 0x04
264 #define ICE_AQC_RES_TYPE_RECIPE 0x05
265 #define ICE_AQC_RES_TYPE_PROFILE 0x06
266 #define ICE_AQC_RES_TYPE_SWID 0x07
267 #define ICE_AQC_RES_TYPE_VSI 0x08
268 #define ICE_AQC_RES_TYPE_FLU 0x09
269 #define ICE_AQC_RES_TYPE_WIDE_TABLE_1 0x0A
270 #define ICE_AQC_RES_TYPE_WIDE_TABLE_2 0x0B
271 #define ICE_AQC_RES_TYPE_WIDE_TABLE_4 0x0C
272 #define ICE_AQC_RES_TYPE_GLOBAL_RSS_HASH 0x20
273 #define ICE_AQC_RES_TYPE_FDIR_COUNTER_BLOCK 0x21
274 #define ICE_AQC_RES_TYPE_FDIR_GUARANTEED_ENTRIES 0x22
275 #define ICE_AQC_RES_TYPE_FDIR_SHARED_ENTRIES 0x23
276 #define ICE_AQC_RES_TYPE_FLEX_DESC_PROG 0x30
277 #define ICE_AQC_RES_TYPE_SWITCH_PROF_BLDR_PROFID 0x48
278 #define ICE_AQC_RES_TYPE_SWITCH_PROF_BLDR_TCAM 0x49
279 #define ICE_AQC_RES_TYPE_ACL_PROF_BLDR_PROFID 0x50
280 #define ICE_AQC_RES_TYPE_ACL_PROF_BLDR_TCAM 0x51
281 #define ICE_AQC_RES_TYPE_FD_PROF_BLDR_PROFID 0x58
282 #define ICE_AQC_RES_TYPE_FD_PROF_BLDR_TCAM 0x59
283 #define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_PROFID 0x60
284 #define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_TCAM 0x61
285 /* Resource types 0x62-67 are reserved for Hash profile builder */
286 #define ICE_AQC_RES_TYPE_QHASH_PROF_BLDR_PROFID 0x68
287 #define ICE_AQC_RES_TYPE_QHASH_PROF_BLDR_TCAM 0x69
289 #define ICE_AQC_RES_TYPE_FLAG_SHARED BIT(7)
290 #define ICE_AQC_RES_TYPE_FLAG_SCAN_BOTTOM BIT(12)
291 #define ICE_AQC_RES_TYPE_FLAG_IGNORE_INDEX BIT(13)
293 #define ICE_AQC_RES_TYPE_FLAG_DEDICATED 0x00
295 #define ICE_AQC_RES_TYPE_S 0
296 #define ICE_AQC_RES_TYPE_M (0x07F << ICE_AQC_RES_TYPE_S)
298 /* Get Resource Allocation command (indirect 0x0204) */
299 struct ice_aqc_get_res_alloc {
300 __le16 resp_elem_num; /* Used in response, reserved in command */
306 /* Get Resource Allocation Response Buffer per response */
307 struct ice_aqc_get_res_resp_elem {
308 __le16 res_type; /* Types defined above cmd 0x0204 */
309 __le16 total_capacity; /* Resources available to all PF's */
310 __le16 total_function; /* Resources allocated for a PF */
311 __le16 total_shared; /* Resources allocated as shared */
312 __le16 total_free; /* Resources un-allocated/not reserved by any PF */
315 /* Allocate Resources command (indirect 0x0208)
316 * Free Resources command (indirect 0x0209)
318 struct ice_aqc_alloc_free_res_cmd {
319 __le16 num_entries; /* Number of Resource entries */
325 /* Resource descriptor */
326 struct ice_aqc_res_elem {
333 /* Buffer for Allocate/Free Resources commands */
334 struct ice_aqc_alloc_free_res_elem {
335 __le16 res_type; /* Types defined above cmd 0x0204 */
336 #define ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_S 8
337 #define ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_M \
338 (0xF << ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_S)
340 struct ice_aqc_res_elem elem[STRUCT_HACK_VAR_LEN];
343 /* Get Allocated Resource Descriptors Command (indirect 0x020A) */
344 struct ice_aqc_get_allocd_res_desc {
347 __le16 res; /* Types defined above cmd 0x0204 */
362 /* Request buffer for Set VLAN Mode AQ command (indirect 0x020C) */
363 struct ice_aqc_set_vlan_mode {
365 u8 l2tag_prio_tagging;
366 #define ICE_AQ_VLAN_PRIO_TAG_S 0
367 #define ICE_AQ_VLAN_PRIO_TAG_M (0x7 << ICE_AQ_VLAN_PRIO_TAG_S)
368 #define ICE_AQ_VLAN_PRIO_TAG_NOT_SUPPORTED 0x0
369 #define ICE_AQ_VLAN_PRIO_TAG_STAG 0x1
370 #define ICE_AQ_VLAN_PRIO_TAG_OUTER_CTAG 0x2
371 #define ICE_AQ_VLAN_PRIO_TAG_OUTER_VLAN 0x3
372 #define ICE_AQ_VLAN_PRIO_TAG_INNER_CTAG 0x4
373 #define ICE_AQ_VLAN_PRIO_TAG_MAX 0x4
374 #define ICE_AQ_VLAN_PRIO_TAG_ERROR 0x7
375 u8 l2tag_reserved[64];
377 #define ICE_AQ_VLAN_RDMA_TAG_S 0
378 #define ICE_AQ_VLAN_RDMA_TAG_M (0x3F << ICE_AQ_VLAN_RDMA_TAG_S)
379 #define ICE_AQ_SVM_VLAN_RDMA_PKT_FLAG_SETTING 0x10
380 #define ICE_AQ_DVM_VLAN_RDMA_PKT_FLAG_SETTING 0x1A
383 #define ICE_AQ_VLAN_MNG_PROTOCOL_ID_OUTER 0x10
384 #define ICE_AQ_VLAN_MNG_PROTOCOL_ID_INNER 0x11
385 u8 prot_id_reserved[30];
388 /* Response buffer for Get VLAN Mode AQ command (indirect 0x020D) */
389 struct ice_aqc_get_vlan_mode {
391 #define ICE_AQ_VLAN_MODE_DVM_ENA BIT(0)
392 u8 l2tag_prio_tagging;
396 /* Add VSI (indirect 0x0210)
397 * Update VSI (indirect 0x0211)
398 * Get VSI (indirect 0x0212)
399 * Free VSI (indirect 0x0213)
401 struct ice_aqc_add_get_update_free_vsi {
403 #define ICE_AQ_VSI_NUM_S 0
404 #define ICE_AQ_VSI_NUM_M (0x03FF << ICE_AQ_VSI_NUM_S)
405 #define ICE_AQ_VSI_IS_VALID BIT(15)
407 #define ICE_AQ_VSI_KEEP_ALLOC 0x1
411 #define ICE_AQ_VSI_TYPE_S 0
412 #define ICE_AQ_VSI_TYPE_M (0x3 << ICE_AQ_VSI_TYPE_S)
413 #define ICE_AQ_VSI_TYPE_VF 0x0
414 #define ICE_AQ_VSI_TYPE_VMDQ2 0x1
415 #define ICE_AQ_VSI_TYPE_PF 0x2
416 #define ICE_AQ_VSI_TYPE_EMP_MNG 0x3
421 /* Response descriptor for:
422 * Add VSI (indirect 0x0210)
423 * Update VSI (indirect 0x0211)
424 * Free VSI (indirect 0x0213)
426 struct ice_aqc_add_update_free_vsi_resp {
435 struct ice_aqc_get_vsi_resp {
438 /* The vsi_flags field uses the ICE_AQ_VSI_TYPE_* defines for values.
439 * These are found above in struct ice_aqc_add_get_update_free_vsi.
448 struct ice_aqc_vsi_props {
449 __le16 valid_sections;
450 #define ICE_AQ_VSI_PROP_SW_VALID BIT(0)
451 #define ICE_AQ_VSI_PROP_SECURITY_VALID BIT(1)
452 #define ICE_AQ_VSI_PROP_VLAN_VALID BIT(2)
453 #define ICE_AQ_VSI_PROP_OUTER_TAG_VALID BIT(3)
454 #define ICE_AQ_VSI_PROP_INGRESS_UP_VALID BIT(4)
455 #define ICE_AQ_VSI_PROP_EGRESS_UP_VALID BIT(5)
456 #define ICE_AQ_VSI_PROP_RXQ_MAP_VALID BIT(6)
457 #define ICE_AQ_VSI_PROP_Q_OPT_VALID BIT(7)
458 #define ICE_AQ_VSI_PROP_OUTER_UP_VALID BIT(8)
459 #define ICE_AQ_VSI_PROP_ACL_VALID BIT(10)
460 #define ICE_AQ_VSI_PROP_FLOW_DIR_VALID BIT(11)
461 #define ICE_AQ_VSI_PROP_PASID_VALID BIT(12)
465 #define ICE_AQ_VSI_SW_FLAG_ALLOW_LB BIT(5)
466 #define ICE_AQ_VSI_SW_FLAG_LOCAL_LB BIT(6)
467 #define ICE_AQ_VSI_SW_FLAG_SRC_PRUNE BIT(7)
469 #define ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_S 0
470 #define ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_M (0xF << ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_S)
471 #define ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA BIT(0)
472 #define ICE_AQ_VSI_SW_FLAG_LAN_ENA BIT(4)
474 #define ICE_AQ_VSI_SW_VEB_STAT_ID_S 0
475 #define ICE_AQ_VSI_SW_VEB_STAT_ID_M (0x1F << ICE_AQ_VSI_SW_VEB_STAT_ID_S)
476 #define ICE_AQ_VSI_SW_VEB_STAT_ID_VALID BIT(5)
477 /* security section */
479 #define ICE_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD BIT(0)
480 #define ICE_AQ_VSI_SEC_FLAG_ENA_MAC_ANTI_SPOOF BIT(2)
481 #define ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S 4
482 #define ICE_AQ_VSI_SEC_TX_PRUNE_ENA_M (0xF << ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S)
483 #define ICE_AQ_VSI_SEC_TX_VLAN_PRUNE_ENA BIT(0)
486 __le16 port_based_inner_vlan; /* VLANS include priority bits */
487 u8 inner_vlan_reserved[2];
489 #define ICE_AQ_VSI_INNER_VLAN_TX_MODE_S 0
490 #define ICE_AQ_VSI_INNER_VLAN_TX_MODE_M (0x3 << ICE_AQ_VSI_INNER_VLAN_TX_MODE_S)
491 #define ICE_AQ_VSI_INNER_VLAN_TX_MODE_ACCEPTUNTAGGED 0x1
492 #define ICE_AQ_VSI_INNER_VLAN_TX_MODE_ACCEPTTAGGED 0x2
493 #define ICE_AQ_VSI_INNER_VLAN_TX_MODE_ALL 0x3
494 #define ICE_AQ_VSI_INNER_VLAN_INSERT_PVID BIT(2)
495 #define ICE_AQ_VSI_INNER_VLAN_EMODE_S 3
496 #define ICE_AQ_VSI_INNER_VLAN_EMODE_M (0x3 << ICE_AQ_VSI_INNER_VLAN_EMODE_S)
497 #define ICE_AQ_VSI_INNER_VLAN_EMODE_STR_BOTH (0x0 << ICE_AQ_VSI_INNER_VLAN_EMODE_S)
498 #define ICE_AQ_VSI_INNER_VLAN_EMODE_STR_UP (0x1 << ICE_AQ_VSI_INNER_VLAN_EMODE_S)
499 #define ICE_AQ_VSI_INNER_VLAN_EMODE_STR (0x2 << ICE_AQ_VSI_INNER_VLAN_EMODE_S)
500 #define ICE_AQ_VSI_INNER_VLAN_EMODE_NOTHING (0x3 << ICE_AQ_VSI_INNER_VLAN_EMODE_S)
501 #define ICE_AQ_VSI_INNER_VLAN_BLOCK_TX_DESC BIT(5)
502 u8 inner_vlan_reserved2[3];
503 /* ingress egress up sections */
504 __le32 ingress_table; /* bitmap, 3 bits per up */
505 #define ICE_AQ_VSI_UP_TABLE_UP0_S 0
506 #define ICE_AQ_VSI_UP_TABLE_UP0_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP0_S)
507 #define ICE_AQ_VSI_UP_TABLE_UP1_S 3
508 #define ICE_AQ_VSI_UP_TABLE_UP1_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP1_S)
509 #define ICE_AQ_VSI_UP_TABLE_UP2_S 6
510 #define ICE_AQ_VSI_UP_TABLE_UP2_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP2_S)
511 #define ICE_AQ_VSI_UP_TABLE_UP3_S 9
512 #define ICE_AQ_VSI_UP_TABLE_UP3_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP3_S)
513 #define ICE_AQ_VSI_UP_TABLE_UP4_S 12
514 #define ICE_AQ_VSI_UP_TABLE_UP4_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP4_S)
515 #define ICE_AQ_VSI_UP_TABLE_UP5_S 15
516 #define ICE_AQ_VSI_UP_TABLE_UP5_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP5_S)
517 #define ICE_AQ_VSI_UP_TABLE_UP6_S 18
518 #define ICE_AQ_VSI_UP_TABLE_UP6_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP6_S)
519 #define ICE_AQ_VSI_UP_TABLE_UP7_S 21
520 #define ICE_AQ_VSI_UP_TABLE_UP7_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP7_S)
521 __le32 egress_table; /* same defines as for ingress table */
522 /* outer tags section */
523 __le16 port_based_outer_vlan;
525 #define ICE_AQ_VSI_OUTER_VLAN_EMODE_S 0
526 #define ICE_AQ_VSI_OUTER_VLAN_EMODE_M (0x3 << ICE_AQ_VSI_OUTER_VLAN_EMODE_S)
527 #define ICE_AQ_VSI_OUTER_VLAN_EMODE_SHOW_BOTH 0x0
528 #define ICE_AQ_VSI_OUTER_VLAN_EMODE_SHOW_UP 0x1
529 #define ICE_AQ_VSI_OUTER_VLAN_EMODE_SHOW 0x2
530 #define ICE_AQ_VSI_OUTER_VLAN_EMODE_NOTHING 0x3
531 #define ICE_AQ_VSI_OUTER_TAG_TYPE_S 2
532 #define ICE_AQ_VSI_OUTER_TAG_TYPE_M (0x3 << ICE_AQ_VSI_OUTER_TAG_TYPE_S)
533 #define ICE_AQ_VSI_OUTER_TAG_NONE 0x0
534 #define ICE_AQ_VSI_OUTER_TAG_STAG 0x1
535 #define ICE_AQ_VSI_OUTER_TAG_VLAN_8100 0x2
536 #define ICE_AQ_VSI_OUTER_TAG_VLAN_9100 0x3
537 #define ICE_AQ_VSI_OUTER_VLAN_PORT_BASED_INSERT BIT(4)
538 #define ICE_AQ_VSI_OUTER_VLAN_PORT_BASED_ACCEPT_HOST BIT(6)
539 #define ICE_AQ_VSI_OUTER_VLAN_TX_MODE_S 5
540 #define ICE_AQ_VSI_OUTER_VLAN_TX_MODE_M (0x3 << ICE_AQ_VSI_OUTER_VLAN_TX_MODE_S)
541 #define ICE_AQ_VSI_OUTER_VLAN_TX_MODE_ACCEPTUNTAGGED 0x1
542 #define ICE_AQ_VSI_OUTER_VLAN_TX_MODE_ACCEPTTAGGED 0x2
543 #define ICE_AQ_VSI_OUTER_VLAN_TX_MODE_ALL 0x3
544 #define ICE_AQ_VSI_OUTER_VLAN_BLOCK_TX_DESC BIT(7)
545 u8 outer_vlan_reserved;
546 /* queue mapping section */
547 __le16 mapping_flags;
548 #define ICE_AQ_VSI_Q_MAP_CONTIG 0x0
549 #define ICE_AQ_VSI_Q_MAP_NONCONTIG BIT(0)
550 __le16 q_mapping[16];
551 #define ICE_AQ_VSI_Q_S 0
552 #define ICE_AQ_VSI_Q_M (0x7FF << ICE_AQ_VSI_Q_S)
553 __le16 tc_mapping[8];
554 #define ICE_AQ_VSI_TC_Q_OFFSET_S 0
555 #define ICE_AQ_VSI_TC_Q_OFFSET_M (0x7FF << ICE_AQ_VSI_TC_Q_OFFSET_S)
556 #define ICE_AQ_VSI_TC_Q_NUM_S 11
557 #define ICE_AQ_VSI_TC_Q_NUM_M (0xF << ICE_AQ_VSI_TC_Q_NUM_S)
558 /* queueing option section */
560 #define ICE_AQ_VSI_Q_OPT_RSS_LUT_S 0
561 #define ICE_AQ_VSI_Q_OPT_RSS_LUT_M (0x3 << ICE_AQ_VSI_Q_OPT_RSS_LUT_S)
562 #define ICE_AQ_VSI_Q_OPT_RSS_LUT_VSI 0x0
563 #define ICE_AQ_VSI_Q_OPT_RSS_LUT_PF 0x2
564 #define ICE_AQ_VSI_Q_OPT_RSS_LUT_GBL 0x3
565 #define ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_S 2
566 #define ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_M (0xF << ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_S)
567 #define ICE_AQ_VSI_Q_OPT_RSS_HASH_S 6
568 #define ICE_AQ_VSI_Q_OPT_RSS_HASH_M (0x3 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
569 #define ICE_AQ_VSI_Q_OPT_RSS_TPLZ (0x0 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
570 #define ICE_AQ_VSI_Q_OPT_RSS_SYM_TPLZ (0x1 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
571 #define ICE_AQ_VSI_Q_OPT_RSS_XOR (0x2 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
572 #define ICE_AQ_VSI_Q_OPT_RSS_JHASH (0x3 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
574 #define ICE_AQ_VSI_Q_OPT_TC_OVR_S 0
575 #define ICE_AQ_VSI_Q_OPT_TC_OVR_M (0x1F << ICE_AQ_VSI_Q_OPT_TC_OVR_S)
576 #define ICE_AQ_VSI_Q_OPT_PROF_TC_OVR BIT(7)
578 #define ICE_AQ_VSI_Q_OPT_PE_FLTR_EN BIT(0)
579 u8 q_opt_reserved[3];
580 /* outer up section */
581 __le32 outer_up_table; /* same structure and defines as ingress tbl */
584 #define ICE_AQ_VSI_ACL_DEF_RX_PROF_S 0
585 #define ICE_AQ_VSI_ACL_DEF_RX_PROF_M (0xF << ICE_AQ_VSI_ACL_DEF_RX_PROF_S)
586 #define ICE_AQ_VSI_ACL_DEF_RX_TABLE_S 4
587 #define ICE_AQ_VSI_ACL_DEF_RX_TABLE_M (0xF << ICE_AQ_VSI_ACL_DEF_RX_TABLE_S)
588 #define ICE_AQ_VSI_ACL_DEF_TX_PROF_S 8
589 #define ICE_AQ_VSI_ACL_DEF_TX_PROF_M (0xF << ICE_AQ_VSI_ACL_DEF_TX_PROF_S)
590 #define ICE_AQ_VSI_ACL_DEF_TX_TABLE_S 12
591 #define ICE_AQ_VSI_ACL_DEF_TX_TABLE_M (0xF << ICE_AQ_VSI_ACL_DEF_TX_TABLE_S)
592 /* flow director section */
594 #define ICE_AQ_VSI_FD_ENABLE BIT(0)
595 #define ICE_AQ_VSI_FD_TX_AUTO_ENABLE BIT(1)
596 #define ICE_AQ_VSI_FD_PROG_ENABLE BIT(3)
597 __le16 max_fd_fltr_dedicated;
598 __le16 max_fd_fltr_shared;
600 #define ICE_AQ_VSI_FD_DEF_Q_S 0
601 #define ICE_AQ_VSI_FD_DEF_Q_M (0x7FF << ICE_AQ_VSI_FD_DEF_Q_S)
602 #define ICE_AQ_VSI_FD_DEF_GRP_S 12
603 #define ICE_AQ_VSI_FD_DEF_GRP_M (0x7 << ICE_AQ_VSI_FD_DEF_GRP_S)
604 __le16 fd_report_opt;
605 #define ICE_AQ_VSI_FD_REPORT_Q_S 0
606 #define ICE_AQ_VSI_FD_REPORT_Q_M (0x7FF << ICE_AQ_VSI_FD_REPORT_Q_S)
607 #define ICE_AQ_VSI_FD_DEF_PRIORITY_S 12
608 #define ICE_AQ_VSI_FD_DEF_PRIORITY_M (0x7 << ICE_AQ_VSI_FD_DEF_PRIORITY_S)
609 #define ICE_AQ_VSI_FD_DEF_DROP BIT(15)
612 #define ICE_AQ_VSI_PASID_ID_S 0
613 #define ICE_AQ_VSI_PASID_ID_M (0xFFFFF << ICE_AQ_VSI_PASID_ID_S)
614 #define ICE_AQ_VSI_PASID_ID_VALID BIT(31)
618 /* Add/update mirror rule - direct (0x0260) */
619 #define ICE_AQC_RULE_ID_VALID_S 7
620 #define ICE_AQC_RULE_ID_VALID_M (0x1 << ICE_AQC_RULE_ID_VALID_S)
621 #define ICE_AQC_RULE_ID_S 0
622 #define ICE_AQC_RULE_ID_M (0x3F << ICE_AQC_RULE_ID_S)
624 /* Following defines to be used while processing caller specified mirror list
627 /* Action: Byte.bit (1.7)
628 * 0 = Remove VSI from mirror rule
629 * 1 = Add VSI to mirror rule
631 #define ICE_AQC_RULE_ACT_S 15
632 #define ICE_AQC_RULE_ACT_M (0x1 << ICE_AQC_RULE_ACT_S)
633 /* Action: 1.2:0.0 = Mirrored VSI */
634 #define ICE_AQC_RULE_MIRRORED_VSI_S 0
635 #define ICE_AQC_RULE_MIRRORED_VSI_M (0x7FF << ICE_AQC_RULE_MIRRORED_VSI_S)
637 /* This is to be used by add/update mirror rule Admin Queue command.
638 * In case of add mirror rule - if rule ID is specified as
639 * INVAL_MIRROR_RULE_ID, new rule ID is allocated from shared pool.
640 * If specified rule_id is valid, then it is used. If specified rule_id
641 * is in use then new mirroring rule is added.
643 #define ICE_INVAL_MIRROR_RULE_ID 0xFFFF
645 struct ice_aqc_add_update_mir_rule {
649 #define ICE_AQC_RULE_TYPE_S 0
650 #define ICE_AQC_RULE_TYPE_M (0x7 << ICE_AQC_RULE_TYPE_S)
651 /* VPORT ingress/egress */
652 #define ICE_AQC_RULE_TYPE_VPORT_INGRESS 0x1
653 #define ICE_AQC_RULE_TYPE_VPORT_EGRESS 0x2
654 /* Physical port ingress mirroring.
655 * All traffic received by this port
657 #define ICE_AQC_RULE_TYPE_PPORT_INGRESS 0x6
658 /* Physical port egress mirroring. All traffic sent by this port */
659 #define ICE_AQC_RULE_TYPE_PPORT_EGRESS 0x7
661 /* Number of mirrored entries.
662 * The values are in the command buffer
666 /* Destination VSI */
672 /* Delete mirror rule - direct(0x0261) */
673 struct ice_aqc_delete_mir_rule {
677 /* Byte.bit: 20.0 = Keep allocation. If set VSI stays part of
678 * the PF allocated resources, otherwise it is returned to the
681 #define ICE_AQC_FLAG_KEEP_ALLOCD_S 0
682 #define ICE_AQC_FLAG_KEEP_ALLOCD_M (0x1 << ICE_AQC_FLAG_KEEP_ALLOCD_S)
688 /* Set/Get storm config - (direct 0x0280, 0x0281) */
689 /* This structure holds get storm configuration response and same structure
690 * is used to perform set_storm_cfg
692 struct ice_aqc_storm_cfg {
693 __le32 bcast_thresh_size;
694 __le32 mcast_thresh_size;
695 /* Bit 18:0 - Traffic upper threshold size
696 * Bit 31:19 - Reserved
698 #define ICE_AQ_THRESHOLD_S 0
699 #define ICE_AQ_THRESHOLD_M (0x7FFFF << ICE_AQ_THRESHOLD_S)
701 __le32 storm_ctrl_ctrl;
702 /* Bit 0: MDIPW - Drop Multicast packets in previous window
703 * Bit 1: MDICW - Drop multicast packets in current window
704 * Bit 2: BDIPW - Drop broadcast packets in previous window
705 * Bit 3: BDICW - Drop broadcast packets in current window
707 #define ICE_AQ_STORM_CTRL_MDIPW_DROP_MULTICAST BIT(0)
708 #define ICE_AQ_STORM_CTRL_MDICW_DROP_MULTICAST BIT(1)
709 #define ICE_AQ_STORM_CTRL_BDIPW_DROP_MULTICAST BIT(2)
710 #define ICE_AQ_STORM_CTRL_BDICW_DROP_MULTICAST BIT(3)
711 /* Bit 7:5 : Reserved */
712 /* Bit 27:8 : Interval - BSC/MSC Time-interval specification: The
713 * interval size for applying ingress broadcast or multicast storm
716 #define ICE_AQ_STORM_BSC_MSC_TIME_INTERVAL_S 8
717 #define ICE_AQ_STORM_BSC_MSC_TIME_INTERVAL_M \
718 (0xFFFFF << ICE_AQ_STORM_BSC_MSC_TIME_INTERVAL_S)
722 #define ICE_MAX_NUM_RECIPES 64
724 /* Add/Get Recipe (indirect 0x0290/0x0292) */
725 struct ice_aqc_add_get_recipe {
726 __le16 num_sub_recipes; /* Input in Add cmd, Output in Get cmd */
727 __le16 return_index; /* Input, used for Get cmd only */
733 struct ice_aqc_recipe_content {
735 #define ICE_AQ_RECIPE_ID_S 0
736 #define ICE_AQ_RECIPE_ID_M (0x3F << ICE_AQ_RECIPE_ID_S)
737 #define ICE_AQ_RECIPE_ID_IS_ROOT BIT(7)
738 #define ICE_AQ_SW_ID_LKUP_IDX 0
740 #define ICE_AQ_RECIPE_LKUP_DATA_S 0
741 #define ICE_AQ_RECIPE_LKUP_DATA_M (0x3F << ICE_AQ_RECIPE_LKUP_DATA_S)
742 #define ICE_AQ_RECIPE_LKUP_IGNORE BIT(7)
743 #define ICE_AQ_SW_ID_LKUP_MASK 0x00FF
746 #define ICE_AQ_RECIPE_RESULT_DATA_S 0
747 #define ICE_AQ_RECIPE_RESULT_DATA_M (0x3F << ICE_AQ_RECIPE_RESULT_DATA_S)
748 #define ICE_AQ_RECIPE_RESULT_EN BIT(7)
750 u8 act_ctrl_join_priority;
751 u8 act_ctrl_fwd_priority;
752 #define ICE_AQ_RECIPE_FWD_PRIORITY_S 0
753 #define ICE_AQ_RECIPE_FWD_PRIORITY_M (0xF << ICE_AQ_RECIPE_FWD_PRIORITY_S)
755 #define ICE_AQ_RECIPE_ACT_NEED_PASS_L2 BIT(0)
756 #define ICE_AQ_RECIPE_ACT_ALLOW_PASS_L2 BIT(1)
757 #define ICE_AQ_RECIPE_ACT_INV_ACT BIT(2)
758 #define ICE_AQ_RECIPE_ACT_PRUNE_INDX_S 4
759 #define ICE_AQ_RECIPE_ACT_PRUNE_INDX_M (0x3 << ICE_AQ_RECIPE_ACT_PRUNE_INDX_S)
762 #define ICE_AQ_RECIPE_DFLT_ACT_S 0
763 #define ICE_AQ_RECIPE_DFLT_ACT_M (0x7FFFF << ICE_AQ_RECIPE_DFLT_ACT_S)
764 #define ICE_AQ_RECIPE_DFLT_ACT_VALID BIT(31)
767 struct ice_aqc_recipe_data_elem {
770 #define ICE_AQ_RECIPE_WAS_UPDATED BIT(0)
774 struct ice_aqc_recipe_content content;
778 /* Set/Get Recipes to Profile Association (direct 0x0291/0x0293) */
779 struct ice_aqc_recipe_to_profile {
782 ice_declare_bitmap(recipe_assoc, ICE_MAX_NUM_RECIPES);
785 /* Add/Update/Remove/Get switch rules (indirect 0x02A0, 0x02A1, 0x02A2, 0x02A3)
787 struct ice_aqc_sw_rules {
788 /* ops: add switch rules, referring the number of rules.
789 * ops: update switch rules, referring the number of filters
790 * ops: remove switch rules, referring the entry index.
791 * ops: get switch rules, referring to the number of filters.
793 __le16 num_rules_fltr_entry_index;
799 /* Add/Update/Get/Remove lookup Rx/Tx command/response entry
800 * This structures describes the lookup rules and associated actions. "index"
801 * is returned as part of a response to a successful Add command, and can be
802 * used to identify the rule for Update/Get/Remove commands.
804 struct ice_sw_rule_lkup_rx_tx {
806 #define ICE_SW_RECIPE_LOGICAL_PORT_FWD 10
807 /* Source port for LOOKUP_RX and source VSI in case of LOOKUP_TX */
811 /* Bit 0:1 - Action type */
812 #define ICE_SINGLE_ACT_TYPE_S 0x00
813 #define ICE_SINGLE_ACT_TYPE_M (0x3 << ICE_SINGLE_ACT_TYPE_S)
815 /* Bit 2 - Loop back enable
818 #define ICE_SINGLE_ACT_LB_ENABLE BIT(2)
819 #define ICE_SINGLE_ACT_LAN_ENABLE BIT(3)
821 /* Action type = 0 - Forward to VSI or VSI list */
822 #define ICE_SINGLE_ACT_VSI_FORWARDING 0x0
824 #define ICE_SINGLE_ACT_VSI_ID_S 4
825 #define ICE_SINGLE_ACT_VSI_ID_M (0x3FF << ICE_SINGLE_ACT_VSI_ID_S)
826 #define ICE_SINGLE_ACT_VSI_LIST_ID_S 4
827 #define ICE_SINGLE_ACT_VSI_LIST_ID_M (0x3FF << ICE_SINGLE_ACT_VSI_LIST_ID_S)
828 /* This bit needs to be set if action is forward to VSI list */
829 #define ICE_SINGLE_ACT_VSI_LIST BIT(14)
830 #define ICE_SINGLE_ACT_VALID_BIT BIT(17)
831 #define ICE_SINGLE_ACT_DROP BIT(18)
833 /* Action type = 1 - Forward to Queue of Queue group */
834 #define ICE_SINGLE_ACT_TO_Q 0x1
835 #define ICE_SINGLE_ACT_Q_INDEX_S 4
836 #define ICE_SINGLE_ACT_Q_INDEX_M (0x7FF << ICE_SINGLE_ACT_Q_INDEX_S)
837 #define ICE_SINGLE_ACT_Q_REGION_S 15
838 #define ICE_SINGLE_ACT_Q_REGION_M (0x7 << ICE_SINGLE_ACT_Q_REGION_S)
839 #define ICE_SINGLE_ACT_Q_PRIORITY BIT(18)
841 /* Action type = 2 - Prune */
842 #define ICE_SINGLE_ACT_PRUNE 0x2
843 #define ICE_SINGLE_ACT_EGRESS BIT(15)
844 #define ICE_SINGLE_ACT_INGRESS BIT(16)
845 #define ICE_SINGLE_ACT_PRUNET BIT(17)
846 /* Bit 18 should be set to 0 for this action */
848 /* Action type = 2 - Pointer */
849 #define ICE_SINGLE_ACT_PTR 0x2
850 #define ICE_SINGLE_ACT_PTR_VAL_S 4
851 #define ICE_SINGLE_ACT_PTR_VAL_M (0x1FFF << ICE_SINGLE_ACT_PTR_VAL_S)
852 /* Bit 18 should be set to 1 */
853 #define ICE_SINGLE_ACT_PTR_BIT BIT(18)
855 /* Action type = 3 - Other actions. Last two bits
856 * are other action identifier
858 #define ICE_SINGLE_ACT_OTHER_ACTS 0x3
859 #define ICE_SINGLE_OTHER_ACT_IDENTIFIER_S 17
860 #define ICE_SINGLE_OTHER_ACT_IDENTIFIER_M \
861 (0x3 << ICE_SINGLE_OTHER_ACT_IDENTIFIER_S)
863 /* Bit 17:18 - Defines other actions */
864 /* Other action = 0 - Mirror VSI */
865 #define ICE_SINGLE_OTHER_ACT_MIRROR 0
866 #define ICE_SINGLE_ACT_MIRROR_VSI_ID_S 4
867 #define ICE_SINGLE_ACT_MIRROR_VSI_ID_M \
868 (0x3FF << ICE_SINGLE_ACT_MIRROR_VSI_ID_S)
870 /* Other action = 3 - Set Stat count */
871 #define ICE_SINGLE_OTHER_ACT_STAT_COUNT 3
872 #define ICE_SINGLE_ACT_STAT_COUNT_INDEX_S 4
873 #define ICE_SINGLE_ACT_STAT_COUNT_INDEX_M \
874 (0x7F << ICE_SINGLE_ACT_STAT_COUNT_INDEX_S)
876 __le16 index; /* The index of the rule in the lookup table */
877 /* Length and values of the header to be matched per recipe or
881 u8 hdr[STRUCT_HACK_VAR_LEN];
884 /* Add/Update/Remove large action command/response entry
885 * "index" is returned as part of a response to a successful Add command, and
886 * can be used to identify the action for Update/Get/Remove commands.
888 struct ice_sw_rule_lg_act {
889 __le16 index; /* Index in large action table */
891 /* Max number of large actions */
892 #define ICE_MAX_LG_ACT 4
893 /* Bit 0:1 - Action type */
894 #define ICE_LG_ACT_TYPE_S 0
895 #define ICE_LG_ACT_TYPE_M (0x7 << ICE_LG_ACT_TYPE_S)
897 /* Action type = 0 - Forward to VSI or VSI list */
898 #define ICE_LG_ACT_VSI_FORWARDING 0
899 #define ICE_LG_ACT_VSI_ID_S 3
900 #define ICE_LG_ACT_VSI_ID_M (0x3FF << ICE_LG_ACT_VSI_ID_S)
901 #define ICE_LG_ACT_VSI_LIST_ID_S 3
902 #define ICE_LG_ACT_VSI_LIST_ID_M (0x3FF << ICE_LG_ACT_VSI_LIST_ID_S)
903 /* This bit needs to be set if action is forward to VSI list */
904 #define ICE_LG_ACT_VSI_LIST BIT(13)
906 #define ICE_LG_ACT_VALID_BIT BIT(16)
908 /* Action type = 1 - Forward to Queue of Queue group */
909 #define ICE_LG_ACT_TO_Q 0x1
910 #define ICE_LG_ACT_Q_INDEX_S 3
911 #define ICE_LG_ACT_Q_INDEX_M (0x7FF << ICE_LG_ACT_Q_INDEX_S)
912 #define ICE_LG_ACT_Q_REGION_S 14
913 #define ICE_LG_ACT_Q_REGION_M (0x7 << ICE_LG_ACT_Q_REGION_S)
914 #define ICE_LG_ACT_Q_PRIORITY_SET BIT(17)
916 /* Action type = 2 - Prune */
917 #define ICE_LG_ACT_PRUNE 0x2
918 #define ICE_LG_ACT_EGRESS BIT(14)
919 #define ICE_LG_ACT_INGRESS BIT(15)
920 #define ICE_LG_ACT_PRUNET BIT(16)
922 /* Action type = 3 - Mirror VSI */
923 #define ICE_LG_OTHER_ACT_MIRROR 0x3
924 #define ICE_LG_ACT_MIRROR_VSI_ID_S 3
925 #define ICE_LG_ACT_MIRROR_VSI_ID_M (0x3FF << ICE_LG_ACT_MIRROR_VSI_ID_S)
927 /* Action type = 5 - Generic Value */
928 #define ICE_LG_ACT_GENERIC 0x5
929 #define ICE_LG_ACT_GENERIC_VALUE_S 3
930 #define ICE_LG_ACT_GENERIC_VALUE_M (0xFFFF << ICE_LG_ACT_GENERIC_VALUE_S)
931 #define ICE_LG_ACT_GENERIC_OFFSET_S 19
932 #define ICE_LG_ACT_GENERIC_OFFSET_M (0x7 << ICE_LG_ACT_GENERIC_OFFSET_S)
933 #define ICE_LG_ACT_GENERIC_PRIORITY_S 22
934 #define ICE_LG_ACT_GENERIC_PRIORITY_M (0x7 << ICE_LG_ACT_GENERIC_PRIORITY_S)
935 #define ICE_LG_ACT_GENERIC_OFF_RX_DESC_PROF_IDX 7
937 /* Action = 7 - Set Stat count */
938 #define ICE_LG_ACT_STAT_COUNT 0x7
939 #define ICE_LG_ACT_STAT_COUNT_S 3
940 #define ICE_LG_ACT_STAT_COUNT_M (0x7F << ICE_LG_ACT_STAT_COUNT_S)
941 __le32 act[STRUCT_HACK_VAR_LEN]; /* array of size for actions */
944 /* Add/Update/Remove VSI list command/response entry
945 * "index" is returned as part of a response to a successful Add command, and
946 * can be used to identify the VSI list for Update/Get/Remove commands.
948 struct ice_sw_rule_vsi_list {
949 __le16 index; /* Index of VSI/Prune list */
951 __le16 vsi[STRUCT_HACK_VAR_LEN]; /* Array of number_vsi VSI numbers */
955 /* Query VSI list command/response entry */
956 struct ice_sw_rule_vsi_list_query {
958 ice_declare_bitmap(vsi_list, ICE_MAX_VSI);
963 /* Add switch rule response:
964 * Content of return buffer is same as the input buffer. The status field and
965 * LUT index are updated as part of the response
967 struct ice_aqc_sw_rules_elem {
968 __le16 type; /* Switch rule type, one of T_... */
969 #define ICE_AQC_SW_RULES_T_LKUP_RX 0x0
970 #define ICE_AQC_SW_RULES_T_LKUP_TX 0x1
971 #define ICE_AQC_SW_RULES_T_LG_ACT 0x2
972 #define ICE_AQC_SW_RULES_T_VSI_LIST_SET 0x3
973 #define ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR 0x4
974 #define ICE_AQC_SW_RULES_T_PRUNE_LIST_SET 0x5
975 #define ICE_AQC_SW_RULES_T_PRUNE_LIST_CLEAR 0x6
978 struct ice_sw_rule_lkup_rx_tx lkup_tx_rx;
979 struct ice_sw_rule_lg_act lg_act;
980 struct ice_sw_rule_vsi_list vsi_list;
981 struct ice_sw_rule_vsi_list_query vsi_list_query;
987 /* PFC Ignore (direct 0x0301)
988 * The command and response use the same descriptor structure
990 struct ice_aqc_pfc_ignore {
992 u8 cmd_flags; /* unused in response */
993 #define ICE_AQC_PFC_IGNORE_SET BIT(7)
994 #define ICE_AQC_PFC_IGNORE_CLEAR 0
998 /* Set PFC Mode (direct 0x0303)
999 * Query PFC Mode (direct 0x0302)
1001 struct ice_aqc_set_query_pfc_mode {
1003 /* For Set Command response, reserved in all other cases */
1004 #define ICE_AQC_PFC_NOT_CONFIGURED 0
1005 /* For Query Command response, reserved in all other cases */
1006 #define ICE_AQC_DCB_DIS 0
1007 #define ICE_AQC_PFC_VLAN_BASED_PFC 1
1008 #define ICE_AQC_PFC_DSCP_BASED_PFC 2
1012 /* Set DCB Parameters (direct 0x0306) */
1013 struct ice_aqc_set_dcb_params {
1014 u8 cmd_flags; /* unused in response */
1015 #define ICE_AQC_LINK_UP_DCB_CFG BIT(0)
1016 #define ICE_AQC_PERSIST_DCB_CFG BIT(1)
1017 u8 valid_flags; /* unused in response */
1018 #define ICE_AQC_LINK_UP_DCB_CFG_VALID BIT(0)
1019 #define ICE_AQC_PERSIST_DCB_CFG_VALID BIT(1)
1023 /* Get Default Topology (indirect 0x0400) */
1024 struct ice_aqc_get_topo {
1033 /* Update TSE (indirect 0x0403)
1034 * Get TSE (indirect 0x0404)
1035 * Add TSE (indirect 0x0401)
1036 * Delete TSE (indirect 0x040F)
1037 * Move TSE (indirect 0x0408)
1038 * Suspend Nodes (indirect 0x0409)
1039 * Resume Nodes (indirect 0x040A)
1041 struct ice_aqc_sched_elem_cmd {
1042 __le16 num_elem_req; /* Used by commands */
1043 __le16 num_elem_resp; /* Used by responses */
1049 struct ice_aqc_txsched_move_grp_info_hdr {
1050 __le32 src_parent_teid;
1051 __le32 dest_parent_teid;
1057 struct ice_aqc_move_elem {
1058 struct ice_aqc_txsched_move_grp_info_hdr hdr;
1059 __le32 teid[STRUCT_HACK_VAR_LEN];
1062 struct ice_aqc_elem_info_bw {
1063 __le16 bw_profile_idx;
1067 struct ice_aqc_txsched_elem {
1068 u8 elem_type; /* Special field, reserved for some aq calls */
1069 #define ICE_AQC_ELEM_TYPE_UNDEFINED 0x0
1070 #define ICE_AQC_ELEM_TYPE_ROOT_PORT 0x1
1071 #define ICE_AQC_ELEM_TYPE_TC 0x2
1072 #define ICE_AQC_ELEM_TYPE_SE_GENERIC 0x3
1073 #define ICE_AQC_ELEM_TYPE_ENTRY_POINT 0x4
1074 #define ICE_AQC_ELEM_TYPE_LEAF 0x5
1075 #define ICE_AQC_ELEM_TYPE_SE_PADDED 0x6
1077 #define ICE_AQC_ELEM_VALID_GENERIC BIT(0)
1078 #define ICE_AQC_ELEM_VALID_CIR BIT(1)
1079 #define ICE_AQC_ELEM_VALID_EIR BIT(2)
1080 #define ICE_AQC_ELEM_VALID_SHARED BIT(3)
1082 #define ICE_AQC_ELEM_GENERIC_MODE_M 0x1
1083 #define ICE_AQC_ELEM_GENERIC_PRIO_S 0x1
1084 #define ICE_AQC_ELEM_GENERIC_PRIO_M (0x7 << ICE_AQC_ELEM_GENERIC_PRIO_S)
1085 #define ICE_AQC_ELEM_GENERIC_SP_S 0x4
1086 #define ICE_AQC_ELEM_GENERIC_SP_M (0x1 << ICE_AQC_ELEM_GENERIC_SP_S)
1087 #define ICE_AQC_ELEM_GENERIC_ADJUST_VAL_S 0x5
1088 #define ICE_AQC_ELEM_GENERIC_ADJUST_VAL_M \
1089 (0x3 << ICE_AQC_ELEM_GENERIC_ADJUST_VAL_S)
1090 u8 flags; /* Special field, reserved for some aq calls */
1091 #define ICE_AQC_ELEM_FLAG_SUSPEND_M 0x1
1092 struct ice_aqc_elem_info_bw cir_bw;
1093 struct ice_aqc_elem_info_bw eir_bw;
1098 struct ice_aqc_txsched_elem_data {
1101 struct ice_aqc_txsched_elem data;
1104 struct ice_aqc_txsched_topo_grp_info_hdr {
1110 struct ice_aqc_add_elem {
1111 struct ice_aqc_txsched_topo_grp_info_hdr hdr;
1112 struct ice_aqc_txsched_elem_data generic[STRUCT_HACK_VAR_LEN];
1115 struct ice_aqc_get_topo_elem {
1116 struct ice_aqc_txsched_topo_grp_info_hdr hdr;
1117 struct ice_aqc_txsched_elem_data
1118 generic[ICE_AQC_TOPO_MAX_LEVEL_NUM];
1121 struct ice_aqc_delete_elem {
1122 struct ice_aqc_txsched_topo_grp_info_hdr hdr;
1123 __le32 teid[STRUCT_HACK_VAR_LEN];
1126 /* Query Port ETS (indirect 0x040E)
1128 * This indirect command is used to query port TC node configuration.
1130 struct ice_aqc_query_port_ets {
1137 struct ice_aqc_port_ets_elem {
1140 /* 3 bits for UP per TC 0-7, 4th byte reserved */
1143 __le32 port_eir_prof_id;
1144 __le32 port_cir_prof_id;
1145 /* 3 bits per Node priority to TC 0-7, 4th byte reserved */
1146 __le32 tc_node_prio;
1147 #define ICE_TC_NODE_PRIO_S 0x4
1149 __le32 tc_node_teid[8]; /* Used for response, reserved in command */
1152 /* Rate limiting profile for
1153 * Add RL profile (indirect 0x0410)
1154 * Query RL profile (indirect 0x0411)
1155 * Remove RL profile (indirect 0x0415)
1156 * These indirect commands acts on single or multiple
1157 * RL profiles with specified data.
1159 struct ice_aqc_rl_profile {
1160 __le16 num_profiles;
1161 __le16 num_processed; /* Only for response. Reserved in Command. */
1167 struct ice_aqc_rl_profile_elem {
1170 #define ICE_AQC_RL_PROFILE_TYPE_S 0x0
1171 #define ICE_AQC_RL_PROFILE_TYPE_M (0x3 << ICE_AQC_RL_PROFILE_TYPE_S)
1172 #define ICE_AQC_RL_PROFILE_TYPE_CIR 0
1173 #define ICE_AQC_RL_PROFILE_TYPE_EIR 1
1174 #define ICE_AQC_RL_PROFILE_TYPE_SRL 2
1175 /* The following flag is used for Query RL Profile Data */
1176 #define ICE_AQC_RL_PROFILE_INVAL_S 0x7
1177 #define ICE_AQC_RL_PROFILE_INVAL_M (0x1 << ICE_AQC_RL_PROFILE_INVAL_S)
1180 __le16 max_burst_size;
1182 __le16 wake_up_calc;
1186 /* Configure L2 Node CGD (indirect 0x0414)
1187 * This indirect command allows configuring a congestion domain for given L2
1188 * node TEIDs in the scheduler topology.
1190 struct ice_aqc_cfg_l2_node_cgd {
1191 __le16 num_l2_nodes;
1197 struct ice_aqc_cfg_l2_node_cgd_elem {
1203 /* Query Scheduler Resource Allocation (indirect 0x0412)
1204 * This indirect command retrieves the scheduler resources allocated by
1205 * EMP Firmware to the given PF.
1207 struct ice_aqc_query_txsched_res {
1213 struct ice_aqc_generic_sched_props {
1215 __le16 logical_levels;
1216 u8 flattening_bitmap;
1224 struct ice_aqc_layer_props {
1227 __le16 max_device_nodes;
1228 __le16 max_pf_nodes;
1230 __le16 max_sibl_grp_sz;
1231 __le16 max_cir_rl_profiles;
1232 __le16 max_eir_rl_profiles;
1233 __le16 max_srl_profiles;
1237 struct ice_aqc_query_txsched_res_resp {
1238 struct ice_aqc_generic_sched_props sched_props;
1239 struct ice_aqc_layer_props layer_props[ICE_AQC_TOPO_MAX_LEVEL_NUM];
1242 /* Query Node to Root Topology (indirect 0x0413)
1243 * This command uses ice_aqc_get_elem as its data buffer.
1245 struct ice_aqc_query_node_to_root {
1247 __le32 num_nodes; /* Response only */
1252 /* Get PHY capabilities (indirect 0x0600) */
1253 struct ice_aqc_get_phy_caps {
1257 /* 18.0 - Report qualified modules */
1258 #define ICE_AQC_GET_PHY_RQM BIT(0)
1259 /* 18.1 - 18.3 : Report mode
1260 * 000b - Report NVM capabilities
1261 * 001b - Report topology capabilities
1262 * 010b - Report SW configured
1263 * 100b - Report default capabilities
1265 #define ICE_AQC_REPORT_MODE_S 1
1266 #define ICE_AQC_REPORT_MODE_M (7 << ICE_AQC_REPORT_MODE_S)
1267 #define ICE_AQC_REPORT_TOPO_CAP_NO_MEDIA 0
1268 #define ICE_AQC_REPORT_TOPO_CAP_MEDIA BIT(1)
1269 #define ICE_AQC_REPORT_ACTIVE_CFG BIT(2)
1270 #define ICE_AQC_REPORT_DFLT_CFG BIT(3)
1276 /* This is #define of PHY type (Extended):
1277 * The first set of defines is for phy_type_low.
1279 #define ICE_PHY_TYPE_LOW_100BASE_TX BIT_ULL(0)
1280 #define ICE_PHY_TYPE_LOW_100M_SGMII BIT_ULL(1)
1281 #define ICE_PHY_TYPE_LOW_1000BASE_T BIT_ULL(2)
1282 #define ICE_PHY_TYPE_LOW_1000BASE_SX BIT_ULL(3)
1283 #define ICE_PHY_TYPE_LOW_1000BASE_LX BIT_ULL(4)
1284 #define ICE_PHY_TYPE_LOW_1000BASE_KX BIT_ULL(5)
1285 #define ICE_PHY_TYPE_LOW_1G_SGMII BIT_ULL(6)
1286 #define ICE_PHY_TYPE_LOW_2500BASE_T BIT_ULL(7)
1287 #define ICE_PHY_TYPE_LOW_2500BASE_X BIT_ULL(8)
1288 #define ICE_PHY_TYPE_LOW_2500BASE_KX BIT_ULL(9)
1289 #define ICE_PHY_TYPE_LOW_5GBASE_T BIT_ULL(10)
1290 #define ICE_PHY_TYPE_LOW_5GBASE_KR BIT_ULL(11)
1291 #define ICE_PHY_TYPE_LOW_10GBASE_T BIT_ULL(12)
1292 #define ICE_PHY_TYPE_LOW_10G_SFI_DA BIT_ULL(13)
1293 #define ICE_PHY_TYPE_LOW_10GBASE_SR BIT_ULL(14)
1294 #define ICE_PHY_TYPE_LOW_10GBASE_LR BIT_ULL(15)
1295 #define ICE_PHY_TYPE_LOW_10GBASE_KR_CR1 BIT_ULL(16)
1296 #define ICE_PHY_TYPE_LOW_10G_SFI_AOC_ACC BIT_ULL(17)
1297 #define ICE_PHY_TYPE_LOW_10G_SFI_C2C BIT_ULL(18)
1298 #define ICE_PHY_TYPE_LOW_25GBASE_T BIT_ULL(19)
1299 #define ICE_PHY_TYPE_LOW_25GBASE_CR BIT_ULL(20)
1300 #define ICE_PHY_TYPE_LOW_25GBASE_CR_S BIT_ULL(21)
1301 #define ICE_PHY_TYPE_LOW_25GBASE_CR1 BIT_ULL(22)
1302 #define ICE_PHY_TYPE_LOW_25GBASE_SR BIT_ULL(23)
1303 #define ICE_PHY_TYPE_LOW_25GBASE_LR BIT_ULL(24)
1304 #define ICE_PHY_TYPE_LOW_25GBASE_KR BIT_ULL(25)
1305 #define ICE_PHY_TYPE_LOW_25GBASE_KR_S BIT_ULL(26)
1306 #define ICE_PHY_TYPE_LOW_25GBASE_KR1 BIT_ULL(27)
1307 #define ICE_PHY_TYPE_LOW_25G_AUI_AOC_ACC BIT_ULL(28)
1308 #define ICE_PHY_TYPE_LOW_25G_AUI_C2C BIT_ULL(29)
1309 #define ICE_PHY_TYPE_LOW_40GBASE_CR4 BIT_ULL(30)
1310 #define ICE_PHY_TYPE_LOW_40GBASE_SR4 BIT_ULL(31)
1311 #define ICE_PHY_TYPE_LOW_40GBASE_LR4 BIT_ULL(32)
1312 #define ICE_PHY_TYPE_LOW_40GBASE_KR4 BIT_ULL(33)
1313 #define ICE_PHY_TYPE_LOW_40G_XLAUI_AOC_ACC BIT_ULL(34)
1314 #define ICE_PHY_TYPE_LOW_40G_XLAUI BIT_ULL(35)
1315 #define ICE_PHY_TYPE_LOW_50GBASE_CR2 BIT_ULL(36)
1316 #define ICE_PHY_TYPE_LOW_50GBASE_SR2 BIT_ULL(37)
1317 #define ICE_PHY_TYPE_LOW_50GBASE_LR2 BIT_ULL(38)
1318 #define ICE_PHY_TYPE_LOW_50GBASE_KR2 BIT_ULL(39)
1319 #define ICE_PHY_TYPE_LOW_50G_LAUI2_AOC_ACC BIT_ULL(40)
1320 #define ICE_PHY_TYPE_LOW_50G_LAUI2 BIT_ULL(41)
1321 #define ICE_PHY_TYPE_LOW_50G_AUI2_AOC_ACC BIT_ULL(42)
1322 #define ICE_PHY_TYPE_LOW_50G_AUI2 BIT_ULL(43)
1323 #define ICE_PHY_TYPE_LOW_50GBASE_CP BIT_ULL(44)
1324 #define ICE_PHY_TYPE_LOW_50GBASE_SR BIT_ULL(45)
1325 #define ICE_PHY_TYPE_LOW_50GBASE_FR BIT_ULL(46)
1326 #define ICE_PHY_TYPE_LOW_50GBASE_LR BIT_ULL(47)
1327 #define ICE_PHY_TYPE_LOW_50GBASE_KR_PAM4 BIT_ULL(48)
1328 #define ICE_PHY_TYPE_LOW_50G_AUI1_AOC_ACC BIT_ULL(49)
1329 #define ICE_PHY_TYPE_LOW_50G_AUI1 BIT_ULL(50)
1330 #define ICE_PHY_TYPE_LOW_100GBASE_CR4 BIT_ULL(51)
1331 #define ICE_PHY_TYPE_LOW_100GBASE_SR4 BIT_ULL(52)
1332 #define ICE_PHY_TYPE_LOW_100GBASE_LR4 BIT_ULL(53)
1333 #define ICE_PHY_TYPE_LOW_100GBASE_KR4 BIT_ULL(54)
1334 #define ICE_PHY_TYPE_LOW_100G_CAUI4_AOC_ACC BIT_ULL(55)
1335 #define ICE_PHY_TYPE_LOW_100G_CAUI4 BIT_ULL(56)
1336 #define ICE_PHY_TYPE_LOW_100G_AUI4_AOC_ACC BIT_ULL(57)
1337 #define ICE_PHY_TYPE_LOW_100G_AUI4 BIT_ULL(58)
1338 #define ICE_PHY_TYPE_LOW_100GBASE_CR_PAM4 BIT_ULL(59)
1339 #define ICE_PHY_TYPE_LOW_100GBASE_KR_PAM4 BIT_ULL(60)
1340 #define ICE_PHY_TYPE_LOW_100GBASE_CP2 BIT_ULL(61)
1341 #define ICE_PHY_TYPE_LOW_100GBASE_SR2 BIT_ULL(62)
1342 #define ICE_PHY_TYPE_LOW_100GBASE_DR BIT_ULL(63)
1343 #define ICE_PHY_TYPE_LOW_MAX_INDEX 63
1344 /* The second set of defines is for phy_type_high. */
1345 #define ICE_PHY_TYPE_HIGH_100GBASE_KR2_PAM4 BIT_ULL(0)
1346 #define ICE_PHY_TYPE_HIGH_100G_CAUI2_AOC_ACC BIT_ULL(1)
1347 #define ICE_PHY_TYPE_HIGH_100G_CAUI2 BIT_ULL(2)
1348 #define ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC BIT_ULL(3)
1349 #define ICE_PHY_TYPE_HIGH_100G_AUI2 BIT_ULL(4)
1350 #define ICE_PHY_TYPE_HIGH_MAX_INDEX 5
1352 struct ice_aqc_get_phy_caps_data {
1353 __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */
1354 __le64 phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */
1356 #define ICE_AQC_PHY_EN_TX_LINK_PAUSE BIT(0)
1357 #define ICE_AQC_PHY_EN_RX_LINK_PAUSE BIT(1)
1358 #define ICE_AQC_PHY_LOW_POWER_MODE BIT(2)
1359 #define ICE_AQC_PHY_EN_LINK BIT(3)
1360 #define ICE_AQC_PHY_AN_MODE BIT(4)
1361 #define ICE_AQC_PHY_EN_MOD_QUAL BIT(5)
1362 #define ICE_AQC_PHY_EN_LESM BIT(6)
1363 #define ICE_AQC_PHY_EN_AUTO_FEC BIT(7)
1364 #define ICE_AQC_PHY_CAPS_MASK MAKEMASK(0xff, 0)
1365 u8 low_power_ctrl_an;
1366 #define ICE_AQC_PHY_EN_D3COLD_LOW_POWER_AUTONEG BIT(0)
1367 #define ICE_AQC_PHY_AN_EN_CLAUSE28 BIT(1)
1368 #define ICE_AQC_PHY_AN_EN_CLAUSE73 BIT(2)
1369 #define ICE_AQC_PHY_AN_EN_CLAUSE37 BIT(3)
1371 #define ICE_AQC_PHY_EEE_EN_100BASE_TX BIT(0)
1372 #define ICE_AQC_PHY_EEE_EN_1000BASE_T BIT(1)
1373 #define ICE_AQC_PHY_EEE_EN_10GBASE_T BIT(2)
1374 #define ICE_AQC_PHY_EEE_EN_1000BASE_KX BIT(3)
1375 #define ICE_AQC_PHY_EEE_EN_10GBASE_KR BIT(4)
1376 #define ICE_AQC_PHY_EEE_EN_25GBASE_KR BIT(5)
1377 #define ICE_AQC_PHY_EEE_EN_40GBASE_KR4 BIT(6)
1378 #define ICE_AQC_PHY_EEE_EN_50GBASE_KR2 BIT(7)
1379 #define ICE_AQC_PHY_EEE_EN_50GBASE_KR_PAM4 BIT(8)
1380 #define ICE_AQC_PHY_EEE_EN_100GBASE_KR4 BIT(9)
1381 #define ICE_AQC_PHY_EEE_EN_100GBASE_KR2_PAM4 BIT(10)
1383 u8 phy_id_oui[4]; /* PHY/Module ID connected on the port */
1385 u8 link_fec_options;
1386 #define ICE_AQC_PHY_FEC_10G_KR_40G_KR4_EN BIT(0)
1387 #define ICE_AQC_PHY_FEC_10G_KR_40G_KR4_REQ BIT(1)
1388 #define ICE_AQC_PHY_FEC_25G_RS_528_REQ BIT(2)
1389 #define ICE_AQC_PHY_FEC_25G_KR_REQ BIT(3)
1390 #define ICE_AQC_PHY_FEC_25G_RS_544_REQ BIT(4)
1391 #define ICE_AQC_PHY_FEC_25G_RS_CLAUSE91_EN BIT(6)
1392 #define ICE_AQC_PHY_FEC_25G_KR_CLAUSE74_EN BIT(7)
1393 #define ICE_AQC_PHY_FEC_MASK MAKEMASK(0xdf, 0)
1394 u8 module_compliance_enforcement;
1395 #define ICE_AQC_MOD_ENFORCE_STRICT_MODE BIT(0)
1396 u8 extended_compliance_code;
1397 #define ICE_MODULE_TYPE_TOTAL_BYTE 3
1398 u8 module_type[ICE_MODULE_TYPE_TOTAL_BYTE];
1399 #define ICE_AQC_MOD_TYPE_BYTE0_SFP_PLUS 0xA0
1400 #define ICE_AQC_MOD_TYPE_BYTE0_QSFP_PLUS 0x80
1401 #define ICE_AQC_MOD_TYPE_IDENT 1
1402 #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_PASSIVE BIT(0)
1403 #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_ACTIVE BIT(1)
1404 #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_SR BIT(4)
1405 #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_LR BIT(5)
1406 #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_LRM BIT(6)
1407 #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_ER BIT(7)
1408 #define ICE_AQC_MOD_TYPE_BYTE2_SFP_PLUS 0xA0
1409 #define ICE_AQC_MOD_TYPE_BYTE2_QSFP_PLUS 0x86
1410 u8 qualified_module_count;
1411 u8 rsvd2[7]; /* Bytes 47:41 reserved */
1412 #define ICE_AQC_QUAL_MOD_COUNT_MAX 16
1419 } qual_modules[ICE_AQC_QUAL_MOD_COUNT_MAX];
1422 /* Set PHY capabilities (direct 0x0601)
1423 * NOTE: This command must be followed by setup link and restart auto-neg
1425 struct ice_aqc_set_phy_cfg {
1432 /* Set PHY config command data structure */
1433 struct ice_aqc_set_phy_cfg_data {
1434 __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */
1435 __le64 phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */
1437 #define ICE_AQ_PHY_ENA_VALID_MASK MAKEMASK(0xef, 0)
1438 #define ICE_AQ_PHY_ENA_TX_PAUSE_ABILITY BIT(0)
1439 #define ICE_AQ_PHY_ENA_RX_PAUSE_ABILITY BIT(1)
1440 #define ICE_AQ_PHY_ENA_LOW_POWER BIT(2)
1441 #define ICE_AQ_PHY_ENA_LINK BIT(3)
1442 #define ICE_AQ_PHY_ENA_AUTO_LINK_UPDT BIT(5)
1443 #define ICE_AQ_PHY_ENA_LESM BIT(6)
1444 #define ICE_AQ_PHY_ENA_AUTO_FEC BIT(7)
1445 u8 low_power_ctrl_an;
1446 __le16 eee_cap; /* Value from ice_aqc_get_phy_caps */
1448 u8 link_fec_opt; /* Use defines from ice_aqc_get_phy_caps */
1449 u8 module_compliance_enforcement;
1452 /* Set MAC Config command data structure (direct 0x0603) */
1453 struct ice_aqc_set_mac_cfg {
1454 __le16 max_frame_size;
1456 #define ICE_AQ_SET_MAC_PACE_S 3
1457 #define ICE_AQ_SET_MAC_PACE_M (0xF << ICE_AQ_SET_MAC_PACE_S)
1458 #define ICE_AQ_SET_MAC_PACE_TYPE_M BIT(7)
1459 #define ICE_AQ_SET_MAC_PACE_TYPE_RATE 0
1460 #define ICE_AQ_SET_MAC_PACE_TYPE_FIXED ICE_AQ_SET_MAC_PACE_TYPE_M
1462 __le16 tx_tmr_value;
1463 __le16 fc_refresh_threshold;
1465 #define ICE_AQ_SET_MAC_AUTO_DROP_MASK BIT(0)
1466 #define ICE_AQ_SET_MAC_AUTO_DROP_NONE 0
1467 #define ICE_AQ_SET_MAC_AUTO_DROP_BLOCKING_PKTS BIT(0)
1471 /* Restart AN command data structure (direct 0x0605)
1472 * Also used for response, with only the lport_num field present.
1474 struct ice_aqc_restart_an {
1478 #define ICE_AQC_RESTART_AN_LINK_RESTART BIT(1)
1479 #define ICE_AQC_RESTART_AN_LINK_ENABLE BIT(2)
1483 /* Get link status (indirect 0x0607), also used for Link Status Event */
1484 struct ice_aqc_get_link_status {
1488 #define ICE_AQ_LSE_M 0x3
1489 #define ICE_AQ_LSE_NOP 0x0
1490 #define ICE_AQ_LSE_DIS 0x2
1491 #define ICE_AQ_LSE_ENA 0x3
1492 /* only response uses this flag */
1493 #define ICE_AQ_LSE_IS_ENABLED 0x1
1499 /* Get link status response data structure, also used for Link Status Event */
1500 struct ice_aqc_get_link_status_data {
1501 u8 topo_media_conflict;
1502 #define ICE_AQ_LINK_TOPO_CONFLICT BIT(0)
1503 #define ICE_AQ_LINK_MEDIA_CONFLICT BIT(1)
1504 #define ICE_AQ_LINK_TOPO_CORRUPT BIT(2)
1505 #define ICE_AQ_LINK_TOPO_UNREACH_PRT BIT(4)
1506 #define ICE_AQ_LINK_TOPO_UNDRUTIL_PRT BIT(5)
1507 #define ICE_AQ_LINK_TOPO_UNDRUTIL_MEDIA BIT(6)
1508 #define ICE_AQ_LINK_TOPO_UNSUPP_MEDIA BIT(7)
1510 #define ICE_AQ_LINK_CFG_ERR BIT(0)
1511 #define ICE_AQ_LINK_ACT_PORT_OPT_INVAL BIT(2)
1512 #define ICE_AQ_LINK_FEAT_ID_OR_CONFIG_ID_INVAL BIT(3)
1513 #define ICE_AQ_LINK_TOPO_CRITICAL_SDP_ERR BIT(4)
1514 #define ICE_AQ_LINK_MODULE_POWER_UNSUPPORTED BIT(5)
1515 #define ICE_AQ_LINK_EXTERNAL_PHY_LOAD_FAILURE BIT(6)
1516 #define ICE_AQ_LINK_INVAL_MAX_POWER_LIMIT BIT(7)
1518 #define ICE_AQ_LINK_UP BIT(0) /* Link Status */
1519 #define ICE_AQ_LINK_FAULT BIT(1)
1520 #define ICE_AQ_LINK_FAULT_TX BIT(2)
1521 #define ICE_AQ_LINK_FAULT_RX BIT(3)
1522 #define ICE_AQ_LINK_FAULT_REMOTE BIT(4)
1523 #define ICE_AQ_LINK_UP_PORT BIT(5) /* External Port Link Status */
1524 #define ICE_AQ_MEDIA_AVAILABLE BIT(6)
1525 #define ICE_AQ_SIGNAL_DETECT BIT(7)
1527 #define ICE_AQ_AN_COMPLETED BIT(0)
1528 #define ICE_AQ_LP_AN_ABILITY BIT(1)
1529 #define ICE_AQ_PD_FAULT BIT(2) /* Parallel Detection Fault */
1530 #define ICE_AQ_FEC_EN BIT(3)
1531 #define ICE_AQ_PHY_LOW_POWER BIT(4) /* Low Power State */
1532 #define ICE_AQ_LINK_PAUSE_TX BIT(5)
1533 #define ICE_AQ_LINK_PAUSE_RX BIT(6)
1534 #define ICE_AQ_QUALIFIED_MODULE BIT(7)
1536 #define ICE_AQ_LINK_PHY_TEMP_ALARM BIT(0)
1537 #define ICE_AQ_LINK_EXCESSIVE_ERRORS BIT(1) /* Excessive Link Errors */
1538 /* Port Tx Suspended */
1539 #define ICE_AQ_LINK_TX_S 2
1540 #define ICE_AQ_LINK_TX_M (0x03 << ICE_AQ_LINK_TX_S)
1541 #define ICE_AQ_LINK_TX_ACTIVE 0
1542 #define ICE_AQ_LINK_TX_DRAINED 1
1543 #define ICE_AQ_LINK_TX_FLUSHED 3
1545 #define ICE_AQ_LINK_LB_PHY_LCL BIT(0)
1546 #define ICE_AQ_LINK_LB_PHY_RMT BIT(1)
1547 #define ICE_AQ_LINK_LB_MAC_LCL BIT(2)
1548 #define ICE_AQ_LINK_LB_PHY_IDX_S 3
1549 #define ICE_AQ_LINK_LB_PHY_IDX_M (0x7 << ICE_AQ_LB_PHY_IDX_S)
1550 __le16 max_frame_size;
1552 #define ICE_AQ_LINK_25G_KR_FEC_EN BIT(0)
1553 #define ICE_AQ_LINK_25G_RS_528_FEC_EN BIT(1)
1554 #define ICE_AQ_LINK_25G_RS_544_FEC_EN BIT(2)
1555 #define ICE_AQ_FEC_MASK MAKEMASK(0x7, 0)
1557 #define ICE_AQ_CFG_PACING_S 3
1558 #define ICE_AQ_CFG_PACING_M (0xF << ICE_AQ_CFG_PACING_S)
1559 #define ICE_AQ_CFG_PACING_TYPE_M BIT(7)
1560 #define ICE_AQ_CFG_PACING_TYPE_AVG 0
1561 #define ICE_AQ_CFG_PACING_TYPE_FIXED ICE_AQ_CFG_PACING_TYPE_M
1562 /* External Device Power Ability */
1564 #define ICE_AQ_PWR_CLASS_M 0x3F
1565 #define ICE_AQ_LINK_PWR_BASET_LOW_HIGH 0
1566 #define ICE_AQ_LINK_PWR_BASET_HIGH 1
1567 #define ICE_AQ_LINK_PWR_QSFP_CLASS_1 0
1568 #define ICE_AQ_LINK_PWR_QSFP_CLASS_2 1
1569 #define ICE_AQ_LINK_PWR_QSFP_CLASS_3 2
1570 #define ICE_AQ_LINK_PWR_QSFP_CLASS_4 3
1572 #define ICE_AQ_LINK_SPEED_M 0x7FF
1573 #define ICE_AQ_LINK_SPEED_10MB BIT(0)
1574 #define ICE_AQ_LINK_SPEED_100MB BIT(1)
1575 #define ICE_AQ_LINK_SPEED_1000MB BIT(2)
1576 #define ICE_AQ_LINK_SPEED_2500MB BIT(3)
1577 #define ICE_AQ_LINK_SPEED_5GB BIT(4)
1578 #define ICE_AQ_LINK_SPEED_10GB BIT(5)
1579 #define ICE_AQ_LINK_SPEED_20GB BIT(6)
1580 #define ICE_AQ_LINK_SPEED_25GB BIT(7)
1581 #define ICE_AQ_LINK_SPEED_40GB BIT(8)
1582 #define ICE_AQ_LINK_SPEED_50GB BIT(9)
1583 #define ICE_AQ_LINK_SPEED_100GB BIT(10)
1584 #define ICE_AQ_LINK_SPEED_UNKNOWN BIT(15)
1585 __le32 reserved3; /* Aligns next field to 8-byte boundary */
1586 __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */
1587 __le64 phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */
1590 /* Set event mask command (direct 0x0613) */
1591 struct ice_aqc_set_event_mask {
1595 #define ICE_AQ_LINK_EVENT_UPDOWN BIT(1)
1596 #define ICE_AQ_LINK_EVENT_MEDIA_NA BIT(2)
1597 #define ICE_AQ_LINK_EVENT_LINK_FAULT BIT(3)
1598 #define ICE_AQ_LINK_EVENT_PHY_TEMP_ALARM BIT(4)
1599 #define ICE_AQ_LINK_EVENT_EXCESSIVE_ERRORS BIT(5)
1600 #define ICE_AQ_LINK_EVENT_SIGNAL_DETECT BIT(6)
1601 #define ICE_AQ_LINK_EVENT_AN_COMPLETED BIT(7)
1602 #define ICE_AQ_LINK_EVENT_MODULE_QUAL_FAIL BIT(8)
1603 #define ICE_AQ_LINK_EVENT_PORT_TX_SUSPENDED BIT(9)
1604 #define ICE_AQ_LINK_EVENT_TOPO_CONFLICT BIT(10)
1605 #define ICE_AQ_LINK_EVENT_MEDIA_CONFLICT BIT(11)
1609 /* Set MAC Loopback command (direct 0x0620) */
1610 struct ice_aqc_set_mac_lb {
1612 #define ICE_AQ_MAC_LB_EN BIT(0)
1613 #define ICE_AQ_MAC_LB_OSC_CLK BIT(1)
1617 struct ice_aqc_link_topo_addr {
1620 #define ICE_AQC_LINK_TOPO_PORT_NUM_VALID BIT(0)
1622 #define ICE_AQC_LINK_TOPO_NODE_TYPE_S 0
1623 #define ICE_AQC_LINK_TOPO_NODE_TYPE_M (0xF << ICE_AQC_LINK_TOPO_NODE_TYPE_S)
1624 #define ICE_AQC_LINK_TOPO_NODE_TYPE_PHY 0
1625 #define ICE_AQC_LINK_TOPO_NODE_TYPE_GPIO_CTRL 1
1626 #define ICE_AQC_LINK_TOPO_NODE_TYPE_MUX_CTRL 2
1627 #define ICE_AQC_LINK_TOPO_NODE_TYPE_LED_CTRL 3
1628 #define ICE_AQC_LINK_TOPO_NODE_TYPE_LED 4
1629 #define ICE_AQC_LINK_TOPO_NODE_TYPE_THERMAL 5
1630 #define ICE_AQC_LINK_TOPO_NODE_TYPE_CAGE 6
1631 #define ICE_AQC_LINK_TOPO_NODE_TYPE_MEZZ 7
1632 #define ICE_AQC_LINK_TOPO_NODE_TYPE_ID_EEPROM 8
1633 #define ICE_AQC_LINK_TOPO_NODE_CTX_S 4
1634 #define ICE_AQC_LINK_TOPO_NODE_CTX_M \
1635 (0xF << ICE_AQC_LINK_TOPO_NODE_CTX_S)
1636 #define ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL 0
1637 #define ICE_AQC_LINK_TOPO_NODE_CTX_BOARD 1
1638 #define ICE_AQC_LINK_TOPO_NODE_CTX_PORT 2
1639 #define ICE_AQC_LINK_TOPO_NODE_CTX_NODE 3
1640 #define ICE_AQC_LINK_TOPO_NODE_CTX_PROVIDED 4
1641 #define ICE_AQC_LINK_TOPO_NODE_CTX_OVERRIDE 5
1644 #define ICE_AQC_LINK_TOPO_HANDLE_S 0
1645 #define ICE_AQC_LINK_TOPO_HANDLE_M (0x3FF << ICE_AQC_LINK_TOPO_HANDLE_S)
1646 /* Used to decode the handle field */
1647 #define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_M BIT(9)
1648 #define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_LOM BIT(9)
1649 #define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_MEZZ 0
1650 #define ICE_AQC_LINK_TOPO_HANDLE_NODE_S 0
1651 /* In case of a Mezzanine type */
1652 #define ICE_AQC_LINK_TOPO_HANDLE_MEZZ_NODE_M \
1653 (0x3F << ICE_AQC_LINK_TOPO_HANDLE_NODE_S)
1654 #define ICE_AQC_LINK_TOPO_HANDLE_MEZZ_S 6
1655 #define ICE_AQC_LINK_TOPO_HANDLE_MEZZ_M (0x7 << ICE_AQC_LINK_TOPO_HANDLE_MEZZ_S)
1656 /* In case of a LOM type */
1657 #define ICE_AQC_LINK_TOPO_HANDLE_LOM_NODE_M \
1658 (0x1FF << ICE_AQC_LINK_TOPO_HANDLE_NODE_S)
1661 /* Get Link Topology Handle (direct, 0x06E0) */
1662 struct ice_aqc_get_link_topo {
1663 struct ice_aqc_link_topo_addr addr;
1668 /* Read/Write I2C (direct, 0x06E2/0x06E3) */
1669 struct ice_aqc_i2c {
1670 struct ice_aqc_link_topo_addr topo_addr;
1673 #define ICE_AQC_I2C_DATA_SIZE_S 0
1674 #define ICE_AQC_I2C_DATA_SIZE_M (0xF << ICE_AQC_I2C_DATA_SIZE_S)
1675 #define ICE_AQC_I2C_ADDR_TYPE_M BIT(4)
1676 #define ICE_AQC_I2C_ADDR_TYPE_7BIT 0
1677 #define ICE_AQC_I2C_ADDR_TYPE_10BIT ICE_AQC_I2C_ADDR_TYPE_M
1678 #define ICE_AQC_I2C_DATA_OFFSET_S 5
1679 #define ICE_AQC_I2C_DATA_OFFSET_M (0x3 << ICE_AQC_I2C_DATA_OFFSET_S)
1680 #define ICE_AQC_I2C_USE_REPEATED_START BIT(7)
1682 __le16 i2c_bus_addr;
1683 #define ICE_AQC_I2C_ADDR_7BIT_MASK 0x7F
1684 #define ICE_AQC_I2C_ADDR_10BIT_MASK 0x3FF
1685 u8 i2c_data[4]; /* Used only by write command, reserved in read. */
1688 /* Read I2C Response (direct, 0x06E2) */
1689 struct ice_aqc_read_i2c_resp {
1693 /* Set Port Identification LED (direct, 0x06E9) */
1694 struct ice_aqc_set_port_id_led {
1697 #define ICE_AQC_PORT_ID_PORT_NUM_VALID BIT(0)
1699 #define ICE_AQC_PORT_IDENT_LED_BLINK BIT(0)
1700 #define ICE_AQC_PORT_IDENT_LED_ORIG 0
1704 /* Set/Get GPIO (direct, 0x06EC/0x06ED) */
1705 struct ice_aqc_gpio {
1706 __le16 gpio_ctrl_handle;
1707 #define ICE_AQC_GPIO_HANDLE_S 0
1708 #define ICE_AQC_GPIO_HANDLE_M (0x3FF << ICE_AQC_GPIO_HANDLE_S)
1714 /* Read/Write SFF EEPROM command (indirect 0x06EE) */
1715 struct ice_aqc_sff_eeprom {
1718 #define ICE_AQC_SFF_PORT_NUM_VALID BIT(0)
1719 __le16 i2c_bus_addr;
1720 #define ICE_AQC_SFF_I2CBUS_7BIT_M 0x7F
1721 #define ICE_AQC_SFF_I2CBUS_10BIT_M 0x3FF
1722 #define ICE_AQC_SFF_I2CBUS_TYPE_M BIT(10)
1723 #define ICE_AQC_SFF_I2CBUS_TYPE_7BIT 0
1724 #define ICE_AQC_SFF_I2CBUS_TYPE_10BIT ICE_AQC_SFF_I2CBUS_TYPE_M
1725 #define ICE_AQC_SFF_SET_EEPROM_PAGE_S 11
1726 #define ICE_AQC_SFF_SET_EEPROM_PAGE_M (0x3 << ICE_AQC_SFF_SET_EEPROM_PAGE_S)
1727 #define ICE_AQC_SFF_NO_PAGE_CHANGE 0
1728 #define ICE_AQC_SFF_SET_23_ON_MISMATCH 1
1729 #define ICE_AQC_SFF_SET_22_ON_MISMATCH 2
1730 #define ICE_AQC_SFF_IS_WRITE BIT(15)
1731 __le16 i2c_mem_addr;
1733 #define ICE_AQC_SFF_EEPROM_BANK_S 0
1734 #define ICE_AQC_SFF_EEPROM_BANK_M (0xFF << ICE_AQC_SFF_EEPROM_BANK_S)
1735 #define ICE_AQC_SFF_EEPROM_PAGE_S 8
1736 #define ICE_AQC_SFF_EEPROM_PAGE_M (0xFF << ICE_AQC_SFF_EEPROM_PAGE_S)
1741 /* SW Set GPIO command (indirect 0x6EF)
1742 * SW Get GPIO command (indirect 0x6F0)
1744 struct ice_aqc_sw_gpio {
1745 __le16 gpio_ctrl_handle;
1746 #define ICE_AQC_SW_GPIO_CONTROLLER_HANDLE_S 0
1747 #define ICE_AQC_SW_GPIO_CONTROLLER_HANDLE_M (0x3FF << ICE_AQC_SW_GPIO_CONTROLLER_HANDLE_S)
1749 #define ICE_AQC_SW_GPIO_NUMBER_S 0
1750 #define ICE_AQC_SW_GPIO_NUMBER_M (0x1F << ICE_AQC_SW_GPIO_NUMBER_S)
1752 #define ICE_AQC_SW_GPIO_PARAMS_DIRECTION BIT(1)
1753 #define ICE_AQC_SW_GPIO_PARAMS_VALUE BIT(0)
1757 /* Program topology device NVM (direct, 0x06F2) */
1758 struct ice_aqc_program_topology_device_nvm {
1766 /* Read topology device NVM (indirect, 0x06F3) */
1767 struct ice_aqc_read_topology_device_nvm {
1772 __le32 start_address;
1776 /* NVM Read command (indirect 0x0701)
1777 * NVM Erase commands (direct 0x0702)
1778 * NVM Write commands (indirect 0x0703)
1779 * NVM Write Activate commands (direct 0x0707)
1780 * NVM Shadow RAM Dump commands (direct 0x0707)
1782 struct ice_aqc_nvm {
1783 #define ICE_AQC_NVM_MAX_OFFSET 0xFFFFFF
1785 u8 offset_high; /* For Write Activate offset_high is used as flags2 */
1787 #define ICE_AQC_NVM_LAST_CMD BIT(0)
1788 #define ICE_AQC_NVM_PCIR_REQ BIT(0) /* Used by NVM Write reply */
1789 #define ICE_AQC_NVM_PRESERVATION_S 1 /* Used by NVM Write Activate only */
1790 #define ICE_AQC_NVM_PRESERVATION_M (3 << ICE_AQC_NVM_PRESERVATION_S)
1791 #define ICE_AQC_NVM_NO_PRESERVATION (0 << ICE_AQC_NVM_PRESERVATION_S)
1792 #define ICE_AQC_NVM_PRESERVE_ALL BIT(1)
1793 #define ICE_AQC_NVM_FACTORY_DEFAULT (2 << ICE_AQC_NVM_PRESERVATION_S)
1794 #define ICE_AQC_NVM_PRESERVE_SELECTED (3 << ICE_AQC_NVM_PRESERVATION_S)
1795 #define ICE_AQC_NVM_ACTIV_SEL_NVM BIT(3) /* Write Activate/SR Dump only */
1796 #define ICE_AQC_NVM_ACTIV_SEL_OROM BIT(4)
1797 #define ICE_AQC_NVM_ACTIV_SEL_NETLIST BIT(5)
1798 #define ICE_AQC_NVM_SPECIAL_UPDATE BIT(6)
1799 #define ICE_AQC_NVM_REVERT_LAST_ACTIV BIT(6) /* Write Activate only */
1800 #define ICE_AQC_NVM_ACTIV_SEL_MASK MAKEMASK(0x7, 3)
1801 #define ICE_AQC_NVM_FLASH_ONLY BIT(7)
1802 #define ICE_AQC_NVM_POR_FLAG 0 /* Used by NVM Write completion on ARQ */
1803 #define ICE_AQC_NVM_PERST_FLAG 1
1804 #define ICE_AQC_NVM_EMPR_FLAG 2
1805 #define ICE_AQC_NVM_EMPR_ENA BIT(0)
1806 __le16 module_typeid;
1808 #define ICE_AQC_NVM_ERASE_LEN 0xFFFF
1813 /* NVM Module_Type ID, needed offset and read_len for struct ice_aqc_nvm. */
1814 #define ICE_AQC_NVM_SECTOR_UNIT 4096 /* In Bytes */
1815 #define ICE_AQC_NVM_WORD_UNIT 2 /* In Bytes */
1817 #define ICE_AQC_NVM_START_POINT 0
1818 #define ICE_AQC_NVM_EMP_SR_PTR_OFFSET 0x90
1819 #define ICE_AQC_NVM_EMP_SR_PTR_RD_LEN 2 /* In Bytes */
1820 #define ICE_AQC_NVM_EMP_SR_PTR_M MAKEMASK(0x7FFF, 0)
1821 #define ICE_AQC_NVM_EMP_SR_PTR_TYPE_S 15
1822 #define ICE_AQC_NVM_EMP_SR_PTR_TYPE_M BIT(15)
1823 #define ICE_AQC_NVM_EMP_SR_PTR_TYPE_SECTOR 1
1825 #define ICE_AQC_NVM_LLDP_CFG_PTR_OFFSET 0x46
1826 #define ICE_AQC_NVM_LLDP_CFG_HEADER_LEN 2 /* In Bytes */
1827 #define ICE_AQC_NVM_LLDP_CFG_PTR_RD_LEN 2 /* In Bytes */
1829 #define ICE_AQC_NVM_LLDP_PRESERVED_MOD_ID 0x129
1830 #define ICE_AQC_NVM_CUR_LLDP_PERSIST_RD_OFFSET 2 /* In Bytes */
1831 #define ICE_AQC_NVM_LLDP_STATUS_M MAKEMASK(0xF, 0)
1832 #define ICE_AQC_NVM_LLDP_STATUS_M_LEN 4 /* In Bits */
1833 #define ICE_AQC_NVM_LLDP_STATUS_RD_LEN 4 /* In Bytes */
1835 /* Used for 0x0704 as well as for 0x0705 commands */
1836 struct ice_aqc_nvm_cfg {
1838 #define ICE_AQC_ANVM_MULTIPLE_ELEMS BIT(0)
1839 #define ICE_AQC_ANVM_IMMEDIATE_FIELD BIT(1)
1840 #define ICE_AQC_ANVM_NEW_CFG BIT(2)
1849 struct ice_aqc_nvm_cfg_data {
1851 __le16 field_options;
1855 /* NVM Checksum Command (direct, 0x0706) */
1856 struct ice_aqc_nvm_checksum {
1858 #define ICE_AQC_NVM_CHECKSUM_VERIFY BIT(0)
1859 #define ICE_AQC_NVM_CHECKSUM_RECALC BIT(1)
1861 __le16 checksum; /* Used only by response */
1862 #define ICE_AQC_NVM_CHECKSUM_CORRECT 0xBABA
1866 /* Get LLDP MIB (indirect 0x0A00)
1867 * Note: This is also used by the LLDP MIB Change Event (0x0A01)
1868 * as the format is the same.
1870 struct ice_aqc_lldp_get_mib {
1872 #define ICE_AQ_LLDP_MIB_TYPE_S 0
1873 #define ICE_AQ_LLDP_MIB_TYPE_M (0x3 << ICE_AQ_LLDP_MIB_TYPE_S)
1874 #define ICE_AQ_LLDP_MIB_LOCAL 0
1875 #define ICE_AQ_LLDP_MIB_REMOTE 1
1876 #define ICE_AQ_LLDP_MIB_LOCAL_AND_REMOTE 2
1877 #define ICE_AQ_LLDP_BRID_TYPE_S 2
1878 #define ICE_AQ_LLDP_BRID_TYPE_M (0x3 << ICE_AQ_LLDP_BRID_TYPE_S)
1879 #define ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID 0
1880 #define ICE_AQ_LLDP_BRID_TYPE_NON_TPMR 1
1881 /* Tx pause flags in the 0xA01 event use ICE_AQ_LLDP_TX_* */
1882 #define ICE_AQ_LLDP_TX_S 0x4
1883 #define ICE_AQ_LLDP_TX_M (0x03 << ICE_AQ_LLDP_TX_S)
1884 #define ICE_AQ_LLDP_TX_ACTIVE 0
1885 #define ICE_AQ_LLDP_TX_SUSPENDED 1
1886 #define ICE_AQ_LLDP_TX_FLUSHED 3
1887 /* The following bytes are reserved for the Get LLDP MIB command (0x0A00)
1888 * and in the LLDP MIB Change Event (0x0A01). They are valid for the
1889 * Get LLDP MIB (0x0A00) response only.
1899 /* Configure LLDP MIB Change Event (direct 0x0A01) */
1900 /* For MIB Change Event use ice_aqc_lldp_get_mib structure above */
1901 struct ice_aqc_lldp_set_mib_change {
1903 #define ICE_AQ_LLDP_MIB_UPDATE_ENABLE 0x0
1904 #define ICE_AQ_LLDP_MIB_UPDATE_DIS 0x1
1908 /* Add LLDP TLV (indirect 0x0A02)
1909 * Delete LLDP TLV (indirect 0x0A04)
1911 struct ice_aqc_lldp_add_delete_tlv {
1912 u8 type; /* only nearest bridge and non-TPMR from 0x0A00 */
1920 /* Update LLDP TLV (indirect 0x0A03) */
1921 struct ice_aqc_lldp_update_tlv {
1922 u8 type; /* only nearest bridge and non-TPMR from 0x0A00 */
1931 /* Stop LLDP (direct 0x0A05) */
1932 struct ice_aqc_lldp_stop {
1934 #define ICE_AQ_LLDP_AGENT_STATE_MASK BIT(0)
1935 #define ICE_AQ_LLDP_AGENT_STOP 0x0
1936 #define ICE_AQ_LLDP_AGENT_SHUTDOWN ICE_AQ_LLDP_AGENT_STATE_MASK
1937 #define ICE_AQ_LLDP_AGENT_PERSIST_DIS BIT(1)
1941 /* Start LLDP (direct 0x0A06) */
1942 struct ice_aqc_lldp_start {
1944 #define ICE_AQ_LLDP_AGENT_START BIT(0)
1945 #define ICE_AQ_LLDP_AGENT_PERSIST_ENA BIT(1)
1949 /* Get CEE DCBX Oper Config (0x0A07)
1950 * The command uses the generic descriptor struct and
1951 * returns the struct below as an indirect response.
1953 struct ice_aqc_get_cee_dcb_cfg_resp {
1958 __le16 oper_app_prio;
1959 #define ICE_AQC_CEE_APP_FCOE_S 0
1960 #define ICE_AQC_CEE_APP_FCOE_M (0x7 << ICE_AQC_CEE_APP_FCOE_S)
1961 #define ICE_AQC_CEE_APP_ISCSI_S 3
1962 #define ICE_AQC_CEE_APP_ISCSI_M (0x7 << ICE_AQC_CEE_APP_ISCSI_S)
1963 #define ICE_AQC_CEE_APP_FIP_S 8
1964 #define ICE_AQC_CEE_APP_FIP_M (0x7 << ICE_AQC_CEE_APP_FIP_S)
1966 #define ICE_AQC_CEE_PG_STATUS_S 0
1967 #define ICE_AQC_CEE_PG_STATUS_M (0x7 << ICE_AQC_CEE_PG_STATUS_S)
1968 #define ICE_AQC_CEE_PFC_STATUS_S 3
1969 #define ICE_AQC_CEE_PFC_STATUS_M (0x7 << ICE_AQC_CEE_PFC_STATUS_S)
1970 #define ICE_AQC_CEE_FCOE_STATUS_S 8
1971 #define ICE_AQC_CEE_FCOE_STATUS_M (0x7 << ICE_AQC_CEE_FCOE_STATUS_S)
1972 #define ICE_AQC_CEE_ISCSI_STATUS_S 11
1973 #define ICE_AQC_CEE_ISCSI_STATUS_M (0x7 << ICE_AQC_CEE_ISCSI_STATUS_S)
1974 #define ICE_AQC_CEE_FIP_STATUS_S 16
1975 #define ICE_AQC_CEE_FIP_STATUS_M (0x7 << ICE_AQC_CEE_FIP_STATUS_S)
1979 /* Set Local LLDP MIB (indirect 0x0A08)
1980 * Used to replace the local MIB of a given LLDP agent. e.g. DCBX
1982 struct ice_aqc_lldp_set_local_mib {
1984 #define SET_LOCAL_MIB_TYPE_DCBX_M BIT(0)
1985 #define SET_LOCAL_MIB_TYPE_LOCAL_MIB 0
1986 #define SET_LOCAL_MIB_TYPE_CEE_M BIT(1)
1987 #define SET_LOCAL_MIB_TYPE_CEE_WILLING 0
1988 #define SET_LOCAL_MIB_TYPE_CEE_NON_WILLING SET_LOCAL_MIB_TYPE_CEE_M
1996 struct ice_aqc_lldp_set_local_mib_resp {
1998 #define SET_LOCAL_MIB_RESP_EVENT_M BIT(0)
1999 #define SET_LOCAL_MIB_RESP_MIB_CHANGE_SILENT 0
2000 #define SET_LOCAL_MIB_RESP_MIB_CHANGE_EVENT SET_LOCAL_MIB_RESP_EVENT_M
2004 /* Stop/Start LLDP Agent (direct 0x0A09)
2005 * Used for stopping/starting specific LLDP agent. e.g. DCBX.
2006 * The same structure is used for the response, with the command field
2007 * being used as the status field.
2009 struct ice_aqc_lldp_stop_start_specific_agent {
2011 #define ICE_AQC_START_STOP_AGENT_M BIT(0)
2012 #define ICE_AQC_START_STOP_AGENT_STOP_DCBX 0
2013 #define ICE_AQC_START_STOP_AGENT_START_DCBX ICE_AQC_START_STOP_AGENT_M
2017 /* LLDP Filter Control (direct 0x0A0A) */
2018 struct ice_aqc_lldp_filter_ctrl {
2020 #define ICE_AQC_LLDP_FILTER_ACTION_M MAKEMASK(3, 0)
2021 #define ICE_AQC_LLDP_FILTER_ACTION_ADD 0x0
2022 #define ICE_AQC_LLDP_FILTER_ACTION_DELETE 0x1
2023 #define ICE_AQC_LLDP_FILTER_ACTION_UPDATE 0x2
2029 /* Get/Set RSS key (indirect 0x0B04/0x0B02) */
2030 struct ice_aqc_get_set_rss_key {
2031 #define ICE_AQC_GSET_RSS_KEY_VSI_VALID BIT(15)
2032 #define ICE_AQC_GSET_RSS_KEY_VSI_ID_S 0
2033 #define ICE_AQC_GSET_RSS_KEY_VSI_ID_M (0x3FF << ICE_AQC_GSET_RSS_KEY_VSI_ID_S)
2040 #define ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE 0x28
2041 #define ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE 0xC
2042 #define ICE_GET_SET_RSS_KEY_EXTEND_KEY_SIZE \
2043 (ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE + \
2044 ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE)
2047 * struct ice_aqc_get_set_rss_keys - Get/Set RSS hash key command buffer
2048 * @standard_rss_key: 40 most significant bytes of hash key
2049 * @extended_hash_key: 12 least significant bytes of hash key
2051 * Set/Get 40 byte hash key using standard_rss_key field, and set
2052 * extended_hash_key field to zero. Set/Get 52 byte hash key using
2053 * standard_rss_key field for 40 most significant bytes and the
2054 * extended_hash_key field for the 12 least significant bytes of hash key.
2056 struct ice_aqc_get_set_rss_keys {
2057 u8 standard_rss_key[ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE];
2058 u8 extended_hash_key[ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE];
2061 /* Get/Set RSS LUT (indirect 0x0B05/0x0B03) */
2062 struct ice_aqc_get_set_rss_lut {
2063 #define ICE_AQC_GSET_RSS_LUT_VSI_VALID BIT(15)
2064 #define ICE_AQC_GSET_RSS_LUT_VSI_ID_S 0
2065 #define ICE_AQC_GSET_RSS_LUT_VSI_ID_M (0x3FF << ICE_AQC_GSET_RSS_LUT_VSI_ID_S)
2067 #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S 0
2068 #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M \
2069 (0x3 << ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S)
2071 #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_VSI 0
2072 #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF 1
2073 #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_GLOBAL 2
2075 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S 2
2076 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M \
2077 (0x3 << ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S)
2079 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128 128
2080 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128_FLAG 0
2081 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512 512
2082 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512_FLAG 1
2083 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K 2048
2084 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K_FLAG 2
2086 #define ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_S 4
2087 #define ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_M \
2088 (0xF << ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_S)
2096 /* Clear FD Table Command (direct, 0x0B06) */
2097 struct ice_aqc_clear_fd_table {
2099 #define CL_FD_VM_VF_TYPE_VSI_IDX 1
2100 #define CL_FD_VM_VF_TYPE_PF_IDX 2
2106 /* Allocate ACL table (indirect 0x0C10) */
2107 #define ICE_AQC_ACL_KEY_WIDTH 40
2108 #define ICE_AQC_ACL_KEY_WIDTH_BYTES 5
2109 #define ICE_AQC_ACL_TCAM_DEPTH 512
2110 #define ICE_ACL_ENTRY_ALLOC_UNIT 64
2111 #define ICE_AQC_MAX_CONCURRENT_ACL_TBL 15
2112 #define ICE_AQC_MAX_ACTION_MEMORIES 20
2113 #define ICE_AQC_MAX_ACTION_ENTRIES 512
2114 #define ICE_AQC_ACL_SLICES 16
2115 #define ICE_AQC_ALLOC_ID_LESS_THAN_4K 0x1000
2116 /* The ACL block supports up to 8 actions per a single output. */
2117 #define ICE_AQC_TBL_MAX_ACTION_PAIRS 4
2119 #define ICE_AQC_MAX_TCAM_ALLOC_UNITS (ICE_AQC_ACL_TCAM_DEPTH / \
2120 ICE_ACL_ENTRY_ALLOC_UNIT)
2121 #define ICE_AQC_ACL_ALLOC_UNITS (ICE_AQC_ACL_SLICES * \
2122 ICE_AQC_MAX_TCAM_ALLOC_UNITS)
2124 struct ice_aqc_acl_alloc_table {
2127 u8 act_pairs_per_entry;
2128 /* For non-concurrent table allocation, this field needs
2129 * to be set to zero(0) otherwise it shall specify the
2130 * amount of concurrent tables whose AllocIDs are
2131 * specified in buffer. Thus the newly allocated table
2132 * is concurrent with table IDs specified in AllocIDs.
2134 #define ICE_AQC_ACL_ALLOC_TABLE_TYPE_NONCONCURR 0
2141 /* Allocate ACL table command buffer format */
2142 struct ice_aqc_acl_alloc_table_data {
2143 /* Dependent table AllocIDs. Each word in this 15 word array specifies
2144 * a dependent table AllocID according to the amount specified in the
2145 * "table_type" field. All unused words shall be set to 0xFFFF
2147 #define ICE_AQC_CONCURR_ID_INVALID 0xffff
2148 __le16 alloc_ids[ICE_AQC_MAX_CONCURRENT_ACL_TBL];
2151 /* Deallocate ACL table (indirect 0x0C11)
2152 * Allocate ACL action-pair (indirect 0x0C12)
2153 * Deallocate ACL action-pair (indirect 0x0C13)
2156 /* Following structure is common and used in case of deallocation
2157 * of ACL table and action-pair
2159 struct ice_aqc_acl_tbl_actpair {
2160 /* Alloc ID of the table being released */
2167 /* This response structure is same in case of alloc/dealloc table,
2168 * alloc/dealloc action-pair
2170 struct ice_aqc_acl_generic {
2171 /* if alloc_id is below 0x1000 then alllocation failed due to
2172 * unavailable resources, else this is set by FW to identify
2178 /* to be used only in case of alloc/dealloc table */
2180 /* Index of the first TCAM block, otherwise set to 0xFF
2181 * for a failed allocation
2184 /* Index of the last TCAM block. This index shall be
2185 * set to the value of first_tcam for single TCAM block
2186 * allocation, otherwise set to 0xFF for a failed
2191 /* reserved in case of alloc/dealloc action-pair */
2197 /* index of first entry (in both TCAM and action memories),
2198 * otherwise set to 0xFF for a failed allocation
2201 /* index of last entry (in both TCAM and action memories),
2202 * otherwise set to 0xFF for a failed allocation
2206 /* Each act_mem element specifies the order of the memory
2209 u8 act_mem[ICE_AQC_MAX_ACTION_MEMORIES];
2212 /* Allocate ACL scenario (indirect 0x0C14). This command doesn't have separate
2213 * response buffer since original command buffer gets updated with
2214 * 'scen_id' in case of success
2216 struct ice_aqc_acl_alloc_scen {
2230 /* De-allocate ACL scenario (direct 0x0C15). This command doesn't need
2231 * separate response buffer since nothing to be returned as a response
2234 struct ice_aqc_acl_dealloc_scen {
2239 /* Update ACL scenario (direct 0x0C1B)
2240 * Query ACL scenario (direct 0x0C23)
2242 struct ice_aqc_acl_update_query_scen {
2249 /* Input buffer format in case allocate/update ACL scenario and same format
2250 * is used for response buffer in case of query ACL scenario.
2251 * NOTE: de-allocate ACL scenario is direct command and doesn't require
2252 * "buffer", hence no buffer format.
2254 struct ice_aqc_acl_scen {
2256 /* Byte [x] selection for the TCAM key. This value must be
2257 * set to 0x0 for unusued TCAM.
2258 * Only Bit 6..0 is used in each byte and MSB is reserved
2260 #define ICE_AQC_ACL_ALLOC_SCE_SELECT_M 0x7F
2261 #define ICE_AQC_ACL_BYTE_SEL_BASE 0x20
2262 #define ICE_AQC_ACL_BYTE_SEL_BASE_PID 0x3E
2263 #define ICE_AQC_ACL_BYTE_SEL_BASE_PKT_DIR ICE_AQC_ACL_BYTE_SEL_BASE
2264 #define ICE_AQC_ACL_BYTE_SEL_BASE_RNG_CHK 0x3F
2266 /* TCAM Block entry masking. This value should be set to 0x0 for
2270 /* Bit 0 : masks TCAM entries 0-63
2271 * Bit 1 : masks TCAM entries 64-127
2272 * Bit 2 to 7 : follow the pattern of bit 0 and 1
2274 #define ICE_AQC_ACL_ALLOC_SCE_START_CMP BIT(0)
2275 #define ICE_AQC_ACL_ALLOC_SCE_START_SET BIT(1)
2278 } tcam_cfg[ICE_AQC_ACL_SLICES];
2280 /* Each byte, Bit 6..0: Action memory association to a TCAM block,
2281 * otherwise it shall be set to 0x0 for disabled memory action.
2282 * Bit 7 : Action memory enable for this scenario
2284 #define ICE_AQC_ACL_SCE_ACT_MEM_TCAM_ASSOC_M 0x7F
2285 #define ICE_AQC_ACL_SCE_ACT_MEM_EN BIT(7)
2286 u8 act_mem_cfg[ICE_AQC_MAX_ACTION_MEMORIES];
2289 /* Allocate ACL counters (indirect 0x0C16) */
2290 struct ice_aqc_acl_alloc_counters {
2291 /* Amount of contiguous counters requested. Min value is 1 and
2294 #define ICE_AQC_ACL_ALLOC_CNT_MIN_AMT 0x1
2295 #define ICE_AQC_ACL_ALLOC_CNT_MAX_AMT 0xFF
2298 /* Counter type: 'single counter' which can be configured to count
2299 * either bytes or packets
2301 #define ICE_AQC_ACL_CNT_TYPE_SINGLE 0x0
2303 /* Counter type: 'counter pair' which counts number of bytes and number
2306 #define ICE_AQC_ACL_CNT_TYPE_DUAL 0x1
2307 /* requested counter type, single/dual */
2310 /* counter bank allocation shall be 0-3 for 'byte or packet counter' */
2311 #define ICE_AQC_ACL_MAX_CNT_SINGLE 0x3
2312 /* counter bank allocation shall be 0-1 for 'byte and packet counter dual' */
2313 #define ICE_AQC_ACL_MAX_CNT_DUAL 0x1
2314 /* requested counter bank allocation */
2320 /* Applicable only in case of command */
2324 /* Applicable only in case of response */
2325 #define ICE_AQC_ACL_ALLOC_CNT_INVAL 0xFFFF
2327 /* Index of first allocated counter. 0xFFFF in case
2328 * of unsuccessful allocation
2330 __le16 first_counter;
2331 /* Index of last allocated counter. 0xFFFF in case
2332 * of unsuccessful allocation
2334 __le16 last_counter;
2340 /* De-allocate ACL counters (direct 0x0C17) */
2341 struct ice_aqc_acl_dealloc_counters {
2342 /* first counter being released */
2343 __le16 first_counter;
2344 /* last counter being released */
2345 __le16 last_counter;
2346 /* requested counter type, single/dual */
2348 /* requested counter bank allocation */
2353 /* De-allocate ACL resources (direct 0x0C1A). Used by SW to release all the
2354 * resources allocated for it using a single command
2356 struct ice_aqc_acl_dealloc_res {
2360 /* Program ACL actionpair (indirect 0x0C1C)
2361 * Query ACL actionpair (indirect 0x0C25)
2363 struct ice_aqc_acl_actpair {
2364 /* action mem index to program/update */
2367 /* The entry index in action memory to be programmed/updated */
2368 __le16 act_entry_index;
2374 /* Input buffer format for program/query action-pair admin command */
2375 struct ice_acl_act_entry {
2376 /* Action priority, values must be between 0..7 */
2377 #define ICE_AQC_ACT_PRIO_VALID_MAX 7
2378 #define ICE_AQC_ACT_PRIO_MSK MAKEMASK(0xff, 0)
2380 /* Action meta-data identifier. This field should be set to 0x0
2383 #define ICE_AQC_ACT_MDID_S 8
2384 #define ICE_AQC_ACT_MDID_MSK MAKEMASK(0xff00, ICE_AQC_ACT_MDID_S)
2387 #define ICE_AQC_ACT_VALUE_S 16
2388 #define ICE_AQC_ACT_VALUE_MSK MAKEMASK(0xffff0000, 16)
2392 #define ICE_ACL_NUM_ACT_PER_ACT_PAIR 2
2393 struct ice_aqc_actpair {
2394 struct ice_acl_act_entry act[ICE_ACL_NUM_ACT_PER_ACT_PAIR];
2397 /* Generic format used to describe either input or response buffer
2398 * for admin commands related to ACL profile
2400 struct ice_aqc_acl_prof_generic_frmt {
2401 /* The first byte of the byte selection base is reserved to keep the
2402 * first byte of the field vector where the packet direction info is
2403 * available. Thus we should start at index 1 of the field vector to
2404 * map its entries to the byte selection base.
2406 #define ICE_AQC_ACL_PROF_BYTE_SEL_START_IDX 1
2408 * Bit 0..5 = Byte selection for the byte selection base from the
2409 * extracted fields (expressed as byte offset in extracted fields).
2410 * Applicable values are 0..63
2411 * Bit 6..7 = Reserved
2413 #define ICE_AQC_ACL_PROF_BYTE_SEL_ELEMS 30
2414 u8 byte_selection[ICE_AQC_ACL_PROF_BYTE_SEL_ELEMS];
2416 * Bit 0..4 = Word selection for the word selection base from the
2417 * extracted fields (expressed as word offset in extracted fields).
2418 * Applicable values are 0..31
2419 * Bit 5..7 = Reserved
2421 #define ICE_AQC_ACL_PROF_WORD_SEL_ELEMS 32
2422 u8 word_selection[ICE_AQC_ACL_PROF_WORD_SEL_ELEMS];
2424 * Bit 0..3 = Double word selection for the double-word selection base
2425 * from the extracted fields (expressed as double-word offset in
2426 * extracted fields).
2427 * Applicable values are 0..15
2428 * Bit 4..7 = Reserved
2430 #define ICE_AQC_ACL_PROF_DWORD_SEL_ELEMS 15
2431 u8 dword_selection[ICE_AQC_ACL_PROF_DWORD_SEL_ELEMS];
2432 /* Scenario numbers for individual Physical Function's */
2433 #define ICE_AQC_ACL_PROF_PF_SCEN_NUM_ELEMS 8
2434 u8 pf_scenario_num[ICE_AQC_ACL_PROF_PF_SCEN_NUM_ELEMS];
2437 /* Program ACL profile extraction (indirect 0x0C1D)
2438 * Program ACL profile ranges (indirect 0x0C1E)
2439 * Query ACL profile (indirect 0x0C21)
2440 * Query ACL profile ranges (indirect 0x0C22)
2442 struct ice_aqc_acl_profile {
2443 u8 profile_id; /* Programmed/Updated profile ID */
2449 /* Input buffer format for program profile extraction admin command and
2450 * response buffer format for query profile admin command is as defined
2451 * in struct ice_aqc_acl_prof_generic_frmt
2454 /* Input buffer format for program profile ranges and query profile ranges
2455 * admin commands. Same format is used for response buffer in case of query
2456 * profile ranges command
2458 struct ice_acl_rng_data {
2459 /* The range checker output shall be sent when the value
2460 * related to this range checker is lower than low boundary
2462 __be16 low_boundary;
2463 /* The range checker output shall be sent when the value
2464 * related to this range checker is higher than high boundary
2466 __be16 high_boundary;
2467 /* A value of '0' in bit shall clear the relevant bit input
2468 * to the range checker
2473 struct ice_aqc_acl_profile_ranges {
2474 #define ICE_AQC_ACL_PROF_RANGES_NUM_CFG 8
2475 struct ice_acl_rng_data checker_cfg[ICE_AQC_ACL_PROF_RANGES_NUM_CFG];
2478 /* Program ACL entry (indirect 0x0C20)
2479 * Query ACL entry (indirect 0x0C24)
2481 struct ice_aqc_acl_entry {
2482 u8 tcam_index; /* Updated TCAM block index */
2484 __le16 entry_index; /* Updated entry index */
2490 /* Input buffer format in case of program ACL entry and response buffer format
2491 * in case of query ACL entry
2493 struct ice_aqc_acl_data {
2494 /* Entry key and entry key invert are 40 bits wide.
2495 * Byte 0..4 : entry key and Byte 5..7 are reserved
2496 * Byte 8..12: entry key invert and Byte 13..15 are reserved
2501 } entry_key, entry_key_invert;
2504 /* Query ACL counter (direct 0x0C27) */
2505 struct ice_aqc_acl_query_counter {
2506 /* Queried counter index */
2507 __le16 counter_index;
2508 /* Queried counter bank */
2515 /* Holds counter value/packet counter value */
2522 /* Add Tx LAN Queues (indirect 0x0C30) */
2523 struct ice_aqc_add_txqs {
2531 /* This is the descriptor of each queue entry for the Add Tx LAN Queues
2532 * command (0x0C30). Only used within struct ice_aqc_add_tx_qgrp.
2534 struct ice_aqc_add_txqs_perq {
2540 struct ice_aqc_txsched_elem info;
2543 /* The format of the command buffer for Add Tx LAN Queues (0x0C30)
2544 * is an array of the following structs. Please note that the length of
2545 * each struct ice_aqc_add_tx_qgrp is variable due
2546 * to the variable number of queues in each group!
2548 struct ice_aqc_add_tx_qgrp {
2552 struct ice_aqc_add_txqs_perq txqs[STRUCT_HACK_VAR_LEN];
2555 /* Disable Tx LAN Queues (indirect 0x0C31) */
2556 struct ice_aqc_dis_txqs {
2558 #define ICE_AQC_Q_DIS_CMD_S 0
2559 #define ICE_AQC_Q_DIS_CMD_M (0x3 << ICE_AQC_Q_DIS_CMD_S)
2560 #define ICE_AQC_Q_DIS_CMD_NO_FUNC_RESET (0 << ICE_AQC_Q_DIS_CMD_S)
2561 #define ICE_AQC_Q_DIS_CMD_VM_RESET BIT(ICE_AQC_Q_DIS_CMD_S)
2562 #define ICE_AQC_Q_DIS_CMD_VF_RESET (2 << ICE_AQC_Q_DIS_CMD_S)
2563 #define ICE_AQC_Q_DIS_CMD_PF_RESET (3 << ICE_AQC_Q_DIS_CMD_S)
2564 #define ICE_AQC_Q_DIS_CMD_SUBSEQ_CALL BIT(2)
2565 #define ICE_AQC_Q_DIS_CMD_FLUSH_PIPE BIT(3)
2567 __le16 vmvf_and_timeout;
2568 #define ICE_AQC_Q_DIS_VMVF_NUM_S 0
2569 #define ICE_AQC_Q_DIS_VMVF_NUM_M (0x3FF << ICE_AQC_Q_DIS_VMVF_NUM_S)
2570 #define ICE_AQC_Q_DIS_TIMEOUT_S 10
2571 #define ICE_AQC_Q_DIS_TIMEOUT_M (0x3F << ICE_AQC_Q_DIS_TIMEOUT_S)
2572 __le32 blocked_cgds;
2577 /* The buffer for Disable Tx LAN Queues (indirect 0x0C31)
2578 * contains the following structures, arrayed one after the
2580 * Note: Since the q_id is 16 bits wide, if the
2581 * number of queues is even, then 2 bytes of alignment MUST be
2582 * added before the start of the next group, to allow correct
2583 * alignment of the parent_teid field.
2586 struct ice_aqc_dis_txq_item {
2590 /* The length of the q_id array varies according to num_qs */
2591 #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S 15
2592 #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_LAN_Q \
2593 (0 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S)
2594 #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_RDMA_QSET \
2595 (1 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S)
2596 __le16 q_id[STRUCT_HACK_VAR_LEN];
2601 /* Tx LAN Queues Cleanup Event (0x0C31) */
2602 struct ice_aqc_txqs_cleanup {
2608 /* Move / Reconfigure Tx Queues (indirect 0x0C32) */
2609 struct ice_aqc_move_txqs {
2611 #define ICE_AQC_Q_CMD_TYPE_S 0
2612 #define ICE_AQC_Q_CMD_TYPE_M (0x3 << ICE_AQC_Q_CMD_TYPE_S)
2613 #define ICE_AQC_Q_CMD_TYPE_MOVE 1
2614 #define ICE_AQC_Q_CMD_TYPE_TC_CHANGE 2
2615 #define ICE_AQC_Q_CMD_TYPE_MOVE_AND_TC 3
2616 #define ICE_AQC_Q_CMD_SUBSEQ_CALL BIT(2)
2617 #define ICE_AQC_Q_CMD_FLUSH_PIPE BIT(3)
2621 #define ICE_AQC_Q_CMD_TIMEOUT_S 2
2622 #define ICE_AQC_Q_CMD_TIMEOUT_M (0x3F << ICE_AQC_Q_CMD_TIMEOUT_S)
2623 __le32 blocked_cgds;
2628 /* Per-queue data buffer for the Move Tx LAN Queues command/response */
2629 struct ice_aqc_move_txqs_elem {
2636 /* Indirect data buffer for the Move Tx LAN Queues command/response */
2637 struct ice_aqc_move_txqs_data {
2640 struct ice_aqc_move_txqs_elem txqs[STRUCT_HACK_VAR_LEN];
2643 /* Download Package (indirect 0x0C40) */
2644 /* Also used for Update Package (indirect 0x0C42 and 0x0C41) */
2645 struct ice_aqc_download_pkg {
2647 #define ICE_AQC_DOWNLOAD_PKG_LAST_BUF 0x01
2654 struct ice_aqc_download_pkg_resp {
2655 __le32 error_offset;
2661 /* Get Package Info List (indirect 0x0C43) */
2662 struct ice_aqc_get_pkg_info_list {
2669 /* Version format for packages */
2670 struct ice_pkg_ver {
2677 #define ICE_PKG_NAME_SIZE 32
2678 #define ICE_SEG_ID_SIZE 28
2679 #define ICE_SEG_NAME_SIZE 28
2681 struct ice_aqc_get_pkg_info {
2682 struct ice_pkg_ver ver;
2683 char name[ICE_SEG_NAME_SIZE];
2687 u8 is_active_at_boot;
2691 /* Get Package Info List response buffer format (0x0C43) */
2692 struct ice_aqc_get_pkg_info_resp {
2694 struct ice_aqc_get_pkg_info pkg_info[STRUCT_HACK_VAR_LEN];
2697 /* Driver Shared Parameters (direct, 0x0C90) */
2698 struct ice_aqc_driver_shared_params {
2700 #define ICE_AQC_DRIVER_PARAM_OP_MASK BIT(0)
2701 #define ICE_AQC_DRIVER_PARAM_SET 0
2702 #define ICE_AQC_DRIVER_PARAM_GET 1
2704 #define ICE_AQC_DRIVER_PARAM_MAX_IDX 15
2711 /* Lan Queue Overflow Event (direct, 0x1001) */
2712 struct ice_aqc_event_lan_overflow {
2713 __le32 prtdcb_ruptq;
2718 /* Set Health Status (direct 0xFF20) */
2719 struct ice_aqc_set_health_status_config {
2721 #define ICE_AQC_HEALTH_STATUS_SET_PF_SPECIFIC_MASK BIT(0)
2722 #define ICE_AQC_HEALTH_STATUS_SET_ALL_PF_MASK BIT(1)
2723 #define ICE_AQC_HEALTH_STATUS_SET_GLOBAL_MASK BIT(2)
2727 #define ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_STRICT 0x101
2728 #define ICE_AQC_HEALTH_STATUS_ERR_MOD_TYPE 0x102
2729 #define ICE_AQC_HEALTH_STATUS_ERR_MOD_QUAL 0x103
2730 #define ICE_AQC_HEALTH_STATUS_ERR_MOD_COMM 0x104
2731 #define ICE_AQC_HEALTH_STATUS_ERR_MOD_CONFLICT 0x105
2732 #define ICE_AQC_HEALTH_STATUS_ERR_MOD_NOT_PRESENT 0x106
2733 #define ICE_AQC_HEALTH_STATUS_INFO_MOD_UNDERUTILIZED 0x107
2734 #define ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_LENIENT 0x108
2735 #define ICE_AQC_HEALTH_STATUS_ERR_INVALID_LINK_CFG 0x10B
2736 #define ICE_AQC_HEALTH_STATUS_ERR_PORT_ACCESS 0x10C
2737 #define ICE_AQC_HEALTH_STATUS_ERR_PORT_UNREACHABLE 0x10D
2738 #define ICE_AQC_HEALTH_STATUS_INFO_PORT_SPEED_MOD_LIMITED 0x10F
2739 #define ICE_AQC_HEALTH_STATUS_ERR_PARALLEL_FAULT 0x110
2740 #define ICE_AQC_HEALTH_STATUS_INFO_PORT_SPEED_PHY_LIMITED 0x111
2741 #define ICE_AQC_HEALTH_STATUS_ERR_NETLIST_TOPO 0x112
2742 #define ICE_AQC_HEALTH_STATUS_ERR_NETLIST 0x113
2743 #define ICE_AQC_HEALTH_STATUS_ERR_TOPO_CONFLICT 0x114
2744 #define ICE_AQC_HEALTH_STATUS_ERR_LINK_HW_ACCESS 0x115
2745 #define ICE_AQC_HEALTH_STATUS_ERR_LINK_RUNTIME 0x116
2746 #define ICE_AQC_HEALTH_STATUS_ERR_DNL_INIT 0x117
2747 #define ICE_AQC_HEALTH_STATUS_INFO_RECOVERY 0x500
2748 #define ICE_AQC_HEALTH_STATUS_ERR_FLASH_ACCESS 0x501
2749 #define ICE_AQC_HEALTH_STATUS_ERR_NVM_AUTH 0x502
2750 #define ICE_AQC_HEALTH_STATUS_ERR_OROM_AUTH 0x503
2751 #define ICE_AQC_HEALTH_STATUS_ERR_DDP_AUTH 0x504
2752 #define ICE_AQC_HEALTH_STATUS_ERR_NVM_COMPAT 0x505
2753 #define ICE_AQC_HEALTH_STATUS_ERR_OROM_COMPAT 0x506
2754 #define ICE_AQC_HEALTH_STATUS_ERR_DCB_MIB 0x509
2756 /* Get Health Status codes (indirect 0xFF21) */
2757 struct ice_aqc_get_supported_health_status_codes {
2758 __le16 health_code_count;
2764 /* Get Health Status (indirect 0xFF22) */
2765 struct ice_aqc_get_health_status {
2766 __le16 health_status_count;
2772 /* Get Health Status event buffer entry, (0xFF22)
2773 * repeated per reported health status
2775 struct ice_aqc_health_status_elem {
2776 __le16 health_status_code;
2777 __le16 event_source;
2778 #define ICE_AQC_HEALTH_STATUS_PF (0x1)
2779 #define ICE_AQC_HEALTH_STATUS_PORT (0x2)
2780 #define ICE_AQC_HEALTH_STATUS_GLOBAL (0x3)
2781 __le32 internal_data1;
2782 #define ICE_AQC_HEALTH_STATUS_UNDEFINED_DATA (0xDEADBEEF)
2783 __le32 internal_data2;
2786 /* Clear Health Status (direct 0xFF23) */
2787 struct ice_aqc_clear_health_status {
2791 /* Set FW Logging configuration (indirect 0xFF30)
2792 * Register for FW Logging (indirect 0xFF31)
2793 * Query FW Logging (indirect 0xFF32)
2794 * FW Log Event (indirect 0xFF33)
2795 * Get FW Log (indirect 0xFF34)
2796 * Clear FW Log (indirect 0xFF35)
2799 struct ice_aqc_fw_log {
2801 #define ICE_AQC_FW_LOG_CONF_UART_EN BIT(0)
2802 #define ICE_AQC_FW_LOG_CONF_AQ_EN BIT(1)
2803 #define ICE_AQC_FW_LOG_CONF_SET_VALID BIT(3)
2804 #define ICE_AQC_FW_LOG_AQ_REGISTER BIT(0)
2805 #define ICE_AQC_FW_LOG_AQ_QUERY BIT(2)
2806 #define ICE_AQC_FW_LOG_PERSISTENT BIT(0)
2808 #define ICE_AQC_FW_LOG_MORE_DATA BIT(1)
2815 __le16 log_resolution;
2816 #define ICE_AQC_FW_LOG_MIN_RESOLUTION (1)
2817 #define ICE_AQC_FW_LOG_MAX_RESOLUTION (128)
2825 /* Response Buffer for:
2826 * Set Firmware Logging Configuration (0xFF30)
2827 * Query FW Logging (0xFF32)
2829 struct ice_aqc_fw_log_cfg_resp {
2830 __le16 module_identifier;
2836 * struct ice_aq_desc - Admin Queue (AQ) descriptor
2837 * @flags: ICE_AQ_FLAG_* flags
2838 * @opcode: AQ command opcode
2839 * @datalen: length in bytes of indirect/external data buffer
2840 * @retval: return value from firmware
2841 * @cookie_high: opaque data high-half
2842 * @cookie_low: opaque data low-half
2843 * @params: command-specific parameters
2845 * Descriptor format for commands the driver posts on the Admin Transmit Queue
2846 * (ATQ). The firmware writes back onto the command descriptor and returns
2847 * the result of the command. Asynchronous events that are not an immediate
2848 * result of the command are written to the Admin Receive Queue (ARQ) using
2849 * the same descriptor format. Descriptors are in little-endian notation with
2852 struct ice_aq_desc {
2861 struct ice_aqc_generic generic;
2862 struct ice_aqc_get_ver get_ver;
2863 struct ice_aqc_driver_ver driver_ver;
2864 struct ice_aqc_q_shutdown q_shutdown;
2865 struct ice_aqc_req_res res_owner;
2866 struct ice_aqc_manage_mac_read mac_read;
2867 struct ice_aqc_manage_mac_write mac_write;
2868 struct ice_aqc_clear_pxe clear_pxe;
2869 struct ice_aqc_config_no_drop_policy no_drop;
2870 struct ice_aqc_add_update_mir_rule add_update_rule;
2871 struct ice_aqc_delete_mir_rule del_rule;
2872 struct ice_aqc_list_caps get_cap;
2873 struct ice_aqc_get_phy_caps get_phy;
2874 struct ice_aqc_set_phy_cfg set_phy;
2875 struct ice_aqc_restart_an restart_an;
2876 struct ice_aqc_i2c read_write_i2c;
2877 struct ice_aqc_read_i2c_resp read_i2c_resp;
2878 struct ice_aqc_gpio read_write_gpio;
2879 struct ice_aqc_sff_eeprom read_write_sff_param;
2880 struct ice_aqc_set_port_id_led set_port_id_led;
2881 struct ice_aqc_get_sw_cfg get_sw_conf;
2882 struct ice_aqc_set_port_params set_port_params;
2883 struct ice_aqc_sw_rules sw_rules;
2884 struct ice_aqc_storm_cfg storm_conf;
2885 struct ice_aqc_add_get_recipe add_get_recipe;
2886 struct ice_aqc_recipe_to_profile recipe_to_profile;
2887 struct ice_aqc_get_topo get_topo;
2888 struct ice_aqc_sched_elem_cmd sched_elem_cmd;
2889 struct ice_aqc_query_txsched_res query_sched_res;
2890 struct ice_aqc_query_node_to_root query_node_to_root;
2891 struct ice_aqc_cfg_l2_node_cgd cfg_l2_node_cgd;
2892 struct ice_aqc_query_port_ets port_ets;
2893 struct ice_aqc_rl_profile rl_profile;
2894 struct ice_aqc_nvm nvm;
2895 struct ice_aqc_nvm_cfg nvm_cfg;
2896 struct ice_aqc_nvm_checksum nvm_checksum;
2897 struct ice_aqc_pfc_ignore pfc_ignore;
2898 struct ice_aqc_set_query_pfc_mode set_query_pfc_mode;
2899 struct ice_aqc_set_dcb_params set_dcb_params;
2900 struct ice_aqc_lldp_get_mib lldp_get_mib;
2901 struct ice_aqc_lldp_set_mib_change lldp_set_event;
2902 struct ice_aqc_lldp_add_delete_tlv lldp_add_delete_tlv;
2903 struct ice_aqc_lldp_update_tlv lldp_update_tlv;
2904 struct ice_aqc_lldp_stop lldp_stop;
2905 struct ice_aqc_lldp_start lldp_start;
2906 struct ice_aqc_lldp_set_local_mib lldp_set_mib;
2907 struct ice_aqc_lldp_stop_start_specific_agent lldp_agent_ctrl;
2908 struct ice_aqc_lldp_filter_ctrl lldp_filter_ctrl;
2909 struct ice_aqc_get_set_rss_lut get_set_rss_lut;
2910 struct ice_aqc_get_set_rss_key get_set_rss_key;
2911 struct ice_aqc_clear_fd_table clear_fd_table;
2912 struct ice_aqc_acl_alloc_table alloc_table;
2913 struct ice_aqc_acl_tbl_actpair tbl_actpair;
2914 struct ice_aqc_acl_alloc_scen alloc_scen;
2915 struct ice_aqc_acl_dealloc_scen dealloc_scen;
2916 struct ice_aqc_acl_update_query_scen update_query_scen;
2917 struct ice_aqc_acl_alloc_counters alloc_counters;
2918 struct ice_aqc_acl_dealloc_counters dealloc_counters;
2919 struct ice_aqc_acl_dealloc_res dealloc_res;
2920 struct ice_aqc_acl_entry program_query_entry;
2921 struct ice_aqc_acl_actpair program_query_actpair;
2922 struct ice_aqc_acl_profile profile;
2923 struct ice_aqc_acl_query_counter query_counter;
2924 struct ice_aqc_add_txqs add_txqs;
2925 struct ice_aqc_dis_txqs dis_txqs;
2926 struct ice_aqc_move_txqs move_txqs;
2927 struct ice_aqc_txqs_cleanup txqs_cleanup;
2928 struct ice_aqc_add_get_update_free_vsi vsi_cmd;
2929 struct ice_aqc_add_update_free_vsi_resp add_update_free_vsi_res;
2930 struct ice_aqc_get_vsi_resp get_vsi_resp;
2931 struct ice_aqc_download_pkg download_pkg;
2932 struct ice_aqc_get_pkg_info_list get_pkg_info_list;
2933 struct ice_aqc_driver_shared_params drv_shared_params;
2934 struct ice_aqc_set_mac_lb set_mac_lb;
2935 struct ice_aqc_alloc_free_res_cmd sw_res_ctrl;
2936 struct ice_aqc_get_res_alloc get_res;
2937 struct ice_aqc_get_allocd_res_desc get_res_desc;
2938 struct ice_aqc_set_mac_cfg set_mac_cfg;
2939 struct ice_aqc_set_event_mask set_event_mask;
2940 struct ice_aqc_get_link_status get_link_status;
2941 struct ice_aqc_event_lan_overflow lan_overflow;
2942 struct ice_aqc_get_link_topo get_link_topo;
2943 struct ice_aqc_set_health_status_config
2944 set_health_status_config;
2945 struct ice_aqc_get_supported_health_status_codes
2946 get_supported_health_status_codes;
2947 struct ice_aqc_get_health_status get_health_status;
2948 struct ice_aqc_clear_health_status clear_health_status;
2952 /* FW defined boundary for a large buffer, 4k >= Large buffer > 512 bytes */
2953 #define ICE_AQ_LG_BUF 512
2955 /* Flags sub-structure
2956 * |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |10 |11 |12 |13 |14 |15 |
2957 * |DD |CMP|ERR|VFE| * * RESERVED * * |LB |RD |VFC|BUF|SI |EI |FE |
2960 /* command flags and offsets */
2961 #define ICE_AQ_FLAG_DD_S 0
2962 #define ICE_AQ_FLAG_CMP_S 1
2963 #define ICE_AQ_FLAG_ERR_S 2
2964 #define ICE_AQ_FLAG_VFE_S 3
2965 #define ICE_AQ_FLAG_LB_S 9
2966 #define ICE_AQ_FLAG_RD_S 10
2967 #define ICE_AQ_FLAG_VFC_S 11
2968 #define ICE_AQ_FLAG_BUF_S 12
2969 #define ICE_AQ_FLAG_SI_S 13
2970 #define ICE_AQ_FLAG_EI_S 14
2971 #define ICE_AQ_FLAG_FE_S 15
2973 #define ICE_AQ_FLAG_DD BIT(ICE_AQ_FLAG_DD_S) /* 0x1 */
2974 #define ICE_AQ_FLAG_CMP BIT(ICE_AQ_FLAG_CMP_S) /* 0x2 */
2975 #define ICE_AQ_FLAG_ERR BIT(ICE_AQ_FLAG_ERR_S) /* 0x4 */
2976 #define ICE_AQ_FLAG_VFE BIT(ICE_AQ_FLAG_VFE_S) /* 0x8 */
2977 #define ICE_AQ_FLAG_LB BIT(ICE_AQ_FLAG_LB_S) /* 0x200 */
2978 #define ICE_AQ_FLAG_RD BIT(ICE_AQ_FLAG_RD_S) /* 0x400 */
2979 #define ICE_AQ_FLAG_VFC BIT(ICE_AQ_FLAG_VFC_S) /* 0x800 */
2980 #define ICE_AQ_FLAG_BUF BIT(ICE_AQ_FLAG_BUF_S) /* 0x1000 */
2981 #define ICE_AQ_FLAG_SI BIT(ICE_AQ_FLAG_SI_S) /* 0x2000 */
2982 #define ICE_AQ_FLAG_EI BIT(ICE_AQ_FLAG_EI_S) /* 0x4000 */
2983 #define ICE_AQ_FLAG_FE BIT(ICE_AQ_FLAG_FE_S) /* 0x8000 */
2987 ICE_AQ_RC_OK = 0, /* Success */
2988 ICE_AQ_RC_EPERM = 1, /* Operation not permitted */
2989 ICE_AQ_RC_ENOENT = 2, /* No such element */
2990 ICE_AQ_RC_ESRCH = 3, /* Bad opcode */
2991 ICE_AQ_RC_EINTR = 4, /* Operation interrupted */
2992 ICE_AQ_RC_EIO = 5, /* I/O error */
2993 ICE_AQ_RC_ENXIO = 6, /* No such resource */
2994 ICE_AQ_RC_E2BIG = 7, /* Arg too long */
2995 ICE_AQ_RC_EAGAIN = 8, /* Try again */
2996 ICE_AQ_RC_ENOMEM = 9, /* Out of memory */
2997 ICE_AQ_RC_EACCES = 10, /* Permission denied */
2998 ICE_AQ_RC_EFAULT = 11, /* Bad address */
2999 ICE_AQ_RC_EBUSY = 12, /* Device or resource busy */
3000 ICE_AQ_RC_EEXIST = 13, /* Object already exists */
3001 ICE_AQ_RC_EINVAL = 14, /* Invalid argument */
3002 ICE_AQ_RC_ENOTTY = 15, /* Not a typewriter */
3003 ICE_AQ_RC_ENOSPC = 16, /* No space left or allocation failure */
3004 ICE_AQ_RC_ENOSYS = 17, /* Function not implemented */
3005 ICE_AQ_RC_ERANGE = 18, /* Parameter out of range */
3006 ICE_AQ_RC_EFLUSHED = 19, /* Cmd flushed due to prev cmd error */
3007 ICE_AQ_RC_BAD_ADDR = 20, /* Descriptor contains a bad pointer */
3008 ICE_AQ_RC_EMODE = 21, /* Op not allowed in current dev mode */
3009 ICE_AQ_RC_EFBIG = 22, /* File too big */
3010 ICE_AQ_RC_ESBCOMP = 23, /* SB-IOSF completion unsuccessful */
3011 ICE_AQ_RC_ENOSEC = 24, /* Missing security manifest */
3012 ICE_AQ_RC_EBADSIG = 25, /* Bad RSA signature */
3013 ICE_AQ_RC_ESVN = 26, /* SVN number prohibits this package */
3014 ICE_AQ_RC_EBADMAN = 27, /* Manifest hash mismatch */
3015 ICE_AQ_RC_EBADBUF = 28, /* Buffer hash mismatches manifest */
3016 ICE_AQ_RC_EACCES_BMCU = 29, /* BMC Update in progress */
3019 /* Admin Queue command opcodes */
3020 enum ice_adminq_opc {
3022 ice_aqc_opc_get_ver = 0x0001,
3023 ice_aqc_opc_driver_ver = 0x0002,
3024 ice_aqc_opc_q_shutdown = 0x0003,
3025 ice_aqc_opc_get_exp_err = 0x0005,
3027 /* resource ownership */
3028 ice_aqc_opc_req_res = 0x0008,
3029 ice_aqc_opc_release_res = 0x0009,
3031 /* device/function capabilities */
3032 ice_aqc_opc_list_func_caps = 0x000A,
3033 ice_aqc_opc_list_dev_caps = 0x000B,
3035 /* manage MAC address */
3036 ice_aqc_opc_manage_mac_read = 0x0107,
3037 ice_aqc_opc_manage_mac_write = 0x0108,
3040 ice_aqc_opc_clear_pxe_mode = 0x0110,
3042 ice_aqc_opc_config_no_drop_policy = 0x0112,
3044 /* internal switch commands */
3045 ice_aqc_opc_get_sw_cfg = 0x0200,
3046 ice_aqc_opc_set_port_params = 0x0203,
3048 /* Alloc/Free/Get Resources */
3049 ice_aqc_opc_get_res_alloc = 0x0204,
3050 ice_aqc_opc_alloc_res = 0x0208,
3051 ice_aqc_opc_free_res = 0x0209,
3052 ice_aqc_opc_get_allocd_res_desc = 0x020A,
3053 ice_aqc_opc_set_vlan_mode_parameters = 0x020C,
3054 ice_aqc_opc_get_vlan_mode_parameters = 0x020D,
3057 ice_aqc_opc_add_vsi = 0x0210,
3058 ice_aqc_opc_update_vsi = 0x0211,
3059 ice_aqc_opc_get_vsi_params = 0x0212,
3060 ice_aqc_opc_free_vsi = 0x0213,
3062 /* Mirroring rules - add/update, delete */
3063 ice_aqc_opc_add_update_mir_rule = 0x0260,
3064 ice_aqc_opc_del_mir_rule = 0x0261,
3066 /* storm configuration */
3067 ice_aqc_opc_set_storm_cfg = 0x0280,
3068 ice_aqc_opc_get_storm_cfg = 0x0281,
3070 /* recipe commands */
3071 ice_aqc_opc_add_recipe = 0x0290,
3072 ice_aqc_opc_recipe_to_profile = 0x0291,
3073 ice_aqc_opc_get_recipe = 0x0292,
3074 ice_aqc_opc_get_recipe_to_profile = 0x0293,
3076 /* switch rules population commands */
3077 ice_aqc_opc_add_sw_rules = 0x02A0,
3078 ice_aqc_opc_update_sw_rules = 0x02A1,
3079 ice_aqc_opc_remove_sw_rules = 0x02A2,
3080 ice_aqc_opc_get_sw_rules = 0x02A3,
3081 ice_aqc_opc_clear_pf_cfg = 0x02A4,
3084 ice_aqc_opc_pfc_ignore = 0x0301,
3085 ice_aqc_opc_query_pfc_mode = 0x0302,
3086 ice_aqc_opc_set_pfc_mode = 0x0303,
3087 ice_aqc_opc_set_dcb_params = 0x0306,
3089 /* transmit scheduler commands */
3090 ice_aqc_opc_get_dflt_topo = 0x0400,
3091 ice_aqc_opc_add_sched_elems = 0x0401,
3092 ice_aqc_opc_cfg_sched_elems = 0x0403,
3093 ice_aqc_opc_get_sched_elems = 0x0404,
3094 ice_aqc_opc_move_sched_elems = 0x0408,
3095 ice_aqc_opc_suspend_sched_elems = 0x0409,
3096 ice_aqc_opc_resume_sched_elems = 0x040A,
3097 ice_aqc_opc_query_port_ets = 0x040E,
3098 ice_aqc_opc_delete_sched_elems = 0x040F,
3099 ice_aqc_opc_add_rl_profiles = 0x0410,
3100 ice_aqc_opc_query_rl_profiles = 0x0411,
3101 ice_aqc_opc_query_sched_res = 0x0412,
3102 ice_aqc_opc_query_node_to_root = 0x0413,
3103 ice_aqc_opc_cfg_l2_node_cgd = 0x0414,
3104 ice_aqc_opc_remove_rl_profiles = 0x0415,
3107 ice_aqc_opc_get_phy_caps = 0x0600,
3108 ice_aqc_opc_set_phy_cfg = 0x0601,
3109 ice_aqc_opc_set_mac_cfg = 0x0603,
3110 ice_aqc_opc_restart_an = 0x0605,
3111 ice_aqc_opc_get_link_status = 0x0607,
3112 ice_aqc_opc_set_event_mask = 0x0613,
3113 ice_aqc_opc_set_mac_lb = 0x0620,
3114 ice_aqc_opc_get_link_topo = 0x06E0,
3115 ice_aqc_opc_read_i2c = 0x06E2,
3116 ice_aqc_opc_write_i2c = 0x06E3,
3117 ice_aqc_opc_set_port_id_led = 0x06E9,
3118 ice_aqc_opc_get_port_options = 0x06EA,
3119 ice_aqc_opc_set_port_option = 0x06EB,
3120 ice_aqc_opc_set_gpio = 0x06EC,
3121 ice_aqc_opc_get_gpio = 0x06ED,
3122 ice_aqc_opc_sff_eeprom = 0x06EE,
3123 ice_aqc_opc_sw_set_gpio = 0x06EF,
3124 ice_aqc_opc_sw_get_gpio = 0x06F0,
3125 ice_aqc_opc_program_topology_device_nvm = 0x06F2,
3126 ice_aqc_opc_read_topology_device_nvm = 0x06F3,
3129 ice_aqc_opc_nvm_read = 0x0701,
3130 ice_aqc_opc_nvm_erase = 0x0702,
3131 ice_aqc_opc_nvm_write = 0x0703,
3132 ice_aqc_opc_nvm_cfg_read = 0x0704,
3133 ice_aqc_opc_nvm_cfg_write = 0x0705,
3134 ice_aqc_opc_nvm_checksum = 0x0706,
3135 ice_aqc_opc_nvm_write_activate = 0x0707,
3136 ice_aqc_opc_nvm_sr_dump = 0x0707,
3137 ice_aqc_opc_nvm_save_factory_settings = 0x0708,
3138 ice_aqc_opc_nvm_update_empr = 0x0709,
3141 ice_aqc_opc_lldp_get_mib = 0x0A00,
3142 ice_aqc_opc_lldp_set_mib_change = 0x0A01,
3143 ice_aqc_opc_lldp_add_tlv = 0x0A02,
3144 ice_aqc_opc_lldp_update_tlv = 0x0A03,
3145 ice_aqc_opc_lldp_delete_tlv = 0x0A04,
3146 ice_aqc_opc_lldp_stop = 0x0A05,
3147 ice_aqc_opc_lldp_start = 0x0A06,
3148 ice_aqc_opc_get_cee_dcb_cfg = 0x0A07,
3149 ice_aqc_opc_lldp_set_local_mib = 0x0A08,
3150 ice_aqc_opc_lldp_stop_start_specific_agent = 0x0A09,
3151 ice_aqc_opc_lldp_filter_ctrl = 0x0A0A,
3154 ice_aqc_opc_set_rss_key = 0x0B02,
3155 ice_aqc_opc_set_rss_lut = 0x0B03,
3156 ice_aqc_opc_get_rss_key = 0x0B04,
3157 ice_aqc_opc_get_rss_lut = 0x0B05,
3158 ice_aqc_opc_clear_fd_table = 0x0B06,
3160 ice_aqc_opc_alloc_acl_tbl = 0x0C10,
3161 ice_aqc_opc_dealloc_acl_tbl = 0x0C11,
3162 ice_aqc_opc_alloc_acl_actpair = 0x0C12,
3163 ice_aqc_opc_dealloc_acl_actpair = 0x0C13,
3164 ice_aqc_opc_alloc_acl_scen = 0x0C14,
3165 ice_aqc_opc_dealloc_acl_scen = 0x0C15,
3166 ice_aqc_opc_alloc_acl_counters = 0x0C16,
3167 ice_aqc_opc_dealloc_acl_counters = 0x0C17,
3168 ice_aqc_opc_dealloc_acl_res = 0x0C1A,
3169 ice_aqc_opc_update_acl_scen = 0x0C1B,
3170 ice_aqc_opc_program_acl_actpair = 0x0C1C,
3171 ice_aqc_opc_program_acl_prof_extraction = 0x0C1D,
3172 ice_aqc_opc_program_acl_prof_ranges = 0x0C1E,
3173 ice_aqc_opc_program_acl_entry = 0x0C20,
3174 ice_aqc_opc_query_acl_prof = 0x0C21,
3175 ice_aqc_opc_query_acl_prof_ranges = 0x0C22,
3176 ice_aqc_opc_query_acl_scen = 0x0C23,
3177 ice_aqc_opc_query_acl_entry = 0x0C24,
3178 ice_aqc_opc_query_acl_actpair = 0x0C25,
3179 ice_aqc_opc_query_acl_counter = 0x0C27,
3181 /* Tx queue handling commands/events */
3182 ice_aqc_opc_add_txqs = 0x0C30,
3183 ice_aqc_opc_dis_txqs = 0x0C31,
3184 ice_aqc_opc_txqs_cleanup = 0x0C31,
3185 ice_aqc_opc_move_recfg_txqs = 0x0C32,
3187 /* package commands */
3188 ice_aqc_opc_download_pkg = 0x0C40,
3189 ice_aqc_opc_upload_section = 0x0C41,
3190 ice_aqc_opc_update_pkg = 0x0C42,
3191 ice_aqc_opc_get_pkg_info_list = 0x0C43,
3193 ice_aqc_opc_driver_shared_params = 0x0C90,
3195 /* Standalone Commands/Events */
3196 ice_aqc_opc_event_lan_overflow = 0x1001,
3198 /* SystemDiagnostic commands */
3199 ice_aqc_opc_set_health_status_config = 0xFF20,
3200 ice_aqc_opc_get_supported_health_status_codes = 0xFF21,
3201 ice_aqc_opc_get_health_status = 0xFF22,
3202 ice_aqc_opc_clear_health_status = 0xFF23,
3204 /* FW Logging Commands */
3205 ice_aqc_opc_fw_logs_config = 0xFF30,
3206 ice_aqc_opc_fw_logs_register = 0xFF31,
3207 ice_aqc_opc_fw_logs_query = 0xFF32,
3208 ice_aqc_opc_fw_logs_event = 0xFF33,
3209 ice_aqc_opc_fw_logs_get = 0xFF34,
3210 ice_aqc_opc_fw_logs_clear = 0xFF35
3213 #endif /* _ICE_ADMINQ_CMD_H_ */