1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* Copyright (c) 2018, Intel Corporation. */ 3 4 #ifndef _ICE_ADMINQ_CMD_H_ 5 #define _ICE_ADMINQ_CMD_H_ 6 7 #include <linux/net/intel/libie/adminq.h> 8 9 /* This header file defines the Admin Queue commands, error codes and 10 * descriptor format. It is shared between Firmware and Software. 11 */ 12 13 #define ICE_MAX_VSI 768 14 #define ICE_AQC_TOPO_MAX_LEVEL_NUM 0x9 15 #define ICE_AQ_SET_MAC_FRAME_SIZE_MAX 9728 16 17 #define ICE_RXQ_CTX_SIZE_DWORDS 8 18 #define ICE_RXQ_CTX_SZ (ICE_RXQ_CTX_SIZE_DWORDS * sizeof(u32)) 19 20 typedef struct __packed { u8 buf[ICE_RXQ_CTX_SZ]; } ice_rxq_ctx_buf_t; 21 22 /* The Tx queue context is 40 bytes, and includes some internal state. The 23 * Admin Queue buffers don't include the internal state, so only include the 24 * first 22 bytes of the context. 25 */ 26 #define ICE_TXQ_CTX_SZ 22 27 28 typedef struct __packed { u8 buf[ICE_TXQ_CTX_SZ]; } ice_txq_ctx_buf_t; 29 30 #define ICE_TXQ_CTX_FULL_SIZE_DWORDS 10 31 #define ICE_TXQ_CTX_FULL_SZ \ 32 (ICE_TXQ_CTX_FULL_SIZE_DWORDS * sizeof(u32)) 33 34 typedef struct __packed { u8 buf[ICE_TXQ_CTX_FULL_SZ]; } ice_txq_ctx_buf_full_t; 35 36 #define ICE_TXTIME_CTX_SZ 25 37 38 typedef struct __packed { u8 buf[ICE_TXTIME_CTX_SZ]; } ice_txtime_ctx_buf_t; 39 40 /* Queue Shutdown (direct 0x0003) */ 41 struct ice_aqc_q_shutdown { 42 u8 driver_unloading; 43 #define ICE_AQC_DRIVER_UNLOADING BIT(0) 44 u8 reserved[15]; 45 }; 46 47 /* Manage MAC address, read command - indirect (0x0107) 48 * This struct is also used for the response 49 */ 50 struct ice_aqc_manage_mac_read { 51 __le16 flags; /* Zeroed by device driver */ 52 #define ICE_AQC_MAN_MAC_LAN_ADDR_VALID BIT(4) 53 #define ICE_AQC_MAN_MAC_SAN_ADDR_VALID BIT(5) 54 #define ICE_AQC_MAN_MAC_PORT_ADDR_VALID BIT(6) 55 #define ICE_AQC_MAN_MAC_WOL_ADDR_VALID BIT(7) 56 #define ICE_AQC_MAN_MAC_READ_S 4 57 #define ICE_AQC_MAN_MAC_READ_M (0xF << ICE_AQC_MAN_MAC_READ_S) 58 u8 rsvd[2]; 59 u8 num_addr; /* Used in response */ 60 u8 rsvd1[3]; 61 __le32 addr_high; 62 __le32 addr_low; 63 }; 64 65 /* Response buffer format for manage MAC read command */ 66 struct ice_aqc_manage_mac_read_resp { 67 u8 lport_num; 68 u8 addr_type; 69 #define ICE_AQC_MAN_MAC_ADDR_TYPE_LAN 0 70 #define ICE_AQC_MAN_MAC_ADDR_TYPE_WOL 1 71 u8 mac_addr[ETH_ALEN]; 72 }; 73 74 /* Manage MAC address, write command - direct (0x0108) */ 75 struct ice_aqc_manage_mac_write { 76 u8 rsvd; 77 u8 flags; 78 #define ICE_AQC_MAN_MAC_WR_MC_MAG_EN BIT(0) 79 #define ICE_AQC_MAN_MAC_WR_WOL_LAA_PFR_KEEP BIT(1) 80 #define ICE_AQC_MAN_MAC_WR_S 6 81 #define ICE_AQC_MAN_MAC_WR_M ICE_M(3, ICE_AQC_MAN_MAC_WR_S) 82 #define ICE_AQC_MAN_MAC_UPDATE_LAA 0 83 #define ICE_AQC_MAN_MAC_UPDATE_LAA_WOL BIT(ICE_AQC_MAN_MAC_WR_S) 84 /* byte stream in network order */ 85 u8 mac_addr[ETH_ALEN]; 86 __le32 addr_high; 87 __le32 addr_low; 88 }; 89 90 /* Clear PXE Command and response (direct 0x0110) */ 91 struct ice_aqc_clear_pxe { 92 u8 rx_cnt; 93 #define ICE_AQC_CLEAR_PXE_RX_CNT 0x2 94 u8 reserved[15]; 95 }; 96 97 /* Get switch configuration (0x0200) */ 98 struct ice_aqc_get_sw_cfg { 99 /* Reserved for command and copy of request flags for response */ 100 __le16 flags; 101 /* First desc in case of command and next_elem in case of response 102 * In case of response, if it is not zero, means all the configuration 103 * was not returned and new command shall be sent with this value in 104 * the 'first desc' field 105 */ 106 __le16 element; 107 /* Reserved for command, only used for response */ 108 __le16 num_elems; 109 __le16 rsvd; 110 __le32 addr_high; 111 __le32 addr_low; 112 }; 113 114 /* Each entry in the response buffer is of the following type: */ 115 struct ice_aqc_get_sw_cfg_resp_elem { 116 /* VSI/Port Number */ 117 __le16 vsi_port_num; 118 #define ICE_AQC_GET_SW_CONF_RESP_VSI_PORT_NUM_S 0 119 #define ICE_AQC_GET_SW_CONF_RESP_VSI_PORT_NUM_M \ 120 (0x3FF << ICE_AQC_GET_SW_CONF_RESP_VSI_PORT_NUM_S) 121 #define ICE_AQC_GET_SW_CONF_RESP_TYPE_S 14 122 #define ICE_AQC_GET_SW_CONF_RESP_TYPE_M (0x3 << ICE_AQC_GET_SW_CONF_RESP_TYPE_S) 123 #define ICE_AQC_GET_SW_CONF_RESP_PHYS_PORT 0 124 #define ICE_AQC_GET_SW_CONF_RESP_VIRT_PORT 1 125 #define ICE_AQC_GET_SW_CONF_RESP_VSI 2 126 127 /* SWID VSI/Port belongs to */ 128 __le16 swid; 129 130 /* Bit 14..0 : PF/VF number VSI belongs to 131 * Bit 15 : VF indication bit 132 */ 133 __le16 pf_vf_num; 134 #define ICE_AQC_GET_SW_CONF_RESP_FUNC_NUM_S 0 135 #define ICE_AQC_GET_SW_CONF_RESP_FUNC_NUM_M \ 136 (0x7FFF << ICE_AQC_GET_SW_CONF_RESP_FUNC_NUM_S) 137 #define ICE_AQC_GET_SW_CONF_RESP_IS_VF BIT(15) 138 }; 139 140 /* Loopback port parameter mode values. */ 141 enum ice_local_fwd_mode { 142 ICE_LOCAL_FWD_MODE_ENABLED = 0, 143 ICE_LOCAL_FWD_MODE_DISABLED = 1, 144 ICE_LOCAL_FWD_MODE_PRIORITIZED = 2, 145 }; 146 147 /* Set Port parameters, (direct, 0x0203) */ 148 struct ice_aqc_set_port_params { 149 __le16 cmd_flags; 150 #define ICE_AQC_SET_P_PARAMS_DOUBLE_VLAN_ENA BIT(2) 151 __le16 bad_frame_vsi; 152 __le16 swid; 153 #define ICE_AQC_PORT_SWID_VALID BIT(15) 154 #define ICE_AQC_PORT_SWID_M 0xFF 155 u8 local_fwd_mode; 156 #define ICE_AQC_SET_P_PARAMS_LOCAL_FWD_MODE_VALID BIT(2) 157 u8 reserved[9]; 158 }; 159 160 /* These resource type defines are used for all switch resource 161 * commands where a resource type is required, such as: 162 * Get Resource Allocation command (indirect 0x0204) 163 * Allocate Resources command (indirect 0x0208) 164 * Free Resources command (indirect 0x0209) 165 * Get Allocated Resource Descriptors Command (indirect 0x020A) 166 * Share Resource command (indirect 0x020B) 167 */ 168 #define ICE_AQC_RES_TYPE_VSI_LIST_REP 0x03 169 #define ICE_AQC_RES_TYPE_VSI_LIST_PRUNE 0x04 170 #define ICE_AQC_RES_TYPE_RECIPE 0x05 171 #define ICE_AQC_RES_TYPE_SWID 0x07 172 #define ICE_AQC_RES_TYPE_FDIR_COUNTER_BLOCK 0x21 173 #define ICE_AQC_RES_TYPE_FDIR_GUARANTEED_ENTRIES 0x22 174 #define ICE_AQC_RES_TYPE_FDIR_SHARED_ENTRIES 0x23 175 #define ICE_AQC_RES_TYPE_FD_PROF_BLDR_PROFID 0x58 176 #define ICE_AQC_RES_TYPE_FD_PROF_BLDR_TCAM 0x59 177 #define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_PROFID 0x60 178 #define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_TCAM 0x61 179 180 #define ICE_AQC_RES_TYPE_FLAG_SHARED BIT(7) 181 #define ICE_AQC_RES_TYPE_FLAG_SCAN_BOTTOM BIT(12) 182 #define ICE_AQC_RES_TYPE_FLAG_IGNORE_INDEX BIT(13) 183 #define ICE_AQC_RES_TYPE_FLAG_SUBSCRIBE_SHARED BIT(14) 184 #define ICE_AQC_RES_TYPE_FLAG_SUBSCRIBE_CTL BIT(15) 185 186 #define ICE_AQC_RES_TYPE_FLAG_DEDICATED 0x00 187 188 #define ICE_AQC_RES_TYPE_S 0 189 #define ICE_AQC_RES_TYPE_M (0x07F << ICE_AQC_RES_TYPE_S) 190 191 /* Allocate Resources command (indirect 0x0208) 192 * Free Resources command (indirect 0x0209) 193 * Share Resource command (indirect 0x020B) 194 */ 195 struct ice_aqc_alloc_free_res_cmd { 196 __le16 num_entries; /* Number of Resource entries */ 197 u8 reserved[6]; 198 __le32 addr_high; 199 __le32 addr_low; 200 }; 201 202 /* Resource descriptor */ 203 struct ice_aqc_res_elem { 204 union { 205 __le16 sw_resp; 206 __le16 flu_resp; 207 } e; 208 }; 209 210 /* Buffer for Allocate/Free Resources commands */ 211 struct ice_aqc_alloc_free_res_elem { 212 __le16 res_type; /* Types defined above cmd 0x0204 */ 213 #define ICE_AQC_RES_TYPE_SHARED_S 7 214 #define ICE_AQC_RES_TYPE_SHARED_M (0x1 << ICE_AQC_RES_TYPE_SHARED_S) 215 #define ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_S 8 216 #define ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_M \ 217 (0xF << ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_S) 218 __le16 num_elems; 219 struct ice_aqc_res_elem elem[]; 220 }; 221 222 /* Request buffer for Set VLAN Mode AQ command (indirect 0x020C) */ 223 struct ice_aqc_set_vlan_mode { 224 u8 reserved; 225 u8 l2tag_prio_tagging; 226 #define ICE_AQ_VLAN_PRIO_TAG_S 0 227 #define ICE_AQ_VLAN_PRIO_TAG_M (0x7 << ICE_AQ_VLAN_PRIO_TAG_S) 228 #define ICE_AQ_VLAN_PRIO_TAG_NOT_SUPPORTED 0x0 229 #define ICE_AQ_VLAN_PRIO_TAG_STAG 0x1 230 #define ICE_AQ_VLAN_PRIO_TAG_OUTER_CTAG 0x2 231 #define ICE_AQ_VLAN_PRIO_TAG_OUTER_VLAN 0x3 232 #define ICE_AQ_VLAN_PRIO_TAG_INNER_CTAG 0x4 233 #define ICE_AQ_VLAN_PRIO_TAG_MAX 0x4 234 #define ICE_AQ_VLAN_PRIO_TAG_ERROR 0x7 235 u8 l2tag_reserved[64]; 236 u8 rdma_packet; 237 #define ICE_AQ_VLAN_RDMA_TAG_S 0 238 #define ICE_AQ_VLAN_RDMA_TAG_M (0x3F << ICE_AQ_VLAN_RDMA_TAG_S) 239 #define ICE_AQ_SVM_VLAN_RDMA_PKT_FLAG_SETTING 0x10 240 #define ICE_AQ_DVM_VLAN_RDMA_PKT_FLAG_SETTING 0x1A 241 u8 rdma_reserved[2]; 242 u8 mng_vlan_prot_id; 243 #define ICE_AQ_VLAN_MNG_PROTOCOL_ID_OUTER 0x10 244 #define ICE_AQ_VLAN_MNG_PROTOCOL_ID_INNER 0x11 245 u8 prot_id_reserved[30]; 246 }; 247 248 /* Response buffer for Get VLAN Mode AQ command (indirect 0x020D) */ 249 struct ice_aqc_get_vlan_mode { 250 u8 vlan_mode; 251 #define ICE_AQ_VLAN_MODE_DVM_ENA BIT(0) 252 u8 l2tag_prio_tagging; 253 u8 reserved[98]; 254 }; 255 256 /* Add VSI (indirect 0x0210) 257 * Update VSI (indirect 0x0211) 258 * Get VSI (indirect 0x0212) 259 * Free VSI (indirect 0x0213) 260 */ 261 struct ice_aqc_add_get_update_free_vsi { 262 __le16 vsi_num; 263 #define ICE_AQ_VSI_NUM_S 0 264 #define ICE_AQ_VSI_NUM_M (0x03FF << ICE_AQ_VSI_NUM_S) 265 #define ICE_AQ_VSI_IS_VALID BIT(15) 266 __le16 cmd_flags; 267 #define ICE_AQ_VSI_KEEP_ALLOC 0x1 268 u8 vf_id; 269 u8 reserved; 270 __le16 vsi_flags; 271 #define ICE_AQ_VSI_TYPE_S 0 272 #define ICE_AQ_VSI_TYPE_M (0x3 << ICE_AQ_VSI_TYPE_S) 273 #define ICE_AQ_VSI_TYPE_VF 0x0 274 #define ICE_AQ_VSI_TYPE_VMDQ2 0x1 275 #define ICE_AQ_VSI_TYPE_PF 0x2 276 #define ICE_AQ_VSI_TYPE_EMP_MNG 0x3 277 __le32 addr_high; 278 __le32 addr_low; 279 }; 280 281 /* Response descriptor for: 282 * Add VSI (indirect 0x0210) 283 * Update VSI (indirect 0x0211) 284 * Free VSI (indirect 0x0213) 285 */ 286 struct ice_aqc_add_update_free_vsi_resp { 287 __le16 vsi_num; 288 __le16 ext_status; 289 __le16 vsi_used; 290 __le16 vsi_free; 291 __le32 addr_high; 292 __le32 addr_low; 293 }; 294 295 struct ice_aqc_vsi_props { 296 __le16 valid_sections; 297 #define ICE_AQ_VSI_PROP_SW_VALID BIT(0) 298 #define ICE_AQ_VSI_PROP_SECURITY_VALID BIT(1) 299 #define ICE_AQ_VSI_PROP_VLAN_VALID BIT(2) 300 #define ICE_AQ_VSI_PROP_OUTER_TAG_VALID BIT(3) 301 #define ICE_AQ_VSI_PROP_INGRESS_UP_VALID BIT(4) 302 #define ICE_AQ_VSI_PROP_EGRESS_UP_VALID BIT(5) 303 #define ICE_AQ_VSI_PROP_RXQ_MAP_VALID BIT(6) 304 #define ICE_AQ_VSI_PROP_Q_OPT_VALID BIT(7) 305 #define ICE_AQ_VSI_PROP_OUTER_UP_VALID BIT(8) 306 #define ICE_AQ_VSI_PROP_FLOW_DIR_VALID BIT(11) 307 #define ICE_AQ_VSI_PROP_PASID_VALID BIT(12) 308 /* switch section */ 309 u8 sw_id; 310 u8 sw_flags; 311 #define ICE_AQ_VSI_SW_FLAG_ALLOW_LB BIT(5) 312 #define ICE_AQ_VSI_SW_FLAG_LOCAL_LB BIT(6) 313 #define ICE_AQ_VSI_SW_FLAG_SRC_PRUNE BIT(7) 314 u8 sw_flags2; 315 #define ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_S 0 316 #define ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_M (0xF << ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_S) 317 #define ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA BIT(0) 318 #define ICE_AQ_VSI_SW_FLAG_LAN_ENA BIT(4) 319 u8 veb_stat_id; 320 #define ICE_AQ_VSI_SW_VEB_STAT_ID_S 0 321 #define ICE_AQ_VSI_SW_VEB_STAT_ID_M (0x1F << ICE_AQ_VSI_SW_VEB_STAT_ID_S) 322 #define ICE_AQ_VSI_SW_VEB_STAT_ID_VALID BIT(5) 323 /* security section */ 324 u8 sec_flags; 325 #define ICE_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD BIT(0) 326 #define ICE_AQ_VSI_SEC_FLAG_ENA_MAC_ANTI_SPOOF BIT(2) 327 #define ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S 4 328 #define ICE_AQ_VSI_SEC_TX_PRUNE_ENA_M (0xF << ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S) 329 #define ICE_AQ_VSI_SEC_TX_VLAN_PRUNE_ENA BIT(0) 330 u8 sec_reserved; 331 /* VLAN section */ 332 __le16 port_based_inner_vlan; /* VLANS include priority bits */ 333 u8 inner_vlan_reserved[2]; 334 u8 inner_vlan_flags; 335 #define ICE_AQ_VSI_INNER_VLAN_TX_MODE_S 0 336 #define ICE_AQ_VSI_INNER_VLAN_TX_MODE_M (0x3 << ICE_AQ_VSI_INNER_VLAN_TX_MODE_S) 337 #define ICE_AQ_VSI_INNER_VLAN_TX_MODE_ACCEPTUNTAGGED 0x1 338 #define ICE_AQ_VSI_INNER_VLAN_TX_MODE_ACCEPTTAGGED 0x2 339 #define ICE_AQ_VSI_INNER_VLAN_TX_MODE_ALL 0x3 340 #define ICE_AQ_VSI_INNER_VLAN_INSERT_PVID BIT(2) 341 #define ICE_AQ_VSI_INNER_VLAN_EMODE_S 3 342 #define ICE_AQ_VSI_INNER_VLAN_EMODE_M (0x3 << ICE_AQ_VSI_INNER_VLAN_EMODE_S) 343 #define ICE_AQ_VSI_INNER_VLAN_EMODE_STR_BOTH 0x0U 344 #define ICE_AQ_VSI_INNER_VLAN_EMODE_STR_UP 0x1U 345 #define ICE_AQ_VSI_INNER_VLAN_EMODE_STR 0x2U 346 #define ICE_AQ_VSI_INNER_VLAN_EMODE_NOTHING 0x3U 347 u8 inner_vlan_reserved2[3]; 348 /* ingress egress up sections */ 349 __le32 ingress_table; /* bitmap, 3 bits per up */ 350 #define ICE_AQ_VSI_UP_TABLE_UP0_S 0 351 #define ICE_AQ_VSI_UP_TABLE_UP0_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP0_S) 352 #define ICE_AQ_VSI_UP_TABLE_UP1_S 3 353 #define ICE_AQ_VSI_UP_TABLE_UP1_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP1_S) 354 #define ICE_AQ_VSI_UP_TABLE_UP2_S 6 355 #define ICE_AQ_VSI_UP_TABLE_UP2_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP2_S) 356 #define ICE_AQ_VSI_UP_TABLE_UP3_S 9 357 #define ICE_AQ_VSI_UP_TABLE_UP3_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP3_S) 358 #define ICE_AQ_VSI_UP_TABLE_UP4_S 12 359 #define ICE_AQ_VSI_UP_TABLE_UP4_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP4_S) 360 #define ICE_AQ_VSI_UP_TABLE_UP5_S 15 361 #define ICE_AQ_VSI_UP_TABLE_UP5_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP5_S) 362 #define ICE_AQ_VSI_UP_TABLE_UP6_S 18 363 #define ICE_AQ_VSI_UP_TABLE_UP6_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP6_S) 364 #define ICE_AQ_VSI_UP_TABLE_UP7_S 21 365 #define ICE_AQ_VSI_UP_TABLE_UP7_M (0x7 << ICE_AQ_VSI_UP_TABLE_UP7_S) 366 __le32 egress_table; /* same defines as for ingress table */ 367 /* outer tags section */ 368 __le16 port_based_outer_vlan; 369 u8 outer_vlan_flags; 370 #define ICE_AQ_VSI_OUTER_VLAN_EMODE_S 0 371 #define ICE_AQ_VSI_OUTER_VLAN_EMODE_M (0x3 << ICE_AQ_VSI_OUTER_VLAN_EMODE_S) 372 #define ICE_AQ_VSI_OUTER_VLAN_EMODE_SHOW_BOTH 0x0 373 #define ICE_AQ_VSI_OUTER_VLAN_EMODE_SHOW_UP 0x1 374 #define ICE_AQ_VSI_OUTER_VLAN_EMODE_SHOW 0x2 375 #define ICE_AQ_VSI_OUTER_VLAN_EMODE_NOTHING 0x3 376 #define ICE_AQ_VSI_OUTER_TAG_TYPE_S 2 377 #define ICE_AQ_VSI_OUTER_TAG_TYPE_M (0x3 << ICE_AQ_VSI_OUTER_TAG_TYPE_S) 378 #define ICE_AQ_VSI_OUTER_TAG_NONE 0x0 379 #define ICE_AQ_VSI_OUTER_TAG_STAG 0x1 380 #define ICE_AQ_VSI_OUTER_TAG_VLAN_8100 0x2 381 #define ICE_AQ_VSI_OUTER_TAG_VLAN_9100 0x3 382 #define ICE_AQ_VSI_OUTER_VLAN_PORT_BASED_INSERT BIT(4) 383 #define ICE_AQ_VSI_OUTER_VLAN_TX_MODE_S 5 384 #define ICE_AQ_VSI_OUTER_VLAN_TX_MODE_M (0x3 << ICE_AQ_VSI_OUTER_VLAN_TX_MODE_S) 385 #define ICE_AQ_VSI_OUTER_VLAN_TX_MODE_ACCEPTUNTAGGED 0x1 386 #define ICE_AQ_VSI_OUTER_VLAN_TX_MODE_ACCEPTTAGGED 0x2 387 #define ICE_AQ_VSI_OUTER_VLAN_TX_MODE_ALL 0x3 388 #define ICE_AQ_VSI_OUTER_VLAN_BLOCK_TX_DESC BIT(7) 389 u8 outer_vlan_reserved; 390 /* queue mapping section */ 391 __le16 mapping_flags; 392 #define ICE_AQ_VSI_Q_MAP_CONTIG 0x0 393 #define ICE_AQ_VSI_Q_MAP_NONCONTIG BIT(0) 394 __le16 q_mapping[16]; 395 #define ICE_AQ_VSI_Q_S 0 396 #define ICE_AQ_VSI_Q_M (0x7FF << ICE_AQ_VSI_Q_S) 397 __le16 tc_mapping[8]; 398 #define ICE_AQ_VSI_TC_Q_OFFSET_S 0 399 #define ICE_AQ_VSI_TC_Q_OFFSET_M (0x7FF << ICE_AQ_VSI_TC_Q_OFFSET_S) 400 #define ICE_AQ_VSI_TC_Q_NUM_S 11 401 #define ICE_AQ_VSI_TC_Q_NUM_M (0xF << ICE_AQ_VSI_TC_Q_NUM_S) 402 /* queueing option section */ 403 u8 q_opt_rss; 404 #define ICE_AQ_VSI_Q_OPT_RSS_LUT_S 0 405 #define ICE_AQ_VSI_Q_OPT_RSS_LUT_M (0x3 << ICE_AQ_VSI_Q_OPT_RSS_LUT_S) 406 #define ICE_AQ_VSI_Q_OPT_RSS_LUT_VSI 0x0 407 #define ICE_AQ_VSI_Q_OPT_RSS_LUT_PF 0x2 408 #define ICE_AQ_VSI_Q_OPT_RSS_LUT_GBL 0x3 409 #define ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_S 2 410 #define ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_M (0xF << ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_S) 411 #define ICE_AQ_VSI_Q_OPT_RSS_HASH_S 6 412 #define ICE_AQ_VSI_Q_OPT_RSS_HASH_M GENMASK(7, 6) 413 #define ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ 0x0U 414 #define ICE_AQ_VSI_Q_OPT_RSS_HASH_SYM_TPLZ 0x1U 415 #define ICE_AQ_VSI_Q_OPT_RSS_HASH_XOR 0x2U 416 #define ICE_AQ_VSI_Q_OPT_RSS_HASH_JHASH 0x3U 417 u8 q_opt_tc; 418 #define ICE_AQ_VSI_Q_OPT_TC_OVR_S 0 419 #define ICE_AQ_VSI_Q_OPT_TC_OVR_M (0x1F << ICE_AQ_VSI_Q_OPT_TC_OVR_S) 420 #define ICE_AQ_VSI_Q_OPT_PROF_TC_OVR BIT(7) 421 u8 q_opt_flags; 422 #define ICE_AQ_VSI_Q_OPT_PE_FLTR_EN BIT(0) 423 u8 q_opt_reserved[3]; 424 /* outer up section */ 425 __le32 outer_up_table; /* same structure and defines as ingress tbl */ 426 /* section 10 */ 427 __le16 sect_10_reserved; 428 /* flow director section */ 429 __le16 fd_options; 430 #define ICE_AQ_VSI_FD_ENABLE BIT(0) 431 #define ICE_AQ_VSI_FD_TX_AUTO_ENABLE BIT(1) 432 #define ICE_AQ_VSI_FD_PROG_ENABLE BIT(3) 433 __le16 max_fd_fltr_dedicated; 434 __le16 max_fd_fltr_shared; 435 __le16 fd_def_q; 436 #define ICE_AQ_VSI_FD_DEF_Q_S 0 437 #define ICE_AQ_VSI_FD_DEF_Q_M (0x7FF << ICE_AQ_VSI_FD_DEF_Q_S) 438 #define ICE_AQ_VSI_FD_DEF_GRP_S 12 439 #define ICE_AQ_VSI_FD_DEF_GRP_M (0x7 << ICE_AQ_VSI_FD_DEF_GRP_S) 440 __le16 fd_report_opt; 441 #define ICE_AQ_VSI_FD_REPORT_Q_S 0 442 #define ICE_AQ_VSI_FD_REPORT_Q_M (0x7FF << ICE_AQ_VSI_FD_REPORT_Q_S) 443 #define ICE_AQ_VSI_FD_DEF_PRIORITY_S 12 444 #define ICE_AQ_VSI_FD_DEF_PRIORITY_M (0x7 << ICE_AQ_VSI_FD_DEF_PRIORITY_S) 445 #define ICE_AQ_VSI_FD_DEF_DROP BIT(15) 446 /* PASID section */ 447 __le32 pasid_id; 448 #define ICE_AQ_VSI_PASID_ID_S 0 449 #define ICE_AQ_VSI_PASID_ID_M (0xFFFFF << ICE_AQ_VSI_PASID_ID_S) 450 #define ICE_AQ_VSI_PASID_ID_VALID BIT(31) 451 u8 reserved[24]; 452 }; 453 454 #define ICE_MAX_NUM_RECIPES 64 455 456 /* Add/Get Recipe (indirect 0x0290/0x0292) */ 457 struct ice_aqc_add_get_recipe { 458 __le16 num_sub_recipes; /* Input in Add cmd, Output in Get cmd */ 459 __le16 return_index; /* Input, used for Get cmd only */ 460 u8 reserved[4]; 461 __le32 addr_high; 462 __le32 addr_low; 463 }; 464 465 struct ice_aqc_recipe_content { 466 u8 rid; 467 #define ICE_AQ_RECIPE_ID_S 0 468 #define ICE_AQ_RECIPE_ID_M (0x3F << ICE_AQ_RECIPE_ID_S) 469 #define ICE_AQ_RECIPE_ID_IS_ROOT BIT(7) 470 #define ICE_AQ_SW_ID_LKUP_IDX 0 471 u8 lkup_indx[5]; 472 #define ICE_AQ_RECIPE_LKUP_DATA_S 0 473 #define ICE_AQ_RECIPE_LKUP_DATA_M (0x3F << ICE_AQ_RECIPE_LKUP_DATA_S) 474 #define ICE_AQ_RECIPE_LKUP_IGNORE BIT(7) 475 #define ICE_AQ_SW_ID_LKUP_MASK 0x00FF 476 __le16 mask[5]; 477 u8 result_indx; 478 #define ICE_AQ_RECIPE_RESULT_DATA_S 0 479 #define ICE_AQ_RECIPE_RESULT_DATA_M (0x3F << ICE_AQ_RECIPE_RESULT_DATA_S) 480 #define ICE_AQ_RECIPE_RESULT_EN BIT(7) 481 u8 rsvd0[3]; 482 u8 act_ctrl_join_priority; 483 u8 act_ctrl_fwd_priority; 484 #define ICE_AQ_RECIPE_FWD_PRIORITY_S 0 485 #define ICE_AQ_RECIPE_FWD_PRIORITY_M (0xF << ICE_AQ_RECIPE_FWD_PRIORITY_S) 486 u8 act_ctrl; 487 #define ICE_AQ_RECIPE_ACT_NEED_PASS_L2 BIT(0) 488 #define ICE_AQ_RECIPE_ACT_ALLOW_PASS_L2 BIT(1) 489 #define ICE_AQ_RECIPE_ACT_INV_ACT BIT(2) 490 #define ICE_AQ_RECIPE_ACT_PRUNE_INDX_S 4 491 #define ICE_AQ_RECIPE_ACT_PRUNE_INDX_M (0x3 << ICE_AQ_RECIPE_ACT_PRUNE_INDX_S) 492 u8 rsvd1; 493 __le32 dflt_act; 494 #define ICE_AQ_RECIPE_DFLT_ACT_S 0 495 #define ICE_AQ_RECIPE_DFLT_ACT_M (0x7FFFF << ICE_AQ_RECIPE_DFLT_ACT_S) 496 #define ICE_AQ_RECIPE_DFLT_ACT_VALID BIT(31) 497 }; 498 499 struct ice_aqc_recipe_data_elem { 500 u8 recipe_indx; 501 u8 resp_bits; 502 #define ICE_AQ_RECIPE_WAS_UPDATED BIT(0) 503 u8 rsvd0[2]; 504 u8 recipe_bitmap[8]; 505 u8 rsvd1[4]; 506 struct ice_aqc_recipe_content content; 507 u8 rsvd2[20]; 508 }; 509 510 /* Set/Get Recipes to Profile Association (direct 0x0291/0x0293) */ 511 struct ice_aqc_recipe_to_profile { 512 __le16 profile_id; 513 u8 rsvd[6]; 514 __le64 recipe_assoc; 515 }; 516 static_assert(sizeof(struct ice_aqc_recipe_to_profile) == 16); 517 518 /* Add/Update/Remove/Get switch rules (indirect 0x02A0, 0x02A1, 0x02A2, 0x02A3) 519 */ 520 struct ice_aqc_sw_rules { 521 /* ops: add switch rules, referring the number of rules. 522 * ops: update switch rules, referring the number of filters 523 * ops: remove switch rules, referring the entry index. 524 * ops: get switch rules, referring to the number of filters. 525 */ 526 __le16 num_rules_fltr_entry_index; 527 u8 reserved[6]; 528 __le32 addr_high; 529 __le32 addr_low; 530 }; 531 532 /* Add switch rule response: 533 * Content of return buffer is same as the input buffer. The status field and 534 * LUT index are updated as part of the response 535 */ 536 struct ice_aqc_sw_rules_elem_hdr { 537 __le16 type; /* Switch rule type, one of T_... */ 538 #define ICE_AQC_SW_RULES_T_LKUP_RX 0x0 539 #define ICE_AQC_SW_RULES_T_LKUP_TX 0x1 540 #define ICE_AQC_SW_RULES_T_LG_ACT 0x2 541 #define ICE_AQC_SW_RULES_T_VSI_LIST_SET 0x3 542 #define ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR 0x4 543 #define ICE_AQC_SW_RULES_T_PRUNE_LIST_SET 0x5 544 #define ICE_AQC_SW_RULES_T_PRUNE_LIST_CLEAR 0x6 545 __le16 status; 546 } __packed __aligned(sizeof(__le16)); 547 548 /* Add/Update/Get/Remove lookup Rx/Tx command/response entry 549 * This structures describes the lookup rules and associated actions. "index" 550 * is returned as part of a response to a successful Add command, and can be 551 * used to identify the rule for Update/Get/Remove commands. 552 */ 553 struct ice_sw_rule_lkup_rx_tx { 554 struct ice_aqc_sw_rules_elem_hdr hdr; 555 556 __le16 recipe_id; 557 #define ICE_SW_RECIPE_LOGICAL_PORT_FWD 10 558 /* Source port for LOOKUP_RX and source VSI in case of LOOKUP_TX */ 559 __le16 src; 560 __le32 act; 561 562 /* Bit 0:1 - Action type */ 563 #define ICE_SINGLE_ACT_TYPE_S 0x00 564 #define ICE_SINGLE_ACT_TYPE_M (0x3 << ICE_SINGLE_ACT_TYPE_S) 565 566 /* Bit 2 - Loop back enable 567 * Bit 3 - LAN enable 568 */ 569 #define ICE_SINGLE_ACT_LB_ENABLE BIT(2) 570 #define ICE_SINGLE_ACT_LAN_ENABLE BIT(3) 571 572 /* Action type = 0 - Forward to VSI or VSI list */ 573 #define ICE_SINGLE_ACT_VSI_FORWARDING 0x0 574 575 #define ICE_SINGLE_ACT_VSI_ID_S 4 576 #define ICE_SINGLE_ACT_VSI_ID_M (0x3FF << ICE_SINGLE_ACT_VSI_ID_S) 577 #define ICE_SINGLE_ACT_VSI_LIST_ID_S 4 578 #define ICE_SINGLE_ACT_VSI_LIST_ID_M (0x3FF << ICE_SINGLE_ACT_VSI_LIST_ID_S) 579 /* This bit needs to be set if action is forward to VSI list */ 580 #define ICE_SINGLE_ACT_VSI_LIST BIT(14) 581 #define ICE_SINGLE_ACT_VALID_BIT BIT(17) 582 #define ICE_SINGLE_ACT_DROP BIT(18) 583 584 /* Action type = 1 - Forward to Queue of Queue group */ 585 #define ICE_SINGLE_ACT_TO_Q 0x1 586 #define ICE_SINGLE_ACT_Q_INDEX_S 4 587 #define ICE_SINGLE_ACT_Q_INDEX_M (0x7FF << ICE_SINGLE_ACT_Q_INDEX_S) 588 #define ICE_SINGLE_ACT_Q_REGION_S 15 589 #define ICE_SINGLE_ACT_Q_REGION_M (0x7 << ICE_SINGLE_ACT_Q_REGION_S) 590 #define ICE_SINGLE_ACT_Q_PRIORITY BIT(18) 591 592 /* Action type = 2 - Prune */ 593 #define ICE_SINGLE_ACT_PRUNE 0x2 594 #define ICE_SINGLE_ACT_EGRESS BIT(15) 595 #define ICE_SINGLE_ACT_INGRESS BIT(16) 596 #define ICE_SINGLE_ACT_PRUNET BIT(17) 597 /* Bit 18 should be set to 0 for this action */ 598 599 /* Action type = 2 - Pointer */ 600 #define ICE_SINGLE_ACT_PTR 0x2 601 #define ICE_SINGLE_ACT_PTR_VAL_S 4 602 #define ICE_SINGLE_ACT_PTR_VAL_M (0x1FFF << ICE_SINGLE_ACT_PTR_VAL_S) 603 /* Bit 18 should be set to 1 */ 604 #define ICE_SINGLE_ACT_PTR_BIT BIT(18) 605 606 /* Action type = 3 - Other actions. Last two bits 607 * are other action identifier 608 */ 609 #define ICE_SINGLE_ACT_OTHER_ACTS 0x3 610 #define ICE_SINGLE_OTHER_ACT_IDENTIFIER_S 17 611 #define ICE_SINGLE_OTHER_ACT_IDENTIFIER_M \ 612 (0x3 << ICE_SINGLE_OTHER_ACT_IDENTIFIER_S) 613 614 /* Bit 17:18 - Defines other actions */ 615 /* Other action = 0 - Mirror VSI */ 616 #define ICE_SINGLE_OTHER_ACT_MIRROR 0 617 #define ICE_SINGLE_ACT_MIRROR_VSI_ID_S 4 618 #define ICE_SINGLE_ACT_MIRROR_VSI_ID_M \ 619 (0x3FF << ICE_SINGLE_ACT_MIRROR_VSI_ID_S) 620 621 /* Other action = 3 - Set Stat count */ 622 #define ICE_SINGLE_OTHER_ACT_STAT_COUNT 3 623 #define ICE_SINGLE_ACT_STAT_COUNT_INDEX_S 4 624 #define ICE_SINGLE_ACT_STAT_COUNT_INDEX_M \ 625 (0x7F << ICE_SINGLE_ACT_STAT_COUNT_INDEX_S) 626 627 __le16 index; /* The index of the rule in the lookup table */ 628 /* Length and values of the header to be matched per recipe or 629 * lookup-type 630 */ 631 __le16 hdr_len; 632 u8 hdr_data[]; 633 } __packed __aligned(sizeof(__le16)); 634 635 /* Add/Update/Remove large action command/response entry 636 * "index" is returned as part of a response to a successful Add command, and 637 * can be used to identify the action for Update/Get/Remove commands. 638 */ 639 struct ice_sw_rule_lg_act { 640 struct ice_aqc_sw_rules_elem_hdr hdr; 641 642 __le16 index; /* Index in large action table */ 643 __le16 size; 644 /* Max number of large actions */ 645 #define ICE_MAX_LG_ACT 4 646 /* Bit 0:1 - Action type */ 647 #define ICE_LG_ACT_TYPE_S 0 648 #define ICE_LG_ACT_TYPE_M (0x7 << ICE_LG_ACT_TYPE_S) 649 650 /* Action type = 0 - Forward to VSI or VSI list */ 651 #define ICE_LG_ACT_VSI_FORWARDING 0 652 #define ICE_LG_ACT_VSI_ID_S 3 653 #define ICE_LG_ACT_VSI_ID_M (0x3FF << ICE_LG_ACT_VSI_ID_S) 654 #define ICE_LG_ACT_VSI_LIST_ID_S 3 655 #define ICE_LG_ACT_VSI_LIST_ID_M (0x3FF << ICE_LG_ACT_VSI_LIST_ID_S) 656 /* This bit needs to be set if action is forward to VSI list */ 657 #define ICE_LG_ACT_VSI_LIST BIT(13) 658 659 #define ICE_LG_ACT_VALID_BIT BIT(16) 660 661 /* Action type = 1 - Forward to Queue of Queue group */ 662 #define ICE_LG_ACT_TO_Q 0x1 663 #define ICE_LG_ACT_Q_INDEX_S 3 664 #define ICE_LG_ACT_Q_INDEX_M (0x7FF << ICE_LG_ACT_Q_INDEX_S) 665 #define ICE_LG_ACT_Q_REGION_S 14 666 #define ICE_LG_ACT_Q_REGION_M (0x7 << ICE_LG_ACT_Q_REGION_S) 667 #define ICE_LG_ACT_Q_PRIORITY_SET BIT(17) 668 669 /* Action type = 2 - Prune */ 670 #define ICE_LG_ACT_PRUNE 0x2 671 #define ICE_LG_ACT_EGRESS BIT(14) 672 #define ICE_LG_ACT_INGRESS BIT(15) 673 #define ICE_LG_ACT_PRUNET BIT(16) 674 675 /* Action type = 3 - Mirror VSI */ 676 #define ICE_LG_OTHER_ACT_MIRROR 0x3 677 #define ICE_LG_ACT_MIRROR_VSI_ID_S 3 678 #define ICE_LG_ACT_MIRROR_VSI_ID_M (0x3FF << ICE_LG_ACT_MIRROR_VSI_ID_S) 679 680 /* Action type = 5 - Generic Value */ 681 #define ICE_LG_ACT_GENERIC 0x5 682 #define ICE_LG_ACT_GENERIC_VALUE_S 3 683 #define ICE_LG_ACT_GENERIC_VALUE_M (0xFFFF << ICE_LG_ACT_GENERIC_VALUE_S) 684 #define ICE_LG_ACT_GENERIC_OFFSET_S 19 685 #define ICE_LG_ACT_GENERIC_OFFSET_M (0x7 << ICE_LG_ACT_GENERIC_OFFSET_S) 686 #define ICE_LG_ACT_GENERIC_PRIORITY_S 22 687 #define ICE_LG_ACT_GENERIC_PRIORITY_M (0x7 << ICE_LG_ACT_GENERIC_PRIORITY_S) 688 #define ICE_LG_ACT_GENERIC_OFF_RX_DESC_PROF_IDX 7 689 690 /* Action = 7 - Set Stat count */ 691 #define ICE_LG_ACT_STAT_COUNT 0x7 692 #define ICE_LG_ACT_STAT_COUNT_S 3 693 #define ICE_LG_ACT_STAT_COUNT_M (0x7F << ICE_LG_ACT_STAT_COUNT_S) 694 __le32 act[]; /* array of size for actions */ 695 } __packed __aligned(sizeof(__le16)); 696 697 /* Add/Update/Remove VSI list command/response entry 698 * "index" is returned as part of a response to a successful Add command, and 699 * can be used to identify the VSI list for Update/Get/Remove commands. 700 */ 701 struct ice_sw_rule_vsi_list { 702 struct ice_aqc_sw_rules_elem_hdr hdr; 703 704 __le16 index; /* Index of VSI/Prune list */ 705 __le16 number_vsi; 706 __le16 vsi[]; /* Array of number_vsi VSI numbers */ 707 } __packed __aligned(sizeof(__le16)); 708 709 /* Query PFC Mode (direct 0x0302) 710 * Set PFC Mode (direct 0x0303) 711 */ 712 struct ice_aqc_set_query_pfc_mode { 713 u8 pfc_mode; 714 /* For Query Command response, reserved in all other cases */ 715 #define ICE_AQC_PFC_VLAN_BASED_PFC 1 716 #define ICE_AQC_PFC_DSCP_BASED_PFC 2 717 u8 rsvd[15]; 718 }; 719 /* Get Default Topology (indirect 0x0400) */ 720 struct ice_aqc_get_topo { 721 u8 port_num; 722 u8 num_branches; 723 __le16 reserved1; 724 __le32 reserved2; 725 __le32 addr_high; 726 __le32 addr_low; 727 }; 728 729 /* Get/Set Tx Topology (indirect 0x0418/0x0417) */ 730 struct ice_aqc_get_set_tx_topo { 731 u8 set_flags; 732 #define ICE_AQC_TX_TOPO_FLAGS_CORRER BIT(0) 733 #define ICE_AQC_TX_TOPO_FLAGS_SRC_RAM BIT(1) 734 #define ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW BIT(4) 735 #define ICE_AQC_TX_TOPO_FLAGS_ISSUED BIT(5) 736 737 u8 get_flags; 738 #define ICE_AQC_TX_TOPO_GET_RAM 2 739 740 __le16 reserved1; 741 __le32 reserved2; 742 __le32 addr_high; 743 __le32 addr_low; 744 }; 745 746 /* Update TSE (indirect 0x0403) 747 * Get TSE (indirect 0x0404) 748 * Add TSE (indirect 0x0401) 749 * Delete TSE (indirect 0x040F) 750 * Move TSE (indirect 0x0408) 751 * Suspend Nodes (indirect 0x0409) 752 * Resume Nodes (indirect 0x040A) 753 */ 754 struct ice_aqc_sched_elem_cmd { 755 __le16 num_elem_req; /* Used by commands */ 756 __le16 num_elem_resp; /* Used by responses */ 757 __le32 reserved; 758 __le32 addr_high; 759 __le32 addr_low; 760 }; 761 762 struct ice_aqc_txsched_move_grp_info_hdr { 763 __le32 src_parent_teid; 764 __le32 dest_parent_teid; 765 __le16 num_elems; 766 u8 mode; 767 #define ICE_AQC_MOVE_ELEM_MODE_SAME_PF 0x0 768 #define ICE_AQC_MOVE_ELEM_MODE_GIVE_OWN 0x1 769 #define ICE_AQC_MOVE_ELEM_MODE_KEEP_OWN 0x2 770 u8 reserved; 771 }; 772 773 struct ice_aqc_move_elem { 774 struct ice_aqc_txsched_move_grp_info_hdr hdr; 775 __le32 teid[]; 776 }; 777 778 struct ice_aqc_elem_info_bw { 779 __le16 bw_profile_idx; 780 __le16 bw_alloc; 781 }; 782 783 struct ice_aqc_txsched_elem { 784 u8 elem_type; /* Special field, reserved for some aq calls */ 785 #define ICE_AQC_ELEM_TYPE_UNDEFINED 0x0 786 #define ICE_AQC_ELEM_TYPE_ROOT_PORT 0x1 787 #define ICE_AQC_ELEM_TYPE_TC 0x2 788 #define ICE_AQC_ELEM_TYPE_SE_GENERIC 0x3 789 #define ICE_AQC_ELEM_TYPE_ENTRY_POINT 0x4 790 #define ICE_AQC_ELEM_TYPE_LEAF 0x5 791 #define ICE_AQC_ELEM_TYPE_SE_PADDED 0x6 792 u8 valid_sections; 793 #define ICE_AQC_ELEM_VALID_GENERIC BIT(0) 794 #define ICE_AQC_ELEM_VALID_CIR BIT(1) 795 #define ICE_AQC_ELEM_VALID_EIR BIT(2) 796 #define ICE_AQC_ELEM_VALID_SHARED BIT(3) 797 u8 generic; 798 #define ICE_AQC_ELEM_GENERIC_MODE_M 0x1 799 #define ICE_AQC_ELEM_GENERIC_PRIO_S 0x1 800 #define ICE_AQC_ELEM_GENERIC_PRIO_M GENMASK(3, 1) 801 #define ICE_AQC_ELEM_GENERIC_SP_S 0x4 802 #define ICE_AQC_ELEM_GENERIC_SP_M GENMASK(4, 4) 803 #define ICE_AQC_ELEM_GENERIC_ADJUST_VAL_S 0x5 804 #define ICE_AQC_ELEM_GENERIC_ADJUST_VAL_M \ 805 (0x3 << ICE_AQC_ELEM_GENERIC_ADJUST_VAL_S) 806 u8 flags; /* Special field, reserved for some aq calls */ 807 #define ICE_AQC_ELEM_FLAG_SUSPEND_M 0x1 808 struct ice_aqc_elem_info_bw cir_bw; 809 struct ice_aqc_elem_info_bw eir_bw; 810 __le16 srl_id; 811 __le16 reserved2; 812 }; 813 814 struct ice_aqc_txsched_elem_data { 815 __le32 parent_teid; 816 __le32 node_teid; 817 struct ice_aqc_txsched_elem data; 818 }; 819 820 struct ice_aqc_txsched_topo_grp_info_hdr { 821 __le32 parent_teid; 822 __le16 num_elems; 823 __le16 reserved2; 824 }; 825 826 struct ice_aqc_add_elem { 827 struct ice_aqc_txsched_topo_grp_info_hdr hdr; 828 struct ice_aqc_txsched_elem_data generic[]; 829 }; 830 831 struct ice_aqc_get_topo_elem { 832 struct ice_aqc_txsched_topo_grp_info_hdr hdr; 833 struct ice_aqc_txsched_elem_data 834 generic[ICE_AQC_TOPO_MAX_LEVEL_NUM]; 835 }; 836 837 struct ice_aqc_delete_elem { 838 struct ice_aqc_txsched_topo_grp_info_hdr hdr; 839 __le32 teid[]; 840 }; 841 842 /* Query Port ETS (indirect 0x040E) 843 * 844 * This indirect command is used to query port TC node configuration. 845 */ 846 struct ice_aqc_query_port_ets { 847 __le32 port_teid; 848 __le32 reserved; 849 __le32 addr_high; 850 __le32 addr_low; 851 }; 852 853 struct ice_aqc_port_ets_elem { 854 u8 tc_valid_bits; 855 u8 reserved[3]; 856 /* 3 bits for UP per TC 0-7, 4th byte reserved */ 857 __le32 up2tc; 858 u8 tc_bw_share[8]; 859 __le32 port_eir_prof_id; 860 __le32 port_cir_prof_id; 861 /* 3 bits per Node priority to TC 0-7, 4th byte reserved */ 862 __le32 tc_node_prio; 863 #define ICE_TC_NODE_PRIO_S 0x4 864 u8 reserved1[4]; 865 __le32 tc_node_teid[8]; /* Used for response, reserved in command */ 866 }; 867 868 /* Rate limiting profile for 869 * Add RL profile (indirect 0x0410) 870 * Query RL profile (indirect 0x0411) 871 * Remove RL profile (indirect 0x0415) 872 * These indirect commands acts on single or multiple 873 * RL profiles with specified data. 874 */ 875 struct ice_aqc_rl_profile { 876 __le16 num_profiles; 877 __le16 num_processed; /* Only for response. Reserved in Command. */ 878 u8 reserved[4]; 879 __le32 addr_high; 880 __le32 addr_low; 881 }; 882 883 struct ice_aqc_rl_profile_elem { 884 u8 level; 885 u8 flags; 886 #define ICE_AQC_RL_PROFILE_TYPE_S 0x0 887 #define ICE_AQC_RL_PROFILE_TYPE_M (0x3 << ICE_AQC_RL_PROFILE_TYPE_S) 888 #define ICE_AQC_RL_PROFILE_TYPE_CIR 0 889 #define ICE_AQC_RL_PROFILE_TYPE_EIR 1 890 #define ICE_AQC_RL_PROFILE_TYPE_SRL 2 891 /* The following flag is used for Query RL Profile Data */ 892 #define ICE_AQC_RL_PROFILE_INVAL_S 0x7 893 #define ICE_AQC_RL_PROFILE_INVAL_M (0x1 << ICE_AQC_RL_PROFILE_INVAL_S) 894 895 __le16 profile_id; 896 __le16 max_burst_size; 897 __le16 rl_multiply; 898 __le16 wake_up_calc; 899 __le16 rl_encode; 900 }; 901 902 /* Query Scheduler Resource Allocation (indirect 0x0412) 903 * This indirect command retrieves the scheduler resources allocated by 904 * EMP Firmware to the given PF. 905 */ 906 struct ice_aqc_query_txsched_res { 907 u8 reserved[8]; 908 __le32 addr_high; 909 __le32 addr_low; 910 }; 911 912 struct ice_aqc_generic_sched_props { 913 __le16 phys_levels; 914 __le16 logical_levels; 915 u8 flattening_bitmap; 916 u8 max_device_cgds; 917 u8 max_pf_cgds; 918 u8 rsvd0; 919 __le16 rdma_qsets; 920 u8 rsvd1[22]; 921 }; 922 923 struct ice_aqc_layer_props { 924 u8 logical_layer; 925 u8 chunk_size; 926 __le16 max_device_nodes; 927 __le16 max_pf_nodes; 928 u8 rsvd0[4]; 929 __le16 max_sibl_grp_sz; 930 __le16 max_cir_rl_profiles; 931 __le16 max_eir_rl_profiles; 932 __le16 max_srl_profiles; 933 u8 rsvd1[14]; 934 }; 935 936 struct ice_aqc_query_txsched_res_resp { 937 struct ice_aqc_generic_sched_props sched_props; 938 struct ice_aqc_layer_props layer_props[ICE_AQC_TOPO_MAX_LEVEL_NUM]; 939 }; 940 941 /* Get PHY capabilities (indirect 0x0600) */ 942 struct ice_aqc_get_phy_caps { 943 u8 lport_num; 944 u8 reserved; 945 __le16 param0; 946 /* 18.0 - Report qualified modules */ 947 #define ICE_AQC_GET_PHY_RQM BIT(0) 948 /* 18.1 - 18.3 : Report mode 949 * 000b - Report NVM capabilities 950 * 001b - Report topology capabilities 951 * 010b - Report SW configured 952 * 100b - Report default capabilities 953 */ 954 #define ICE_AQC_REPORT_MODE_S 1 955 #define ICE_AQC_REPORT_MODE_M (7 << ICE_AQC_REPORT_MODE_S) 956 #define ICE_AQC_REPORT_TOPO_CAP_NO_MEDIA 0 957 #define ICE_AQC_REPORT_TOPO_CAP_MEDIA BIT(1) 958 #define ICE_AQC_REPORT_ACTIVE_CFG BIT(2) 959 #define ICE_AQC_REPORT_DFLT_CFG BIT(3) 960 __le32 reserved1; 961 __le32 addr_high; 962 __le32 addr_low; 963 }; 964 965 /* This is #define of PHY type (Extended): 966 * The first set of defines is for phy_type_low. 967 */ 968 #define ICE_PHY_TYPE_LOW_100BASE_TX BIT_ULL(0) 969 #define ICE_PHY_TYPE_LOW_100M_SGMII BIT_ULL(1) 970 #define ICE_PHY_TYPE_LOW_1000BASE_T BIT_ULL(2) 971 #define ICE_PHY_TYPE_LOW_1000BASE_SX BIT_ULL(3) 972 #define ICE_PHY_TYPE_LOW_1000BASE_LX BIT_ULL(4) 973 #define ICE_PHY_TYPE_LOW_1000BASE_KX BIT_ULL(5) 974 #define ICE_PHY_TYPE_LOW_1G_SGMII BIT_ULL(6) 975 #define ICE_PHY_TYPE_LOW_2500BASE_T BIT_ULL(7) 976 #define ICE_PHY_TYPE_LOW_2500BASE_X BIT_ULL(8) 977 #define ICE_PHY_TYPE_LOW_2500BASE_KX BIT_ULL(9) 978 #define ICE_PHY_TYPE_LOW_5GBASE_T BIT_ULL(10) 979 #define ICE_PHY_TYPE_LOW_5GBASE_KR BIT_ULL(11) 980 #define ICE_PHY_TYPE_LOW_10GBASE_T BIT_ULL(12) 981 #define ICE_PHY_TYPE_LOW_10G_SFI_DA BIT_ULL(13) 982 #define ICE_PHY_TYPE_LOW_10GBASE_SR BIT_ULL(14) 983 #define ICE_PHY_TYPE_LOW_10GBASE_LR BIT_ULL(15) 984 #define ICE_PHY_TYPE_LOW_10GBASE_KR_CR1 BIT_ULL(16) 985 #define ICE_PHY_TYPE_LOW_10G_SFI_AOC_ACC BIT_ULL(17) 986 #define ICE_PHY_TYPE_LOW_10G_SFI_C2C BIT_ULL(18) 987 #define ICE_PHY_TYPE_LOW_25GBASE_T BIT_ULL(19) 988 #define ICE_PHY_TYPE_LOW_25GBASE_CR BIT_ULL(20) 989 #define ICE_PHY_TYPE_LOW_25GBASE_CR_S BIT_ULL(21) 990 #define ICE_PHY_TYPE_LOW_25GBASE_CR1 BIT_ULL(22) 991 #define ICE_PHY_TYPE_LOW_25GBASE_SR BIT_ULL(23) 992 #define ICE_PHY_TYPE_LOW_25GBASE_LR BIT_ULL(24) 993 #define ICE_PHY_TYPE_LOW_25GBASE_KR BIT_ULL(25) 994 #define ICE_PHY_TYPE_LOW_25GBASE_KR_S BIT_ULL(26) 995 #define ICE_PHY_TYPE_LOW_25GBASE_KR1 BIT_ULL(27) 996 #define ICE_PHY_TYPE_LOW_25G_AUI_AOC_ACC BIT_ULL(28) 997 #define ICE_PHY_TYPE_LOW_25G_AUI_C2C BIT_ULL(29) 998 #define ICE_PHY_TYPE_LOW_40GBASE_CR4 BIT_ULL(30) 999 #define ICE_PHY_TYPE_LOW_40GBASE_SR4 BIT_ULL(31) 1000 #define ICE_PHY_TYPE_LOW_40GBASE_LR4 BIT_ULL(32) 1001 #define ICE_PHY_TYPE_LOW_40GBASE_KR4 BIT_ULL(33) 1002 #define ICE_PHY_TYPE_LOW_40G_XLAUI_AOC_ACC BIT_ULL(34) 1003 #define ICE_PHY_TYPE_LOW_40G_XLAUI BIT_ULL(35) 1004 #define ICE_PHY_TYPE_LOW_50GBASE_CR2 BIT_ULL(36) 1005 #define ICE_PHY_TYPE_LOW_50GBASE_SR2 BIT_ULL(37) 1006 #define ICE_PHY_TYPE_LOW_50GBASE_LR2 BIT_ULL(38) 1007 #define ICE_PHY_TYPE_LOW_50GBASE_KR2 BIT_ULL(39) 1008 #define ICE_PHY_TYPE_LOW_50G_LAUI2_AOC_ACC BIT_ULL(40) 1009 #define ICE_PHY_TYPE_LOW_50G_LAUI2 BIT_ULL(41) 1010 #define ICE_PHY_TYPE_LOW_50G_AUI2_AOC_ACC BIT_ULL(42) 1011 #define ICE_PHY_TYPE_LOW_50G_AUI2 BIT_ULL(43) 1012 #define ICE_PHY_TYPE_LOW_50GBASE_CP BIT_ULL(44) 1013 #define ICE_PHY_TYPE_LOW_50GBASE_SR BIT_ULL(45) 1014 #define ICE_PHY_TYPE_LOW_50GBASE_FR BIT_ULL(46) 1015 #define ICE_PHY_TYPE_LOW_50GBASE_LR BIT_ULL(47) 1016 #define ICE_PHY_TYPE_LOW_50GBASE_KR_PAM4 BIT_ULL(48) 1017 #define ICE_PHY_TYPE_LOW_50G_AUI1_AOC_ACC BIT_ULL(49) 1018 #define ICE_PHY_TYPE_LOW_50G_AUI1 BIT_ULL(50) 1019 #define ICE_PHY_TYPE_LOW_100GBASE_CR4 BIT_ULL(51) 1020 #define ICE_PHY_TYPE_LOW_100GBASE_SR4 BIT_ULL(52) 1021 #define ICE_PHY_TYPE_LOW_100GBASE_LR4 BIT_ULL(53) 1022 #define ICE_PHY_TYPE_LOW_100GBASE_KR4 BIT_ULL(54) 1023 #define ICE_PHY_TYPE_LOW_100G_CAUI4_AOC_ACC BIT_ULL(55) 1024 #define ICE_PHY_TYPE_LOW_100G_CAUI4 BIT_ULL(56) 1025 #define ICE_PHY_TYPE_LOW_100G_AUI4_AOC_ACC BIT_ULL(57) 1026 #define ICE_PHY_TYPE_LOW_100G_AUI4 BIT_ULL(58) 1027 #define ICE_PHY_TYPE_LOW_100GBASE_CR_PAM4 BIT_ULL(59) 1028 #define ICE_PHY_TYPE_LOW_100GBASE_KR_PAM4 BIT_ULL(60) 1029 #define ICE_PHY_TYPE_LOW_100GBASE_CP2 BIT_ULL(61) 1030 #define ICE_PHY_TYPE_LOW_100GBASE_SR2 BIT_ULL(62) 1031 #define ICE_PHY_TYPE_LOW_100GBASE_DR BIT_ULL(63) 1032 #define ICE_PHY_TYPE_LOW_MAX_INDEX 63 1033 /* The second set of defines is for phy_type_high. */ 1034 #define ICE_PHY_TYPE_HIGH_100GBASE_KR2_PAM4 BIT_ULL(0) 1035 #define ICE_PHY_TYPE_HIGH_100G_CAUI2_AOC_ACC BIT_ULL(1) 1036 #define ICE_PHY_TYPE_HIGH_100G_CAUI2 BIT_ULL(2) 1037 #define ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC BIT_ULL(3) 1038 #define ICE_PHY_TYPE_HIGH_100G_AUI2 BIT_ULL(4) 1039 #define ICE_PHY_TYPE_HIGH_200G_CR4_PAM4 BIT_ULL(5) 1040 #define ICE_PHY_TYPE_HIGH_200G_SR4 BIT_ULL(6) 1041 #define ICE_PHY_TYPE_HIGH_200G_FR4 BIT_ULL(7) 1042 #define ICE_PHY_TYPE_HIGH_200G_LR4 BIT_ULL(8) 1043 #define ICE_PHY_TYPE_HIGH_200G_DR4 BIT_ULL(9) 1044 #define ICE_PHY_TYPE_HIGH_200G_KR4_PAM4 BIT_ULL(10) 1045 #define ICE_PHY_TYPE_HIGH_200G_AUI4_AOC_ACC BIT_ULL(11) 1046 #define ICE_PHY_TYPE_HIGH_200G_AUI4 BIT_ULL(12) 1047 #define ICE_PHY_TYPE_HIGH_MAX_INDEX 12 1048 1049 struct ice_aqc_get_phy_caps_data { 1050 __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ 1051 __le64 phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */ 1052 u8 caps; 1053 #define ICE_AQC_PHY_EN_TX_LINK_PAUSE BIT(0) 1054 #define ICE_AQC_PHY_EN_RX_LINK_PAUSE BIT(1) 1055 #define ICE_AQC_PHY_LOW_POWER_MODE BIT(2) 1056 #define ICE_AQC_PHY_EN_LINK BIT(3) 1057 #define ICE_AQC_PHY_AN_MODE BIT(4) 1058 #define ICE_AQC_GET_PHY_EN_MOD_QUAL BIT(5) 1059 #define ICE_AQC_PHY_EN_AUTO_FEC BIT(7) 1060 #define ICE_AQC_PHY_CAPS_MASK ICE_M(0xff, 0) 1061 u8 low_power_ctrl_an; 1062 #define ICE_AQC_PHY_EN_D3COLD_LOW_POWER_AUTONEG BIT(0) 1063 #define ICE_AQC_PHY_AN_EN_CLAUSE28 BIT(1) 1064 #define ICE_AQC_PHY_AN_EN_CLAUSE73 BIT(2) 1065 #define ICE_AQC_PHY_AN_EN_CLAUSE37 BIT(3) 1066 __le16 eee_cap; 1067 #define ICE_AQC_PHY_EEE_EN_100BASE_TX BIT(0) 1068 #define ICE_AQC_PHY_EEE_EN_1000BASE_T BIT(1) 1069 #define ICE_AQC_PHY_EEE_EN_10GBASE_T BIT(2) 1070 #define ICE_AQC_PHY_EEE_EN_1000BASE_KX BIT(3) 1071 #define ICE_AQC_PHY_EEE_EN_10GBASE_KR BIT(4) 1072 #define ICE_AQC_PHY_EEE_EN_25GBASE_KR BIT(5) 1073 #define ICE_AQC_PHY_EEE_EN_40GBASE_KR4 BIT(6) 1074 __le16 eeer_value; 1075 u8 phy_id_oui[4]; /* PHY/Module ID connected on the port */ 1076 u8 phy_fw_ver[8]; 1077 u8 link_fec_options; 1078 #define ICE_AQC_PHY_FEC_10G_KR_40G_KR4_EN BIT(0) 1079 #define ICE_AQC_PHY_FEC_10G_KR_40G_KR4_REQ BIT(1) 1080 #define ICE_AQC_PHY_FEC_25G_RS_528_REQ BIT(2) 1081 #define ICE_AQC_PHY_FEC_25G_KR_REQ BIT(3) 1082 #define ICE_AQC_PHY_FEC_25G_RS_544_REQ BIT(4) 1083 #define ICE_AQC_PHY_FEC_25G_RS_CLAUSE91_EN BIT(6) 1084 #define ICE_AQC_PHY_FEC_25G_KR_CLAUSE74_EN BIT(7) 1085 #define ICE_AQC_PHY_FEC_MASK ICE_M(0xdf, 0) 1086 u8 module_compliance_enforcement; 1087 #define ICE_AQC_MOD_ENFORCE_STRICT_MODE BIT(0) 1088 u8 extended_compliance_code; 1089 #define ICE_MODULE_TYPE_TOTAL_BYTE 3 1090 u8 module_type[ICE_MODULE_TYPE_TOTAL_BYTE]; 1091 #define ICE_AQC_MOD_TYPE_BYTE0_SFP_PLUS 0xA0 1092 #define ICE_AQC_MOD_TYPE_BYTE0_QSFP_PLUS 0x80 1093 #define ICE_AQC_MOD_TYPE_IDENT 1 1094 #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_PASSIVE BIT(0) 1095 #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_ACTIVE BIT(1) 1096 #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_SR BIT(4) 1097 #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_LR BIT(5) 1098 #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_LRM BIT(6) 1099 #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_ER BIT(7) 1100 #define ICE_AQC_MOD_TYPE_BYTE2_SFP_PLUS 0xA0 1101 #define ICE_AQC_MOD_TYPE_BYTE2_QSFP_PLUS 0x86 1102 u8 qualified_module_count; 1103 u8 rsvd2[7]; /* Bytes 47:41 reserved */ 1104 #define ICE_AQC_QUAL_MOD_COUNT_MAX 16 1105 struct { 1106 u8 v_oui[3]; 1107 u8 rsvd3; 1108 u8 v_part[16]; 1109 __le32 v_rev; 1110 __le64 rsvd4; 1111 } qual_modules[ICE_AQC_QUAL_MOD_COUNT_MAX]; 1112 }; 1113 1114 /* Set PHY capabilities (direct 0x0601) 1115 * NOTE: This command must be followed by setup link and restart auto-neg 1116 */ 1117 struct ice_aqc_set_phy_cfg { 1118 u8 lport_num; 1119 u8 reserved[7]; 1120 __le32 addr_high; 1121 __le32 addr_low; 1122 }; 1123 1124 /* Set PHY config command data structure */ 1125 struct ice_aqc_set_phy_cfg_data { 1126 __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ 1127 __le64 phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */ 1128 u8 caps; 1129 #define ICE_AQ_PHY_ENA_VALID_MASK ICE_M(0xef, 0) 1130 #define ICE_AQ_PHY_ENA_TX_PAUSE_ABILITY BIT(0) 1131 #define ICE_AQ_PHY_ENA_RX_PAUSE_ABILITY BIT(1) 1132 #define ICE_AQ_PHY_ENA_LOW_POWER BIT(2) 1133 #define ICE_AQ_PHY_ENA_LINK BIT(3) 1134 #define ICE_AQ_PHY_ENA_AUTO_LINK_UPDT BIT(5) 1135 #define ICE_AQ_PHY_ENA_LESM BIT(6) 1136 #define ICE_AQ_PHY_ENA_AUTO_FEC BIT(7) 1137 u8 low_power_ctrl_an; 1138 __le16 eee_cap; /* Value from ice_aqc_get_phy_caps */ 1139 __le16 eeer_value; 1140 u8 link_fec_opt; /* Use defines from ice_aqc_get_phy_caps */ 1141 u8 module_compliance_enforcement; 1142 }; 1143 1144 /* Set MAC Config command data structure (direct 0x0603) */ 1145 struct ice_aqc_set_mac_cfg { 1146 __le16 max_frame_size; 1147 u8 params; 1148 #define ICE_AQ_SET_MAC_PACE_S 3 1149 #define ICE_AQ_SET_MAC_PACE_M (0xF << ICE_AQ_SET_MAC_PACE_S) 1150 #define ICE_AQ_SET_MAC_PACE_TYPE_M BIT(7) 1151 #define ICE_AQ_SET_MAC_PACE_TYPE_RATE 0 1152 #define ICE_AQ_SET_MAC_PACE_TYPE_FIXED ICE_AQ_SET_MAC_PACE_TYPE_M 1153 u8 tx_tmr_priority; 1154 __le16 tx_tmr_value; 1155 __le16 fc_refresh_threshold; 1156 u8 drop_opts; 1157 #define ICE_AQ_SET_MAC_AUTO_DROP_MASK BIT(0) 1158 #define ICE_AQ_SET_MAC_AUTO_DROP_NONE 0 1159 #define ICE_AQ_SET_MAC_AUTO_DROP_BLOCKING_PKTS BIT(0) 1160 u8 reserved[7]; 1161 }; 1162 1163 /* Restart AN command data structure (direct 0x0605) 1164 * Also used for response, with only the lport_num field present. 1165 */ 1166 struct ice_aqc_restart_an { 1167 u8 lport_num; 1168 u8 reserved; 1169 u8 cmd_flags; 1170 #define ICE_AQC_RESTART_AN_LINK_RESTART BIT(1) 1171 #define ICE_AQC_RESTART_AN_LINK_ENABLE BIT(2) 1172 #define ICE_AQC_RESTART_AN_REFCLK_M GENMASK(4, 3) 1173 #define ICE_AQC_RESTART_AN_REFCLK_NOCHANGE 0 1174 u8 reserved2[13]; 1175 }; 1176 1177 /* Get link status (indirect 0x0607), also used for Link Status Event */ 1178 struct ice_aqc_get_link_status { 1179 u8 lport_num; 1180 u8 reserved; 1181 __le16 cmd_flags; 1182 #define ICE_AQ_LSE_M 0x3 1183 #define ICE_AQ_LSE_NOP 0x0 1184 #define ICE_AQ_LSE_DIS 0x2 1185 #define ICE_AQ_LSE_ENA 0x3 1186 /* only response uses this flag */ 1187 #define ICE_AQ_LSE_IS_ENABLED 0x1 1188 __le32 reserved2; 1189 __le32 addr_high; 1190 __le32 addr_low; 1191 }; 1192 1193 /* Get link status response data structure, also used for Link Status Event */ 1194 struct ice_aqc_get_link_status_data { 1195 u8 topo_media_conflict; 1196 #define ICE_AQ_LINK_TOPO_CONFLICT BIT(0) 1197 #define ICE_AQ_LINK_MEDIA_CONFLICT BIT(1) 1198 #define ICE_AQ_LINK_TOPO_CORRUPT BIT(2) 1199 #define ICE_AQ_LINK_TOPO_UNREACH_PRT BIT(4) 1200 #define ICE_AQ_LINK_TOPO_UNDRUTIL_PRT BIT(5) 1201 #define ICE_AQ_LINK_TOPO_UNDRUTIL_MEDIA BIT(6) 1202 #define ICE_AQ_LINK_TOPO_UNSUPP_MEDIA BIT(7) 1203 u8 link_cfg_err; 1204 #define ICE_AQ_LINK_MODULE_POWER_UNSUPPORTED BIT(5) 1205 #define ICE_AQ_LINK_EXTERNAL_PHY_LOAD_FAILURE BIT(6) 1206 #define ICE_AQ_LINK_INVAL_MAX_POWER_LIMIT BIT(7) 1207 u8 link_info; 1208 #define ICE_AQ_LINK_UP BIT(0) /* Link Status */ 1209 #define ICE_AQ_LINK_FAULT BIT(1) 1210 #define ICE_AQ_LINK_FAULT_TX BIT(2) 1211 #define ICE_AQ_LINK_FAULT_RX BIT(3) 1212 #define ICE_AQ_LINK_FAULT_REMOTE BIT(4) 1213 #define ICE_AQ_LINK_UP_PORT BIT(5) /* External Port Link Status */ 1214 #define ICE_AQ_MEDIA_AVAILABLE BIT(6) 1215 #define ICE_AQ_SIGNAL_DETECT BIT(7) 1216 u8 an_info; 1217 #define ICE_AQ_AN_COMPLETED BIT(0) 1218 #define ICE_AQ_LP_AN_ABILITY BIT(1) 1219 #define ICE_AQ_PD_FAULT BIT(2) /* Parallel Detection Fault */ 1220 #define ICE_AQ_FEC_EN BIT(3) 1221 #define ICE_AQ_PHY_LOW_POWER BIT(4) /* Low Power State */ 1222 #define ICE_AQ_LINK_PAUSE_TX BIT(5) 1223 #define ICE_AQ_LINK_PAUSE_RX BIT(6) 1224 #define ICE_AQ_QUALIFIED_MODULE BIT(7) 1225 u8 ext_info; 1226 #define ICE_AQ_LINK_PHY_TEMP_ALARM BIT(0) 1227 #define ICE_AQ_LINK_EXCESSIVE_ERRORS BIT(1) /* Excessive Link Errors */ 1228 /* Port Tx Suspended */ 1229 #define ICE_AQ_LINK_TX_S 2 1230 #define ICE_AQ_LINK_TX_M (0x03 << ICE_AQ_LINK_TX_S) 1231 #define ICE_AQ_LINK_TX_ACTIVE 0 1232 #define ICE_AQ_LINK_TX_DRAINED 1 1233 #define ICE_AQ_LINK_TX_FLUSHED 3 1234 u8 reserved2; 1235 __le16 max_frame_size; 1236 u8 cfg; 1237 #define ICE_AQ_LINK_25G_KR_FEC_EN BIT(0) 1238 #define ICE_AQ_LINK_25G_RS_528_FEC_EN BIT(1) 1239 #define ICE_AQ_LINK_25G_RS_544_FEC_EN BIT(2) 1240 #define ICE_AQ_FEC_MASK ICE_M(0x7, 0) 1241 /* Pacing Config */ 1242 #define ICE_AQ_CFG_PACING_S 3 1243 #define ICE_AQ_CFG_PACING_M (0xF << ICE_AQ_CFG_PACING_S) 1244 #define ICE_AQ_CFG_PACING_TYPE_M BIT(7) 1245 #define ICE_AQ_CFG_PACING_TYPE_AVG 0 1246 #define ICE_AQ_CFG_PACING_TYPE_FIXED ICE_AQ_CFG_PACING_TYPE_M 1247 /* External Device Power Ability */ 1248 u8 power_desc; 1249 #define ICE_AQ_PWR_CLASS_M 0x3F 1250 #define ICE_AQ_LINK_PWR_BASET_LOW_HIGH 0 1251 #define ICE_AQ_LINK_PWR_BASET_HIGH 1 1252 #define ICE_AQ_LINK_PWR_QSFP_CLASS_1 0 1253 #define ICE_AQ_LINK_PWR_QSFP_CLASS_2 1 1254 #define ICE_AQ_LINK_PWR_QSFP_CLASS_3 2 1255 #define ICE_AQ_LINK_PWR_QSFP_CLASS_4 3 1256 __le16 link_speed; 1257 #define ICE_AQ_LINK_SPEED_M GENMASK(11, 0) 1258 #define ICE_AQ_LINK_SPEED_10MB BIT(0) 1259 #define ICE_AQ_LINK_SPEED_100MB BIT(1) 1260 #define ICE_AQ_LINK_SPEED_1000MB BIT(2) 1261 #define ICE_AQ_LINK_SPEED_2500MB BIT(3) 1262 #define ICE_AQ_LINK_SPEED_5GB BIT(4) 1263 #define ICE_AQ_LINK_SPEED_10GB BIT(5) 1264 #define ICE_AQ_LINK_SPEED_20GB BIT(6) 1265 #define ICE_AQ_LINK_SPEED_25GB BIT(7) 1266 #define ICE_AQ_LINK_SPEED_40GB BIT(8) 1267 #define ICE_AQ_LINK_SPEED_50GB BIT(9) 1268 #define ICE_AQ_LINK_SPEED_100GB BIT(10) 1269 #define ICE_AQ_LINK_SPEED_200GB BIT(11) 1270 #define ICE_AQ_LINK_SPEED_UNKNOWN BIT(15) 1271 /* Aligns next field to 8-byte boundary */ 1272 __le16 reserved3; 1273 u8 ext_fec_status; 1274 /* RS 272 FEC enabled */ 1275 #define ICE_AQ_LINK_RS_272_FEC_EN BIT(0) 1276 u8 reserved4; 1277 /* Use values from ICE_PHY_TYPE_LOW_* */ 1278 __le64 phy_type_low; 1279 /* Use values from ICE_PHY_TYPE_HIGH_* */ 1280 __le64 phy_type_high; 1281 #define ICE_AQC_LS_DATA_SIZE_V1 \ 1282 offsetofend(struct ice_aqc_get_link_status_data, phy_type_high) 1283 /* Get link status v2 link partner data */ 1284 __le64 lp_phy_type_low; 1285 __le64 lp_phy_type_high; 1286 u8 lp_fec_adv; 1287 #define ICE_AQ_LINK_LP_10G_KR_FEC_CAP BIT(0) 1288 #define ICE_AQ_LINK_LP_25G_KR_FEC_CAP BIT(1) 1289 #define ICE_AQ_LINK_LP_RS_528_FEC_CAP BIT(2) 1290 #define ICE_AQ_LINK_LP_50G_KR_272_FEC_CAP BIT(3) 1291 #define ICE_AQ_LINK_LP_100G_KR_272_FEC_CAP BIT(4) 1292 #define ICE_AQ_LINK_LP_200G_KR_272_FEC_CAP BIT(5) 1293 u8 lp_fec_req; 1294 #define ICE_AQ_LINK_LP_10G_KR_FEC_REQ BIT(0) 1295 #define ICE_AQ_LINK_LP_25G_KR_FEC_REQ BIT(1) 1296 #define ICE_AQ_LINK_LP_RS_528_FEC_REQ BIT(2) 1297 #define ICE_AQ_LINK_LP_KR_272_FEC_REQ BIT(3) 1298 u8 lp_flowcontrol; 1299 #define ICE_AQ_LINK_LP_PAUSE_ADV BIT(0) 1300 #define ICE_AQ_LINK_LP_ASM_DIR_ADV BIT(1) 1301 u8 reserved5[5]; 1302 #define ICE_AQC_LS_DATA_SIZE_V2 \ 1303 offsetofend(struct ice_aqc_get_link_status_data, reserved5) 1304 } __packed; 1305 1306 /* Set event mask command (direct 0x0613) */ 1307 struct ice_aqc_set_event_mask { 1308 u8 lport_num; 1309 u8 reserved[7]; 1310 __le16 event_mask; 1311 #define ICE_AQ_LINK_EVENT_UPDOWN BIT(1) 1312 #define ICE_AQ_LINK_EVENT_MEDIA_NA BIT(2) 1313 #define ICE_AQ_LINK_EVENT_LINK_FAULT BIT(3) 1314 #define ICE_AQ_LINK_EVENT_PHY_TEMP_ALARM BIT(4) 1315 #define ICE_AQ_LINK_EVENT_EXCESSIVE_ERRORS BIT(5) 1316 #define ICE_AQ_LINK_EVENT_SIGNAL_DETECT BIT(6) 1317 #define ICE_AQ_LINK_EVENT_AN_COMPLETED BIT(7) 1318 #define ICE_AQ_LINK_EVENT_MODULE_QUAL_FAIL BIT(8) 1319 #define ICE_AQ_LINK_EVENT_PORT_TX_SUSPENDED BIT(9) 1320 #define ICE_AQ_LINK_EVENT_PHY_FW_LOAD_FAIL BIT(12) 1321 u8 reserved1[6]; 1322 }; 1323 1324 /* Set MAC Loopback command (direct 0x0620) */ 1325 struct ice_aqc_set_mac_lb { 1326 u8 lb_mode; 1327 #define ICE_AQ_MAC_LB_EN BIT(0) 1328 #define ICE_AQ_MAC_LB_OSC_CLK BIT(1) 1329 u8 reserved[15]; 1330 }; 1331 1332 /* Set PHY recovered clock output (direct 0x0630) */ 1333 struct ice_aqc_set_phy_rec_clk_out { 1334 u8 phy_output; 1335 u8 port_num; 1336 #define ICE_AQC_SET_PHY_REC_CLK_OUT_CURR_PORT 0xFF 1337 u8 flags; 1338 #define ICE_AQC_SET_PHY_REC_CLK_OUT_OUT_EN BIT(0) 1339 u8 rsvd; 1340 __le32 freq; 1341 u8 rsvd2[6]; 1342 __le16 node_handle; 1343 }; 1344 1345 /* Get PHY recovered clock output (direct 0x0631) */ 1346 struct ice_aqc_get_phy_rec_clk_out { 1347 u8 phy_output; 1348 u8 port_num; 1349 #define ICE_AQC_GET_PHY_REC_CLK_OUT_CURR_PORT 0xFF 1350 u8 flags; 1351 #define ICE_AQC_GET_PHY_REC_CLK_OUT_OUT_EN BIT(0) 1352 u8 rsvd[11]; 1353 __le16 node_handle; 1354 }; 1355 1356 /* Get sensor reading (direct 0x0632) */ 1357 struct ice_aqc_get_sensor_reading { 1358 u8 sensor; 1359 u8 format; 1360 u8 reserved[6]; 1361 __le32 addr_high; 1362 __le32 addr_low; 1363 }; 1364 1365 /* Get sensor reading response (direct 0x0632) */ 1366 struct ice_aqc_get_sensor_reading_resp { 1367 union { 1368 u8 raw[8]; 1369 /* Output data for sensor 0x00, format 0x00 */ 1370 struct _packed { 1371 s8 temp; 1372 u8 temp_warning_threshold; 1373 u8 temp_critical_threshold; 1374 u8 temp_fatal_threshold; 1375 u8 reserved[4]; 1376 } s0f0; 1377 } data; 1378 }; 1379 1380 /* DNL call command (indirect 0x0682) 1381 * Struct is used for both command and response 1382 */ 1383 struct ice_aqc_dnl_call_command { 1384 u8 ctx; /* Used in command, reserved in response */ 1385 u8 reserved; 1386 __le16 activity_id; 1387 #define ICE_AQC_ACT_ID_DNL 0x1129 1388 __le32 reserved1; 1389 __le32 addr_high; 1390 __le32 addr_low; 1391 }; 1392 1393 struct ice_aqc_dnl_equa_param { 1394 __le16 data_in; 1395 #define ICE_AQC_RX_EQU_SHIFT 8 1396 #define ICE_AQC_RX_EQU_PRE2 (0x10 << ICE_AQC_RX_EQU_SHIFT) 1397 #define ICE_AQC_RX_EQU_PRE1 (0x11 << ICE_AQC_RX_EQU_SHIFT) 1398 #define ICE_AQC_RX_EQU_POST1 (0x12 << ICE_AQC_RX_EQU_SHIFT) 1399 #define ICE_AQC_RX_EQU_BFLF (0x13 << ICE_AQC_RX_EQU_SHIFT) 1400 #define ICE_AQC_RX_EQU_BFHF (0x14 << ICE_AQC_RX_EQU_SHIFT) 1401 #define ICE_AQC_RX_EQU_CTLE_GAINHF (0x20 << ICE_AQC_RX_EQU_SHIFT) 1402 #define ICE_AQC_RX_EQU_CTLE_GAINLF (0x21 << ICE_AQC_RX_EQU_SHIFT) 1403 #define ICE_AQC_RX_EQU_CTLE_GAINDC (0x22 << ICE_AQC_RX_EQU_SHIFT) 1404 #define ICE_AQC_RX_EQU_CTLE_BW (0x23 << ICE_AQC_RX_EQU_SHIFT) 1405 #define ICE_AQC_RX_EQU_DFE_GAIN (0x30 << ICE_AQC_RX_EQU_SHIFT) 1406 #define ICE_AQC_RX_EQU_DFE_GAIN2 (0x31 << ICE_AQC_RX_EQU_SHIFT) 1407 #define ICE_AQC_RX_EQU_DFE_2 (0x32 << ICE_AQC_RX_EQU_SHIFT) 1408 #define ICE_AQC_RX_EQU_DFE_3 (0x33 << ICE_AQC_RX_EQU_SHIFT) 1409 #define ICE_AQC_RX_EQU_DFE_4 (0x34 << ICE_AQC_RX_EQU_SHIFT) 1410 #define ICE_AQC_RX_EQU_DFE_5 (0x35 << ICE_AQC_RX_EQU_SHIFT) 1411 #define ICE_AQC_RX_EQU_DFE_6 (0x36 << ICE_AQC_RX_EQU_SHIFT) 1412 #define ICE_AQC_RX_EQU_DFE_7 (0x37 << ICE_AQC_RX_EQU_SHIFT) 1413 #define ICE_AQC_RX_EQU_DFE_8 (0x38 << ICE_AQC_RX_EQU_SHIFT) 1414 #define ICE_AQC_RX_EQU_DFE_9 (0x39 << ICE_AQC_RX_EQU_SHIFT) 1415 #define ICE_AQC_RX_EQU_DFE_10 (0x3A << ICE_AQC_RX_EQU_SHIFT) 1416 #define ICE_AQC_RX_EQU_DFE_11 (0x3B << ICE_AQC_RX_EQU_SHIFT) 1417 #define ICE_AQC_RX_EQU_DFE_12 (0x3C << ICE_AQC_RX_EQU_SHIFT) 1418 #define ICE_AQC_TX_EQU_PRE1 0x0 1419 #define ICE_AQC_TX_EQU_PRE3 0x3 1420 #define ICE_AQC_TX_EQU_ATTEN 0x4 1421 #define ICE_AQC_TX_EQU_POST1 0x8 1422 #define ICE_AQC_TX_EQU_PRE2 0xC 1423 __le16 op_code_serdes_sel; 1424 #define ICE_AQC_OP_CODE_SHIFT 4 1425 #define ICE_AQC_OP_CODE_RX_EQU (0x9 << ICE_AQC_OP_CODE_SHIFT) 1426 #define ICE_AQC_OP_CODE_TX_EQU (0x10 << ICE_AQC_OP_CODE_SHIFT) 1427 __le32 reserved[3]; 1428 }; 1429 1430 struct ice_aqc_dnl_equa_respon { 1431 /* Equalization value can be negative */ 1432 int val; 1433 __le32 reserved[3]; 1434 }; 1435 1436 /* DNL call command/response buffer (indirect 0x0682) */ 1437 struct ice_aqc_dnl_call { 1438 union { 1439 struct ice_aqc_dnl_equa_param txrx_equa_reqs; 1440 __le32 stores[4]; 1441 struct ice_aqc_dnl_equa_respon txrx_equa_resp; 1442 } sto; 1443 }; 1444 1445 struct ice_aqc_link_topo_params { 1446 u8 lport_num; 1447 u8 lport_num_valid; 1448 #define ICE_AQC_LINK_TOPO_PORT_NUM_VALID BIT(0) 1449 u8 node_type_ctx; 1450 #define ICE_AQC_LINK_TOPO_NODE_TYPE_S 0 1451 #define ICE_AQC_LINK_TOPO_NODE_TYPE_M (0xF << ICE_AQC_LINK_TOPO_NODE_TYPE_S) 1452 #define ICE_AQC_LINK_TOPO_NODE_TYPE_PHY 0 1453 #define ICE_AQC_LINK_TOPO_NODE_TYPE_GPIO_CTRL 1 1454 #define ICE_AQC_LINK_TOPO_NODE_TYPE_MUX_CTRL 2 1455 #define ICE_AQC_LINK_TOPO_NODE_TYPE_LED_CTRL 3 1456 #define ICE_AQC_LINK_TOPO_NODE_TYPE_LED 4 1457 #define ICE_AQC_LINK_TOPO_NODE_TYPE_THERMAL 5 1458 #define ICE_AQC_LINK_TOPO_NODE_TYPE_CAGE 6 1459 #define ICE_AQC_LINK_TOPO_NODE_TYPE_MEZZ 7 1460 #define ICE_AQC_LINK_TOPO_NODE_TYPE_ID_EEPROM 8 1461 #define ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_CTRL 9 1462 #define ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_MUX 10 1463 #define ICE_AQC_LINK_TOPO_NODE_TYPE_GPS 11 1464 #define ICE_AQC_LINK_TOPO_NODE_CTX_S 4 1465 #define ICE_AQC_LINK_TOPO_NODE_CTX_M \ 1466 (0xF << ICE_AQC_LINK_TOPO_NODE_CTX_S) 1467 #define ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL 0 1468 #define ICE_AQC_LINK_TOPO_NODE_CTX_BOARD 1 1469 #define ICE_AQC_LINK_TOPO_NODE_CTX_PORT 2 1470 #define ICE_AQC_LINK_TOPO_NODE_CTX_NODE 3 1471 #define ICE_AQC_LINK_TOPO_NODE_CTX_PROVIDED 4 1472 #define ICE_AQC_LINK_TOPO_NODE_CTX_OVERRIDE 5 1473 u8 index; 1474 }; 1475 1476 struct ice_aqc_link_topo_addr { 1477 struct ice_aqc_link_topo_params topo_params; 1478 __le16 handle; 1479 #define ICE_AQC_LINK_TOPO_HANDLE_S 0 1480 #define ICE_AQC_LINK_TOPO_HANDLE_M (0x3FF << ICE_AQC_LINK_TOPO_HANDLE_S) 1481 /* Used to decode the handle field */ 1482 #define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_M BIT(9) 1483 #define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_LOM BIT(9) 1484 #define ICE_AQC_LINK_TOPO_HANDLE_BRD_TYPE_MEZZ 0 1485 #define ICE_AQC_LINK_TOPO_HANDLE_NODE_S 0 1486 /* In case of a Mezzanine type */ 1487 #define ICE_AQC_LINK_TOPO_HANDLE_MEZZ_NODE_M \ 1488 (0x3F << ICE_AQC_LINK_TOPO_HANDLE_NODE_S) 1489 #define ICE_AQC_LINK_TOPO_HANDLE_MEZZ_S 6 1490 #define ICE_AQC_LINK_TOPO_HANDLE_MEZZ_M (0x7 << ICE_AQC_LINK_TOPO_HANDLE_MEZZ_S) 1491 /* In case of a LOM type */ 1492 #define ICE_AQC_LINK_TOPO_HANDLE_LOM_NODE_M \ 1493 (0x1FF << ICE_AQC_LINK_TOPO_HANDLE_NODE_S) 1494 }; 1495 1496 /* Get Link Topology Handle (direct, 0x06E0) */ 1497 struct ice_aqc_get_link_topo { 1498 struct ice_aqc_link_topo_addr addr; 1499 u8 node_part_num; 1500 #define ICE_AQC_GET_LINK_TOPO_NODE_NR_PCA9575 0x21 1501 #define ICE_AQC_GET_LINK_TOPO_NODE_NR_ZL30632_80032 0x24 1502 #define ICE_AQC_GET_LINK_TOPO_NODE_NR_SI5383_5384 0x25 1503 #define ICE_AQC_GET_LINK_TOPO_NODE_NR_E822_PHY 0x30 1504 #define ICE_AQC_GET_LINK_TOPO_NODE_NR_C827 0x31 1505 #define ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_CLK_MUX 0x47 1506 #define ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_GPS 0x48 1507 u8 rsvd[9]; 1508 }; 1509 1510 /* Read/Write I2C (direct, 0x06E2/0x06E3) */ 1511 struct ice_aqc_i2c { 1512 struct ice_aqc_link_topo_addr topo_addr; 1513 __le16 i2c_addr; 1514 u8 i2c_params; 1515 #define ICE_AQC_I2C_DATA_SIZE_M GENMASK(3, 0) 1516 #define ICE_AQC_I2C_USE_REPEATED_START BIT(7) 1517 1518 u8 rsvd; 1519 __le16 i2c_bus_addr; 1520 u8 i2c_data[4]; /* Used only by write command, reserved in read. */ 1521 }; 1522 1523 /* Read I2C Response (direct, 0x06E2) */ 1524 struct ice_aqc_read_i2c_resp { 1525 u8 i2c_data[16]; 1526 }; 1527 1528 /* Set Port Identification LED (direct, 0x06E9) */ 1529 struct ice_aqc_set_port_id_led { 1530 u8 lport_num; 1531 u8 lport_num_valid; 1532 u8 ident_mode; 1533 #define ICE_AQC_PORT_IDENT_LED_BLINK BIT(0) 1534 #define ICE_AQC_PORT_IDENT_LED_ORIG 0 1535 u8 rsvd[13]; 1536 }; 1537 1538 /* Get Port Options (indirect, 0x06EA) */ 1539 struct ice_aqc_get_port_options { 1540 u8 lport_num; 1541 u8 lport_num_valid; 1542 u8 port_options_count; 1543 #define ICE_AQC_PORT_OPT_COUNT_M GENMASK(3, 0) 1544 #define ICE_AQC_PORT_OPT_MAX 16 1545 1546 u8 innermost_phy_index; 1547 u8 port_options; 1548 #define ICE_AQC_PORT_OPT_ACTIVE_M GENMASK(3, 0) 1549 #define ICE_AQC_PORT_OPT_VALID BIT(7) 1550 1551 u8 pending_port_option_status; 1552 #define ICE_AQC_PENDING_PORT_OPT_IDX_M GENMASK(3, 0) 1553 #define ICE_AQC_PENDING_PORT_OPT_VALID BIT(7) 1554 1555 u8 rsvd[2]; 1556 __le32 addr_high; 1557 __le32 addr_low; 1558 }; 1559 1560 struct ice_aqc_get_port_options_elem { 1561 u8 pmd; 1562 #define ICE_AQC_PORT_OPT_PMD_COUNT_M GENMASK(3, 0) 1563 1564 u8 max_lane_speed; 1565 #define ICE_AQC_PORT_OPT_MAX_LANE_M GENMASK(3, 0) 1566 #define ICE_AQC_PORT_OPT_MAX_LANE_100M 0 1567 #define ICE_AQC_PORT_OPT_MAX_LANE_1G 1 1568 #define ICE_AQC_PORT_OPT_MAX_LANE_2500M 2 1569 #define ICE_AQC_PORT_OPT_MAX_LANE_5G 3 1570 #define ICE_AQC_PORT_OPT_MAX_LANE_10G 4 1571 #define ICE_AQC_PORT_OPT_MAX_LANE_25G 5 1572 #define ICE_AQC_PORT_OPT_MAX_LANE_50G 6 1573 #define ICE_AQC_PORT_OPT_MAX_LANE_100G 7 1574 #define ICE_AQC_PORT_OPT_MAX_LANE_200G 8 1575 #define ICE_AQC_PORT_OPT_MAX_LANE_40G 9 1576 1577 u8 global_scid[2]; 1578 u8 phy_scid[2]; 1579 u8 pf2port_cid[2]; 1580 }; 1581 1582 /* Set Port Option (direct, 0x06EB) */ 1583 struct ice_aqc_set_port_option { 1584 u8 lport_num; 1585 u8 lport_num_valid; 1586 u8 selected_port_option; 1587 u8 rsvd[13]; 1588 }; 1589 1590 /* Set/Get GPIO (direct, 0x06EC/0x06ED) */ 1591 struct ice_aqc_gpio { 1592 __le16 gpio_ctrl_handle; 1593 #define ICE_AQC_GPIO_HANDLE_S 0 1594 #define ICE_AQC_GPIO_HANDLE_M (0x3FF << ICE_AQC_GPIO_HANDLE_S) 1595 u8 gpio_num; 1596 u8 gpio_val; 1597 u8 rsvd[12]; 1598 }; 1599 1600 /* Read/Write SFF EEPROM command (indirect 0x06EE) */ 1601 struct ice_aqc_sff_eeprom { 1602 u8 lport_num; 1603 u8 lport_num_valid; 1604 #define ICE_AQC_SFF_PORT_NUM_VALID BIT(0) 1605 __le16 i2c_bus_addr; 1606 #define ICE_AQC_SFF_I2CBUS_7BIT_M 0x7F 1607 #define ICE_AQC_SFF_I2CBUS_10BIT_M 0x3FF 1608 #define ICE_AQC_SFF_I2CBUS_TYPE_M BIT(10) 1609 #define ICE_AQC_SFF_I2CBUS_TYPE_7BIT 0 1610 #define ICE_AQC_SFF_I2CBUS_TYPE_10BIT ICE_AQC_SFF_I2CBUS_TYPE_M 1611 #define ICE_AQC_SFF_SET_EEPROM_PAGE_S 11 1612 #define ICE_AQC_SFF_SET_EEPROM_PAGE_M (0x3 << ICE_AQC_SFF_SET_EEPROM_PAGE_S) 1613 #define ICE_AQC_SFF_NO_PAGE_CHANGE 0 1614 #define ICE_AQC_SFF_SET_23_ON_MISMATCH 1 1615 #define ICE_AQC_SFF_SET_22_ON_MISMATCH 2 1616 #define ICE_AQC_SFF_IS_WRITE BIT(15) 1617 __le16 i2c_mem_addr; 1618 __le16 eeprom_page; 1619 #define ICE_AQC_SFF_EEPROM_BANK_S 0 1620 #define ICE_AQC_SFF_EEPROM_BANK_M (0xFF << ICE_AQC_SFF_EEPROM_BANK_S) 1621 #define ICE_AQC_SFF_EEPROM_PAGE_S 8 1622 #define ICE_AQC_SFF_EEPROM_PAGE_M (0xFF << ICE_AQC_SFF_EEPROM_PAGE_S) 1623 __le32 addr_high; 1624 __le32 addr_low; 1625 }; 1626 1627 /* NVM Read command (indirect 0x0701) 1628 * NVM Erase commands (direct 0x0702) 1629 * NVM Update commands (indirect 0x0703) 1630 */ 1631 struct ice_aqc_nvm { 1632 #define ICE_AQC_NVM_MAX_OFFSET 0xFFFFFF 1633 __le16 offset_low; 1634 u8 offset_high; 1635 u8 cmd_flags; 1636 #define ICE_AQC_NVM_LAST_CMD BIT(0) 1637 #define ICE_AQC_NVM_PCIR_REQ BIT(0) /* Used by NVM Update reply */ 1638 #define ICE_AQC_NVM_PRESERVATION_S 1 1639 #define ICE_AQC_NVM_PRESERVATION_M (3 << ICE_AQC_NVM_PRESERVATION_S) 1640 #define ICE_AQC_NVM_NO_PRESERVATION (0 << ICE_AQC_NVM_PRESERVATION_S) 1641 #define ICE_AQC_NVM_PRESERVE_ALL BIT(1) 1642 #define ICE_AQC_NVM_FACTORY_DEFAULT (2 << ICE_AQC_NVM_PRESERVATION_S) 1643 #define ICE_AQC_NVM_PRESERVE_SELECTED (3 << ICE_AQC_NVM_PRESERVATION_S) 1644 #define ICE_AQC_NVM_ACTIV_SEL_NVM BIT(3) /* Write Activate/SR Dump only */ 1645 #define ICE_AQC_NVM_ACTIV_SEL_OROM BIT(4) 1646 #define ICE_AQC_NVM_ACTIV_SEL_NETLIST BIT(5) 1647 #define ICE_AQC_NVM_SPECIAL_UPDATE BIT(6) 1648 #define ICE_AQC_NVM_REVERT_LAST_ACTIV BIT(6) /* Write Activate only */ 1649 #define ICE_AQC_NVM_ACTIV_SEL_MASK ICE_M(0x7, 3) 1650 #define ICE_AQC_NVM_FLASH_ONLY BIT(7) 1651 #define ICE_AQC_NVM_RESET_LVL_M ICE_M(0x3, 0) /* Write reply only */ 1652 #define ICE_AQC_NVM_POR_FLAG 0 1653 #define ICE_AQC_NVM_PERST_FLAG 1 1654 #define ICE_AQC_NVM_EMPR_FLAG 2 1655 #define ICE_AQC_NVM_EMPR_ENA BIT(0) /* Write Activate reply only */ 1656 /* For Write Activate, several flags are sent as part of a separate 1657 * flags2 field using a separate byte. For simplicity of the software 1658 * interface, we pass the flags as a 16 bit value so these flags are 1659 * all offset by 8 bits 1660 */ 1661 #define ICE_AQC_NVM_ACTIV_REQ_EMPR BIT(8) /* NVM Write Activate only */ 1662 __le16 module_typeid; 1663 __le16 length; 1664 #define ICE_AQC_NVM_ERASE_LEN 0xFFFF 1665 __le32 addr_high; 1666 __le32 addr_low; 1667 }; 1668 1669 #define ICE_AQC_NVM_START_POINT 0 1670 #define ICE_AQC_NVM_SECTOR_UNIT 4096 1671 #define ICE_AQC_NVM_SDP_AC_PTR_OFFSET 0xD8 1672 #define ICE_AQC_NVM_SDP_AC_PTR_M GENMASK(14, 0) 1673 #define ICE_AQC_NVM_SDP_AC_PTR_INVAL 0x7FFF 1674 #define ICE_AQC_NVM_SDP_AC_PTR_TYPE_M BIT(15) 1675 #define ICE_AQC_NVM_SDP_AC_SDP_NUM_M GENMASK(2, 0) 1676 #define ICE_AQC_NVM_SDP_AC_DIR_M BIT(3) 1677 #define ICE_AQC_NVM_SDP_AC_PIN_M GENMASK(15, 6) 1678 #define ICE_AQC_NVM_SDP_AC_MAX_SIZE 7 1679 1680 #define ICE_AQC_NVM_TX_TOPO_MOD_ID 0x14B 1681 1682 struct ice_aqc_nvm_tx_topo_user_sel { 1683 __le16 length; 1684 u8 data; 1685 #define ICE_AQC_NVM_TX_TOPO_USER_SEL BIT(4) 1686 u8 reserved; 1687 }; 1688 1689 /* NVM Checksum Command (direct, 0x0706) */ 1690 struct ice_aqc_nvm_checksum { 1691 u8 flags; 1692 #define ICE_AQC_NVM_CHECKSUM_VERIFY BIT(0) 1693 #define ICE_AQC_NVM_CHECKSUM_RECALC BIT(1) 1694 u8 rsvd; 1695 __le16 checksum; /* Used only by response */ 1696 #define ICE_AQC_NVM_CHECKSUM_CORRECT 0xBABA 1697 u8 rsvd2[12]; 1698 }; 1699 1700 /* Used for NVM Set Package Data command - 0x070A */ 1701 struct ice_aqc_nvm_pkg_data { 1702 u8 reserved[3]; 1703 u8 cmd_flags; 1704 #define ICE_AQC_NVM_PKG_DELETE BIT(0) /* used for command call */ 1705 #define ICE_AQC_NVM_PKG_SKIPPED BIT(0) /* used for command response */ 1706 1707 u32 reserved1; 1708 __le32 addr_high; 1709 __le32 addr_low; 1710 }; 1711 1712 /* Used for Pass Component Table command - 0x070B */ 1713 struct ice_aqc_nvm_pass_comp_tbl { 1714 u8 component_response; /* Response only */ 1715 #define ICE_AQ_NVM_PASS_COMP_CAN_BE_UPDATED 0x0 1716 #define ICE_AQ_NVM_PASS_COMP_CAN_MAY_BE_UPDATEABLE 0x1 1717 #define ICE_AQ_NVM_PASS_COMP_CAN_NOT_BE_UPDATED 0x2 1718 #define ICE_AQ_NVM_PASS_COMP_PARTIAL_CHECK 0x3 1719 u8 component_response_code; /* Response only */ 1720 #define ICE_AQ_NVM_PASS_COMP_CAN_BE_UPDATED_CODE 0x0 1721 #define ICE_AQ_NVM_PASS_COMP_STAMP_IDENTICAL_CODE 0x1 1722 #define ICE_AQ_NVM_PASS_COMP_STAMP_LOWER 0x2 1723 #define ICE_AQ_NVM_PASS_COMP_INVALID_STAMP_CODE 0x3 1724 #define ICE_AQ_NVM_PASS_COMP_CONFLICT_CODE 0x4 1725 #define ICE_AQ_NVM_PASS_COMP_PRE_REQ_NOT_MET_CODE 0x5 1726 #define ICE_AQ_NVM_PASS_COMP_NOT_SUPPORTED_CODE 0x6 1727 #define ICE_AQ_NVM_PASS_COMP_CANNOT_DOWNGRADE_CODE 0x7 1728 #define ICE_AQ_NVM_PASS_COMP_INCOMPLETE_IMAGE_CODE 0x8 1729 #define ICE_AQ_NVM_PASS_COMP_VER_STR_IDENTICAL_CODE 0xA 1730 #define ICE_AQ_NVM_PASS_COMP_VER_STR_LOWER_CODE 0xB 1731 u8 reserved; 1732 u8 transfer_flag; 1733 #define ICE_AQ_NVM_PASS_COMP_TBL_START 0x1 1734 #define ICE_AQ_NVM_PASS_COMP_TBL_MIDDLE 0x2 1735 #define ICE_AQ_NVM_PASS_COMP_TBL_END 0x4 1736 #define ICE_AQ_NVM_PASS_COMP_TBL_START_AND_END 0x5 1737 __le32 reserved1; 1738 __le32 addr_high; 1739 __le32 addr_low; 1740 }; 1741 1742 struct ice_aqc_nvm_comp_tbl { 1743 __le16 comp_class; 1744 #define NVM_COMP_CLASS_ALL_FW 0x000A 1745 1746 __le16 comp_id; 1747 #define NVM_COMP_ID_OROM 0x5 1748 #define NVM_COMP_ID_NVM 0x6 1749 #define NVM_COMP_ID_NETLIST 0x8 1750 1751 u8 comp_class_idx; 1752 #define FWU_COMP_CLASS_IDX_NOT_USE 0x0 1753 1754 __le32 comp_cmp_stamp; 1755 u8 cvs_type; 1756 #define NVM_CVS_TYPE_ASCII 0x1 1757 1758 u8 cvs_len; 1759 u8 cvs[]; /* Component Version String */ 1760 } __packed; 1761 1762 /* Send to PF command (indirect 0x0801) ID is only used by PF 1763 * 1764 * Send to VF command (indirect 0x0802) ID is only used by PF 1765 * 1766 */ 1767 struct ice_aqc_pf_vf_msg { 1768 __le32 id; 1769 u32 reserved; 1770 __le32 addr_high; 1771 __le32 addr_low; 1772 }; 1773 1774 /* Get LLDP MIB (indirect 0x0A00) 1775 * Note: This is also used by the LLDP MIB Change Event (0x0A01) 1776 * as the format is the same. 1777 */ 1778 struct ice_aqc_lldp_get_mib { 1779 u8 type; 1780 #define ICE_AQ_LLDP_MIB_TYPE_S 0 1781 #define ICE_AQ_LLDP_MIB_TYPE_M (0x3 << ICE_AQ_LLDP_MIB_TYPE_S) 1782 #define ICE_AQ_LLDP_MIB_LOCAL 0 1783 #define ICE_AQ_LLDP_MIB_REMOTE 1 1784 #define ICE_AQ_LLDP_MIB_LOCAL_AND_REMOTE 2 1785 #define ICE_AQ_LLDP_BRID_TYPE_S 2 1786 #define ICE_AQ_LLDP_BRID_TYPE_M (0x3 << ICE_AQ_LLDP_BRID_TYPE_S) 1787 #define ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID 0 1788 #define ICE_AQ_LLDP_BRID_TYPE_NON_TPMR 1 1789 /* Tx pause flags in the 0xA01 event use ICE_AQ_LLDP_TX_* */ 1790 #define ICE_AQ_LLDP_TX_S 0x4 1791 #define ICE_AQ_LLDP_TX_M (0x03 << ICE_AQ_LLDP_TX_S) 1792 #define ICE_AQ_LLDP_TX_ACTIVE 0 1793 #define ICE_AQ_LLDP_TX_SUSPENDED 1 1794 #define ICE_AQ_LLDP_TX_FLUSHED 3 1795 /* DCBX mode */ 1796 #define ICE_AQ_LLDP_DCBX_M GENMASK(7, 6) 1797 #define ICE_AQ_LLDP_DCBX_NA 0 1798 #define ICE_AQ_LLDP_DCBX_CEE 1 1799 #define ICE_AQ_LLDP_DCBX_IEEE 2 1800 1801 u8 state; 1802 #define ICE_AQ_LLDP_MIB_CHANGE_STATE_M BIT(0) 1803 #define ICE_AQ_LLDP_MIB_CHANGE_EXECUTED 0 1804 #define ICE_AQ_LLDP_MIB_CHANGE_PENDING 1 1805 1806 /* The following bytes are reserved for the Get LLDP MIB command (0x0A00) 1807 * and in the LLDP MIB Change Event (0x0A01). They are valid for the 1808 * Get LLDP MIB (0x0A00) response only. 1809 */ 1810 __le16 local_len; 1811 __le16 remote_len; 1812 u8 reserved[2]; 1813 __le32 addr_high; 1814 __le32 addr_low; 1815 }; 1816 1817 /* Configure LLDP MIB Change Event (direct 0x0A01) */ 1818 /* For MIB Change Event use ice_aqc_lldp_get_mib structure above */ 1819 struct ice_aqc_lldp_set_mib_change { 1820 u8 command; 1821 #define ICE_AQ_LLDP_MIB_UPDATE_ENABLE 0x0 1822 #define ICE_AQ_LLDP_MIB_UPDATE_DIS 0x1 1823 #define ICE_AQ_LLDP_MIB_PENDING_M BIT(1) 1824 #define ICE_AQ_LLDP_MIB_PENDING_DISABLE 0 1825 #define ICE_AQ_LLDP_MIB_PENDING_ENABLE 1 1826 u8 reserved[15]; 1827 }; 1828 1829 /* Stop LLDP (direct 0x0A05) */ 1830 struct ice_aqc_lldp_stop { 1831 u8 command; 1832 #define ICE_AQ_LLDP_AGENT_STATE_MASK BIT(0) 1833 #define ICE_AQ_LLDP_AGENT_STOP 0x0 1834 #define ICE_AQ_LLDP_AGENT_SHUTDOWN ICE_AQ_LLDP_AGENT_STATE_MASK 1835 #define ICE_AQ_LLDP_AGENT_PERSIST_DIS BIT(1) 1836 u8 reserved[15]; 1837 }; 1838 1839 /* Start LLDP (direct 0x0A06) */ 1840 struct ice_aqc_lldp_start { 1841 u8 command; 1842 #define ICE_AQ_LLDP_AGENT_START BIT(0) 1843 #define ICE_AQ_LLDP_AGENT_PERSIST_ENA BIT(1) 1844 u8 reserved[15]; 1845 }; 1846 1847 /* Get CEE DCBX Oper Config (0x0A07) 1848 * The command uses the generic descriptor struct and 1849 * returns the struct below as an indirect response. 1850 */ 1851 struct ice_aqc_get_cee_dcb_cfg_resp { 1852 u8 oper_num_tc; 1853 u8 oper_prio_tc[4]; 1854 u8 oper_tc_bw[8]; 1855 u8 oper_pfc_en; 1856 __le16 oper_app_prio; 1857 #define ICE_AQC_CEE_APP_FCOE_S 0 1858 #define ICE_AQC_CEE_APP_FCOE_M (0x7 << ICE_AQC_CEE_APP_FCOE_S) 1859 #define ICE_AQC_CEE_APP_ISCSI_S 3 1860 #define ICE_AQC_CEE_APP_ISCSI_M (0x7 << ICE_AQC_CEE_APP_ISCSI_S) 1861 #define ICE_AQC_CEE_APP_FIP_S 8 1862 #define ICE_AQC_CEE_APP_FIP_M (0x7 << ICE_AQC_CEE_APP_FIP_S) 1863 __le32 tlv_status; 1864 #define ICE_AQC_CEE_PG_STATUS_S 0 1865 #define ICE_AQC_CEE_PG_STATUS_M (0x7 << ICE_AQC_CEE_PG_STATUS_S) 1866 #define ICE_AQC_CEE_PFC_STATUS_S 3 1867 #define ICE_AQC_CEE_PFC_STATUS_M (0x7 << ICE_AQC_CEE_PFC_STATUS_S) 1868 #define ICE_AQC_CEE_FCOE_STATUS_S 8 1869 #define ICE_AQC_CEE_FCOE_STATUS_M (0x7 << ICE_AQC_CEE_FCOE_STATUS_S) 1870 #define ICE_AQC_CEE_ISCSI_STATUS_S 11 1871 #define ICE_AQC_CEE_ISCSI_STATUS_M (0x7 << ICE_AQC_CEE_ISCSI_STATUS_S) 1872 #define ICE_AQC_CEE_FIP_STATUS_S 16 1873 #define ICE_AQC_CEE_FIP_STATUS_M (0x7 << ICE_AQC_CEE_FIP_STATUS_S) 1874 u8 reserved[12]; 1875 }; 1876 1877 /* Set Local LLDP MIB (indirect 0x0A08) 1878 * Used to replace the local MIB of a given LLDP agent. e.g. DCBX 1879 */ 1880 struct ice_aqc_lldp_set_local_mib { 1881 u8 type; 1882 #define SET_LOCAL_MIB_TYPE_DCBX_M BIT(0) 1883 #define SET_LOCAL_MIB_TYPE_LOCAL_MIB 0 1884 #define SET_LOCAL_MIB_TYPE_CEE_M BIT(1) 1885 #define SET_LOCAL_MIB_TYPE_CEE_WILLING 0 1886 #define SET_LOCAL_MIB_TYPE_CEE_NON_WILLING SET_LOCAL_MIB_TYPE_CEE_M 1887 u8 reserved0; 1888 __le16 length; 1889 u8 reserved1[4]; 1890 __le32 addr_high; 1891 __le32 addr_low; 1892 }; 1893 1894 /* Stop/Start LLDP Agent (direct 0x0A09) 1895 * Used for stopping/starting specific LLDP agent. e.g. DCBX. 1896 * The same structure is used for the response, with the command field 1897 * being used as the status field. 1898 */ 1899 struct ice_aqc_lldp_stop_start_specific_agent { 1900 u8 command; 1901 #define ICE_AQC_START_STOP_AGENT_M BIT(0) 1902 #define ICE_AQC_START_STOP_AGENT_STOP_DCBX 0 1903 #define ICE_AQC_START_STOP_AGENT_START_DCBX ICE_AQC_START_STOP_AGENT_M 1904 u8 reserved[15]; 1905 }; 1906 1907 /* LLDP Filter Control (direct 0x0A0A) */ 1908 struct ice_aqc_lldp_filter_ctrl { 1909 u8 cmd_flags; 1910 #define ICE_AQC_LLDP_FILTER_ACTION_ADD 0x0 1911 #define ICE_AQC_LLDP_FILTER_ACTION_DELETE 0x1 1912 u8 reserved1; 1913 __le16 vsi_num; 1914 u8 reserved2[12]; 1915 }; 1916 1917 #define ICE_AQC_RSS_VSI_VALID BIT(15) 1918 1919 /* Get/Set RSS key (indirect 0x0B04/0x0B02) */ 1920 struct ice_aqc_get_set_rss_key { 1921 __le16 vsi_id; 1922 u8 reserved[6]; 1923 __le32 addr_high; 1924 __le32 addr_low; 1925 }; 1926 1927 #define ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE 0x28 1928 #define ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE 0xC 1929 #define ICE_GET_SET_RSS_KEY_EXTEND_KEY_SIZE \ 1930 (ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE + \ 1931 ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE) 1932 1933 struct ice_aqc_get_set_rss_keys { 1934 u8 standard_rss_key[ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE]; 1935 u8 extended_hash_key[ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE]; 1936 }; 1937 1938 enum ice_lut_type { 1939 ICE_LUT_VSI = 0, 1940 ICE_LUT_PF = 1, 1941 ICE_LUT_GLOBAL = 2, 1942 }; 1943 1944 enum ice_lut_size { 1945 ICE_LUT_VSI_SIZE = 64, 1946 ICE_LUT_GLOBAL_SIZE = 512, 1947 ICE_LUT_PF_SIZE = 2048, 1948 }; 1949 1950 /* enum ice_aqc_lut_flags combines constants used to fill 1951 * &ice_aqc_get_set_rss_lut ::flags, which is an amalgamation of global LUT ID, 1952 * LUT size and LUT type, last of which does not need neither shift nor mask. 1953 */ 1954 enum ice_aqc_lut_flags { 1955 ICE_AQC_LUT_SIZE_SMALL = 0, /* size = 64 or 128 */ 1956 ICE_AQC_LUT_SIZE_512 = BIT(2), 1957 ICE_AQC_LUT_SIZE_2K = BIT(3), 1958 1959 ICE_AQC_LUT_GLOBAL_IDX = GENMASK(7, 4), 1960 }; 1961 1962 /* Get/Set RSS LUT (indirect 0x0B05/0x0B03) */ 1963 struct ice_aqc_get_set_rss_lut { 1964 __le16 vsi_id; 1965 __le16 flags; 1966 __le32 reserved; 1967 __le32 addr_high; 1968 __le32 addr_low; 1969 }; 1970 1971 /* Sideband Control Interface Commands */ 1972 /* Neighbor Device Request (indirect 0x0C00); also used for the response. */ 1973 struct ice_aqc_neigh_dev_req { 1974 __le16 sb_data_len; 1975 u8 reserved[6]; 1976 __le32 addr_high; 1977 __le32 addr_low; 1978 }; 1979 1980 /* Add Tx LAN Queues (indirect 0x0C30) */ 1981 struct ice_aqc_add_txqs { 1982 u8 num_qgrps; 1983 u8 reserved[3]; 1984 __le32 reserved1; 1985 __le32 addr_high; 1986 __le32 addr_low; 1987 }; 1988 1989 /* This is the descriptor of each queue entry for the Add Tx LAN Queues 1990 * command (0x0C30). Only used within struct ice_aqc_add_tx_qgrp. 1991 */ 1992 struct ice_aqc_add_txqs_perq { 1993 __le16 txq_id; 1994 u8 rsvd[2]; 1995 __le32 q_teid; 1996 ice_txq_ctx_buf_t txq_ctx; 1997 u8 rsvd2[2]; 1998 struct ice_aqc_txsched_elem info; 1999 } __packed; 2000 2001 /* The format of the command buffer for Add Tx LAN Queues (0x0C30) 2002 * is an array of the following structs. Please note that the length of 2003 * each struct ice_aqc_add_tx_qgrp is variable due 2004 * to the variable number of queues in each group! 2005 */ 2006 struct ice_aqc_add_tx_qgrp { 2007 __le32 parent_teid; 2008 u8 num_txqs; 2009 u8 rsvd[3]; 2010 struct ice_aqc_add_txqs_perq txqs[]; 2011 }; 2012 2013 /* Disable Tx LAN Queues (indirect 0x0C31) */ 2014 struct ice_aqc_dis_txqs { 2015 u8 cmd_type; 2016 #define ICE_AQC_Q_DIS_CMD_S 0 2017 #define ICE_AQC_Q_DIS_CMD_M (0x3 << ICE_AQC_Q_DIS_CMD_S) 2018 #define ICE_AQC_Q_DIS_CMD_NO_FUNC_RESET (0 << ICE_AQC_Q_DIS_CMD_S) 2019 #define ICE_AQC_Q_DIS_CMD_VM_RESET BIT(ICE_AQC_Q_DIS_CMD_S) 2020 #define ICE_AQC_Q_DIS_CMD_VF_RESET (2 << ICE_AQC_Q_DIS_CMD_S) 2021 #define ICE_AQC_Q_DIS_CMD_PF_RESET (3 << ICE_AQC_Q_DIS_CMD_S) 2022 #define ICE_AQC_Q_DIS_CMD_SUBSEQ_CALL BIT(2) 2023 #define ICE_AQC_Q_DIS_CMD_FLUSH_PIPE BIT(3) 2024 u8 num_entries; 2025 __le16 vmvf_and_timeout; 2026 #define ICE_AQC_Q_DIS_VMVF_NUM_S 0 2027 #define ICE_AQC_Q_DIS_VMVF_NUM_M (0x3FF << ICE_AQC_Q_DIS_VMVF_NUM_S) 2028 #define ICE_AQC_Q_DIS_TIMEOUT_S 10 2029 #define ICE_AQC_Q_DIS_TIMEOUT_M (0x3F << ICE_AQC_Q_DIS_TIMEOUT_S) 2030 __le32 blocked_cgds; 2031 __le32 addr_high; 2032 __le32 addr_low; 2033 }; 2034 2035 /* The buffer for Disable Tx LAN Queues (indirect 0x0C31) 2036 * contains the following structures, arrayed one after the 2037 * other. 2038 * Note: Since the q_id is 16 bits wide, if the 2039 * number of queues is even, then 2 bytes of alignment MUST be 2040 * added before the start of the next group, to allow correct 2041 * alignment of the parent_teid field. 2042 */ 2043 struct ice_aqc_dis_txq_item { 2044 __le32 parent_teid; 2045 u8 num_qs; 2046 u8 rsvd; 2047 /* The length of the q_id array varies according to num_qs */ 2048 #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S 15 2049 #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_LAN_Q \ 2050 (0 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S) 2051 #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_RDMA_QSET \ 2052 (1 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S) 2053 __le16 q_id[]; 2054 } __packed; 2055 2056 /* Move/Reconfigure Tx queue (indirect 0x0C32) */ 2057 struct ice_aqc_cfg_txqs { 2058 u8 cmd_type; 2059 #define ICE_AQC_Q_CFG_MOVE_NODE 0x1 2060 #define ICE_AQC_Q_CFG_TC_CHNG 0x2 2061 #define ICE_AQC_Q_CFG_MOVE_TC_CHNG 0x3 2062 #define ICE_AQC_Q_CFG_SUBSEQ_CALL BIT(2) 2063 #define ICE_AQC_Q_CFG_FLUSH BIT(3) 2064 u8 num_qs; 2065 u8 port_num_chng; 2066 #define ICE_AQC_Q_CFG_SRC_PRT_M 0x7 2067 #define ICE_AQC_Q_CFG_DST_PRT_S 3 2068 #define ICE_AQC_Q_CFG_DST_PRT_M (0x7 << ICE_AQC_Q_CFG_DST_PRT_S) 2069 #define ICE_AQC_Q_CFG_MODE_M GENMASK(7, 6) 2070 #define ICE_AQC_Q_CFG_MODE_SAME_PF 0x0 2071 #define ICE_AQC_Q_CFG_MODE_GIVE_OWN 0x1 2072 #define ICE_AQC_Q_CFG_MODE_KEEP_OWN 0x2 2073 u8 time_out; 2074 #define ICE_AQC_Q_CFG_TIMEOUT_S 2 2075 #define ICE_AQC_Q_CFG_TIMEOUT_M (0x1F << ICE_AQC_Q_CFG_TIMEOUT_S) 2076 __le32 blocked_cgds; 2077 __le32 addr_high; 2078 __le32 addr_low; 2079 }; 2080 2081 /* Per Q struct for Move/Reconfigure Tx LAN Queues (indirect 0x0C32) */ 2082 struct ice_aqc_cfg_txq_perq { 2083 __le16 q_handle; 2084 u8 tc; 2085 u8 rsvd; 2086 __le32 q_teid; 2087 }; 2088 2089 /* The buffer for Move/Reconfigure Tx LAN Queues (indirect 0x0C32) */ 2090 struct ice_aqc_cfg_txqs_buf { 2091 __le32 src_parent_teid; 2092 __le32 dst_parent_teid; 2093 struct ice_aqc_cfg_txq_perq queue_info[]; 2094 }; 2095 2096 /* Add Tx RDMA Queue Set (indirect 0x0C33) */ 2097 struct ice_aqc_add_rdma_qset { 2098 u8 num_qset_grps; 2099 u8 reserved[7]; 2100 __le32 addr_high; 2101 __le32 addr_low; 2102 }; 2103 2104 /* This is the descriptor of each Qset entry for the Add Tx RDMA Queue Set 2105 * command (0x0C33). Only used within struct ice_aqc_add_rdma_qset. 2106 */ 2107 struct ice_aqc_add_tx_rdma_qset_entry { 2108 __le16 tx_qset_id; 2109 u8 rsvd[2]; 2110 __le32 qset_teid; 2111 struct ice_aqc_txsched_elem info; 2112 }; 2113 2114 /* The format of the command buffer for Add Tx RDMA Queue Set(0x0C33) 2115 * is an array of the following structs. Please note that the length of 2116 * each struct ice_aqc_add_rdma_qset is variable due to the variable 2117 * number of queues in each group! 2118 */ 2119 struct ice_aqc_add_rdma_qset_data { 2120 __le32 parent_teid; 2121 __le16 num_qsets; 2122 u8 rsvd[2]; 2123 struct ice_aqc_add_tx_rdma_qset_entry rdma_qsets[]; 2124 }; 2125 2126 /* Set Tx Time LAN Queue (indirect 0x0C35) */ 2127 struct ice_aqc_set_txtimeqs { 2128 __le16 q_id; 2129 __le16 q_amount; 2130 u8 reserved[4]; 2131 __le32 addr_high; 2132 __le32 addr_low; 2133 }; 2134 2135 /* This is the descriptor of each queue entry for the Set Tx Time Queue 2136 * command (0x0C35). Only used within struct ice_aqc_set_txtime_qgrp. 2137 */ 2138 struct ice_aqc_set_txtimeqs_perq { 2139 u8 reserved[4]; 2140 ice_txtime_ctx_buf_t txtime_ctx; 2141 u8 reserved1[3]; 2142 }; 2143 2144 /* The format of the command buffer for Set Tx Time Queue (0x0C35) 2145 * is an array of the following structs. Please note that the length of 2146 * each struct ice_aqc_set_txtime_qgrp is variable due to the variable 2147 * number of queues in each group! 2148 */ 2149 struct ice_aqc_set_txtime_qgrp { 2150 u8 reserved[8]; 2151 struct ice_aqc_set_txtimeqs_perq txtimeqs[]; 2152 }; 2153 2154 /* Download Package (indirect 0x0C40) */ 2155 /* Also used for Update Package (indirect 0x0C41 and 0x0C42) */ 2156 struct ice_aqc_download_pkg { 2157 u8 flags; 2158 #define ICE_AQC_DOWNLOAD_PKG_LAST_BUF 0x01 2159 u8 reserved[3]; 2160 __le32 reserved1; 2161 __le32 addr_high; 2162 __le32 addr_low; 2163 }; 2164 2165 struct ice_aqc_download_pkg_resp { 2166 __le32 error_offset; 2167 __le32 error_info; 2168 __le32 addr_high; 2169 __le32 addr_low; 2170 }; 2171 2172 /* Get Package Info List (indirect 0x0C43) */ 2173 struct ice_aqc_get_pkg_info_list { 2174 __le32 reserved1; 2175 __le32 reserved2; 2176 __le32 addr_high; 2177 __le32 addr_low; 2178 }; 2179 2180 /* Version format for packages */ 2181 struct ice_pkg_ver { 2182 u8 major; 2183 u8 minor; 2184 u8 update; 2185 u8 draft; 2186 }; 2187 2188 #define ICE_PKG_NAME_SIZE 32 2189 #define ICE_SEG_ID_SIZE 28 2190 #define ICE_SEG_NAME_SIZE 28 2191 2192 struct ice_aqc_get_pkg_info { 2193 struct ice_pkg_ver ver; 2194 char name[ICE_SEG_NAME_SIZE]; 2195 __le32 track_id; 2196 u8 is_in_nvm; 2197 u8 is_active; 2198 u8 is_active_at_boot; 2199 u8 is_modified; 2200 }; 2201 2202 /* Get Package Info List response buffer format (0x0C43) */ 2203 struct ice_aqc_get_pkg_info_resp { 2204 __le32 count; 2205 struct ice_aqc_get_pkg_info pkg_info[]; 2206 }; 2207 2208 #define ICE_CGU_INPUT_PHASE_OFFSET_BYTES 6 2209 2210 struct ice_cgu_input_measure { 2211 u8 phase_offset[ICE_CGU_INPUT_PHASE_OFFSET_BYTES]; 2212 __le32 freq; 2213 } __packed __aligned(sizeof(__le16)); 2214 2215 #define ICE_AQC_GET_CGU_IN_MEAS_DPLL_IDX_M ICE_M(0xf, 0) 2216 2217 /* Get CGU input measure command response data structure (indirect 0x0C59) */ 2218 struct ice_aqc_get_cgu_input_measure { 2219 u8 dpll_idx_opt; 2220 u8 length; 2221 u8 rsvd[6]; 2222 }; 2223 2224 #define ICE_AQC_GET_CGU_MAX_PHASE_ADJ GENMASK(30, 0) 2225 2226 /* Get CGU abilities command response data structure (indirect 0x0C61) */ 2227 struct ice_aqc_get_cgu_abilities { 2228 u8 num_inputs; 2229 u8 num_outputs; 2230 u8 pps_dpll_idx; 2231 u8 eec_dpll_idx; 2232 __le32 max_in_freq; 2233 __le32 max_in_phase_adj; 2234 __le32 max_out_freq; 2235 __le32 max_out_phase_adj; 2236 u8 cgu_part_num; 2237 u8 rsvd[3]; 2238 }; 2239 2240 #define ICE_AQC_CGU_IN_CFG_FLG2_REFSYNC_EN BIT(7) 2241 2242 /* Set CGU input config (direct 0x0C62) */ 2243 struct ice_aqc_set_cgu_input_config { 2244 u8 input_idx; 2245 u8 flags1; 2246 #define ICE_AQC_SET_CGU_IN_CFG_FLG1_UPDATE_FREQ BIT(6) 2247 #define ICE_AQC_SET_CGU_IN_CFG_FLG1_UPDATE_DELAY BIT(7) 2248 u8 flags2; 2249 #define ICE_AQC_SET_CGU_IN_CFG_FLG2_INPUT_EN BIT(5) 2250 #define ICE_AQC_SET_CGU_IN_CFG_FLG2_ESYNC_EN BIT(6) 2251 u8 rsvd; 2252 __le32 freq; 2253 __le32 phase_delay; 2254 u8 rsvd2[2]; 2255 __le16 node_handle; 2256 }; 2257 2258 /* Get CGU input config response descriptor structure (direct 0x0C63) */ 2259 struct ice_aqc_get_cgu_input_config { 2260 u8 input_idx; 2261 u8 status; 2262 #define ICE_AQC_GET_CGU_IN_CFG_STATUS_LOS BIT(0) 2263 #define ICE_AQC_GET_CGU_IN_CFG_STATUS_SCM_FAIL BIT(1) 2264 #define ICE_AQC_GET_CGU_IN_CFG_STATUS_CFM_FAIL BIT(2) 2265 #define ICE_AQC_GET_CGU_IN_CFG_STATUS_GST_FAIL BIT(3) 2266 #define ICE_AQC_GET_CGU_IN_CFG_STATUS_PFM_FAIL BIT(4) 2267 #define ICE_AQC_GET_CGU_IN_CFG_STATUS_ESYNC_FAIL BIT(6) 2268 #define ICE_AQC_GET_CGU_IN_CFG_STATUS_ESYNC_CAP BIT(7) 2269 u8 type; 2270 #define ICE_AQC_GET_CGU_IN_CFG_TYPE_READ_ONLY BIT(0) 2271 #define ICE_AQC_GET_CGU_IN_CFG_TYPE_GPS BIT(4) 2272 #define ICE_AQC_GET_CGU_IN_CFG_TYPE_EXTERNAL BIT(5) 2273 #define ICE_AQC_GET_CGU_IN_CFG_TYPE_PHY BIT(6) 2274 u8 flags1; 2275 #define ICE_AQC_GET_CGU_IN_CFG_FLG1_PHASE_DELAY_SUPP BIT(0) 2276 #define ICE_AQC_GET_CGU_IN_CFG_FLG1_1PPS_SUPP BIT(2) 2277 #define ICE_AQC_GET_CGU_IN_CFG_FLG1_10MHZ_SUPP BIT(3) 2278 #define ICE_AQC_GET_CGU_IN_CFG_FLG1_ANYFREQ BIT(7) 2279 __le32 freq; 2280 __le32 phase_delay; 2281 u8 flags2; 2282 #define ICE_AQC_GET_CGU_IN_CFG_FLG2_INPUT_EN BIT(5) 2283 #define ICE_AQC_GET_CGU_IN_CFG_FLG2_ESYNC_EN BIT(6) 2284 u8 rsvd[1]; 2285 __le16 node_handle; 2286 }; 2287 2288 /* Set CGU output config (direct 0x0C64) */ 2289 struct ice_aqc_set_cgu_output_config { 2290 u8 output_idx; 2291 u8 flags; 2292 #define ICE_AQC_SET_CGU_OUT_CFG_OUT_EN BIT(0) 2293 #define ICE_AQC_SET_CGU_OUT_CFG_ESYNC_EN BIT(1) 2294 #define ICE_AQC_SET_CGU_OUT_CFG_UPDATE_FREQ BIT(2) 2295 #define ICE_AQC_SET_CGU_OUT_CFG_UPDATE_PHASE BIT(3) 2296 #define ICE_AQC_SET_CGU_OUT_CFG_UPDATE_SRC_SEL BIT(4) 2297 u8 src_sel; 2298 #define ICE_AQC_SET_CGU_OUT_CFG_DPLL_SRC_SEL ICE_M(0x1F, 0) 2299 u8 rsvd; 2300 __le32 freq; 2301 __le32 phase_delay; 2302 u8 rsvd2[2]; 2303 __le16 node_handle; 2304 }; 2305 2306 /* Get CGU output config (direct 0x0C65) */ 2307 struct ice_aqc_get_cgu_output_config { 2308 u8 output_idx; 2309 u8 flags; 2310 #define ICE_AQC_GET_CGU_OUT_CFG_OUT_EN BIT(0) 2311 #define ICE_AQC_GET_CGU_OUT_CFG_ESYNC_EN BIT(1) 2312 #define ICE_AQC_GET_CGU_OUT_CFG_ESYNC_ABILITY BIT(2) 2313 u8 src_sel; 2314 #define ICE_AQC_GET_CGU_OUT_CFG_DPLL_SRC_SEL_SHIFT 0 2315 #define ICE_AQC_GET_CGU_OUT_CFG_DPLL_SRC_SEL \ 2316 ICE_M(0x1F, ICE_AQC_GET_CGU_OUT_CFG_DPLL_SRC_SEL_SHIFT) 2317 #define ICE_AQC_GET_CGU_OUT_CFG_DPLL_MODE_SHIFT 5 2318 #define ICE_AQC_GET_CGU_OUT_CFG_DPLL_MODE \ 2319 ICE_M(0x7, ICE_AQC_GET_CGU_OUT_CFG_DPLL_MODE_SHIFT) 2320 u8 rsvd; 2321 __le32 freq; 2322 __le32 src_freq; 2323 u8 rsvd2[2]; 2324 __le16 node_handle; 2325 }; 2326 2327 /* Get CGU DPLL status (direct 0x0C66) */ 2328 struct ice_aqc_get_cgu_dpll_status { 2329 u8 dpll_num; 2330 u8 ref_state; 2331 #define ICE_AQC_GET_CGU_DPLL_STATUS_REF_SW_LOS BIT(0) 2332 #define ICE_AQC_GET_CGU_DPLL_STATUS_REF_SW_SCM BIT(1) 2333 #define ICE_AQC_GET_CGU_DPLL_STATUS_REF_SW_CFM BIT(2) 2334 #define ICE_AQC_GET_CGU_DPLL_STATUS_REF_SW_GST BIT(3) 2335 #define ICE_AQC_GET_CGU_DPLL_STATUS_REF_SW_PFM BIT(4) 2336 #define ICE_AQC_GET_CGU_DPLL_STATUS_FAST_LOCK_EN BIT(5) 2337 #define ICE_AQC_GET_CGU_DPLL_STATUS_REF_SW_ESYNC BIT(6) 2338 u8 dpll_state; 2339 #define ICE_AQC_GET_CGU_DPLL_STATUS_STATE_LOCK BIT(0) 2340 #define ICE_AQC_GET_CGU_DPLL_STATUS_STATE_HO BIT(1) 2341 #define ICE_AQC_GET_CGU_DPLL_STATUS_STATE_HO_READY BIT(2) 2342 #define ICE_AQC_GET_CGU_DPLL_STATUS_STATE_FLHIT BIT(5) 2343 #define ICE_AQC_GET_CGU_DPLL_STATUS_STATE_PSLHIT BIT(7) 2344 u8 config; 2345 #define ICE_AQC_GET_CGU_DPLL_CONFIG_CLK_REF_SEL ICE_M(0x1F, 0) 2346 #define ICE_AQC_GET_CGU_DPLL_CONFIG_MODE_SHIFT 5 2347 #define ICE_AQC_GET_CGU_DPLL_CONFIG_MODE \ 2348 ICE_M(0x7, ICE_AQC_GET_CGU_DPLL_CONFIG_MODE_SHIFT) 2349 #define ICE_AQC_GET_CGU_DPLL_CONFIG_MODE_FREERUN 0 2350 #define ICE_AQC_GET_CGU_DPLL_CONFIG_MODE_AUTOMATIC \ 2351 ICE_M(0x3, ICE_AQC_GET_CGU_DPLL_CONFIG_MODE_SHIFT) 2352 __le32 phase_offset_h; 2353 __le32 phase_offset_l; 2354 u8 eec_mode; 2355 #define ICE_AQC_GET_CGU_DPLL_STATUS_EEC_MODE_1 0xA 2356 #define ICE_AQC_GET_CGU_DPLL_STATUS_EEC_MODE_2 0xB 2357 #define ICE_AQC_GET_CGU_DPLL_STATUS_EEC_MODE_UNKNOWN 0xF 2358 u8 rsvd[1]; 2359 __le16 node_handle; 2360 }; 2361 2362 /* Set CGU DPLL config (direct 0x0C67) */ 2363 struct ice_aqc_set_cgu_dpll_config { 2364 u8 dpll_num; 2365 u8 ref_state; 2366 #define ICE_AQC_SET_CGU_DPLL_CONFIG_REF_SW_LOS BIT(0) 2367 #define ICE_AQC_SET_CGU_DPLL_CONFIG_REF_SW_SCM BIT(1) 2368 #define ICE_AQC_SET_CGU_DPLL_CONFIG_REF_SW_CFM BIT(2) 2369 #define ICE_AQC_SET_CGU_DPLL_CONFIG_REF_SW_GST BIT(3) 2370 #define ICE_AQC_SET_CGU_DPLL_CONFIG_REF_SW_PFM BIT(4) 2371 #define ICE_AQC_SET_CGU_DPLL_CONFIG_REF_FLOCK_EN BIT(5) 2372 #define ICE_AQC_SET_CGU_DPLL_CONFIG_REF_SW_ESYNC BIT(6) 2373 u8 rsvd; 2374 u8 config; 2375 #define ICE_AQC_SET_CGU_DPLL_CONFIG_CLK_REF_SEL ICE_M(0x1F, 0) 2376 #define ICE_AQC_SET_CGU_DPLL_CONFIG_MODE_SHIFT 5 2377 #define ICE_AQC_SET_CGU_DPLL_CONFIG_MODE \ 2378 ICE_M(0x7, ICE_AQC_SET_CGU_DPLL_CONFIG_MODE_SHIFT) 2379 #define ICE_AQC_SET_CGU_DPLL_CONFIG_MODE_FREERUN 0 2380 #define ICE_AQC_SET_CGU_DPLL_CONFIG_MODE_AUTOMATIC \ 2381 ICE_M(0x3, ICE_AQC_SET_CGU_DPLL_CONFIG_MODE_SHIFT) 2382 u8 rsvd2[8]; 2383 u8 eec_mode; 2384 u8 rsvd3[1]; 2385 __le16 node_handle; 2386 }; 2387 2388 /* Set CGU reference priority (direct 0x0C68) */ 2389 struct ice_aqc_set_cgu_ref_prio { 2390 u8 dpll_num; 2391 u8 ref_idx; 2392 u8 ref_priority; 2393 u8 rsvd[11]; 2394 __le16 node_handle; 2395 }; 2396 2397 /* Get CGU reference priority (direct 0x0C69) */ 2398 struct ice_aqc_get_cgu_ref_prio { 2399 u8 dpll_num; 2400 u8 ref_idx; 2401 u8 ref_priority; /* Valid only in response */ 2402 u8 rsvd[13]; 2403 }; 2404 2405 /* Get CGU info (direct 0x0C6A) */ 2406 struct ice_aqc_get_cgu_info { 2407 __le32 cgu_id; 2408 __le32 cgu_cfg_ver; 2409 __le32 cgu_fw_ver; 2410 u8 node_part_num; 2411 u8 dev_rev; 2412 __le16 node_handle; 2413 }; 2414 2415 /* Driver Shared Parameters (direct, 0x0C90) */ 2416 struct ice_aqc_driver_shared_params { 2417 u8 set_or_get_op; 2418 #define ICE_AQC_DRIVER_PARAM_OP_MASK BIT(0) 2419 #define ICE_AQC_DRIVER_PARAM_SET 0 2420 #define ICE_AQC_DRIVER_PARAM_GET 1 2421 u8 param_indx; 2422 #define ICE_AQC_DRIVER_PARAM_MAX_IDX 15 2423 u8 rsvd[2]; 2424 __le32 param_val; 2425 __le32 addr_high; 2426 __le32 addr_low; 2427 }; 2428 2429 /* Lan Queue Overflow Event (direct, 0x1001) */ 2430 struct ice_aqc_event_lan_overflow { 2431 __le32 prtdcb_ruptq; 2432 __le32 qtx_ctl; 2433 u8 reserved[8]; 2434 }; 2435 2436 enum ice_aqc_health_status_mask { 2437 ICE_AQC_HEALTH_STATUS_SET_PF_SPECIFIC_MASK = BIT(0), 2438 ICE_AQC_HEALTH_STATUS_SET_ALL_PF_MASK = BIT(1), 2439 ICE_AQC_HEALTH_STATUS_SET_GLOBAL_MASK = BIT(2), 2440 }; 2441 2442 /* Set Health Status (direct 0xFF20) */ 2443 struct ice_aqc_set_health_status_cfg { 2444 u8 event_source; 2445 u8 reserved[15]; 2446 }; 2447 2448 enum ice_aqc_health_status { 2449 ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_STRICT = 0x101, 2450 ICE_AQC_HEALTH_STATUS_ERR_MOD_TYPE = 0x102, 2451 ICE_AQC_HEALTH_STATUS_ERR_MOD_QUAL = 0x103, 2452 ICE_AQC_HEALTH_STATUS_ERR_MOD_COMM = 0x104, 2453 ICE_AQC_HEALTH_STATUS_ERR_MOD_CONFLICT = 0x105, 2454 ICE_AQC_HEALTH_STATUS_ERR_MOD_NOT_PRESENT = 0x106, 2455 ICE_AQC_HEALTH_STATUS_INFO_MOD_UNDERUTILIZED = 0x107, 2456 ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_LENIENT = 0x108, 2457 ICE_AQC_HEALTH_STATUS_ERR_MOD_DIAGNOSTIC_FEATURE = 0x109, 2458 ICE_AQC_HEALTH_STATUS_ERR_INVALID_LINK_CFG = 0x10B, 2459 ICE_AQC_HEALTH_STATUS_ERR_PORT_ACCESS = 0x10C, 2460 ICE_AQC_HEALTH_STATUS_ERR_PORT_UNREACHABLE = 0x10D, 2461 ICE_AQC_HEALTH_STATUS_INFO_PORT_SPEED_MOD_LIMITED = 0x10F, 2462 ICE_AQC_HEALTH_STATUS_ERR_PARALLEL_FAULT = 0x110, 2463 ICE_AQC_HEALTH_STATUS_INFO_PORT_SPEED_PHY_LIMITED = 0x111, 2464 ICE_AQC_HEALTH_STATUS_ERR_NETLIST_TOPO = 0x112, 2465 ICE_AQC_HEALTH_STATUS_ERR_NETLIST = 0x113, 2466 ICE_AQC_HEALTH_STATUS_ERR_TOPO_CONFLICT = 0x114, 2467 ICE_AQC_HEALTH_STATUS_ERR_LINK_HW_ACCESS = 0x115, 2468 ICE_AQC_HEALTH_STATUS_ERR_LINK_RUNTIME = 0x116, 2469 ICE_AQC_HEALTH_STATUS_ERR_DNL_INIT = 0x117, 2470 ICE_AQC_HEALTH_STATUS_ERR_PHY_NVM_PROG = 0x120, 2471 ICE_AQC_HEALTH_STATUS_ERR_PHY_FW_LOAD = 0x121, 2472 ICE_AQC_HEALTH_STATUS_INFO_RECOVERY = 0x500, 2473 ICE_AQC_HEALTH_STATUS_ERR_FLASH_ACCESS = 0x501, 2474 ICE_AQC_HEALTH_STATUS_ERR_NVM_AUTH = 0x502, 2475 ICE_AQC_HEALTH_STATUS_ERR_OROM_AUTH = 0x503, 2476 ICE_AQC_HEALTH_STATUS_ERR_DDP_AUTH = 0x504, 2477 ICE_AQC_HEALTH_STATUS_ERR_NVM_COMPAT = 0x505, 2478 ICE_AQC_HEALTH_STATUS_ERR_OROM_COMPAT = 0x506, 2479 ICE_AQC_HEALTH_STATUS_ERR_NVM_SEC_VIOLATION = 0x507, 2480 ICE_AQC_HEALTH_STATUS_ERR_OROM_SEC_VIOLATION = 0x508, 2481 ICE_AQC_HEALTH_STATUS_ERR_DCB_MIB = 0x509, 2482 ICE_AQC_HEALTH_STATUS_ERR_MNG_TIMEOUT = 0x50A, 2483 ICE_AQC_HEALTH_STATUS_ERR_BMC_RESET = 0x50B, 2484 ICE_AQC_HEALTH_STATUS_ERR_LAST_MNG_FAIL = 0x50C, 2485 ICE_AQC_HEALTH_STATUS_ERR_RESOURCE_ALLOC_FAIL = 0x50D, 2486 ICE_AQC_HEALTH_STATUS_ERR_FW_LOOP = 0x1000, 2487 ICE_AQC_HEALTH_STATUS_ERR_FW_PFR_FAIL = 0x1001, 2488 ICE_AQC_HEALTH_STATUS_ERR_LAST_FAIL_AQ = 0x1002, 2489 }; 2490 2491 /* Get Health Status (indirect 0xFF22) */ 2492 struct ice_aqc_get_health_status { 2493 __le16 health_status_count; 2494 u8 reserved[6]; 2495 __le32 addr_high; 2496 __le32 addr_low; 2497 }; 2498 2499 enum ice_aqc_health_status_scope { 2500 ICE_AQC_HEALTH_STATUS_PF = 0x1, 2501 ICE_AQC_HEALTH_STATUS_PORT = 0x2, 2502 ICE_AQC_HEALTH_STATUS_GLOBAL = 0x3, 2503 }; 2504 2505 #define ICE_AQC_HEALTH_STATUS_UNDEFINED_DATA 0xDEADBEEF 2506 2507 /* Get Health Status event buffer entry (0xFF22), 2508 * repeated per reported health status. 2509 */ 2510 struct ice_aqc_health_status_elem { 2511 __le16 health_status_code; 2512 __le16 event_source; 2513 __le32 internal_data1; 2514 __le32 internal_data2; 2515 }; 2516 2517 /* Admin Queue command opcodes */ 2518 enum ice_adminq_opc { 2519 /* AQ commands */ 2520 ice_aqc_opc_get_ver = 0x0001, 2521 ice_aqc_opc_driver_ver = 0x0002, 2522 ice_aqc_opc_q_shutdown = 0x0003, 2523 2524 /* resource ownership */ 2525 ice_aqc_opc_req_res = 0x0008, 2526 ice_aqc_opc_release_res = 0x0009, 2527 2528 /* device/function capabilities */ 2529 ice_aqc_opc_list_func_caps = 0x000A, 2530 ice_aqc_opc_list_dev_caps = 0x000B, 2531 2532 /* manage MAC address */ 2533 ice_aqc_opc_manage_mac_read = 0x0107, 2534 ice_aqc_opc_manage_mac_write = 0x0108, 2535 2536 /* PXE */ 2537 ice_aqc_opc_clear_pxe_mode = 0x0110, 2538 2539 /* internal switch commands */ 2540 ice_aqc_opc_get_sw_cfg = 0x0200, 2541 ice_aqc_opc_set_port_params = 0x0203, 2542 2543 /* Alloc/Free/Get Resources */ 2544 ice_aqc_opc_alloc_res = 0x0208, 2545 ice_aqc_opc_free_res = 0x0209, 2546 ice_aqc_opc_share_res = 0x020B, 2547 ice_aqc_opc_set_vlan_mode_parameters = 0x020C, 2548 ice_aqc_opc_get_vlan_mode_parameters = 0x020D, 2549 2550 /* VSI commands */ 2551 ice_aqc_opc_add_vsi = 0x0210, 2552 ice_aqc_opc_update_vsi = 0x0211, 2553 ice_aqc_opc_free_vsi = 0x0213, 2554 2555 /* recipe commands */ 2556 ice_aqc_opc_add_recipe = 0x0290, 2557 ice_aqc_opc_recipe_to_profile = 0x0291, 2558 ice_aqc_opc_get_recipe = 0x0292, 2559 ice_aqc_opc_get_recipe_to_profile = 0x0293, 2560 2561 /* switch rules population commands */ 2562 ice_aqc_opc_add_sw_rules = 0x02A0, 2563 ice_aqc_opc_update_sw_rules = 0x02A1, 2564 ice_aqc_opc_remove_sw_rules = 0x02A2, 2565 2566 ice_aqc_opc_clear_pf_cfg = 0x02A4, 2567 2568 /* DCB commands */ 2569 ice_aqc_opc_query_pfc_mode = 0x0302, 2570 ice_aqc_opc_set_pfc_mode = 0x0303, 2571 2572 /* transmit scheduler commands */ 2573 ice_aqc_opc_get_dflt_topo = 0x0400, 2574 ice_aqc_opc_add_sched_elems = 0x0401, 2575 ice_aqc_opc_cfg_sched_elems = 0x0403, 2576 ice_aqc_opc_get_sched_elems = 0x0404, 2577 ice_aqc_opc_move_sched_elems = 0x0408, 2578 ice_aqc_opc_suspend_sched_elems = 0x0409, 2579 ice_aqc_opc_resume_sched_elems = 0x040A, 2580 ice_aqc_opc_query_port_ets = 0x040E, 2581 ice_aqc_opc_delete_sched_elems = 0x040F, 2582 ice_aqc_opc_add_rl_profiles = 0x0410, 2583 ice_aqc_opc_query_sched_res = 0x0412, 2584 ice_aqc_opc_remove_rl_profiles = 0x0415, 2585 2586 /* tx topology commands */ 2587 ice_aqc_opc_set_tx_topo = 0x0417, 2588 ice_aqc_opc_get_tx_topo = 0x0418, 2589 2590 /* PHY commands */ 2591 ice_aqc_opc_get_phy_caps = 0x0600, 2592 ice_aqc_opc_set_phy_cfg = 0x0601, 2593 ice_aqc_opc_set_mac_cfg = 0x0603, 2594 ice_aqc_opc_restart_an = 0x0605, 2595 ice_aqc_opc_get_link_status = 0x0607, 2596 ice_aqc_opc_set_event_mask = 0x0613, 2597 ice_aqc_opc_set_mac_lb = 0x0620, 2598 ice_aqc_opc_set_phy_rec_clk_out = 0x0630, 2599 ice_aqc_opc_get_phy_rec_clk_out = 0x0631, 2600 ice_aqc_opc_get_sensor_reading = 0x0632, 2601 ice_aqc_opc_dnl_call = 0x0682, 2602 ice_aqc_opc_get_link_topo = 0x06E0, 2603 ice_aqc_opc_read_i2c = 0x06E2, 2604 ice_aqc_opc_write_i2c = 0x06E3, 2605 ice_aqc_opc_set_port_id_led = 0x06E9, 2606 ice_aqc_opc_get_port_options = 0x06EA, 2607 ice_aqc_opc_set_port_option = 0x06EB, 2608 ice_aqc_opc_set_gpio = 0x06EC, 2609 ice_aqc_opc_get_gpio = 0x06ED, 2610 ice_aqc_opc_sff_eeprom = 0x06EE, 2611 2612 /* NVM commands */ 2613 ice_aqc_opc_nvm_read = 0x0701, 2614 ice_aqc_opc_nvm_erase = 0x0702, 2615 ice_aqc_opc_nvm_write = 0x0703, 2616 ice_aqc_opc_nvm_checksum = 0x0706, 2617 ice_aqc_opc_nvm_write_activate = 0x0707, 2618 ice_aqc_opc_nvm_update_empr = 0x0709, 2619 ice_aqc_opc_nvm_pkg_data = 0x070A, 2620 ice_aqc_opc_nvm_pass_component_tbl = 0x070B, 2621 2622 /* PF/VF mailbox commands */ 2623 ice_mbx_opc_send_msg_to_pf = 0x0801, 2624 ice_mbx_opc_send_msg_to_vf = 0x0802, 2625 /* LLDP commands */ 2626 ice_aqc_opc_lldp_get_mib = 0x0A00, 2627 ice_aqc_opc_lldp_set_mib_change = 0x0A01, 2628 ice_aqc_opc_lldp_stop = 0x0A05, 2629 ice_aqc_opc_lldp_start = 0x0A06, 2630 ice_aqc_opc_get_cee_dcb_cfg = 0x0A07, 2631 ice_aqc_opc_lldp_set_local_mib = 0x0A08, 2632 ice_aqc_opc_lldp_stop_start_specific_agent = 0x0A09, 2633 ice_aqc_opc_lldp_filter_ctrl = 0x0A0A, 2634 ice_aqc_opc_lldp_execute_pending_mib = 0x0A0B, 2635 2636 /* RSS commands */ 2637 ice_aqc_opc_set_rss_key = 0x0B02, 2638 ice_aqc_opc_set_rss_lut = 0x0B03, 2639 ice_aqc_opc_get_rss_key = 0x0B04, 2640 ice_aqc_opc_get_rss_lut = 0x0B05, 2641 2642 /* Sideband Control Interface commands */ 2643 ice_aqc_opc_neighbour_device_request = 0x0C00, 2644 2645 /* Tx queue handling commands/events */ 2646 ice_aqc_opc_add_txqs = 0x0C30, 2647 ice_aqc_opc_dis_txqs = 0x0C31, 2648 ice_aqc_opc_cfg_txqs = 0x0C32, 2649 ice_aqc_opc_add_rdma_qset = 0x0C33, 2650 2651 /* Tx Time queue commands */ 2652 ice_aqc_opc_set_txtimeqs = 0x0C35, 2653 2654 /* package commands */ 2655 ice_aqc_opc_download_pkg = 0x0C40, 2656 ice_aqc_opc_upload_section = 0x0C41, 2657 ice_aqc_opc_update_pkg = 0x0C42, 2658 ice_aqc_opc_get_pkg_info_list = 0x0C43, 2659 2660 /* 1588/SyncE commands/events */ 2661 ice_aqc_opc_get_cgu_input_measure = 0x0C59, 2662 ice_aqc_opc_get_cgu_abilities = 0x0C61, 2663 ice_aqc_opc_set_cgu_input_config = 0x0C62, 2664 ice_aqc_opc_get_cgu_input_config = 0x0C63, 2665 ice_aqc_opc_set_cgu_output_config = 0x0C64, 2666 ice_aqc_opc_get_cgu_output_config = 0x0C65, 2667 ice_aqc_opc_get_cgu_dpll_status = 0x0C66, 2668 ice_aqc_opc_set_cgu_dpll_config = 0x0C67, 2669 ice_aqc_opc_set_cgu_ref_prio = 0x0C68, 2670 ice_aqc_opc_get_cgu_ref_prio = 0x0C69, 2671 ice_aqc_opc_get_cgu_info = 0x0C6A, 2672 2673 ice_aqc_opc_driver_shared_params = 0x0C90, 2674 2675 /* Standalone Commands/Events */ 2676 ice_aqc_opc_event_lan_overflow = 0x1001, 2677 2678 /* System Diagnostic commands */ 2679 ice_aqc_opc_set_health_status_cfg = 0xFF20, 2680 ice_aqc_opc_get_health_status = 0xFF22, 2681 2682 /* FW Logging Commands */ 2683 ice_aqc_opc_fw_logs_config = 0xFF30, 2684 ice_aqc_opc_fw_logs_register = 0xFF31, 2685 ice_aqc_opc_fw_logs_query = 0xFF32, 2686 ice_aqc_opc_fw_logs_event = 0xFF33, 2687 }; 2688 2689 #endif /* _ICE_ADMINQ_CMD_H_ */ 2690