1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright (c) 2014-2018 Broadcom Limited 3 * All rights reserved. 4 * 5 * DO NOT MODIFY!!! This file is automatically generated. 6 */ 7 8 #ifndef _HSI_STRUCT_DEF_DPDK_H_ 9 #define _HSI_STRUCT_DEF_DPDK_H_ 10 11 /* This is the HWRM command header. */ 12 /* hwrm_cmd_hdr (size:128b/16B) */ 13 struct hwrm_cmd_hdr { 14 /* The HWRM command request type. */ 15 uint16_t req_type; 16 /* 17 * The completion ring to send the completion event on. This should 18 * be the NQ ID returned from the `nq_alloc` HWRM command. 19 */ 20 uint16_t cmpl_ring; 21 /* 22 * The sequence ID is used by the driver for tracking multiple 23 * commands. This ID is treated as opaque data by the firmware and 24 * the value is returned in the `hwrm_resp_hdr` upon completion. 25 */ 26 uint16_t seq_id; 27 /* 28 * The target ID of the command: 29 * * 0x0-0xFFF8 - The function ID 30 * * 0xFFF8-0xFFFE - Reserved for internal processors 31 * * 0xFFFF - HWRM 32 */ 33 uint16_t target_id; 34 /* 35 * A physical address pointer pointing to a host buffer that the 36 * command's response data will be written. This can be either a host 37 * physical address (HPA) or a guest physical address (GPA) and must 38 * point to a physically contiguous block of memory. 39 */ 40 uint64_t resp_addr; 41 } __attribute__((packed)); 42 43 /* This is the HWRM response header. */ 44 /* hwrm_resp_hdr (size:64b/8B) */ 45 struct hwrm_resp_hdr { 46 /* The specific error status for the command. */ 47 uint16_t error_code; 48 /* The HWRM command request type. */ 49 uint16_t req_type; 50 /* The sequence ID from the original command. */ 51 uint16_t seq_id; 52 /* The length of the response data in number of bytes. */ 53 uint16_t resp_len; 54 } __attribute__((packed)); 55 56 /* 57 * TLV encapsulated message. Use the TLV type field of the 58 * TLV to determine the type of message encapsulated. 59 */ 60 #define CMD_DISCR_TLV_ENCAP UINT32_C(0x8000) 61 #define CMD_DISCR_LAST CMD_DISCR_TLV_ENCAP 62 63 64 /* HWRM request message */ 65 #define TLV_TYPE_HWRM_REQUEST UINT32_C(0x1) 66 /* HWRM response message */ 67 #define TLV_TYPE_HWRM_RESPONSE UINT32_C(0x2) 68 /* RoCE slow path command */ 69 #define TLV_TYPE_ROCE_SP_COMMAND UINT32_C(0x3) 70 /* RoCE slow path command to query CC Gen1 support. */ 71 #define TLV_TYPE_QUERY_ROCE_CC_GEN1 UINT32_C(0xcommand 0x0005) 72 /* RoCE slow path command to modify CC Gen1 support. */ 73 #define TLV_TYPE_MODIFY_ROCE_CC_GEN1 UINT32_C(0xcommand 0x0005) 74 /* Engine CKV - The device's serial number. */ 75 #define TLV_TYPE_ENGINE_CKV_DEVICE_SERIAL_NUMBER UINT32_C(0x8001) 76 /* Engine CKV - Per-function random nonce data. */ 77 #define TLV_TYPE_ENGINE_CKV_NONCE UINT32_C(0x8002) 78 /* Engine CKV - Initialization vector. */ 79 #define TLV_TYPE_ENGINE_CKV_IV UINT32_C(0x8003) 80 /* Engine CKV - Authentication tag. */ 81 #define TLV_TYPE_ENGINE_CKV_AUTH_TAG UINT32_C(0x8004) 82 /* Engine CKV - The encrypted data. */ 83 #define TLV_TYPE_ENGINE_CKV_CIPHERTEXT UINT32_C(0x8005) 84 /* Engine CKV - Supported algorithms. */ 85 #define TLV_TYPE_ENGINE_CKV_ALGORITHMS UINT32_C(0x8006) 86 /* Engine CKV - The EC curve name and ECC public key information. */ 87 #define TLV_TYPE_ENGINE_CKV_ECC_PUBLIC_KEY UINT32_C(0x8007) 88 /* Engine CKV - The ECDSA signature. */ 89 #define TLV_TYPE_ENGINE_CKV_ECDSA_SIGNATURE UINT32_C(0x8008) 90 #define TLV_TYPE_LAST \ 91 TLV_TYPE_ENGINE_CKV_ECDSA_SIGNATURE 92 93 94 /* tlv (size:64b/8B) */ 95 struct tlv { 96 /* 97 * The command discriminator is used to differentiate between various 98 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath 99 * command messages as well as newer TLV encapsulated HWRM commands. 100 * 101 * For TLV encapsulated messages this field must be 0x8000. 102 */ 103 uint16_t cmd_discr; 104 uint8_t reserved_8b; 105 uint8_t flags; 106 /* 107 * Indicates the presence of additional TLV encapsulated data 108 * follows this TLV. 109 */ 110 #define TLV_FLAGS_MORE UINT32_C(0x1) 111 /* Last TLV in a sequence of TLVs. */ 112 #define TLV_FLAGS_MORE_LAST UINT32_C(0x0) 113 /* More TLVs follow this TLV. */ 114 #define TLV_FLAGS_MORE_NOT_LAST UINT32_C(0x1) 115 /* 116 * When an HWRM receiver detects a TLV type that it does not 117 * support with the TLV required flag set, the receiver must 118 * reject the HWRM message with an error code indicating an 119 * unsupported TLV type. 120 */ 121 #define TLV_FLAGS_REQUIRED UINT32_C(0x2) 122 /* No */ 123 #define TLV_FLAGS_REQUIRED_NO (UINT32_C(0x0) << 1) 124 /* Yes */ 125 #define TLV_FLAGS_REQUIRED_YES (UINT32_C(0x1) << 1) 126 #define TLV_FLAGS_REQUIRED_LAST TLV_FLAGS_REQUIRED_YES 127 /* 128 * This field defines the TLV type value which is divided into 129 * two ranges to differentiate between global and local TLV types. 130 * Global TLV types must be unique across all defined TLV types. 131 * Local TLV types are valid only for extensions to a given 132 * HWRM message and may be repeated across different HWRM message 133 * types. There is a direct correlation of each HWRM message type 134 * to a single global TLV type value. 135 * 136 * Global TLV range: `0 - (63k-1)` 137 * 138 * Local TLV range: `63k - (64k-1)` 139 */ 140 uint16_t tlv_type; 141 /* 142 * Length of the message data encapsulated by this TLV in bytes. 143 * This length does not include the size of the TLV header itself 144 * and it must be an integer multiple of 8B. 145 */ 146 uint16_t length; 147 } __attribute__((packed)); 148 149 /* Input */ 150 /* input (size:128b/16B) */ 151 struct input { 152 /* 153 * This value indicates what type of request this is. The format 154 * for the rest of the command is determined by this field. 155 */ 156 uint16_t req_type; 157 /* 158 * This value indicates the what completion ring the request will 159 * be optionally completed on. If the value is -1, then no 160 * CR completion will be generated. Any other value must be a 161 * valid CR ring_id value for this function. 162 */ 163 uint16_t cmpl_ring; 164 /* This value indicates the command sequence number. */ 165 uint16_t seq_id; 166 /* 167 * Target ID of this command. 168 * 169 * 0x0 - 0xFFF8 - Used for function ids 170 * 0xFFF8 - 0xFFFE - Reserved for internal processors 171 * 0xFFFF - HWRM 172 */ 173 uint16_t target_id; 174 /* 175 * This is the host address where the response will be written 176 * when the request is complete. This area must be 16B aligned 177 * and must be cleared to zero before the request is made. 178 */ 179 uint64_t resp_addr; 180 } __attribute__((packed)); 181 182 /* Output */ 183 /* output (size:64b/8B) */ 184 struct output { 185 /* 186 * Pass/Fail or error type 187 * 188 * Note: receiver to verify the in parameters, and fail the call 189 * with an error when appropriate 190 */ 191 uint16_t error_code; 192 /* This field returns the type of original request. */ 193 uint16_t req_type; 194 /* This field provides original sequence number of the command. */ 195 uint16_t seq_id; 196 /* 197 * This field is the length of the response in bytes. The 198 * last byte of the response is a valid flag that will read 199 * as '1' when the command has been completely written to 200 * memory. 201 */ 202 uint16_t resp_len; 203 } __attribute__((packed)); 204 205 /* Short Command Structure */ 206 /* hwrm_short_input (size:128b/16B) */ 207 struct hwrm_short_input { 208 /* 209 * This field indicates the type of request in the request buffer. 210 * The format for the rest of the command (request) is determined 211 * by this field. 212 */ 213 uint16_t req_type; 214 /* 215 * This field indicates a signature that is used to identify short 216 * form of the command listed here. This field shall be set to 217 * 17185 (0x4321). 218 */ 219 uint16_t signature; 220 /* Signature indicating this is a short form of HWRM command */ 221 #define HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD UINT32_C(0x4321) 222 #define HWRM_SHORT_INPUT_SIGNATURE_LAST \ 223 HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD 224 /* Reserved for future use. */ 225 uint16_t unused_0; 226 /* This value indicates the length of the request. */ 227 uint16_t size; 228 /* 229 * This is the host address where the request was written. 230 * This area must be 16B aligned. 231 */ 232 uint64_t req_addr; 233 } __attribute__((packed)); 234 235 /* 236 * Command numbering 237 * # NOTE - definitions already in hwrm_req_type, in hwrm_types.yaml 238 * # So only structure definition is provided here. 239 */ 240 /* cmd_nums (size:64b/8B) */ 241 struct cmd_nums { 242 /* 243 * This version of the specification defines the commands listed in 244 * the table below. The following are general implementation 245 * requirements for these commands: 246 * 247 * # All commands listed below that are marked neither 248 * reserved nor experimental shall be implemented by the HWRM. 249 * # A HWRM client compliant to this specification should not use 250 * commands outside of the list below. 251 * # A HWRM client compliant to this specification should not use 252 * command numbers marked reserved below. 253 * # A command marked experimental below may not be implemented 254 * by the HWRM. 255 * # A command marked experimental may change in the 256 * future version of the HWRM specification. 257 * # A command not listed below may be implemented by the HWRM. 258 * The behavior of commands that are not listed below is outside 259 * the scope of this specification. 260 */ 261 uint16_t req_type; 262 #define HWRM_VER_GET UINT32_C(0x0) 263 #define HWRM_FUNC_DRV_IF_CHANGE UINT32_C(0xd) 264 #define HWRM_FUNC_BUF_UNRGTR UINT32_C(0xe) 265 #define HWRM_FUNC_VF_CFG UINT32_C(0xf) 266 /* Reserved for future use. */ 267 #define HWRM_RESERVED1 UINT32_C(0x10) 268 #define HWRM_FUNC_RESET UINT32_C(0x11) 269 #define HWRM_FUNC_GETFID UINT32_C(0x12) 270 #define HWRM_FUNC_VF_ALLOC UINT32_C(0x13) 271 #define HWRM_FUNC_VF_FREE UINT32_C(0x14) 272 #define HWRM_FUNC_QCAPS UINT32_C(0x15) 273 #define HWRM_FUNC_QCFG UINT32_C(0x16) 274 #define HWRM_FUNC_CFG UINT32_C(0x17) 275 #define HWRM_FUNC_QSTATS UINT32_C(0x18) 276 #define HWRM_FUNC_CLR_STATS UINT32_C(0x19) 277 #define HWRM_FUNC_DRV_UNRGTR UINT32_C(0x1a) 278 #define HWRM_FUNC_VF_RESC_FREE UINT32_C(0x1b) 279 #define HWRM_FUNC_VF_VNIC_IDS_QUERY UINT32_C(0x1c) 280 #define HWRM_FUNC_DRV_RGTR UINT32_C(0x1d) 281 #define HWRM_FUNC_DRV_QVER UINT32_C(0x1e) 282 #define HWRM_FUNC_BUF_RGTR UINT32_C(0x1f) 283 #define HWRM_PORT_PHY_CFG UINT32_C(0x20) 284 #define HWRM_PORT_MAC_CFG UINT32_C(0x21) 285 /* Experimental */ 286 #define HWRM_PORT_TS_QUERY UINT32_C(0x22) 287 #define HWRM_PORT_QSTATS UINT32_C(0x23) 288 #define HWRM_PORT_LPBK_QSTATS UINT32_C(0x24) 289 /* Experimental */ 290 #define HWRM_PORT_CLR_STATS UINT32_C(0x25) 291 /* Experimental */ 292 #define HWRM_PORT_LPBK_CLR_STATS UINT32_C(0x26) 293 #define HWRM_PORT_PHY_QCFG UINT32_C(0x27) 294 #define HWRM_PORT_MAC_QCFG UINT32_C(0x28) 295 /* Experimental */ 296 #define HWRM_PORT_MAC_PTP_QCFG UINT32_C(0x29) 297 #define HWRM_PORT_PHY_QCAPS UINT32_C(0x2a) 298 #define HWRM_PORT_PHY_I2C_WRITE UINT32_C(0x2b) 299 #define HWRM_PORT_PHY_I2C_READ UINT32_C(0x2c) 300 #define HWRM_PORT_LED_CFG UINT32_C(0x2d) 301 #define HWRM_PORT_LED_QCFG UINT32_C(0x2e) 302 #define HWRM_PORT_LED_QCAPS UINT32_C(0x2f) 303 #define HWRM_QUEUE_QPORTCFG UINT32_C(0x30) 304 #define HWRM_QUEUE_QCFG UINT32_C(0x31) 305 #define HWRM_QUEUE_CFG UINT32_C(0x32) 306 #define HWRM_FUNC_VLAN_CFG UINT32_C(0x33) 307 #define HWRM_FUNC_VLAN_QCFG UINT32_C(0x34) 308 #define HWRM_QUEUE_PFCENABLE_QCFG UINT32_C(0x35) 309 #define HWRM_QUEUE_PFCENABLE_CFG UINT32_C(0x36) 310 #define HWRM_QUEUE_PRI2COS_QCFG UINT32_C(0x37) 311 #define HWRM_QUEUE_PRI2COS_CFG UINT32_C(0x38) 312 #define HWRM_QUEUE_COS2BW_QCFG UINT32_C(0x39) 313 #define HWRM_QUEUE_COS2BW_CFG UINT32_C(0x3a) 314 /* Experimental */ 315 #define HWRM_QUEUE_DSCP_QCAPS UINT32_C(0x3b) 316 /* Experimental */ 317 #define HWRM_QUEUE_DSCP2PRI_QCFG UINT32_C(0x3c) 318 /* Experimental */ 319 #define HWRM_QUEUE_DSCP2PRI_CFG UINT32_C(0x3d) 320 #define HWRM_VNIC_ALLOC UINT32_C(0x40) 321 #define HWRM_VNIC_FREE UINT32_C(0x41) 322 #define HWRM_VNIC_CFG UINT32_C(0x42) 323 #define HWRM_VNIC_QCFG UINT32_C(0x43) 324 #define HWRM_VNIC_TPA_CFG UINT32_C(0x44) 325 /* Experimental */ 326 #define HWRM_VNIC_TPA_QCFG UINT32_C(0x45) 327 #define HWRM_VNIC_RSS_CFG UINT32_C(0x46) 328 #define HWRM_VNIC_RSS_QCFG UINT32_C(0x47) 329 #define HWRM_VNIC_PLCMODES_CFG UINT32_C(0x48) 330 #define HWRM_VNIC_PLCMODES_QCFG UINT32_C(0x49) 331 #define HWRM_VNIC_QCAPS UINT32_C(0x4a) 332 #define HWRM_RING_ALLOC UINT32_C(0x50) 333 #define HWRM_RING_FREE UINT32_C(0x51) 334 #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS UINT32_C(0x52) 335 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS UINT32_C(0x53) 336 #define HWRM_RING_AGGINT_QCAPS UINT32_C(0x54) 337 #define HWRM_RING_RESET UINT32_C(0x5e) 338 #define HWRM_RING_GRP_ALLOC UINT32_C(0x60) 339 #define HWRM_RING_GRP_FREE UINT32_C(0x61) 340 /* Reserved for future use. */ 341 #define HWRM_RESERVED5 UINT32_C(0x64) 342 /* Reserved for future use. */ 343 #define HWRM_RESERVED6 UINT32_C(0x65) 344 #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC UINT32_C(0x70) 345 #define HWRM_VNIC_RSS_COS_LB_CTX_FREE UINT32_C(0x71) 346 #define HWRM_CFA_L2_FILTER_ALLOC UINT32_C(0x90) 347 #define HWRM_CFA_L2_FILTER_FREE UINT32_C(0x91) 348 #define HWRM_CFA_L2_FILTER_CFG UINT32_C(0x92) 349 #define HWRM_CFA_L2_SET_RX_MASK UINT32_C(0x93) 350 #define HWRM_CFA_VLAN_ANTISPOOF_CFG UINT32_C(0x94) 351 #define HWRM_CFA_TUNNEL_FILTER_ALLOC UINT32_C(0x95) 352 #define HWRM_CFA_TUNNEL_FILTER_FREE UINT32_C(0x96) 353 /* Experimental */ 354 #define HWRM_CFA_ENCAP_RECORD_ALLOC UINT32_C(0x97) 355 /* Experimental */ 356 #define HWRM_CFA_ENCAP_RECORD_FREE UINT32_C(0x98) 357 #define HWRM_CFA_NTUPLE_FILTER_ALLOC UINT32_C(0x99) 358 #define HWRM_CFA_NTUPLE_FILTER_FREE UINT32_C(0x9a) 359 #define HWRM_CFA_NTUPLE_FILTER_CFG UINT32_C(0x9b) 360 /* Experimental */ 361 #define HWRM_CFA_EM_FLOW_ALLOC UINT32_C(0x9c) 362 /* Experimental */ 363 #define HWRM_CFA_EM_FLOW_FREE UINT32_C(0x9d) 364 /* Experimental */ 365 #define HWRM_CFA_EM_FLOW_CFG UINT32_C(0x9e) 366 #define HWRM_TUNNEL_DST_PORT_QUERY UINT32_C(0xa0) 367 #define HWRM_TUNNEL_DST_PORT_ALLOC UINT32_C(0xa1) 368 #define HWRM_TUNNEL_DST_PORT_FREE UINT32_C(0xa2) 369 #define HWRM_STAT_CTX_ALLOC UINT32_C(0xb0) 370 #define HWRM_STAT_CTX_FREE UINT32_C(0xb1) 371 #define HWRM_STAT_CTX_QUERY UINT32_C(0xb2) 372 #define HWRM_STAT_CTX_CLR_STATS UINT32_C(0xb3) 373 #define HWRM_PORT_QSTATS_EXT UINT32_C(0xb4) 374 #define HWRM_FW_RESET UINT32_C(0xc0) 375 #define HWRM_FW_QSTATUS UINT32_C(0xc1) 376 #define HWRM_FW_HEALTH_CHECK UINT32_C(0xc2) 377 #define HWRM_FW_SYNC UINT32_C(0xc3) 378 /* Experimental */ 379 #define HWRM_FW_SET_TIME UINT32_C(0xc8) 380 /* Experimental */ 381 #define HWRM_FW_GET_TIME UINT32_C(0xc9) 382 /* Experimental */ 383 #define HWRM_FW_SET_STRUCTURED_DATA UINT32_C(0xca) 384 /* Experimental */ 385 #define HWRM_FW_GET_STRUCTURED_DATA UINT32_C(0xcb) 386 /* Experimental */ 387 #define HWRM_FW_IPC_MAILBOX UINT32_C(0xcc) 388 #define HWRM_EXEC_FWD_RESP UINT32_C(0xd0) 389 #define HWRM_REJECT_FWD_RESP UINT32_C(0xd1) 390 #define HWRM_FWD_RESP UINT32_C(0xd2) 391 #define HWRM_FWD_ASYNC_EVENT_CMPL UINT32_C(0xd3) 392 #define HWRM_OEM_CMD UINT32_C(0xd4) 393 #define HWRM_TEMP_MONITOR_QUERY UINT32_C(0xe0) 394 #define HWRM_WOL_FILTER_ALLOC UINT32_C(0xf0) 395 #define HWRM_WOL_FILTER_FREE UINT32_C(0xf1) 396 #define HWRM_WOL_FILTER_QCFG UINT32_C(0xf2) 397 #define HWRM_WOL_REASON_QCFG UINT32_C(0xf3) 398 /* Experimental */ 399 #define HWRM_CFA_METER_PROFILE_ALLOC UINT32_C(0xf5) 400 /* Experimental */ 401 #define HWRM_CFA_METER_PROFILE_FREE UINT32_C(0xf6) 402 /* Experimental */ 403 #define HWRM_CFA_METER_PROFILE_CFG UINT32_C(0xf7) 404 /* Experimental */ 405 #define HWRM_CFA_METER_INSTANCE_ALLOC UINT32_C(0xf8) 406 /* Experimental */ 407 #define HWRM_CFA_METER_INSTANCE_FREE UINT32_C(0xf9) 408 /* Experimental */ 409 #define HWRM_CFA_VFR_ALLOC UINT32_C(0xfd) 410 /* Experimental */ 411 #define HWRM_CFA_VFR_FREE UINT32_C(0xfe) 412 /* Experimental */ 413 #define HWRM_CFA_VF_PAIR_ALLOC UINT32_C(0x100) 414 /* Experimental */ 415 #define HWRM_CFA_VF_PAIR_FREE UINT32_C(0x101) 416 /* Experimental */ 417 #define HWRM_CFA_VF_PAIR_INFO UINT32_C(0x102) 418 /* Experimental */ 419 #define HWRM_CFA_FLOW_ALLOC UINT32_C(0x103) 420 /* Experimental */ 421 #define HWRM_CFA_FLOW_FREE UINT32_C(0x104) 422 /* Experimental */ 423 #define HWRM_CFA_FLOW_FLUSH UINT32_C(0x105) 424 /* Experimental */ 425 #define HWRM_CFA_FLOW_STATS UINT32_C(0x106) 426 /* Experimental */ 427 #define HWRM_CFA_FLOW_INFO UINT32_C(0x107) 428 /* Experimental */ 429 #define HWRM_CFA_DECAP_FILTER_ALLOC UINT32_C(0x108) 430 /* Experimental */ 431 #define HWRM_CFA_DECAP_FILTER_FREE UINT32_C(0x109) 432 #define HWRM_CFA_VLAN_ANTISPOOF_QCFG UINT32_C(0x10a) 433 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC UINT32_C(0x10b) 434 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE UINT32_C(0x10c) 435 /* Experimental */ 436 #define HWRM_CFA_PAIR_ALLOC UINT32_C(0x10d) 437 /* Experimental */ 438 #define HWRM_CFA_PAIR_FREE UINT32_C(0x10e) 439 /* Experimental */ 440 #define HWRM_CFA_PAIR_INFO UINT32_C(0x10f) 441 /* Experimental */ 442 #define HWRM_FW_IPC_MSG UINT32_C(0x110) 443 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO UINT32_C(0x111) 444 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE UINT32_C(0x112) 445 /* Engine CKV - Ping the device and SRT firmware to get the public key. */ 446 #define HWRM_ENGINE_CKV_HELLO UINT32_C(0x12d) 447 /* Engine CKV - Get the current allocation status of keys provisioned in the key vault. */ 448 #define HWRM_ENGINE_CKV_STATUS UINT32_C(0x12e) 449 /* Engine CKV - Add a new CKEK used to encrypt keys. */ 450 #define HWRM_ENGINE_CKV_CKEK_ADD UINT32_C(0x12f) 451 /* Engine CKV - Delete a previously added CKEK. */ 452 #define HWRM_ENGINE_CKV_CKEK_DELETE UINT32_C(0x130) 453 /* Engine CKV - Add a new key to the key vault. */ 454 #define HWRM_ENGINE_CKV_KEY_ADD UINT32_C(0x131) 455 /* Engine CKV - Delete a key from the key vault. */ 456 #define HWRM_ENGINE_CKV_KEY_DELETE UINT32_C(0x132) 457 /* Engine CKV - Delete all keys from the key vault. */ 458 #define HWRM_ENGINE_CKV_FLUSH UINT32_C(0x133) 459 /* Engine CKV - Get random data. */ 460 #define HWRM_ENGINE_CKV_RNG_GET UINT32_C(0x134) 461 /* Engine CKV - Generate and encrypt a new AES key. */ 462 #define HWRM_ENGINE_CKV_KEY_GEN UINT32_C(0x135) 463 /* Engine - Query the available queue groups configuration. */ 464 #define HWRM_ENGINE_QG_CONFIG_QUERY UINT32_C(0x13c) 465 /* Engine - Query the queue groups assigned to a function. */ 466 #define HWRM_ENGINE_QG_QUERY UINT32_C(0x13d) 467 /* Engine - Query the available queue group meter profile configuration. */ 468 #define HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY UINT32_C(0x13e) 469 /* Engine - Query the configuration of a queue group meter profile. */ 470 #define HWRM_ENGINE_QG_METER_PROFILE_QUERY UINT32_C(0x13f) 471 /* Engine - Allocate a queue group meter profile. */ 472 #define HWRM_ENGINE_QG_METER_PROFILE_ALLOC UINT32_C(0x140) 473 /* Engine - Free a queue group meter profile. */ 474 #define HWRM_ENGINE_QG_METER_PROFILE_FREE UINT32_C(0x141) 475 /* Engine - Query the meters assigned to a queue group. */ 476 #define HWRM_ENGINE_QG_METER_QUERY UINT32_C(0x142) 477 /* Engine - Bind a queue group meter profile to a queue group. */ 478 #define HWRM_ENGINE_QG_METER_BIND UINT32_C(0x143) 479 /* Engine - Unbind a queue group meter profile from a queue group. */ 480 #define HWRM_ENGINE_QG_METER_UNBIND UINT32_C(0x144) 481 /* Engine - Bind a queue group to a function. */ 482 #define HWRM_ENGINE_QG_FUNC_BIND UINT32_C(0x145) 483 /* Engine - Query the scheduling group configuration. */ 484 #define HWRM_ENGINE_SG_CONFIG_QUERY UINT32_C(0x146) 485 /* Engine - Query the queue groups assigned to a scheduling group. */ 486 #define HWRM_ENGINE_SG_QUERY UINT32_C(0x147) 487 /* Engine - Query the configuration of a scheduling group's meter profiles. */ 488 #define HWRM_ENGINE_SG_METER_QUERY UINT32_C(0x148) 489 /* Engine - Configure a scheduling group's meter profiles. */ 490 #define HWRM_ENGINE_SG_METER_CONFIG UINT32_C(0x149) 491 /* Engine - Bind a queue group to a scheduling group. */ 492 #define HWRM_ENGINE_SG_QG_BIND UINT32_C(0x14a) 493 /* Engine - Unbind a queue group from its scheduling group. */ 494 #define HWRM_ENGINE_QG_SG_UNBIND UINT32_C(0x14b) 495 /* Engine - Query the Engine configuration. */ 496 #define HWRM_ENGINE_CONFIG_QUERY UINT32_C(0x154) 497 /* Engine - Configure the statistics accumulator for an Engine. */ 498 #define HWRM_ENGINE_STATS_CONFIG UINT32_C(0x155) 499 /* Engine - Clear the statistics accumulator for an Engine. */ 500 #define HWRM_ENGINE_STATS_CLEAR UINT32_C(0x156) 501 /* Engine - Query the statistics accumulator for an Engine. */ 502 #define HWRM_ENGINE_STATS_QUERY UINT32_C(0x157) 503 /* Engine - Allocate an Engine RQ. */ 504 #define HWRM_ENGINE_RQ_ALLOC UINT32_C(0x15e) 505 /* Engine - Free an Engine RQ. */ 506 #define HWRM_ENGINE_RQ_FREE UINT32_C(0x15f) 507 /* Engine - Allocate an Engine CQ. */ 508 #define HWRM_ENGINE_CQ_ALLOC UINT32_C(0x160) 509 /* Engine - Free an Engine CQ. */ 510 #define HWRM_ENGINE_CQ_FREE UINT32_C(0x161) 511 /* Engine - Allocate an NQ. */ 512 #define HWRM_ENGINE_NQ_ALLOC UINT32_C(0x162) 513 /* Engine - Free an NQ. */ 514 #define HWRM_ENGINE_NQ_FREE UINT32_C(0x163) 515 /* Engine - Set the on-die RQE credit update location. */ 516 #define HWRM_ENGINE_ON_DIE_RQE_CREDITS UINT32_C(0x164) 517 /* Experimental */ 518 #define HWRM_FUNC_RESOURCE_QCAPS UINT32_C(0x190) 519 /* Experimental */ 520 #define HWRM_FUNC_VF_RESOURCE_CFG UINT32_C(0x191) 521 /* Experimental */ 522 #define HWRM_FUNC_BACKING_STORE_QCAPS UINT32_C(0x192) 523 /* Experimental */ 524 #define HWRM_FUNC_BACKING_STORE_CFG UINT32_C(0x193) 525 /* Experimental */ 526 #define HWRM_FUNC_BACKING_STORE_QCFG UINT32_C(0x194) 527 /* Configures the BW of any VF */ 528 #define HWRM_FUNC_VF_BW_CFG UINT32_C(0x195) 529 /* Queries the BW of any VF */ 530 #define HWRM_FUNC_VF_BW_QCFG UINT32_C(0x196) 531 /* Experimental */ 532 #define HWRM_SELFTEST_QLIST UINT32_C(0x200) 533 /* Experimental */ 534 #define HWRM_SELFTEST_EXEC UINT32_C(0x201) 535 /* Experimental */ 536 #define HWRM_SELFTEST_IRQ UINT32_C(0x202) 537 /* Experimental */ 538 #define HWRM_SELFTEST_RETRIEVE_SERDES_DATA UINT32_C(0x203) 539 /* Experimental */ 540 #define HWRM_PCIE_QSTATS UINT32_C(0x204) 541 /* Experimental */ 542 #define HWRM_DBG_READ_DIRECT UINT32_C(0xff10) 543 /* Experimental */ 544 #define HWRM_DBG_READ_INDIRECT UINT32_C(0xff11) 545 /* Experimental */ 546 #define HWRM_DBG_WRITE_DIRECT UINT32_C(0xff12) 547 /* Experimental */ 548 #define HWRM_DBG_WRITE_INDIRECT UINT32_C(0xff13) 549 #define HWRM_DBG_DUMP UINT32_C(0xff14) 550 /* Experimental */ 551 #define HWRM_DBG_ERASE_NVM UINT32_C(0xff15) 552 /* Experimental */ 553 #define HWRM_DBG_CFG UINT32_C(0xff16) 554 /* Experimental */ 555 #define HWRM_DBG_COREDUMP_LIST UINT32_C(0xff17) 556 /* Experimental */ 557 #define HWRM_DBG_COREDUMP_INITIATE UINT32_C(0xff18) 558 /* Experimental */ 559 #define HWRM_DBG_COREDUMP_RETRIEVE UINT32_C(0xff19) 560 /* Experimental */ 561 #define HWRM_DBG_FW_CLI UINT32_C(0xff1a) 562 /* */ 563 #define HWRM_DBG_I2C_CMD UINT32_C(0xff1b) 564 /* */ 565 #define HWRM_DBG_RING_INFO_GET UINT32_C(0xff1c) 566 /* Experimental */ 567 #define HWRM_NVM_FACTORY_DEFAULTS UINT32_C(0xffee) 568 #define HWRM_NVM_VALIDATE_OPTION UINT32_C(0xffef) 569 #define HWRM_NVM_FLUSH UINT32_C(0xfff0) 570 #define HWRM_NVM_GET_VARIABLE UINT32_C(0xfff1) 571 #define HWRM_NVM_SET_VARIABLE UINT32_C(0xfff2) 572 #define HWRM_NVM_INSTALL_UPDATE UINT32_C(0xfff3) 573 #define HWRM_NVM_MODIFY UINT32_C(0xfff4) 574 #define HWRM_NVM_VERIFY_UPDATE UINT32_C(0xfff5) 575 #define HWRM_NVM_GET_DEV_INFO UINT32_C(0xfff6) 576 #define HWRM_NVM_ERASE_DIR_ENTRY UINT32_C(0xfff7) 577 #define HWRM_NVM_MOD_DIR_ENTRY UINT32_C(0xfff8) 578 #define HWRM_NVM_FIND_DIR_ENTRY UINT32_C(0xfff9) 579 #define HWRM_NVM_GET_DIR_ENTRIES UINT32_C(0xfffa) 580 #define HWRM_NVM_GET_DIR_INFO UINT32_C(0xfffb) 581 #define HWRM_NVM_RAW_DUMP UINT32_C(0xfffc) 582 #define HWRM_NVM_READ UINT32_C(0xfffd) 583 #define HWRM_NVM_WRITE UINT32_C(0xfffe) 584 #define HWRM_NVM_RAW_WRITE_BLK UINT32_C(0xffff) 585 #define HWRM_LAST HWRM_NVM_RAW_WRITE_BLK 586 uint16_t unused_0[3]; 587 } __attribute__((packed)); 588 589 /* Return Codes */ 590 /* ret_codes (size:64b/8B) */ 591 struct ret_codes { 592 uint16_t error_code; 593 /* Request was successfully executed by the HWRM. */ 594 #define HWRM_ERR_CODE_SUCCESS UINT32_C(0x0) 595 /* The HWRM failed to execute the request. */ 596 #define HWRM_ERR_CODE_FAIL UINT32_C(0x1) 597 /* 598 * The request contains invalid argument(s) or input 599 * parameters. 600 */ 601 #define HWRM_ERR_CODE_INVALID_PARAMS UINT32_C(0x2) 602 /* 603 * The requester is not allowed to access the requested 604 * resource. This error code shall be provided in a 605 * response to a request to query or modify an existing 606 * resource that is not accessible by the requester. 607 */ 608 #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED UINT32_C(0x3) 609 /* 610 * The HWRM is unable to allocate the requested resource. 611 * This code only applies to requests for HWRM resource 612 * allocations. 613 */ 614 #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR UINT32_C(0x4) 615 /* 616 * Invalid combination of flags is specified in the 617 * request. 618 */ 619 #define HWRM_ERR_CODE_INVALID_FLAGS UINT32_C(0x5) 620 /* 621 * Invalid combination of enables fields is specified in 622 * the request. 623 */ 624 #define HWRM_ERR_CODE_INVALID_ENABLES UINT32_C(0x6) 625 /* 626 * Request contains a required TLV that is not supported by 627 * the installed version of firmware. 628 */ 629 #define HWRM_ERR_CODE_UNSUPPORTED_TLV UINT32_C(0x7) 630 /* 631 * No firmware buffer available to accept the request. Driver 632 * should retry the request. 633 */ 634 #define HWRM_ERR_CODE_NO_BUFFER UINT32_C(0x8) 635 /* 636 * This error code is only reported by firmware when some 637 * sub-option of a supported HWRM command is unsupported. 638 */ 639 #define HWRM_ERR_CODE_UNSUPPORTED_OPTION_ERR UINT32_C(0x9) 640 /* 641 * Generic HWRM execution error that represents an 642 * internal error. 643 */ 644 #define HWRM_ERR_CODE_HWRM_ERROR UINT32_C(0xf) 645 /* Unknown error */ 646 #define HWRM_ERR_CODE_UNKNOWN_ERR UINT32_C(0xfffe) 647 /* Unsupported or invalid command */ 648 #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED UINT32_C(0xffff) 649 #define HWRM_ERR_CODE_LAST \ 650 HWRM_ERR_CODE_CMD_NOT_SUPPORTED 651 uint16_t unused_0[3]; 652 } __attribute__((packed)); 653 654 /* Output */ 655 /* hwrm_err_output (size:128b/16B) */ 656 struct hwrm_err_output { 657 /* 658 * Pass/Fail or error type 659 * 660 * Note: receiver to verify the in parameters, and fail the call 661 * with an error when appropriate 662 */ 663 uint16_t error_code; 664 /* This field returns the type of original request. */ 665 uint16_t req_type; 666 /* This field provides original sequence number of the command. */ 667 uint16_t seq_id; 668 /* 669 * This field is the length of the response in bytes. The 670 * last byte of the response is a valid flag that will read 671 * as '1' when the command has been completely written to 672 * memory. 673 */ 674 uint16_t resp_len; 675 /* debug info for this error response. */ 676 uint32_t opaque_0; 677 /* debug info for this error response. */ 678 uint16_t opaque_1; 679 /* 680 * In the case of an error response, command specific error 681 * code is returned in this field. 682 */ 683 uint8_t cmd_err; 684 /* 685 * This field is used in Output records to indicate that the output 686 * is completely written to RAM. This field should be read as '1' 687 * to indicate that the output has been completely written. 688 * When writing a command completion or response to an internal processor, 689 * the order of writes has to be such that this field is written last. 690 */ 691 uint8_t valid; 692 } __attribute__((packed)); 693 /* 694 * Following is the signature for HWRM message field that indicates not 695 * applicable (All F's). Need to cast it the size of the field if needed. 696 */ 697 #define HWRM_NA_SIGNATURE ((uint32_t)(-1)) 698 /* hwrm_func_buf_rgtr */ 699 #define HWRM_MAX_REQ_LEN 128 700 /* hwrm_selftest_qlist */ 701 #define HWRM_MAX_RESP_LEN 280 702 /* 7 bit indirection table index. */ 703 #define HW_HASH_INDEX_SIZE 0x80 704 #define HW_HASH_KEY_SIZE 40 705 /* valid key for HWRM response */ 706 #define HWRM_RESP_VALID_KEY 1 707 #define HWRM_VERSION_MAJOR 1 708 #define HWRM_VERSION_MINOR 9 709 #define HWRM_VERSION_UPDATE 2 710 /* non-zero means beta version */ 711 #define HWRM_VERSION_RSVD 53 712 #define HWRM_VERSION_STR "1.9.2.53" 713 714 /**************** 715 * hwrm_ver_get * 716 ****************/ 717 718 719 /* hwrm_ver_get_input (size:192b/24B) */ 720 struct hwrm_ver_get_input { 721 /* The HWRM command request type. */ 722 uint16_t req_type; 723 /* 724 * The completion ring to send the completion event on. This should 725 * be the NQ ID returned from the `nq_alloc` HWRM command. 726 */ 727 uint16_t cmpl_ring; 728 /* 729 * The sequence ID is used by the driver for tracking multiple 730 * commands. This ID is treated as opaque data by the firmware and 731 * the value is returned in the `hwrm_resp_hdr` upon completion. 732 */ 733 uint16_t seq_id; 734 /* 735 * The target ID of the command: 736 * * 0x0-0xFFF8 - The function ID 737 * * 0xFFF8-0xFFFE - Reserved for internal processors 738 * * 0xFFFF - HWRM 739 */ 740 uint16_t target_id; 741 /* 742 * A physical address pointer pointing to a host buffer that the 743 * command's response data will be written. This can be either a host 744 * physical address (HPA) or a guest physical address (GPA) and must 745 * point to a physically contiguous block of memory. 746 */ 747 uint64_t resp_addr; 748 /* 749 * This field represents the major version of HWRM interface 750 * specification supported by the driver HWRM implementation. 751 * The interface major version is intended to change only when 752 * non backward compatible changes are made to the HWRM 753 * interface specification. 754 */ 755 uint8_t hwrm_intf_maj; 756 /* 757 * This field represents the minor version of HWRM interface 758 * specification supported by the driver HWRM implementation. 759 * A change in interface minor version is used to reflect 760 * significant backward compatible modification to HWRM 761 * interface specification. 762 * This can be due to addition or removal of functionality. 763 * HWRM interface specifications with the same major version 764 * but different minor versions are compatible. 765 */ 766 uint8_t hwrm_intf_min; 767 /* 768 * This field represents the update version of HWRM interface 769 * specification supported by the driver HWRM implementation. 770 * The interface update version is used to reflect minor 771 * changes or bug fixes to a released HWRM interface 772 * specification. 773 */ 774 uint8_t hwrm_intf_upd; 775 uint8_t unused_0[5]; 776 } __attribute__((packed)); 777 778 /* hwrm_ver_get_output (size:1408b/176B) */ 779 struct hwrm_ver_get_output { 780 /* The specific error status for the command. */ 781 uint16_t error_code; 782 /* The HWRM command request type. */ 783 uint16_t req_type; 784 /* The sequence ID from the original command. */ 785 uint16_t seq_id; 786 /* The length of the response data in number of bytes. */ 787 uint16_t resp_len; 788 /* 789 * This field represents the major version of HWRM interface 790 * specification supported by the HWRM implementation. 791 * The interface major version is intended to change only when 792 * non backward compatible changes are made to the HWRM 793 * interface specification. 794 * A HWRM implementation that is compliant with this 795 * specification shall provide value of 1 in this field. 796 */ 797 uint8_t hwrm_intf_maj_8b; 798 /* 799 * This field represents the minor version of HWRM interface 800 * specification supported by the HWRM implementation. 801 * A change in interface minor version is used to reflect 802 * significant backward compatible modification to HWRM 803 * interface specification. 804 * This can be due to addition or removal of functionality. 805 * HWRM interface specifications with the same major version 806 * but different minor versions are compatible. 807 * A HWRM implementation that is compliant with this 808 * specification shall provide value of 2 in this field. 809 */ 810 uint8_t hwrm_intf_min_8b; 811 /* 812 * This field represents the update version of HWRM interface 813 * specification supported by the HWRM implementation. 814 * The interface update version is used to reflect minor 815 * changes or bug fixes to a released HWRM interface 816 * specification. 817 * A HWRM implementation that is compliant with this 818 * specification shall provide value of 2 in this field. 819 */ 820 uint8_t hwrm_intf_upd_8b; 821 uint8_t hwrm_intf_rsvd_8b; 822 /* 823 * This field represents the major version of HWRM firmware. 824 * A change in firmware major version represents a major 825 * firmware release. 826 */ 827 uint8_t hwrm_fw_maj_8b; 828 /* 829 * This field represents the minor version of HWRM firmware. 830 * A change in firmware minor version represents significant 831 * firmware functionality changes. 832 */ 833 uint8_t hwrm_fw_min_8b; 834 /* 835 * This field represents the build version of HWRM firmware. 836 * A change in firmware build version represents bug fixes 837 * to a released firmware. 838 */ 839 uint8_t hwrm_fw_bld_8b; 840 /* 841 * This field is a reserved field. This field can be used to 842 * represent firmware branches or customer specific releases 843 * tied to a specific (major,minor,update) version of the 844 * HWRM firmware. 845 */ 846 uint8_t hwrm_fw_rsvd_8b; 847 /* 848 * This field represents the major version of mgmt firmware. 849 * A change in major version represents a major release. 850 */ 851 uint8_t mgmt_fw_maj_8b; 852 /* 853 * This field represents the minor version of mgmt firmware. 854 * A change in minor version represents significant 855 * functionality changes. 856 */ 857 uint8_t mgmt_fw_min_8b; 858 /* 859 * This field represents the build version of mgmt firmware. 860 * A change in update version represents bug fixes. 861 */ 862 uint8_t mgmt_fw_bld_8b; 863 /* 864 * This field is a reserved field. This field can be used to 865 * represent firmware branches or customer specific releases 866 * tied to a specific (major,minor,update) version 867 */ 868 uint8_t mgmt_fw_rsvd_8b; 869 /* 870 * This field represents the major version of network 871 * control firmware. 872 * A change in major version represents a major release. 873 */ 874 uint8_t netctrl_fw_maj_8b; 875 /* 876 * This field represents the minor version of network 877 * control firmware. 878 * A change in minor version represents significant 879 * functionality changes. 880 */ 881 uint8_t netctrl_fw_min_8b; 882 /* 883 * This field represents the build version of network 884 * control firmware. 885 * A change in update version represents bug fixes. 886 */ 887 uint8_t netctrl_fw_bld_8b; 888 /* 889 * This field is a reserved field. This field can be used to 890 * represent firmware branches or customer specific releases 891 * tied to a specific (major,minor,update) version 892 */ 893 uint8_t netctrl_fw_rsvd_8b; 894 /* 895 * This field is used to indicate device's capabilities and 896 * configurations. 897 */ 898 uint32_t dev_caps_cfg; 899 /* 900 * If set to 1, then secure firmware update behavior 901 * is supported. 902 * If set to 0, then secure firmware update behavior is 903 * not supported. 904 */ 905 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED \ 906 UINT32_C(0x1) 907 /* 908 * If set to 1, then firmware based DCBX agent is supported. 909 * If set to 0, then firmware based DCBX agent capability 910 * is not supported on this device. 911 */ 912 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED \ 913 UINT32_C(0x2) 914 /* 915 * If set to 1, then HWRM short command format is supported. 916 * If set to 0, then HWRM short command format is not supported. 917 */ 918 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED \ 919 UINT32_C(0x4) 920 /* 921 * If set to 1, then HWRM short command format is required. 922 * If set to 0, then HWRM short command format is not required. 923 */ 924 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED \ 925 UINT32_C(0x8) 926 /* 927 * If set to 1, then the KONG host mailbox channel is supported. 928 * If set to 0, then the KONG host mailbox channel is not supported. 929 * By default, this flag should be 0 for older version of core firmware. 930 */ 931 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_KONG_MB_CHNL_SUPPORTED \ 932 UINT32_C(0x10) 933 /* 934 * If set to 1, then the 64bit flow handle is supported in addition to the 935 * legacy 16bit flow handle. If set to 0, then the 64bit flow handle is not 936 * supported. By default, this flag should be 0 for older version of core firmware. 937 */ 938 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_HANDLE_64BIT_SUPPORTED \ 939 UINT32_C(0x20) 940 /* 941 * If set to 1, then filter type can be provided in filter_alloc or filter_cfg 942 * filter types like L2 for l2 traffic and ROCE for roce & l2 traffic. 943 * If set to 0, then filter types not supported. 944 * By default, this flag should be 0 for older version of core firmware. 945 */ 946 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_L2_FILTER_TYPES_ROCE_OR_L2_SUPPORTED \ 947 UINT32_C(0x40) 948 /* 949 * If set to 1, firmware is capable to support virtio vSwitch offload model. 950 * If set to 0, firmware can't supported virtio vSwitch offload model. 951 * By default, this flag should be 0 for older version of core firmware. 952 */ 953 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_VIRTIO_VSWITCH_OFFLOAD_SUPPORTED \ 954 UINT32_C(0x80) 955 /* 956 * If set to 1, firmware is capable to support trusted VF. 957 * If set to 0, firmware is not capable to support trusted VF. 958 * By default, this flag should be 0 for older version of core firmware. 959 */ 960 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_TRUSTED_VF_SUPPORTED \ 961 UINT32_C(0x100) 962 /* 963 * This field represents the major version of RoCE firmware. 964 * A change in major version represents a major release. 965 */ 966 uint8_t roce_fw_maj_8b; 967 /* 968 * This field represents the minor version of RoCE firmware. 969 * A change in minor version represents significant 970 * functionality changes. 971 */ 972 uint8_t roce_fw_min_8b; 973 /* 974 * This field represents the build version of RoCE firmware. 975 * A change in update version represents bug fixes. 976 */ 977 uint8_t roce_fw_bld_8b; 978 /* 979 * This field is a reserved field. This field can be used to 980 * represent firmware branches or customer specific releases 981 * tied to a specific (major,minor,update) version 982 */ 983 uint8_t roce_fw_rsvd_8b; 984 /* 985 * This field represents the name of HWRM FW (ASCII chars 986 * with NULL at the end). 987 */ 988 char hwrm_fw_name[16]; 989 /* 990 * This field represents the name of mgmt FW (ASCII chars 991 * with NULL at the end). 992 */ 993 char mgmt_fw_name[16]; 994 /* 995 * This field represents the name of network control 996 * firmware (ASCII chars with NULL at the end). 997 */ 998 char netctrl_fw_name[16]; 999 /* 1000 * This field is reserved for future use. 1001 * The responder should set it to 0. 1002 * The requester should ignore this field. 1003 */ 1004 uint8_t reserved2[16]; 1005 /* 1006 * This field represents the name of RoCE FW (ASCII chars 1007 * with NULL at the end). 1008 */ 1009 char roce_fw_name[16]; 1010 /* This field returns the chip number. */ 1011 uint16_t chip_num; 1012 /* This field returns the revision of chip. */ 1013 uint8_t chip_rev; 1014 /* This field returns the chip metal number. */ 1015 uint8_t chip_metal; 1016 /* This field returns the bond id of the chip. */ 1017 uint8_t chip_bond_id; 1018 /* This value indicates the type of platform used for chip implementation. */ 1019 uint8_t chip_platform_type; 1020 /* ASIC */ 1021 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC UINT32_C(0x0) 1022 /* FPGA platform of the chip. */ 1023 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA UINT32_C(0x1) 1024 /* Palladium platform of the chip. */ 1025 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2) 1026 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_LAST \ 1027 HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM 1028 /* 1029 * This field returns the maximum value of request window that 1030 * is supported by the HWRM. The request window is mapped 1031 * into device address space using MMIO. 1032 */ 1033 uint16_t max_req_win_len; 1034 /* 1035 * This field returns the maximum value of response buffer in 1036 * bytes. 1037 */ 1038 uint16_t max_resp_len; 1039 /* 1040 * This field returns the default request timeout value in 1041 * milliseconds. 1042 */ 1043 uint16_t def_req_timeout; 1044 /* 1045 * This field will indicate if any subsystems is not fully 1046 * initialized. 1047 */ 1048 uint8_t flags; 1049 /* 1050 * If set to 1, device is not ready. 1051 * If set to 0, device is ready to accept all HWRM commands. 1052 */ 1053 #define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY UINT32_C(0x1) 1054 /* 1055 * If set to 1, external version present. 1056 * If set to 0, external version not present. 1057 */ 1058 #define HWRM_VER_GET_OUTPUT_FLAGS_EXT_VER_AVAIL UINT32_C(0x2) 1059 uint8_t unused_0[2]; 1060 /* 1061 * For backward compatibility this field must be set to 1. 1062 * Older drivers might look for this field to be 1 before 1063 * processing the message. 1064 */ 1065 uint8_t always_1; 1066 /* 1067 * This field represents the major version of HWRM interface 1068 * specification supported by the HWRM implementation. 1069 * The interface major version is intended to change only when 1070 * non backward compatible changes are made to the HWRM 1071 * interface specification. A HWRM implementation that is 1072 * compliant with this specification shall provide value of 1 1073 * in this field. 1074 */ 1075 uint16_t hwrm_intf_major; 1076 /* 1077 * This field represents the minor version of HWRM interface 1078 * specification supported by the HWRM implementation. 1079 * A change in interface minor version is used to reflect 1080 * significant backward compatible modification to HWRM 1081 * interface specification. This can be due to addition or 1082 * removal of functionality. HWRM interface specifications 1083 * with the same major version but different minor versions are 1084 * compatible. A HWRM implementation that is compliant with 1085 * this specification shall provide value of 2 in this field. 1086 */ 1087 uint16_t hwrm_intf_minor; 1088 /* 1089 * This field represents the update version of HWRM interface 1090 * specification supported by the HWRM implementation. The 1091 * interface update version is used to reflect minor changes or 1092 * bug fixes to a released HWRM interface specification. 1093 * A HWRM implementation that is compliant with this 1094 * specification shall provide value of 2 in this field. 1095 */ 1096 uint16_t hwrm_intf_build; 1097 /* 1098 * This field represents the patch version of HWRM interface 1099 * specification supported by the HWRM implementation. 1100 */ 1101 uint16_t hwrm_intf_patch; 1102 /* 1103 * This field represents the major version of HWRM firmware. 1104 * A change in firmware major version represents a major 1105 * firmware release. 1106 */ 1107 uint16_t hwrm_fw_major; 1108 /* 1109 * This field represents the minor version of HWRM firmware. 1110 * A change in firmware minor version represents significant 1111 * firmware functionality changes. 1112 */ 1113 uint16_t hwrm_fw_minor; 1114 /* 1115 * This field represents the build version of HWRM firmware. 1116 * A change in firmware build version represents bug fixes to 1117 * a released firmware. 1118 */ 1119 uint16_t hwrm_fw_build; 1120 /* 1121 * This field is a reserved field. 1122 * This field can be used to represent firmware branches or customer 1123 * specific releases tied to a specific (major,minor,update) version 1124 * of the HWRM firmware. 1125 */ 1126 uint16_t hwrm_fw_patch; 1127 /* 1128 * This field represents the major version of mgmt firmware. 1129 * A change in major version represents a major release. 1130 */ 1131 uint16_t mgmt_fw_major; 1132 /* 1133 * This field represents the minor version of HWRM firmware. 1134 * A change in firmware minor version represents significant 1135 * firmware functionality changes. 1136 */ 1137 uint16_t mgmt_fw_minor; 1138 /* 1139 * This field represents the build version of mgmt firmware. 1140 * A change in update version represents bug fixes. 1141 */ 1142 uint16_t mgmt_fw_build; 1143 /* 1144 * This field is a reserved field. This field can be used to 1145 * represent firmware branches or customer specific releases 1146 * tied to a specific (major,minor,update) version. 1147 */ 1148 uint16_t mgmt_fw_patch; 1149 /* 1150 * This field represents the major version of network control 1151 * firmware. A change in major version represents 1152 * a major release. 1153 */ 1154 uint16_t netctrl_fw_major; 1155 /* 1156 * This field represents the minor version of network control 1157 * firmware. A change in minor version represents significant 1158 * functionality changes. 1159 */ 1160 uint16_t netctrl_fw_minor; 1161 /* 1162 * This field represents the build version of network control 1163 * firmware. A change in update version represents bug fixes. 1164 */ 1165 uint16_t netctrl_fw_build; 1166 /* 1167 * This field is a reserved field. This field can be used to 1168 * represent firmware branches or customer specific releases 1169 * tied to a specific (major,minor,update) version 1170 */ 1171 uint16_t netctrl_fw_patch; 1172 /* 1173 * This field represents the major version of RoCE firmware. 1174 * A change in major version represents a major release. 1175 */ 1176 uint16_t roce_fw_major; 1177 /* 1178 * This field represents the minor version of RoCE firmware. 1179 * A change in minor version represents significant 1180 * functionality changes. 1181 */ 1182 uint16_t roce_fw_minor; 1183 /* 1184 * This field represents the build version of RoCE firmware. 1185 * A change in update version represents bug fixes. 1186 */ 1187 uint16_t roce_fw_build; 1188 /* 1189 * This field is a reserved field. This field can be used to 1190 * represent firmware branches or customer specific releases 1191 * tied to a specific (major,minor,update) version 1192 */ 1193 uint16_t roce_fw_patch; 1194 /* 1195 * This field returns the maximum extended request length acceptable 1196 * by the device which allows requests greater than mailbox size when 1197 * used with the short cmd request format. 1198 */ 1199 uint16_t max_ext_req_len; 1200 uint8_t unused_1[5]; 1201 /* 1202 * This field is used in Output records to indicate that the output 1203 * is completely written to RAM. This field should be read as '1' 1204 * to indicate that the output has been completely written. 1205 * When writing a command completion or response to an internal processor, 1206 * the order of writes has to be such that this field is written last. 1207 */ 1208 uint8_t valid; 1209 } __attribute__((packed)); 1210 1211 /* bd_base (size:64b/8B) */ 1212 struct bd_base { 1213 uint8_t type; 1214 /* This value identifies the type of buffer descriptor. */ 1215 #define BD_BASE_TYPE_MASK UINT32_C(0x3f) 1216 #define BD_BASE_TYPE_SFT 0 1217 /* 1218 * Indicates that this BD is 16B long and is used for 1219 * normal L2 packet transmission. 1220 */ 1221 #define BD_BASE_TYPE_TX_BD_SHORT UINT32_C(0x0) 1222 /* 1223 * Indicates that this BD is 1BB long and is an empty 1224 * TX BD. Not valid for use by the driver. 1225 */ 1226 #define BD_BASE_TYPE_TX_BD_EMPTY UINT32_C(0x1) 1227 /* 1228 * Indicates that this BD is 16B long and is an RX Producer 1229 * (ie. empty) buffer descriptor. 1230 */ 1231 #define BD_BASE_TYPE_RX_PROD_PKT UINT32_C(0x4) 1232 /* 1233 * Indicates that this BD is 16B long and is an RX 1234 * Producer Buffer BD. 1235 */ 1236 #define BD_BASE_TYPE_RX_PROD_BFR UINT32_C(0x5) 1237 /* 1238 * Indicates that this BD is 16B long and is an 1239 * RX Producer Assembly Buffer Descriptor. 1240 */ 1241 #define BD_BASE_TYPE_RX_PROD_AGG UINT32_C(0x6) 1242 /* 1243 * Indicates that this BD is 32B long and is used for 1244 * normal L2 packet transmission. 1245 */ 1246 #define BD_BASE_TYPE_TX_BD_LONG UINT32_C(0x10) 1247 /* 1248 * Indicates that this BD is 32B long and is used for 1249 * L2 packet transmission for small packets that require 1250 * low latency. 1251 */ 1252 #define BD_BASE_TYPE_TX_BD_LONG_INLINE UINT32_C(0x11) 1253 #define BD_BASE_TYPE_LAST BD_BASE_TYPE_TX_BD_LONG_INLINE 1254 uint8_t unused_1[7]; 1255 } __attribute__((packed)); 1256 1257 /* tx_bd_short (size:128b/16B) */ 1258 struct tx_bd_short { 1259 /* 1260 * All bits in this field must be valid on the first BD of a packet. 1261 * Only the packet_end bit must be valid for the remaining BDs 1262 * of a packet. 1263 */ 1264 uint16_t flags_type; 1265 /* This value identifies the type of buffer descriptor. */ 1266 #define TX_BD_SHORT_TYPE_MASK UINT32_C(0x3f) 1267 #define TX_BD_SHORT_TYPE_SFT 0 1268 /* 1269 * Indicates that this BD is 16B long and is used for 1270 * normal L2 packet transmission. 1271 */ 1272 #define TX_BD_SHORT_TYPE_TX_BD_SHORT UINT32_C(0x0) 1273 #define TX_BD_SHORT_TYPE_LAST TX_BD_SHORT_TYPE_TX_BD_SHORT 1274 /* 1275 * All bits in this field must be valid on the first BD of a packet. 1276 * Only the packet_end bit must be valid for the remaining BDs 1277 * of a packet. 1278 */ 1279 #define TX_BD_SHORT_FLAGS_MASK UINT32_C(0xffc0) 1280 #define TX_BD_SHORT_FLAGS_SFT 6 1281 /* 1282 * If set to 1, the packet ends with the data in the buffer 1283 * pointed to by this descriptor. This flag must be 1284 * valid on every BD. 1285 */ 1286 #define TX_BD_SHORT_FLAGS_PACKET_END UINT32_C(0x40) 1287 /* 1288 * If set to 1, the device will not generate a completion for 1289 * this transmit packet unless there is an error in it's 1290 * processing. 1291 * If this bit 1292 * is set to 0, then the packet will be completed normally. 1293 * 1294 * This bit must be valid only on the first BD of a packet. 1295 */ 1296 #define TX_BD_SHORT_FLAGS_NO_CMPL UINT32_C(0x80) 1297 /* 1298 * This value indicates how many 16B BD locations are consumed 1299 * in the ring by this packet. 1300 * A value of 1 indicates that this BD is the only BD (and that 1301 * the it is a short BD). A value 1302 * of 3 indicates either 3 short BDs or 1 long BD and one short 1303 * BD in the packet. A value of 0 indicates 1304 * that there are 32 BD locations in the packet (the maximum). 1305 * 1306 * This field is valid only on the first BD of a packet. 1307 */ 1308 #define TX_BD_SHORT_FLAGS_BD_CNT_MASK UINT32_C(0x1f00) 1309 #define TX_BD_SHORT_FLAGS_BD_CNT_SFT 8 1310 /* 1311 * This value is a hint for the length of the entire packet. 1312 * It is used by the chip to optimize internal processing. 1313 * 1314 * The packet will be dropped if the hint is too short. 1315 * 1316 * This field is valid only on the first BD of a packet. 1317 */ 1318 #define TX_BD_SHORT_FLAGS_LHINT_MASK UINT32_C(0x6000) 1319 #define TX_BD_SHORT_FLAGS_LHINT_SFT 13 1320 /* indicates packet length < 512B */ 1321 #define TX_BD_SHORT_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13) 1322 /* indicates 512 <= packet length < 1KB */ 1323 #define TX_BD_SHORT_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13) 1324 /* indicates 1KB <= packet length < 2KB */ 1325 #define TX_BD_SHORT_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13) 1326 /* indicates packet length >= 2KB */ 1327 #define TX_BD_SHORT_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13) 1328 #define TX_BD_SHORT_FLAGS_LHINT_LAST \ 1329 TX_BD_SHORT_FLAGS_LHINT_GTE2K 1330 /* 1331 * If set to 1, the device immediately updates the Send Consumer 1332 * Index after the buffer associated with this descriptor has 1333 * been transferred via DMA to NIC memory from host memory. An 1334 * interrupt may or may not be generated according to the state 1335 * of the interrupt avoidance mechanisms. If this bit 1336 * is set to 0, then the Consumer Index is only updated as soon 1337 * as one of the host interrupt coalescing conditions has been met. 1338 * 1339 * This bit must be valid on the first BD of a packet. 1340 */ 1341 #define TX_BD_SHORT_FLAGS_COAL_NOW UINT32_C(0x8000) 1342 /* 1343 * This is the length of the host physical buffer this BD describes 1344 * in bytes. 1345 * 1346 * This field must be valid on all BDs of a packet. 1347 */ 1348 uint16_t len; 1349 /* 1350 * The opaque data field is pass through to the completion and can be 1351 * used for any data that the driver wants to associate with the 1352 * transmit BD. 1353 * 1354 * This field must be valid on the first BD of a packet. 1355 */ 1356 uint32_t opaque; 1357 /* 1358 * This is the host physical address for the portion of the packet 1359 * described by this TX BD. 1360 * 1361 * This value must be valid on all BDs of a packet. 1362 */ 1363 uint64_t address; 1364 } __attribute__((packed)); 1365 1366 /* tx_bd_long (size:128b/16B) */ 1367 struct tx_bd_long { 1368 /* This value identifies the type of buffer descriptor. */ 1369 uint16_t flags_type; 1370 /* 1371 * This value indicates the type of buffer descriptor. 1372 * packet. 1373 */ 1374 #define TX_BD_LONG_TYPE_MASK UINT32_C(0x3f) 1375 #define TX_BD_LONG_TYPE_SFT 0 1376 /* 1377 * Indicates that this BD is 32B long and is used for 1378 * normal L2 packet transmission. 1379 */ 1380 #define TX_BD_LONG_TYPE_TX_BD_LONG UINT32_C(0x10) 1381 #define TX_BD_LONG_TYPE_LAST TX_BD_LONG_TYPE_TX_BD_LONG 1382 /* 1383 * All bits in this field must be valid on the first BD of a packet. 1384 * Only the packet_end bit must be valid for the remaining BDs 1385 * of a packet. 1386 */ 1387 #define TX_BD_LONG_FLAGS_MASK UINT32_C(0xffc0) 1388 #define TX_BD_LONG_FLAGS_SFT 6 1389 /* 1390 * If set to 1, the packet ends with the data in the buffer 1391 * pointed to by this descriptor. This flag must be 1392 * valid on every BD. 1393 */ 1394 #define TX_BD_LONG_FLAGS_PACKET_END UINT32_C(0x40) 1395 /* 1396 * If set to 1, the device will not generate a completion for 1397 * this transmit packet unless there is an error in it's 1398 * processing. 1399 * If this bit 1400 * is set to 0, then the packet will be completed normally. 1401 * 1402 * This bit must be valid only on the first BD of a packet. 1403 */ 1404 #define TX_BD_LONG_FLAGS_NO_CMPL UINT32_C(0x80) 1405 /* 1406 * This value indicates how many 16B BD locations are consumed 1407 * in the ring by this packet. 1408 * A value of 1 indicates that this BD is the only BD (and that 1409 * the it is a short BD). A value 1410 * of 3 indicates either 3 short BDs or 1 long BD and one short 1411 * BD in the packet. A value of 0 indicates 1412 * that there are 32 BD locations in the packet (the maximum). 1413 * 1414 * This field is valid only on the first BD of a packet. 1415 */ 1416 #define TX_BD_LONG_FLAGS_BD_CNT_MASK UINT32_C(0x1f00) 1417 #define TX_BD_LONG_FLAGS_BD_CNT_SFT 8 1418 /* 1419 * This value is a hint for the length of the entire packet. 1420 * It is used by the chip to optimize internal processing. 1421 * 1422 * The packet will be dropped if the hint is too short. 1423 * 1424 * This field is valid only on the first BD of a packet. 1425 */ 1426 #define TX_BD_LONG_FLAGS_LHINT_MASK UINT32_C(0x6000) 1427 #define TX_BD_LONG_FLAGS_LHINT_SFT 13 1428 /* indicates packet length < 512B */ 1429 #define TX_BD_LONG_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13) 1430 /* indicates 512 <= packet length < 1KB */ 1431 #define TX_BD_LONG_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13) 1432 /* indicates 1KB <= packet length < 2KB */ 1433 #define TX_BD_LONG_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13) 1434 /* indicates packet length >= 2KB */ 1435 #define TX_BD_LONG_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13) 1436 #define TX_BD_LONG_FLAGS_LHINT_LAST TX_BD_LONG_FLAGS_LHINT_GTE2K 1437 /* 1438 * If set to 1, the device immediately updates the Send Consumer 1439 * Index after the buffer associated with this descriptor has 1440 * been transferred via DMA to NIC memory from host memory. An 1441 * interrupt may or may not be generated according to the state 1442 * of the interrupt avoidance mechanisms. If this bit 1443 * is set to 0, then the Consumer Index is only updated as soon 1444 * as one of the host interrupt coalescing conditions has been met. 1445 * 1446 * This bit must be valid on the first BD of a packet. 1447 */ 1448 #define TX_BD_LONG_FLAGS_COAL_NOW UINT32_C(0x8000) 1449 /* 1450 * This is the length of the host physical buffer this BD describes 1451 * in bytes. 1452 * 1453 * This field must be valid on all BDs of a packet. 1454 */ 1455 uint16_t len; 1456 /* 1457 * The opaque data field is pass through to the completion and can be 1458 * used for any data that the driver wants to associate with the 1459 * transmit BD. 1460 * 1461 * This field must be valid on the first BD of a packet. 1462 */ 1463 uint32_t opaque; 1464 /* 1465 * This is the host physical address for the portion of the packet 1466 * described by this TX BD. 1467 * 1468 * This value must be valid on all BDs of a packet. 1469 */ 1470 uint64_t address; 1471 } __attribute__((packed)); 1472 1473 /* Last 16 bytes of tx_bd_long. */ 1474 /* tx_bd_long_hi (size:128b/16B) */ 1475 struct tx_bd_long_hi { 1476 /* 1477 * All bits in this field must be valid on the first BD of a packet. 1478 * Their value on other BDs of the packet will be ignored. 1479 */ 1480 uint16_t lflags; 1481 /* 1482 * If set to 1, the controller replaces the TCP/UPD checksum 1483 * fields of normal TCP/UPD checksum, or the inner TCP/UDP 1484 * checksum field of the encapsulated TCP/UDP packets with the 1485 * hardware calculated TCP/UDP checksum for the packet associated 1486 * with this descriptor. The flag is ignored if the LSO flag is set. 1487 * 1488 * This bit must be valid on the first BD of a packet. 1489 */ 1490 #define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM UINT32_C(0x1) 1491 /* 1492 * If set to 1, the controller replaces the IP checksum of the 1493 * normal packets, or the inner IP checksum of the encapsulated 1494 * packets with the hardware calculated IP checksum for the 1495 * packet associated with this descriptor. 1496 * 1497 * This bit must be valid on the first BD of a packet. 1498 */ 1499 #define TX_BD_LONG_LFLAGS_IP_CHKSUM UINT32_C(0x2) 1500 /* 1501 * If set to 1, the controller will not append an Ethernet CRC 1502 * to the end of the frame. 1503 * 1504 * This bit must be valid on the first BD of a packet. 1505 * 1506 * Packet must be 64B or longer when this flag is set. It is not 1507 * useful to use this bit with any form of TX offload such as 1508 * CSO or LSO. The intent is that the packet from the host already 1509 * has a valid Ethernet CRC on the packet. 1510 */ 1511 #define TX_BD_LONG_LFLAGS_NOCRC UINT32_C(0x4) 1512 /* 1513 * If set to 1, the device will record the time at which the packet 1514 * was actually transmitted at the TX MAC. 1515 * 1516 * This bit must be valid on the first BD of a packet. 1517 */ 1518 #define TX_BD_LONG_LFLAGS_STAMP UINT32_C(0x8) 1519 /* 1520 * If set to 1, The controller replaces the tunnel IP checksum 1521 * field with hardware calculated IP checksum for the IP header 1522 * of the packet associated with this descriptor. 1523 * 1524 * For outer UDP checksum, global outer UDP checksum TE_NIC register 1525 * needs to be enabled. If the global outer UDP checksum TE_NIC register 1526 * bit is set, outer UDP checksum will be calculated for the following 1527 * cases: 1528 * 1. Packets with tcp_udp_chksum flag set to offload checksum for inner 1529 * packet AND the inner packet is TCP/UDP. If the inner packet is ICMP for 1530 * example (non-TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP 1531 * checksum will not be calculated. 1532 * 2. Packets with lso flag set which implies inner TCP checksum calculation 1533 * as part of LSO operation. 1534 */ 1535 #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM UINT32_C(0x10) 1536 /* 1537 * If set to 1, the device will treat this packet with LSO(Large 1538 * Send Offload) processing for both normal or encapsulated 1539 * packets, which is a form of TCP segmentation. When this bit 1540 * is 1, the hdr_size and mss fields must be valid. The driver 1541 * doesn't need to set t_ip_chksum, ip_chksum, and tcp_udp_chksum 1542 * flags since the controller will replace the appropriate 1543 * checksum fields for segmented packets. 1544 * 1545 * When this bit is 1, the hdr_size and mss fields must be valid. 1546 */ 1547 #define TX_BD_LONG_LFLAGS_LSO UINT32_C(0x20) 1548 /* 1549 * If set to zero when LSO is '1', then the IPID will be treated 1550 * as a 16b number and will be wrapped if it exceeds a value of 1551 * 0xffff. 1552 * 1553 * If set to one when LSO is '1', then the IPID will be treated 1554 * as a 15b number and will be wrapped if it exceeds a value 0f 1555 * 0x7fff. 1556 */ 1557 #define TX_BD_LONG_LFLAGS_IPID_FMT UINT32_C(0x40) 1558 /* 1559 * If set to zero when LSO is '1', then the IPID of the tunnel 1560 * IP header will not be modified during LSO operations. 1561 * 1562 * If set to one when LSO is '1', then the IPID of the tunnel 1563 * IP header will be incremented for each subsequent segment of an 1564 * LSO operation. 1565 * 1566 * The flag is ignored if the LSO packet is a normal (non-tunneled) 1567 * TCP packet. 1568 */ 1569 #define TX_BD_LONG_LFLAGS_T_IPID UINT32_C(0x80) 1570 /* 1571 * If set to '1', then the RoCE ICRC will be appended to the 1572 * packet. Packet must be a valid RoCE format packet. 1573 */ 1574 #define TX_BD_LONG_LFLAGS_ROCE_CRC UINT32_C(0x100) 1575 /* 1576 * If set to '1', then the FCoE CRC will be appended to the 1577 * packet. Packet must be a valid FCoE format packet. 1578 */ 1579 #define TX_BD_LONG_LFLAGS_FCOE_CRC UINT32_C(0x200) 1580 uint16_t hdr_size; 1581 /* 1582 * When LSO is '1', this field must contain the offset of the 1583 * TCP payload from the beginning of the packet in as 1584 * 16b words. In case of encapsulated/tunneling packet, this field 1585 * contains the offset of the inner TCP payload from beginning of the 1586 * packet as 16-bit words. 1587 * 1588 * This value must be valid on the first BD of a packet. 1589 */ 1590 #define TX_BD_LONG_HDR_SIZE_MASK UINT32_C(0x1ff) 1591 #define TX_BD_LONG_HDR_SIZE_SFT 0 1592 uint32_t mss; 1593 /* 1594 * This is the MSS value that will be used to do the LSO processing. 1595 * The value is the length in bytes of the TCP payload for each 1596 * segment generated by the LSO operation. 1597 * 1598 * This value must be valid on the first BD of a packet. 1599 */ 1600 #define TX_BD_LONG_MSS_MASK UINT32_C(0x7fff) 1601 #define TX_BD_LONG_MSS_SFT 0 1602 uint16_t unused2; 1603 /* 1604 * This value selects a CFA action to perform on the packet. 1605 * Set this value to zero if no CFA action is desired. 1606 * 1607 * This value must be valid on the first BD of a packet. 1608 */ 1609 uint16_t cfa_action; 1610 /* 1611 * This value is action meta-data that defines CFA edit operations 1612 * that are done in addition to any action editing. 1613 */ 1614 uint32_t cfa_meta; 1615 /* When key=1, This is the VLAN tag VID value. */ 1616 #define TX_BD_LONG_CFA_META_VLAN_VID_MASK UINT32_C(0xfff) 1617 #define TX_BD_LONG_CFA_META_VLAN_VID_SFT 0 1618 /* When key=1, This is the VLAN tag DE value. */ 1619 #define TX_BD_LONG_CFA_META_VLAN_DE UINT32_C(0x1000) 1620 /* When key=1, This is the VLAN tag PRI value. */ 1621 #define TX_BD_LONG_CFA_META_VLAN_PRI_MASK UINT32_C(0xe000) 1622 #define TX_BD_LONG_CFA_META_VLAN_PRI_SFT 13 1623 /* When key=1, This is the VLAN tag TPID select value. */ 1624 #define TX_BD_LONG_CFA_META_VLAN_TPID_MASK UINT32_C(0x70000) 1625 #define TX_BD_LONG_CFA_META_VLAN_TPID_SFT 16 1626 /* 0x88a8 */ 1627 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8 (UINT32_C(0x0) << 16) 1628 /* 0x8100 */ 1629 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100 (UINT32_C(0x1) << 16) 1630 /* 0x9100 */ 1631 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100 (UINT32_C(0x2) << 16) 1632 /* 0x9200 */ 1633 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200 (UINT32_C(0x3) << 16) 1634 /* 0x9300 */ 1635 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300 (UINT32_C(0x4) << 16) 1636 /* Value programmed in CFA VLANTPID register. */ 1637 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG (UINT32_C(0x5) << 16) 1638 #define TX_BD_LONG_CFA_META_VLAN_TPID_LAST \ 1639 TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG 1640 /* When key=1, This is the VLAN tag TPID select value. */ 1641 #define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000) 1642 #define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT 19 1643 /* 1644 * This field identifies the type of edit to be performed 1645 * on the packet. 1646 * 1647 * This value must be valid on the first BD of a packet. 1648 */ 1649 #define TX_BD_LONG_CFA_META_KEY_MASK UINT32_C(0xf0000000) 1650 #define TX_BD_LONG_CFA_META_KEY_SFT 28 1651 /* No editing */ 1652 #define TX_BD_LONG_CFA_META_KEY_NONE (UINT32_C(0x0) << 28) 1653 /* 1654 * - meta[17:16] - TPID select value (0 = 0x8100). 1655 * - meta[15:12] - PRI/DE value. 1656 * - meta[11:0] - VID value. 1657 */ 1658 #define TX_BD_LONG_CFA_META_KEY_VLAN_TAG (UINT32_C(0x1) << 28) 1659 #define TX_BD_LONG_CFA_META_KEY_LAST \ 1660 TX_BD_LONG_CFA_META_KEY_VLAN_TAG 1661 } __attribute__((packed)); 1662 1663 /* 1664 * This structure is used to inform the NIC of packet data that needs to be 1665 * transmitted with additional processing that requires extra data such as 1666 * VLAN insertion plus attached inline data. This BD type may be used to 1667 * improve latency for small packets needing the additional extended features 1668 * supported by long BDs. 1669 */ 1670 /* tx_bd_long_inline (size:256b/32B) */ 1671 struct tx_bd_long_inline { 1672 uint16_t flags_type; 1673 /* This value identifies the type of buffer descriptor. */ 1674 #define TX_BD_LONG_INLINE_TYPE_MASK UINT32_C(0x3f) 1675 #define TX_BD_LONG_INLINE_TYPE_SFT 0 1676 /* 1677 * This type of BD is 32B long and is used for inline L2 packet 1678 * transmission. 1679 */ 1680 #define TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE UINT32_C(0x11) 1681 #define TX_BD_LONG_INLINE_TYPE_LAST \ 1682 TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE 1683 /* 1684 * All bits in this field may be set on the first BD of a packet. 1685 * Only the packet_end bit may be set in non-first BDs. 1686 */ 1687 #define TX_BD_LONG_INLINE_FLAGS_MASK UINT32_C(0xffc0) 1688 #define TX_BD_LONG_INLINE_FLAGS_SFT 6 1689 /* 1690 * If set to 1, the packet ends with the data in the buffer 1691 * pointed to by this descriptor. This flag must be 1692 * valid on every BD. 1693 */ 1694 #define TX_BD_LONG_INLINE_FLAGS_PACKET_END UINT32_C(0x40) 1695 /* 1696 * If set to 1, the device will not generate a completion for 1697 * this transmit packet unless there is an error in its processing. 1698 * If this bit is set to 0, then the packet will be completed 1699 * normally. 1700 * 1701 * This bit may be set only on the first BD of a packet. 1702 */ 1703 #define TX_BD_LONG_INLINE_FLAGS_NO_CMPL UINT32_C(0x80) 1704 /* 1705 * This value indicates how many 16B BD locations are consumed 1706 * in the ring by this packet, including the BD and inline 1707 * data. 1708 */ 1709 #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_MASK UINT32_C(0x1f00) 1710 #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_SFT 8 1711 /* This field is deprecated. */ 1712 #define TX_BD_LONG_INLINE_FLAGS_LHINT_MASK UINT32_C(0x6000) 1713 #define TX_BD_LONG_INLINE_FLAGS_LHINT_SFT 13 1714 /* 1715 * If set to 1, the device immediately updates the Send Consumer 1716 * Index after the buffer associated with this descriptor has 1717 * been transferred via DMA to NIC memory from host memory. An 1718 * interrupt may or may not be generated according to the state 1719 * of the interrupt avoidance mechanisms. If this bit 1720 * is set to 0, then the Consumer Index is only updated as soon 1721 * as one of the host interrupt coalescing conditions has been met. 1722 * 1723 * This bit must be valid on the first BD of a packet. 1724 */ 1725 #define TX_BD_LONG_INLINE_FLAGS_COAL_NOW UINT32_C(0x8000) 1726 /* 1727 * This is the length of the inline data, not including BD length, in 1728 * bytes. 1729 * The maximum value is 480. 1730 * 1731 * This field must be valid on all BDs of a packet. 1732 */ 1733 uint16_t len; 1734 /* 1735 * The opaque data field is passed through to the completion and can be 1736 * used for any data that the driver wants to associate with the transmit 1737 * BD. 1738 * 1739 * This field must be valid on the first BD of a packet. 1740 */ 1741 uint32_t opaque; 1742 uint64_t unused1; 1743 /* 1744 * All bits in this field must be valid on the first BD of a packet. 1745 * Their value on other BDs of the packet is ignored. 1746 */ 1747 uint16_t lflags; 1748 /* 1749 * If set to 1, the controller replaces the TCP/UPD checksum 1750 * fields of normal TCP/UPD checksum, or the inner TCP/UDP 1751 * checksum field of the encapsulated TCP/UDP packets with the 1752 * hardware calculated TCP/UDP checksum for the packet associated 1753 * with this descriptor. The flag is ignored if the LSO flag is set. 1754 */ 1755 #define TX_BD_LONG_INLINE_LFLAGS_TCP_UDP_CHKSUM UINT32_C(0x1) 1756 /* 1757 * If set to 1, the controller replaces the IP checksum of the 1758 * normal packets, or the inner IP checksum of the encapsulated 1759 * packets with the hardware calculated IP checksum for the 1760 * packet associated with this descriptor. 1761 */ 1762 #define TX_BD_LONG_INLINE_LFLAGS_IP_CHKSUM UINT32_C(0x2) 1763 /* 1764 * If set to 1, the controller will not append an Ethernet CRC 1765 * to the end of the frame. 1766 * 1767 * Packet must be 64B or longer when this flag is set. It is not 1768 * useful to use this bit with any form of TX offload such as 1769 * CSO or LSO. The intent is that the packet from the host already 1770 * has a valid Ethernet CRC on the packet. 1771 */ 1772 #define TX_BD_LONG_INLINE_LFLAGS_NOCRC UINT32_C(0x4) 1773 /* 1774 * If set to 1, the device will record the time at which the packet 1775 * was actually transmitted at the TX MAC. 1776 */ 1777 #define TX_BD_LONG_INLINE_LFLAGS_STAMP UINT32_C(0x8) 1778 /* 1779 * If set to 1, the controller replaces the tunnel IP checksum 1780 * field with hardware calculated IP checksum for the IP header 1781 * of the packet associated with this descriptor. The hardware 1782 * updates an outer UDP checksum if it is non-zero. 1783 */ 1784 #define TX_BD_LONG_INLINE_LFLAGS_T_IP_CHKSUM UINT32_C(0x10) 1785 /* 1786 * This bit must be 0 for BDs of this type. LSO is not supported with 1787 * inline BDs. 1788 */ 1789 #define TX_BD_LONG_INLINE_LFLAGS_LSO UINT32_C(0x20) 1790 /* Since LSO is not supported with inline BDs, this bit is not used. */ 1791 #define TX_BD_LONG_INLINE_LFLAGS_IPID_FMT UINT32_C(0x40) 1792 /* Since LSO is not supported with inline BDs, this bit is not used. */ 1793 #define TX_BD_LONG_INLINE_LFLAGS_T_IPID UINT32_C(0x80) 1794 /* 1795 * If set to '1', then the RoCE ICRC will be appended to the 1796 * packet. Packet must be a valid RoCE format packet. 1797 */ 1798 #define TX_BD_LONG_INLINE_LFLAGS_ROCE_CRC UINT32_C(0x100) 1799 /* 1800 * If set to '1', then the FCoE CRC will be appended to the 1801 * packet. Packet must be a valid FCoE format packet. 1802 */ 1803 #define TX_BD_LONG_INLINE_LFLAGS_FCOE_CRC UINT32_C(0x200) 1804 uint16_t unused2; 1805 uint32_t unused3; 1806 uint16_t unused4; 1807 /* 1808 * This value selects a CFA action to perform on the packet. 1809 * Set this value to zero if no CFA action is desired. 1810 * 1811 * This value must be valid on the first BD of a packet. 1812 */ 1813 uint16_t cfa_action; 1814 /* 1815 * This value is action meta-data that defines CFA edit operations 1816 * that are done in addition to any action editing. 1817 */ 1818 uint32_t cfa_meta; 1819 /* When key = 1, this is the VLAN tag VID value. */ 1820 #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_MASK UINT32_C(0xfff) 1821 #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_SFT 0 1822 /* When key = 1, this is the VLAN tag DE value. */ 1823 #define TX_BD_LONG_INLINE_CFA_META_VLAN_DE UINT32_C(0x1000) 1824 /* When key = 1, this is the VLAN tag PRI value. */ 1825 #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_MASK UINT32_C(0xe000) 1826 #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_SFT 13 1827 /* When key = 1, this is the VLAN tag TPID select value. */ 1828 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_MASK UINT32_C(0x70000) 1829 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_SFT 16 1830 /* 0x88a8 */ 1831 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID88A8 \ 1832 (UINT32_C(0x0) << 16) 1833 /* 0x8100 */ 1834 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID8100 \ 1835 (UINT32_C(0x1) << 16) 1836 /* 0x9100 */ 1837 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9100 \ 1838 (UINT32_C(0x2) << 16) 1839 /* 0x9200 */ 1840 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9200 \ 1841 (UINT32_C(0x3) << 16) 1842 /* 0x9300 */ 1843 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9300 \ 1844 (UINT32_C(0x4) << 16) 1845 /* Value programmed in CFA VLANTPID register. */ 1846 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG \ 1847 (UINT32_C(0x5) << 16) 1848 #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_LAST \ 1849 TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG 1850 #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_MASK \ 1851 UINT32_C(0xff80000) 1852 #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_SFT 19 1853 /* 1854 * This field identifies the type of edit to be performed 1855 * on the packet. 1856 * 1857 * This value must be valid on the first BD of a packet. 1858 */ 1859 #define TX_BD_LONG_INLINE_CFA_META_KEY_MASK \ 1860 UINT32_C(0xf0000000) 1861 #define TX_BD_LONG_INLINE_CFA_META_KEY_SFT 28 1862 /* No editing */ 1863 #define TX_BD_LONG_INLINE_CFA_META_KEY_NONE \ 1864 (UINT32_C(0x0) << 28) 1865 /* 1866 * - meta[17:16] - TPID select value (0 = 0x8100). 1867 * - meta[15:12] - PRI/DE value. 1868 * - meta[11:0] - VID value. 1869 */ 1870 #define TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG \ 1871 (UINT32_C(0x1) << 28) 1872 #define TX_BD_LONG_INLINE_CFA_META_KEY_LAST \ 1873 TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG 1874 } __attribute__((packed)); 1875 1876 /* tx_bd_empty (size:128b/16B) */ 1877 struct tx_bd_empty { 1878 /* This value identifies the type of buffer descriptor. */ 1879 uint8_t type; 1880 #define TX_BD_EMPTY_TYPE_MASK UINT32_C(0x3f) 1881 #define TX_BD_EMPTY_TYPE_SFT 0 1882 /* 1883 * Indicates that this BD is 1BB long and is an empty 1884 * TX BD. Not valid for use by the driver. 1885 */ 1886 #define TX_BD_EMPTY_TYPE_TX_BD_EMPTY UINT32_C(0x1) 1887 #define TX_BD_EMPTY_TYPE_LAST TX_BD_EMPTY_TYPE_TX_BD_EMPTY 1888 uint8_t unused_1[3]; 1889 uint8_t unused_2; 1890 uint8_t unused_3[3]; 1891 uint8_t unused_4[8]; 1892 } __attribute__((packed)); 1893 1894 /* rx_prod_pkt_bd (size:128b/16B) */ 1895 struct rx_prod_pkt_bd { 1896 /* This value identifies the type of buffer descriptor. */ 1897 uint16_t flags_type; 1898 /* This value identifies the type of buffer descriptor. */ 1899 #define RX_PROD_PKT_BD_TYPE_MASK UINT32_C(0x3f) 1900 #define RX_PROD_PKT_BD_TYPE_SFT 0 1901 /* 1902 * Indicates that this BD is 16B long and is an RX Producer 1903 * (ie. empty) buffer descriptor. 1904 */ 1905 #define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT UINT32_C(0x4) 1906 #define RX_PROD_PKT_BD_TYPE_LAST \ 1907 RX_PROD_PKT_BD_TYPE_RX_PROD_PKT 1908 #define RX_PROD_PKT_BD_FLAGS_MASK UINT32_C(0xffc0) 1909 #define RX_PROD_PKT_BD_FLAGS_SFT 6 1910 /* 1911 * If set to 1, the packet will be placed at the address plus 1912 * 2B. The 2 Bytes of padding will be written as zero. 1913 */ 1914 #define RX_PROD_PKT_BD_FLAGS_SOP_PAD UINT32_C(0x40) 1915 /* 1916 * If set to 1, the packet write will be padded out to the 1917 * nearest cache-line with zero value padding. 1918 */ 1919 #define RX_PROD_PKT_BD_FLAGS_EOP_PAD UINT32_C(0x80) 1920 /* 1921 * This value is the number of additional buffers in the ring that 1922 * describe the buffer space to be consumed for the this packet. 1923 * If the value is zero, then the packet must fit within the 1924 * space described by this BD. If this value is 1 or more, it 1925 * indicates how many additional "buffer" BDs are in the ring 1926 * immediately following this BD to be used for the same 1927 * network packet. 1928 * 1929 * Even if the packet to be placed does not need all the 1930 * additional buffers, they will be consumed anyway. 1931 */ 1932 #define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300) 1933 #define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT 8 1934 /* 1935 * This is the length in Bytes of the host physical buffer where 1936 * data for the packet may be placed in host memory. 1937 */ 1938 uint16_t len; 1939 /* 1940 * The opaque data field is pass through to the completion and can be 1941 * used for any data that the driver wants to associate with this 1942 * receive buffer set. 1943 */ 1944 uint32_t opaque; 1945 /* 1946 * This is the host physical address where data for the packet may 1947 * by placed in host memory. 1948 */ 1949 uint64_t address; 1950 } __attribute__((packed)); 1951 1952 /* rx_prod_bfr_bd (size:128b/16B) */ 1953 struct rx_prod_bfr_bd { 1954 /* This value identifies the type of buffer descriptor. */ 1955 uint16_t flags_type; 1956 /* This value identifies the type of buffer descriptor. */ 1957 #define RX_PROD_BFR_BD_TYPE_MASK UINT32_C(0x3f) 1958 #define RX_PROD_BFR_BD_TYPE_SFT 0 1959 /* 1960 * Indicates that this BD is 16B long and is an RX 1961 * Producer Buffer BD. 1962 */ 1963 #define RX_PROD_BFR_BD_TYPE_RX_PROD_BFR UINT32_C(0x5) 1964 #define RX_PROD_BFR_BD_TYPE_LAST RX_PROD_BFR_BD_TYPE_RX_PROD_BFR 1965 #define RX_PROD_BFR_BD_FLAGS_MASK UINT32_C(0xffc0) 1966 #define RX_PROD_BFR_BD_FLAGS_SFT 6 1967 /* 1968 * This is the length in Bytes of the host physical buffer where 1969 * data for the packet may be placed in host memory. 1970 */ 1971 uint16_t len; 1972 /* This field is not used. */ 1973 uint32_t opaque; 1974 /* 1975 * This is the host physical address where data for the packet may 1976 * by placed in host memory. 1977 */ 1978 uint64_t address; 1979 } __attribute__((packed)); 1980 1981 /* rx_prod_agg_bd (size:128b/16B) */ 1982 struct rx_prod_agg_bd { 1983 /* This value identifies the type of buffer descriptor. */ 1984 uint16_t flags_type; 1985 /* This value identifies the type of buffer descriptor. */ 1986 #define RX_PROD_AGG_BD_TYPE_MASK UINT32_C(0x3f) 1987 #define RX_PROD_AGG_BD_TYPE_SFT 0 1988 /* 1989 * Indicates that this BD is 16B long and is an 1990 * RX Producer Assembly Buffer Descriptor. 1991 */ 1992 #define RX_PROD_AGG_BD_TYPE_RX_PROD_AGG UINT32_C(0x6) 1993 #define RX_PROD_AGG_BD_TYPE_LAST \ 1994 RX_PROD_AGG_BD_TYPE_RX_PROD_AGG 1995 #define RX_PROD_AGG_BD_FLAGS_MASK UINT32_C(0xffc0) 1996 #define RX_PROD_AGG_BD_FLAGS_SFT 6 1997 /* 1998 * If set to 1, the packet write will be padded out to the 1999 * nearest cache-line with zero value padding. 2000 */ 2001 #define RX_PROD_AGG_BD_FLAGS_EOP_PAD UINT32_C(0x40) 2002 /* 2003 * This is the length in Bytes of the host physical buffer where 2004 * data for the packet may be placed in host memory. 2005 */ 2006 uint16_t len; 2007 /* 2008 * The opaque data field is pass through to the completion and can be 2009 * used for any data that the driver wants to associate with this 2010 * receive assembly buffer. 2011 */ 2012 uint32_t opaque; 2013 /* 2014 * This is the host physical address where data for the packet may 2015 * by placed in host memory. 2016 */ 2017 uint64_t address; 2018 } __attribute__((packed)); 2019 2020 /* cmpl_base (size:128b/16B) */ 2021 struct cmpl_base { 2022 uint16_t type; 2023 /* 2024 * This field indicates the exact type of the completion. 2025 * By convention, the LSB identifies the length of the 2026 * record in 16B units. Even values indicate 16B 2027 * records. Odd values indicate 32B 2028 * records. 2029 */ 2030 #define CMPL_BASE_TYPE_MASK UINT32_C(0x3f) 2031 #define CMPL_BASE_TYPE_SFT 0 2032 /* 2033 * TX L2 completion: 2034 * Completion of TX packet. Length = 16B 2035 */ 2036 #define CMPL_BASE_TYPE_TX_L2 UINT32_C(0x0) 2037 /* 2038 * RX L2 completion: 2039 * Completion of and L2 RX packet. Length = 32B 2040 */ 2041 #define CMPL_BASE_TYPE_RX_L2 UINT32_C(0x11) 2042 /* 2043 * RX Aggregation Buffer completion : 2044 * Completion of an L2 aggregation buffer in support of 2045 * TPA, HDS, or Jumbo packet completion. Length = 16B 2046 */ 2047 #define CMPL_BASE_TYPE_RX_AGG UINT32_C(0x12) 2048 /* 2049 * RX L2 TPA Start Completion: 2050 * Completion at the beginning of a TPA operation. 2051 * Length = 32B 2052 */ 2053 #define CMPL_BASE_TYPE_RX_TPA_START UINT32_C(0x13) 2054 /* 2055 * RX L2 TPA End Completion: 2056 * Completion at the end of a TPA operation. 2057 * Length = 32B 2058 */ 2059 #define CMPL_BASE_TYPE_RX_TPA_END UINT32_C(0x15) 2060 /* 2061 * Statistics Ejection Completion: 2062 * Completion of statistics data ejection buffer. 2063 * Length = 16B 2064 */ 2065 #define CMPL_BASE_TYPE_STAT_EJECT UINT32_C(0x1a) 2066 /* 2067 * HWRM Command Completion: 2068 * Completion of an HWRM command. 2069 */ 2070 #define CMPL_BASE_TYPE_HWRM_DONE UINT32_C(0x20) 2071 /* Forwarded HWRM Request */ 2072 #define CMPL_BASE_TYPE_HWRM_FWD_REQ UINT32_C(0x22) 2073 /* Forwarded HWRM Response */ 2074 #define CMPL_BASE_TYPE_HWRM_FWD_RESP UINT32_C(0x24) 2075 /* HWRM Asynchronous Event Information */ 2076 #define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e) 2077 /* CQ Notification */ 2078 #define CMPL_BASE_TYPE_CQ_NOTIFICATION UINT32_C(0x30) 2079 /* SRQ Threshold Event */ 2080 #define CMPL_BASE_TYPE_SRQ_EVENT UINT32_C(0x32) 2081 /* DBQ Threshold Event */ 2082 #define CMPL_BASE_TYPE_DBQ_EVENT UINT32_C(0x34) 2083 /* QP Async Notification */ 2084 #define CMPL_BASE_TYPE_QP_EVENT UINT32_C(0x38) 2085 /* Function Async Notification */ 2086 #define CMPL_BASE_TYPE_FUNC_EVENT UINT32_C(0x3a) 2087 #define CMPL_BASE_TYPE_LAST CMPL_BASE_TYPE_FUNC_EVENT 2088 /* info1 is 16 b */ 2089 uint16_t info1; 2090 /* info2 is 32 b */ 2091 uint32_t info2; 2092 /* 2093 * This value is written by the NIC such that it will be different 2094 * for each pass through the completion queue. The even passes 2095 * will write 1. The odd passes will write 0. 2096 */ 2097 uint32_t info3_v; 2098 #define CMPL_BASE_V UINT32_C(0x1) 2099 #define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe) 2100 #define CMPL_BASE_INFO3_SFT 1 2101 /* info4 is 32 b */ 2102 uint32_t info4; 2103 } __attribute__((packed)); 2104 2105 /* tx_cmpl (size:128b/16B) */ 2106 struct tx_cmpl { 2107 uint16_t flags_type; 2108 /* 2109 * This field indicates the exact type of the completion. 2110 * By convention, the LSB identifies the length of the 2111 * record in 16B units. Even values indicate 16B 2112 * records. Odd values indicate 32B 2113 * records. 2114 */ 2115 #define TX_CMPL_TYPE_MASK UINT32_C(0x3f) 2116 #define TX_CMPL_TYPE_SFT 0 2117 /* 2118 * TX L2 completion: 2119 * Completion of TX packet. Length = 16B 2120 */ 2121 #define TX_CMPL_TYPE_TX_L2 UINT32_C(0x0) 2122 #define TX_CMPL_TYPE_LAST TX_CMPL_TYPE_TX_L2 2123 #define TX_CMPL_FLAGS_MASK UINT32_C(0xffc0) 2124 #define TX_CMPL_FLAGS_SFT 6 2125 /* 2126 * When this bit is '1', it indicates a packet that has an 2127 * error of some type. Type of error is indicated in 2128 * error_flags. 2129 */ 2130 #define TX_CMPL_FLAGS_ERROR UINT32_C(0x40) 2131 /* 2132 * When this bit is '1', it indicates that the packet completed 2133 * was transmitted using the push acceleration data provided 2134 * by the driver. When this bit is '0', it indicates that the 2135 * packet had not push acceleration data written or was executed 2136 * as a normal packet even though push data was provided. 2137 */ 2138 #define TX_CMPL_FLAGS_PUSH UINT32_C(0x80) 2139 /* unused1 is 16 b */ 2140 uint16_t unused_0; 2141 /* 2142 * This is a copy of the opaque field from the first TX BD of this 2143 * transmitted packet. 2144 */ 2145 uint32_t opaque; 2146 uint16_t errors_v; 2147 /* 2148 * This value is written by the NIC such that it will be different 2149 * for each pass through the completion queue. The even passes 2150 * will write 1. The odd passes will write 0. 2151 */ 2152 #define TX_CMPL_V UINT32_C(0x1) 2153 #define TX_CMPL_ERRORS_MASK UINT32_C(0xfffe) 2154 #define TX_CMPL_ERRORS_SFT 1 2155 /* 2156 * This error indicates that there was some sort of problem 2157 * with the BDs for the packet. 2158 */ 2159 #define TX_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe) 2160 #define TX_CMPL_ERRORS_BUFFER_ERROR_SFT 1 2161 /* No error */ 2162 #define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR (UINT32_C(0x0) << 1) 2163 /* 2164 * Bad Format: 2165 * BDs were not formatted correctly. 2166 */ 2167 #define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT (UINT32_C(0x2) << 1) 2168 #define TX_CMPL_ERRORS_BUFFER_ERROR_LAST \ 2169 TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT 2170 /* 2171 * When this bit is '1', it indicates that the length of 2172 * the packet was zero. No packet was transmitted. 2173 */ 2174 #define TX_CMPL_ERRORS_ZERO_LENGTH_PKT UINT32_C(0x10) 2175 /* 2176 * When this bit is '1', it indicates that the packet 2177 * was longer than the programmed limit in TDI. No 2178 * packet was transmitted. 2179 */ 2180 #define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH UINT32_C(0x20) 2181 /* 2182 * When this bit is '1', it indicates that one or more of the 2183 * BDs associated with this packet generated a PCI error. 2184 * This probably means the address was not valid. 2185 */ 2186 #define TX_CMPL_ERRORS_DMA_ERROR UINT32_C(0x40) 2187 /* 2188 * When this bit is '1', it indicates that the packet was longer 2189 * than indicated by the hint. No packet was transmitted. 2190 */ 2191 #define TX_CMPL_ERRORS_HINT_TOO_SHORT UINT32_C(0x80) 2192 /* 2193 * When this bit is '1', it indicates that the packet was 2194 * dropped due to Poison TLP error on one or more of the 2195 * TLPs in the PXP completion. 2196 */ 2197 #define TX_CMPL_ERRORS_POISON_TLP_ERROR UINT32_C(0x100) 2198 /* unused2 is 16 b */ 2199 uint16_t unused_1; 2200 /* unused3 is 32 b */ 2201 uint32_t unused_2; 2202 } __attribute__((packed)); 2203 2204 /* rx_pkt_cmpl (size:128b/16B) */ 2205 struct rx_pkt_cmpl { 2206 uint16_t flags_type; 2207 /* 2208 * This field indicates the exact type of the completion. 2209 * By convention, the LSB identifies the length of the 2210 * record in 16B units. Even values indicate 16B 2211 * records. Odd values indicate 32B 2212 * records. 2213 */ 2214 #define RX_PKT_CMPL_TYPE_MASK UINT32_C(0x3f) 2215 #define RX_PKT_CMPL_TYPE_SFT 0 2216 /* 2217 * RX L2 completion: 2218 * Completion of and L2 RX packet. Length = 32B 2219 */ 2220 #define RX_PKT_CMPL_TYPE_RX_L2 UINT32_C(0x11) 2221 #define RX_PKT_CMPL_TYPE_LAST RX_PKT_CMPL_TYPE_RX_L2 2222 #define RX_PKT_CMPL_FLAGS_MASK UINT32_C(0xffc0) 2223 #define RX_PKT_CMPL_FLAGS_SFT 6 2224 /* 2225 * When this bit is '1', it indicates a packet that has an 2226 * error of some type. Type of error is indicated in 2227 * error_flags. 2228 */ 2229 #define RX_PKT_CMPL_FLAGS_ERROR UINT32_C(0x40) 2230 /* This field indicates how the packet was placed in the buffer. */ 2231 #define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380) 2232 #define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT 7 2233 /* 2234 * Normal: 2235 * Packet was placed using normal algorithm. 2236 */ 2237 #define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL (UINT32_C(0x0) << 7) 2238 /* 2239 * Jumbo: 2240 * Packet was placed using jumbo algorithm. 2241 */ 2242 #define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7) 2243 /* 2244 * Header/Data Separation: 2245 * Packet was placed using Header/Data separation algorithm. 2246 * The separation location is indicated by the itype field. 2247 */ 2248 #define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7) 2249 #define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST \ 2250 RX_PKT_CMPL_FLAGS_PLACEMENT_HDS 2251 /* This bit is '1' if the RSS field in this completion is valid. */ 2252 #define RX_PKT_CMPL_FLAGS_RSS_VALID UINT32_C(0x400) 2253 /* unused is 1 b */ 2254 #define RX_PKT_CMPL_FLAGS_UNUSED UINT32_C(0x800) 2255 /* 2256 * This value indicates what the inner packet determined for the 2257 * packet was. 2258 */ 2259 #define RX_PKT_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000) 2260 #define RX_PKT_CMPL_FLAGS_ITYPE_SFT 12 2261 /* 2262 * Not Known: 2263 * Indicates that the packet type was not known. 2264 */ 2265 #define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN \ 2266 (UINT32_C(0x0) << 12) 2267 /* 2268 * IP Packet: 2269 * Indicates that the packet was an IP packet, but further 2270 * classification was not possible. 2271 */ 2272 #define RX_PKT_CMPL_FLAGS_ITYPE_IP \ 2273 (UINT32_C(0x1) << 12) 2274 /* 2275 * TCP Packet: 2276 * Indicates that the packet was IP and TCP. 2277 * This indicates that the payload_offset field is valid. 2278 */ 2279 #define RX_PKT_CMPL_FLAGS_ITYPE_TCP \ 2280 (UINT32_C(0x2) << 12) 2281 /* 2282 * UDP Packet: 2283 * Indicates that the packet was IP and UDP. 2284 * This indicates that the payload_offset field is valid. 2285 */ 2286 #define RX_PKT_CMPL_FLAGS_ITYPE_UDP \ 2287 (UINT32_C(0x3) << 12) 2288 /* 2289 * FCoE Packet: 2290 * Indicates that the packet was recognized as a FCoE. 2291 * This also indicates that the payload_offset field is valid. 2292 */ 2293 #define RX_PKT_CMPL_FLAGS_ITYPE_FCOE \ 2294 (UINT32_C(0x4) << 12) 2295 /* 2296 * RoCE Packet: 2297 * Indicates that the packet was recognized as a RoCE. 2298 * This also indicates that the payload_offset field is valid. 2299 */ 2300 #define RX_PKT_CMPL_FLAGS_ITYPE_ROCE \ 2301 (UINT32_C(0x5) << 12) 2302 /* 2303 * ICMP Packet: 2304 * Indicates that the packet was recognized as ICMP. 2305 * This indicates that the payload_offset field is valid. 2306 */ 2307 #define RX_PKT_CMPL_FLAGS_ITYPE_ICMP \ 2308 (UINT32_C(0x7) << 12) 2309 /* 2310 * PtP packet wo/timestamp: 2311 * Indicates that the packet was recognized as a PtP 2312 * packet. 2313 */ 2314 #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \ 2315 (UINT32_C(0x8) << 12) 2316 /* 2317 * PtP packet w/timestamp: 2318 * Indicates that the packet was recognized as a PtP 2319 * packet and that a timestamp was taken for the packet. 2320 */ 2321 #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \ 2322 (UINT32_C(0x9) << 12) 2323 #define RX_PKT_CMPL_FLAGS_ITYPE_LAST \ 2324 RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP 2325 /* 2326 * This is the length of the data for the packet stored in the 2327 * buffer(s) identified by the opaque value. This includes 2328 * the packet BD and any associated buffer BDs. This does not include 2329 * the the length of any data places in aggregation BDs. 2330 */ 2331 uint16_t len; 2332 /* 2333 * This is a copy of the opaque field from the RX BD this completion 2334 * corresponds to. 2335 */ 2336 uint32_t opaque; 2337 uint8_t agg_bufs_v1; 2338 /* 2339 * This value is written by the NIC such that it will be different 2340 * for each pass through the completion queue. The even passes 2341 * will write 1. The odd passes will write 0. 2342 */ 2343 #define RX_PKT_CMPL_V1 UINT32_C(0x1) 2344 /* 2345 * This value is the number of aggregation buffers that follow this 2346 * entry in the completion ring that are a part of this packet. 2347 * If the value is zero, then the packet is completely contained 2348 * in the buffer space provided for the packet in the RX ring. 2349 */ 2350 #define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e) 2351 #define RX_PKT_CMPL_AGG_BUFS_SFT 1 2352 /* unused1 is 2 b */ 2353 #define RX_PKT_CMPL_UNUSED1_MASK UINT32_C(0xc0) 2354 #define RX_PKT_CMPL_UNUSED1_SFT 6 2355 /* 2356 * This is the RSS hash type for the packet. The value is packed 2357 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}. 2358 * 2359 * The value of tuple_extrac_op provides the information about 2360 * what fields the hash was computed on. 2361 * * 0: The RSS hash was computed over source IP address, 2362 * destination IP address, source port, and destination port of inner 2363 * IP and TCP or UDP headers. Note: For non-tunneled packets, 2364 * the packet headers are considered inner packet headers for the RSS 2365 * hash computation purpose. 2366 * * 1: The RSS hash was computed over source IP address and destination 2367 * IP address of inner IP header. Note: For non-tunneled packets, 2368 * the packet headers are considered inner packet headers for the RSS 2369 * hash computation purpose. 2370 * * 2: The RSS hash was computed over source IP address, 2371 * destination IP address, source port, and destination port of 2372 * IP and TCP or UDP headers of outer tunnel headers. 2373 * Note: For non-tunneled packets, this value is not applicable. 2374 * * 3: The RSS hash was computed over source IP address and 2375 * destination IP address of IP header of outer tunnel headers. 2376 * Note: For non-tunneled packets, this value is not applicable. 2377 * 2378 * Note that 4-tuples values listed above are applicable 2379 * for layer 4 protocols supported and enabled for RSS in the hardware, 2380 * HWRM firmware, and drivers. For example, if RSS hash is supported and 2381 * enabled for TCP traffic only, then the values of tuple_extract_op 2382 * corresponding to 4-tuples are only valid for TCP traffic. 2383 */ 2384 uint8_t rss_hash_type; 2385 /* 2386 * This value indicates the offset in bytes from the beginning of the packet 2387 * where the inner payload starts. This value is valid for TCP, UDP, 2388 * FCoE, and RoCE packets. 2389 * 2390 * A value of zero indicates that header is 256B into the packet. 2391 */ 2392 uint8_t payload_offset; 2393 /* unused2 is 8 b */ 2394 uint8_t unused1; 2395 /* 2396 * This value is the RSS hash value calculated for the packet 2397 * based on the mode bits and key value in the VNIC. 2398 */ 2399 uint32_t rss_hash; 2400 } __attribute__((packed)); 2401 2402 /* Last 16 bytes of rx_pkt_cmpl. */ 2403 /* rx_pkt_cmpl_hi (size:128b/16B) */ 2404 struct rx_pkt_cmpl_hi { 2405 uint32_t flags2; 2406 /* 2407 * This indicates that the ip checksum was calculated for the 2408 * inner packet and that the ip_cs_error field indicates if there 2409 * was an error. 2410 */ 2411 #define RX_PKT_CMPL_FLAGS2_IP_CS_CALC UINT32_C(0x1) 2412 /* 2413 * This indicates that the TCP, UDP or ICMP checksum was 2414 * calculated for the inner packet and that the l4_cs_error field 2415 * indicates if there was an error. 2416 */ 2417 #define RX_PKT_CMPL_FLAGS2_L4_CS_CALC UINT32_C(0x2) 2418 /* 2419 * This indicates that the ip checksum was calculated for the 2420 * tunnel header and that the t_ip_cs_error field indicates if there 2421 * was an error. 2422 */ 2423 #define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC UINT32_C(0x4) 2424 /* 2425 * This indicates that the UDP checksum was 2426 * calculated for the tunnel packet and that the t_l4_cs_error field 2427 * indicates if there was an error. 2428 */ 2429 #define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC UINT32_C(0x8) 2430 /* This value indicates what format the metadata field is. */ 2431 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0) 2432 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT 4 2433 /* No metadata informtaion. Value is zero. */ 2434 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4) 2435 /* 2436 * The metadata field contains the VLAN tag and TPID value. 2437 * - metadata[11:0] contains the vlan VID value. 2438 * - metadata[12] contains the vlan DE value. 2439 * - metadata[15:13] contains the vlan PRI value. 2440 * - metadata[31:16] contains the vlan TPID value. 2441 */ 2442 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4) 2443 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST \ 2444 RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN 2445 /* 2446 * This field indicates the IP type for the inner-most IP header. 2447 * A value of '0' indicates IPv4. A value of '1' indicates IPv6. 2448 * This value is only valid if itype indicates a packet 2449 * with an IP header. 2450 */ 2451 #define RX_PKT_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100) 2452 /* 2453 * This is data from the CFA block as indicated by the meta_format 2454 * field. 2455 */ 2456 uint32_t metadata; 2457 /* When meta_format=1, this value is the VLAN VID. */ 2458 #define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff) 2459 #define RX_PKT_CMPL_METADATA_VID_SFT 0 2460 /* When meta_format=1, this value is the VLAN DE. */ 2461 #define RX_PKT_CMPL_METADATA_DE UINT32_C(0x1000) 2462 /* When meta_format=1, this value is the VLAN PRI. */ 2463 #define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000) 2464 #define RX_PKT_CMPL_METADATA_PRI_SFT 13 2465 /* When meta_format=1, this value is the VLAN TPID. */ 2466 #define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000) 2467 #define RX_PKT_CMPL_METADATA_TPID_SFT 16 2468 uint16_t errors_v2; 2469 /* 2470 * This value is written by the NIC such that it will be different 2471 * for each pass through the completion queue. The even passes 2472 * will write 1. The odd passes will write 0. 2473 */ 2474 #define RX_PKT_CMPL_V2 \ 2475 UINT32_C(0x1) 2476 #define RX_PKT_CMPL_ERRORS_MASK \ 2477 UINT32_C(0xfffe) 2478 #define RX_PKT_CMPL_ERRORS_SFT 1 2479 /* 2480 * This error indicates that there was some sort of problem with 2481 * the BDs for the packet that was found after part of the 2482 * packet was already placed. The packet should be treated as 2483 * invalid. 2484 */ 2485 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK \ 2486 UINT32_C(0xe) 2487 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT 1 2488 /* No buffer error */ 2489 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \ 2490 (UINT32_C(0x0) << 1) 2491 /* 2492 * Did Not Fit: 2493 * Packet did not fit into packet buffer provided. 2494 * For regular placement, this means the packet did not fit 2495 * in the buffer provided. For HDS and jumbo placement, this 2496 * means that the packet could not be placed into 7 physical 2497 * buffers or less. 2498 */ 2499 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \ 2500 (UINT32_C(0x1) << 1) 2501 /* 2502 * Not On Chip: 2503 * All BDs needed for the packet were not on-chip when 2504 * the packet arrived. 2505 */ 2506 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \ 2507 (UINT32_C(0x2) << 1) 2508 /* 2509 * Bad Format: 2510 * BDs were not formatted correctly. 2511 */ 2512 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \ 2513 (UINT32_C(0x3) << 1) 2514 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST \ 2515 RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT 2516 /* 2517 * This indicates that there was an error in the IP header 2518 * checksum. 2519 */ 2520 #define RX_PKT_CMPL_ERRORS_IP_CS_ERROR \ 2521 UINT32_C(0x10) 2522 /* 2523 * This indicates that there was an error in the TCP, UDP 2524 * or ICMP checksum. 2525 */ 2526 #define RX_PKT_CMPL_ERRORS_L4_CS_ERROR \ 2527 UINT32_C(0x20) 2528 /* 2529 * This indicates that there was an error in the tunnel 2530 * IP header checksum. 2531 */ 2532 #define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR \ 2533 UINT32_C(0x40) 2534 /* 2535 * This indicates that there was an error in the tunnel 2536 * UDP checksum. 2537 */ 2538 #define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR \ 2539 UINT32_C(0x80) 2540 /* 2541 * This indicates that there was a CRC error on either an FCoE 2542 * or RoCE packet. The itype indicates the packet type. 2543 */ 2544 #define RX_PKT_CMPL_ERRORS_CRC_ERROR \ 2545 UINT32_C(0x100) 2546 /* 2547 * This indicates that there was an error in the tunnel 2548 * portion of the packet when this 2549 * field is non-zero. 2550 */ 2551 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK \ 2552 UINT32_C(0xe00) 2553 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT 9 2554 /* 2555 * No additional error occurred on the tunnel portion 2556 * of the packet of the packet does not have a tunnel. 2557 */ 2558 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR \ 2559 (UINT32_C(0x0) << 9) 2560 /* 2561 * Indicates that IP header version does not match 2562 * expectation from L2 Ethertype for IPv4 and IPv6 2563 * in the tunnel header. 2564 */ 2565 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \ 2566 (UINT32_C(0x1) << 9) 2567 /* 2568 * Indicates that header length is out of range in the 2569 * tunnel header. Valid for 2570 * IPv4. 2571 */ 2572 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \ 2573 (UINT32_C(0x2) << 9) 2574 /* 2575 * Indicates that the physical packet is shorter than that 2576 * claimed by the PPPoE header length for a tunnel PPPoE 2577 * packet. 2578 */ 2579 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \ 2580 (UINT32_C(0x3) << 9) 2581 /* 2582 * Indicates that physical packet is shorter than that claimed 2583 * by the tunnel l3 header length. Valid for IPv4, or IPv6 2584 * tunnel packet packets. 2585 */ 2586 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \ 2587 (UINT32_C(0x4) << 9) 2588 /* 2589 * Indicates that the physical packet is shorter than that 2590 * claimed by the tunnel UDP header length for a tunnel 2591 * UDP packet that is not fragmented. 2592 */ 2593 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \ 2594 (UINT32_C(0x5) << 9) 2595 /* 2596 * indicates that the IPv4 TTL or IPv6 hop limit check 2597 * have failed (e.g. TTL = 0) in the tunnel header. Valid 2598 * for IPv4, and IPv6. 2599 */ 2600 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \ 2601 (UINT32_C(0x6) << 9) 2602 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST \ 2603 RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL 2604 /* 2605 * This indicates that there was an error in the inner 2606 * portion of the packet when this 2607 * field is non-zero. 2608 */ 2609 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK \ 2610 UINT32_C(0xf000) 2611 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT 12 2612 /* 2613 * No additional error occurred on the tunnel portion 2614 * of the packet of the packet does not have a tunnel. 2615 */ 2616 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR \ 2617 (UINT32_C(0x0) << 12) 2618 /* 2619 * Indicates that IP header version does not match 2620 * expectation from L2 Ethertype for IPv4 and IPv6 or that 2621 * option other than VFT was parsed on 2622 * FCoE packet. 2623 */ 2624 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION \ 2625 (UINT32_C(0x1) << 12) 2626 /* 2627 * indicates that header length is out of range. Valid for 2628 * IPv4 and RoCE 2629 */ 2630 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \ 2631 (UINT32_C(0x2) << 12) 2632 /* 2633 * indicates that the IPv4 TTL or IPv6 hop limit check 2634 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6 2635 */ 2636 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL \ 2637 (UINT32_C(0x3) << 12) 2638 /* 2639 * Indicates that physical packet is shorter than that 2640 * claimed by the l3 header length. Valid for IPv4, 2641 * IPv6 packet or RoCE packets. 2642 */ 2643 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \ 2644 (UINT32_C(0x4) << 12) 2645 /* 2646 * Indicates that the physical packet is shorter than that 2647 * claimed by the UDP header length for a UDP packet that is 2648 * not fragmented. 2649 */ 2650 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \ 2651 (UINT32_C(0x5) << 12) 2652 /* 2653 * Indicates that TCP header length > IP payload. Valid for 2654 * TCP packets only. 2655 */ 2656 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \ 2657 (UINT32_C(0x6) << 12) 2658 /* Indicates that TCP header length < 5. Valid for TCP. */ 2659 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \ 2660 (UINT32_C(0x7) << 12) 2661 /* 2662 * Indicates that TCP option headers result in a TCP header 2663 * size that does not match data offset in TCP header. Valid 2664 * for TCP. 2665 */ 2666 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \ 2667 (UINT32_C(0x8) << 12) 2668 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST \ 2669 RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN 2670 /* 2671 * This field identifies the CFA action rule that was used for this 2672 * packet. 2673 */ 2674 uint16_t cfa_code; 2675 uint32_t reorder; 2676 /* 2677 * This value holds the reordering sequence number for the packet. 2678 * If the reordering sequence is not valid, then this value is zero. 2679 * The reordering domain for the packet is in the bottom 8 to 10b of 2680 * the rss_hash value. The bottom 20b of this value contain the 2681 * ordering domain value for the packet. 2682 */ 2683 #define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff) 2684 #define RX_PKT_CMPL_REORDER_SFT 0 2685 } __attribute__((packed)); 2686 2687 /* rx_tpa_start_cmpl (size:128b/16B) */ 2688 struct rx_tpa_start_cmpl { 2689 uint16_t flags_type; 2690 /* 2691 * This field indicates the exact type of the completion. 2692 * By convention, the LSB identifies the length of the 2693 * record in 16B units. Even values indicate 16B 2694 * records. Odd values indicate 32B 2695 * records. 2696 */ 2697 #define RX_TPA_START_CMPL_TYPE_MASK UINT32_C(0x3f) 2698 #define RX_TPA_START_CMPL_TYPE_SFT 0 2699 /* 2700 * RX L2 TPA Start Completion: 2701 * Completion at the beginning of a TPA operation. 2702 * Length = 32B 2703 */ 2704 #define RX_TPA_START_CMPL_TYPE_RX_TPA_START UINT32_C(0x13) 2705 #define RX_TPA_START_CMPL_TYPE_LAST \ 2706 RX_TPA_START_CMPL_TYPE_RX_TPA_START 2707 #define RX_TPA_START_CMPL_FLAGS_MASK UINT32_C(0xffc0) 2708 #define RX_TPA_START_CMPL_FLAGS_SFT 6 2709 /* This bit will always be '0' for TPA start completions. */ 2710 #define RX_TPA_START_CMPL_FLAGS_ERROR UINT32_C(0x40) 2711 /* This field indicates how the packet was placed in the buffer. */ 2712 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380) 2713 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT 7 2714 /* 2715 * Jumbo: 2716 * TPA Packet was placed using jumbo algorithm. This means 2717 * that the first buffer will be filled with data before 2718 * moving to aggregation buffers. Each aggregation buffer 2719 * will be filled before moving to the next aggregation 2720 * buffer. 2721 */ 2722 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO \ 2723 (UINT32_C(0x1) << 7) 2724 /* 2725 * Header/Data Separation: 2726 * Packet was placed using Header/Data separation algorithm. 2727 * The separation location is indicated by the itype field. 2728 */ 2729 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS \ 2730 (UINT32_C(0x2) << 7) 2731 /* 2732 * GRO/Jumbo: 2733 * Packet will be placed using GRO/Jumbo where the first 2734 * packet is filled with data. Subsequent packets will be 2735 * placed such that any one packet does not span two 2736 * aggregation buffers unless it starts at the beginning of 2737 * an aggregation buffer. 2738 */ 2739 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \ 2740 (UINT32_C(0x5) << 7) 2741 /* 2742 * GRO/Header-Data Separation: 2743 * Packet will be placed using GRO/HDS where the header 2744 * is in the first packet. 2745 * Payload of each packet will be 2746 * placed such that any one packet does not span two 2747 * aggregation buffers unless it starts at the beginning of 2748 * an aggregation buffer. 2749 */ 2750 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \ 2751 (UINT32_C(0x6) << 7) 2752 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST \ 2753 RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS 2754 /* This bit is '1' if the RSS field in this completion is valid. */ 2755 #define RX_TPA_START_CMPL_FLAGS_RSS_VALID UINT32_C(0x400) 2756 /* unused is 1 b */ 2757 #define RX_TPA_START_CMPL_FLAGS_UNUSED UINT32_C(0x800) 2758 /* 2759 * This value indicates what the inner packet determined for the 2760 * packet was. 2761 */ 2762 #define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000) 2763 #define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT 12 2764 /* 2765 * TCP Packet: 2766 * Indicates that the packet was IP and TCP. 2767 */ 2768 #define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP \ 2769 (UINT32_C(0x2) << 12) 2770 #define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST \ 2771 RX_TPA_START_CMPL_FLAGS_ITYPE_TCP 2772 /* 2773 * This value indicates the amount of packet data written to the 2774 * buffer the opaque field in this completion corresponds to. 2775 */ 2776 uint16_t len; 2777 /* 2778 * This is a copy of the opaque field from the RX BD this completion 2779 * corresponds to. 2780 */ 2781 uint32_t opaque; 2782 /* 2783 * This value is written by the NIC such that it will be different 2784 * for each pass through the completion queue. The even passes 2785 * will write 1. The odd passes will write 0. 2786 */ 2787 uint8_t v1; 2788 /* 2789 * This value is written by the NIC such that it will be different 2790 * for each pass through the completion queue. The even passes 2791 * will write 1. The odd passes will write 0. 2792 */ 2793 #define RX_TPA_START_CMPL_V1 UINT32_C(0x1) 2794 #define RX_TPA_START_CMPL_LAST RX_TPA_START_CMPL_V1 2795 /* 2796 * This is the RSS hash type for the packet. The value is packed 2797 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}. 2798 * 2799 * The value of tuple_extrac_op provides the information about 2800 * what fields the hash was computed on. 2801 * * 0: The RSS hash was computed over source IP address, 2802 * destination IP address, source port, and destination port of inner 2803 * IP and TCP or UDP headers. Note: For non-tunneled packets, 2804 * the packet headers are considered inner packet headers for the RSS 2805 * hash computation purpose. 2806 * * 1: The RSS hash was computed over source IP address and destination 2807 * IP address of inner IP header. Note: For non-tunneled packets, 2808 * the packet headers are considered inner packet headers for the RSS 2809 * hash computation purpose. 2810 * * 2: The RSS hash was computed over source IP address, 2811 * destination IP address, source port, and destination port of 2812 * IP and TCP or UDP headers of outer tunnel headers. 2813 * Note: For non-tunneled packets, this value is not applicable. 2814 * * 3: The RSS hash was computed over source IP address and 2815 * destination IP address of IP header of outer tunnel headers. 2816 * Note: For non-tunneled packets, this value is not applicable. 2817 * 2818 * Note that 4-tuples values listed above are applicable 2819 * for layer 4 protocols supported and enabled for RSS in the hardware, 2820 * HWRM firmware, and drivers. For example, if RSS hash is supported and 2821 * enabled for TCP traffic only, then the values of tuple_extract_op 2822 * corresponding to 4-tuples are only valid for TCP traffic. 2823 */ 2824 uint8_t rss_hash_type; 2825 /* 2826 * This is the aggregation ID that the completion is associated 2827 * with. Use this number to correlate the TPA start completion 2828 * with the TPA end completion. 2829 */ 2830 uint16_t agg_id; 2831 /* unused2 is 9 b */ 2832 #define RX_TPA_START_CMPL_UNUSED2_MASK UINT32_C(0x1ff) 2833 #define RX_TPA_START_CMPL_UNUSED2_SFT 0 2834 /* 2835 * This is the aggregation ID that the completion is associated 2836 * with. Use this number to correlate the TPA start completion 2837 * with the TPA end completion. 2838 */ 2839 #define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00) 2840 #define RX_TPA_START_CMPL_AGG_ID_SFT 9 2841 /* 2842 * This value is the RSS hash value calculated for the packet 2843 * based on the mode bits and key value in the VNIC. 2844 */ 2845 uint32_t rss_hash; 2846 } __attribute__((packed)); 2847 2848 /* Last 16 bytes of rx_tpq_start_cmpl. */ 2849 /* rx_tpa_start_cmpl_hi (size:128b/16B) */ 2850 struct rx_tpa_start_cmpl_hi { 2851 uint32_t flags2; 2852 /* 2853 * This indicates that the ip checksum was calculated for the 2854 * inner packet and that the sum passed for all segments 2855 * included in the aggregation. 2856 */ 2857 #define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC UINT32_C(0x1) 2858 /* 2859 * This indicates that the TCP, UDP or ICMP checksum was 2860 * calculated for the inner packet and that the sum passed 2861 * for all segments included in the aggregation. 2862 */ 2863 #define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC UINT32_C(0x2) 2864 /* 2865 * This indicates that the ip checksum was calculated for the 2866 * tunnel header and that the sum passed for all segments 2867 * included in the aggregation. 2868 */ 2869 #define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC UINT32_C(0x4) 2870 /* 2871 * This indicates that the UDP checksum was 2872 * calculated for the tunnel packet and that the sum passed for 2873 * all segments included in the aggregation. 2874 */ 2875 #define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC UINT32_C(0x8) 2876 /* This value indicates what format the metadata field is. */ 2877 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0) 2878 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT 4 2879 /* No metadata informtaion. Value is zero. */ 2880 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE \ 2881 (UINT32_C(0x0) << 4) 2882 /* 2883 * The metadata field contains the VLAN tag and TPID value. 2884 * - metadata[11:0] contains the vlan VID value. 2885 * - metadata[12] contains the vlan DE value. 2886 * - metadata[15:13] contains the vlan PRI value. 2887 * - metadata[31:16] contains the vlan TPID value. 2888 */ 2889 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN \ 2890 (UINT32_C(0x1) << 4) 2891 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST \ 2892 RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN 2893 /* 2894 * This field indicates the IP type for the inner-most IP header. 2895 * A value of '0' indicates IPv4. A value of '1' indicates IPv6. 2896 */ 2897 #define RX_TPA_START_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100) 2898 /* 2899 * This is data from the CFA block as indicated by the meta_format 2900 * field. 2901 */ 2902 uint32_t metadata; 2903 /* When meta_format=1, this value is the VLAN VID. */ 2904 #define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff) 2905 #define RX_TPA_START_CMPL_METADATA_VID_SFT 0 2906 /* When meta_format=1, this value is the VLAN DE. */ 2907 #define RX_TPA_START_CMPL_METADATA_DE UINT32_C(0x1000) 2908 /* When meta_format=1, this value is the VLAN PRI. */ 2909 #define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000) 2910 #define RX_TPA_START_CMPL_METADATA_PRI_SFT 13 2911 /* When meta_format=1, this value is the VLAN TPID. */ 2912 #define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000) 2913 #define RX_TPA_START_CMPL_METADATA_TPID_SFT 16 2914 uint16_t v2; 2915 /* 2916 * This value is written by the NIC such that it will be different 2917 * for each pass through the completion queue. The even passes 2918 * will write 1. The odd passes will write 0. 2919 */ 2920 #define RX_TPA_START_CMPL_V2 UINT32_C(0x1) 2921 /* 2922 * This field identifies the CFA action rule that was used for this 2923 * packet. 2924 */ 2925 uint16_t cfa_code; 2926 /* 2927 * This is the size in bytes of the inner most L4 header. 2928 * This can be subtracted from the payload_offset to determine 2929 * the start of the inner most L4 header. 2930 */ 2931 uint32_t inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset; 2932 /* 2933 * This is the offset from the beginning of the packet in bytes for 2934 * the outer L3 header. If there is no outer L3 header, then this 2935 * value is zero. 2936 */ 2937 #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff) 2938 #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0 2939 /* 2940 * This is the offset from the beginning of the packet in bytes for 2941 * the inner most L2 header. 2942 */ 2943 #define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00) 2944 #define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9 2945 /* 2946 * This is the offset from the beginning of the packet in bytes for 2947 * the inner most L3 header. 2948 */ 2949 #define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000) 2950 #define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18 2951 /* 2952 * This is the size in bytes of the inner most L4 header. 2953 * This can be subtracted from the payload_offset to determine 2954 * the start of the inner most L4 header. 2955 */ 2956 #define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK UINT32_C(0xf8000000) 2957 #define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT 27 2958 } __attribute__((packed)); 2959 2960 /* rx_tpa_end_cmpl (size:128b/16B) */ 2961 struct rx_tpa_end_cmpl { 2962 uint16_t flags_type; 2963 /* 2964 * This field indicates the exact type of the completion. 2965 * By convention, the LSB identifies the length of the 2966 * record in 16B units. Even values indicate 16B 2967 * records. Odd values indicate 32B 2968 * records. 2969 */ 2970 #define RX_TPA_END_CMPL_TYPE_MASK UINT32_C(0x3f) 2971 #define RX_TPA_END_CMPL_TYPE_SFT 0 2972 /* 2973 * RX L2 TPA End Completion: 2974 * Completion at the end of a TPA operation. 2975 * Length = 32B 2976 */ 2977 #define RX_TPA_END_CMPL_TYPE_RX_TPA_END UINT32_C(0x15) 2978 #define RX_TPA_END_CMPL_TYPE_LAST \ 2979 RX_TPA_END_CMPL_TYPE_RX_TPA_END 2980 #define RX_TPA_END_CMPL_FLAGS_MASK UINT32_C(0xffc0) 2981 #define RX_TPA_END_CMPL_FLAGS_SFT 6 2982 /* 2983 * When this bit is '1', it indicates a packet that has an 2984 * error of some type. Type of error is indicated in 2985 * error_flags. 2986 */ 2987 #define RX_TPA_END_CMPL_FLAGS_ERROR UINT32_C(0x40) 2988 /* This field indicates how the packet was placed in the buffer. */ 2989 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380) 2990 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT 7 2991 /* 2992 * Jumbo: 2993 * TPA Packet was placed using jumbo algorithm. This means 2994 * that the first buffer will be filled with data before 2995 * moving to aggregation buffers. Each aggregation buffer 2996 * will be filled before moving to the next aggregation 2997 * buffer. 2998 */ 2999 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO \ 3000 (UINT32_C(0x1) << 7) 3001 /* 3002 * Header/Data Separation: 3003 * Packet was placed using Header/Data separation algorithm. 3004 * The separation location is indicated by the itype field. 3005 */ 3006 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS \ 3007 (UINT32_C(0x2) << 7) 3008 /* 3009 * GRO/Jumbo: 3010 * Packet will be placed using GRO/Jumbo where the first 3011 * packet is filled with data. Subsequent packets will be 3012 * placed such that any one packet does not span two 3013 * aggregation buffers unless it starts at the beginning of 3014 * an aggregation buffer. 3015 */ 3016 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \ 3017 (UINT32_C(0x5) << 7) 3018 /* 3019 * GRO/Header-Data Separation: 3020 * Packet will be placed using GRO/HDS where the header 3021 * is in the first packet. 3022 * Payload of each packet will be 3023 * placed such that any one packet does not span two 3024 * aggregation buffers unless it starts at the beginning of 3025 * an aggregation buffer. 3026 */ 3027 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS \ 3028 (UINT32_C(0x6) << 7) 3029 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST \ 3030 RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS 3031 /* unused is 2 b */ 3032 #define RX_TPA_END_CMPL_FLAGS_UNUSED_MASK UINT32_C(0xc00) 3033 #define RX_TPA_END_CMPL_FLAGS_UNUSED_SFT 10 3034 /* 3035 * This value indicates what the inner packet determined for the 3036 * packet was. 3037 * - 2 TCP Packet 3038 * Indicates that the packet was IP and TCP. This indicates 3039 * that the ip_cs field is valid and that the tcp_udp_cs 3040 * field is valid and contains the TCP checksum. 3041 * This also indicates that the payload_offset field is valid. 3042 */ 3043 #define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000) 3044 #define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT 12 3045 /* 3046 * This value is zero for TPA End completions. 3047 * There is no data in the buffer that corresponds to the opaque 3048 * value in this completion. 3049 */ 3050 uint16_t len; 3051 /* 3052 * This is a copy of the opaque field from the RX BD this completion 3053 * corresponds to. 3054 */ 3055 uint32_t opaque; 3056 /* 3057 * This value is written by the NIC such that it will be different 3058 * for each pass through the completion queue. The even passes 3059 * will write 1. The odd passes will write 0. 3060 */ 3061 uint8_t agg_bufs_v1; 3062 /* 3063 * This value is written by the NIC such that it will be different 3064 * for each pass through the completion queue. The even passes 3065 * will write 1. The odd passes will write 0. 3066 */ 3067 #define RX_TPA_END_CMPL_V1 UINT32_C(0x1) 3068 /* 3069 * This value is the number of aggregation buffers that follow this 3070 * entry in the completion ring that are a part of this aggregation 3071 * packet. 3072 * If the value is zero, then the packet is completely contained 3073 * in the buffer space provided in the aggregation start completion. 3074 */ 3075 #define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e) 3076 #define RX_TPA_END_CMPL_AGG_BUFS_SFT 1 3077 /* This value is the number of segments in the TPA operation. */ 3078 uint8_t tpa_segs; 3079 /* 3080 * This value indicates the offset in bytes from the beginning of the packet 3081 * where the inner payload starts. This value is valid for TCP, UDP, 3082 * FCoE, and RoCE packets. 3083 * 3084 * A value of zero indicates an offset of 256 bytes. 3085 */ 3086 uint8_t payload_offset; 3087 uint8_t agg_id; 3088 /* unused2 is 1 b */ 3089 #define RX_TPA_END_CMPL_UNUSED2 UINT32_C(0x1) 3090 /* 3091 * This is the aggregation ID that the completion is associated 3092 * with. Use this number to correlate the TPA start completion 3093 * with the TPA end completion. 3094 */ 3095 #define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe) 3096 #define RX_TPA_END_CMPL_AGG_ID_SFT 1 3097 /* 3098 * For non-GRO packets, this value is the 3099 * timestamp delta between earliest and latest timestamp values for 3100 * TPA packet. If packets were not time stamped, then delta will be 3101 * zero. 3102 * 3103 * For GRO packets, this field is zero except for the following 3104 * sub-fields. 3105 * - tsdelta[31] 3106 * Timestamp present indication. When '0', no Timestamp 3107 * option is in the packet. When '1', then a Timestamp 3108 * option is present in the packet. 3109 */ 3110 uint32_t tsdelta; 3111 } __attribute__((packed)); 3112 3113 /* Last 16 bytes of rx_tpa_end_cmpl. */ 3114 /* rx_tpa_end_cmpl_hi (size:128b/16B) */ 3115 struct rx_tpa_end_cmpl_hi { 3116 /* 3117 * This value is the number of duplicate ACKs that have been 3118 * received as part of the TPA operation. 3119 */ 3120 uint32_t tpa_dup_acks; 3121 /* 3122 * This value is the number of duplicate ACKs that have been 3123 * received as part of the TPA operation. 3124 */ 3125 #define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf) 3126 #define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0 3127 /* 3128 * This value is the valid when TPA completion is active. It 3129 * indicates the length of the longest segment of the TPA operation 3130 * for LRO mode and the length of the first segment in GRO mode. 3131 * 3132 * This value may be used by GRO software to re-construct the original 3133 * packet stream from the TPA packet. This is the length of all 3134 * but the last segment for GRO. In LRO mode this value may be used 3135 * to indicate MSS size to the stack. 3136 */ 3137 uint16_t tpa_seg_len; 3138 /* unused4 is 16 b */ 3139 uint16_t unused3; 3140 uint16_t errors_v2; 3141 /* 3142 * This value is written by the NIC such that it will be different 3143 * for each pass through the completion queue. The even passes 3144 * will write 1. The odd passes will write 0. 3145 */ 3146 #define RX_TPA_END_CMPL_V2 UINT32_C(0x1) 3147 #define RX_TPA_END_CMPL_ERRORS_MASK UINT32_C(0xfffe) 3148 #define RX_TPA_END_CMPL_ERRORS_SFT 1 3149 /* 3150 * This error indicates that there was some sort of problem with 3151 * the BDs for the packet that was found after part of the 3152 * packet was already placed. The packet should be treated as 3153 * invalid. 3154 */ 3155 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe) 3156 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT 1 3157 /* 3158 * This error occurs when there is a fatal HW problem in 3159 * the chip only. It indicates that there were not 3160 * BDs on chip but that there was adequate reservation. 3161 * provided by the TPA block. 3162 */ 3163 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \ 3164 (UINT32_C(0x2) << 1) 3165 /* 3166 * This error occurs when TPA block was not configured to 3167 * reserve adequate BDs for TPA operations on this RX 3168 * ring. All data for the TPA operation was not placed. 3169 * 3170 * This error can also be generated when the number of 3171 * segments is not programmed correctly in TPA and the 3172 * 33 total aggregation buffers allowed for the TPA 3173 * operation has been exceeded. 3174 */ 3175 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \ 3176 (UINT32_C(0x4) << 1) 3177 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST \ 3178 RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR 3179 /* unused5 is 16 b */ 3180 uint16_t unused_4; 3181 /* 3182 * This is the opaque value that was completed for the TPA start 3183 * completion that corresponds to this TPA end completion. 3184 */ 3185 uint32_t start_opaque; 3186 } __attribute__((packed)); 3187 3188 /* rx_abuf_cmpl (size:128b/16B) */ 3189 struct rx_abuf_cmpl { 3190 uint16_t type; 3191 /* 3192 * This field indicates the exact type of the completion. 3193 * By convention, the LSB identifies the length of the 3194 * record in 16B units. Even values indicate 16B 3195 * records. Odd values indicate 32B 3196 * records. 3197 */ 3198 #define RX_ABUF_CMPL_TYPE_MASK UINT32_C(0x3f) 3199 #define RX_ABUF_CMPL_TYPE_SFT 0 3200 /* 3201 * RX Aggregation Buffer completion : 3202 * Completion of an L2 aggregation buffer in support of 3203 * TPA, HDS, or Jumbo packet completion. Length = 16B 3204 */ 3205 #define RX_ABUF_CMPL_TYPE_RX_AGG UINT32_C(0x12) 3206 #define RX_ABUF_CMPL_TYPE_LAST RX_ABUF_CMPL_TYPE_RX_AGG 3207 /* 3208 * This is the length of the data for the packet stored in this 3209 * aggregation buffer identified by the opaque value. This does not 3210 * include the length of any 3211 * data placed in other aggregation BDs or in the packet or buffer 3212 * BDs. This length does not include any space added due to 3213 * hdr_offset register during HDS placement mode. 3214 */ 3215 uint16_t len; 3216 /* 3217 * This is a copy of the opaque field from the RX BD this aggregation 3218 * buffer corresponds to. 3219 */ 3220 uint32_t opaque; 3221 uint32_t v; 3222 /* 3223 * This value is written by the NIC such that it will be different 3224 * for each pass through the completion queue. The even passes 3225 * will write 1. The odd passes will write 0. 3226 */ 3227 #define RX_ABUF_CMPL_V UINT32_C(0x1) 3228 /* unused3 is 32 b */ 3229 uint32_t unused_2; 3230 } __attribute__((packed)); 3231 3232 /* eject_cmpl (size:128b/16B) */ 3233 struct eject_cmpl { 3234 uint16_t type; 3235 /* 3236 * This field indicates the exact type of the completion. 3237 * By convention, the LSB identifies the length of the 3238 * record in 16B units. Even values indicate 16B 3239 * records. Odd values indicate 32B 3240 * records. 3241 */ 3242 #define EJECT_CMPL_TYPE_MASK UINT32_C(0x3f) 3243 #define EJECT_CMPL_TYPE_SFT 0 3244 /* 3245 * Statistics Ejection Completion: 3246 * Completion of statistics data ejection buffer. 3247 * Length = 16B 3248 */ 3249 #define EJECT_CMPL_TYPE_STAT_EJECT UINT32_C(0x1a) 3250 #define EJECT_CMPL_TYPE_LAST EJECT_CMPL_TYPE_STAT_EJECT 3251 /* 3252 * This is the length of the statistics data stored in this 3253 * buffer. 3254 */ 3255 uint16_t len; 3256 /* 3257 * This is a copy of the opaque field from the RX BD this ejection 3258 * buffer corresponds to. 3259 */ 3260 uint32_t opaque; 3261 uint32_t v; 3262 /* 3263 * This value is written by the NIC such that it will be different 3264 * for each pass through the completion queue. The even passes 3265 * will write 1. The odd passes will write 0. 3266 */ 3267 #define EJECT_CMPL_V UINT32_C(0x1) 3268 /* unused3 is 32 b */ 3269 uint32_t unused_2; 3270 } __attribute__((packed)); 3271 3272 /* hwrm_cmpl (size:128b/16B) */ 3273 struct hwrm_cmpl { 3274 uint16_t type; 3275 /* 3276 * This field indicates the exact type of the completion. 3277 * By convention, the LSB identifies the length of the 3278 * record in 16B units. Even values indicate 16B 3279 * records. Odd values indicate 32B 3280 * records. 3281 */ 3282 #define HWRM_CMPL_TYPE_MASK UINT32_C(0x3f) 3283 #define HWRM_CMPL_TYPE_SFT 0 3284 /* 3285 * HWRM Command Completion: 3286 * Completion of an HWRM command. 3287 */ 3288 #define HWRM_CMPL_TYPE_HWRM_DONE UINT32_C(0x20) 3289 #define HWRM_CMPL_TYPE_LAST HWRM_CMPL_TYPE_HWRM_DONE 3290 /* This is the sequence_id of the HWRM command that has completed. */ 3291 uint16_t sequence_id; 3292 /* unused2 is 32 b */ 3293 uint32_t unused_1; 3294 uint32_t v; 3295 /* 3296 * This value is written by the NIC such that it will be different 3297 * for each pass through the completion queue. The even passes 3298 * will write 1. The odd passes will write 0. 3299 */ 3300 #define HWRM_CMPL_V UINT32_C(0x1) 3301 /* unused4 is 32 b */ 3302 uint32_t unused_3; 3303 } __attribute__((packed)); 3304 3305 /* hwrm_fwd_req_cmpl (size:128b/16B) */ 3306 struct hwrm_fwd_req_cmpl { 3307 /* 3308 * This field indicates the exact type of the completion. 3309 * By convention, the LSB identifies the length of the 3310 * record in 16B units. Even values indicate 16B 3311 * records. Odd values indicate 32B 3312 * records. 3313 */ 3314 uint16_t req_len_type; 3315 /* 3316 * This field indicates the exact type of the completion. 3317 * By convention, the LSB identifies the length of the 3318 * record in 16B units. Even values indicate 16B 3319 * records. Odd values indicate 32B 3320 * records. 3321 */ 3322 #define HWRM_FWD_REQ_CMPL_TYPE_MASK UINT32_C(0x3f) 3323 #define HWRM_FWD_REQ_CMPL_TYPE_SFT 0 3324 /* Forwarded HWRM Request */ 3325 #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ UINT32_C(0x22) 3326 #define HWRM_FWD_REQ_CMPL_TYPE_LAST \ 3327 HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ 3328 /* Length of forwarded request in bytes. */ 3329 #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK UINT32_C(0xffc0) 3330 #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT 6 3331 /* 3332 * Source ID of this request. 3333 * Typically used in forwarding requests and responses. 3334 * 0x0 - 0xFFF8 - Used for function ids 3335 * 0xFFF8 - 0xFFFE - Reserved for internal processors 3336 * 0xFFFF - HWRM 3337 */ 3338 uint16_t source_id; 3339 /* unused1 is 32 b */ 3340 uint32_t unused0; 3341 /* Address of forwarded request. */ 3342 uint32_t req_buf_addr_v[2]; 3343 /* 3344 * This value is written by the NIC such that it will be different 3345 * for each pass through the completion queue. The even passes 3346 * will write 1. The odd passes will write 0. 3347 */ 3348 #define HWRM_FWD_REQ_CMPL_V UINT32_C(0x1) 3349 /* Address of forwarded request. */ 3350 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe) 3351 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1 3352 } __attribute__((packed)); 3353 3354 /* hwrm_fwd_resp_cmpl (size:128b/16B) */ 3355 struct hwrm_fwd_resp_cmpl { 3356 uint16_t type; 3357 /* 3358 * This field indicates the exact type of the completion. 3359 * By convention, the LSB identifies the length of the 3360 * record in 16B units. Even values indicate 16B 3361 * records. Odd values indicate 32B 3362 * records. 3363 */ 3364 #define HWRM_FWD_RESP_CMPL_TYPE_MASK UINT32_C(0x3f) 3365 #define HWRM_FWD_RESP_CMPL_TYPE_SFT 0 3366 /* Forwarded HWRM Response */ 3367 #define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP UINT32_C(0x24) 3368 #define HWRM_FWD_RESP_CMPL_TYPE_LAST \ 3369 HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP 3370 /* 3371 * Source ID of this response. 3372 * Typically used in forwarding requests and responses. 3373 * 0x0 - 0xFFF8 - Used for function ids 3374 * 0xFFF8 - 0xFFFE - Reserved for internal processors 3375 * 0xFFFF - HWRM 3376 */ 3377 uint16_t source_id; 3378 /* Length of forwarded response in bytes. */ 3379 uint16_t resp_len; 3380 /* unused2 is 16 b */ 3381 uint16_t unused_1; 3382 /* Address of forwarded request. */ 3383 uint32_t resp_buf_addr_v[2]; 3384 /* 3385 * This value is written by the NIC such that it will be different 3386 * for each pass through the completion queue. The even passes 3387 * will write 1. The odd passes will write 0. 3388 */ 3389 #define HWRM_FWD_RESP_CMPL_V UINT32_C(0x1) 3390 /* Address of forwarded request. */ 3391 #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK UINT32_C(0xfffffffe) 3392 #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT 1 3393 } __attribute__((packed)); 3394 3395 /* hwrm_async_event_cmpl (size:128b/16B) */ 3396 struct hwrm_async_event_cmpl { 3397 uint16_t type; 3398 /* 3399 * This field indicates the exact type of the completion. 3400 * By convention, the LSB identifies the length of the 3401 * record in 16B units. Even values indicate 16B 3402 * records. Odd values indicate 32B 3403 * records. 3404 */ 3405 #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK UINT32_C(0x3f) 3406 #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT 0 3407 /* HWRM Asynchronous Event Information */ 3408 #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e) 3409 #define HWRM_ASYNC_EVENT_CMPL_TYPE_LAST \ 3410 HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT 3411 /* Identifiers of events. */ 3412 uint16_t event_id; 3413 /* Link status changed */ 3414 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE \ 3415 UINT32_C(0x0) 3416 /* Link MTU changed */ 3417 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE \ 3418 UINT32_C(0x1) 3419 /* Link speed changed */ 3420 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE \ 3421 UINT32_C(0x2) 3422 /* DCB Configuration changed */ 3423 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE \ 3424 UINT32_C(0x3) 3425 /* Port connection not allowed */ 3426 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED \ 3427 UINT32_C(0x4) 3428 /* Link speed configuration was not allowed */ 3429 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \ 3430 UINT32_C(0x5) 3431 /* Link speed configuration change */ 3432 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE \ 3433 UINT32_C(0x6) 3434 /* Port PHY configuration change */ 3435 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE \ 3436 UINT32_C(0x7) 3437 /* Reset notification to clients */ 3438 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY \ 3439 UINT32_C(0x8) 3440 /* Function driver unloaded */ 3441 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD \ 3442 UINT32_C(0x10) 3443 /* Function driver loaded */ 3444 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD \ 3445 UINT32_C(0x11) 3446 /* Function FLR related processing has completed */ 3447 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT \ 3448 UINT32_C(0x12) 3449 /* PF driver unloaded */ 3450 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD \ 3451 UINT32_C(0x20) 3452 /* PF driver loaded */ 3453 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD \ 3454 UINT32_C(0x21) 3455 /* VF Function Level Reset (FLR) */ 3456 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR \ 3457 UINT32_C(0x30) 3458 /* VF MAC Address Change */ 3459 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE \ 3460 UINT32_C(0x31) 3461 /* PF-VF communication channel status change. */ 3462 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \ 3463 UINT32_C(0x32) 3464 /* VF Configuration Change */ 3465 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE \ 3466 UINT32_C(0x33) 3467 /* LLFC/PFC Configuration Change */ 3468 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE \ 3469 UINT32_C(0x34) 3470 /* Default VNIC Configuration Change */ 3471 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE \ 3472 UINT32_C(0x35) 3473 /* HWRM Error */ 3474 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR \ 3475 UINT32_C(0xff) 3476 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LAST \ 3477 HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR 3478 /* Event specific data */ 3479 uint32_t event_data2; 3480 uint8_t opaque_v; 3481 /* 3482 * This value is written by the NIC such that it will be different 3483 * for each pass through the completion queue. The even passes 3484 * will write 1. The odd passes will write 0. 3485 */ 3486 #define HWRM_ASYNC_EVENT_CMPL_V UINT32_C(0x1) 3487 /* opaque is 7 b */ 3488 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe) 3489 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1 3490 /* 8-lsb timestamp from POR (100-msec resolution) */ 3491 uint8_t timestamp_lo; 3492 /* 16-lsb timestamp from POR (100-msec resolution) */ 3493 uint16_t timestamp_hi; 3494 /* Event specific data */ 3495 uint32_t event_data1; 3496 } __attribute__((packed)); 3497 3498 /* hwrm_async_event_cmpl_link_status_change (size:128b/16B) */ 3499 struct hwrm_async_event_cmpl_link_status_change { 3500 uint16_t type; 3501 /* 3502 * This field indicates the exact type of the completion. 3503 * By convention, the LSB identifies the length of the 3504 * record in 16B units. Even values indicate 16B 3505 * records. Odd values indicate 32B 3506 * records. 3507 */ 3508 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK \ 3509 UINT32_C(0x3f) 3510 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT 0 3511 /* HWRM Asynchronous Event Information */ 3512 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \ 3513 UINT32_C(0x2e) 3514 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_LAST \ 3515 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT 3516 /* Identifiers of events. */ 3517 uint16_t event_id; 3518 /* Link status changed */ 3519 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE \ 3520 UINT32_C(0x0) 3521 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LAST \ 3522 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE 3523 /* Event specific data */ 3524 uint32_t event_data2; 3525 uint8_t opaque_v; 3526 /* 3527 * This value is written by the NIC such that it will be different 3528 * for each pass through the completion queue. The even passes 3529 * will write 1. The odd passes will write 0. 3530 */ 3531 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V \ 3532 UINT32_C(0x1) 3533 /* opaque is 7 b */ 3534 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK \ 3535 UINT32_C(0xfe) 3536 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1 3537 /* 8-lsb timestamp from POR (100-msec resolution) */ 3538 uint8_t timestamp_lo; 3539 /* 16-lsb timestamp from POR (100-msec resolution) */ 3540 uint16_t timestamp_hi; 3541 /* Event specific data */ 3542 uint32_t event_data1; 3543 /* Indicates link status change */ 3544 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE \ 3545 UINT32_C(0x1) 3546 /* 3547 * If this bit set to 0, then it indicates that the link 3548 * was up and it went down. 3549 */ 3550 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN \ 3551 UINT32_C(0x0) 3552 /* 3553 * If this bit is set to 1, then it indicates that the link 3554 * was down and it went up. 3555 */ 3556 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP \ 3557 UINT32_C(0x1) 3558 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_LAST \ 3559 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP 3560 /* Indicates the physical port this link status change occur */ 3561 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK \ 3562 UINT32_C(0xe) 3563 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT \ 3564 1 3565 /* PORT ID */ 3566 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK \ 3567 UINT32_C(0xffff0) 3568 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT \ 3569 4 3570 /* Indicates the physical function this event occured on. */ 3571 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_MASK \ 3572 UINT32_C(0xff00000) 3573 #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_SFT \ 3574 20 3575 } __attribute__((packed)); 3576 3577 /* hwrm_async_event_cmpl_link_mtu_change (size:128b/16B) */ 3578 struct hwrm_async_event_cmpl_link_mtu_change { 3579 uint16_t type; 3580 /* 3581 * This field indicates the exact type of the completion. 3582 * By convention, the LSB identifies the length of the 3583 * record in 16B units. Even values indicate 16B 3584 * records. Odd values indicate 32B 3585 * records. 3586 */ 3587 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_MASK \ 3588 UINT32_C(0x3f) 3589 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_SFT 0 3590 /* HWRM Asynchronous Event Information */ 3591 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT \ 3592 UINT32_C(0x2e) 3593 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_LAST \ 3594 HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT 3595 /* Identifiers of events. */ 3596 uint16_t event_id; 3597 /* Link MTU changed */ 3598 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE \ 3599 UINT32_C(0x1) 3600 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LAST \ 3601 HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE 3602 /* Event specific data */ 3603 uint32_t event_data2; 3604 uint8_t opaque_v; 3605 /* 3606 * This value is written by the NIC such that it will be different 3607 * for each pass through the completion queue. The even passes 3608 * will write 1. The odd passes will write 0. 3609 */ 3610 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_V UINT32_C(0x1) 3611 /* opaque is 7 b */ 3612 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_MASK \ 3613 UINT32_C(0xfe) 3614 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_SFT 1 3615 /* 8-lsb timestamp from POR (100-msec resolution) */ 3616 uint8_t timestamp_lo; 3617 /* 16-lsb timestamp from POR (100-msec resolution) */ 3618 uint16_t timestamp_hi; 3619 /* Event specific data */ 3620 uint32_t event_data1; 3621 /* The new MTU of the link in bytes. */ 3622 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK \ 3623 UINT32_C(0xffff) 3624 #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0 3625 } __attribute__((packed)); 3626 3627 /* hwrm_async_event_cmpl_link_speed_change (size:128b/16B) */ 3628 struct hwrm_async_event_cmpl_link_speed_change { 3629 uint16_t type; 3630 /* 3631 * This field indicates the exact type of the completion. 3632 * By convention, the LSB identifies the length of the 3633 * record in 16B units. Even values indicate 16B 3634 * records. Odd values indicate 32B 3635 * records. 3636 */ 3637 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_MASK \ 3638 UINT32_C(0x3f) 3639 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_SFT 0 3640 /* HWRM Asynchronous Event Information */ 3641 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT \ 3642 UINT32_C(0x2e) 3643 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_LAST \ 3644 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT 3645 /* Identifiers of events. */ 3646 uint16_t event_id; 3647 /* Link speed changed */ 3648 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE \ 3649 UINT32_C(0x2) 3650 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LAST \ 3651 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE 3652 /* Event specific data */ 3653 uint32_t event_data2; 3654 uint8_t opaque_v; 3655 /* 3656 * This value is written by the NIC such that it will be different 3657 * for each pass through the completion queue. The even passes 3658 * will write 1. The odd passes will write 0. 3659 */ 3660 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_V \ 3661 UINT32_C(0x1) 3662 /* opaque is 7 b */ 3663 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_MASK \ 3664 UINT32_C(0xfe) 3665 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_SFT 1 3666 /* 8-lsb timestamp from POR (100-msec resolution) */ 3667 uint8_t timestamp_lo; 3668 /* 16-lsb timestamp from POR (100-msec resolution) */ 3669 uint16_t timestamp_hi; 3670 /* Event specific data */ 3671 uint32_t event_data1; 3672 /* 3673 * When this bit is '1', the link was forced to the 3674 * force_link_speed value. 3675 */ 3676 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_FORCE \ 3677 UINT32_C(0x1) 3678 /* The new link speed in 100 Mbps units. */ 3679 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_MASK \ 3680 UINT32_C(0xfffe) 3681 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_SFT \ 3682 1 3683 /* 100Mb link speed */ 3684 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100MB \ 3685 (UINT32_C(0x1) << 1) 3686 /* 1Gb link speed */ 3687 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_1GB \ 3688 (UINT32_C(0xa) << 1) 3689 /* 2Gb link speed */ 3690 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2GB \ 3691 (UINT32_C(0x14) << 1) 3692 /* 25Gb link speed */ 3693 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2_5GB \ 3694 (UINT32_C(0x19) << 1) 3695 /* 10Gb link speed */ 3696 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10GB \ 3697 (UINT32_C(0x64) << 1) 3698 /* 20Mb link speed */ 3699 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_20GB \ 3700 (UINT32_C(0xc8) << 1) 3701 /* 25Gb link speed */ 3702 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_25GB \ 3703 (UINT32_C(0xfa) << 1) 3704 /* 40Gb link speed */ 3705 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_40GB \ 3706 (UINT32_C(0x190) << 1) 3707 /* 50Gb link speed */ 3708 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_50GB \ 3709 (UINT32_C(0x1f4) << 1) 3710 /* 100Gb link speed */ 3711 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB \ 3712 (UINT32_C(0x3e8) << 1) 3713 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_LAST \ 3714 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB 3715 /* PORT ID */ 3716 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_MASK \ 3717 UINT32_C(0xffff0000) 3718 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT \ 3719 16 3720 } __attribute__((packed)); 3721 3722 /* hwrm_async_event_cmpl_dcb_config_change (size:128b/16B) */ 3723 struct hwrm_async_event_cmpl_dcb_config_change { 3724 uint16_t type; 3725 /* 3726 * This field indicates the exact type of the completion. 3727 * By convention, the LSB identifies the length of the 3728 * record in 16B units. Even values indicate 16B 3729 * records. Odd values indicate 32B 3730 * records. 3731 */ 3732 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_MASK \ 3733 UINT32_C(0x3f) 3734 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_SFT 0 3735 /* HWRM Asynchronous Event Information */ 3736 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT \ 3737 UINT32_C(0x2e) 3738 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_LAST \ 3739 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT 3740 /* Identifiers of events. */ 3741 uint16_t event_id; 3742 /* DCB Configuration changed */ 3743 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE \ 3744 UINT32_C(0x3) 3745 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_LAST \ 3746 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE 3747 /* Event specific data */ 3748 uint32_t event_data2; 3749 /* ETS configuration change */ 3750 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_ETS \ 3751 UINT32_C(0x1) 3752 /* PFC configuration change */ 3753 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_PFC \ 3754 UINT32_C(0x2) 3755 /* APP configuration change */ 3756 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_APP \ 3757 UINT32_C(0x4) 3758 uint8_t opaque_v; 3759 /* 3760 * This value is written by the NIC such that it will be different 3761 * for each pass through the completion queue. The even passes 3762 * will write 1. The odd passes will write 0. 3763 */ 3764 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_V \ 3765 UINT32_C(0x1) 3766 /* opaque is 7 b */ 3767 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_MASK \ 3768 UINT32_C(0xfe) 3769 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_SFT 1 3770 /* 8-lsb timestamp from POR (100-msec resolution) */ 3771 uint8_t timestamp_lo; 3772 /* 16-lsb timestamp from POR (100-msec resolution) */ 3773 uint16_t timestamp_hi; 3774 /* Event specific data */ 3775 uint32_t event_data1; 3776 /* PORT ID */ 3777 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK \ 3778 UINT32_C(0xffff) 3779 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT \ 3780 0 3781 /* Priority recommended for RoCE traffic */ 3782 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_MASK \ 3783 UINT32_C(0xff0000) 3784 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_SFT \ 3785 16 3786 /* none is 255 */ 3787 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE \ 3788 (UINT32_C(0xff) << 16) 3789 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_LAST \ 3790 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE 3791 /* Priority recommended for L2 traffic */ 3792 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_MASK \ 3793 UINT32_C(0xff000000) 3794 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_SFT \ 3795 24 3796 /* none is 255 */ 3797 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE \ 3798 (UINT32_C(0xff) << 24) 3799 #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_LAST \ 3800 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE 3801 } __attribute__((packed)); 3802 3803 /* hwrm_async_event_cmpl_port_conn_not_allowed (size:128b/16B) */ 3804 struct hwrm_async_event_cmpl_port_conn_not_allowed { 3805 uint16_t type; 3806 /* 3807 * This field indicates the exact type of the completion. 3808 * By convention, the LSB identifies the length of the 3809 * record in 16B units. Even values indicate 16B 3810 * records. Odd values indicate 32B 3811 * records. 3812 */ 3813 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_MASK \ 3814 UINT32_C(0x3f) 3815 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_SFT \ 3816 0 3817 /* HWRM Asynchronous Event Information */ 3818 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT \ 3819 UINT32_C(0x2e) 3820 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_LAST \ 3821 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT 3822 /* Identifiers of events. */ 3823 uint16_t event_id; 3824 /* Port connection not allowed */ 3825 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED \ 3826 UINT32_C(0x4) 3827 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_LAST \ 3828 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED 3829 /* Event specific data */ 3830 uint32_t event_data2; 3831 uint8_t opaque_v; 3832 /* 3833 * This value is written by the NIC such that it will be different 3834 * for each pass through the completion queue. The even passes 3835 * will write 1. The odd passes will write 0. 3836 */ 3837 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_V \ 3838 UINT32_C(0x1) 3839 /* opaque is 7 b */ 3840 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_MASK \ 3841 UINT32_C(0xfe) 3842 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_SFT 1 3843 /* 8-lsb timestamp from POR (100-msec resolution) */ 3844 uint8_t timestamp_lo; 3845 /* 16-lsb timestamp from POR (100-msec resolution) */ 3846 uint16_t timestamp_hi; 3847 /* Event specific data */ 3848 uint32_t event_data1; 3849 /* PORT ID */ 3850 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK \ 3851 UINT32_C(0xffff) 3852 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \ 3853 0 3854 /* 3855 * This value indicates the current port level enforcement policy 3856 * for the optics module when there is an optical module mismatch 3857 * and port is not connected. 3858 */ 3859 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK \ 3860 UINT32_C(0xff0000) 3861 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT \ 3862 16 3863 /* No enforcement */ 3864 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_NONE \ 3865 (UINT32_C(0x0) << 16) 3866 /* Disable Transmit side Laser. */ 3867 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_DISABLETX \ 3868 (UINT32_C(0x1) << 16) 3869 /* Raise a warning message. */ 3870 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_WARNINGMSG \ 3871 (UINT32_C(0x2) << 16) 3872 /* Power down the module. */ 3873 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN \ 3874 (UINT32_C(0x3) << 16) 3875 #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_LAST \ 3876 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN 3877 } __attribute__((packed)); 3878 3879 /* hwrm_async_event_cmpl_link_speed_cfg_not_allowed (size:128b/16B) */ 3880 struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed { 3881 uint16_t type; 3882 /* 3883 * This field indicates the exact type of the completion. 3884 * By convention, the LSB identifies the length of the 3885 * record in 16B units. Even values indicate 16B 3886 * records. Odd values indicate 32B 3887 * records. 3888 */ 3889 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_MASK \ 3890 UINT32_C(0x3f) 3891 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_SFT \ 3892 0 3893 /* HWRM Asynchronous Event Information */ 3894 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT \ 3895 UINT32_C(0x2e) 3896 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_LAST \ 3897 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT 3898 /* Identifiers of events. */ 3899 uint16_t event_id; 3900 /* Link speed configuration was not allowed */ 3901 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \ 3902 UINT32_C(0x5) 3903 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LAST \ 3904 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED 3905 /* Event specific data */ 3906 uint32_t event_data2; 3907 uint8_t opaque_v; 3908 /* 3909 * This value is written by the NIC such that it will be different 3910 * for each pass through the completion queue. The even passes 3911 * will write 1. The odd passes will write 0. 3912 */ 3913 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_V \ 3914 UINT32_C(0x1) 3915 /* opaque is 7 b */ 3916 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_MASK \ 3917 UINT32_C(0xfe) 3918 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_SFT 1 3919 /* 8-lsb timestamp from POR (100-msec resolution) */ 3920 uint8_t timestamp_lo; 3921 /* 16-lsb timestamp from POR (100-msec resolution) */ 3922 uint16_t timestamp_hi; 3923 /* Event specific data */ 3924 uint32_t event_data1; 3925 /* PORT ID */ 3926 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK \ 3927 UINT32_C(0xffff) 3928 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \ 3929 0 3930 } __attribute__((packed)); 3931 3932 /* hwrm_async_event_cmpl_link_speed_cfg_change (size:128b/16B) */ 3933 struct hwrm_async_event_cmpl_link_speed_cfg_change { 3934 uint16_t type; 3935 /* 3936 * This field indicates the exact type of the completion. 3937 * By convention, the LSB identifies the length of the 3938 * record in 16B units. Even values indicate 16B 3939 * records. Odd values indicate 32B 3940 * records. 3941 */ 3942 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_MASK \ 3943 UINT32_C(0x3f) 3944 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_SFT \ 3945 0 3946 /* HWRM Asynchronous Event Information */ 3947 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \ 3948 UINT32_C(0x2e) 3949 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_LAST \ 3950 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT 3951 /* Identifiers of events. */ 3952 uint16_t event_id; 3953 /* Link speed configuration change */ 3954 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE \ 3955 UINT32_C(0x6) 3956 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LAST \ 3957 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE 3958 /* Event specific data */ 3959 uint32_t event_data2; 3960 uint8_t opaque_v; 3961 /* 3962 * This value is written by the NIC such that it will be different 3963 * for each pass through the completion queue. The even passes 3964 * will write 1. The odd passes will write 0. 3965 */ 3966 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_V \ 3967 UINT32_C(0x1) 3968 /* opaque is 7 b */ 3969 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_MASK \ 3970 UINT32_C(0xfe) 3971 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_SFT 1 3972 /* 8-lsb timestamp from POR (100-msec resolution) */ 3973 uint8_t timestamp_lo; 3974 /* 16-lsb timestamp from POR (100-msec resolution) */ 3975 uint16_t timestamp_hi; 3976 /* Event specific data */ 3977 uint32_t event_data1; 3978 /* PORT ID */ 3979 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \ 3980 UINT32_C(0xffff) 3981 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \ 3982 0 3983 /* 3984 * If set to 1, it indicates that the supported link speeds 3985 * configuration on the port has changed. 3986 * If set to 0, then there is no change in supported link speeds 3987 * configuration. 3988 */ 3989 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_SUPPORTED_LINK_SPEEDS_CHANGE \ 3990 UINT32_C(0x10000) 3991 /* 3992 * If set to 1, it indicates that the link speed configuration 3993 * on the port has become illegal or invalid. 3994 * If set to 0, then the link speed configuration on the port is 3995 * legal or valid. 3996 */ 3997 #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_ILLEGAL_LINK_SPEED_CFG \ 3998 UINT32_C(0x20000) 3999 } __attribute__((packed)); 4000 4001 /* hwrm_async_event_cmpl_port_phy_cfg_change (size:128b/16B) */ 4002 struct hwrm_async_event_cmpl_port_phy_cfg_change { 4003 uint16_t type; 4004 /* 4005 * This field indicates the exact type of the completion. 4006 * By convention, the LSB identifies the length of the 4007 * record in 16B units. Even values indicate 16B 4008 * records. Odd values indicate 32B 4009 * records. 4010 */ 4011 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_MASK \ 4012 UINT32_C(0x3f) 4013 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_SFT \ 4014 0 4015 /* HWRM Asynchronous Event Information */ 4016 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \ 4017 UINT32_C(0x2e) 4018 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_LAST \ 4019 HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT 4020 /* Identifiers of events. */ 4021 uint16_t event_id; 4022 /* Port PHY configuration change */ 4023 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE \ 4024 UINT32_C(0x7) 4025 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_LAST \ 4026 HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE 4027 /* Event specific data */ 4028 uint32_t event_data2; 4029 uint8_t opaque_v; 4030 /* 4031 * This value is written by the NIC such that it will be different 4032 * for each pass through the completion queue. The even passes 4033 * will write 1. The odd passes will write 0. 4034 */ 4035 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_V \ 4036 UINT32_C(0x1) 4037 /* opaque is 7 b */ 4038 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_MASK \ 4039 UINT32_C(0xfe) 4040 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_SFT 1 4041 /* 8-lsb timestamp from POR (100-msec resolution) */ 4042 uint8_t timestamp_lo; 4043 /* 16-lsb timestamp from POR (100-msec resolution) */ 4044 uint16_t timestamp_hi; 4045 /* Event specific data */ 4046 uint32_t event_data1; 4047 /* PORT ID */ 4048 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \ 4049 UINT32_C(0xffff) 4050 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \ 4051 0 4052 /* 4053 * If set to 1, it indicates that the FEC 4054 * configuration on the port has changed. 4055 * If set to 0, then there is no change in FEC configuration. 4056 */ 4057 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_FEC_CFG_CHANGE \ 4058 UINT32_C(0x10000) 4059 /* 4060 * If set to 1, it indicates that the EEE configuration 4061 * on the port has changed. 4062 * If set to 0, then there is no change in EEE configuration 4063 * on the port. 4064 */ 4065 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_EEE_CFG_CHANGE \ 4066 UINT32_C(0x20000) 4067 /* 4068 * If set to 1, it indicates that the pause configuration 4069 * on the PHY has changed. 4070 * If set to 0, then there is no change in the pause 4071 * configuration on the PHY. 4072 */ 4073 #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PAUSE_CFG_CHANGE \ 4074 UINT32_C(0x40000) 4075 } __attribute__((packed)); 4076 4077 /* hwrm_async_event_cmpl_reset_notify (size:128b/16B) */ 4078 struct hwrm_async_event_cmpl_reset_notify { 4079 uint16_t type; 4080 /* 4081 * This field indicates the exact type of the completion. 4082 * By convention, the LSB identifies the length of the 4083 * record in 16B units. Even values indicate 16B 4084 * records. Odd values indicate 32B 4085 * records. 4086 */ 4087 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_MASK \ 4088 UINT32_C(0x3f) 4089 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_SFT 0 4090 /* HWRM Asynchronous Event Information */ 4091 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT \ 4092 UINT32_C(0x2e) 4093 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_LAST \ 4094 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT 4095 /* Identifiers of events. */ 4096 uint16_t event_id; 4097 /* Notify clients of imminent reset. */ 4098 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY \ 4099 UINT32_C(0x8) 4100 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_LAST \ 4101 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY 4102 /* Event specific data */ 4103 uint32_t event_data2; 4104 uint8_t opaque_v; 4105 /* 4106 * This value is written by the NIC such that it will be different 4107 * for each pass through the completion queue. The even passes 4108 * will write 1. The odd passes will write 0. 4109 */ 4110 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_V UINT32_C(0x1) 4111 /* opaque is 7 b */ 4112 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_MASK UINT32_C(0xfe) 4113 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_SFT 1 4114 /* 8-lsb timestamp from POR (100-msec resolution) */ 4115 uint8_t timestamp_lo; 4116 /* 16-lsb timestamp from POR (100-msec resolution) */ 4117 uint16_t timestamp_hi; 4118 /* Event specific data */ 4119 uint32_t event_data1; 4120 /* Indicates driver action requested */ 4121 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_MASK \ 4122 UINT32_C(0xff) 4123 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_SFT \ 4124 0 4125 /* 4126 * If set to 1, it indicates that the l2 client should 4127 * stop sending in band traffic to Nitro. 4128 * if set to 0, there is no change in L2 client behavior. 4129 */ 4130 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_STOP_TX_QUEUE \ 4131 UINT32_C(0x1) 4132 /* 4133 * If set to 1, it indicates that the L2 client should 4134 * bring down the interface. 4135 * If set to 0, then there is no change in L2 client behavior. 4136 */ 4137 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN \ 4138 UINT32_C(0x2) 4139 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_LAST \ 4140 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN 4141 /* Indicates reason for reset. */ 4142 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MASK \ 4143 UINT32_C(0xff00) 4144 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_SFT \ 4145 8 4146 /* A management client has requested reset. */ 4147 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MANAGEMENT_RESET_REQUEST \ 4148 (UINT32_C(0x1) << 8) 4149 /* A fatal firmware exception has occurred. */ 4150 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_FATAL \ 4151 (UINT32_C(0x2) << 8) 4152 /* A non-fatal firmware exception has occurred. */ 4153 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL \ 4154 (UINT32_C(0x3) << 8) 4155 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_LAST \ 4156 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL 4157 /* 4158 * Minimum time before driver should attempt access - units 100ms ticks. 4159 * Range 0-65535 4160 */ 4161 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_MASK \ 4162 UINT32_C(0xffff0000) 4163 #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_SFT \ 4164 16 4165 } __attribute__((packed)); 4166 4167 /* hwrm_async_event_cmpl_func_drvr_unload (size:128b/16B) */ 4168 struct hwrm_async_event_cmpl_func_drvr_unload { 4169 uint16_t type; 4170 /* 4171 * This field indicates the exact type of the completion. 4172 * By convention, the LSB identifies the length of the 4173 * record in 16B units. Even values indicate 16B 4174 * records. Odd values indicate 32B 4175 * records. 4176 */ 4177 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_MASK \ 4178 UINT32_C(0x3f) 4179 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_SFT 0 4180 /* HWRM Asynchronous Event Information */ 4181 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT \ 4182 UINT32_C(0x2e) 4183 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_LAST \ 4184 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT 4185 /* Identifiers of events. */ 4186 uint16_t event_id; 4187 /* Function driver unloaded */ 4188 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD \ 4189 UINT32_C(0x10) 4190 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_LAST \ 4191 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD 4192 /* Event specific data */ 4193 uint32_t event_data2; 4194 uint8_t opaque_v; 4195 /* 4196 * This value is written by the NIC such that it will be different 4197 * for each pass through the completion queue. The even passes 4198 * will write 1. The odd passes will write 0. 4199 */ 4200 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_V UINT32_C(0x1) 4201 /* opaque is 7 b */ 4202 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_MASK \ 4203 UINT32_C(0xfe) 4204 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_SFT 1 4205 /* 8-lsb timestamp from POR (100-msec resolution) */ 4206 uint8_t timestamp_lo; 4207 /* 16-lsb timestamp from POR (100-msec resolution) */ 4208 uint16_t timestamp_hi; 4209 /* Event specific data */ 4210 uint32_t event_data1; 4211 /* Function ID */ 4212 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK \ 4213 UINT32_C(0xffff) 4214 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT \ 4215 0 4216 } __attribute__((packed)); 4217 4218 /* hwrm_async_event_cmpl_func_drvr_load (size:128b/16B) */ 4219 struct hwrm_async_event_cmpl_func_drvr_load { 4220 uint16_t type; 4221 /* 4222 * This field indicates the exact type of the completion. 4223 * By convention, the LSB identifies the length of the 4224 * record in 16B units. Even values indicate 16B 4225 * records. Odd values indicate 32B 4226 * records. 4227 */ 4228 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_MASK \ 4229 UINT32_C(0x3f) 4230 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_SFT 0 4231 /* HWRM Asynchronous Event Information */ 4232 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT \ 4233 UINT32_C(0x2e) 4234 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_LAST \ 4235 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT 4236 /* Identifiers of events. */ 4237 uint16_t event_id; 4238 /* Function driver loaded */ 4239 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD \ 4240 UINT32_C(0x11) 4241 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_LAST \ 4242 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD 4243 /* Event specific data */ 4244 uint32_t event_data2; 4245 uint8_t opaque_v; 4246 /* 4247 * This value is written by the NIC such that it will be different 4248 * for each pass through the completion queue. The even passes 4249 * will write 1. The odd passes will write 0. 4250 */ 4251 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_V UINT32_C(0x1) 4252 /* opaque is 7 b */ 4253 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe) 4254 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_SFT 1 4255 /* 8-lsb timestamp from POR (100-msec resolution) */ 4256 uint8_t timestamp_lo; 4257 /* 16-lsb timestamp from POR (100-msec resolution) */ 4258 uint16_t timestamp_hi; 4259 /* Event specific data */ 4260 uint32_t event_data1; 4261 /* Function ID */ 4262 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \ 4263 UINT32_C(0xffff) 4264 #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0 4265 } __attribute__((packed)); 4266 4267 /* hwrm_async_event_cmpl_func_flr_proc_cmplt (size:128b/16B) */ 4268 struct hwrm_async_event_cmpl_func_flr_proc_cmplt { 4269 uint16_t type; 4270 /* 4271 * This field indicates the exact type of the completion. 4272 * By convention, the LSB identifies the length of the 4273 * record in 16B units. Even values indicate 16B 4274 * records. Odd values indicate 32B 4275 * records. 4276 */ 4277 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_MASK \ 4278 UINT32_C(0x3f) 4279 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_SFT \ 4280 0 4281 /* HWRM Asynchronous Event Information */ 4282 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT \ 4283 UINT32_C(0x2e) 4284 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_LAST \ 4285 HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT 4286 /* Identifiers of events. */ 4287 uint16_t event_id; 4288 /* Function FLR related processing has completed */ 4289 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT \ 4290 UINT32_C(0x12) 4291 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_LAST \ 4292 HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT 4293 /* Event specific data */ 4294 uint32_t event_data2; 4295 uint8_t opaque_v; 4296 /* 4297 * This value is written by the NIC such that it will be different 4298 * for each pass through the completion queue. The even passes 4299 * will write 1. The odd passes will write 0. 4300 */ 4301 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_V \ 4302 UINT32_C(0x1) 4303 /* opaque is 7 b */ 4304 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_MASK \ 4305 UINT32_C(0xfe) 4306 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_SFT 1 4307 /* 8-lsb timestamp from POR (100-msec resolution) */ 4308 uint8_t timestamp_lo; 4309 /* 16-lsb timestamp from POR (100-msec resolution) */ 4310 uint16_t timestamp_hi; 4311 /* Event specific data */ 4312 uint32_t event_data1; 4313 /* Function ID */ 4314 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_MASK \ 4315 UINT32_C(0xffff) 4316 #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_SFT \ 4317 0 4318 } __attribute__((packed)); 4319 4320 /* hwrm_async_event_cmpl_pf_drvr_unload (size:128b/16B) */ 4321 struct hwrm_async_event_cmpl_pf_drvr_unload { 4322 uint16_t type; 4323 /* 4324 * This field indicates the exact type of the completion. 4325 * By convention, the LSB identifies the length of the 4326 * record in 16B units. Even values indicate 16B 4327 * records. Odd values indicate 32B 4328 * records. 4329 */ 4330 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_MASK \ 4331 UINT32_C(0x3f) 4332 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_SFT 0 4333 /* HWRM Asynchronous Event Information */ 4334 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT \ 4335 UINT32_C(0x2e) 4336 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_LAST \ 4337 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT 4338 /* Identifiers of events. */ 4339 uint16_t event_id; 4340 /* PF driver unloaded */ 4341 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD \ 4342 UINT32_C(0x20) 4343 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_LAST \ 4344 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD 4345 /* Event specific data */ 4346 uint32_t event_data2; 4347 uint8_t opaque_v; 4348 /* 4349 * This value is written by the NIC such that it will be different 4350 * for each pass through the completion queue. The even passes 4351 * will write 1. The odd passes will write 0. 4352 */ 4353 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_V UINT32_C(0x1) 4354 /* opaque is 7 b */ 4355 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe) 4356 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_SFT 1 4357 /* 8-lsb timestamp from POR (100-msec resolution) */ 4358 uint8_t timestamp_lo; 4359 /* 16-lsb timestamp from POR (100-msec resolution) */ 4360 uint16_t timestamp_hi; 4361 /* Event specific data */ 4362 uint32_t event_data1; 4363 /* PF ID */ 4364 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK \ 4365 UINT32_C(0xffff) 4366 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0 4367 /* Indicates the physical port this pf belongs to */ 4368 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK \ 4369 UINT32_C(0x70000) 4370 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT 16 4371 } __attribute__((packed)); 4372 4373 /* hwrm_async_event_cmpl_pf_drvr_load (size:128b/16B) */ 4374 struct hwrm_async_event_cmpl_pf_drvr_load { 4375 uint16_t type; 4376 /* 4377 * This field indicates the exact type of the completion. 4378 * By convention, the LSB identifies the length of the 4379 * record in 16B units. Even values indicate 16B 4380 * records. Odd values indicate 32B 4381 * records. 4382 */ 4383 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_MASK \ 4384 UINT32_C(0x3f) 4385 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_SFT 0 4386 /* HWRM Asynchronous Event Information */ 4387 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT \ 4388 UINT32_C(0x2e) 4389 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_LAST \ 4390 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT 4391 /* Identifiers of events. */ 4392 uint16_t event_id; 4393 /* PF driver loaded */ 4394 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD \ 4395 UINT32_C(0x21) 4396 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_LAST \ 4397 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD 4398 /* Event specific data */ 4399 uint32_t event_data2; 4400 uint8_t opaque_v; 4401 /* 4402 * This value is written by the NIC such that it will be different 4403 * for each pass through the completion queue. The even passes 4404 * will write 1. The odd passes will write 0. 4405 */ 4406 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_V UINT32_C(0x1) 4407 /* opaque is 7 b */ 4408 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe) 4409 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_SFT 1 4410 /* 8-lsb timestamp from POR (100-msec resolution) */ 4411 uint8_t timestamp_lo; 4412 /* 16-lsb timestamp from POR (100-msec resolution) */ 4413 uint16_t timestamp_hi; 4414 /* Event specific data */ 4415 uint32_t event_data1; 4416 /* PF ID */ 4417 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \ 4418 UINT32_C(0xffff) 4419 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0 4420 /* Indicates the physical port this pf belongs to */ 4421 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK \ 4422 UINT32_C(0x70000) 4423 #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT 16 4424 } __attribute__((packed)); 4425 4426 /* hwrm_async_event_cmpl_vf_flr (size:128b/16B) */ 4427 struct hwrm_async_event_cmpl_vf_flr { 4428 uint16_t type; 4429 /* 4430 * This field indicates the exact type of the completion. 4431 * By convention, the LSB identifies the length of the 4432 * record in 16B units. Even values indicate 16B 4433 * records. Odd values indicate 32B 4434 * records. 4435 */ 4436 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_MASK \ 4437 UINT32_C(0x3f) 4438 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_SFT 0 4439 /* HWRM Asynchronous Event Information */ 4440 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT \ 4441 UINT32_C(0x2e) 4442 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_LAST \ 4443 HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT 4444 /* Identifiers of events. */ 4445 uint16_t event_id; 4446 /* VF Function Level Reset (FLR) */ 4447 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR UINT32_C(0x30) 4448 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_LAST \ 4449 HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR 4450 /* Event specific data */ 4451 uint32_t event_data2; 4452 uint8_t opaque_v; 4453 /* 4454 * This value is written by the NIC such that it will be different 4455 * for each pass through the completion queue. The even passes 4456 * will write 1. The odd passes will write 0. 4457 */ 4458 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_V UINT32_C(0x1) 4459 /* opaque is 7 b */ 4460 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_MASK UINT32_C(0xfe) 4461 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_SFT 1 4462 /* 8-lsb timestamp from POR (100-msec resolution) */ 4463 uint8_t timestamp_lo; 4464 /* 16-lsb timestamp from POR (100-msec resolution) */ 4465 uint16_t timestamp_hi; 4466 /* Event specific data */ 4467 uint32_t event_data1; 4468 /* VF ID */ 4469 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK \ 4470 UINT32_C(0xffff) 4471 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT 0 4472 /* Indicates the physical function this event occured on. */ 4473 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_MASK \ 4474 UINT32_C(0xff0000) 4475 #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_SFT 16 4476 } __attribute__((packed)); 4477 4478 /* hwrm_async_event_cmpl_vf_mac_addr_change (size:128b/16B) */ 4479 struct hwrm_async_event_cmpl_vf_mac_addr_change { 4480 uint16_t type; 4481 /* 4482 * This field indicates the exact type of the completion. 4483 * By convention, the LSB identifies the length of the 4484 * record in 16B units. Even values indicate 16B 4485 * records. Odd values indicate 32B 4486 * records. 4487 */ 4488 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_MASK \ 4489 UINT32_C(0x3f) 4490 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_SFT 0 4491 /* HWRM Asynchronous Event Information */ 4492 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT \ 4493 UINT32_C(0x2e) 4494 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_LAST \ 4495 HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT 4496 /* Identifiers of events. */ 4497 uint16_t event_id; 4498 /* VF MAC Address Change */ 4499 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE \ 4500 UINT32_C(0x31) 4501 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_LAST \ 4502 HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE 4503 /* Event specific data */ 4504 uint32_t event_data2; 4505 uint8_t opaque_v; 4506 /* 4507 * This value is written by the NIC such that it will be different 4508 * for each pass through the completion queue. The even passes 4509 * will write 1. The odd passes will write 0. 4510 */ 4511 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_V \ 4512 UINT32_C(0x1) 4513 /* opaque is 7 b */ 4514 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_MASK \ 4515 UINT32_C(0xfe) 4516 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_SFT 1 4517 /* 8-lsb timestamp from POR (100-msec resolution) */ 4518 uint8_t timestamp_lo; 4519 /* 16-lsb timestamp from POR (100-msec resolution) */ 4520 uint16_t timestamp_hi; 4521 /* Event specific data */ 4522 uint32_t event_data1; 4523 /* VF ID */ 4524 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_MASK \ 4525 UINT32_C(0xffff) 4526 #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT \ 4527 0 4528 } __attribute__((packed)); 4529 4530 /* hwrm_async_event_cmpl_pf_vf_comm_status_change (size:128b/16B) */ 4531 struct hwrm_async_event_cmpl_pf_vf_comm_status_change { 4532 uint16_t type; 4533 /* 4534 * This field indicates the exact type of the completion. 4535 * By convention, the LSB identifies the length of the 4536 * record in 16B units. Even values indicate 16B 4537 * records. Odd values indicate 32B 4538 * records. 4539 */ 4540 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_MASK \ 4541 UINT32_C(0x3f) 4542 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_SFT \ 4543 0 4544 /* HWRM Asynchronous Event Information */ 4545 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \ 4546 UINT32_C(0x2e) 4547 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_LAST \ 4548 HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT 4549 /* Identifiers of events. */ 4550 uint16_t event_id; 4551 /* PF-VF communication channel status change. */ 4552 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \ 4553 UINT32_C(0x32) 4554 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_LAST \ 4555 HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE 4556 /* Event specific data */ 4557 uint32_t event_data2; 4558 uint8_t opaque_v; 4559 /* 4560 * This value is written by the NIC such that it will be different 4561 * for each pass through the completion queue. The even passes 4562 * will write 1. The odd passes will write 0. 4563 */ 4564 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_V \ 4565 UINT32_C(0x1) 4566 /* opaque is 7 b */ 4567 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_MASK \ 4568 UINT32_C(0xfe) 4569 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_SFT 1 4570 /* 8-lsb timestamp from POR (100-msec resolution) */ 4571 uint8_t timestamp_lo; 4572 /* 16-lsb timestamp from POR (100-msec resolution) */ 4573 uint16_t timestamp_hi; 4574 /* Event specific data */ 4575 uint32_t event_data1; 4576 /* 4577 * If this bit is set to 1, then it indicates that the PF-VF 4578 * communication was lost and it is established. 4579 * If this bit set to 0, then it indicates that the PF-VF 4580 * communication was established and it is lost. 4581 */ 4582 #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_DATA1_COMM_ESTABLISHED \ 4583 UINT32_C(0x1) 4584 } __attribute__((packed)); 4585 4586 /* hwrm_async_event_cmpl_vf_cfg_change (size:128b/16B) */ 4587 struct hwrm_async_event_cmpl_vf_cfg_change { 4588 uint16_t type; 4589 /* 4590 * This field indicates the exact type of the completion. 4591 * By convention, the LSB identifies the length of the 4592 * record in 16B units. Even values indicate 16B 4593 * records. Odd values indicate 32B 4594 * records. 4595 */ 4596 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_MASK \ 4597 UINT32_C(0x3f) 4598 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_SFT 0 4599 /* HWRM Asynchronous Event Information */ 4600 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \ 4601 UINT32_C(0x2e) 4602 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_LAST \ 4603 HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT 4604 /* Identifiers of events. */ 4605 uint16_t event_id; 4606 /* VF Configuration Change */ 4607 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE \ 4608 UINT32_C(0x33) 4609 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_LAST \ 4610 HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE 4611 /* Event specific data */ 4612 uint32_t event_data2; 4613 uint8_t opaque_v; 4614 /* 4615 * This value is written by the NIC such that it will be different 4616 * for each pass through the completion queue. The even passes 4617 * will write 1. The odd passes will write 0. 4618 */ 4619 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_V UINT32_C(0x1) 4620 /* opaque is 7 b */ 4621 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe) 4622 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_SFT 1 4623 /* 8-lsb timestamp from POR (100-msec resolution) */ 4624 uint8_t timestamp_lo; 4625 /* 16-lsb timestamp from POR (100-msec resolution) */ 4626 uint16_t timestamp_hi; 4627 /* 4628 * Each flag provided in this field indicates a specific VF 4629 * configuration change. At least one of these flags shall be set to 1 4630 * when an asynchronous event completion of this type is provided 4631 * by the HWRM. 4632 */ 4633 uint32_t event_data1; 4634 /* 4635 * If this bit is set to 1, then the value of MTU 4636 * was changed on this VF. 4637 * If set to 0, then this bit should be ignored. 4638 */ 4639 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MTU_CHANGE \ 4640 UINT32_C(0x1) 4641 /* 4642 * If this bit is set to 1, then the value of MRU 4643 * was changed on this VF. 4644 * If set to 0, then this bit should be ignored. 4645 */ 4646 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MRU_CHANGE \ 4647 UINT32_C(0x2) 4648 /* 4649 * If this bit is set to 1, then the value of default MAC 4650 * address was changed on this VF. 4651 * If set to 0, then this bit should be ignored. 4652 */ 4653 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_MAC_ADDR_CHANGE \ 4654 UINT32_C(0x4) 4655 /* 4656 * If this bit is set to 1, then the value of default VLAN 4657 * was changed on this VF. 4658 * If set to 0, then this bit should be ignored. 4659 */ 4660 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE \ 4661 UINT32_C(0x8) 4662 /* 4663 * If this bit is set to 1, then the value of trusted VF enable 4664 * was changed on this VF. 4665 * If set to 0, then this bit should be ignored. 4666 */ 4667 #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TRUSTED_VF_CFG_CHANGE \ 4668 UINT32_C(0x10) 4669 } __attribute__((packed)); 4670 4671 /* hwrm_async_event_cmpl_llfc_pfc_change (size:128b/16B) */ 4672 struct hwrm_async_event_cmpl_llfc_pfc_change { 4673 uint16_t type; 4674 /* 4675 * This field indicates the exact type of the completion. 4676 * By convention, the LSB identifies the length of the 4677 * record in 16B units. Even values indicate 16B 4678 * records. Odd values indicate 32B 4679 * records. 4680 */ 4681 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_MASK \ 4682 UINT32_C(0x3f) 4683 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_SFT 0 4684 /* HWRM Asynchronous Event Information */ 4685 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT \ 4686 UINT32_C(0x2e) 4687 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_LAST \ 4688 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT 4689 /* unused1 is 10 b */ 4690 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_MASK \ 4691 UINT32_C(0xffc0) 4692 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_SFT 6 4693 /* Identifiers of events. */ 4694 uint16_t event_id; 4695 /* LLFC/PFC Configuration Change */ 4696 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE \ 4697 UINT32_C(0x34) 4698 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LAST \ 4699 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE 4700 /* Event specific data */ 4701 uint32_t event_data2; 4702 uint8_t opaque_v; 4703 /* 4704 * This value is written by the NIC such that it will be different 4705 * for each pass through the completion queue. The even passes 4706 * will write 1. The odd passes will write 0. 4707 */ 4708 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_V UINT32_C(0x1) 4709 /* opaque is 7 b */ 4710 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_MASK \ 4711 UINT32_C(0xfe) 4712 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_SFT 1 4713 /* 8-lsb timestamp from POR (100-msec resolution) */ 4714 uint8_t timestamp_lo; 4715 /* 16-lsb timestamp from POR (100-msec resolution) */ 4716 uint16_t timestamp_hi; 4717 /* Event specific data */ 4718 uint32_t event_data1; 4719 /* Indicates llfc pfc status change */ 4720 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_MASK \ 4721 UINT32_C(0x3) 4722 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_SFT \ 4723 0 4724 /* 4725 * If this field set to 1, then it indicates that llfc is 4726 * enabled. 4727 */ 4728 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LLFC \ 4729 UINT32_C(0x1) 4730 /* 4731 * If this field is set to 2, then it indicates that pfc 4732 * is enabled. 4733 */ 4734 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC \ 4735 UINT32_C(0x2) 4736 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LAST \ 4737 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC 4738 /* Indicates the physical port this llfc pfc change occur */ 4739 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_MASK \ 4740 UINT32_C(0x1c) 4741 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_SFT \ 4742 2 4743 /* PORT ID */ 4744 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_MASK \ 4745 UINT32_C(0x1fffe0) 4746 #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_SFT \ 4747 5 4748 } __attribute__((packed)); 4749 4750 /* hwrm_async_event_cmpl_default_vnic_change (size:128b/16B) */ 4751 struct hwrm_async_event_cmpl_default_vnic_change { 4752 uint16_t type; 4753 /* 4754 * This field indicates the exact type of the completion. 4755 * By convention, the LSB identifies the length of the 4756 * record in 16B units. Even values indicate 16B 4757 * records. Odd values indicate 32B 4758 * records. 4759 */ 4760 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_MASK \ 4761 UINT32_C(0x3f) 4762 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_SFT \ 4763 0 4764 /* HWRM Asynchronous Event Information */ 4765 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT \ 4766 UINT32_C(0x2e) 4767 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_LAST \ 4768 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT 4769 /* unused1 is 10 b */ 4770 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_MASK \ 4771 UINT32_C(0xffc0) 4772 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_SFT \ 4773 6 4774 /* Identifiers of events. */ 4775 uint16_t event_id; 4776 /* Notification of a default vnic allocaiton or free */ 4777 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION \ 4778 UINT32_C(0x35) 4779 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_LAST \ 4780 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION 4781 /* Event specific data */ 4782 uint32_t event_data2; 4783 uint8_t opaque_v; 4784 /* 4785 * This value is written by the NIC such that it will be different 4786 * for each pass through the completion queue. The even passes 4787 * will write 1. The odd passes will write 0. 4788 */ 4789 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_V \ 4790 UINT32_C(0x1) 4791 /* opaque is 7 b */ 4792 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_MASK \ 4793 UINT32_C(0xfe) 4794 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_SFT 1 4795 /* 8-lsb timestamp from POR (100-msec resolution) */ 4796 uint8_t timestamp_lo; 4797 /* 16-lsb timestamp from POR (100-msec resolution) */ 4798 uint16_t timestamp_hi; 4799 /* Event specific data */ 4800 uint32_t event_data1; 4801 /* Indicates default vnic configuration change */ 4802 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_MASK \ 4803 UINT32_C(0x3) 4804 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_SFT \ 4805 0 4806 /* 4807 * If this field is set to 1, then it indicates that 4808 * a default VNIC has been allocate. 4809 */ 4810 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_ALLOC \ 4811 UINT32_C(0x1) 4812 /* 4813 * If this field is set to 2, then it indicates that 4814 * a default VNIC has been freed. 4815 */ 4816 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE \ 4817 UINT32_C(0x2) 4818 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_LAST \ 4819 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE 4820 /* Indicates the physical function this event occured on. */ 4821 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_MASK \ 4822 UINT32_C(0x3fc) 4823 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_SFT \ 4824 2 4825 /* Indicates the virtual function this event occured on */ 4826 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_MASK \ 4827 UINT32_C(0x3fffc00) 4828 #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_SFT \ 4829 10 4830 } __attribute__((packed)); 4831 4832 /* hwrm_async_event_cmpl_hwrm_error (size:128b/16B) */ 4833 struct hwrm_async_event_cmpl_hwrm_error { 4834 uint16_t type; 4835 /* 4836 * This field indicates the exact type of the completion. 4837 * By convention, the LSB identifies the length of the 4838 * record in 16B units. Even values indicate 16B 4839 * records. Odd values indicate 32B 4840 * records. 4841 */ 4842 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_MASK \ 4843 UINT32_C(0x3f) 4844 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_SFT 0 4845 /* HWRM Asynchronous Event Information */ 4846 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT \ 4847 UINT32_C(0x2e) 4848 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_LAST \ 4849 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT 4850 /* Identifiers of events. */ 4851 uint16_t event_id; 4852 /* HWRM Error */ 4853 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR \ 4854 UINT32_C(0xff) 4855 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_LAST \ 4856 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR 4857 /* Event specific data */ 4858 uint32_t event_data2; 4859 /* Severity of HWRM Error */ 4860 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_MASK \ 4861 UINT32_C(0xff) 4862 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_SFT 0 4863 /* Warning */ 4864 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_WARNING \ 4865 UINT32_C(0x0) 4866 /* Non-fatal Error */ 4867 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_NONFATAL \ 4868 UINT32_C(0x1) 4869 /* Fatal Error */ 4870 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL \ 4871 UINT32_C(0x2) 4872 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_LAST \ 4873 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL 4874 uint8_t opaque_v; 4875 /* 4876 * This value is written by the NIC such that it will be different 4877 * for each pass through the completion queue. The even passes 4878 * will write 1. The odd passes will write 0. 4879 */ 4880 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_V UINT32_C(0x1) 4881 /* opaque is 7 b */ 4882 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_MASK UINT32_C(0xfe) 4883 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_SFT 1 4884 /* 8-lsb timestamp from POR (100-msec resolution) */ 4885 uint8_t timestamp_lo; 4886 /* 16-lsb timestamp from POR (100-msec resolution) */ 4887 uint16_t timestamp_hi; 4888 /* Event specific data */ 4889 uint32_t event_data1; 4890 /* Time stamp for error event */ 4891 #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP \ 4892 UINT32_C(0x1) 4893 } __attribute__((packed)); 4894 4895 /******************* 4896 * hwrm_func_reset * 4897 *******************/ 4898 4899 4900 /* hwrm_func_reset_input (size:192b/24B) */ 4901 struct hwrm_func_reset_input { 4902 /* The HWRM command request type. */ 4903 uint16_t req_type; 4904 /* 4905 * The completion ring to send the completion event on. This should 4906 * be the NQ ID returned from the `nq_alloc` HWRM command. 4907 */ 4908 uint16_t cmpl_ring; 4909 /* 4910 * The sequence ID is used by the driver for tracking multiple 4911 * commands. This ID is treated as opaque data by the firmware and 4912 * the value is returned in the `hwrm_resp_hdr` upon completion. 4913 */ 4914 uint16_t seq_id; 4915 /* 4916 * The target ID of the command: 4917 * * 0x0-0xFFF8 - The function ID 4918 * * 0xFFF8-0xFFFE - Reserved for internal processors 4919 * * 0xFFFF - HWRM 4920 */ 4921 uint16_t target_id; 4922 /* 4923 * A physical address pointer pointing to a host buffer that the 4924 * command's response data will be written. This can be either a host 4925 * physical address (HPA) or a guest physical address (GPA) and must 4926 * point to a physically contiguous block of memory. 4927 */ 4928 uint64_t resp_addr; 4929 uint32_t enables; 4930 /* 4931 * This bit must be '1' for the vf_id_valid field to be 4932 * configured. 4933 */ 4934 #define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID UINT32_C(0x1) 4935 /* 4936 * The ID of the VF that this PF is trying to reset. 4937 * Only the parent PF shall be allowed to reset a child VF. 4938 * 4939 * A parent PF driver shall use this field only when a specific child VF 4940 * is requested to be reset. 4941 */ 4942 uint16_t vf_id; 4943 /* This value indicates the level of a function reset. */ 4944 uint8_t func_reset_level; 4945 /* 4946 * Reset the caller function and its children VFs (if any). If no 4947 * children functions exist, then reset the caller function only. 4948 */ 4949 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL \ 4950 UINT32_C(0x0) 4951 /* Reset the caller function only */ 4952 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME \ 4953 UINT32_C(0x1) 4954 /* 4955 * Reset all children VFs of the caller function driver if the 4956 * caller is a PF driver. 4957 * It is an error to specify this level by a VF driver. 4958 * It is an error to specify this level by a PF driver with 4959 * no children VFs. 4960 */ 4961 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN \ 4962 UINT32_C(0x2) 4963 /* 4964 * Reset a specific VF of the caller function driver if the caller 4965 * is the parent PF driver. 4966 * It is an error to specify this level by a VF driver. 4967 * It is an error to specify this level by a PF driver that is not 4968 * the parent of the VF that is being requested to reset. 4969 */ 4970 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF \ 4971 UINT32_C(0x3) 4972 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_LAST \ 4973 HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF 4974 uint8_t unused_0; 4975 } __attribute__((packed)); 4976 4977 /* hwrm_func_reset_output (size:128b/16B) */ 4978 struct hwrm_func_reset_output { 4979 /* The specific error status for the command. */ 4980 uint16_t error_code; 4981 /* The HWRM command request type. */ 4982 uint16_t req_type; 4983 /* The sequence ID from the original command. */ 4984 uint16_t seq_id; 4985 /* The length of the response data in number of bytes. */ 4986 uint16_t resp_len; 4987 uint8_t unused_0[7]; 4988 /* 4989 * This field is used in Output records to indicate that the output 4990 * is completely written to RAM. This field should be read as '1' 4991 * to indicate that the output has been completely written. 4992 * When writing a command completion or response to an internal processor, 4993 * the order of writes has to be such that this field is written last. 4994 */ 4995 uint8_t valid; 4996 } __attribute__((packed)); 4997 4998 /******************** 4999 * hwrm_func_getfid * 5000 ********************/ 5001 5002 5003 /* hwrm_func_getfid_input (size:192b/24B) */ 5004 struct hwrm_func_getfid_input { 5005 /* The HWRM command request type. */ 5006 uint16_t req_type; 5007 /* 5008 * The completion ring to send the completion event on. This should 5009 * be the NQ ID returned from the `nq_alloc` HWRM command. 5010 */ 5011 uint16_t cmpl_ring; 5012 /* 5013 * The sequence ID is used by the driver for tracking multiple 5014 * commands. This ID is treated as opaque data by the firmware and 5015 * the value is returned in the `hwrm_resp_hdr` upon completion. 5016 */ 5017 uint16_t seq_id; 5018 /* 5019 * The target ID of the command: 5020 * * 0x0-0xFFF8 - The function ID 5021 * * 0xFFF8-0xFFFE - Reserved for internal processors 5022 * * 0xFFFF - HWRM 5023 */ 5024 uint16_t target_id; 5025 /* 5026 * A physical address pointer pointing to a host buffer that the 5027 * command's response data will be written. This can be either a host 5028 * physical address (HPA) or a guest physical address (GPA) and must 5029 * point to a physically contiguous block of memory. 5030 */ 5031 uint64_t resp_addr; 5032 uint32_t enables; 5033 /* 5034 * This bit must be '1' for the pci_id field to be 5035 * configured. 5036 */ 5037 #define HWRM_FUNC_GETFID_INPUT_ENABLES_PCI_ID UINT32_C(0x1) 5038 /* 5039 * This value is the PCI ID of the queried function. 5040 * If ARI is enabled, then it is 5041 * Bus Number (8b):Function Number(8b). Otherwise, it is 5042 * Bus Number (8b):Device Number (5b):Function Number(3b). 5043 */ 5044 uint16_t pci_id; 5045 uint8_t unused_0[2]; 5046 } __attribute__((packed)); 5047 5048 /* hwrm_func_getfid_output (size:128b/16B) */ 5049 struct hwrm_func_getfid_output { 5050 /* The specific error status for the command. */ 5051 uint16_t error_code; 5052 /* The HWRM command request type. */ 5053 uint16_t req_type; 5054 /* The sequence ID from the original command. */ 5055 uint16_t seq_id; 5056 /* The length of the response data in number of bytes. */ 5057 uint16_t resp_len; 5058 /* 5059 * FID value. This value is used to identify operations on the PCI 5060 * bus as belonging to a particular PCI function. 5061 */ 5062 uint16_t fid; 5063 uint8_t unused_0[5]; 5064 /* 5065 * This field is used in Output records to indicate that the output 5066 * is completely written to RAM. This field should be read as '1' 5067 * to indicate that the output has been completely written. 5068 * When writing a command completion or response to an internal processor, 5069 * the order of writes has to be such that this field is written last. 5070 */ 5071 uint8_t valid; 5072 } __attribute__((packed)); 5073 5074 /********************** 5075 * hwrm_func_vf_alloc * 5076 **********************/ 5077 5078 5079 /* hwrm_func_vf_alloc_input (size:192b/24B) */ 5080 struct hwrm_func_vf_alloc_input { 5081 /* The HWRM command request type. */ 5082 uint16_t req_type; 5083 /* 5084 * The completion ring to send the completion event on. This should 5085 * be the NQ ID returned from the `nq_alloc` HWRM command. 5086 */ 5087 uint16_t cmpl_ring; 5088 /* 5089 * The sequence ID is used by the driver for tracking multiple 5090 * commands. This ID is treated as opaque data by the firmware and 5091 * the value is returned in the `hwrm_resp_hdr` upon completion. 5092 */ 5093 uint16_t seq_id; 5094 /* 5095 * The target ID of the command: 5096 * * 0x0-0xFFF8 - The function ID 5097 * * 0xFFF8-0xFFFE - Reserved for internal processors 5098 * * 0xFFFF - HWRM 5099 */ 5100 uint16_t target_id; 5101 /* 5102 * A physical address pointer pointing to a host buffer that the 5103 * command's response data will be written. This can be either a host 5104 * physical address (HPA) or a guest physical address (GPA) and must 5105 * point to a physically contiguous block of memory. 5106 */ 5107 uint64_t resp_addr; 5108 uint32_t enables; 5109 /* 5110 * This bit must be '1' for the first_vf_id field to be 5111 * configured. 5112 */ 5113 #define HWRM_FUNC_VF_ALLOC_INPUT_ENABLES_FIRST_VF_ID UINT32_C(0x1) 5114 /* 5115 * This value is used to identify a Virtual Function (VF). 5116 * The scope of VF ID is local within a PF. 5117 */ 5118 uint16_t first_vf_id; 5119 /* The number of virtual functions requested. */ 5120 uint16_t num_vfs; 5121 } __attribute__((packed)); 5122 5123 /* hwrm_func_vf_alloc_output (size:128b/16B) */ 5124 struct hwrm_func_vf_alloc_output { 5125 /* The specific error status for the command. */ 5126 uint16_t error_code; 5127 /* The HWRM command request type. */ 5128 uint16_t req_type; 5129 /* The sequence ID from the original command. */ 5130 uint16_t seq_id; 5131 /* The length of the response data in number of bytes. */ 5132 uint16_t resp_len; 5133 /* The ID of the first VF allocated. */ 5134 uint16_t first_vf_id; 5135 uint8_t unused_0[5]; 5136 /* 5137 * This field is used in Output records to indicate that the output 5138 * is completely written to RAM. This field should be read as '1' 5139 * to indicate that the output has been completely written. 5140 * When writing a command completion or response to an internal processor, 5141 * the order of writes has to be such that this field is written last. 5142 */ 5143 uint8_t valid; 5144 } __attribute__((packed)); 5145 5146 /********************* 5147 * hwrm_func_vf_free * 5148 *********************/ 5149 5150 5151 /* hwrm_func_vf_free_input (size:192b/24B) */ 5152 struct hwrm_func_vf_free_input { 5153 /* The HWRM command request type. */ 5154 uint16_t req_type; 5155 /* 5156 * The completion ring to send the completion event on. This should 5157 * be the NQ ID returned from the `nq_alloc` HWRM command. 5158 */ 5159 uint16_t cmpl_ring; 5160 /* 5161 * The sequence ID is used by the driver for tracking multiple 5162 * commands. This ID is treated as opaque data by the firmware and 5163 * the value is returned in the `hwrm_resp_hdr` upon completion. 5164 */ 5165 uint16_t seq_id; 5166 /* 5167 * The target ID of the command: 5168 * * 0x0-0xFFF8 - The function ID 5169 * * 0xFFF8-0xFFFE - Reserved for internal processors 5170 * * 0xFFFF - HWRM 5171 */ 5172 uint16_t target_id; 5173 /* 5174 * A physical address pointer pointing to a host buffer that the 5175 * command's response data will be written. This can be either a host 5176 * physical address (HPA) or a guest physical address (GPA) and must 5177 * point to a physically contiguous block of memory. 5178 */ 5179 uint64_t resp_addr; 5180 uint32_t enables; 5181 /* 5182 * This bit must be '1' for the first_vf_id field to be 5183 * configured. 5184 */ 5185 #define HWRM_FUNC_VF_FREE_INPUT_ENABLES_FIRST_VF_ID UINT32_C(0x1) 5186 /* 5187 * This value is used to identify a Virtual Function (VF). 5188 * The scope of VF ID is local within a PF. 5189 */ 5190 uint16_t first_vf_id; 5191 /* 5192 * The number of virtual functions requested. 5193 * 0xFFFF - Cleanup all children of this PF. 5194 */ 5195 uint16_t num_vfs; 5196 } __attribute__((packed)); 5197 5198 /* hwrm_func_vf_free_output (size:128b/16B) */ 5199 struct hwrm_func_vf_free_output { 5200 /* The specific error status for the command. */ 5201 uint16_t error_code; 5202 /* The HWRM command request type. */ 5203 uint16_t req_type; 5204 /* The sequence ID from the original command. */ 5205 uint16_t seq_id; 5206 /* The length of the response data in number of bytes. */ 5207 uint16_t resp_len; 5208 uint8_t unused_0[7]; 5209 /* 5210 * This field is used in Output records to indicate that the output 5211 * is completely written to RAM. This field should be read as '1' 5212 * to indicate that the output has been completely written. 5213 * When writing a command completion or response to an internal processor, 5214 * the order of writes has to be such that this field is written last. 5215 */ 5216 uint8_t valid; 5217 } __attribute__((packed)); 5218 5219 /******************** 5220 * hwrm_func_vf_cfg * 5221 ********************/ 5222 5223 5224 /* hwrm_func_vf_cfg_input (size:448b/56B) */ 5225 struct hwrm_func_vf_cfg_input { 5226 /* The HWRM command request type. */ 5227 uint16_t req_type; 5228 /* 5229 * The completion ring to send the completion event on. This should 5230 * be the NQ ID returned from the `nq_alloc` HWRM command. 5231 */ 5232 uint16_t cmpl_ring; 5233 /* 5234 * The sequence ID is used by the driver for tracking multiple 5235 * commands. This ID is treated as opaque data by the firmware and 5236 * the value is returned in the `hwrm_resp_hdr` upon completion. 5237 */ 5238 uint16_t seq_id; 5239 /* 5240 * The target ID of the command: 5241 * * 0x0-0xFFF8 - The function ID 5242 * * 0xFFF8-0xFFFE - Reserved for internal processors 5243 * * 0xFFFF - HWRM 5244 */ 5245 uint16_t target_id; 5246 /* 5247 * A physical address pointer pointing to a host buffer that the 5248 * command's response data will be written. This can be either a host 5249 * physical address (HPA) or a guest physical address (GPA) and must 5250 * point to a physically contiguous block of memory. 5251 */ 5252 uint64_t resp_addr; 5253 uint32_t enables; 5254 /* 5255 * This bit must be '1' for the mtu field to be 5256 * configured. 5257 */ 5258 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU \ 5259 UINT32_C(0x1) 5260 /* 5261 * This bit must be '1' for the guest_vlan field to be 5262 * configured. 5263 */ 5264 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN \ 5265 UINT32_C(0x2) 5266 /* 5267 * This bit must be '1' for the async_event_cr field to be 5268 * configured. 5269 */ 5270 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \ 5271 UINT32_C(0x4) 5272 /* 5273 * This bit must be '1' for the dflt_mac_addr field to be 5274 * configured. 5275 */ 5276 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \ 5277 UINT32_C(0x8) 5278 /* 5279 * This bit must be '1' for the num_rsscos_ctxs field to be 5280 * configured. 5281 */ 5282 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \ 5283 UINT32_C(0x10) 5284 /* 5285 * This bit must be '1' for the num_cmpl_rings field to be 5286 * configured. 5287 */ 5288 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \ 5289 UINT32_C(0x20) 5290 /* 5291 * This bit must be '1' for the num_tx_rings field to be 5292 * configured. 5293 */ 5294 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_RINGS \ 5295 UINT32_C(0x40) 5296 /* 5297 * This bit must be '1' for the num_rx_rings field to be 5298 * configured. 5299 */ 5300 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_RINGS \ 5301 UINT32_C(0x80) 5302 /* 5303 * This bit must be '1' for the num_l2_ctxs field to be 5304 * configured. 5305 */ 5306 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_L2_CTXS \ 5307 UINT32_C(0x100) 5308 /* 5309 * This bit must be '1' for the num_vnics field to be 5310 * configured. 5311 */ 5312 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_VNICS \ 5313 UINT32_C(0x200) 5314 /* 5315 * This bit must be '1' for the num_stat_ctxs field to be 5316 * configured. 5317 */ 5318 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_STAT_CTXS \ 5319 UINT32_C(0x400) 5320 /* 5321 * This bit must be '1' for the num_hw_ring_grps field to be 5322 * configured. 5323 */ 5324 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \ 5325 UINT32_C(0x800) 5326 /* 5327 * The maximum transmission unit requested on the function. 5328 * The HWRM should make sure that the mtu of 5329 * the function does not exceed the mtu of the physical 5330 * port that this function is associated with. 5331 * 5332 * In addition to requesting mtu per function, it is 5333 * possible to configure mtu per transmit ring. 5334 * By default, the mtu of each transmit ring associated 5335 * with a function is equal to the mtu of the function. 5336 * The HWRM should make sure that the mtu of each transmit 5337 * ring that is assigned to a function has a valid mtu. 5338 */ 5339 uint16_t mtu; 5340 /* 5341 * The guest VLAN for the function being configured. 5342 * This field's format is same as 802.1Q Tag's 5343 * Tag Control Information (TCI) format that includes both 5344 * Priority Code Point (PCP) and VLAN Identifier (VID). 5345 */ 5346 uint16_t guest_vlan; 5347 /* 5348 * ID of the target completion ring for receiving asynchronous 5349 * event completions. If this field is not valid, then the 5350 * HWRM shall use the default completion ring of the function 5351 * that is being configured as the target completion ring for 5352 * providing any asynchronous event completions for that 5353 * function. 5354 * If this field is valid, then the HWRM shall use the 5355 * completion ring identified by this ID as the target 5356 * completion ring for providing any asynchronous event 5357 * completions for the function that is being configured. 5358 */ 5359 uint16_t async_event_cr; 5360 /* 5361 * This value is the current MAC address requested by the VF 5362 * driver to be configured on this VF. A value of 5363 * 00-00-00-00-00-00 indicates no MAC address configuration 5364 * is requested by the VF driver. 5365 * The parent PF driver may reject or overwrite this 5366 * MAC address. 5367 */ 5368 uint8_t dflt_mac_addr[6]; 5369 uint32_t flags; 5370 /* 5371 * This bit requests that the firmware test to see if all the assets 5372 * requested in this command (i.e. number of TX rings) are available. 5373 * The firmware will return an error if the requested assets are 5374 * not available. The firwmare will NOT reserve the assets if they 5375 * are available. 5376 */ 5377 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_TX_ASSETS_TEST \ 5378 UINT32_C(0x1) 5379 /* 5380 * This bit requests that the firmware test to see if all the assets 5381 * requested in this command (i.e. number of RX rings) are available. 5382 * The firmware will return an error if the requested assets are 5383 * not available. The firwmare will NOT reserve the assets if they 5384 * are available. 5385 */ 5386 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RX_ASSETS_TEST \ 5387 UINT32_C(0x2) 5388 /* 5389 * This bit requests that the firmware test to see if all the assets 5390 * requested in this command (i.e. number of CMPL rings) are available. 5391 * The firmware will return an error if the requested assets are 5392 * not available. The firwmare will NOT reserve the assets if they 5393 * are available. 5394 */ 5395 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \ 5396 UINT32_C(0x4) 5397 /* 5398 * This bit requests that the firmware test to see if all the assets 5399 * requested in this command (i.e. number of RSS ctx) are available. 5400 * The firmware will return an error if the requested assets are 5401 * not available. The firwmare will NOT reserve the assets if they 5402 * are available. 5403 */ 5404 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \ 5405 UINT32_C(0x8) 5406 /* 5407 * This bit requests that the firmware test to see if all the assets 5408 * requested in this command (i.e. number of ring groups) are available. 5409 * The firmware will return an error if the requested assets are 5410 * not available. The firwmare will NOT reserve the assets if they 5411 * are available. 5412 */ 5413 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \ 5414 UINT32_C(0x10) 5415 /* 5416 * This bit requests that the firmware test to see if all the assets 5417 * requested in this command (i.e. number of stat ctx) are available. 5418 * The firmware will return an error if the requested assets are 5419 * not available. The firwmare will NOT reserve the assets if they 5420 * are available. 5421 */ 5422 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \ 5423 UINT32_C(0x20) 5424 /* 5425 * This bit requests that the firmware test to see if all the assets 5426 * requested in this command (i.e. number of VNICs) are available. 5427 * The firmware will return an error if the requested assets are 5428 * not available. The firwmare will NOT reserve the assets if they 5429 * are available. 5430 */ 5431 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \ 5432 UINT32_C(0x40) 5433 /* 5434 * This bit requests that the firmware test to see if all the assets 5435 * requested in this command (i.e. number of L2 ctx) are available. 5436 * The firmware will return an error if the requested assets are 5437 * not available. The firwmare will NOT reserve the assets if they 5438 * are available. 5439 */ 5440 #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \ 5441 UINT32_C(0x80) 5442 /* The number of RSS/COS contexts requested for the VF. */ 5443 uint16_t num_rsscos_ctxs; 5444 /* The number of completion rings requested for the VF. */ 5445 uint16_t num_cmpl_rings; 5446 /* The number of transmit rings requested for the VF. */ 5447 uint16_t num_tx_rings; 5448 /* The number of receive rings requested for the VF. */ 5449 uint16_t num_rx_rings; 5450 /* The number of L2 contexts requested for the VF. */ 5451 uint16_t num_l2_ctxs; 5452 /* The number of vnics requested for the VF. */ 5453 uint16_t num_vnics; 5454 /* The number of statistic contexts requested for the VF. */ 5455 uint16_t num_stat_ctxs; 5456 /* The number of HW ring groups requested for the VF. */ 5457 uint16_t num_hw_ring_grps; 5458 uint8_t unused_0[4]; 5459 } __attribute__((packed)); 5460 5461 /* hwrm_func_vf_cfg_output (size:128b/16B) */ 5462 struct hwrm_func_vf_cfg_output { 5463 /* The specific error status for the command. */ 5464 uint16_t error_code; 5465 /* The HWRM command request type. */ 5466 uint16_t req_type; 5467 /* The sequence ID from the original command. */ 5468 uint16_t seq_id; 5469 /* The length of the response data in number of bytes. */ 5470 uint16_t resp_len; 5471 uint8_t unused_0[7]; 5472 /* 5473 * This field is used in Output records to indicate that the output 5474 * is completely written to RAM. This field should be read as '1' 5475 * to indicate that the output has been completely written. 5476 * When writing a command completion or response to an internal processor, 5477 * the order of writes has to be such that this field is written last. 5478 */ 5479 uint8_t valid; 5480 } __attribute__((packed)); 5481 5482 /******************* 5483 * hwrm_func_qcaps * 5484 *******************/ 5485 5486 5487 /* hwrm_func_qcaps_input (size:192b/24B) */ 5488 struct hwrm_func_qcaps_input { 5489 /* The HWRM command request type. */ 5490 uint16_t req_type; 5491 /* 5492 * The completion ring to send the completion event on. This should 5493 * be the NQ ID returned from the `nq_alloc` HWRM command. 5494 */ 5495 uint16_t cmpl_ring; 5496 /* 5497 * The sequence ID is used by the driver for tracking multiple 5498 * commands. This ID is treated as opaque data by the firmware and 5499 * the value is returned in the `hwrm_resp_hdr` upon completion. 5500 */ 5501 uint16_t seq_id; 5502 /* 5503 * The target ID of the command: 5504 * * 0x0-0xFFF8 - The function ID 5505 * * 0xFFF8-0xFFFE - Reserved for internal processors 5506 * * 0xFFFF - HWRM 5507 */ 5508 uint16_t target_id; 5509 /* 5510 * A physical address pointer pointing to a host buffer that the 5511 * command's response data will be written. This can be either a host 5512 * physical address (HPA) or a guest physical address (GPA) and must 5513 * point to a physically contiguous block of memory. 5514 */ 5515 uint64_t resp_addr; 5516 /* 5517 * Function ID of the function that is being queried. 5518 * 0xFF... (All Fs) if the query is for the requesting 5519 * function. 5520 */ 5521 uint16_t fid; 5522 uint8_t unused_0[6]; 5523 } __attribute__((packed)); 5524 5525 /* hwrm_func_qcaps_output (size:640b/80B) */ 5526 struct hwrm_func_qcaps_output { 5527 /* The specific error status for the command. */ 5528 uint16_t error_code; 5529 /* The HWRM command request type. */ 5530 uint16_t req_type; 5531 /* The sequence ID from the original command. */ 5532 uint16_t seq_id; 5533 /* The length of the response data in number of bytes. */ 5534 uint16_t resp_len; 5535 /* 5536 * FID value. This value is used to identify operations on the PCI 5537 * bus as belonging to a particular PCI function. 5538 */ 5539 uint16_t fid; 5540 /* 5541 * Port ID of port that this function is associated with. 5542 * Valid only for the PF. 5543 * 0xFF... (All Fs) if this function is not associated with 5544 * any port. 5545 * 0xFF... (All Fs) if this function is called from a VF. 5546 */ 5547 uint16_t port_id; 5548 uint32_t flags; 5549 /* If 1, then Push mode is supported on this function. */ 5550 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED \ 5551 UINT32_C(0x1) 5552 /* 5553 * If 1, then the global MSI-X auto-masking is enabled for the 5554 * device. 5555 */ 5556 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \ 5557 UINT32_C(0x2) 5558 /* 5559 * If 1, then the Precision Time Protocol (PTP) processing 5560 * is supported on this function. 5561 * The HWRM should enable PTP on only a single Physical 5562 * Function (PF) per port. 5563 */ 5564 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED \ 5565 UINT32_C(0x4) 5566 /* 5567 * If 1, then RDMA over Converged Ethernet (RoCE) v1 5568 * is supported on this function. 5569 */ 5570 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED \ 5571 UINT32_C(0x8) 5572 /* 5573 * If 1, then RDMA over Converged Ethernet (RoCE) v2 5574 * is supported on this function. 5575 */ 5576 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED \ 5577 UINT32_C(0x10) 5578 /* 5579 * If 1, then control and configuration of WoL magic packet 5580 * are supported on this function. 5581 */ 5582 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED \ 5583 UINT32_C(0x20) 5584 /* 5585 * If 1, then control and configuration of bitmap pattern 5586 * packet are supported on this function. 5587 */ 5588 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED \ 5589 UINT32_C(0x40) 5590 /* 5591 * If set to 1, then the control and configuration of rate limit 5592 * of an allocated TX ring on the queried function is supported. 5593 */ 5594 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED \ 5595 UINT32_C(0x80) 5596 /* 5597 * If 1, then control and configuration of minimum and 5598 * maximum bandwidths are supported on the queried function. 5599 */ 5600 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED \ 5601 UINT32_C(0x100) 5602 /* 5603 * If the query is for a VF, then this flag shall be ignored. 5604 * If this query is for a PF and this flag is set to 1, 5605 * then the PF has the capability to set the rate limits 5606 * on the TX rings of its children VFs. 5607 * If this query is for a PF and this flag is set to 0, then 5608 * the PF does not have the capability to set the rate limits 5609 * on the TX rings of its children VFs. 5610 */ 5611 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED \ 5612 UINT32_C(0x200) 5613 /* 5614 * If the query is for a VF, then this flag shall be ignored. 5615 * If this query is for a PF and this flag is set to 1, 5616 * then the PF has the capability to set the minimum and/or 5617 * maximum bandwidths for its children VFs. 5618 * If this query is for a PF and this flag is set to 0, then 5619 * the PF does not have the capability to set the minimum or 5620 * maximum bandwidths for its children VFs. 5621 */ 5622 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED \ 5623 UINT32_C(0x400) 5624 /* 5625 * Standard TX Ring mode is used for the allocation of TX ring 5626 * and underlying scheduling resources that allow bandwidth 5627 * reservation and limit settings on the queried function. 5628 * If set to 1, then standard TX ring mode is supported 5629 * on the queried function. 5630 * If set to 0, then standard TX ring mode is not available 5631 * on the queried function. 5632 */ 5633 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED \ 5634 UINT32_C(0x800) 5635 /* 5636 * If the query is for a VF, then this flag shall be ignored, 5637 * If this query is for a PF and this flag is set to 1, 5638 * then the PF has the capability to detect GENEVE tunnel 5639 * flags. 5640 */ 5641 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GENEVE_TUN_FLAGS_SUPPORTED \ 5642 UINT32_C(0x1000) 5643 /* 5644 * If the query is for a VF, then this flag shall be ignored, 5645 * If this query is for a PF and this flag is set to 1, 5646 * then the PF has the capability to detect NVGRE tunnel 5647 * flags. 5648 */ 5649 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NVGRE_TUN_FLAGS_SUPPORTED \ 5650 UINT32_C(0x2000) 5651 /* 5652 * If the query is for a VF, then this flag shall be ignored, 5653 * If this query is for a PF and this flag is set to 1, 5654 * then the PF has the capability to detect GRE tunnel 5655 * flags. 5656 */ 5657 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GRE_TUN_FLAGS_SUPPORTED \ 5658 UINT32_C(0x4000) 5659 /* 5660 * If the query is for a VF, then this flag shall be ignored, 5661 * If this query is for a PF and this flag is set to 1, 5662 * then the PF has the capability to detect MPLS tunnel 5663 * flags. 5664 */ 5665 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_MPLS_TUN_FLAGS_SUPPORTED \ 5666 UINT32_C(0x8000) 5667 /* 5668 * If the query is for a VF, then this flag shall be ignored, 5669 * If this query is for a PF and this flag is set to 1, 5670 * then the PF has the capability to support pcie stats. 5671 */ 5672 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PCIE_STATS_SUPPORTED \ 5673 UINT32_C(0x10000) 5674 /* 5675 * If the query is for a VF, then this flag shall be ignored, 5676 * If this query is for a PF and this flag is set to 1, 5677 * then the PF has the capability to adopt the VF's belonging 5678 * to another PF. 5679 */ 5680 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADOPTED_PF_SUPPORTED \ 5681 UINT32_C(0x20000) 5682 /* 5683 * If the query is for a VF, then this flag shall be ignored, 5684 * If this query is for a PF and this flag is set to 1, 5685 * then the PF has the capability to administer another PF. 5686 */ 5687 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADMIN_PF_SUPPORTED \ 5688 UINT32_C(0x40000) 5689 /* 5690 * If the query is for a VF, then this flag shall be ignored. 5691 * If this query is for a PF and this flag is set to 1, then 5692 * the PF will know that the firmware has the capability to track 5693 * the virtual link status. 5694 */ 5695 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_LINK_ADMIN_STATUS_SUPPORTED \ 5696 UINT32_C(0x80000) 5697 /* 5698 * If 1, then this function supports the push mode that uses 5699 * write combine buffers and the long inline tx buffer descriptor. 5700 */ 5701 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WCB_PUSH_MODE \ 5702 UINT32_C(0x100000) 5703 /* 5704 * This value is current MAC address configured for this 5705 * function. A value of 00-00-00-00-00-00 indicates no 5706 * MAC address is currently configured. 5707 */ 5708 uint8_t mac_address[6]; 5709 /* 5710 * The maximum number of RSS/COS contexts that can be 5711 * allocated to the function. 5712 */ 5713 uint16_t max_rsscos_ctx; 5714 /* 5715 * The maximum number of completion rings that can be 5716 * allocated to the function. 5717 */ 5718 uint16_t max_cmpl_rings; 5719 /* 5720 * The maximum number of transmit rings that can be 5721 * allocated to the function. 5722 */ 5723 uint16_t max_tx_rings; 5724 /* 5725 * The maximum number of receive rings that can be 5726 * allocated to the function. 5727 */ 5728 uint16_t max_rx_rings; 5729 /* 5730 * The maximum number of L2 contexts that can be 5731 * allocated to the function. 5732 */ 5733 uint16_t max_l2_ctxs; 5734 /* 5735 * The maximum number of VNICs that can be 5736 * allocated to the function. 5737 */ 5738 uint16_t max_vnics; 5739 /* 5740 * The identifier for the first VF enabled on a PF. This 5741 * is valid only on the PF with SR-IOV enabled. 5742 * 0xFF... (All Fs) if this command is called on a PF with 5743 * SR-IOV disabled or on a VF. 5744 */ 5745 uint16_t first_vf_id; 5746 /* 5747 * The maximum number of VFs that can be 5748 * allocated to the function. This is valid only on the 5749 * PF with SR-IOV enabled. 0xFF... (All Fs) if this 5750 * command is called on a PF with SR-IOV disabled or 5751 * on a VF. 5752 */ 5753 uint16_t max_vfs; 5754 /* 5755 * The maximum number of statistic contexts that can be 5756 * allocated to the function. 5757 */ 5758 uint16_t max_stat_ctx; 5759 /* 5760 * The maximum number of Encapsulation records that can be 5761 * offloaded by this function. 5762 */ 5763 uint32_t max_encap_records; 5764 /* 5765 * The maximum number of decapsulation records that can 5766 * be offloaded by this function. 5767 */ 5768 uint32_t max_decap_records; 5769 /* 5770 * The maximum number of Exact Match (EM) flows that can be 5771 * offloaded by this function on the TX side. 5772 */ 5773 uint32_t max_tx_em_flows; 5774 /* 5775 * The maximum number of Wildcard Match (WM) flows that can 5776 * be offloaded by this function on the TX side. 5777 */ 5778 uint32_t max_tx_wm_flows; 5779 /* 5780 * The maximum number of Exact Match (EM) flows that can be 5781 * offloaded by this function on the RX side. 5782 */ 5783 uint32_t max_rx_em_flows; 5784 /* 5785 * The maximum number of Wildcard Match (WM) flows that can 5786 * be offloaded by this function on the RX side. 5787 */ 5788 uint32_t max_rx_wm_flows; 5789 /* 5790 * The maximum number of multicast filters that can 5791 * be supported by this function on the RX side. 5792 */ 5793 uint32_t max_mcast_filters; 5794 /* 5795 * The maximum value of flow_id that can be supported 5796 * in completion records. 5797 */ 5798 uint32_t max_flow_id; 5799 /* 5800 * The maximum number of HW ring groups that can be 5801 * supported on this function. 5802 */ 5803 uint32_t max_hw_ring_grps; 5804 /* 5805 * The maximum number of strict priority transmit rings 5806 * that can be allocated to the function. 5807 * This number indicates the maximum number of TX rings 5808 * that can be assigned strict priorities out of the 5809 * maximum number of TX rings that can be allocated 5810 * (max_tx_rings) to the function. 5811 */ 5812 uint16_t max_sp_tx_rings; 5813 uint8_t unused_0; 5814 /* 5815 * This field is used in Output records to indicate that the output 5816 * is completely written to RAM. This field should be read as '1' 5817 * to indicate that the output has been completely written. 5818 * When writing a command completion or response to an internal processor, 5819 * the order of writes has to be such that this field is written last. 5820 */ 5821 uint8_t valid; 5822 } __attribute__((packed)); 5823 5824 /****************** 5825 * hwrm_func_qcfg * 5826 ******************/ 5827 5828 5829 /* hwrm_func_qcfg_input (size:192b/24B) */ 5830 struct hwrm_func_qcfg_input { 5831 /* The HWRM command request type. */ 5832 uint16_t req_type; 5833 /* 5834 * The completion ring to send the completion event on. This should 5835 * be the NQ ID returned from the `nq_alloc` HWRM command. 5836 */ 5837 uint16_t cmpl_ring; 5838 /* 5839 * The sequence ID is used by the driver for tracking multiple 5840 * commands. This ID is treated as opaque data by the firmware and 5841 * the value is returned in the `hwrm_resp_hdr` upon completion. 5842 */ 5843 uint16_t seq_id; 5844 /* 5845 * The target ID of the command: 5846 * * 0x0-0xFFF8 - The function ID 5847 * * 0xFFF8-0xFFFE - Reserved for internal processors 5848 * * 0xFFFF - HWRM 5849 */ 5850 uint16_t target_id; 5851 /* 5852 * A physical address pointer pointing to a host buffer that the 5853 * command's response data will be written. This can be either a host 5854 * physical address (HPA) or a guest physical address (GPA) and must 5855 * point to a physically contiguous block of memory. 5856 */ 5857 uint64_t resp_addr; 5858 /* 5859 * Function ID of the function that is being queried. 5860 * 0xFF... (All Fs) if the query is for the requesting 5861 * function. 5862 */ 5863 uint16_t fid; 5864 uint8_t unused_0[6]; 5865 } __attribute__((packed)); 5866 5867 /* hwrm_func_qcfg_output (size:640b/80B) */ 5868 struct hwrm_func_qcfg_output { 5869 /* The specific error status for the command. */ 5870 uint16_t error_code; 5871 /* The HWRM command request type. */ 5872 uint16_t req_type; 5873 /* The sequence ID from the original command. */ 5874 uint16_t seq_id; 5875 /* The length of the response data in number of bytes. */ 5876 uint16_t resp_len; 5877 /* 5878 * FID value. This value is used to identify operations on the PCI 5879 * bus as belonging to a particular PCI function. 5880 */ 5881 uint16_t fid; 5882 /* 5883 * Port ID of port that this function is associated with. 5884 * 0xFF... (All Fs) if this function is not associated with 5885 * any port. 5886 */ 5887 uint16_t port_id; 5888 /* 5889 * This value is the current VLAN setting for this 5890 * function. The value of 0 for this field indicates 5891 * no priority tagging or VLAN is used. 5892 * This field's format is same as 802.1Q Tag's 5893 * Tag Control Information (TCI) format that includes both 5894 * Priority Code Point (PCP) and VLAN Identifier (VID). 5895 */ 5896 uint16_t vlan; 5897 uint16_t flags; 5898 /* 5899 * If 1, then magic packet based Out-Of-Box WoL is enabled on 5900 * the port associated with this function. 5901 */ 5902 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED \ 5903 UINT32_C(0x1) 5904 /* 5905 * If 1, then bitmap pattern based Out-Of-Box WoL packet is enabled 5906 * on the port associated with this function. 5907 */ 5908 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED \ 5909 UINT32_C(0x2) 5910 /* 5911 * If set to 1, then FW based DCBX agent is enabled and running on 5912 * the port associated with this function. 5913 * If set to 0, then DCBX agent is not running in the firmware. 5914 */ 5915 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED \ 5916 UINT32_C(0x4) 5917 /* 5918 * Standard TX Ring mode is used for the allocation of TX ring 5919 * and underlying scheduling resources that allow bandwidth 5920 * reservation and limit settings on the queried function. 5921 * If set to 1, then standard TX ring mode is enabled 5922 * on the queried function. 5923 * If set to 0, then the standard TX ring mode is disabled 5924 * on the queried function. In this extended TX ring resource 5925 * mode, the minimum and maximum bandwidth settings are not 5926 * supported to allow the allocation of TX rings to span multiple 5927 * scheduler nodes. 5928 */ 5929 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED \ 5930 UINT32_C(0x8) 5931 /* 5932 * If set to 1 then FW based LLDP agent is enabled and running on 5933 * the port associated with this function. 5934 * If set to 0 then the LLDP agent is not running in the firmware. 5935 */ 5936 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED \ 5937 UINT32_C(0x10) 5938 /* 5939 * If set to 1, then multi-host mode is active for this function. 5940 * If set to 0, then multi-host mode is inactive for this function 5941 * or not applicable for this device. 5942 */ 5943 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST \ 5944 UINT32_C(0x20) 5945 /* 5946 * If the function that is being queried is a PF, then the HWRM shall 5947 * set this field to 0 and the HWRM client shall ignore this field. 5948 * If the function that is being queried is a VF, then the HWRM shall 5949 * set this field to 1 if the queried VF is trusted, otherwise the HWRM 5950 * shall set this field to 0. 5951 */ 5952 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF \ 5953 UINT32_C(0x40) 5954 /* 5955 * This value is current MAC address configured for this 5956 * function. A value of 00-00-00-00-00-00 indicates no 5957 * MAC address is currently configured. 5958 */ 5959 uint8_t mac_address[6]; 5960 /* 5961 * This value is current PCI ID of this 5962 * function. If ARI is enabled, then it is 5963 * Bus Number (8b):Function Number(8b). Otherwise, it is 5964 * Bus Number (8b):Device Number (4b):Function Number(4b). 5965 * If multi-host mode is active, the 4 lsb will indicate 5966 * the PF index for this function. 5967 */ 5968 uint16_t pci_id; 5969 /* 5970 * The number of RSS/COS contexts currently 5971 * allocated to the function. 5972 */ 5973 uint16_t alloc_rsscos_ctx; 5974 /* 5975 * The number of completion rings currently allocated to 5976 * the function. This does not include the rings allocated 5977 * to any children functions if any. 5978 */ 5979 uint16_t alloc_cmpl_rings; 5980 /* 5981 * The number of transmit rings currently allocated to 5982 * the function. This does not include the rings allocated 5983 * to any children functions if any. 5984 */ 5985 uint16_t alloc_tx_rings; 5986 /* 5987 * The number of receive rings currently allocated to 5988 * the function. This does not include the rings allocated 5989 * to any children functions if any. 5990 */ 5991 uint16_t alloc_rx_rings; 5992 /* The allocated number of L2 contexts to the function. */ 5993 uint16_t alloc_l2_ctx; 5994 /* The allocated number of vnics to the function. */ 5995 uint16_t alloc_vnics; 5996 /* 5997 * The maximum transmission unit of the function. 5998 * For rings allocated on this function, this default 5999 * value is used if ring MTU is not specified. 6000 */ 6001 uint16_t mtu; 6002 /* 6003 * The maximum receive unit of the function. 6004 * For vnics allocated on this function, this default 6005 * value is used if vnic MRU is not specified. 6006 */ 6007 uint16_t mru; 6008 /* The statistics context assigned to a function. */ 6009 uint16_t stat_ctx_id; 6010 /* 6011 * The HWRM shall return Unknown value for this field 6012 * when this command is used to query VF's configuration. 6013 */ 6014 uint8_t port_partition_type; 6015 /* Single physical function */ 6016 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF UINT32_C(0x0) 6017 /* Multiple physical functions */ 6018 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS UINT32_C(0x1) 6019 /* Network Partitioning 1.0 */ 6020 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2) 6021 /* Network Partitioning 1.5 */ 6022 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3) 6023 /* Network Partitioning 2.0 */ 6024 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4) 6025 /* Unknown */ 6026 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN \ 6027 UINT32_C(0xff) 6028 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_LAST \ 6029 HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN 6030 /* 6031 * This field will indicate number of physical functions on this port_partition. 6032 * HWRM shall return unavail (i.e. value of 0) for this field 6033 * when this command is used to query VF's configuration or 6034 * from older firmware that doesn't support this field. 6035 */ 6036 uint8_t port_pf_cnt; 6037 /* number of PFs is not available */ 6038 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0) 6039 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_LAST \ 6040 HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL 6041 /* 6042 * The default VNIC ID assigned to a function that is 6043 * being queried. 6044 */ 6045 uint16_t dflt_vnic_id; 6046 uint16_t max_mtu_configured; 6047 /* 6048 * Minimum BW allocated for this function. 6049 * The HWRM will translate this value into byte counter and 6050 * time interval used for the scheduler inside the device. 6051 * A value of 0 indicates the minimum bandwidth is not 6052 * configured. 6053 */ 6054 uint32_t min_bw; 6055 /* The bandwidth value. */ 6056 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK \ 6057 UINT32_C(0xfffffff) 6058 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT 0 6059 /* The granularity of the value (bits or bytes). */ 6060 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE \ 6061 UINT32_C(0x10000000) 6062 /* Value is in bits. */ 6063 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS \ 6064 (UINT32_C(0x0) << 28) 6065 /* Value is in bytes. */ 6066 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES \ 6067 (UINT32_C(0x1) << 28) 6068 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST \ 6069 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES 6070 /* bw_value_unit is 3 b */ 6071 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK \ 6072 UINT32_C(0xe0000000) 6073 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT 29 6074 /* Value is in Mb or MB (base 10). */ 6075 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA \ 6076 (UINT32_C(0x0) << 29) 6077 /* Value is in Kb or KB (base 10). */ 6078 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO \ 6079 (UINT32_C(0x2) << 29) 6080 /* Value is in bits or bytes. */ 6081 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE \ 6082 (UINT32_C(0x4) << 29) 6083 /* Value is in Gb or GB (base 10). */ 6084 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA \ 6085 (UINT32_C(0x6) << 29) 6086 /* Value is in 1/100th of a percentage of total bandwidth. */ 6087 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 6088 (UINT32_C(0x1) << 29) 6089 /* Invalid unit */ 6090 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID \ 6091 (UINT32_C(0x7) << 29) 6092 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST \ 6093 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID 6094 /* 6095 * Maximum BW allocated for this function. 6096 * The HWRM will translate this value into byte counter and 6097 * time interval used for the scheduler inside the device. 6098 * A value of 0 indicates that the maximum bandwidth is not 6099 * configured. 6100 */ 6101 uint32_t max_bw; 6102 /* The bandwidth value. */ 6103 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK \ 6104 UINT32_C(0xfffffff) 6105 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT 0 6106 /* The granularity of the value (bits or bytes). */ 6107 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE \ 6108 UINT32_C(0x10000000) 6109 /* Value is in bits. */ 6110 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS \ 6111 (UINT32_C(0x0) << 28) 6112 /* Value is in bytes. */ 6113 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES \ 6114 (UINT32_C(0x1) << 28) 6115 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST \ 6116 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES 6117 /* bw_value_unit is 3 b */ 6118 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK \ 6119 UINT32_C(0xe0000000) 6120 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT 29 6121 /* Value is in Mb or MB (base 10). */ 6122 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA \ 6123 (UINT32_C(0x0) << 29) 6124 /* Value is in Kb or KB (base 10). */ 6125 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO \ 6126 (UINT32_C(0x2) << 29) 6127 /* Value is in bits or bytes. */ 6128 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE \ 6129 (UINT32_C(0x4) << 29) 6130 /* Value is in Gb or GB (base 10). */ 6131 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA \ 6132 (UINT32_C(0x6) << 29) 6133 /* Value is in 1/100th of a percentage of total bandwidth. */ 6134 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 6135 (UINT32_C(0x1) << 29) 6136 /* Invalid unit */ 6137 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID \ 6138 (UINT32_C(0x7) << 29) 6139 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST \ 6140 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID 6141 /* 6142 * This value indicates the Edge virtual bridge mode for the 6143 * domain that this function belongs to. 6144 */ 6145 uint8_t evb_mode; 6146 /* No Edge Virtual Bridging (EVB) */ 6147 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0) 6148 /* Virtual Ethernet Bridge (VEB) */ 6149 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB UINT32_C(0x1) 6150 /* Virtual Ethernet Port Aggregator (VEPA) */ 6151 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA UINT32_C(0x2) 6152 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_LAST \ 6153 HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA 6154 uint8_t options; 6155 /* 6156 * This value indicates the PCIE device cache line size. 6157 * The cache line size allows the DMA writes to terminate and 6158 * start at the cache boundary. 6159 */ 6160 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_MASK \ 6161 UINT32_C(0x3) 6162 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SFT 0 6163 /* Cache Line Size 64 bytes */ 6164 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \ 6165 UINT32_C(0x0) 6166 /* Cache Line Size 128 bytes */ 6167 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \ 6168 UINT32_C(0x1) 6169 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_LAST \ 6170 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 6171 /* This value is the virtual link admin state setting. */ 6172 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_MASK \ 6173 UINT32_C(0xc) 6174 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_SFT 2 6175 /* Admin link state is in forced down mode. */ 6176 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \ 6177 (UINT32_C(0x0) << 2) 6178 /* Admin link state is in forced up mode. */ 6179 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \ 6180 (UINT32_C(0x1) << 2) 6181 /* Admin link state is in auto mode - follows the physical link state. */ 6182 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \ 6183 (UINT32_C(0x2) << 2) 6184 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_LAST \ 6185 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO 6186 /* Reserved for future. */ 6187 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_MASK \ 6188 UINT32_C(0xf0) 6189 #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_SFT 4 6190 /* 6191 * The number of VFs that are allocated to the function. 6192 * This is valid only on the PF with SR-IOV enabled. 6193 * 0xFF... (All Fs) if this command is called on a PF with 6194 * SR-IOV disabled or on a VF. 6195 */ 6196 uint16_t alloc_vfs; 6197 /* 6198 * The number of allocated multicast filters for this 6199 * function on the RX side. 6200 */ 6201 uint32_t alloc_mcast_filters; 6202 /* 6203 * The number of allocated HW ring groups for this 6204 * function. 6205 */ 6206 uint32_t alloc_hw_ring_grps; 6207 /* 6208 * The number of strict priority transmit rings out of 6209 * currently allocated TX rings to the function 6210 * (alloc_tx_rings). 6211 */ 6212 uint16_t alloc_sp_tx_rings; 6213 /* 6214 * The number of statistics contexts 6215 * currently reserved for the function. 6216 */ 6217 uint16_t alloc_stat_ctx; 6218 /* 6219 * This field specifies how many NQs are reserved for the PF. 6220 * Remaining NQs that belong to the PF are available for VFs. 6221 * Once a PF has created VFs, it cannot change how many NQs are 6222 * reserved for itself (since the NQs must be contiguous in HW). 6223 */ 6224 uint16_t alloc_msix; 6225 uint8_t unused_2[5]; 6226 /* 6227 * This field is used in Output records to indicate that the output 6228 * is completely written to RAM. This field should be read as '1' 6229 * to indicate that the output has been completely written. 6230 * When writing a command completion or response to an internal processor, 6231 * the order of writes has to be such that this field is written last. 6232 */ 6233 uint8_t valid; 6234 } __attribute__((packed)); 6235 6236 /***************** 6237 * hwrm_func_cfg * 6238 *****************/ 6239 6240 6241 /* hwrm_func_cfg_input (size:704b/88B) */ 6242 struct hwrm_func_cfg_input { 6243 /* The HWRM command request type. */ 6244 uint16_t req_type; 6245 /* 6246 * The completion ring to send the completion event on. This should 6247 * be the NQ ID returned from the `nq_alloc` HWRM command. 6248 */ 6249 uint16_t cmpl_ring; 6250 /* 6251 * The sequence ID is used by the driver for tracking multiple 6252 * commands. This ID is treated as opaque data by the firmware and 6253 * the value is returned in the `hwrm_resp_hdr` upon completion. 6254 */ 6255 uint16_t seq_id; 6256 /* 6257 * The target ID of the command: 6258 * * 0x0-0xFFF8 - The function ID 6259 * * 0xFFF8-0xFFFE - Reserved for internal processors 6260 * * 0xFFFF - HWRM 6261 */ 6262 uint16_t target_id; 6263 /* 6264 * A physical address pointer pointing to a host buffer that the 6265 * command's response data will be written. This can be either a host 6266 * physical address (HPA) or a guest physical address (GPA) and must 6267 * point to a physically contiguous block of memory. 6268 */ 6269 uint64_t resp_addr; 6270 /* 6271 * Function ID of the function that is being 6272 * configured. 6273 * If set to 0xFF... (All Fs), then the the configuration is 6274 * for the requesting function. 6275 */ 6276 uint16_t fid; 6277 /* 6278 * This field specifies how many NQs will be reserved for the PF. 6279 * Remaining NQs that belong to the PF become available for VFs. 6280 * Once a PF has created VFs, it cannot change how many NQs are 6281 * reserved for itself (since the NQs must be contiguous in HW). 6282 */ 6283 uint16_t num_msix; 6284 uint32_t flags; 6285 /* 6286 * When this bit is '1', the function is disabled with 6287 * source MAC address check. 6288 * This is an anti-spoofing check. If this flag is set, 6289 * then the function shall be configured to disallow 6290 * transmission of frames with the source MAC address that 6291 * is configured for this function. 6292 */ 6293 #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE \ 6294 UINT32_C(0x1) 6295 /* 6296 * When this bit is '1', the function is enabled with 6297 * source MAC address check. 6298 * This is an anti-spoofing check. If this flag is set, 6299 * then the function shall be configured to allow 6300 * transmission of frames with the source MAC address that 6301 * is configured for this function. 6302 */ 6303 #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE \ 6304 UINT32_C(0x2) 6305 /* reserved. */ 6306 #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK \ 6307 UINT32_C(0x1fc) 6308 #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT 2 6309 /* 6310 * Standard TX Ring mode is used for the allocation of TX ring 6311 * and underlying scheduling resources that allow bandwidth 6312 * reservation and limit settings on the queried function. 6313 * If set to 1, then standard TX ring mode is requested to be 6314 * enabled on the function being configured. 6315 */ 6316 #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE \ 6317 UINT32_C(0x200) 6318 /* 6319 * Standard TX Ring mode is used for the allocation of TX ring 6320 * and underlying scheduling resources that allow bandwidth 6321 * reservation and limit settings on the queried function. 6322 * If set to 1, then the standard TX ring mode is requested to 6323 * be disabled on the function being configured. In this extended 6324 * TX ring resource mode, the minimum and maximum bandwidth settings 6325 * are not supported to allow the allocation of TX rings to 6326 * span multiple scheduler nodes. 6327 */ 6328 #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE \ 6329 UINT32_C(0x400) 6330 /* 6331 * If this bit is set, virtual mac address configured 6332 * in this command will be persistent over warm boot. 6333 */ 6334 #define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST \ 6335 UINT32_C(0x800) 6336 /* 6337 * This bit only applies to the VF. If this bit is set, the statistic 6338 * context counters will not be cleared when the statistic context is freed 6339 * or a function reset is called on VF. This bit will be cleared when the PF 6340 * is unloaded or a function reset is called on the PF. 6341 */ 6342 #define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC \ 6343 UINT32_C(0x1000) 6344 /* 6345 * This bit requests that the firmware test to see if all the assets 6346 * requested in this command (i.e. number of TX rings) are available. 6347 * The firmware will return an error if the requested assets are 6348 * not available. The firwmare will NOT reserve the assets if they 6349 * are available. 6350 */ 6351 #define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST \ 6352 UINT32_C(0x2000) 6353 /* 6354 * This bit requests that the firmware test to see if all the assets 6355 * requested in this command (i.e. number of RX rings) are available. 6356 * The firmware will return an error if the requested assets are 6357 * not available. The firwmare will NOT reserve the assets if they 6358 * are available. 6359 */ 6360 #define HWRM_FUNC_CFG_INPUT_FLAGS_RX_ASSETS_TEST \ 6361 UINT32_C(0x4000) 6362 /* 6363 * This bit requests that the firmware test to see if all the assets 6364 * requested in this command (i.e. number of CMPL rings) are available. 6365 * The firmware will return an error if the requested assets are 6366 * not available. The firwmare will NOT reserve the assets if they 6367 * are available. 6368 */ 6369 #define HWRM_FUNC_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \ 6370 UINT32_C(0x8000) 6371 /* 6372 * This bit requests that the firmware test to see if all the assets 6373 * requested in this command (i.e. number of RSS ctx) are available. 6374 * The firmware will return an error if the requested assets are 6375 * not available. The firwmare will NOT reserve the assets if they 6376 * are available. 6377 */ 6378 #define HWRM_FUNC_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \ 6379 UINT32_C(0x10000) 6380 /* 6381 * This bit requests that the firmware test to see if all the assets 6382 * requested in this command (i.e. number of ring groups) are available. 6383 * The firmware will return an error if the requested assets are 6384 * not available. The firwmare will NOT reserve the assets if they 6385 * are available. 6386 */ 6387 #define HWRM_FUNC_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \ 6388 UINT32_C(0x20000) 6389 /* 6390 * This bit requests that the firmware test to see if all the assets 6391 * requested in this command (i.e. number of stat ctx) are available. 6392 * The firmware will return an error if the requested assets are 6393 * not available. The firwmare will NOT reserve the assets if they 6394 * are available. 6395 */ 6396 #define HWRM_FUNC_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \ 6397 UINT32_C(0x40000) 6398 /* 6399 * This bit requests that the firmware test to see if all the assets 6400 * requested in this command (i.e. number of VNICs) are available. 6401 * The firmware will return an error if the requested assets are 6402 * not available. The firwmare will NOT reserve the assets if they 6403 * are available. 6404 */ 6405 #define HWRM_FUNC_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \ 6406 UINT32_C(0x80000) 6407 /* 6408 * This bit requests that the firmware test to see if all the assets 6409 * requested in this command (i.e. number of L2 ctx) are available. 6410 * The firmware will return an error if the requested assets are 6411 * not available. The firwmare will NOT reserve the assets if they 6412 * are available. 6413 */ 6414 #define HWRM_FUNC_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \ 6415 UINT32_C(0x100000) 6416 /* 6417 * This configuration change can be initiated by a PF driver. This 6418 * configuration request shall be targeted to a VF. From local host 6419 * resident HWRM clients, only the parent PF driver shall be allowed 6420 * to initiate this change on one of its children VFs. If this bit is 6421 * set to 1, then the VF that is being configured is requested to be 6422 * trusted. If this bit is set to 0, then the VF that is being configured 6423 * is requested to be not trusted. 6424 */ 6425 #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_ENABLE \ 6426 UINT32_C(0x200000) 6427 uint32_t enables; 6428 /* 6429 * This bit must be '1' for the mtu field to be 6430 * configured. 6431 */ 6432 #define HWRM_FUNC_CFG_INPUT_ENABLES_MTU \ 6433 UINT32_C(0x1) 6434 /* 6435 * This bit must be '1' for the mru field to be 6436 * configured. 6437 */ 6438 #define HWRM_FUNC_CFG_INPUT_ENABLES_MRU \ 6439 UINT32_C(0x2) 6440 /* 6441 * This bit must be '1' for the num_rsscos_ctxs field to be 6442 * configured. 6443 */ 6444 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \ 6445 UINT32_C(0x4) 6446 /* 6447 * This bit must be '1' for the num_cmpl_rings field to be 6448 * configured. 6449 */ 6450 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \ 6451 UINT32_C(0x8) 6452 /* 6453 * This bit must be '1' for the num_tx_rings field to be 6454 * configured. 6455 */ 6456 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS \ 6457 UINT32_C(0x10) 6458 /* 6459 * This bit must be '1' for the num_rx_rings field to be 6460 * configured. 6461 */ 6462 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS \ 6463 UINT32_C(0x20) 6464 /* 6465 * This bit must be '1' for the num_l2_ctxs field to be 6466 * configured. 6467 */ 6468 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS \ 6469 UINT32_C(0x40) 6470 /* 6471 * This bit must be '1' for the num_vnics field to be 6472 * configured. 6473 */ 6474 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS \ 6475 UINT32_C(0x80) 6476 /* 6477 * This bit must be '1' for the num_stat_ctxs field to be 6478 * configured. 6479 */ 6480 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS \ 6481 UINT32_C(0x100) 6482 /* 6483 * This bit must be '1' for the dflt_mac_addr field to be 6484 * configured. 6485 */ 6486 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \ 6487 UINT32_C(0x200) 6488 /* 6489 * This bit must be '1' for the dflt_vlan field to be 6490 * configured. 6491 */ 6492 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN \ 6493 UINT32_C(0x400) 6494 /* 6495 * This bit must be '1' for the dflt_ip_addr field to be 6496 * configured. 6497 */ 6498 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR \ 6499 UINT32_C(0x800) 6500 /* 6501 * This bit must be '1' for the min_bw field to be 6502 * configured. 6503 */ 6504 #define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW \ 6505 UINT32_C(0x1000) 6506 /* 6507 * This bit must be '1' for the max_bw field to be 6508 * configured. 6509 */ 6510 #define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW \ 6511 UINT32_C(0x2000) 6512 /* 6513 * This bit must be '1' for the async_event_cr field to be 6514 * configured. 6515 */ 6516 #define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \ 6517 UINT32_C(0x4000) 6518 /* 6519 * This bit must be '1' for the vlan_antispoof_mode field to be 6520 * configured. 6521 */ 6522 #define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE \ 6523 UINT32_C(0x8000) 6524 /* 6525 * This bit must be '1' for the allowed_vlan_pris field to be 6526 * configured. 6527 */ 6528 #define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS \ 6529 UINT32_C(0x10000) 6530 /* 6531 * This bit must be '1' for the evb_mode field to be 6532 * configured. 6533 */ 6534 #define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE \ 6535 UINT32_C(0x20000) 6536 /* 6537 * This bit must be '1' for the num_mcast_filters field to be 6538 * configured. 6539 */ 6540 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS \ 6541 UINT32_C(0x40000) 6542 /* 6543 * This bit must be '1' for the num_hw_ring_grps field to be 6544 * configured. 6545 */ 6546 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \ 6547 UINT32_C(0x80000) 6548 /* 6549 * This bit must be '1' for the cache_linesize field to be 6550 * configured. 6551 */ 6552 #define HWRM_FUNC_CFG_INPUT_ENABLES_CACHE_LINESIZE \ 6553 UINT32_C(0x100000) 6554 /* 6555 * This bit must be '1' for the num_msix field to be 6556 * configured. 6557 */ 6558 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX \ 6559 UINT32_C(0x200000) 6560 /* 6561 * This bit must be '1' for the link admin state field to be 6562 * configured. 6563 */ 6564 #define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_LINK_STATE \ 6565 UINT32_C(0x400000) 6566 /* 6567 * The maximum transmission unit of the function. 6568 * The HWRM should make sure that the mtu of 6569 * the function does not exceed the mtu of the physical 6570 * port that this function is associated with. 6571 * 6572 * In addition to configuring mtu per function, it is 6573 * possible to configure mtu per transmit ring. 6574 * By default, the mtu of each transmit ring associated 6575 * with a function is equal to the mtu of the function. 6576 * The HWRM should make sure that the mtu of each transmit 6577 * ring that is assigned to a function has a valid mtu. 6578 */ 6579 uint16_t mtu; 6580 /* 6581 * The maximum receive unit of the function. 6582 * The HWRM should make sure that the mru of 6583 * the function does not exceed the mru of the physical 6584 * port that this function is associated with. 6585 * 6586 * In addition to configuring mru per function, it is 6587 * possible to configure mru per vnic. 6588 * By default, the mru of each vnic associated 6589 * with a function is equal to the mru of the function. 6590 * The HWRM should make sure that the mru of each vnic 6591 * that is assigned to a function has a valid mru. 6592 */ 6593 uint16_t mru; 6594 /* 6595 * The number of RSS/COS contexts requested for the 6596 * function. 6597 */ 6598 uint16_t num_rsscos_ctxs; 6599 /* 6600 * The number of completion rings requested for the 6601 * function. This does not include the rings allocated 6602 * to any children functions if any. 6603 */ 6604 uint16_t num_cmpl_rings; 6605 /* 6606 * The number of transmit rings requested for the function. 6607 * This does not include the rings allocated to any 6608 * children functions if any. 6609 */ 6610 uint16_t num_tx_rings; 6611 /* 6612 * The number of receive rings requested for the function. 6613 * This does not include the rings allocated 6614 * to any children functions if any. 6615 */ 6616 uint16_t num_rx_rings; 6617 /* The requested number of L2 contexts for the function. */ 6618 uint16_t num_l2_ctxs; 6619 /* The requested number of vnics for the function. */ 6620 uint16_t num_vnics; 6621 /* The requested number of statistic contexts for the function. */ 6622 uint16_t num_stat_ctxs; 6623 /* 6624 * The number of HW ring groups that should 6625 * be reserved for this function. 6626 */ 6627 uint16_t num_hw_ring_grps; 6628 /* The default MAC address for the function being configured. */ 6629 uint8_t dflt_mac_addr[6]; 6630 /* 6631 * The default VLAN for the function being configured. 6632 * This field's format is same as 802.1Q Tag's 6633 * Tag Control Information (TCI) format that includes both 6634 * Priority Code Point (PCP) and VLAN Identifier (VID). 6635 */ 6636 uint16_t dflt_vlan; 6637 /* 6638 * The default IP address for the function being configured. 6639 * This address is only used in enabling source property check. 6640 */ 6641 uint32_t dflt_ip_addr[4]; 6642 /* 6643 * Minimum BW allocated for this function. 6644 * The HWRM will translate this value into byte counter and 6645 * time interval used for the scheduler inside the device. 6646 */ 6647 uint32_t min_bw; 6648 /* The bandwidth value. */ 6649 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK \ 6650 UINT32_C(0xfffffff) 6651 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT 0 6652 /* The granularity of the value (bits or bytes). */ 6653 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE \ 6654 UINT32_C(0x10000000) 6655 /* Value is in bits. */ 6656 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS \ 6657 (UINT32_C(0x0) << 28) 6658 /* Value is in bytes. */ 6659 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES \ 6660 (UINT32_C(0x1) << 28) 6661 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST \ 6662 HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES 6663 /* bw_value_unit is 3 b */ 6664 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK \ 6665 UINT32_C(0xe0000000) 6666 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT 29 6667 /* Value is in Mb or MB (base 10). */ 6668 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA \ 6669 (UINT32_C(0x0) << 29) 6670 /* Value is in Kb or KB (base 10). */ 6671 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO \ 6672 (UINT32_C(0x2) << 29) 6673 /* Value is in bits or bytes. */ 6674 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE \ 6675 (UINT32_C(0x4) << 29) 6676 /* Value is in Gb or GB (base 10). */ 6677 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA \ 6678 (UINT32_C(0x6) << 29) 6679 /* Value is in 1/100th of a percentage of total bandwidth. */ 6680 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 6681 (UINT32_C(0x1) << 29) 6682 /* Invalid unit */ 6683 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID \ 6684 (UINT32_C(0x7) << 29) 6685 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST \ 6686 HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID 6687 /* 6688 * Maximum BW allocated for this function. 6689 * The HWRM will translate this value into byte counter and 6690 * time interval used for the scheduler inside the device. 6691 */ 6692 uint32_t max_bw; 6693 /* The bandwidth value. */ 6694 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK \ 6695 UINT32_C(0xfffffff) 6696 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT 0 6697 /* The granularity of the value (bits or bytes). */ 6698 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE \ 6699 UINT32_C(0x10000000) 6700 /* Value is in bits. */ 6701 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS \ 6702 (UINT32_C(0x0) << 28) 6703 /* Value is in bytes. */ 6704 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES \ 6705 (UINT32_C(0x1) << 28) 6706 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST \ 6707 HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES 6708 /* bw_value_unit is 3 b */ 6709 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \ 6710 UINT32_C(0xe0000000) 6711 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT 29 6712 /* Value is in Mb or MB (base 10). */ 6713 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \ 6714 (UINT32_C(0x0) << 29) 6715 /* Value is in Kb or KB (base 10). */ 6716 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \ 6717 (UINT32_C(0x2) << 29) 6718 /* Value is in bits or bytes. */ 6719 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \ 6720 (UINT32_C(0x4) << 29) 6721 /* Value is in Gb or GB (base 10). */ 6722 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \ 6723 (UINT32_C(0x6) << 29) 6724 /* Value is in 1/100th of a percentage of total bandwidth. */ 6725 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 6726 (UINT32_C(0x1) << 29) 6727 /* Invalid unit */ 6728 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \ 6729 (UINT32_C(0x7) << 29) 6730 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \ 6731 HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID 6732 /* 6733 * ID of the target completion ring for receiving asynchronous 6734 * event completions. If this field is not valid, then the 6735 * HWRM shall use the default completion ring of the function 6736 * that is being configured as the target completion ring for 6737 * providing any asynchronous event completions for that 6738 * function. 6739 * If this field is valid, then the HWRM shall use the 6740 * completion ring identified by this ID as the target 6741 * completion ring for providing any asynchronous event 6742 * completions for the function that is being configured. 6743 */ 6744 uint16_t async_event_cr; 6745 /* VLAN Anti-spoofing mode. */ 6746 uint8_t vlan_antispoof_mode; 6747 /* No VLAN anti-spoofing checks are enabled */ 6748 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK \ 6749 UINT32_C(0x0) 6750 /* Validate VLAN against the configured VLAN(s) */ 6751 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN \ 6752 UINT32_C(0x1) 6753 /* Insert VLAN if it does not exist, otherwise discard */ 6754 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE \ 6755 UINT32_C(0x2) 6756 /* Insert VLAN if it does not exist, override VLAN if it exists */ 6757 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN \ 6758 UINT32_C(0x3) 6759 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_LAST \ 6760 HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN 6761 /* 6762 * This bit field defines VLAN PRIs that are allowed on 6763 * this function. 6764 * If nth bit is set, then VLAN PRI n is allowed on this 6765 * function. 6766 */ 6767 uint8_t allowed_vlan_pris; 6768 /* 6769 * The HWRM shall allow a PF driver to change EVB mode for the 6770 * partition it belongs to. 6771 * The HWRM shall not allow a VF driver to change the EVB mode. 6772 * The HWRM shall take into account the switching of EVB mode 6773 * from one to another and reconfigure hardware resources as 6774 * appropriately. 6775 * The switching from VEB to VEPA mode requires 6776 * the disabling of the loopback traffic. Additionally, 6777 * source knock outs are handled differently in VEB and VEPA 6778 * modes. 6779 */ 6780 uint8_t evb_mode; 6781 /* No Edge Virtual Bridging (EVB) */ 6782 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0) 6783 /* Virtual Ethernet Bridge (VEB) */ 6784 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB UINT32_C(0x1) 6785 /* Virtual Ethernet Port Aggregator (VEPA) */ 6786 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA UINT32_C(0x2) 6787 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_LAST \ 6788 HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA 6789 uint8_t options; 6790 /* 6791 * This value indicates the PCIE device cache line size. 6792 * The cache line size allows the DMA writes to terminate and 6793 * start at the cache boundary. 6794 */ 6795 #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_MASK \ 6796 UINT32_C(0x3) 6797 #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SFT 0 6798 /* Cache Line Size 64 bytes */ 6799 #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \ 6800 UINT32_C(0x0) 6801 /* Cache Line Size 128 bytes */ 6802 #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \ 6803 UINT32_C(0x1) 6804 #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_LAST \ 6805 HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 6806 /* This value is the virtual link admin state setting. */ 6807 #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_MASK \ 6808 UINT32_C(0xc) 6809 #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_SFT 2 6810 /* Admin state is forced down. */ 6811 #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \ 6812 (UINT32_C(0x0) << 2) 6813 /* Admin state is forced up. */ 6814 #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \ 6815 (UINT32_C(0x1) << 2) 6816 /* Admin state is in auto mode - is to follow the physical link state. */ 6817 #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \ 6818 (UINT32_C(0x2) << 2) 6819 #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_LAST \ 6820 HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO 6821 /* Reserved for future. */ 6822 #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_MASK \ 6823 UINT32_C(0xf0) 6824 #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_SFT 4 6825 /* 6826 * The number of multicast filters that should 6827 * be reserved for this function on the RX side. 6828 */ 6829 uint16_t num_mcast_filters; 6830 } __attribute__((packed)); 6831 6832 /* hwrm_func_cfg_output (size:128b/16B) */ 6833 struct hwrm_func_cfg_output { 6834 /* The specific error status for the command. */ 6835 uint16_t error_code; 6836 /* The HWRM command request type. */ 6837 uint16_t req_type; 6838 /* The sequence ID from the original command. */ 6839 uint16_t seq_id; 6840 /* The length of the response data in number of bytes. */ 6841 uint16_t resp_len; 6842 uint8_t unused_0[7]; 6843 /* 6844 * This field is used in Output records to indicate that the output 6845 * is completely written to RAM. This field should be read as '1' 6846 * to indicate that the output has been completely written. 6847 * When writing a command completion or response to an internal processor, 6848 * the order of writes has to be such that this field is written last. 6849 */ 6850 uint8_t valid; 6851 } __attribute__((packed)); 6852 6853 /******************** 6854 * hwrm_func_qstats * 6855 ********************/ 6856 6857 6858 /* hwrm_func_qstats_input (size:192b/24B) */ 6859 struct hwrm_func_qstats_input { 6860 /* The HWRM command request type. */ 6861 uint16_t req_type; 6862 /* 6863 * The completion ring to send the completion event on. This should 6864 * be the NQ ID returned from the `nq_alloc` HWRM command. 6865 */ 6866 uint16_t cmpl_ring; 6867 /* 6868 * The sequence ID is used by the driver for tracking multiple 6869 * commands. This ID is treated as opaque data by the firmware and 6870 * the value is returned in the `hwrm_resp_hdr` upon completion. 6871 */ 6872 uint16_t seq_id; 6873 /* 6874 * The target ID of the command: 6875 * * 0x0-0xFFF8 - The function ID 6876 * * 0xFFF8-0xFFFE - Reserved for internal processors 6877 * * 0xFFFF - HWRM 6878 */ 6879 uint16_t target_id; 6880 /* 6881 * A physical address pointer pointing to a host buffer that the 6882 * command's response data will be written. This can be either a host 6883 * physical address (HPA) or a guest physical address (GPA) and must 6884 * point to a physically contiguous block of memory. 6885 */ 6886 uint64_t resp_addr; 6887 /* 6888 * Function ID of the function that is being queried. 6889 * 0xFF... (All Fs) if the query is for the requesting 6890 * function. 6891 */ 6892 uint16_t fid; 6893 uint8_t unused_0[6]; 6894 } __attribute__((packed)); 6895 6896 /* hwrm_func_qstats_output (size:1408b/176B) */ 6897 struct hwrm_func_qstats_output { 6898 /* The specific error status for the command. */ 6899 uint16_t error_code; 6900 /* The HWRM command request type. */ 6901 uint16_t req_type; 6902 /* The sequence ID from the original command. */ 6903 uint16_t seq_id; 6904 /* The length of the response data in number of bytes. */ 6905 uint16_t resp_len; 6906 /* Number of transmitted unicast packets on the function. */ 6907 uint64_t tx_ucast_pkts; 6908 /* Number of transmitted multicast packets on the function. */ 6909 uint64_t tx_mcast_pkts; 6910 /* Number of transmitted broadcast packets on the function. */ 6911 uint64_t tx_bcast_pkts; 6912 /* 6913 * Number of transmitted packets that were discarded due to 6914 * internal NIC resource problems. For transmit, this 6915 * can only happen if TMP is configured to allow dropping 6916 * in HOL blocking conditions, which is not a normal 6917 * configuration. 6918 */ 6919 uint64_t tx_discard_pkts; 6920 /* 6921 * Number of dropped packets on transmit path on the function. 6922 * These are packets that have been marked for drop by 6923 * the TE CFA block or are packets that exceeded the 6924 * transmit MTU limit for the function. 6925 */ 6926 uint64_t tx_drop_pkts; 6927 /* Number of transmitted bytes for unicast traffic on the function. */ 6928 uint64_t tx_ucast_bytes; 6929 /* Number of transmitted bytes for multicast traffic on the function. */ 6930 uint64_t tx_mcast_bytes; 6931 /* Number of transmitted bytes for broadcast traffic on the function. */ 6932 uint64_t tx_bcast_bytes; 6933 /* Number of received unicast packets on the function. */ 6934 uint64_t rx_ucast_pkts; 6935 /* Number of received multicast packets on the function. */ 6936 uint64_t rx_mcast_pkts; 6937 /* Number of received broadcast packets on the function. */ 6938 uint64_t rx_bcast_pkts; 6939 /* 6940 * Number of received packets that were discarded on the function 6941 * due to resource limitations. This can happen for 3 reasons. 6942 * # The BD used for the packet has a bad format. 6943 * # There were no BDs available in the ring for the packet. 6944 * # There were no BDs available on-chip for the packet. 6945 */ 6946 uint64_t rx_discard_pkts; 6947 /* 6948 * Number of dropped packets on received path on the function. 6949 * These are packets that have been marked for drop by the 6950 * RE CFA. 6951 */ 6952 uint64_t rx_drop_pkts; 6953 /* Number of received bytes for unicast traffic on the function. */ 6954 uint64_t rx_ucast_bytes; 6955 /* Number of received bytes for multicast traffic on the function. */ 6956 uint64_t rx_mcast_bytes; 6957 /* Number of received bytes for broadcast traffic on the function. */ 6958 uint64_t rx_bcast_bytes; 6959 /* Number of aggregated unicast packets on the function. */ 6960 uint64_t rx_agg_pkts; 6961 /* Number of aggregated unicast bytes on the function. */ 6962 uint64_t rx_agg_bytes; 6963 /* Number of aggregation events on the function. */ 6964 uint64_t rx_agg_events; 6965 /* Number of aborted aggregations on the function. */ 6966 uint64_t rx_agg_aborts; 6967 uint8_t unused_0[7]; 6968 /* 6969 * This field is used in Output records to indicate that the output 6970 * is completely written to RAM. This field should be read as '1' 6971 * to indicate that the output has been completely written. 6972 * When writing a command completion or response to an internal processor, 6973 * the order of writes has to be such that this field is written last. 6974 */ 6975 uint8_t valid; 6976 } __attribute__((packed)); 6977 6978 /*********************** 6979 * hwrm_func_clr_stats * 6980 ***********************/ 6981 6982 6983 /* hwrm_func_clr_stats_input (size:192b/24B) */ 6984 struct hwrm_func_clr_stats_input { 6985 /* The HWRM command request type. */ 6986 uint16_t req_type; 6987 /* 6988 * The completion ring to send the completion event on. This should 6989 * be the NQ ID returned from the `nq_alloc` HWRM command. 6990 */ 6991 uint16_t cmpl_ring; 6992 /* 6993 * The sequence ID is used by the driver for tracking multiple 6994 * commands. This ID is treated as opaque data by the firmware and 6995 * the value is returned in the `hwrm_resp_hdr` upon completion. 6996 */ 6997 uint16_t seq_id; 6998 /* 6999 * The target ID of the command: 7000 * * 0x0-0xFFF8 - The function ID 7001 * * 0xFFF8-0xFFFE - Reserved for internal processors 7002 * * 0xFFFF - HWRM 7003 */ 7004 uint16_t target_id; 7005 /* 7006 * A physical address pointer pointing to a host buffer that the 7007 * command's response data will be written. This can be either a host 7008 * physical address (HPA) or a guest physical address (GPA) and must 7009 * point to a physically contiguous block of memory. 7010 */ 7011 uint64_t resp_addr; 7012 /* 7013 * Function ID of the function. 7014 * 0xFF... (All Fs) if the query is for the requesting 7015 * function. 7016 */ 7017 uint16_t fid; 7018 uint8_t unused_0[6]; 7019 } __attribute__((packed)); 7020 7021 /* hwrm_func_clr_stats_output (size:128b/16B) */ 7022 struct hwrm_func_clr_stats_output { 7023 /* The specific error status for the command. */ 7024 uint16_t error_code; 7025 /* The HWRM command request type. */ 7026 uint16_t req_type; 7027 /* The sequence ID from the original command. */ 7028 uint16_t seq_id; 7029 /* The length of the response data in number of bytes. */ 7030 uint16_t resp_len; 7031 uint8_t unused_0[7]; 7032 /* 7033 * This field is used in Output records to indicate that the output 7034 * is completely written to RAM. This field should be read as '1' 7035 * to indicate that the output has been completely written. 7036 * When writing a command completion or response to an internal processor, 7037 * the order of writes has to be such that this field is written last. 7038 */ 7039 uint8_t valid; 7040 } __attribute__((packed)); 7041 7042 /************************** 7043 * hwrm_func_vf_resc_free * 7044 **************************/ 7045 7046 7047 /* hwrm_func_vf_resc_free_input (size:192b/24B) */ 7048 struct hwrm_func_vf_resc_free_input { 7049 /* The HWRM command request type. */ 7050 uint16_t req_type; 7051 /* 7052 * The completion ring to send the completion event on. This should 7053 * be the NQ ID returned from the `nq_alloc` HWRM command. 7054 */ 7055 uint16_t cmpl_ring; 7056 /* 7057 * The sequence ID is used by the driver for tracking multiple 7058 * commands. This ID is treated as opaque data by the firmware and 7059 * the value is returned in the `hwrm_resp_hdr` upon completion. 7060 */ 7061 uint16_t seq_id; 7062 /* 7063 * The target ID of the command: 7064 * * 0x0-0xFFF8 - The function ID 7065 * * 0xFFF8-0xFFFE - Reserved for internal processors 7066 * * 0xFFFF - HWRM 7067 */ 7068 uint16_t target_id; 7069 /* 7070 * A physical address pointer pointing to a host buffer that the 7071 * command's response data will be written. This can be either a host 7072 * physical address (HPA) or a guest physical address (GPA) and must 7073 * point to a physically contiguous block of memory. 7074 */ 7075 uint64_t resp_addr; 7076 /* 7077 * This value is used to identify a Virtual Function (VF). 7078 * The scope of VF ID is local within a PF. 7079 */ 7080 uint16_t vf_id; 7081 uint8_t unused_0[6]; 7082 } __attribute__((packed)); 7083 7084 /* hwrm_func_vf_resc_free_output (size:128b/16B) */ 7085 struct hwrm_func_vf_resc_free_output { 7086 /* The specific error status for the command. */ 7087 uint16_t error_code; 7088 /* The HWRM command request type. */ 7089 uint16_t req_type; 7090 /* The sequence ID from the original command. */ 7091 uint16_t seq_id; 7092 /* The length of the response data in number of bytes. */ 7093 uint16_t resp_len; 7094 uint8_t unused_0[7]; 7095 /* 7096 * This field is used in Output records to indicate that the output 7097 * is completely written to RAM. This field should be read as '1' 7098 * to indicate that the output has been completely written. 7099 * When writing a command completion or response to an internal processor, 7100 * the order of writes has to be such that this field is written last. 7101 */ 7102 uint8_t valid; 7103 } __attribute__((packed)); 7104 7105 /********************** 7106 * hwrm_func_drv_rgtr * 7107 **********************/ 7108 7109 7110 /* hwrm_func_drv_rgtr_input (size:896b/112B) */ 7111 struct hwrm_func_drv_rgtr_input { 7112 /* The HWRM command request type. */ 7113 uint16_t req_type; 7114 /* 7115 * The completion ring to send the completion event on. This should 7116 * be the NQ ID returned from the `nq_alloc` HWRM command. 7117 */ 7118 uint16_t cmpl_ring; 7119 /* 7120 * The sequence ID is used by the driver for tracking multiple 7121 * commands. This ID is treated as opaque data by the firmware and 7122 * the value is returned in the `hwrm_resp_hdr` upon completion. 7123 */ 7124 uint16_t seq_id; 7125 /* 7126 * The target ID of the command: 7127 * * 0x0-0xFFF8 - The function ID 7128 * * 0xFFF8-0xFFFE - Reserved for internal processors 7129 * * 0xFFFF - HWRM 7130 */ 7131 uint16_t target_id; 7132 /* 7133 * A physical address pointer pointing to a host buffer that the 7134 * command's response data will be written. This can be either a host 7135 * physical address (HPA) or a guest physical address (GPA) and must 7136 * point to a physically contiguous block of memory. 7137 */ 7138 uint64_t resp_addr; 7139 uint32_t flags; 7140 /* 7141 * When this bit is '1', the function driver is requesting 7142 * all requests from its children VF drivers to be 7143 * forwarded to itself. 7144 * This flag can only be set by the PF driver. 7145 * If a VF driver sets this flag, it should be ignored 7146 * by the HWRM. 7147 */ 7148 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE \ 7149 UINT32_C(0x1) 7150 /* 7151 * When this bit is '1', the function is requesting none of 7152 * the requests from its children VF drivers to be 7153 * forwarded to itself. 7154 * This flag can only be set by the PF driver. 7155 * If a VF driver sets this flag, it should be ignored 7156 * by the HWRM. 7157 */ 7158 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE \ 7159 UINT32_C(0x2) 7160 /* 7161 * When this bit is '1', then ver_maj_8b, ver_min_8b, ver_upd_8b 7162 * fields shall be ignored and ver_maj, ver_min, ver_upd 7163 * and ver_patch shall be used for the driver version information. 7164 * When this bit is '0', then ver_maj_8b, ver_min_8b, ver_upd_8b 7165 * fields shall be used for the driver version information and 7166 * ver_maj, ver_min, ver_upd and ver_patch shall be ignored. 7167 */ 7168 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_16BIT_VER_MODE \ 7169 UINT32_C(0x4) 7170 /* 7171 * When this bit is '1', the function is indicating support of 7172 * 64bit flow handle. The firmware that only supports 64bit flow 7173 * handle should check this bit before allowing processing of 7174 * HWRM_CFA_FLOW_XXX commands from the requesting function as firmware 7175 * with 64bit flow handle support can only be compatible with drivers 7176 * that support 64bit flow handle. The legacy drivers that don't support 7177 * 64bit flow handle won't be able to use HWRM_CFA_FLOW_XXX commands when 7178 * running with new firmware that only supports 64bit flow handle. The new 7179 * firmware support 64bit flow handle returns HWRM_ERR_CODE_CMD_NOT_SUPPORTED 7180 * status to the legacy driver when encounters these commands. 7181 */ 7182 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FLOW_HANDLE_64BIT_MODE \ 7183 UINT32_C(0x8) 7184 uint32_t enables; 7185 /* 7186 * This bit must be '1' for the os_type field to be 7187 * configured. 7188 */ 7189 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE \ 7190 UINT32_C(0x1) 7191 /* 7192 * This bit must be '1' for the ver field to be 7193 * configured. 7194 */ 7195 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER \ 7196 UINT32_C(0x2) 7197 /* 7198 * This bit must be '1' for the timestamp field to be 7199 * configured. 7200 */ 7201 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP \ 7202 UINT32_C(0x4) 7203 /* 7204 * This bit must be '1' for the vf_req_fwd field to be 7205 * configured. 7206 */ 7207 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD \ 7208 UINT32_C(0x8) 7209 /* 7210 * This bit must be '1' for the async_event_fwd field to be 7211 * configured. 7212 */ 7213 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \ 7214 UINT32_C(0x10) 7215 /* This value indicates the type of OS. The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */ 7216 uint16_t os_type; 7217 /* Unknown */ 7218 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN UINT32_C(0x0) 7219 /* Other OS not listed below. */ 7220 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER UINT32_C(0x1) 7221 /* MSDOS OS. */ 7222 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS UINT32_C(0xe) 7223 /* Windows OS. */ 7224 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS UINT32_C(0x12) 7225 /* Solaris OS. */ 7226 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS UINT32_C(0x1d) 7227 /* Linux OS. */ 7228 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX UINT32_C(0x24) 7229 /* FreeBSD OS. */ 7230 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD UINT32_C(0x2a) 7231 /* VMware ESXi OS. */ 7232 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI UINT32_C(0x68) 7233 /* Microsoft Windows 8 64-bit OS. */ 7234 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864 UINT32_C(0x73) 7235 /* Microsoft Windows Server 2012 R2 OS. */ 7236 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74) 7237 /* UEFI driver. */ 7238 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI UINT32_C(0x8000) 7239 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LAST \ 7240 HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI 7241 /* This is the 8bit major version of the driver. */ 7242 uint8_t ver_maj_8b; 7243 /* This is the 8bit minor version of the driver. */ 7244 uint8_t ver_min_8b; 7245 /* This is the 8bit update version of the driver. */ 7246 uint8_t ver_upd_8b; 7247 uint8_t unused_0[3]; 7248 /* 7249 * This is a 32-bit timestamp provided by the driver for 7250 * keep alive. 7251 * The timestamp is in multiples of 1ms. 7252 */ 7253 uint32_t timestamp; 7254 uint8_t unused_1[4]; 7255 /* 7256 * This is a 256-bit bit mask provided by the PF driver for 7257 * letting the HWRM know what commands issued by the VF driver 7258 * to the HWRM should be forwarded to the PF driver. 7259 * Nth bit refers to the Nth req_type. 7260 * 7261 * Setting Nth bit to 1 indicates that requests from the 7262 * VF driver with req_type equal to N shall be forwarded to 7263 * the parent PF driver. 7264 * 7265 * This field is not valid for the VF driver. 7266 */ 7267 uint32_t vf_req_fwd[8]; 7268 /* 7269 * This is a 256-bit bit mask provided by the function driver 7270 * (PF or VF driver) to indicate the list of asynchronous event 7271 * completions to be forwarded. 7272 * 7273 * Nth bit refers to the Nth event_id. 7274 * 7275 * Setting Nth bit to 1 by the function driver shall result in 7276 * the HWRM forwarding asynchronous event completion with 7277 * event_id equal to N. 7278 * 7279 * If all bits are set to 0 (value of 0), then the HWRM shall 7280 * not forward any asynchronous event completion to this 7281 * function driver. 7282 */ 7283 uint32_t async_event_fwd[8]; 7284 /* This is the 16bit major version of the driver. */ 7285 uint16_t ver_maj; 7286 /* This is the 16bit minor version of the driver. */ 7287 uint16_t ver_min; 7288 /* This is the 16bit update version of the driver. */ 7289 uint16_t ver_upd; 7290 /* This is the 16bit patch version of the driver. */ 7291 uint16_t ver_patch; 7292 } __attribute__((packed)); 7293 7294 /* hwrm_func_drv_rgtr_output (size:128b/16B) */ 7295 struct hwrm_func_drv_rgtr_output { 7296 /* The specific error status for the command. */ 7297 uint16_t error_code; 7298 /* The HWRM command request type. */ 7299 uint16_t req_type; 7300 /* The sequence ID from the original command. */ 7301 uint16_t seq_id; 7302 /* The length of the response data in number of bytes. */ 7303 uint16_t resp_len; 7304 uint32_t flags; 7305 /* 7306 * When this bit is '1', it indicates that the 7307 * HWRM_FUNC_DRV_IF_CHANGE call is supported. 7308 */ 7309 #define HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED \ 7310 UINT32_C(0x1) 7311 uint8_t unused_0[3]; 7312 /* 7313 * This field is used in Output records to indicate that the output 7314 * is completely written to RAM. This field should be read as '1' 7315 * to indicate that the output has been completely written. 7316 * When writing a command completion or response to an internal processor, 7317 * the order of writes has to be such that this field is written last. 7318 */ 7319 uint8_t valid; 7320 } __attribute__((packed)); 7321 7322 /************************ 7323 * hwrm_func_drv_unrgtr * 7324 ************************/ 7325 7326 7327 /* hwrm_func_drv_unrgtr_input (size:192b/24B) */ 7328 struct hwrm_func_drv_unrgtr_input { 7329 /* The HWRM command request type. */ 7330 uint16_t req_type; 7331 /* 7332 * The completion ring to send the completion event on. This should 7333 * be the NQ ID returned from the `nq_alloc` HWRM command. 7334 */ 7335 uint16_t cmpl_ring; 7336 /* 7337 * The sequence ID is used by the driver for tracking multiple 7338 * commands. This ID is treated as opaque data by the firmware and 7339 * the value is returned in the `hwrm_resp_hdr` upon completion. 7340 */ 7341 uint16_t seq_id; 7342 /* 7343 * The target ID of the command: 7344 * * 0x0-0xFFF8 - The function ID 7345 * * 0xFFF8-0xFFFE - Reserved for internal processors 7346 * * 0xFFFF - HWRM 7347 */ 7348 uint16_t target_id; 7349 /* 7350 * A physical address pointer pointing to a host buffer that the 7351 * command's response data will be written. This can be either a host 7352 * physical address (HPA) or a guest physical address (GPA) and must 7353 * point to a physically contiguous block of memory. 7354 */ 7355 uint64_t resp_addr; 7356 uint32_t flags; 7357 /* 7358 * When this bit is '1', the function driver is notifying 7359 * the HWRM to prepare for the shutdown. 7360 */ 7361 #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \ 7362 UINT32_C(0x1) 7363 uint8_t unused_0[4]; 7364 } __attribute__((packed)); 7365 7366 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */ 7367 struct hwrm_func_drv_unrgtr_output { 7368 /* The specific error status for the command. */ 7369 uint16_t error_code; 7370 /* The HWRM command request type. */ 7371 uint16_t req_type; 7372 /* The sequence ID from the original command. */ 7373 uint16_t seq_id; 7374 /* The length of the response data in number of bytes. */ 7375 uint16_t resp_len; 7376 uint8_t unused_0[7]; 7377 /* 7378 * This field is used in Output records to indicate that the output 7379 * is completely written to RAM. This field should be read as '1' 7380 * to indicate that the output has been completely written. 7381 * When writing a command completion or response to an internal processor, 7382 * the order of writes has to be such that this field is written last. 7383 */ 7384 uint8_t valid; 7385 } __attribute__((packed)); 7386 7387 /********************** 7388 * hwrm_func_buf_rgtr * 7389 **********************/ 7390 7391 7392 /* hwrm_func_buf_rgtr_input (size:1024b/128B) */ 7393 struct hwrm_func_buf_rgtr_input { 7394 /* The HWRM command request type. */ 7395 uint16_t req_type; 7396 /* 7397 * The completion ring to send the completion event on. This should 7398 * be the NQ ID returned from the `nq_alloc` HWRM command. 7399 */ 7400 uint16_t cmpl_ring; 7401 /* 7402 * The sequence ID is used by the driver for tracking multiple 7403 * commands. This ID is treated as opaque data by the firmware and 7404 * the value is returned in the `hwrm_resp_hdr` upon completion. 7405 */ 7406 uint16_t seq_id; 7407 /* 7408 * The target ID of the command: 7409 * * 0x0-0xFFF8 - The function ID 7410 * * 0xFFF8-0xFFFE - Reserved for internal processors 7411 * * 0xFFFF - HWRM 7412 */ 7413 uint16_t target_id; 7414 /* 7415 * A physical address pointer pointing to a host buffer that the 7416 * command's response data will be written. This can be either a host 7417 * physical address (HPA) or a guest physical address (GPA) and must 7418 * point to a physically contiguous block of memory. 7419 */ 7420 uint64_t resp_addr; 7421 uint32_t enables; 7422 /* 7423 * This bit must be '1' for the vf_id field to be 7424 * configured. 7425 */ 7426 #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID UINT32_C(0x1) 7427 /* 7428 * This bit must be '1' for the err_buf_addr field to be 7429 * configured. 7430 */ 7431 #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR UINT32_C(0x2) 7432 /* 7433 * This value is used to identify a Virtual Function (VF). 7434 * The scope of VF ID is local within a PF. 7435 */ 7436 uint16_t vf_id; 7437 /* 7438 * This field represents the number of pages used for request 7439 * buffer(s). 7440 */ 7441 uint16_t req_buf_num_pages; 7442 /* 7443 * This field represents the page size used for request 7444 * buffer(s). 7445 */ 7446 uint16_t req_buf_page_size; 7447 /* 16 bytes */ 7448 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B UINT32_C(0x4) 7449 /* 4 Kbytes */ 7450 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K UINT32_C(0xc) 7451 /* 8 Kbytes */ 7452 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K UINT32_C(0xd) 7453 /* 64 Kbytes */ 7454 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K UINT32_C(0x10) 7455 /* 2 Mbytes */ 7456 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M UINT32_C(0x15) 7457 /* 4 Mbytes */ 7458 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M UINT32_C(0x16) 7459 /* 1 Gbytes */ 7460 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G UINT32_C(0x1e) 7461 #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_LAST \ 7462 HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G 7463 /* The length of the request buffer per VF in bytes. */ 7464 uint16_t req_buf_len; 7465 /* The length of the response buffer in bytes. */ 7466 uint16_t resp_buf_len; 7467 uint8_t unused_0[2]; 7468 /* This field represents the page address of page #0. */ 7469 uint64_t req_buf_page_addr0; 7470 /* This field represents the page address of page #1. */ 7471 uint64_t req_buf_page_addr1; 7472 /* This field represents the page address of page #2. */ 7473 uint64_t req_buf_page_addr2; 7474 /* This field represents the page address of page #3. */ 7475 uint64_t req_buf_page_addr3; 7476 /* This field represents the page address of page #4. */ 7477 uint64_t req_buf_page_addr4; 7478 /* This field represents the page address of page #5. */ 7479 uint64_t req_buf_page_addr5; 7480 /* This field represents the page address of page #6. */ 7481 uint64_t req_buf_page_addr6; 7482 /* This field represents the page address of page #7. */ 7483 uint64_t req_buf_page_addr7; 7484 /* This field represents the page address of page #8. */ 7485 uint64_t req_buf_page_addr8; 7486 /* This field represents the page address of page #9. */ 7487 uint64_t req_buf_page_addr9; 7488 /* 7489 * This field is used to receive the error reporting from 7490 * the chipset. Only applicable for PFs. 7491 */ 7492 uint64_t error_buf_addr; 7493 /* 7494 * This field is used to receive the response forwarded by the 7495 * HWRM. 7496 */ 7497 uint64_t resp_buf_addr; 7498 } __attribute__((packed)); 7499 7500 /* hwrm_func_buf_rgtr_output (size:128b/16B) */ 7501 struct hwrm_func_buf_rgtr_output { 7502 /* The specific error status for the command. */ 7503 uint16_t error_code; 7504 /* The HWRM command request type. */ 7505 uint16_t req_type; 7506 /* The sequence ID from the original command. */ 7507 uint16_t seq_id; 7508 /* The length of the response data in number of bytes. */ 7509 uint16_t resp_len; 7510 uint8_t unused_0[7]; 7511 /* 7512 * This field is used in Output records to indicate that the output 7513 * is completely written to RAM. This field should be read as '1' 7514 * to indicate that the output has been completely written. 7515 * When writing a command completion or response to an internal processor, 7516 * the order of writes has to be such that this field is written last. 7517 */ 7518 uint8_t valid; 7519 } __attribute__((packed)); 7520 7521 /************************ 7522 * hwrm_func_buf_unrgtr * 7523 ************************/ 7524 7525 7526 /* hwrm_func_buf_unrgtr_input (size:192b/24B) */ 7527 struct hwrm_func_buf_unrgtr_input { 7528 /* The HWRM command request type. */ 7529 uint16_t req_type; 7530 /* 7531 * The completion ring to send the completion event on. This should 7532 * be the NQ ID returned from the `nq_alloc` HWRM command. 7533 */ 7534 uint16_t cmpl_ring; 7535 /* 7536 * The sequence ID is used by the driver for tracking multiple 7537 * commands. This ID is treated as opaque data by the firmware and 7538 * the value is returned in the `hwrm_resp_hdr` upon completion. 7539 */ 7540 uint16_t seq_id; 7541 /* 7542 * The target ID of the command: 7543 * * 0x0-0xFFF8 - The function ID 7544 * * 0xFFF8-0xFFFE - Reserved for internal processors 7545 * * 0xFFFF - HWRM 7546 */ 7547 uint16_t target_id; 7548 /* 7549 * A physical address pointer pointing to a host buffer that the 7550 * command's response data will be written. This can be either a host 7551 * physical address (HPA) or a guest physical address (GPA) and must 7552 * point to a physically contiguous block of memory. 7553 */ 7554 uint64_t resp_addr; 7555 uint32_t enables; 7556 /* 7557 * This bit must be '1' for the vf_id field to be 7558 * configured. 7559 */ 7560 #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID UINT32_C(0x1) 7561 /* 7562 * This value is used to identify a Virtual Function (VF). 7563 * The scope of VF ID is local within a PF. 7564 */ 7565 uint16_t vf_id; 7566 uint8_t unused_0[2]; 7567 } __attribute__((packed)); 7568 7569 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */ 7570 struct hwrm_func_buf_unrgtr_output { 7571 /* The specific error status for the command. */ 7572 uint16_t error_code; 7573 /* The HWRM command request type. */ 7574 uint16_t req_type; 7575 /* The sequence ID from the original command. */ 7576 uint16_t seq_id; 7577 /* The length of the response data in number of bytes. */ 7578 uint16_t resp_len; 7579 uint8_t unused_0[7]; 7580 /* 7581 * This field is used in Output records to indicate that the output 7582 * is completely written to RAM. This field should be read as '1' 7583 * to indicate that the output has been completely written. 7584 * When writing a command completion or response to an internal processor, 7585 * the order of writes has to be such that this field is written last. 7586 */ 7587 uint8_t valid; 7588 } __attribute__((packed)); 7589 7590 /********************** 7591 * hwrm_func_drv_qver * 7592 **********************/ 7593 7594 7595 /* hwrm_func_drv_qver_input (size:192b/24B) */ 7596 struct hwrm_func_drv_qver_input { 7597 /* The HWRM command request type. */ 7598 uint16_t req_type; 7599 /* 7600 * The completion ring to send the completion event on. This should 7601 * be the NQ ID returned from the `nq_alloc` HWRM command. 7602 */ 7603 uint16_t cmpl_ring; 7604 /* 7605 * The sequence ID is used by the driver for tracking multiple 7606 * commands. This ID is treated as opaque data by the firmware and 7607 * the value is returned in the `hwrm_resp_hdr` upon completion. 7608 */ 7609 uint16_t seq_id; 7610 /* 7611 * The target ID of the command: 7612 * * 0x0-0xFFF8 - The function ID 7613 * * 0xFFF8-0xFFFE - Reserved for internal processors 7614 * * 0xFFFF - HWRM 7615 */ 7616 uint16_t target_id; 7617 /* 7618 * A physical address pointer pointing to a host buffer that the 7619 * command's response data will be written. This can be either a host 7620 * physical address (HPA) or a guest physical address (GPA) and must 7621 * point to a physically contiguous block of memory. 7622 */ 7623 uint64_t resp_addr; 7624 /* Reserved for future use. */ 7625 uint32_t reserved; 7626 /* 7627 * Function ID of the function that is being queried. 7628 * 0xFF... (All Fs) if the query is for the requesting 7629 * function. 7630 */ 7631 uint16_t fid; 7632 uint8_t unused_0[2]; 7633 } __attribute__((packed)); 7634 7635 /* hwrm_func_drv_qver_output (size:256b/32B) */ 7636 struct hwrm_func_drv_qver_output { 7637 /* The specific error status for the command. */ 7638 uint16_t error_code; 7639 /* The HWRM command request type. */ 7640 uint16_t req_type; 7641 /* The sequence ID from the original command. */ 7642 uint16_t seq_id; 7643 /* The length of the response data in number of bytes. */ 7644 uint16_t resp_len; 7645 /* This value indicates the type of OS. The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */ 7646 uint16_t os_type; 7647 /* Unknown */ 7648 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN UINT32_C(0x0) 7649 /* Other OS not listed below. */ 7650 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER UINT32_C(0x1) 7651 /* MSDOS OS. */ 7652 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS UINT32_C(0xe) 7653 /* Windows OS. */ 7654 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS UINT32_C(0x12) 7655 /* Solaris OS. */ 7656 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS UINT32_C(0x1d) 7657 /* Linux OS. */ 7658 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX UINT32_C(0x24) 7659 /* FreeBSD OS. */ 7660 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD UINT32_C(0x2a) 7661 /* VMware ESXi OS. */ 7662 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI UINT32_C(0x68) 7663 /* Microsoft Windows 8 64-bit OS. */ 7664 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864 UINT32_C(0x73) 7665 /* Microsoft Windows Server 2012 R2 OS. */ 7666 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74) 7667 /* UEFI driver. */ 7668 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI UINT32_C(0x8000) 7669 #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LAST \ 7670 HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI 7671 /* This is the 8bit major version of the driver. */ 7672 uint8_t ver_maj_8b; 7673 /* This is the 8bit minor version of the driver. */ 7674 uint8_t ver_min_8b; 7675 /* This is the 8bit update version of the driver. */ 7676 uint8_t ver_upd_8b; 7677 uint8_t unused_0[3]; 7678 /* This is the 16bit major version of the driver. */ 7679 uint16_t ver_maj; 7680 /* This is the 16bit minor version of the driver. */ 7681 uint16_t ver_min; 7682 /* This is the 16bit update version of the driver. */ 7683 uint16_t ver_upd; 7684 /* This is the 16bit patch version of the driver. */ 7685 uint16_t ver_patch; 7686 uint8_t unused_1[7]; 7687 /* 7688 * This field is used in Output records to indicate that the output 7689 * is completely written to RAM. This field should be read as '1' 7690 * to indicate that the output has been completely written. 7691 * When writing a command completion or response to an internal processor, 7692 * the order of writes has to be such that this field is written last. 7693 */ 7694 uint8_t valid; 7695 } __attribute__((packed)); 7696 7697 /**************************** 7698 * hwrm_func_resource_qcaps * 7699 ****************************/ 7700 7701 7702 /* hwrm_func_resource_qcaps_input (size:192b/24B) */ 7703 struct hwrm_func_resource_qcaps_input { 7704 /* The HWRM command request type. */ 7705 uint16_t req_type; 7706 /* 7707 * The completion ring to send the completion event on. This should 7708 * be the NQ ID returned from the `nq_alloc` HWRM command. 7709 */ 7710 uint16_t cmpl_ring; 7711 /* 7712 * The sequence ID is used by the driver for tracking multiple 7713 * commands. This ID is treated as opaque data by the firmware and 7714 * the value is returned in the `hwrm_resp_hdr` upon completion. 7715 */ 7716 uint16_t seq_id; 7717 /* 7718 * The target ID of the command: 7719 * * 0x0-0xFFF8 - The function ID 7720 * * 0xFFF8-0xFFFE - Reserved for internal processors 7721 * * 0xFFFF - HWRM 7722 */ 7723 uint16_t target_id; 7724 /* 7725 * A physical address pointer pointing to a host buffer that the 7726 * command's response data will be written. This can be either a host 7727 * physical address (HPA) or a guest physical address (GPA) and must 7728 * point to a physically contiguous block of memory. 7729 */ 7730 uint64_t resp_addr; 7731 /* 7732 * Function ID of the function that is being queried. 7733 * 0xFF... (All Fs) if the query is for the requesting 7734 * function. 7735 */ 7736 uint16_t fid; 7737 uint8_t unused_0[6]; 7738 } __attribute__((packed)); 7739 7740 /* hwrm_func_resource_qcaps_output (size:448b/56B) */ 7741 struct hwrm_func_resource_qcaps_output { 7742 /* The specific error status for the command. */ 7743 uint16_t error_code; 7744 /* The HWRM command request type. */ 7745 uint16_t req_type; 7746 /* The sequence ID from the original command. */ 7747 uint16_t seq_id; 7748 /* The length of the response data in number of bytes. */ 7749 uint16_t resp_len; 7750 /* Maximum guaranteed number of VFs supported by PF. Not applicable for VFs. */ 7751 uint16_t max_vfs; 7752 /* Maximum guaranteed number of MSI-X vectors supported by function */ 7753 uint16_t max_msix; 7754 /* Hint of strategy to be used by PF driver to reserve resources for its VF */ 7755 uint16_t vf_reservation_strategy; 7756 /* The PF driver should evenly divide its remaining resources among all VFs. */ 7757 #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL \ 7758 UINT32_C(0x0) 7759 /* The PF driver should only reserve minimal resources for each VF. */ 7760 #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL \ 7761 UINT32_C(0x1) 7762 /* 7763 * The PF driver should not reserve any resources for each VF until the 7764 * the VF interface is brought up. 7765 */ 7766 #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC \ 7767 UINT32_C(0x2) 7768 #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_LAST \ 7769 HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC 7770 /* Minimum guaranteed number of RSS/COS contexts */ 7771 uint16_t min_rsscos_ctx; 7772 /* Maximum non-guaranteed number of RSS/COS contexts */ 7773 uint16_t max_rsscos_ctx; 7774 /* Minimum guaranteed number of completion rings */ 7775 uint16_t min_cmpl_rings; 7776 /* Maximum non-guaranteed number of completion rings */ 7777 uint16_t max_cmpl_rings; 7778 /* Minimum guaranteed number of transmit rings */ 7779 uint16_t min_tx_rings; 7780 /* Maximum non-guaranteed number of transmit rings */ 7781 uint16_t max_tx_rings; 7782 /* Minimum guaranteed number of receive rings */ 7783 uint16_t min_rx_rings; 7784 /* Maximum non-guaranteed number of receive rings */ 7785 uint16_t max_rx_rings; 7786 /* Minimum guaranteed number of L2 contexts */ 7787 uint16_t min_l2_ctxs; 7788 /* Maximum non-guaranteed number of L2 contexts */ 7789 uint16_t max_l2_ctxs; 7790 /* Minimum guaranteed number of VNICs */ 7791 uint16_t min_vnics; 7792 /* Maximum non-guaranteed number of VNICs */ 7793 uint16_t max_vnics; 7794 /* Minimum guaranteed number of statistic contexts */ 7795 uint16_t min_stat_ctx; 7796 /* Maximum non-guaranteed number of statistic contexts */ 7797 uint16_t max_stat_ctx; 7798 /* Minimum guaranteed number of ring groups */ 7799 uint16_t min_hw_ring_grps; 7800 /* Maximum non-guaranteed number of ring groups */ 7801 uint16_t max_hw_ring_grps; 7802 /* 7803 * Maximum number of inputs into the transmit scheduler for this function. 7804 * The number of TX rings assigned to the function cannot exceed this value. 7805 */ 7806 uint16_t max_tx_scheduler_inputs; 7807 uint16_t flags; 7808 /* 7809 * When this bit is '1', it indicates that VF_RESOURCE_CFG supports 7810 * feature to reserve all minimum resources when minimum >= 1, otherwise 7811 * returns an error. 7812 */ 7813 #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_FLAGS_MIN_GUARANTEED \ 7814 UINT32_C(0x1) 7815 uint8_t unused_0[5]; 7816 /* 7817 * This field is used in Output records to indicate that the output 7818 * is completely written to RAM. This field should be read as '1' 7819 * to indicate that the output has been completely written. 7820 * When writing a command completion or response to an internal processor, 7821 * the order of writes has to be such that this field is written last. 7822 */ 7823 uint8_t valid; 7824 } __attribute__((packed)); 7825 7826 /********************************* 7827 * hwrm_func_backing_store_qcaps * 7828 *********************************/ 7829 7830 7831 /* hwrm_func_backing_store_qcaps_input (size:128b/16B) */ 7832 struct hwrm_func_backing_store_qcaps_input { 7833 /* The HWRM command request type. */ 7834 uint16_t req_type; 7835 /* 7836 * The completion ring to send the completion event on. This should 7837 * be the NQ ID returned from the `nq_alloc` HWRM command. 7838 */ 7839 uint16_t cmpl_ring; 7840 /* 7841 * The sequence ID is used by the driver for tracking multiple 7842 * commands. This ID is treated as opaque data by the firmware and 7843 * the value is returned in the `hwrm_resp_hdr` upon completion. 7844 */ 7845 uint16_t seq_id; 7846 /* 7847 * The target ID of the command: 7848 * * 0x0-0xFFF8 - The function ID 7849 * * 0xFFF8-0xFFFE - Reserved for internal processors 7850 * * 0xFFFF - HWRM 7851 */ 7852 uint16_t target_id; 7853 /* 7854 * A physical address pointer pointing to a host buffer that the 7855 * command's response data will be written. This can be either a host 7856 * physical address (HPA) or a guest physical address (GPA) and must 7857 * point to a physically contiguous block of memory. 7858 */ 7859 uint64_t resp_addr; 7860 } __attribute__((packed)); 7861 7862 /* hwrm_func_backing_store_qcaps_output (size:576b/72B) */ 7863 struct hwrm_func_backing_store_qcaps_output { 7864 /* The specific error status for the command. */ 7865 uint16_t error_code; 7866 /* The HWRM command request type. */ 7867 uint16_t req_type; 7868 /* The sequence ID from the original command. */ 7869 uint16_t seq_id; 7870 /* The length of the response data in number of bytes. */ 7871 uint16_t resp_len; 7872 /* Maximum number of QP context entries supported for this function. */ 7873 uint32_t qp_max_entries; 7874 /* 7875 * Minimum number of QP context entries that are needed to be reserved 7876 * for QP1 for the PF and its VFs. PF drivers must allocate at least 7877 * this many QP context entries, even if RoCE will not be used. 7878 */ 7879 uint16_t qp_min_qp1_entries; 7880 /* Maximum number of QP context entries that can be used for L2. */ 7881 uint16_t qp_max_l2_entries; 7882 /* Number of bytes that must be allocated for each context entry. */ 7883 uint16_t qp_entry_size; 7884 /* Maximum number of SRQ context entries that can be used for L2. */ 7885 uint16_t srq_max_l2_entries; 7886 /* Maximum number of SRQ context entries supported for this function. */ 7887 uint32_t srq_max_entries; 7888 /* Number of bytes that must be allocated for each context entry. */ 7889 uint16_t srq_entry_size; 7890 /* Maximum number of CQ context entries that can be used for L2. */ 7891 uint16_t cq_max_l2_entries; 7892 /* Maximum number of CQ context entries supported for this function. */ 7893 uint32_t cq_max_entries; 7894 /* Number of bytes that must be allocated for each context entry. */ 7895 uint16_t cq_entry_size; 7896 /* Maximum number of VNIC context entries supported for this function. */ 7897 uint16_t vnic_max_vnic_entries; 7898 /* Maximum number of Ring table context entries supported for this function. */ 7899 uint16_t vnic_max_ring_table_entries; 7900 /* Number of bytes that must be allocated for each context entry. */ 7901 uint16_t vnic_entry_size; 7902 /* Maximum number of statistic context entries supported for this function. */ 7903 uint32_t stat_max_entries; 7904 /* Number of bytes that must be allocated for each context entry. */ 7905 uint16_t stat_entry_size; 7906 /* Number of bytes that must be allocated for each context entry. */ 7907 uint16_t tqm_entry_size; 7908 /* Minimum number of TQM context entries required per ring. */ 7909 uint32_t tqm_min_entries_per_ring; 7910 /* 7911 * Maximum number of TQM context entries supported per ring. This is 7912 * actually a recommended TQM queue size based on worst case usage of 7913 * the TQM queue. 7914 * 7915 * TQM fastpath rings should be sized large enough to accommodate the 7916 * maximum number of QPs (either L2 or RoCE, or both if shared) 7917 * that can be enqueued to the TQM ring. 7918 * 7919 * TQM slowpath rings should be sized as follows: 7920 * 7921 * num_entries = num_vnics + num_l2_tx_rings + num_roce_qps + tqm_min_size 7922 * 7923 * Where: 7924 * num_vnics is the number of VNICs allocated in the VNIC backing store 7925 * num_l2_tx_rings is the number of L2 rings in the QP backing store 7926 * num_roce_qps is the number of RoCE QPs in the QP backing store 7927 * tqm_min_size is tqm_min_entries_per_ring reported by 7928 * HWRM_FUNC_BACKING_STORE_QCAPS 7929 * 7930 * Note that TQM ring sizes cannot be extended while the system is 7931 * operational. If a PF driver needs to extend a TQM ring, it needs 7932 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate 7933 * the backing store. 7934 */ 7935 uint32_t tqm_max_entries_per_ring; 7936 /* Maximum number of MR/AV context entries supported for this function. */ 7937 uint32_t mrav_max_entries; 7938 /* Number of bytes that must be allocated for each context entry. */ 7939 uint16_t mrav_entry_size; 7940 /* Number of bytes that must be allocated for each context entry. */ 7941 uint16_t tim_entry_size; 7942 /* Maximum number of Timer context entries supported for this function. */ 7943 uint32_t tim_max_entries; 7944 uint8_t unused_0[2]; 7945 /* 7946 * The number of entries specified for any TQM ring must be a 7947 * multiple of this value to prevent any resource allocation 7948 * limitations. 7949 */ 7950 uint8_t tqm_entries_multiple; 7951 /* 7952 * This field is used in Output records to indicate that the output 7953 * is completely written to RAM. This field should be read as '1' 7954 * to indicate that the output has been completely written. 7955 * When writing a command completion or response to an internal processor, 7956 * the order of writes has to be such that this field is written last. 7957 */ 7958 uint8_t valid; 7959 } __attribute__((packed)); 7960 7961 /******************************* 7962 * hwrm_func_backing_store_cfg * 7963 *******************************/ 7964 7965 7966 /* hwrm_func_backing_store_cfg_input (size:2048b/256B) */ 7967 struct hwrm_func_backing_store_cfg_input { 7968 /* The HWRM command request type. */ 7969 uint16_t req_type; 7970 /* 7971 * The completion ring to send the completion event on. This should 7972 * be the NQ ID returned from the `nq_alloc` HWRM command. 7973 */ 7974 uint16_t cmpl_ring; 7975 /* 7976 * The sequence ID is used by the driver for tracking multiple 7977 * commands. This ID is treated as opaque data by the firmware and 7978 * the value is returned in the `hwrm_resp_hdr` upon completion. 7979 */ 7980 uint16_t seq_id; 7981 /* 7982 * The target ID of the command: 7983 * * 0x0-0xFFF8 - The function ID 7984 * * 0xFFF8-0xFFFE - Reserved for internal processors 7985 * * 0xFFFF - HWRM 7986 */ 7987 uint16_t target_id; 7988 /* 7989 * A physical address pointer pointing to a host buffer that the 7990 * command's response data will be written. This can be either a host 7991 * physical address (HPA) or a guest physical address (GPA) and must 7992 * point to a physically contiguous block of memory. 7993 */ 7994 uint64_t resp_addr; 7995 uint32_t flags; 7996 /* 7997 * When set, the firmware only uses on-chip resources and does not 7998 * expect any backing store to be provided by the host driver. This 7999 * mode provides minimal L2 functionality (e.g. limited L2 resources, 8000 * no RoCE). 8001 */ 8002 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_PREBOOT_MODE \ 8003 UINT32_C(0x1) 8004 uint32_t enables; 8005 /* 8006 * This bit must be '1' for the qp fields to be 8007 * configured. 8008 */ 8009 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP \ 8010 UINT32_C(0x1) 8011 /* 8012 * This bit must be '1' for the srq fields to be 8013 * configured. 8014 */ 8015 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ \ 8016 UINT32_C(0x2) 8017 /* 8018 * This bit must be '1' for the cq fields to be 8019 * configured. 8020 */ 8021 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ \ 8022 UINT32_C(0x4) 8023 /* 8024 * This bit must be '1' for the vnic fields to be 8025 * configured. 8026 */ 8027 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC \ 8028 UINT32_C(0x8) 8029 /* 8030 * This bit must be '1' for the stat fields to be 8031 * configured. 8032 */ 8033 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT \ 8034 UINT32_C(0x10) 8035 /* 8036 * This bit must be '1' for the tqm_sp fields to be 8037 * configured. 8038 */ 8039 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP \ 8040 UINT32_C(0x20) 8041 /* 8042 * This bit must be '1' for the tqm_ring0 fields to be 8043 * configured. 8044 */ 8045 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING0 \ 8046 UINT32_C(0x40) 8047 /* 8048 * This bit must be '1' for the tqm_ring1 fields to be 8049 * configured. 8050 */ 8051 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING1 \ 8052 UINT32_C(0x80) 8053 /* 8054 * This bit must be '1' for the tqm_ring2 fields to be 8055 * configured. 8056 */ 8057 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING2 \ 8058 UINT32_C(0x100) 8059 /* 8060 * This bit must be '1' for the tqm_ring3 fields to be 8061 * configured. 8062 */ 8063 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING3 \ 8064 UINT32_C(0x200) 8065 /* 8066 * This bit must be '1' for the tqm_ring4 fields to be 8067 * configured. 8068 */ 8069 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING4 \ 8070 UINT32_C(0x400) 8071 /* 8072 * This bit must be '1' for the tqm_ring5 fields to be 8073 * configured. 8074 */ 8075 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING5 \ 8076 UINT32_C(0x800) 8077 /* 8078 * This bit must be '1' for the tqm_ring6 fields to be 8079 * configured. 8080 */ 8081 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING6 \ 8082 UINT32_C(0x1000) 8083 /* 8084 * This bit must be '1' for the tqm_ring7 fields to be 8085 * configured. 8086 */ 8087 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING7 \ 8088 UINT32_C(0x2000) 8089 /* 8090 * This bit must be '1' for the mrav fields to be 8091 * configured. 8092 */ 8093 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV \ 8094 UINT32_C(0x4000) 8095 /* 8096 * This bit must be '1' for the tim fields to be 8097 * configured. 8098 */ 8099 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM \ 8100 UINT32_C(0x8000) 8101 /* QPC page size and level. */ 8102 uint8_t qpc_pg_size_qpc_lvl; 8103 /* QPC PBL indirect levels. */ 8104 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_MASK \ 8105 UINT32_C(0xf) 8106 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_SFT 0 8107 /* PBL pointer is physical start address. */ 8108 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_0 \ 8109 UINT32_C(0x0) 8110 /* PBL pointer points to PTE table. */ 8111 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1 \ 8112 UINT32_C(0x1) 8113 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8114 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2 \ 8115 UINT32_C(0x2) 8116 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LAST \ 8117 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2 8118 /* QPC page size. */ 8119 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_MASK \ 8120 UINT32_C(0xf0) 8121 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_SFT 4 8122 /* 4KB. */ 8123 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_4K \ 8124 (UINT32_C(0x0) << 4) 8125 /* 8KB. */ 8126 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8K \ 8127 (UINT32_C(0x1) << 4) 8128 /* 64KB. */ 8129 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_64K \ 8130 (UINT32_C(0x2) << 4) 8131 /* 2MB. */ 8132 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_2M \ 8133 (UINT32_C(0x3) << 4) 8134 /* 8MB. */ 8135 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8M \ 8136 (UINT32_C(0x4) << 4) 8137 /* 1GB. */ 8138 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G \ 8139 (UINT32_C(0x5) << 4) 8140 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_LAST \ 8141 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G 8142 /* SRQ page size and level. */ 8143 uint8_t srq_pg_size_srq_lvl; 8144 /* SRQ PBL indirect levels. */ 8145 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_MASK \ 8146 UINT32_C(0xf) 8147 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_SFT 0 8148 /* PBL pointer is physical start address. */ 8149 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_0 \ 8150 UINT32_C(0x0) 8151 /* PBL pointer points to PTE table. */ 8152 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_1 \ 8153 UINT32_C(0x1) 8154 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8155 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2 \ 8156 UINT32_C(0x2) 8157 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LAST \ 8158 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2 8159 /* SRQ page size. */ 8160 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_MASK \ 8161 UINT32_C(0xf0) 8162 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_SFT 4 8163 /* 4KB. */ 8164 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_4K \ 8165 (UINT32_C(0x0) << 4) 8166 /* 8KB. */ 8167 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8K \ 8168 (UINT32_C(0x1) << 4) 8169 /* 64KB. */ 8170 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_64K \ 8171 (UINT32_C(0x2) << 4) 8172 /* 2MB. */ 8173 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_2M \ 8174 (UINT32_C(0x3) << 4) 8175 /* 8MB. */ 8176 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8M \ 8177 (UINT32_C(0x4) << 4) 8178 /* 1GB. */ 8179 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G \ 8180 (UINT32_C(0x5) << 4) 8181 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_LAST \ 8182 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G 8183 /* CQ page size and level. */ 8184 uint8_t cq_pg_size_cq_lvl; 8185 /* CQ PBL indirect levels. */ 8186 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_MASK \ 8187 UINT32_C(0xf) 8188 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_SFT 0 8189 /* PBL pointer is physical start address. */ 8190 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_0 \ 8191 UINT32_C(0x0) 8192 /* PBL pointer points to PTE table. */ 8193 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_1 \ 8194 UINT32_C(0x1) 8195 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8196 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2 \ 8197 UINT32_C(0x2) 8198 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LAST \ 8199 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2 8200 /* CQ page size. */ 8201 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_MASK \ 8202 UINT32_C(0xf0) 8203 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_SFT 4 8204 /* 4KB. */ 8205 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_4K \ 8206 (UINT32_C(0x0) << 4) 8207 /* 8KB. */ 8208 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8K \ 8209 (UINT32_C(0x1) << 4) 8210 /* 64KB. */ 8211 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_64K \ 8212 (UINT32_C(0x2) << 4) 8213 /* 2MB. */ 8214 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_2M \ 8215 (UINT32_C(0x3) << 4) 8216 /* 8MB. */ 8217 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8M \ 8218 (UINT32_C(0x4) << 4) 8219 /* 1GB. */ 8220 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G \ 8221 (UINT32_C(0x5) << 4) 8222 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_LAST \ 8223 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G 8224 /* VNIC page size and level. */ 8225 uint8_t vnic_pg_size_vnic_lvl; 8226 /* VNIC PBL indirect levels. */ 8227 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_MASK \ 8228 UINT32_C(0xf) 8229 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_SFT 0 8230 /* PBL pointer is physical start address. */ 8231 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_0 \ 8232 UINT32_C(0x0) 8233 /* PBL pointer points to PTE table. */ 8234 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_1 \ 8235 UINT32_C(0x1) 8236 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8237 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2 \ 8238 UINT32_C(0x2) 8239 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LAST \ 8240 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2 8241 /* VNIC page size. */ 8242 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_MASK \ 8243 UINT32_C(0xf0) 8244 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_SFT 4 8245 /* 4KB. */ 8246 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_4K \ 8247 (UINT32_C(0x0) << 4) 8248 /* 8KB. */ 8249 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8K \ 8250 (UINT32_C(0x1) << 4) 8251 /* 64KB. */ 8252 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_64K \ 8253 (UINT32_C(0x2) << 4) 8254 /* 2MB. */ 8255 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_2M \ 8256 (UINT32_C(0x3) << 4) 8257 /* 8MB. */ 8258 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8M \ 8259 (UINT32_C(0x4) << 4) 8260 /* 1GB. */ 8261 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G \ 8262 (UINT32_C(0x5) << 4) 8263 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_LAST \ 8264 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G 8265 /* Stat page size and level. */ 8266 uint8_t stat_pg_size_stat_lvl; 8267 /* Stat PBL indirect levels. */ 8268 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_MASK \ 8269 UINT32_C(0xf) 8270 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_SFT 0 8271 /* PBL pointer is physical start address. */ 8272 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_0 \ 8273 UINT32_C(0x0) 8274 /* PBL pointer points to PTE table. */ 8275 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_1 \ 8276 UINT32_C(0x1) 8277 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8278 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2 \ 8279 UINT32_C(0x2) 8280 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LAST \ 8281 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2 8282 /* Stat page size. */ 8283 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_MASK \ 8284 UINT32_C(0xf0) 8285 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_SFT 4 8286 /* 4KB. */ 8287 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_4K \ 8288 (UINT32_C(0x0) << 4) 8289 /* 8KB. */ 8290 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8K \ 8291 (UINT32_C(0x1) << 4) 8292 /* 64KB. */ 8293 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_64K \ 8294 (UINT32_C(0x2) << 4) 8295 /* 2MB. */ 8296 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_2M \ 8297 (UINT32_C(0x3) << 4) 8298 /* 8MB. */ 8299 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8M \ 8300 (UINT32_C(0x4) << 4) 8301 /* 1GB. */ 8302 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G \ 8303 (UINT32_C(0x5) << 4) 8304 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_LAST \ 8305 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G 8306 /* TQM slow path page size and level. */ 8307 uint8_t tqm_sp_pg_size_tqm_sp_lvl; 8308 /* TQM slow path PBL indirect levels. */ 8309 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_MASK \ 8310 UINT32_C(0xf) 8311 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_SFT 0 8312 /* PBL pointer is physical start address. */ 8313 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_0 \ 8314 UINT32_C(0x0) 8315 /* PBL pointer points to PTE table. */ 8316 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_1 \ 8317 UINT32_C(0x1) 8318 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8319 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2 \ 8320 UINT32_C(0x2) 8321 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LAST \ 8322 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2 8323 /* TQM slow path page size. */ 8324 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_MASK \ 8325 UINT32_C(0xf0) 8326 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_SFT 4 8327 /* 4KB. */ 8328 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_4K \ 8329 (UINT32_C(0x0) << 4) 8330 /* 8KB. */ 8331 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8K \ 8332 (UINT32_C(0x1) << 4) 8333 /* 64KB. */ 8334 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_64K \ 8335 (UINT32_C(0x2) << 4) 8336 /* 2MB. */ 8337 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_2M \ 8338 (UINT32_C(0x3) << 4) 8339 /* 8MB. */ 8340 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8M \ 8341 (UINT32_C(0x4) << 4) 8342 /* 1GB. */ 8343 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G \ 8344 (UINT32_C(0x5) << 4) 8345 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_LAST \ 8346 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G 8347 /* TQM ring 0 page size and level. */ 8348 uint8_t tqm_ring0_pg_size_tqm_ring0_lvl; 8349 /* TQM ring 0 PBL indirect levels. */ 8350 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_MASK \ 8351 UINT32_C(0xf) 8352 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_SFT 0 8353 /* PBL pointer is physical start address. */ 8354 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_0 \ 8355 UINT32_C(0x0) 8356 /* PBL pointer points to PTE table. */ 8357 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_1 \ 8358 UINT32_C(0x1) 8359 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8360 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2 \ 8361 UINT32_C(0x2) 8362 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LAST \ 8363 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2 8364 /* TQM ring 0 page size. */ 8365 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_MASK \ 8366 UINT32_C(0xf0) 8367 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_SFT 4 8368 /* 4KB. */ 8369 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_4K \ 8370 (UINT32_C(0x0) << 4) 8371 /* 8KB. */ 8372 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8K \ 8373 (UINT32_C(0x1) << 4) 8374 /* 64KB. */ 8375 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_64K \ 8376 (UINT32_C(0x2) << 4) 8377 /* 2MB. */ 8378 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_2M \ 8379 (UINT32_C(0x3) << 4) 8380 /* 8MB. */ 8381 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8M \ 8382 (UINT32_C(0x4) << 4) 8383 /* 1GB. */ 8384 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G \ 8385 (UINT32_C(0x5) << 4) 8386 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_LAST \ 8387 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G 8388 /* TQM ring 1 page size and level. */ 8389 uint8_t tqm_ring1_pg_size_tqm_ring1_lvl; 8390 /* TQM ring 1 PBL indirect levels. */ 8391 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_MASK \ 8392 UINT32_C(0xf) 8393 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_SFT 0 8394 /* PBL pointer is physical start address. */ 8395 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_0 \ 8396 UINT32_C(0x0) 8397 /* PBL pointer points to PTE table. */ 8398 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_1 \ 8399 UINT32_C(0x1) 8400 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8401 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2 \ 8402 UINT32_C(0x2) 8403 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LAST \ 8404 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2 8405 /* TQM ring 1 page size. */ 8406 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_MASK \ 8407 UINT32_C(0xf0) 8408 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_SFT 4 8409 /* 4KB. */ 8410 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_4K \ 8411 (UINT32_C(0x0) << 4) 8412 /* 8KB. */ 8413 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8K \ 8414 (UINT32_C(0x1) << 4) 8415 /* 64KB. */ 8416 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_64K \ 8417 (UINT32_C(0x2) << 4) 8418 /* 2MB. */ 8419 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_2M \ 8420 (UINT32_C(0x3) << 4) 8421 /* 8MB. */ 8422 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8M \ 8423 (UINT32_C(0x4) << 4) 8424 /* 1GB. */ 8425 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G \ 8426 (UINT32_C(0x5) << 4) 8427 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_LAST \ 8428 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G 8429 /* TQM ring 2 page size and level. */ 8430 uint8_t tqm_ring2_pg_size_tqm_ring2_lvl; 8431 /* TQM ring 2 PBL indirect levels. */ 8432 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_MASK \ 8433 UINT32_C(0xf) 8434 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_SFT 0 8435 /* PBL pointer is physical start address. */ 8436 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_0 \ 8437 UINT32_C(0x0) 8438 /* PBL pointer points to PTE table. */ 8439 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_1 \ 8440 UINT32_C(0x1) 8441 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8442 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2 \ 8443 UINT32_C(0x2) 8444 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LAST \ 8445 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2 8446 /* TQM ring 2 page size. */ 8447 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_MASK \ 8448 UINT32_C(0xf0) 8449 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_SFT 4 8450 /* 4KB. */ 8451 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_4K \ 8452 (UINT32_C(0x0) << 4) 8453 /* 8KB. */ 8454 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8K \ 8455 (UINT32_C(0x1) << 4) 8456 /* 64KB. */ 8457 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_64K \ 8458 (UINT32_C(0x2) << 4) 8459 /* 2MB. */ 8460 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_2M \ 8461 (UINT32_C(0x3) << 4) 8462 /* 8MB. */ 8463 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8M \ 8464 (UINT32_C(0x4) << 4) 8465 /* 1GB. */ 8466 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G \ 8467 (UINT32_C(0x5) << 4) 8468 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_LAST \ 8469 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G 8470 /* TQM ring 3 page size and level. */ 8471 uint8_t tqm_ring3_pg_size_tqm_ring3_lvl; 8472 /* TQM ring 3 PBL indirect levels. */ 8473 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_MASK \ 8474 UINT32_C(0xf) 8475 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_SFT 0 8476 /* PBL pointer is physical start address. */ 8477 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_0 \ 8478 UINT32_C(0x0) 8479 /* PBL pointer points to PTE table. */ 8480 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_1 \ 8481 UINT32_C(0x1) 8482 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8483 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2 \ 8484 UINT32_C(0x2) 8485 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LAST \ 8486 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2 8487 /* TQM ring 3 page size. */ 8488 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_MASK \ 8489 UINT32_C(0xf0) 8490 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_SFT 4 8491 /* 4KB. */ 8492 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_4K \ 8493 (UINT32_C(0x0) << 4) 8494 /* 8KB. */ 8495 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8K \ 8496 (UINT32_C(0x1) << 4) 8497 /* 64KB. */ 8498 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_64K \ 8499 (UINT32_C(0x2) << 4) 8500 /* 2MB. */ 8501 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_2M \ 8502 (UINT32_C(0x3) << 4) 8503 /* 8MB. */ 8504 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8M \ 8505 (UINT32_C(0x4) << 4) 8506 /* 1GB. */ 8507 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G \ 8508 (UINT32_C(0x5) << 4) 8509 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_LAST \ 8510 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G 8511 /* TQM ring 4 page size and level. */ 8512 uint8_t tqm_ring4_pg_size_tqm_ring4_lvl; 8513 /* TQM ring 4 PBL indirect levels. */ 8514 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_MASK \ 8515 UINT32_C(0xf) 8516 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_SFT 0 8517 /* PBL pointer is physical start address. */ 8518 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_0 \ 8519 UINT32_C(0x0) 8520 /* PBL pointer points to PTE table. */ 8521 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_1 \ 8522 UINT32_C(0x1) 8523 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8524 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2 \ 8525 UINT32_C(0x2) 8526 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LAST \ 8527 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2 8528 /* TQM ring 4 page size. */ 8529 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_MASK \ 8530 UINT32_C(0xf0) 8531 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_SFT 4 8532 /* 4KB. */ 8533 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_4K \ 8534 (UINT32_C(0x0) << 4) 8535 /* 8KB. */ 8536 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8K \ 8537 (UINT32_C(0x1) << 4) 8538 /* 64KB. */ 8539 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_64K \ 8540 (UINT32_C(0x2) << 4) 8541 /* 2MB. */ 8542 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_2M \ 8543 (UINT32_C(0x3) << 4) 8544 /* 8MB. */ 8545 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8M \ 8546 (UINT32_C(0x4) << 4) 8547 /* 1GB. */ 8548 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G \ 8549 (UINT32_C(0x5) << 4) 8550 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_LAST \ 8551 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G 8552 /* TQM ring 5 page size and level. */ 8553 uint8_t tqm_ring5_pg_size_tqm_ring5_lvl; 8554 /* TQM ring 5 PBL indirect levels. */ 8555 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_MASK \ 8556 UINT32_C(0xf) 8557 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_SFT 0 8558 /* PBL pointer is physical start address. */ 8559 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_0 \ 8560 UINT32_C(0x0) 8561 /* PBL pointer points to PTE table. */ 8562 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_1 \ 8563 UINT32_C(0x1) 8564 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8565 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2 \ 8566 UINT32_C(0x2) 8567 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LAST \ 8568 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2 8569 /* TQM ring 5 page size. */ 8570 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_MASK \ 8571 UINT32_C(0xf0) 8572 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_SFT 4 8573 /* 4KB. */ 8574 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_4K \ 8575 (UINT32_C(0x0) << 4) 8576 /* 8KB. */ 8577 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8K \ 8578 (UINT32_C(0x1) << 4) 8579 /* 64KB. */ 8580 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_64K \ 8581 (UINT32_C(0x2) << 4) 8582 /* 2MB. */ 8583 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_2M \ 8584 (UINT32_C(0x3) << 4) 8585 /* 8MB. */ 8586 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8M \ 8587 (UINT32_C(0x4) << 4) 8588 /* 1GB. */ 8589 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G \ 8590 (UINT32_C(0x5) << 4) 8591 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_LAST \ 8592 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G 8593 /* TQM ring 6 page size and level. */ 8594 uint8_t tqm_ring6_pg_size_tqm_ring6_lvl; 8595 /* TQM ring 6 PBL indirect levels. */ 8596 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_MASK \ 8597 UINT32_C(0xf) 8598 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_SFT 0 8599 /* PBL pointer is physical start address. */ 8600 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_0 \ 8601 UINT32_C(0x0) 8602 /* PBL pointer points to PTE table. */ 8603 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_1 \ 8604 UINT32_C(0x1) 8605 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8606 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2 \ 8607 UINT32_C(0x2) 8608 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LAST \ 8609 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2 8610 /* TQM ring 6 page size. */ 8611 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_MASK \ 8612 UINT32_C(0xf0) 8613 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_SFT 4 8614 /* 4KB. */ 8615 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_4K \ 8616 (UINT32_C(0x0) << 4) 8617 /* 8KB. */ 8618 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8K \ 8619 (UINT32_C(0x1) << 4) 8620 /* 64KB. */ 8621 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_64K \ 8622 (UINT32_C(0x2) << 4) 8623 /* 2MB. */ 8624 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_2M \ 8625 (UINT32_C(0x3) << 4) 8626 /* 8MB. */ 8627 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8M \ 8628 (UINT32_C(0x4) << 4) 8629 /* 1GB. */ 8630 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G \ 8631 (UINT32_C(0x5) << 4) 8632 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_LAST \ 8633 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G 8634 /* TQM ring 7 page size and level. */ 8635 uint8_t tqm_ring7_pg_size_tqm_ring7_lvl; 8636 /* TQM ring 7 PBL indirect levels. */ 8637 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_MASK \ 8638 UINT32_C(0xf) 8639 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_SFT 0 8640 /* PBL pointer is physical start address. */ 8641 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_0 \ 8642 UINT32_C(0x0) 8643 /* PBL pointer points to PTE table. */ 8644 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_1 \ 8645 UINT32_C(0x1) 8646 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8647 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2 \ 8648 UINT32_C(0x2) 8649 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LAST \ 8650 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2 8651 /* TQM ring 7 page size. */ 8652 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_MASK \ 8653 UINT32_C(0xf0) 8654 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_SFT 4 8655 /* 4KB. */ 8656 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_4K \ 8657 (UINT32_C(0x0) << 4) 8658 /* 8KB. */ 8659 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8K \ 8660 (UINT32_C(0x1) << 4) 8661 /* 64KB. */ 8662 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_64K \ 8663 (UINT32_C(0x2) << 4) 8664 /* 2MB. */ 8665 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_2M \ 8666 (UINT32_C(0x3) << 4) 8667 /* 8MB. */ 8668 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8M \ 8669 (UINT32_C(0x4) << 4) 8670 /* 1GB. */ 8671 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G \ 8672 (UINT32_C(0x5) << 4) 8673 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_LAST \ 8674 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G 8675 /* MR/AV page size and level. */ 8676 uint8_t mrav_pg_size_mrav_lvl; 8677 /* MR/AV PBL indirect levels. */ 8678 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_MASK \ 8679 UINT32_C(0xf) 8680 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_SFT 0 8681 /* PBL pointer is physical start address. */ 8682 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_0 \ 8683 UINT32_C(0x0) 8684 /* PBL pointer points to PTE table. */ 8685 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_1 \ 8686 UINT32_C(0x1) 8687 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8688 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2 \ 8689 UINT32_C(0x2) 8690 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LAST \ 8691 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2 8692 /* MR/AV page size. */ 8693 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_MASK \ 8694 UINT32_C(0xf0) 8695 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_SFT 4 8696 /* 4KB. */ 8697 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_4K \ 8698 (UINT32_C(0x0) << 4) 8699 /* 8KB. */ 8700 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8K \ 8701 (UINT32_C(0x1) << 4) 8702 /* 64KB. */ 8703 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_64K \ 8704 (UINT32_C(0x2) << 4) 8705 /* 2MB. */ 8706 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_2M \ 8707 (UINT32_C(0x3) << 4) 8708 /* 8MB. */ 8709 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8M \ 8710 (UINT32_C(0x4) << 4) 8711 /* 1GB. */ 8712 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G \ 8713 (UINT32_C(0x5) << 4) 8714 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_LAST \ 8715 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G 8716 /* Timer page size and level. */ 8717 uint8_t tim_pg_size_tim_lvl; 8718 /* Timer PBL indirect levels. */ 8719 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_MASK \ 8720 UINT32_C(0xf) 8721 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_SFT 0 8722 /* PBL pointer is physical start address. */ 8723 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_0 \ 8724 UINT32_C(0x0) 8725 /* PBL pointer points to PTE table. */ 8726 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_1 \ 8727 UINT32_C(0x1) 8728 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 8729 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2 \ 8730 UINT32_C(0x2) 8731 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LAST \ 8732 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2 8733 /* Timer page size. */ 8734 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_MASK \ 8735 UINT32_C(0xf0) 8736 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_SFT 4 8737 /* 4KB. */ 8738 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_4K \ 8739 (UINT32_C(0x0) << 4) 8740 /* 8KB. */ 8741 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8K \ 8742 (UINT32_C(0x1) << 4) 8743 /* 64KB. */ 8744 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_64K \ 8745 (UINT32_C(0x2) << 4) 8746 /* 2MB. */ 8747 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_2M \ 8748 (UINT32_C(0x3) << 4) 8749 /* 8MB. */ 8750 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8M \ 8751 (UINT32_C(0x4) << 4) 8752 /* 1GB. */ 8753 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G \ 8754 (UINT32_C(0x5) << 4) 8755 #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_LAST \ 8756 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G 8757 /* QP page directory. */ 8758 uint64_t qpc_page_dir; 8759 /* SRQ page directory. */ 8760 uint64_t srq_page_dir; 8761 /* CQ page directory. */ 8762 uint64_t cq_page_dir; 8763 /* VNIC page directory. */ 8764 uint64_t vnic_page_dir; 8765 /* Stat page directory. */ 8766 uint64_t stat_page_dir; 8767 /* TQM slowpath page directory. */ 8768 uint64_t tqm_sp_page_dir; 8769 /* TQM ring 0 page directory. */ 8770 uint64_t tqm_ring0_page_dir; 8771 /* TQM ring 1 page directory. */ 8772 uint64_t tqm_ring1_page_dir; 8773 /* TQM ring 2 page directory. */ 8774 uint64_t tqm_ring2_page_dir; 8775 /* TQM ring 3 page directory. */ 8776 uint64_t tqm_ring3_page_dir; 8777 /* TQM ring 4 page directory. */ 8778 uint64_t tqm_ring4_page_dir; 8779 /* TQM ring 5 page directory. */ 8780 uint64_t tqm_ring5_page_dir; 8781 /* TQM ring 6 page directory. */ 8782 uint64_t tqm_ring6_page_dir; 8783 /* TQM ring 7 page directory. */ 8784 uint64_t tqm_ring7_page_dir; 8785 /* MR/AV page directory. */ 8786 uint64_t mrav_page_dir; 8787 /* Timer page directory. */ 8788 uint64_t tim_page_dir; 8789 /* Number of QPs. */ 8790 uint32_t qp_num_entries; 8791 /* Number of SRQs. */ 8792 uint32_t srq_num_entries; 8793 /* Number of CQs. */ 8794 uint32_t cq_num_entries; 8795 /* Number of Stats. */ 8796 uint32_t stat_num_entries; 8797 /* 8798 * Number of TQM slowpath entries. 8799 * 8800 * TQM slowpath rings should be sized as follows: 8801 * 8802 * num_entries = num_vnics + num_l2_tx_rings + num_roce_qps + tqm_min_size 8803 * 8804 * Where: 8805 * num_vnics is the number of VNICs allocated in the VNIC backing store 8806 * num_l2_tx_rings is the number of L2 rings in the QP backing store 8807 * num_roce_qps is the number of RoCE QPs in the QP backing store 8808 * tqm_min_size is tqm_min_entries_per_ring reported by 8809 * HWRM_FUNC_BACKING_STORE_QCAPS 8810 * 8811 * Note that TQM ring sizes cannot be extended while the system is 8812 * operational. If a PF driver needs to extend a TQM ring, it needs 8813 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate 8814 * the backing store. 8815 */ 8816 uint32_t tqm_sp_num_entries; 8817 /* 8818 * Number of TQM ring 0 entries. 8819 * 8820 * TQM fastpath rings should be sized large enough to accommodate the 8821 * maximum number of QPs (either L2 or RoCE, or both if shared) 8822 * that can be enqueued to the TQM ring. 8823 * 8824 * Note that TQM ring sizes cannot be extended while the system is 8825 * operational. If a PF driver needs to extend a TQM ring, it needs 8826 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate 8827 * the backing store. 8828 */ 8829 uint32_t tqm_ring0_num_entries; 8830 /* 8831 * Number of TQM ring 1 entries. 8832 * 8833 * TQM fastpath rings should be sized large enough to accommodate the 8834 * maximum number of QPs (either L2 or RoCE, or both if shared) 8835 * that can be enqueued to the TQM ring. 8836 * 8837 * Note that TQM ring sizes cannot be extended while the system is 8838 * operational. If a PF driver needs to extend a TQM ring, it needs 8839 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate 8840 * the backing store. 8841 */ 8842 uint32_t tqm_ring1_num_entries; 8843 /* 8844 * Number of TQM ring 2 entries. 8845 * 8846 * TQM fastpath rings should be sized large enough to accommodate the 8847 * maximum number of QPs (either L2 or RoCE, or both if shared) 8848 * that can be enqueued to the TQM ring. 8849 * 8850 * Note that TQM ring sizes cannot be extended while the system is 8851 * operational. If a PF driver needs to extend a TQM ring, it needs 8852 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate 8853 * the backing store. 8854 */ 8855 uint32_t tqm_ring2_num_entries; 8856 /* 8857 * Number of TQM ring 3 entries. 8858 * 8859 * TQM fastpath rings should be sized large enough to accommodate the 8860 * maximum number of QPs (either L2 or RoCE, or both if shared) 8861 * that can be enqueued to the TQM ring. 8862 * 8863 * Note that TQM ring sizes cannot be extended while the system is 8864 * operational. If a PF driver needs to extend a TQM ring, it needs 8865 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate 8866 * the backing store. 8867 */ 8868 uint32_t tqm_ring3_num_entries; 8869 /* 8870 * Number of TQM ring 4 entries. 8871 * 8872 * TQM fastpath rings should be sized large enough to accommodate the 8873 * maximum number of QPs (either L2 or RoCE, or both if shared) 8874 * that can be enqueued to the TQM ring. 8875 * 8876 * Note that TQM ring sizes cannot be extended while the system is 8877 * operational. If a PF driver needs to extend a TQM ring, it needs 8878 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate 8879 * the backing store. 8880 */ 8881 uint32_t tqm_ring4_num_entries; 8882 /* 8883 * Number of TQM ring 5 entries. 8884 * 8885 * TQM fastpath rings should be sized large enough to accommodate the 8886 * maximum number of QPs (either L2 or RoCE, or both if shared) 8887 * that can be enqueued to the TQM ring. 8888 * 8889 * Note that TQM ring sizes cannot be extended while the system is 8890 * operational. If a PF driver needs to extend a TQM ring, it needs 8891 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate 8892 * the backing store. 8893 */ 8894 uint32_t tqm_ring5_num_entries; 8895 /* 8896 * Number of TQM ring 6 entries. 8897 * 8898 * TQM fastpath rings should be sized large enough to accommodate the 8899 * maximum number of QPs (either L2 or RoCE, or both if shared) 8900 * that can be enqueued to the TQM ring. 8901 * 8902 * Note that TQM ring sizes cannot be extended while the system is 8903 * operational. If a PF driver needs to extend a TQM ring, it needs 8904 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate 8905 * the backing store. 8906 */ 8907 uint32_t tqm_ring6_num_entries; 8908 /* 8909 * Number of TQM ring 7 entries. 8910 * 8911 * TQM fastpath rings should be sized large enough to accommodate the 8912 * maximum number of QPs (either L2 or RoCE, or both if shared) 8913 * that can be enqueued to the TQM ring. 8914 * 8915 * Note that TQM ring sizes cannot be extended while the system is 8916 * operational. If a PF driver needs to extend a TQM ring, it needs 8917 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate 8918 * the backing store. 8919 */ 8920 uint32_t tqm_ring7_num_entries; 8921 /* Number of MR/AV entries. */ 8922 uint32_t mrav_num_entries; 8923 /* Number of Timer entries. */ 8924 uint32_t tim_num_entries; 8925 /* Number of entries to reserve for QP1 */ 8926 uint16_t qp_num_qp1_entries; 8927 /* Number of entries to reserve for L2 */ 8928 uint16_t qp_num_l2_entries; 8929 /* Number of bytes that have been allocated for each context entry. */ 8930 uint16_t qp_entry_size; 8931 /* Number of entries to reserve for L2 */ 8932 uint16_t srq_num_l2_entries; 8933 /* Number of bytes that have been allocated for each context entry. */ 8934 uint16_t srq_entry_size; 8935 /* Number of entries to reserve for L2 */ 8936 uint16_t cq_num_l2_entries; 8937 /* Number of bytes that have been allocated for each context entry. */ 8938 uint16_t cq_entry_size; 8939 /* Number of entries to reserve for VNIC entries */ 8940 uint16_t vnic_num_vnic_entries; 8941 /* Number of entries to reserve for Ring table entries */ 8942 uint16_t vnic_num_ring_table_entries; 8943 /* Number of bytes that have been allocated for each context entry. */ 8944 uint16_t vnic_entry_size; 8945 /* Number of bytes that have been allocated for each context entry. */ 8946 uint16_t stat_entry_size; 8947 /* Number of bytes that have been allocated for each context entry. */ 8948 uint16_t tqm_entry_size; 8949 /* Number of bytes that have been allocated for each context entry. */ 8950 uint16_t mrav_entry_size; 8951 /* Number of bytes that have been allocated for each context entry. */ 8952 uint16_t tim_entry_size; 8953 } __attribute__((packed)); 8954 8955 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */ 8956 struct hwrm_func_backing_store_cfg_output { 8957 /* The specific error status for the command. */ 8958 uint16_t error_code; 8959 /* The HWRM command request type. */ 8960 uint16_t req_type; 8961 /* The sequence ID from the original command. */ 8962 uint16_t seq_id; 8963 /* The length of the response data in number of bytes. */ 8964 uint16_t resp_len; 8965 uint8_t unused_0[7]; 8966 /* 8967 * This field is used in Output records to indicate that the output 8968 * is completely written to RAM. This field should be read as '1' 8969 * to indicate that the output has been completely written. 8970 * When writing a command completion or response to an internal processor, 8971 * the order of writes has to be such that this field is written last. 8972 */ 8973 uint8_t valid; 8974 } __attribute__((packed)); 8975 8976 /******************************** 8977 * hwrm_func_backing_store_qcfg * 8978 ********************************/ 8979 8980 8981 /* hwrm_func_backing_store_qcfg_input (size:128b/16B) */ 8982 struct hwrm_func_backing_store_qcfg_input { 8983 /* The HWRM command request type. */ 8984 uint16_t req_type; 8985 /* 8986 * The completion ring to send the completion event on. This should 8987 * be the NQ ID returned from the `nq_alloc` HWRM command. 8988 */ 8989 uint16_t cmpl_ring; 8990 /* 8991 * The sequence ID is used by the driver for tracking multiple 8992 * commands. This ID is treated as opaque data by the firmware and 8993 * the value is returned in the `hwrm_resp_hdr` upon completion. 8994 */ 8995 uint16_t seq_id; 8996 /* 8997 * The target ID of the command: 8998 * * 0x0-0xFFF8 - The function ID 8999 * * 0xFFF8-0xFFFE - Reserved for internal processors 9000 * * 0xFFFF - HWRM 9001 */ 9002 uint16_t target_id; 9003 /* 9004 * A physical address pointer pointing to a host buffer that the 9005 * command's response data will be written. This can be either a host 9006 * physical address (HPA) or a guest physical address (GPA) and must 9007 * point to a physically contiguous block of memory. 9008 */ 9009 uint64_t resp_addr; 9010 } __attribute__((packed)); 9011 9012 /* hwrm_func_backing_store_qcfg_output (size:1920b/240B) */ 9013 struct hwrm_func_backing_store_qcfg_output { 9014 /* The specific error status for the command. */ 9015 uint16_t error_code; 9016 /* The HWRM command request type. */ 9017 uint16_t req_type; 9018 /* The sequence ID from the original command. */ 9019 uint16_t seq_id; 9020 /* The length of the response data in number of bytes. */ 9021 uint16_t resp_len; 9022 uint32_t flags; 9023 /* 9024 * When set, the firmware only uses on-chip resources and does not 9025 * expect any backing store to be provided by the host driver. This 9026 * mode provides minimal L2 functionality (e.g. limited L2 resources, 9027 * no RoCE). 9028 */ 9029 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_PREBOOT_MODE \ 9030 UINT32_C(0x1) 9031 uint8_t unused_0[4]; 9032 /* 9033 * This bit must be '1' for the qp fields to be 9034 * configured. 9035 */ 9036 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_QP \ 9037 UINT32_C(0x1) 9038 /* 9039 * This bit must be '1' for the srq fields to be 9040 * configured. 9041 */ 9042 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_SRQ \ 9043 UINT32_C(0x2) 9044 /* 9045 * This bit must be '1' for the cq fields to be 9046 * configured. 9047 */ 9048 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_CQ \ 9049 UINT32_C(0x4) 9050 /* 9051 * This bit must be '1' for the vnic fields to be 9052 * configured. 9053 */ 9054 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_VNIC \ 9055 UINT32_C(0x8) 9056 /* 9057 * This bit must be '1' for the stat fields to be 9058 * configured. 9059 */ 9060 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_STAT \ 9061 UINT32_C(0x10) 9062 /* 9063 * This bit must be '1' for the tqm_sp fields to be 9064 * configured. 9065 */ 9066 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_SP \ 9067 UINT32_C(0x20) 9068 /* 9069 * This bit must be '1' for the tqm_ring0 fields to be 9070 * configured. 9071 */ 9072 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING0 \ 9073 UINT32_C(0x40) 9074 /* 9075 * This bit must be '1' for the tqm_ring1 fields to be 9076 * configured. 9077 */ 9078 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING1 \ 9079 UINT32_C(0x80) 9080 /* 9081 * This bit must be '1' for the tqm_ring2 fields to be 9082 * configured. 9083 */ 9084 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING2 \ 9085 UINT32_C(0x100) 9086 /* 9087 * This bit must be '1' for the tqm_ring3 fields to be 9088 * configured. 9089 */ 9090 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING3 \ 9091 UINT32_C(0x200) 9092 /* 9093 * This bit must be '1' for the tqm_ring4 fields to be 9094 * configured. 9095 */ 9096 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING4 \ 9097 UINT32_C(0x400) 9098 /* 9099 * This bit must be '1' for the tqm_ring5 fields to be 9100 * configured. 9101 */ 9102 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING5 \ 9103 UINT32_C(0x800) 9104 /* 9105 * This bit must be '1' for the tqm_ring6 fields to be 9106 * configured. 9107 */ 9108 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING6 \ 9109 UINT32_C(0x1000) 9110 /* 9111 * This bit must be '1' for the tqm_ring7 fields to be 9112 * configured. 9113 */ 9114 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING7 \ 9115 UINT32_C(0x2000) 9116 /* 9117 * This bit must be '1' for the mrav fields to be 9118 * configured. 9119 */ 9120 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_MRAV \ 9121 UINT32_C(0x4000) 9122 /* 9123 * This bit must be '1' for the tim fields to be 9124 * configured. 9125 */ 9126 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TIM \ 9127 UINT32_C(0x8000) 9128 /* QPC page size and level. */ 9129 uint8_t qpc_pg_size_qpc_lvl; 9130 /* QPC PBL indirect levels. */ 9131 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_MASK \ 9132 UINT32_C(0xf) 9133 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_SFT 0 9134 /* PBL pointer is physical start address. */ 9135 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_0 \ 9136 UINT32_C(0x0) 9137 /* PBL pointer points to PTE table. */ 9138 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_1 \ 9139 UINT32_C(0x1) 9140 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9141 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2 \ 9142 UINT32_C(0x2) 9143 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LAST \ 9144 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2 9145 /* QPC page size. */ 9146 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_MASK \ 9147 UINT32_C(0xf0) 9148 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_SFT 4 9149 /* 4KB. */ 9150 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_4K \ 9151 (UINT32_C(0x0) << 4) 9152 /* 8KB. */ 9153 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8K \ 9154 (UINT32_C(0x1) << 4) 9155 /* 64KB. */ 9156 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_64K \ 9157 (UINT32_C(0x2) << 4) 9158 /* 2MB. */ 9159 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_2M \ 9160 (UINT32_C(0x3) << 4) 9161 /* 8MB. */ 9162 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8M \ 9163 (UINT32_C(0x4) << 4) 9164 /* 1GB. */ 9165 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G \ 9166 (UINT32_C(0x5) << 4) 9167 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_LAST \ 9168 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G 9169 /* SRQ page size and level. */ 9170 uint8_t srq_pg_size_srq_lvl; 9171 /* SRQ PBL indirect levels. */ 9172 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_MASK \ 9173 UINT32_C(0xf) 9174 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_SFT 0 9175 /* PBL pointer is physical start address. */ 9176 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_0 \ 9177 UINT32_C(0x0) 9178 /* PBL pointer points to PTE table. */ 9179 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_1 \ 9180 UINT32_C(0x1) 9181 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9182 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2 \ 9183 UINT32_C(0x2) 9184 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LAST \ 9185 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2 9186 /* SRQ page size. */ 9187 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_MASK \ 9188 UINT32_C(0xf0) 9189 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_SFT 4 9190 /* 4KB. */ 9191 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_4K \ 9192 (UINT32_C(0x0) << 4) 9193 /* 8KB. */ 9194 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8K \ 9195 (UINT32_C(0x1) << 4) 9196 /* 64KB. */ 9197 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_64K \ 9198 (UINT32_C(0x2) << 4) 9199 /* 2MB. */ 9200 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_2M \ 9201 (UINT32_C(0x3) << 4) 9202 /* 8MB. */ 9203 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8M \ 9204 (UINT32_C(0x4) << 4) 9205 /* 1GB. */ 9206 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G \ 9207 (UINT32_C(0x5) << 4) 9208 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_LAST \ 9209 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G 9210 /* CQ page size and level. */ 9211 uint8_t cq_pg_size_cq_lvl; 9212 /* CQ PBL indirect levels. */ 9213 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_MASK \ 9214 UINT32_C(0xf) 9215 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_SFT 0 9216 /* PBL pointer is physical start address. */ 9217 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_0 \ 9218 UINT32_C(0x0) 9219 /* PBL pointer points to PTE table. */ 9220 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_1 \ 9221 UINT32_C(0x1) 9222 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9223 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2 \ 9224 UINT32_C(0x2) 9225 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LAST \ 9226 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2 9227 /* CQ page size. */ 9228 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_MASK \ 9229 UINT32_C(0xf0) 9230 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_SFT 4 9231 /* 4KB. */ 9232 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_4K \ 9233 (UINT32_C(0x0) << 4) 9234 /* 8KB. */ 9235 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8K \ 9236 (UINT32_C(0x1) << 4) 9237 /* 64KB. */ 9238 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_64K \ 9239 (UINT32_C(0x2) << 4) 9240 /* 2MB. */ 9241 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_2M \ 9242 (UINT32_C(0x3) << 4) 9243 /* 8MB. */ 9244 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8M \ 9245 (UINT32_C(0x4) << 4) 9246 /* 1GB. */ 9247 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G \ 9248 (UINT32_C(0x5) << 4) 9249 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_LAST \ 9250 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G 9251 /* VNIC page size and level. */ 9252 uint8_t vnic_pg_size_vnic_lvl; 9253 /* VNIC PBL indirect levels. */ 9254 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_MASK \ 9255 UINT32_C(0xf) 9256 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_SFT 0 9257 /* PBL pointer is physical start address. */ 9258 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_0 \ 9259 UINT32_C(0x0) 9260 /* PBL pointer points to PTE table. */ 9261 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_1 \ 9262 UINT32_C(0x1) 9263 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9264 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2 \ 9265 UINT32_C(0x2) 9266 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LAST \ 9267 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2 9268 /* VNIC page size. */ 9269 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_MASK \ 9270 UINT32_C(0xf0) 9271 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_SFT 4 9272 /* 4KB. */ 9273 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_4K \ 9274 (UINT32_C(0x0) << 4) 9275 /* 8KB. */ 9276 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8K \ 9277 (UINT32_C(0x1) << 4) 9278 /* 64KB. */ 9279 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_64K \ 9280 (UINT32_C(0x2) << 4) 9281 /* 2MB. */ 9282 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_2M \ 9283 (UINT32_C(0x3) << 4) 9284 /* 8MB. */ 9285 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8M \ 9286 (UINT32_C(0x4) << 4) 9287 /* 1GB. */ 9288 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G \ 9289 (UINT32_C(0x5) << 4) 9290 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_LAST \ 9291 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G 9292 /* Stat page size and level. */ 9293 uint8_t stat_pg_size_stat_lvl; 9294 /* Stat PBL indirect levels. */ 9295 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_MASK \ 9296 UINT32_C(0xf) 9297 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_SFT 0 9298 /* PBL pointer is physical start address. */ 9299 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_0 \ 9300 UINT32_C(0x0) 9301 /* PBL pointer points to PTE table. */ 9302 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_1 \ 9303 UINT32_C(0x1) 9304 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9305 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2 \ 9306 UINT32_C(0x2) 9307 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LAST \ 9308 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2 9309 /* Stat page size. */ 9310 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_MASK \ 9311 UINT32_C(0xf0) 9312 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_SFT 4 9313 /* 4KB. */ 9314 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_4K \ 9315 (UINT32_C(0x0) << 4) 9316 /* 8KB. */ 9317 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8K \ 9318 (UINT32_C(0x1) << 4) 9319 /* 64KB. */ 9320 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_64K \ 9321 (UINT32_C(0x2) << 4) 9322 /* 2MB. */ 9323 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_2M \ 9324 (UINT32_C(0x3) << 4) 9325 /* 8MB. */ 9326 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8M \ 9327 (UINT32_C(0x4) << 4) 9328 /* 1GB. */ 9329 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G \ 9330 (UINT32_C(0x5) << 4) 9331 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_LAST \ 9332 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G 9333 /* TQM slow path page size and level. */ 9334 uint8_t tqm_sp_pg_size_tqm_sp_lvl; 9335 /* TQM slow path PBL indirect levels. */ 9336 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_MASK \ 9337 UINT32_C(0xf) 9338 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_SFT 0 9339 /* PBL pointer is physical start address. */ 9340 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_0 \ 9341 UINT32_C(0x0) 9342 /* PBL pointer points to PTE table. */ 9343 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_1 \ 9344 UINT32_C(0x1) 9345 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9346 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2 \ 9347 UINT32_C(0x2) 9348 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LAST \ 9349 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2 9350 /* TQM slow path page size. */ 9351 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_MASK \ 9352 UINT32_C(0xf0) 9353 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_SFT 4 9354 /* 4KB. */ 9355 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_4K \ 9356 (UINT32_C(0x0) << 4) 9357 /* 8KB. */ 9358 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8K \ 9359 (UINT32_C(0x1) << 4) 9360 /* 64KB. */ 9361 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_64K \ 9362 (UINT32_C(0x2) << 4) 9363 /* 2MB. */ 9364 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_2M \ 9365 (UINT32_C(0x3) << 4) 9366 /* 8MB. */ 9367 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8M \ 9368 (UINT32_C(0x4) << 4) 9369 /* 1GB. */ 9370 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G \ 9371 (UINT32_C(0x5) << 4) 9372 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_LAST \ 9373 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G 9374 /* TQM ring 0 page size and level. */ 9375 uint8_t tqm_ring0_pg_size_tqm_ring0_lvl; 9376 /* TQM ring 0 PBL indirect levels. */ 9377 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_MASK \ 9378 UINT32_C(0xf) 9379 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_SFT 0 9380 /* PBL pointer is physical start address. */ 9381 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_0 \ 9382 UINT32_C(0x0) 9383 /* PBL pointer points to PTE table. */ 9384 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_1 \ 9385 UINT32_C(0x1) 9386 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9387 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2 \ 9388 UINT32_C(0x2) 9389 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LAST \ 9390 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2 9391 /* TQM ring 0 page size. */ 9392 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_MASK \ 9393 UINT32_C(0xf0) 9394 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_SFT 4 9395 /* 4KB. */ 9396 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_4K \ 9397 (UINT32_C(0x0) << 4) 9398 /* 8KB. */ 9399 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8K \ 9400 (UINT32_C(0x1) << 4) 9401 /* 64KB. */ 9402 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_64K \ 9403 (UINT32_C(0x2) << 4) 9404 /* 2MB. */ 9405 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_2M \ 9406 (UINT32_C(0x3) << 4) 9407 /* 8MB. */ 9408 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8M \ 9409 (UINT32_C(0x4) << 4) 9410 /* 1GB. */ 9411 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G \ 9412 (UINT32_C(0x5) << 4) 9413 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_LAST \ 9414 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G 9415 /* TQM ring 1 page size and level. */ 9416 uint8_t tqm_ring1_pg_size_tqm_ring1_lvl; 9417 /* TQM ring 1 PBL indirect levels. */ 9418 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_MASK \ 9419 UINT32_C(0xf) 9420 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_SFT 0 9421 /* PBL pointer is physical start address. */ 9422 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_0 \ 9423 UINT32_C(0x0) 9424 /* PBL pointer points to PTE table. */ 9425 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_1 \ 9426 UINT32_C(0x1) 9427 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9428 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2 \ 9429 UINT32_C(0x2) 9430 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LAST \ 9431 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2 9432 /* TQM ring 1 page size. */ 9433 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_MASK \ 9434 UINT32_C(0xf0) 9435 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_SFT 4 9436 /* 4KB. */ 9437 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_4K \ 9438 (UINT32_C(0x0) << 4) 9439 /* 8KB. */ 9440 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8K \ 9441 (UINT32_C(0x1) << 4) 9442 /* 64KB. */ 9443 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_64K \ 9444 (UINT32_C(0x2) << 4) 9445 /* 2MB. */ 9446 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_2M \ 9447 (UINT32_C(0x3) << 4) 9448 /* 8MB. */ 9449 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8M \ 9450 (UINT32_C(0x4) << 4) 9451 /* 1GB. */ 9452 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G \ 9453 (UINT32_C(0x5) << 4) 9454 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_LAST \ 9455 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G 9456 /* TQM ring 2 page size and level. */ 9457 uint8_t tqm_ring2_pg_size_tqm_ring2_lvl; 9458 /* TQM ring 2 PBL indirect levels. */ 9459 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_MASK \ 9460 UINT32_C(0xf) 9461 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_SFT 0 9462 /* PBL pointer is physical start address. */ 9463 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_0 \ 9464 UINT32_C(0x0) 9465 /* PBL pointer points to PTE table. */ 9466 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_1 \ 9467 UINT32_C(0x1) 9468 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9469 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2 \ 9470 UINT32_C(0x2) 9471 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LAST \ 9472 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2 9473 /* TQM ring 2 page size. */ 9474 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_MASK \ 9475 UINT32_C(0xf0) 9476 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_SFT 4 9477 /* 4KB. */ 9478 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_4K \ 9479 (UINT32_C(0x0) << 4) 9480 /* 8KB. */ 9481 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8K \ 9482 (UINT32_C(0x1) << 4) 9483 /* 64KB. */ 9484 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_64K \ 9485 (UINT32_C(0x2) << 4) 9486 /* 2MB. */ 9487 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_2M \ 9488 (UINT32_C(0x3) << 4) 9489 /* 8MB. */ 9490 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8M \ 9491 (UINT32_C(0x4) << 4) 9492 /* 1GB. */ 9493 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G \ 9494 (UINT32_C(0x5) << 4) 9495 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_LAST \ 9496 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G 9497 /* TQM ring 3 page size and level. */ 9498 uint8_t tqm_ring3_pg_size_tqm_ring3_lvl; 9499 /* TQM ring 3 PBL indirect levels. */ 9500 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_MASK \ 9501 UINT32_C(0xf) 9502 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_SFT 0 9503 /* PBL pointer is physical start address. */ 9504 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_0 \ 9505 UINT32_C(0x0) 9506 /* PBL pointer points to PTE table. */ 9507 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_1 \ 9508 UINT32_C(0x1) 9509 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9510 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2 \ 9511 UINT32_C(0x2) 9512 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LAST \ 9513 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2 9514 /* TQM ring 3 page size. */ 9515 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_MASK \ 9516 UINT32_C(0xf0) 9517 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_SFT 4 9518 /* 4KB. */ 9519 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_4K \ 9520 (UINT32_C(0x0) << 4) 9521 /* 8KB. */ 9522 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8K \ 9523 (UINT32_C(0x1) << 4) 9524 /* 64KB. */ 9525 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_64K \ 9526 (UINT32_C(0x2) << 4) 9527 /* 2MB. */ 9528 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_2M \ 9529 (UINT32_C(0x3) << 4) 9530 /* 8MB. */ 9531 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8M \ 9532 (UINT32_C(0x4) << 4) 9533 /* 1GB. */ 9534 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G \ 9535 (UINT32_C(0x5) << 4) 9536 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_LAST \ 9537 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G 9538 /* TQM ring 4 page size and level. */ 9539 uint8_t tqm_ring4_pg_size_tqm_ring4_lvl; 9540 /* TQM ring 4 PBL indirect levels. */ 9541 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_MASK \ 9542 UINT32_C(0xf) 9543 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_SFT 0 9544 /* PBL pointer is physical start address. */ 9545 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_0 \ 9546 UINT32_C(0x0) 9547 /* PBL pointer points to PTE table. */ 9548 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_1 \ 9549 UINT32_C(0x1) 9550 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9551 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2 \ 9552 UINT32_C(0x2) 9553 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LAST \ 9554 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2 9555 /* TQM ring 4 page size. */ 9556 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_MASK \ 9557 UINT32_C(0xf0) 9558 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_SFT 4 9559 /* 4KB. */ 9560 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_4K \ 9561 (UINT32_C(0x0) << 4) 9562 /* 8KB. */ 9563 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8K \ 9564 (UINT32_C(0x1) << 4) 9565 /* 64KB. */ 9566 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_64K \ 9567 (UINT32_C(0x2) << 4) 9568 /* 2MB. */ 9569 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_2M \ 9570 (UINT32_C(0x3) << 4) 9571 /* 8MB. */ 9572 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8M \ 9573 (UINT32_C(0x4) << 4) 9574 /* 1GB. */ 9575 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G \ 9576 (UINT32_C(0x5) << 4) 9577 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_LAST \ 9578 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G 9579 /* TQM ring 5 page size and level. */ 9580 uint8_t tqm_ring5_pg_size_tqm_ring5_lvl; 9581 /* TQM ring 5 PBL indirect levels. */ 9582 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_MASK \ 9583 UINT32_C(0xf) 9584 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_SFT 0 9585 /* PBL pointer is physical start address. */ 9586 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_0 \ 9587 UINT32_C(0x0) 9588 /* PBL pointer points to PTE table. */ 9589 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_1 \ 9590 UINT32_C(0x1) 9591 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9592 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2 \ 9593 UINT32_C(0x2) 9594 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LAST \ 9595 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2 9596 /* TQM ring 5 page size. */ 9597 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_MASK \ 9598 UINT32_C(0xf0) 9599 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_SFT 4 9600 /* 4KB. */ 9601 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_4K \ 9602 (UINT32_C(0x0) << 4) 9603 /* 8KB. */ 9604 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8K \ 9605 (UINT32_C(0x1) << 4) 9606 /* 64KB. */ 9607 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_64K \ 9608 (UINT32_C(0x2) << 4) 9609 /* 2MB. */ 9610 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_2M \ 9611 (UINT32_C(0x3) << 4) 9612 /* 8MB. */ 9613 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8M \ 9614 (UINT32_C(0x4) << 4) 9615 /* 1GB. */ 9616 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G \ 9617 (UINT32_C(0x5) << 4) 9618 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_LAST \ 9619 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G 9620 /* TQM ring 6 page size and level. */ 9621 uint8_t tqm_ring6_pg_size_tqm_ring6_lvl; 9622 /* TQM ring 6 PBL indirect levels. */ 9623 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_MASK \ 9624 UINT32_C(0xf) 9625 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_SFT 0 9626 /* PBL pointer is physical start address. */ 9627 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_0 \ 9628 UINT32_C(0x0) 9629 /* PBL pointer points to PTE table. */ 9630 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_1 \ 9631 UINT32_C(0x1) 9632 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9633 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2 \ 9634 UINT32_C(0x2) 9635 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LAST \ 9636 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2 9637 /* TQM ring 6 page size. */ 9638 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_MASK \ 9639 UINT32_C(0xf0) 9640 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_SFT 4 9641 /* 4KB. */ 9642 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_4K \ 9643 (UINT32_C(0x0) << 4) 9644 /* 8KB. */ 9645 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8K \ 9646 (UINT32_C(0x1) << 4) 9647 /* 64KB. */ 9648 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_64K \ 9649 (UINT32_C(0x2) << 4) 9650 /* 2MB. */ 9651 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_2M \ 9652 (UINT32_C(0x3) << 4) 9653 /* 8MB. */ 9654 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8M \ 9655 (UINT32_C(0x4) << 4) 9656 /* 1GB. */ 9657 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G \ 9658 (UINT32_C(0x5) << 4) 9659 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_LAST \ 9660 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G 9661 /* TQM ring 7 page size and level. */ 9662 uint8_t tqm_ring7_pg_size_tqm_ring7_lvl; 9663 /* TQM ring 7 PBL indirect levels. */ 9664 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_MASK \ 9665 UINT32_C(0xf) 9666 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_SFT 0 9667 /* PBL pointer is physical start address. */ 9668 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_0 \ 9669 UINT32_C(0x0) 9670 /* PBL pointer points to PTE table. */ 9671 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_1 \ 9672 UINT32_C(0x1) 9673 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9674 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2 \ 9675 UINT32_C(0x2) 9676 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LAST \ 9677 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2 9678 /* TQM ring 7 page size. */ 9679 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_MASK \ 9680 UINT32_C(0xf0) 9681 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_SFT 4 9682 /* 4KB. */ 9683 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_4K \ 9684 (UINT32_C(0x0) << 4) 9685 /* 8KB. */ 9686 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8K \ 9687 (UINT32_C(0x1) << 4) 9688 /* 64KB. */ 9689 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_64K \ 9690 (UINT32_C(0x2) << 4) 9691 /* 2MB. */ 9692 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_2M \ 9693 (UINT32_C(0x3) << 4) 9694 /* 8MB. */ 9695 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8M \ 9696 (UINT32_C(0x4) << 4) 9697 /* 1GB. */ 9698 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G \ 9699 (UINT32_C(0x5) << 4) 9700 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_LAST \ 9701 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G 9702 /* MR/AV page size and level. */ 9703 uint8_t mrav_pg_size_mrav_lvl; 9704 /* MR/AV PBL indirect levels. */ 9705 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_MASK \ 9706 UINT32_C(0xf) 9707 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_SFT 0 9708 /* PBL pointer is physical start address. */ 9709 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_0 \ 9710 UINT32_C(0x0) 9711 /* PBL pointer points to PTE table. */ 9712 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_1 \ 9713 UINT32_C(0x1) 9714 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9715 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2 \ 9716 UINT32_C(0x2) 9717 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LAST \ 9718 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2 9719 /* MR/AV page size. */ 9720 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_MASK \ 9721 UINT32_C(0xf0) 9722 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_SFT 4 9723 /* 4KB. */ 9724 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_4K \ 9725 (UINT32_C(0x0) << 4) 9726 /* 8KB. */ 9727 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8K \ 9728 (UINT32_C(0x1) << 4) 9729 /* 64KB. */ 9730 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_64K \ 9731 (UINT32_C(0x2) << 4) 9732 /* 2MB. */ 9733 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_2M \ 9734 (UINT32_C(0x3) << 4) 9735 /* 8MB. */ 9736 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8M \ 9737 (UINT32_C(0x4) << 4) 9738 /* 1GB. */ 9739 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G \ 9740 (UINT32_C(0x5) << 4) 9741 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_LAST \ 9742 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G 9743 /* Timer page size and level. */ 9744 uint8_t tim_pg_size_tim_lvl; 9745 /* Timer PBL indirect levels. */ 9746 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_MASK \ 9747 UINT32_C(0xf) 9748 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_SFT 0 9749 /* PBL pointer is physical start address. */ 9750 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_0 \ 9751 UINT32_C(0x0) 9752 /* PBL pointer points to PTE table. */ 9753 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_1 \ 9754 UINT32_C(0x1) 9755 /* PBL pointer points to PDE table with each entry pointing to PTE tables. */ 9756 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2 \ 9757 UINT32_C(0x2) 9758 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LAST \ 9759 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2 9760 /* Timer page size. */ 9761 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_MASK \ 9762 UINT32_C(0xf0) 9763 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_SFT 4 9764 /* 4KB. */ 9765 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_4K \ 9766 (UINT32_C(0x0) << 4) 9767 /* 8KB. */ 9768 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8K \ 9769 (UINT32_C(0x1) << 4) 9770 /* 64KB. */ 9771 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_64K \ 9772 (UINT32_C(0x2) << 4) 9773 /* 2MB. */ 9774 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_2M \ 9775 (UINT32_C(0x3) << 4) 9776 /* 8MB. */ 9777 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8M \ 9778 (UINT32_C(0x4) << 4) 9779 /* 1GB. */ 9780 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G \ 9781 (UINT32_C(0x5) << 4) 9782 #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_LAST \ 9783 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G 9784 /* QP page directory. */ 9785 uint64_t qpc_page_dir; 9786 /* SRQ page directory. */ 9787 uint64_t srq_page_dir; 9788 /* CQ page directory. */ 9789 uint64_t cq_page_dir; 9790 /* VNIC page directory. */ 9791 uint64_t vnic_page_dir; 9792 /* Stat page directory. */ 9793 uint64_t stat_page_dir; 9794 /* TQM slowpath page directory. */ 9795 uint64_t tqm_sp_page_dir; 9796 /* TQM ring 0 page directory. */ 9797 uint64_t tqm_ring0_page_dir; 9798 /* TQM ring 1 page directory. */ 9799 uint64_t tqm_ring1_page_dir; 9800 /* TQM ring 2 page directory. */ 9801 uint64_t tqm_ring2_page_dir; 9802 /* TQM ring 3 page directory. */ 9803 uint64_t tqm_ring3_page_dir; 9804 /* TQM ring 4 page directory. */ 9805 uint64_t tqm_ring4_page_dir; 9806 /* TQM ring 5 page directory. */ 9807 uint64_t tqm_ring5_page_dir; 9808 /* TQM ring 6 page directory. */ 9809 uint64_t tqm_ring6_page_dir; 9810 /* TQM ring 7 page directory. */ 9811 uint64_t tqm_ring7_page_dir; 9812 /* MR/AV page directory. */ 9813 uint64_t mrav_page_dir; 9814 /* Timer page directory. */ 9815 uint64_t tim_page_dir; 9816 /* Number of entries to reserve for QP1 */ 9817 uint16_t qp_num_qp1_entries; 9818 /* Number of entries to reserve for L2 */ 9819 uint16_t qp_num_l2_entries; 9820 /* Number of QPs. */ 9821 uint32_t qp_num_entries; 9822 /* Number of SRQs. */ 9823 uint32_t srq_num_entries; 9824 /* Number of entries to reserve for L2 */ 9825 uint16_t srq_num_l2_entries; 9826 /* Number of entries to reserve for L2 */ 9827 uint16_t cq_num_l2_entries; 9828 /* Number of CQs. */ 9829 uint32_t cq_num_entries; 9830 /* Number of entries to reserve for VNIC entries */ 9831 uint16_t vnic_num_vnic_entries; 9832 /* Number of entries to reserve for Ring table entries */ 9833 uint16_t vnic_num_ring_table_entries; 9834 /* Number of Stats. */ 9835 uint32_t stat_num_entries; 9836 /* Number of TQM slowpath entries. */ 9837 uint32_t tqm_sp_num_entries; 9838 /* Number of TQM ring 0 entries. */ 9839 uint32_t tqm_ring0_num_entries; 9840 /* Number of TQM ring 1 entries. */ 9841 uint32_t tqm_ring1_num_entries; 9842 /* Number of TQM ring 2 entries. */ 9843 uint32_t tqm_ring2_num_entries; 9844 /* Number of TQM ring 3 entries. */ 9845 uint32_t tqm_ring3_num_entries; 9846 /* Number of TQM ring 4 entries. */ 9847 uint32_t tqm_ring4_num_entries; 9848 /* Number of TQM ring 5 entries. */ 9849 uint32_t tqm_ring5_num_entries; 9850 /* Number of TQM ring 6 entries. */ 9851 uint32_t tqm_ring6_num_entries; 9852 /* Number of TQM ring 7 entries. */ 9853 uint32_t tqm_ring7_num_entries; 9854 /* Number of MR/AV entries. */ 9855 uint32_t mrav_num_entries; 9856 /* Number of Timer entries. */ 9857 uint32_t tim_num_entries; 9858 uint8_t unused_1[7]; 9859 /* 9860 * This field is used in Output records to indicate that the output 9861 * is completely written to RAM. This field should be read as '1' 9862 * to indicate that the output has been completely written. 9863 * When writing a command completion or response to an internal processor, 9864 * the order of writes has to be such that this field is written last. 9865 */ 9866 uint8_t valid; 9867 } __attribute__((packed)); 9868 9869 /*********************** 9870 * hwrm_func_vlan_qcfg * 9871 ***********************/ 9872 9873 9874 /* hwrm_func_vlan_qcfg_input (size:192b/24B) */ 9875 struct hwrm_func_vlan_qcfg_input { 9876 /* The HWRM command request type. */ 9877 uint16_t req_type; 9878 /* 9879 * The completion ring to send the completion event on. This should 9880 * be the NQ ID returned from the `nq_alloc` HWRM command. 9881 */ 9882 uint16_t cmpl_ring; 9883 /* 9884 * The sequence ID is used by the driver for tracking multiple 9885 * commands. This ID is treated as opaque data by the firmware and 9886 * the value is returned in the `hwrm_resp_hdr` upon completion. 9887 */ 9888 uint16_t seq_id; 9889 /* 9890 * The target ID of the command: 9891 * * 0x0-0xFFF8 - The function ID 9892 * * 0xFFF8-0xFFFE - Reserved for internal processors 9893 * * 0xFFFF - HWRM 9894 */ 9895 uint16_t target_id; 9896 /* 9897 * A physical address pointer pointing to a host buffer that the 9898 * command's response data will be written. This can be either a host 9899 * physical address (HPA) or a guest physical address (GPA) and must 9900 * point to a physically contiguous block of memory. 9901 */ 9902 uint64_t resp_addr; 9903 /* 9904 * Function ID of the function that is being 9905 * configured. 9906 * If set to 0xFF... (All Fs), then the configuration is 9907 * for the requesting function. 9908 */ 9909 uint16_t fid; 9910 uint8_t unused_0[6]; 9911 } __attribute__((packed)); 9912 9913 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */ 9914 struct hwrm_func_vlan_qcfg_output { 9915 /* The specific error status for the command. */ 9916 uint16_t error_code; 9917 /* The HWRM command request type. */ 9918 uint16_t req_type; 9919 /* The sequence ID from the original command. */ 9920 uint16_t seq_id; 9921 /* The length of the response data in number of bytes. */ 9922 uint16_t resp_len; 9923 uint64_t unused_0; 9924 /* S-TAG VLAN identifier configured for the function. */ 9925 uint16_t stag_vid; 9926 /* S-TAG PCP value configured for the function. */ 9927 uint8_t stag_pcp; 9928 uint8_t unused_1; 9929 /* 9930 * S-TAG TPID value configured for the function. This field is specified in 9931 * network byte order. 9932 */ 9933 uint16_t stag_tpid; 9934 /* C-TAG VLAN identifier configured for the function. */ 9935 uint16_t ctag_vid; 9936 /* C-TAG PCP value configured for the function. */ 9937 uint8_t ctag_pcp; 9938 uint8_t unused_2; 9939 /* 9940 * C-TAG TPID value configured for the function. This field is specified in 9941 * network byte order. 9942 */ 9943 uint16_t ctag_tpid; 9944 /* Future use. */ 9945 uint32_t rsvd2; 9946 /* Future use. */ 9947 uint32_t rsvd3; 9948 uint8_t unused_3[3]; 9949 /* 9950 * This field is used in Output records to indicate that the output 9951 * is completely written to RAM. This field should be read as '1' 9952 * to indicate that the output has been completely written. 9953 * When writing a command completion or response to an internal processor, 9954 * the order of writes has to be such that this field is written last. 9955 */ 9956 uint8_t valid; 9957 } __attribute__((packed)); 9958 9959 /********************** 9960 * hwrm_func_vlan_cfg * 9961 **********************/ 9962 9963 9964 /* hwrm_func_vlan_cfg_input (size:384b/48B) */ 9965 struct hwrm_func_vlan_cfg_input { 9966 /* The HWRM command request type. */ 9967 uint16_t req_type; 9968 /* 9969 * The completion ring to send the completion event on. This should 9970 * be the NQ ID returned from the `nq_alloc` HWRM command. 9971 */ 9972 uint16_t cmpl_ring; 9973 /* 9974 * The sequence ID is used by the driver for tracking multiple 9975 * commands. This ID is treated as opaque data by the firmware and 9976 * the value is returned in the `hwrm_resp_hdr` upon completion. 9977 */ 9978 uint16_t seq_id; 9979 /* 9980 * The target ID of the command: 9981 * * 0x0-0xFFF8 - The function ID 9982 * * 0xFFF8-0xFFFE - Reserved for internal processors 9983 * * 0xFFFF - HWRM 9984 */ 9985 uint16_t target_id; 9986 /* 9987 * A physical address pointer pointing to a host buffer that the 9988 * command's response data will be written. This can be either a host 9989 * physical address (HPA) or a guest physical address (GPA) and must 9990 * point to a physically contiguous block of memory. 9991 */ 9992 uint64_t resp_addr; 9993 /* 9994 * Function ID of the function that is being 9995 * configured. 9996 * If set to 0xFF... (All Fs), then the configuration is 9997 * for the requesting function. 9998 */ 9999 uint16_t fid; 10000 uint8_t unused_0[2]; 10001 uint32_t enables; 10002 /* 10003 * This bit must be '1' for the stag_vid field to be 10004 * configured. 10005 */ 10006 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID UINT32_C(0x1) 10007 /* 10008 * This bit must be '1' for the ctag_vid field to be 10009 * configured. 10010 */ 10011 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID UINT32_C(0x2) 10012 /* 10013 * This bit must be '1' for the stag_pcp field to be 10014 * configured. 10015 */ 10016 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP UINT32_C(0x4) 10017 /* 10018 * This bit must be '1' for the ctag_pcp field to be 10019 * configured. 10020 */ 10021 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP UINT32_C(0x8) 10022 /* 10023 * This bit must be '1' for the stag_tpid field to be 10024 * configured. 10025 */ 10026 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID UINT32_C(0x10) 10027 /* 10028 * This bit must be '1' for the ctag_tpid field to be 10029 * configured. 10030 */ 10031 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID UINT32_C(0x20) 10032 /* S-TAG VLAN identifier configured for the function. */ 10033 uint16_t stag_vid; 10034 /* S-TAG PCP value configured for the function. */ 10035 uint8_t stag_pcp; 10036 uint8_t unused_1; 10037 /* 10038 * S-TAG TPID value configured for the function. This field is specified in 10039 * network byte order. 10040 */ 10041 uint16_t stag_tpid; 10042 /* C-TAG VLAN identifier configured for the function. */ 10043 uint16_t ctag_vid; 10044 /* C-TAG PCP value configured for the function. */ 10045 uint8_t ctag_pcp; 10046 uint8_t unused_2; 10047 /* 10048 * C-TAG TPID value configured for the function. This field is specified in 10049 * network byte order. 10050 */ 10051 uint16_t ctag_tpid; 10052 /* Future use. */ 10053 uint32_t rsvd1; 10054 /* Future use. */ 10055 uint32_t rsvd2; 10056 uint8_t unused_3[4]; 10057 } __attribute__((packed)); 10058 10059 /* hwrm_func_vlan_cfg_output (size:128b/16B) */ 10060 struct hwrm_func_vlan_cfg_output { 10061 /* The specific error status for the command. */ 10062 uint16_t error_code; 10063 /* The HWRM command request type. */ 10064 uint16_t req_type; 10065 /* The sequence ID from the original command. */ 10066 uint16_t seq_id; 10067 /* The length of the response data in number of bytes. */ 10068 uint16_t resp_len; 10069 uint8_t unused_0[7]; 10070 /* 10071 * This field is used in Output records to indicate that the output 10072 * is completely written to RAM. This field should be read as '1' 10073 * to indicate that the output has been completely written. 10074 * When writing a command completion or response to an internal processor, 10075 * the order of writes has to be such that this field is written last. 10076 */ 10077 uint8_t valid; 10078 } __attribute__((packed)); 10079 10080 /******************************* 10081 * hwrm_func_vf_vnic_ids_query * 10082 *******************************/ 10083 10084 10085 /* hwrm_func_vf_vnic_ids_query_input (size:256b/32B) */ 10086 struct hwrm_func_vf_vnic_ids_query_input { 10087 /* The HWRM command request type. */ 10088 uint16_t req_type; 10089 /* 10090 * The completion ring to send the completion event on. This should 10091 * be the NQ ID returned from the `nq_alloc` HWRM command. 10092 */ 10093 uint16_t cmpl_ring; 10094 /* 10095 * The sequence ID is used by the driver for tracking multiple 10096 * commands. This ID is treated as opaque data by the firmware and 10097 * the value is returned in the `hwrm_resp_hdr` upon completion. 10098 */ 10099 uint16_t seq_id; 10100 /* 10101 * The target ID of the command: 10102 * * 0x0-0xFFF8 - The function ID 10103 * * 0xFFF8-0xFFFE - Reserved for internal processors 10104 * * 0xFFFF - HWRM 10105 */ 10106 uint16_t target_id; 10107 /* 10108 * A physical address pointer pointing to a host buffer that the 10109 * command's response data will be written. This can be either a host 10110 * physical address (HPA) or a guest physical address (GPA) and must 10111 * point to a physically contiguous block of memory. 10112 */ 10113 uint64_t resp_addr; 10114 /* 10115 * This value is used to identify a Virtual Function (VF). 10116 * The scope of VF ID is local within a PF. 10117 */ 10118 uint16_t vf_id; 10119 uint8_t unused_0[2]; 10120 /* Max number of vnic ids in vnic id table */ 10121 uint32_t max_vnic_id_cnt; 10122 /* This is the address for VF VNIC ID table */ 10123 uint64_t vnic_id_tbl_addr; 10124 } __attribute__((packed)); 10125 10126 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */ 10127 struct hwrm_func_vf_vnic_ids_query_output { 10128 /* The specific error status for the command. */ 10129 uint16_t error_code; 10130 /* The HWRM command request type. */ 10131 uint16_t req_type; 10132 /* The sequence ID from the original command. */ 10133 uint16_t seq_id; 10134 /* The length of the response data in number of bytes. */ 10135 uint16_t resp_len; 10136 /* 10137 * Actual number of vnic ids 10138 * 10139 * Each VNIC ID is written as a 32-bit number. 10140 */ 10141 uint32_t vnic_id_cnt; 10142 uint8_t unused_0[3]; 10143 /* 10144 * This field is used in Output records to indicate that the output 10145 * is completely written to RAM. This field should be read as '1' 10146 * to indicate that the output has been completely written. 10147 * When writing a command completion or response to an internal processor, 10148 * the order of writes has to be such that this field is written last. 10149 */ 10150 uint8_t valid; 10151 } __attribute__((packed)); 10152 10153 /*********************** 10154 * hwrm_func_vf_bw_cfg * 10155 ***********************/ 10156 10157 10158 /* hwrm_func_vf_bw_cfg_input (size:960b/120B) */ 10159 struct hwrm_func_vf_bw_cfg_input { 10160 /* The HWRM command request type. */ 10161 uint16_t req_type; 10162 /* 10163 * The completion ring to send the completion event on. This should 10164 * be the NQ ID returned from the `nq_alloc` HWRM command. 10165 */ 10166 uint16_t cmpl_ring; 10167 /* 10168 * The sequence ID is used by the driver for tracking multiple 10169 * commands. This ID is treated as opaque data by the firmware and 10170 * the value is returned in the `hwrm_resp_hdr` upon completion. 10171 */ 10172 uint16_t seq_id; 10173 /* 10174 * The target ID of the command: 10175 * * 0x0-0xFFF8 - The function ID 10176 * * 0xFFF8-0xFFFE - Reserved for internal processors 10177 * * 0xFFFF - HWRM 10178 */ 10179 uint16_t target_id; 10180 /* 10181 * A physical address pointer pointing to a host buffer that the 10182 * command's response data will be written. This can be either a host 10183 * physical address (HPA) or a guest physical address (GPA) and must 10184 * point to a physically contiguous block of memory. 10185 */ 10186 uint64_t resp_addr; 10187 /* 10188 * The number of VF functions that are being configured. 10189 * The cmd space allows up to 50 VFs' BW to be configured with one cmd. 10190 */ 10191 uint16_t num_vfs; 10192 uint16_t unused[3]; 10193 /* These 16-bit fields contain the VF fid and the rate scale percentage. */ 10194 uint16_t vfn[48]; 10195 /* The physical VF id the adjustment will be made to. */ 10196 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff) 10197 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_SFT 0 10198 /* 10199 * This field configures the rate scale percentage of the VF as specified 10200 * by the physical VF id. 10201 */ 10202 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_MASK UINT32_C(0xf000) 10203 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_SFT 12 10204 /* 0% of the max tx rate */ 10205 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_0 \ 10206 (UINT32_C(0x0) << 12) 10207 /* 6.66% of the max tx rate */ 10208 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_6_66 \ 10209 (UINT32_C(0x1) << 12) 10210 /* 13.33% of the max tx rate */ 10211 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_13_33 \ 10212 (UINT32_C(0x2) << 12) 10213 /* 20% of the max tx rate */ 10214 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_20 \ 10215 (UINT32_C(0x3) << 12) 10216 /* 26.66% of the max tx rate */ 10217 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_26_66 \ 10218 (UINT32_C(0x4) << 12) 10219 /* 33% of the max tx rate */ 10220 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_33_33 \ 10221 (UINT32_C(0x5) << 12) 10222 /* 40% of the max tx rate */ 10223 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_40 \ 10224 (UINT32_C(0x6) << 12) 10225 /* 46.66% of the max tx rate */ 10226 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_46_66 \ 10227 (UINT32_C(0x7) << 12) 10228 /* 53.33% of the max tx rate */ 10229 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_53_33 \ 10230 (UINT32_C(0x8) << 12) 10231 /* 60% of the max tx rate */ 10232 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_60 \ 10233 (UINT32_C(0x9) << 12) 10234 /* 66.66% of the max tx rate */ 10235 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_66_66 \ 10236 (UINT32_C(0xa) << 12) 10237 /* 53.33% of the max tx rate */ 10238 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_73_33 \ 10239 (UINT32_C(0xb) << 12) 10240 /* 80% of the max tx rate */ 10241 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_80 \ 10242 (UINT32_C(0xc) << 12) 10243 /* 86.66% of the max tx rate */ 10244 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_86_66 \ 10245 (UINT32_C(0xd) << 12) 10246 /* 93.33% of the max tx rate */ 10247 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_93_33 \ 10248 (UINT32_C(0xe) << 12) 10249 /* 100% of the max tx rate */ 10250 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100 \ 10251 (UINT32_C(0xf) << 12) 10252 #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_LAST \ 10253 HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100 10254 } __attribute__((packed)); 10255 10256 /* hwrm_func_vf_bw_cfg_output (size:128b/16B) */ 10257 struct hwrm_func_vf_bw_cfg_output { 10258 /* The specific error status for the command. */ 10259 uint16_t error_code; 10260 /* The HWRM command request type. */ 10261 uint16_t req_type; 10262 /* The sequence ID from the original command. */ 10263 uint16_t seq_id; 10264 /* The length of the response data in number of bytes. */ 10265 uint16_t resp_len; 10266 uint8_t unused_0[7]; 10267 /* 10268 * This field is used in Output records to indicate that the output 10269 * is completely written to RAM. This field should be read as '1' 10270 * to indicate that the output has been completely written. 10271 * When writing a command completion or response to an internal processor, 10272 * the order of writes has to be such that this field is written last. 10273 */ 10274 uint8_t valid; 10275 } __attribute__((packed)); 10276 10277 /************************ 10278 * hwrm_func_vf_bw_qcfg * 10279 ************************/ 10280 10281 10282 /* hwrm_func_vf_bw_qcfg_input (size:960b/120B) */ 10283 struct hwrm_func_vf_bw_qcfg_input { 10284 /* The HWRM command request type. */ 10285 uint16_t req_type; 10286 /* 10287 * The completion ring to send the completion event on. This should 10288 * be the NQ ID returned from the `nq_alloc` HWRM command. 10289 */ 10290 uint16_t cmpl_ring; 10291 /* 10292 * The sequence ID is used by the driver for tracking multiple 10293 * commands. This ID is treated as opaque data by the firmware and 10294 * the value is returned in the `hwrm_resp_hdr` upon completion. 10295 */ 10296 uint16_t seq_id; 10297 /* 10298 * The target ID of the command: 10299 * * 0x0-0xFFF8 - The function ID 10300 * * 0xFFF8-0xFFFE - Reserved for internal processors 10301 * * 0xFFFF - HWRM 10302 */ 10303 uint16_t target_id; 10304 /* 10305 * A physical address pointer pointing to a host buffer that the 10306 * command's response data will be written. This can be either a host 10307 * physical address (HPA) or a guest physical address (GPA) and must 10308 * point to a physically contiguous block of memory. 10309 */ 10310 uint64_t resp_addr; 10311 /* 10312 * The number of VF functions that are being queried. 10313 * The inline response space allows the host to query up to 50 VFs' 10314 * rate scale percentage 10315 */ 10316 uint16_t num_vfs; 10317 uint16_t unused[3]; 10318 /* These 16-bit fields contain the VF fid */ 10319 uint16_t vfn[48]; 10320 /* The physical VF id of interest */ 10321 #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff) 10322 #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_SFT 0 10323 } __attribute__((packed)); 10324 10325 /* hwrm_func_vf_bw_qcfg_output (size:960b/120B) */ 10326 struct hwrm_func_vf_bw_qcfg_output { 10327 /* The specific error status for the command. */ 10328 uint16_t error_code; 10329 /* The HWRM command request type. */ 10330 uint16_t req_type; 10331 /* The sequence ID from the original command. */ 10332 uint16_t seq_id; 10333 /* The length of the response data in number of bytes. */ 10334 uint16_t resp_len; 10335 /* 10336 * The number of VF functions that are being queried. 10337 * The inline response space allows the host to query up to 50 VFs' rate 10338 * scale percentage 10339 */ 10340 uint16_t num_vfs; 10341 uint16_t unused[3]; 10342 /* These 16-bit fields contain the VF fid and the rate scale percentage. */ 10343 uint16_t vfn[48]; 10344 /* The physical VF id the adjustment will be made to. */ 10345 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_MASK UINT32_C(0xfff) 10346 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_SFT 0 10347 /* 10348 * This field configures the rate scale percentage of the VF as specified 10349 * by the physical VF id. 10350 */ 10351 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_MASK UINT32_C(0xf000) 10352 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_SFT 12 10353 /* 0% of the max tx rate */ 10354 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_0 \ 10355 (UINT32_C(0x0) << 12) 10356 /* 6.66% of the max tx rate */ 10357 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_6_66 \ 10358 (UINT32_C(0x1) << 12) 10359 /* 13.33% of the max tx rate */ 10360 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_13_33 \ 10361 (UINT32_C(0x2) << 12) 10362 /* 20% of the max tx rate */ 10363 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_20 \ 10364 (UINT32_C(0x3) << 12) 10365 /* 26.66% of the max tx rate */ 10366 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_26_66 \ 10367 (UINT32_C(0x4) << 12) 10368 /* 33% of the max tx rate */ 10369 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_33_33 \ 10370 (UINT32_C(0x5) << 12) 10371 /* 40% of the max tx rate */ 10372 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_40 \ 10373 (UINT32_C(0x6) << 12) 10374 /* 46.66% of the max tx rate */ 10375 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_46_66 \ 10376 (UINT32_C(0x7) << 12) 10377 /* 53.33% of the max tx rate */ 10378 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_53_33 \ 10379 (UINT32_C(0x8) << 12) 10380 /* 60% of the max tx rate */ 10381 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_60 \ 10382 (UINT32_C(0x9) << 12) 10383 /* 66.66% of the max tx rate */ 10384 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_66_66 \ 10385 (UINT32_C(0xa) << 12) 10386 /* 53.33% of the max tx rate */ 10387 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_73_33 \ 10388 (UINT32_C(0xb) << 12) 10389 /* 80% of the max tx rate */ 10390 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_80 \ 10391 (UINT32_C(0xc) << 12) 10392 /* 86.66% of the max tx rate */ 10393 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_86_66 \ 10394 (UINT32_C(0xd) << 12) 10395 /* 93.33% of the max tx rate */ 10396 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_93_33 \ 10397 (UINT32_C(0xe) << 12) 10398 /* 100% of the max tx rate */ 10399 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100 \ 10400 (UINT32_C(0xf) << 12) 10401 #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_LAST \ 10402 HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100 10403 uint8_t unused_0[7]; 10404 /* 10405 * This field is used in Output records to indicate that the output 10406 * is completely written to RAM. This field should be read as '1' 10407 * to indicate that the output has been completely written. 10408 * When writing a command completion or response to an internal processor, 10409 * the order of writes has to be such that this field is written last. 10410 */ 10411 uint8_t valid; 10412 } __attribute__((packed)); 10413 10414 /*************************** 10415 * hwrm_func_drv_if_change * 10416 ***************************/ 10417 10418 10419 /* hwrm_func_drv_if_change_input (size:192b/24B) */ 10420 struct hwrm_func_drv_if_change_input { 10421 /* The HWRM command request type. */ 10422 uint16_t req_type; 10423 /* 10424 * The completion ring to send the completion event on. This should 10425 * be the NQ ID returned from the `nq_alloc` HWRM command. 10426 */ 10427 uint16_t cmpl_ring; 10428 /* 10429 * The sequence ID is used by the driver for tracking multiple 10430 * commands. This ID is treated as opaque data by the firmware and 10431 * the value is returned in the `hwrm_resp_hdr` upon completion. 10432 */ 10433 uint16_t seq_id; 10434 /* 10435 * The target ID of the command: 10436 * * 0x0-0xFFF8 - The function ID 10437 * * 0xFFF8-0xFFFE - Reserved for internal processors 10438 * * 0xFFFF - HWRM 10439 */ 10440 uint16_t target_id; 10441 /* 10442 * A physical address pointer pointing to a host buffer that the 10443 * command's response data will be written. This can be either a host 10444 * physical address (HPA) or a guest physical address (GPA) and must 10445 * point to a physically contiguous block of memory. 10446 */ 10447 uint64_t resp_addr; 10448 uint32_t flags; 10449 /* 10450 * When this bit is '1', the function driver is indicating 10451 * that the IF state is changing to UP state. The call should 10452 * be made at the beginning of the driver's open call before 10453 * resources are allocated. After making the call, the driver 10454 * should check the response to see if any resources may have 10455 * changed (see the response below). If the driver fails 10456 * the open call, the driver should make this call again with 10457 * this bit cleared to indicate that the IF state is not UP. 10458 * During the driver's close call when the IF state is changing 10459 * to DOWN, the driver should make this call with the bit cleared 10460 * after all resources have been freed. 10461 */ 10462 #define HWRM_FUNC_DRV_IF_CHANGE_INPUT_FLAGS_UP UINT32_C(0x1) 10463 uint32_t unused; 10464 } __attribute__((packed)); 10465 10466 /* hwrm_func_drv_if_change_output (size:128b/16B) */ 10467 struct hwrm_func_drv_if_change_output { 10468 /* The specific error status for the command. */ 10469 uint16_t error_code; 10470 /* The HWRM command request type. */ 10471 uint16_t req_type; 10472 /* The sequence ID from the original command. */ 10473 uint16_t seq_id; 10474 /* The length of the response data in number of bytes. */ 10475 uint16_t resp_len; 10476 uint32_t flags; 10477 /* 10478 * When this bit is '1', it indicates that the resources reserved 10479 * for this function may have changed. The driver should check 10480 * resource capabilities and reserve resources again before 10481 * allocating resources. 10482 */ 10483 #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_RESC_CHANGE \ 10484 UINT32_C(0x1) 10485 uint8_t unused_0[3]; 10486 /* 10487 * This field is used in Output records to indicate that the output 10488 * is completely written to RAM. This field should be read as '1' 10489 * to indicate that the output has been completely written. 10490 * When writing a command completion or response to an internal processor, 10491 * the order of writes has to be such that this field is written last. 10492 */ 10493 uint8_t valid; 10494 } __attribute__((packed)); 10495 10496 /********************* 10497 * hwrm_port_phy_cfg * 10498 *********************/ 10499 10500 10501 /* hwrm_port_phy_cfg_input (size:448b/56B) */ 10502 struct hwrm_port_phy_cfg_input { 10503 /* The HWRM command request type. */ 10504 uint16_t req_type; 10505 /* 10506 * The completion ring to send the completion event on. This should 10507 * be the NQ ID returned from the `nq_alloc` HWRM command. 10508 */ 10509 uint16_t cmpl_ring; 10510 /* 10511 * The sequence ID is used by the driver for tracking multiple 10512 * commands. This ID is treated as opaque data by the firmware and 10513 * the value is returned in the `hwrm_resp_hdr` upon completion. 10514 */ 10515 uint16_t seq_id; 10516 /* 10517 * The target ID of the command: 10518 * * 0x0-0xFFF8 - The function ID 10519 * * 0xFFF8-0xFFFE - Reserved for internal processors 10520 * * 0xFFFF - HWRM 10521 */ 10522 uint16_t target_id; 10523 /* 10524 * A physical address pointer pointing to a host buffer that the 10525 * command's response data will be written. This can be either a host 10526 * physical address (HPA) or a guest physical address (GPA) and must 10527 * point to a physically contiguous block of memory. 10528 */ 10529 uint64_t resp_addr; 10530 uint32_t flags; 10531 /* 10532 * When this bit is set to '1', the PHY for the port shall 10533 * be reset. 10534 * 10535 * # If this bit is set to 1, then the HWRM shall reset the 10536 * PHY after applying PHY configuration changes specified 10537 * in this command. 10538 * # In order to guarantee that PHY configuration changes 10539 * specified in this command take effect, the HWRM 10540 * client should set this flag to 1. 10541 * # If this bit is not set to 1, then the HWRM may reset 10542 * the PHY depending on the current PHY configuration and 10543 * settings specified in this command. 10544 */ 10545 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY \ 10546 UINT32_C(0x1) 10547 /* deprecated bit. Do not use!!! */ 10548 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED \ 10549 UINT32_C(0x2) 10550 /* 10551 * When this bit is set to '1', the link shall be forced to 10552 * the force_link_speed value. 10553 * 10554 * When this bit is set to '1', the HWRM client should 10555 * not enable any of the auto negotiation related 10556 * fields represented by auto_XXX fields in this command. 10557 * When this bit is set to '1' and the HWRM client has 10558 * enabled a auto_XXX field in this command, then the 10559 * HWRM shall ignore the enabled auto_XXX field. 10560 * 10561 * When this bit is set to zero, the link 10562 * shall be allowed to autoneg. 10563 */ 10564 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE \ 10565 UINT32_C(0x4) 10566 /* 10567 * When this bit is set to '1', the auto-negotiation process 10568 * shall be restarted on the link. 10569 */ 10570 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG \ 10571 UINT32_C(0x8) 10572 /* 10573 * When this bit is set to '1', Energy Efficient Ethernet 10574 * (EEE) is requested to be enabled on this link. 10575 * If EEE is not supported on this port, then this flag 10576 * shall be ignored by the HWRM. 10577 */ 10578 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE \ 10579 UINT32_C(0x10) 10580 /* 10581 * When this bit is set to '1', Energy Efficient Ethernet 10582 * (EEE) is requested to be disabled on this link. 10583 * If EEE is not supported on this port, then this flag 10584 * shall be ignored by the HWRM. 10585 */ 10586 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE \ 10587 UINT32_C(0x20) 10588 /* 10589 * When this bit is set to '1' and EEE is enabled on this 10590 * link, then TX LPI is requested to be enabled on the link. 10591 * If EEE is not supported on this port, then this flag 10592 * shall be ignored by the HWRM. 10593 * If EEE is disabled on this port, then this flag shall be 10594 * ignored by the HWRM. 10595 */ 10596 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE \ 10597 UINT32_C(0x40) 10598 /* 10599 * When this bit is set to '1' and EEE is enabled on this 10600 * link, then TX LPI is requested to be disabled on the link. 10601 * If EEE is not supported on this port, then this flag 10602 * shall be ignored by the HWRM. 10603 * If EEE is disabled on this port, then this flag shall be 10604 * ignored by the HWRM. 10605 */ 10606 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE \ 10607 UINT32_C(0x80) 10608 /* 10609 * When set to 1, then the HWRM shall enable FEC autonegotitation 10610 * on this port if supported. 10611 * When set to 0, then this flag shall be ignored. 10612 * If FEC autonegotiation is not supported, then the HWRM shall ignore this 10613 * flag. 10614 */ 10615 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE \ 10616 UINT32_C(0x100) 10617 /* 10618 * When set to 1, then the HWRM shall disable FEC autonegotiation 10619 * on this port if supported. 10620 * When set to 0, then this flag shall be ignored. 10621 * If FEC autonegotiation is not supported, then the HWRM shall ignore this 10622 * flag. 10623 */ 10624 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE \ 10625 UINT32_C(0x200) 10626 /* 10627 * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire Code) 10628 * on this port if supported. 10629 * When set to 0, then this flag shall be ignored. 10630 * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this 10631 * flag. 10632 */ 10633 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE \ 10634 UINT32_C(0x400) 10635 /* 10636 * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire Code) 10637 * on this port if supported. 10638 * When set to 0, then this flag shall be ignored. 10639 * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this 10640 * flag. 10641 */ 10642 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE \ 10643 UINT32_C(0x800) 10644 /* 10645 * When set to 1, then the HWRM shall enable FEC CLAUSE 91 (Reed Solomon) 10646 * on this port if supported. 10647 * When set to 0, then this flag shall be ignored. 10648 * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this 10649 * flag. 10650 */ 10651 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE \ 10652 UINT32_C(0x1000) 10653 /* 10654 * When set to 1, then the HWRM shall disable FEC CLAUSE 91 (Reed Solomon) 10655 * on this port if supported. 10656 * When set to 0, then this flag shall be ignored. 10657 * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this 10658 * flag. 10659 */ 10660 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE \ 10661 UINT32_C(0x2000) 10662 /* 10663 * When this bit is set to '1', the link shall be forced to 10664 * be taken down. 10665 * 10666 * # When this bit is set to '1", all other 10667 * command input settings related to the link speed shall 10668 * be ignored. 10669 * Once the link state is forced down, it can be 10670 * explicitly cleared from that state by setting this flag 10671 * to '0'. 10672 * # If this flag is set to '0', then the link shall be 10673 * cleared from forced down state if the link is in forced 10674 * down state. 10675 * There may be conditions (e.g. out-of-band or sideband 10676 * configuration changes for the link) outside the scope 10677 * of the HWRM implementation that may clear forced down 10678 * link state. 10679 */ 10680 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN \ 10681 UINT32_C(0x4000) 10682 uint32_t enables; 10683 /* 10684 * This bit must be '1' for the auto_mode field to be 10685 * configured. 10686 */ 10687 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE \ 10688 UINT32_C(0x1) 10689 /* 10690 * This bit must be '1' for the auto_duplex field to be 10691 * configured. 10692 */ 10693 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX \ 10694 UINT32_C(0x2) 10695 /* 10696 * This bit must be '1' for the auto_pause field to be 10697 * configured. 10698 */ 10699 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE \ 10700 UINT32_C(0x4) 10701 /* 10702 * This bit must be '1' for the auto_link_speed field to be 10703 * configured. 10704 */ 10705 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED \ 10706 UINT32_C(0x8) 10707 /* 10708 * This bit must be '1' for the auto_link_speed_mask field to be 10709 * configured. 10710 */ 10711 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \ 10712 UINT32_C(0x10) 10713 /* 10714 * This bit must be '1' for the wirespeed field to be 10715 * configured. 10716 */ 10717 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED \ 10718 UINT32_C(0x20) 10719 /* 10720 * This bit must be '1' for the lpbk field to be 10721 * configured. 10722 */ 10723 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK \ 10724 UINT32_C(0x40) 10725 /* 10726 * This bit must be '1' for the preemphasis field to be 10727 * configured. 10728 */ 10729 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS \ 10730 UINT32_C(0x80) 10731 /* 10732 * This bit must be '1' for the force_pause field to be 10733 * configured. 10734 */ 10735 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE \ 10736 UINT32_C(0x100) 10737 /* 10738 * This bit must be '1' for the eee_link_speed_mask field to be 10739 * configured. 10740 */ 10741 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \ 10742 UINT32_C(0x200) 10743 /* 10744 * This bit must be '1' for the tx_lpi_timer field to be 10745 * configured. 10746 */ 10747 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER \ 10748 UINT32_C(0x400) 10749 /* Port ID of port that is to be configured. */ 10750 uint16_t port_id; 10751 /* 10752 * This is the speed that will be used if the force 10753 * bit is '1'. If unsupported speed is selected, an error 10754 * will be generated. 10755 */ 10756 uint16_t force_link_speed; 10757 /* 100Mb link speed */ 10758 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1) 10759 /* 1Gb link speed */ 10760 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB UINT32_C(0xa) 10761 /* 2Gb link speed */ 10762 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB UINT32_C(0x14) 10763 /* 25Gb link speed */ 10764 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19) 10765 /* 10Gb link speed */ 10766 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB UINT32_C(0x64) 10767 /* 20Mb link speed */ 10768 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB UINT32_C(0xc8) 10769 /* 25Gb link speed */ 10770 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB UINT32_C(0xfa) 10771 /* 40Gb link speed */ 10772 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB UINT32_C(0x190) 10773 /* 50Gb link speed */ 10774 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB UINT32_C(0x1f4) 10775 /* 100Gb link speed */ 10776 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8) 10777 /* 10Mb link speed */ 10778 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB UINT32_C(0xffff) 10779 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_LAST \ 10780 HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB 10781 /* 10782 * This value is used to identify what autoneg mode is 10783 * used when the link speed is not being forced. 10784 */ 10785 uint8_t auto_mode; 10786 /* Disable autoneg or autoneg disabled. No speeds are selected. */ 10787 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE UINT32_C(0x0) 10788 /* Select all possible speeds for autoneg mode. */ 10789 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS UINT32_C(0x1) 10790 /* 10791 * Select only the auto_link_speed speed for autoneg mode. This mode has 10792 * been DEPRECATED. An HWRM client should not use this mode. 10793 */ 10794 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED UINT32_C(0x2) 10795 /* 10796 * Select the auto_link_speed or any speed below that speed for autoneg. 10797 * This mode has been DEPRECATED. An HWRM client should not use this mode. 10798 */ 10799 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3) 10800 /* 10801 * Select the speeds based on the corresponding link speed mask value 10802 * that is provided. 10803 */ 10804 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK UINT32_C(0x4) 10805 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_LAST \ 10806 HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK 10807 /* 10808 * This is the duplex setting that will be used if the autoneg_mode 10809 * is "one_speed" or "one_or_below". 10810 */ 10811 uint8_t auto_duplex; 10812 /* Half Duplex will be requested. */ 10813 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0) 10814 /* Full duplex will be requested. */ 10815 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1) 10816 /* Both Half and Full dupex will be requested. */ 10817 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2) 10818 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_LAST \ 10819 HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH 10820 /* 10821 * This value is used to configure the pause that will be 10822 * used for autonegotiation. 10823 * Add text on the usage of auto_pause and force_pause. 10824 */ 10825 uint8_t auto_pause; 10826 /* 10827 * When this bit is '1', Generation of tx pause messages 10828 * has been requested. Disabled otherwise. 10829 */ 10830 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX \ 10831 UINT32_C(0x1) 10832 /* 10833 * When this bit is '1', Reception of rx pause messages 10834 * has been requested. Disabled otherwise. 10835 */ 10836 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX \ 10837 UINT32_C(0x2) 10838 /* 10839 * When set to 1, the advertisement of pause is enabled. 10840 * 10841 * # When the auto_mode is not set to none and this flag is 10842 * set to 1, then the auto_pause bits on this port are being 10843 * advertised and autoneg pause results are being interpreted. 10844 * # When the auto_mode is not set to none and this 10845 * flag is set to 0, the pause is forced as indicated in 10846 * force_pause, and also advertised as auto_pause bits, but 10847 * the autoneg results are not interpreted since the pause 10848 * configuration is being forced. 10849 * # When the auto_mode is set to none and this flag is set to 10850 * 1, auto_pause bits should be ignored and should be set to 0. 10851 */ 10852 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE \ 10853 UINT32_C(0x4) 10854 uint8_t unused_0; 10855 /* 10856 * This is the speed that will be used if the autoneg_mode 10857 * is "one_speed" or "one_or_below". If an unsupported speed 10858 * is selected, an error will be generated. 10859 */ 10860 uint16_t auto_link_speed; 10861 /* 100Mb link speed */ 10862 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1) 10863 /* 1Gb link speed */ 10864 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB UINT32_C(0xa) 10865 /* 2Gb link speed */ 10866 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB UINT32_C(0x14) 10867 /* 25Gb link speed */ 10868 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19) 10869 /* 10Gb link speed */ 10870 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB UINT32_C(0x64) 10871 /* 20Mb link speed */ 10872 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB UINT32_C(0xc8) 10873 /* 25Gb link speed */ 10874 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB UINT32_C(0xfa) 10875 /* 40Gb link speed */ 10876 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB UINT32_C(0x190) 10877 /* 50Gb link speed */ 10878 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB UINT32_C(0x1f4) 10879 /* 100Gb link speed */ 10880 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8) 10881 /* 10Mb link speed */ 10882 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB UINT32_C(0xffff) 10883 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_LAST \ 10884 HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB 10885 /* 10886 * This is a mask of link speeds that will be used if 10887 * autoneg_mode is "mask". If unsupported speed is enabled 10888 * an error will be generated. 10889 */ 10890 uint16_t auto_link_speed_mask; 10891 /* 100Mb link speed (Half-duplex) */ 10892 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \ 10893 UINT32_C(0x1) 10894 /* 100Mb link speed (Full-duplex) */ 10895 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \ 10896 UINT32_C(0x2) 10897 /* 1Gb link speed (Half-duplex) */ 10898 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \ 10899 UINT32_C(0x4) 10900 /* 1Gb link speed (Full-duplex) */ 10901 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \ 10902 UINT32_C(0x8) 10903 /* 2Gb link speed */ 10904 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \ 10905 UINT32_C(0x10) 10906 /* 25Gb link speed */ 10907 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \ 10908 UINT32_C(0x20) 10909 /* 10Gb link speed */ 10910 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \ 10911 UINT32_C(0x40) 10912 /* 20Gb link speed */ 10913 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \ 10914 UINT32_C(0x80) 10915 /* 25Gb link speed */ 10916 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \ 10917 UINT32_C(0x100) 10918 /* 40Gb link speed */ 10919 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \ 10920 UINT32_C(0x200) 10921 /* 50Gb link speed */ 10922 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \ 10923 UINT32_C(0x400) 10924 /* 100Gb link speed */ 10925 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \ 10926 UINT32_C(0x800) 10927 /* 10Mb link speed (Half-duplex) */ 10928 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \ 10929 UINT32_C(0x1000) 10930 /* 10Mb link speed (Full-duplex) */ 10931 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \ 10932 UINT32_C(0x2000) 10933 /* This value controls the wirespeed feature. */ 10934 uint8_t wirespeed; 10935 /* Wirespeed feature is disabled. */ 10936 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF UINT32_C(0x0) 10937 /* Wirespeed feature is enabled. */ 10938 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON UINT32_C(0x1) 10939 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_LAST \ 10940 HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON 10941 /* This value controls the loopback setting for the PHY. */ 10942 uint8_t lpbk; 10943 /* No loopback is selected. Normal operation. */ 10944 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE UINT32_C(0x0) 10945 /* 10946 * The HW will be configured with local loopback such that 10947 * host data is sent back to the host without modification. 10948 */ 10949 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL UINT32_C(0x1) 10950 /* 10951 * The HW will be configured with remote loopback such that 10952 * port logic will send packets back out the transmitter that 10953 * are received. 10954 */ 10955 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2) 10956 /* 10957 * The HW will be configured with external loopback such that 10958 * host data is sent on the trasmitter and based on the external 10959 * loopback connection the data will be received without modification. 10960 */ 10961 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL UINT32_C(0x3) 10962 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LAST \ 10963 HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL 10964 /* 10965 * This value is used to configure the pause that will be 10966 * used for force mode. 10967 */ 10968 uint8_t force_pause; 10969 /* 10970 * When this bit is '1', Generation of tx pause messages 10971 * is supported. Disabled otherwise. 10972 */ 10973 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX UINT32_C(0x1) 10974 /* 10975 * When this bit is '1', Reception of rx pause messages 10976 * is supported. Disabled otherwise. 10977 */ 10978 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX UINT32_C(0x2) 10979 uint8_t unused_1; 10980 /* 10981 * This value controls the pre-emphasis to be used for the 10982 * link. Driver should not set this value (use 10983 * enable.preemphasis = 0) unless driver is sure of setting. 10984 * Normally HWRM FW will determine proper pre-emphasis. 10985 */ 10986 uint32_t preemphasis; 10987 /* 10988 * Setting for link speed mask that is used to 10989 * advertise speeds during autonegotiation when EEE is enabled. 10990 * This field is valid only when EEE is enabled. 10991 * The speeds specified in this field shall be a subset of 10992 * speeds specified in auto_link_speed_mask. 10993 * If EEE is enabled,then at least one speed shall be provided 10994 * in this mask. 10995 */ 10996 uint16_t eee_link_speed_mask; 10997 /* Reserved */ 10998 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 \ 10999 UINT32_C(0x1) 11000 /* 100Mb link speed (Full-duplex) */ 11001 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB \ 11002 UINT32_C(0x2) 11003 /* Reserved */ 11004 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 \ 11005 UINT32_C(0x4) 11006 /* 1Gb link speed (Full-duplex) */ 11007 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB \ 11008 UINT32_C(0x8) 11009 /* Reserved */ 11010 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \ 11011 UINT32_C(0x10) 11012 /* Reserved */ 11013 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \ 11014 UINT32_C(0x20) 11015 /* 10Gb link speed */ 11016 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \ 11017 UINT32_C(0x40) 11018 uint8_t unused_2[2]; 11019 /* 11020 * Reuested setting of TX LPI timer in microseconds. 11021 * This field is valid only when EEE is enabled and TX LPI is 11022 * enabled. 11023 */ 11024 uint32_t tx_lpi_timer; 11025 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff) 11026 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0 11027 uint32_t unused_3; 11028 } __attribute__((packed)); 11029 11030 /* hwrm_port_phy_cfg_output (size:128b/16B) */ 11031 struct hwrm_port_phy_cfg_output { 11032 /* The specific error status for the command. */ 11033 uint16_t error_code; 11034 /* The HWRM command request type. */ 11035 uint16_t req_type; 11036 /* The sequence ID from the original command. */ 11037 uint16_t seq_id; 11038 /* The length of the response data in number of bytes. */ 11039 uint16_t resp_len; 11040 uint8_t unused_0[7]; 11041 /* 11042 * This field is used in Output records to indicate that the output 11043 * is completely written to RAM. This field should be read as '1' 11044 * to indicate that the output has been completely written. 11045 * When writing a command completion or response to an internal processor, 11046 * the order of writes has to be such that this field is written last. 11047 */ 11048 uint8_t valid; 11049 } __attribute__((packed)); 11050 11051 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */ 11052 struct hwrm_port_phy_cfg_cmd_err { 11053 /* 11054 * command specific error codes that goes to 11055 * the cmd_err field in Common HWRM Error Response. 11056 */ 11057 uint8_t code; 11058 /* Unknown error */ 11059 #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0) 11060 /* Unable to complete operation due to invalid speed */ 11061 #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_ILLEGAL_SPEED UINT32_C(0x1) 11062 /* 11063 * retry the command since the phy is not ready. 11064 * retry count is returned in opaque_0. 11065 * This is only valid for the first command and 11066 * this value will not change for successive calls. 11067 * but if a 0 is returned at any time then this should 11068 * be treated as an un recoverable failure, 11069 * 11070 * retry interval in milli seconds is returned in opaque_1. 11071 * This specifies the time that user should wait before 11072 * issuing the next port_phy_cfg command. 11073 */ 11074 #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY UINT32_C(0x2) 11075 #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST \ 11076 HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY 11077 uint8_t unused_0[7]; 11078 } __attribute__((packed)); 11079 11080 /********************** 11081 * hwrm_port_phy_qcfg * 11082 **********************/ 11083 11084 11085 /* hwrm_port_phy_qcfg_input (size:192b/24B) */ 11086 struct hwrm_port_phy_qcfg_input { 11087 /* The HWRM command request type. */ 11088 uint16_t req_type; 11089 /* 11090 * The completion ring to send the completion event on. This should 11091 * be the NQ ID returned from the `nq_alloc` HWRM command. 11092 */ 11093 uint16_t cmpl_ring; 11094 /* 11095 * The sequence ID is used by the driver for tracking multiple 11096 * commands. This ID is treated as opaque data by the firmware and 11097 * the value is returned in the `hwrm_resp_hdr` upon completion. 11098 */ 11099 uint16_t seq_id; 11100 /* 11101 * The target ID of the command: 11102 * * 0x0-0xFFF8 - The function ID 11103 * * 0xFFF8-0xFFFE - Reserved for internal processors 11104 * * 0xFFFF - HWRM 11105 */ 11106 uint16_t target_id; 11107 /* 11108 * A physical address pointer pointing to a host buffer that the 11109 * command's response data will be written. This can be either a host 11110 * physical address (HPA) or a guest physical address (GPA) and must 11111 * point to a physically contiguous block of memory. 11112 */ 11113 uint64_t resp_addr; 11114 /* Port ID of port that is to be queried. */ 11115 uint16_t port_id; 11116 uint8_t unused_0[6]; 11117 } __attribute__((packed)); 11118 11119 /* hwrm_port_phy_qcfg_output (size:768b/96B) */ 11120 struct hwrm_port_phy_qcfg_output { 11121 /* The specific error status for the command. */ 11122 uint16_t error_code; 11123 /* The HWRM command request type. */ 11124 uint16_t req_type; 11125 /* The sequence ID from the original command. */ 11126 uint16_t seq_id; 11127 /* The length of the response data in number of bytes. */ 11128 uint16_t resp_len; 11129 /* This value indicates the current link status. */ 11130 uint8_t link; 11131 /* There is no link or cable detected. */ 11132 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0) 11133 /* There is no link, but a cable has been detected. */ 11134 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL UINT32_C(0x1) 11135 /* There is a link. */ 11136 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK UINT32_C(0x2) 11137 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LAST \ 11138 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK 11139 uint8_t unused_0; 11140 /* This value indicates the current link speed of the connection. */ 11141 uint16_t link_speed; 11142 /* 100Mb link speed */ 11143 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1) 11144 /* 1Gb link speed */ 11145 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB UINT32_C(0xa) 11146 /* 2Gb link speed */ 11147 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB UINT32_C(0x14) 11148 /* 25Gb link speed */ 11149 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19) 11150 /* 10Gb link speed */ 11151 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB UINT32_C(0x64) 11152 /* 20Mb link speed */ 11153 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB UINT32_C(0xc8) 11154 /* 25Gb link speed */ 11155 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB UINT32_C(0xfa) 11156 /* 40Gb link speed */ 11157 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB UINT32_C(0x190) 11158 /* 50Gb link speed */ 11159 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB UINT32_C(0x1f4) 11160 /* 100Gb link speed */ 11161 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8) 11162 /* 10Mb link speed */ 11163 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB UINT32_C(0xffff) 11164 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_LAST \ 11165 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB 11166 /* 11167 * This value is indicates the duplex of the current 11168 * configuration. 11169 */ 11170 uint8_t duplex_cfg; 11171 /* Half Duplex connection. */ 11172 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0) 11173 /* Full duplex connection. */ 11174 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1) 11175 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_LAST \ 11176 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL 11177 /* 11178 * This value is used to indicate the current 11179 * pause configuration. When autoneg is enabled, this value 11180 * represents the autoneg results of pause configuration. 11181 */ 11182 uint8_t pause; 11183 /* 11184 * When this bit is '1', Generation of tx pause messages 11185 * is supported. Disabled otherwise. 11186 */ 11187 #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX UINT32_C(0x1) 11188 /* 11189 * When this bit is '1', Reception of rx pause messages 11190 * is supported. Disabled otherwise. 11191 */ 11192 #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX UINT32_C(0x2) 11193 /* 11194 * The supported speeds for the port. This is a bit mask. 11195 * For each speed that is supported, the corrresponding 11196 * bit will be set to '1'. 11197 */ 11198 uint16_t support_speeds; 11199 /* 100Mb link speed (Half-duplex) */ 11200 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD \ 11201 UINT32_C(0x1) 11202 /* 100Mb link speed (Full-duplex) */ 11203 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB \ 11204 UINT32_C(0x2) 11205 /* 1Gb link speed (Half-duplex) */ 11206 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD \ 11207 UINT32_C(0x4) 11208 /* 1Gb link speed (Full-duplex) */ 11209 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB \ 11210 UINT32_C(0x8) 11211 /* 2Gb link speed */ 11212 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB \ 11213 UINT32_C(0x10) 11214 /* 25Gb link speed */ 11215 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB \ 11216 UINT32_C(0x20) 11217 /* 10Gb link speed */ 11218 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB \ 11219 UINT32_C(0x40) 11220 /* 20Gb link speed */ 11221 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB \ 11222 UINT32_C(0x80) 11223 /* 25Gb link speed */ 11224 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB \ 11225 UINT32_C(0x100) 11226 /* 40Gb link speed */ 11227 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB \ 11228 UINT32_C(0x200) 11229 /* 50Gb link speed */ 11230 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB \ 11231 UINT32_C(0x400) 11232 /* 100Gb link speed */ 11233 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB \ 11234 UINT32_C(0x800) 11235 /* 10Mb link speed (Half-duplex) */ 11236 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD \ 11237 UINT32_C(0x1000) 11238 /* 10Mb link speed (Full-duplex) */ 11239 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB \ 11240 UINT32_C(0x2000) 11241 /* 11242 * Current setting of forced link speed. 11243 * When the link speed is not being forced, this 11244 * value shall be set to 0. 11245 */ 11246 uint16_t force_link_speed; 11247 /* 100Mb link speed */ 11248 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1) 11249 /* 1Gb link speed */ 11250 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB UINT32_C(0xa) 11251 /* 2Gb link speed */ 11252 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB UINT32_C(0x14) 11253 /* 25Gb link speed */ 11254 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19) 11255 /* 10Gb link speed */ 11256 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB UINT32_C(0x64) 11257 /* 20Mb link speed */ 11258 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB UINT32_C(0xc8) 11259 /* 25Gb link speed */ 11260 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB UINT32_C(0xfa) 11261 /* 40Gb link speed */ 11262 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB \ 11263 UINT32_C(0x190) 11264 /* 50Gb link speed */ 11265 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB \ 11266 UINT32_C(0x1f4) 11267 /* 100Gb link speed */ 11268 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB \ 11269 UINT32_C(0x3e8) 11270 /* 10Mb link speed */ 11271 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB \ 11272 UINT32_C(0xffff) 11273 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_LAST \ 11274 HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB 11275 /* Current setting of auto negotiation mode. */ 11276 uint8_t auto_mode; 11277 /* Disable autoneg or autoneg disabled. No speeds are selected. */ 11278 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE UINT32_C(0x0) 11279 /* Select all possible speeds for autoneg mode. */ 11280 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS UINT32_C(0x1) 11281 /* 11282 * Select only the auto_link_speed speed for autoneg mode. This mode has 11283 * been DEPRECATED. An HWRM client should not use this mode. 11284 */ 11285 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED UINT32_C(0x2) 11286 /* 11287 * Select the auto_link_speed or any speed below that speed for autoneg. 11288 * This mode has been DEPRECATED. An HWRM client should not use this mode. 11289 */ 11290 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3) 11291 /* 11292 * Select the speeds based on the corresponding link speed mask value 11293 * that is provided. 11294 */ 11295 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK UINT32_C(0x4) 11296 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_LAST \ 11297 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK 11298 /* 11299 * Current setting of pause autonegotiation. 11300 * Move autoneg_pause flag here. 11301 */ 11302 uint8_t auto_pause; 11303 /* 11304 * When this bit is '1', Generation of tx pause messages 11305 * has been requested. Disabled otherwise. 11306 */ 11307 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX \ 11308 UINT32_C(0x1) 11309 /* 11310 * When this bit is '1', Reception of rx pause messages 11311 * has been requested. Disabled otherwise. 11312 */ 11313 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX \ 11314 UINT32_C(0x2) 11315 /* 11316 * When set to 1, the advertisement of pause is enabled. 11317 * 11318 * # When the auto_mode is not set to none and this flag is 11319 * set to 1, then the auto_pause bits on this port are being 11320 * advertised and autoneg pause results are being interpreted. 11321 * # When the auto_mode is not set to none and this 11322 * flag is set to 0, the pause is forced as indicated in 11323 * force_pause, and also advertised as auto_pause bits, but 11324 * the autoneg results are not interpreted since the pause 11325 * configuration is being forced. 11326 * # When the auto_mode is set to none and this flag is set to 11327 * 1, auto_pause bits should be ignored and should be set to 0. 11328 */ 11329 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE \ 11330 UINT32_C(0x4) 11331 /* 11332 * Current setting for auto_link_speed. This field is only 11333 * valid when auto_mode is set to "one_speed" or "one_or_below". 11334 */ 11335 uint16_t auto_link_speed; 11336 /* 100Mb link speed */ 11337 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1) 11338 /* 1Gb link speed */ 11339 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB UINT32_C(0xa) 11340 /* 2Gb link speed */ 11341 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB UINT32_C(0x14) 11342 /* 25Gb link speed */ 11343 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19) 11344 /* 10Gb link speed */ 11345 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB UINT32_C(0x64) 11346 /* 20Mb link speed */ 11347 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB UINT32_C(0xc8) 11348 /* 25Gb link speed */ 11349 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB UINT32_C(0xfa) 11350 /* 40Gb link speed */ 11351 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB UINT32_C(0x190) 11352 /* 50Gb link speed */ 11353 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB UINT32_C(0x1f4) 11354 /* 100Gb link speed */ 11355 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8) 11356 /* 10Mb link speed */ 11357 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB \ 11358 UINT32_C(0xffff) 11359 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_LAST \ 11360 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB 11361 /* 11362 * Current setting for auto_link_speed_mask that is used to 11363 * advertise speeds during autonegotiation. 11364 * This field is only valid when auto_mode is set to "mask". 11365 * The speeds specified in this field shall be a subset of 11366 * supported speeds on this port. 11367 */ 11368 uint16_t auto_link_speed_mask; 11369 /* 100Mb link speed (Half-duplex) */ 11370 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \ 11371 UINT32_C(0x1) 11372 /* 100Mb link speed (Full-duplex) */ 11373 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \ 11374 UINT32_C(0x2) 11375 /* 1Gb link speed (Half-duplex) */ 11376 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \ 11377 UINT32_C(0x4) 11378 /* 1Gb link speed (Full-duplex) */ 11379 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB \ 11380 UINT32_C(0x8) 11381 /* 2Gb link speed */ 11382 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \ 11383 UINT32_C(0x10) 11384 /* 25Gb link speed */ 11385 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \ 11386 UINT32_C(0x20) 11387 /* 10Gb link speed */ 11388 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \ 11389 UINT32_C(0x40) 11390 /* 20Gb link speed */ 11391 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \ 11392 UINT32_C(0x80) 11393 /* 25Gb link speed */ 11394 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \ 11395 UINT32_C(0x100) 11396 /* 40Gb link speed */ 11397 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \ 11398 UINT32_C(0x200) 11399 /* 50Gb link speed */ 11400 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \ 11401 UINT32_C(0x400) 11402 /* 100Gb link speed */ 11403 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \ 11404 UINT32_C(0x800) 11405 /* 10Mb link speed (Half-duplex) */ 11406 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \ 11407 UINT32_C(0x1000) 11408 /* 10Mb link speed (Full-duplex) */ 11409 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \ 11410 UINT32_C(0x2000) 11411 /* Current setting for wirespeed. */ 11412 uint8_t wirespeed; 11413 /* Wirespeed feature is disabled. */ 11414 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF UINT32_C(0x0) 11415 /* Wirespeed feature is enabled. */ 11416 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON UINT32_C(0x1) 11417 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_LAST \ 11418 HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON 11419 /* Current setting for loopback. */ 11420 uint8_t lpbk; 11421 /* No loopback is selected. Normal operation. */ 11422 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE UINT32_C(0x0) 11423 /* 11424 * The HW will be configured with local loopback such that 11425 * host data is sent back to the host without modification. 11426 */ 11427 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL UINT32_C(0x1) 11428 /* 11429 * The HW will be configured with remote loopback such that 11430 * port logic will send packets back out the transmitter that 11431 * are received. 11432 */ 11433 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2) 11434 /* 11435 * The HW will be configured with external loopback such that 11436 * host data is sent on the trasmitter and based on the external 11437 * loopback connection the data will be received without modification. 11438 */ 11439 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL UINT32_C(0x3) 11440 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LAST \ 11441 HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL 11442 /* 11443 * Current setting of forced pause. 11444 * When the pause configuration is not being forced, then 11445 * this value shall be set to 0. 11446 */ 11447 uint8_t force_pause; 11448 /* 11449 * When this bit is '1', Generation of tx pause messages 11450 * is supported. Disabled otherwise. 11451 */ 11452 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX UINT32_C(0x1) 11453 /* 11454 * When this bit is '1', Reception of rx pause messages 11455 * is supported. Disabled otherwise. 11456 */ 11457 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX UINT32_C(0x2) 11458 /* 11459 * This value indicates the current status of the optics module on 11460 * this port. 11461 */ 11462 uint8_t module_status; 11463 /* Module is inserted and accepted */ 11464 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE \ 11465 UINT32_C(0x0) 11466 /* Module is rejected and transmit side Laser is disabled. */ 11467 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX \ 11468 UINT32_C(0x1) 11469 /* Module mismatch warning. */ 11470 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG \ 11471 UINT32_C(0x2) 11472 /* Module is rejected and powered down. */ 11473 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN \ 11474 UINT32_C(0x3) 11475 /* Module is not inserted. */ 11476 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \ 11477 UINT32_C(0x4) 11478 /* Module status is not applicable. */ 11479 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \ 11480 UINT32_C(0xff) 11481 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_LAST \ 11482 HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE 11483 /* Current setting for preemphasis. */ 11484 uint32_t preemphasis; 11485 /* This field represents the major version of the PHY. */ 11486 uint8_t phy_maj; 11487 /* This field represents the minor version of the PHY. */ 11488 uint8_t phy_min; 11489 /* This field represents the build version of the PHY. */ 11490 uint8_t phy_bld; 11491 /* This value represents a PHY type. */ 11492 uint8_t phy_type; 11493 /* Unknown */ 11494 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN \ 11495 UINT32_C(0x0) 11496 /* BASE-CR */ 11497 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR \ 11498 UINT32_C(0x1) 11499 /* BASE-KR4 (Deprecated) */ 11500 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 \ 11501 UINT32_C(0x2) 11502 /* BASE-LR */ 11503 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR \ 11504 UINT32_C(0x3) 11505 /* BASE-SR */ 11506 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR \ 11507 UINT32_C(0x4) 11508 /* BASE-KR2 (Deprecated) */ 11509 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 \ 11510 UINT32_C(0x5) 11511 /* BASE-KX */ 11512 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX \ 11513 UINT32_C(0x6) 11514 /* BASE-KR */ 11515 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR \ 11516 UINT32_C(0x7) 11517 /* BASE-T */ 11518 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET \ 11519 UINT32_C(0x8) 11520 /* EEE capable BASE-T */ 11521 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE \ 11522 UINT32_C(0x9) 11523 /* SGMII connected external PHY */ 11524 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY \ 11525 UINT32_C(0xa) 11526 /* 25G_BASECR_CA_L */ 11527 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L \ 11528 UINT32_C(0xb) 11529 /* 25G_BASECR_CA_S */ 11530 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S \ 11531 UINT32_C(0xc) 11532 /* 25G_BASECR_CA_N */ 11533 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N \ 11534 UINT32_C(0xd) 11535 /* 25G_BASESR */ 11536 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR \ 11537 UINT32_C(0xe) 11538 /* 100G_BASECR4 */ 11539 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 \ 11540 UINT32_C(0xf) 11541 /* 100G_BASESR4 */ 11542 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 \ 11543 UINT32_C(0x10) 11544 /* 100G_BASELR4 */ 11545 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 \ 11546 UINT32_C(0x11) 11547 /* 100G_BASEER4 */ 11548 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 \ 11549 UINT32_C(0x12) 11550 /* 100G_BASESR10 */ 11551 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 \ 11552 UINT32_C(0x13) 11553 /* 40G_BASECR4 */ 11554 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 \ 11555 UINT32_C(0x14) 11556 /* 40G_BASESR4 */ 11557 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 \ 11558 UINT32_C(0x15) 11559 /* 40G_BASELR4 */ 11560 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 \ 11561 UINT32_C(0x16) 11562 /* 40G_BASEER4 */ 11563 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 \ 11564 UINT32_C(0x17) 11565 /* 40G_ACTIVE_CABLE */ 11566 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE \ 11567 UINT32_C(0x18) 11568 /* 1G_baseT */ 11569 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET \ 11570 UINT32_C(0x19) 11571 /* 1G_baseSX */ 11572 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX \ 11573 UINT32_C(0x1a) 11574 /* 1G_baseCX */ 11575 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX \ 11576 UINT32_C(0x1b) 11577 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_LAST \ 11578 HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX 11579 /* This value represents a media type. */ 11580 uint8_t media_type; 11581 /* Unknown */ 11582 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0) 11583 /* Twisted Pair */ 11584 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP UINT32_C(0x1) 11585 /* Direct Attached Copper */ 11586 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC UINT32_C(0x2) 11587 /* Fiber */ 11588 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE UINT32_C(0x3) 11589 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_LAST \ 11590 HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE 11591 /* This value represents a transceiver type. */ 11592 uint8_t xcvr_pkg_type; 11593 /* PHY and MAC are in the same package */ 11594 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \ 11595 UINT32_C(0x1) 11596 /* PHY and MAC are in different packages */ 11597 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \ 11598 UINT32_C(0x2) 11599 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_LAST \ 11600 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL 11601 uint8_t eee_config_phy_addr; 11602 /* This field represents PHY address. */ 11603 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK \ 11604 UINT32_C(0x1f) 11605 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT 0 11606 /* 11607 * This field represents flags related to EEE configuration. 11608 * These EEE configuration flags are valid only when the 11609 * auto_mode is not set to none (in other words autonegotiation 11610 * is enabled). 11611 */ 11612 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK \ 11613 UINT32_C(0xe0) 11614 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT 5 11615 /* 11616 * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled. 11617 * Speeds for autoneg with EEE mode enabled 11618 * are based on eee_link_speed_mask. 11619 */ 11620 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED \ 11621 UINT32_C(0x20) 11622 /* 11623 * This flag is valid only when eee_enabled is set to 1. 11624 * 11625 * # If eee_enabled is set to 0, then EEE mode is disabled 11626 * and this flag shall be ignored. 11627 * # If eee_enabled is set to 1 and this flag is set to 1, 11628 * then Energy Efficient Ethernet (EEE) mode is enabled 11629 * and in use. 11630 * # If eee_enabled is set to 1 and this flag is set to 0, 11631 * then Energy Efficient Ethernet (EEE) mode is enabled 11632 * but is currently not in use. 11633 */ 11634 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE \ 11635 UINT32_C(0x40) 11636 /* 11637 * This flag is valid only when eee_enabled is set to 1. 11638 * 11639 * # If eee_enabled is set to 0, then EEE mode is disabled 11640 * and this flag shall be ignored. 11641 * # If eee_enabled is set to 1 and this flag is set to 1, 11642 * then Energy Efficient Ethernet (EEE) mode is enabled 11643 * and TX LPI is enabled. 11644 * # If eee_enabled is set to 1 and this flag is set to 0, 11645 * then Energy Efficient Ethernet (EEE) mode is enabled 11646 * but TX LPI is disabled. 11647 */ 11648 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI \ 11649 UINT32_C(0x80) 11650 /* 11651 * When set to 1, the parallel detection is used to determine 11652 * the speed of the link partner. 11653 * 11654 * Parallel detection is used when a autonegotiation capable 11655 * device is connected to a link parter that is not capable 11656 * of autonegotiation. 11657 */ 11658 uint8_t parallel_detect; 11659 /* 11660 * When set to 1, the parallel detection is used to determine 11661 * the speed of the link partner. 11662 * 11663 * Parallel detection is used when a autonegotiation capable 11664 * device is connected to a link parter that is not capable 11665 * of autonegotiation. 11666 */ 11667 #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT UINT32_C(0x1) 11668 /* 11669 * The advertised speeds for the port by the link partner. 11670 * Each advertised speed will be set to '1'. 11671 */ 11672 uint16_t link_partner_adv_speeds; 11673 /* 100Mb link speed (Half-duplex) */ 11674 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \ 11675 UINT32_C(0x1) 11676 /* 100Mb link speed (Full-duplex) */ 11677 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \ 11678 UINT32_C(0x2) 11679 /* 1Gb link speed (Half-duplex) */ 11680 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \ 11681 UINT32_C(0x4) 11682 /* 1Gb link speed (Full-duplex) */ 11683 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \ 11684 UINT32_C(0x8) 11685 /* 2Gb link speed */ 11686 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \ 11687 UINT32_C(0x10) 11688 /* 25Gb link speed */ 11689 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \ 11690 UINT32_C(0x20) 11691 /* 10Gb link speed */ 11692 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \ 11693 UINT32_C(0x40) 11694 /* 20Gb link speed */ 11695 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \ 11696 UINT32_C(0x80) 11697 /* 25Gb link speed */ 11698 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \ 11699 UINT32_C(0x100) 11700 /* 40Gb link speed */ 11701 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \ 11702 UINT32_C(0x200) 11703 /* 50Gb link speed */ 11704 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \ 11705 UINT32_C(0x400) 11706 /* 100Gb link speed */ 11707 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \ 11708 UINT32_C(0x800) 11709 /* 10Mb link speed (Half-duplex) */ 11710 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \ 11711 UINT32_C(0x1000) 11712 /* 10Mb link speed (Full-duplex) */ 11713 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \ 11714 UINT32_C(0x2000) 11715 /* 11716 * The advertised autoneg for the port by the link partner. 11717 * This field is deprecated and should be set to 0. 11718 */ 11719 uint8_t link_partner_adv_auto_mode; 11720 /* Disable autoneg or autoneg disabled. No speeds are selected. */ 11721 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \ 11722 UINT32_C(0x0) 11723 /* Select all possible speeds for autoneg mode. */ 11724 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS \ 11725 UINT32_C(0x1) 11726 /* 11727 * Select only the auto_link_speed speed for autoneg mode. This mode has 11728 * been DEPRECATED. An HWRM client should not use this mode. 11729 */ 11730 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \ 11731 UINT32_C(0x2) 11732 /* 11733 * Select the auto_link_speed or any speed below that speed for autoneg. 11734 * This mode has been DEPRECATED. An HWRM client should not use this mode. 11735 */ 11736 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \ 11737 UINT32_C(0x3) 11738 /* 11739 * Select the speeds based on the corresponding link speed mask value 11740 * that is provided. 11741 */ 11742 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK \ 11743 UINT32_C(0x4) 11744 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_LAST \ 11745 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK 11746 /* The advertised pause settings on the port by the link partner. */ 11747 uint8_t link_partner_adv_pause; 11748 /* 11749 * When this bit is '1', Generation of tx pause messages 11750 * is supported. Disabled otherwise. 11751 */ 11752 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \ 11753 UINT32_C(0x1) 11754 /* 11755 * When this bit is '1', Reception of rx pause messages 11756 * is supported. Disabled otherwise. 11757 */ 11758 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \ 11759 UINT32_C(0x2) 11760 /* 11761 * Current setting for link speed mask that is used to 11762 * advertise speeds during autonegotiation when EEE is enabled. 11763 * This field is valid only when eee_enabled flags is set to 1. 11764 * The speeds specified in this field shall be a subset of 11765 * speeds specified in auto_link_speed_mask. 11766 */ 11767 uint16_t adv_eee_link_speed_mask; 11768 /* Reserved */ 11769 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \ 11770 UINT32_C(0x1) 11771 /* 100Mb link speed (Full-duplex) */ 11772 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \ 11773 UINT32_C(0x2) 11774 /* Reserved */ 11775 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \ 11776 UINT32_C(0x4) 11777 /* 1Gb link speed (Full-duplex) */ 11778 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \ 11779 UINT32_C(0x8) 11780 /* Reserved */ 11781 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \ 11782 UINT32_C(0x10) 11783 /* Reserved */ 11784 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \ 11785 UINT32_C(0x20) 11786 /* 10Gb link speed */ 11787 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \ 11788 UINT32_C(0x40) 11789 /* 11790 * Current setting for link speed mask that is advertised by 11791 * the link partner when EEE is enabled. 11792 * This field is valid only when eee_enabled flags is set to 1. 11793 */ 11794 uint16_t link_partner_adv_eee_link_speed_mask; 11795 /* Reserved */ 11796 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \ 11797 UINT32_C(0x1) 11798 /* 100Mb link speed (Full-duplex) */ 11799 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \ 11800 UINT32_C(0x2) 11801 /* Reserved */ 11802 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \ 11803 UINT32_C(0x4) 11804 /* 1Gb link speed (Full-duplex) */ 11805 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \ 11806 UINT32_C(0x8) 11807 /* Reserved */ 11808 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \ 11809 UINT32_C(0x10) 11810 /* Reserved */ 11811 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \ 11812 UINT32_C(0x20) 11813 /* 10Gb link speed */ 11814 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \ 11815 UINT32_C(0x40) 11816 uint32_t xcvr_identifier_type_tx_lpi_timer; 11817 /* 11818 * Current setting of TX LPI timer in microseconds. 11819 * This field is valid only when_eee_enabled flag is set to 1 11820 * and tx_lpi_enabled is set to 1. 11821 */ 11822 #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK \ 11823 UINT32_C(0xffffff) 11824 #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT 0 11825 /* This value represents transceiver identifier type. */ 11826 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \ 11827 UINT32_C(0xff000000) 11828 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT 24 11829 /* Unknown */ 11830 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \ 11831 (UINT32_C(0x0) << 24) 11832 /* SFP/SFP+/SFP28 */ 11833 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \ 11834 (UINT32_C(0x3) << 24) 11835 /* QSFP+ */ 11836 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \ 11837 (UINT32_C(0xc) << 24) 11838 /* QSFP+ */ 11839 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \ 11840 (UINT32_C(0xd) << 24) 11841 /* QSFP28 */ 11842 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \ 11843 (UINT32_C(0x11) << 24) 11844 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_LAST \ 11845 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 11846 /* 11847 * This value represents the current configuration of 11848 * Forward Error Correction (FEC) on the port. 11849 */ 11850 uint16_t fec_cfg; 11851 /* 11852 * When set to 1, then FEC is not supported on this port. If this flag 11853 * is set to 1, then all other FEC configuration flags shall be ignored. 11854 * When set to 0, then FEC is supported as indicated by other 11855 * configuration flags. 11856 * If no cable is attached and the HWRM does not yet know the FEC 11857 * capability, then the HWRM shall set this flag to 1 when reporting 11858 * FEC capability. 11859 */ 11860 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED \ 11861 UINT32_C(0x1) 11862 /* 11863 * When set to 1, then FEC autonegotiation is supported on this port. 11864 * When set to 0, then FEC autonegotiation is not supported on this port. 11865 */ 11866 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED \ 11867 UINT32_C(0x2) 11868 /* 11869 * When set to 1, then FEC autonegotiation is enabled on this port. 11870 * When set to 0, then FEC autonegotiation is disabled if supported. 11871 * This flag should be ignored if FEC autonegotiation is not supported on this port. 11872 */ 11873 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED \ 11874 UINT32_C(0x4) 11875 /* 11876 * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this port. 11877 * When set to 0, then FEC CLAUSE 74 (Fire Code) is not supported on this port. 11878 */ 11879 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED \ 11880 UINT32_C(0x8) 11881 /* 11882 * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this port. 11883 * When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if supported. 11884 * This flag should be ignored if FEC CLAUSE 74 is not supported on this port. 11885 */ 11886 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED \ 11887 UINT32_C(0x10) 11888 /* 11889 * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is supported on this port. 11890 * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is not supported on this port. 11891 */ 11892 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED \ 11893 UINT32_C(0x20) 11894 /* 11895 * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is enabled on this port. 11896 * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is disabled if supported. 11897 * This flag should be ignored if FEC CLAUSE 91 is not supported on this port. 11898 */ 11899 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED \ 11900 UINT32_C(0x40) 11901 /* 11902 * This value is indicates the duplex of the current 11903 * connection state. 11904 */ 11905 uint8_t duplex_state; 11906 /* Half Duplex connection. */ 11907 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0) 11908 /* Full duplex connection. */ 11909 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1) 11910 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_LAST \ 11911 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL 11912 /* Option flags fields. */ 11913 uint8_t option_flags; 11914 /* When this bit is '1', Media auto detect is enabled. */ 11915 #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_MEDIA_AUTO_DETECT \ 11916 UINT32_C(0x1) 11917 /* 11918 * Up to 16 bytes of null padded ASCII string representing 11919 * PHY vendor. 11920 * If the string is set to null, then the vendor name is not 11921 * available. 11922 */ 11923 char phy_vendor_name[16]; 11924 /* 11925 * Up to 16 bytes of null padded ASCII string that 11926 * identifies vendor specific part number of the PHY. 11927 * If the string is set to null, then the vendor specific 11928 * part number is not available. 11929 */ 11930 char phy_vendor_partnumber[16]; 11931 uint8_t unused_2[7]; 11932 /* 11933 * This field is used in Output records to indicate that the output 11934 * is completely written to RAM. This field should be read as '1' 11935 * to indicate that the output has been completely written. 11936 * When writing a command completion or response to an internal processor, 11937 * the order of writes has to be such that this field is written last. 11938 */ 11939 uint8_t valid; 11940 } __attribute__((packed)); 11941 11942 /********************* 11943 * hwrm_port_mac_cfg * 11944 *********************/ 11945 11946 11947 /* hwrm_port_mac_cfg_input (size:320b/40B) */ 11948 struct hwrm_port_mac_cfg_input { 11949 /* The HWRM command request type. */ 11950 uint16_t req_type; 11951 /* 11952 * The completion ring to send the completion event on. This should 11953 * be the NQ ID returned from the `nq_alloc` HWRM command. 11954 */ 11955 uint16_t cmpl_ring; 11956 /* 11957 * The sequence ID is used by the driver for tracking multiple 11958 * commands. This ID is treated as opaque data by the firmware and 11959 * the value is returned in the `hwrm_resp_hdr` upon completion. 11960 */ 11961 uint16_t seq_id; 11962 /* 11963 * The target ID of the command: 11964 * * 0x0-0xFFF8 - The function ID 11965 * * 0xFFF8-0xFFFE - Reserved for internal processors 11966 * * 0xFFFF - HWRM 11967 */ 11968 uint16_t target_id; 11969 /* 11970 * A physical address pointer pointing to a host buffer that the 11971 * command's response data will be written. This can be either a host 11972 * physical address (HPA) or a guest physical address (GPA) and must 11973 * point to a physically contiguous block of memory. 11974 */ 11975 uint64_t resp_addr; 11976 /* 11977 * In this field, there are a number of CoS mappings related flags 11978 * that are used to configure CoS mappings and their corresponding 11979 * priorities in the hardware. 11980 * For the priorities of CoS mappings, the HWRM uses the following 11981 * priority order (high to low) by default: 11982 * # vlan pri 11983 * # ip_dscp 11984 * # tunnel_vlan_pri 11985 * # default cos 11986 * 11987 * A subset of CoS mappings can be enabled. 11988 * If a priority is not specified for an enabled CoS mapping, the 11989 * priority will be assigned in the above order for the enabled CoS 11990 * mappings. For example, if vlan_pri and ip_dscp CoS mappings are 11991 * enabled and their priorities are not specified, the following 11992 * priority order (high to low) will be used by the HWRM: 11993 * # vlan_pri 11994 * # ip_dscp 11995 * # default cos 11996 * 11997 * vlan_pri CoS mapping together with default CoS with lower priority 11998 * are enabled by default by the HWRM. 11999 */ 12000 uint32_t flags; 12001 /* 12002 * When this bit is '1', this command will configure 12003 * the MAC to match the current link state of the PHY. 12004 * If the link is not established on the PHY, then this 12005 * bit has no effect. 12006 */ 12007 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK \ 12008 UINT32_C(0x1) 12009 /* 12010 * When this bit is set to '1', the inner VLAN PRI to CoS mapping 12011 * is requested to be enabled. 12012 */ 12013 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE \ 12014 UINT32_C(0x2) 12015 /* 12016 * When this bit is set to '1', tunnel VLAN PRI field to 12017 * CoS mapping is requested to be enabled. 12018 */ 12019 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \ 12020 UINT32_C(0x4) 12021 /* 12022 * When this bit is set to '1', the IP DSCP to CoS mapping is 12023 * requested to be enabled. 12024 */ 12025 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE \ 12026 UINT32_C(0x8) 12027 /* 12028 * When this bit is '1', the HWRM is requested to 12029 * enable timestamp capture capability on the receive side 12030 * of this port. 12031 */ 12032 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \ 12033 UINT32_C(0x10) 12034 /* 12035 * When this bit is '1', the HWRM is requested to 12036 * disable timestamp capture capability on the receive side 12037 * of this port. 12038 */ 12039 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE \ 12040 UINT32_C(0x20) 12041 /* 12042 * When this bit is '1', the HWRM is requested to 12043 * enable timestamp capture capability on the transmit side 12044 * of this port. 12045 */ 12046 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \ 12047 UINT32_C(0x40) 12048 /* 12049 * When this bit is '1', the HWRM is requested to 12050 * disable timestamp capture capability on the transmit side 12051 * of this port. 12052 */ 12053 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE \ 12054 UINT32_C(0x80) 12055 /* 12056 * When this bit is '1', the Out-Of-Box WoL is requested to 12057 * be enabled on this port. 12058 */ 12059 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE \ 12060 UINT32_C(0x100) 12061 /* 12062 * When this bit is '1', the the Out-Of-Box WoL is requested to 12063 * be disabled on this port. 12064 */ 12065 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE \ 12066 UINT32_C(0x200) 12067 /* 12068 * When this bit is set to '1', the inner VLAN PRI to CoS mapping 12069 * is requested to be disabled. 12070 */ 12071 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE \ 12072 UINT32_C(0x400) 12073 /* 12074 * When this bit is set to '1', tunnel VLAN PRI field to 12075 * CoS mapping is requested to be disabled. 12076 */ 12077 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE \ 12078 UINT32_C(0x800) 12079 /* 12080 * When this bit is set to '1', the IP DSCP to CoS mapping is 12081 * requested to be disabled. 12082 */ 12083 #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE \ 12084 UINT32_C(0x1000) 12085 uint32_t enables; 12086 /* 12087 * This bit must be '1' for the ipg field to be 12088 * configured. 12089 */ 12090 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG \ 12091 UINT32_C(0x1) 12092 /* 12093 * This bit must be '1' for the lpbk field to be 12094 * configured. 12095 */ 12096 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK \ 12097 UINT32_C(0x2) 12098 /* 12099 * This bit must be '1' for the vlan_pri2cos_map_pri field to be 12100 * configured. 12101 */ 12102 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI \ 12103 UINT32_C(0x4) 12104 /* 12105 * This bit must be '1' for the tunnel_pri2cos_map_pri field to be 12106 * configured. 12107 */ 12108 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI \ 12109 UINT32_C(0x10) 12110 /* 12111 * This bit must be '1' for the dscp2cos_map_pri field to be 12112 * configured. 12113 */ 12114 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI \ 12115 UINT32_C(0x20) 12116 /* 12117 * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to be 12118 * configured. 12119 */ 12120 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE \ 12121 UINT32_C(0x40) 12122 /* 12123 * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to be 12124 * configured. 12125 */ 12126 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE \ 12127 UINT32_C(0x80) 12128 /* 12129 * This bit must be '1' for the cos_field_cfg field to be 12130 * configured. 12131 */ 12132 #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG \ 12133 UINT32_C(0x100) 12134 /* Port ID of port that is to be configured. */ 12135 uint16_t port_id; 12136 /* 12137 * This value is used to configure the minimum IPG that will 12138 * be sent between packets by this port. 12139 */ 12140 uint8_t ipg; 12141 /* This value controls the loopback setting for the MAC. */ 12142 uint8_t lpbk; 12143 /* No loopback is selected. Normal operation. */ 12144 #define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE UINT32_C(0x0) 12145 /* 12146 * The HW will be configured with local loopback such that 12147 * host data is sent back to the host without modification. 12148 */ 12149 #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL UINT32_C(0x1) 12150 /* 12151 * The HW will be configured with remote loopback such that 12152 * port logic will send packets back out the transmitter that 12153 * are received. 12154 */ 12155 #define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2) 12156 #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LAST \ 12157 HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE 12158 /* 12159 * This value controls the priority setting of VLAN PRI to CoS 12160 * mapping based on VLAN Tags of inner packet headers of 12161 * tunneled packets or packet headers of non-tunneled packets. 12162 * 12163 * # Each XXX_pri variable shall have a unique priority value 12164 * when it is being specified. 12165 * # When comparing priorities of mappings, higher value 12166 * indicates higher priority. 12167 * For example, a value of 0-3 is returned where 0 is being 12168 * the lowest priority and 3 is being the highest priority. 12169 */ 12170 uint8_t vlan_pri2cos_map_pri; 12171 /* Reserved field. */ 12172 uint8_t reserved1; 12173 /* 12174 * This value controls the priority setting of VLAN PRI to CoS 12175 * mapping based on VLAN Tags of tunneled header. 12176 * This mapping only applies when tunneled headers 12177 * are present. 12178 * 12179 * # Each XXX_pri variable shall have a unique priority value 12180 * when it is being specified. 12181 * # When comparing priorities of mappings, higher value 12182 * indicates higher priority. 12183 * For example, a value of 0-3 is returned where 0 is being 12184 * the lowest priority and 3 is being the highest priority. 12185 */ 12186 uint8_t tunnel_pri2cos_map_pri; 12187 /* 12188 * This value controls the priority setting of IP DSCP to CoS 12189 * mapping based on inner IP header of tunneled packets or 12190 * IP header of non-tunneled packets. 12191 * 12192 * # Each XXX_pri variable shall have a unique priority value 12193 * when it is being specified. 12194 * # When comparing priorities of mappings, higher value 12195 * indicates higher priority. 12196 * For example, a value of 0-3 is returned where 0 is being 12197 * the lowest priority and 3 is being the highest priority. 12198 */ 12199 uint8_t dscp2pri_map_pri; 12200 /* 12201 * This is a 16-bit bit mask that is used to request a 12202 * specific configuration of time stamp capture of PTP messages 12203 * on the receive side of this port. 12204 * This field shall be ignored if the ptp_rx_ts_capture_enable 12205 * flag is not set in this command. 12206 * Otherwise, if bit 'i' is set, then the HWRM is being 12207 * requested to configure the receive side of the port to 12208 * capture the time stamp of every received PTP message 12209 * with messageType field value set to i. 12210 */ 12211 uint16_t rx_ts_capture_ptp_msg_type; 12212 /* 12213 * This is a 16-bit bit mask that is used to request a 12214 * specific configuration of time stamp capture of PTP messages 12215 * on the transmit side of this port. 12216 * This field shall be ignored if the ptp_tx_ts_capture_enable 12217 * flag is not set in this command. 12218 * Otherwise, if bit 'i' is set, then the HWRM is being 12219 * requested to configure the transmit sied of the port to 12220 * capture the time stamp of every transmitted PTP message 12221 * with messageType field value set to i. 12222 */ 12223 uint16_t tx_ts_capture_ptp_msg_type; 12224 /* Configuration of CoS fields. */ 12225 uint8_t cos_field_cfg; 12226 /* Reserved */ 12227 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1 \ 12228 UINT32_C(0x1) 12229 /* 12230 * This field is used to specify selection of VLAN PRI value 12231 * based on whether one or two VLAN Tags are present in 12232 * the inner packet headers of tunneled packets or 12233 * non-tunneled packets. 12234 * This field is valid only if inner VLAN PRI to CoS mapping 12235 * is enabled. 12236 * If VLAN PRI to CoS mapping is not enabled, then this 12237 * field shall be ignored. 12238 */ 12239 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \ 12240 UINT32_C(0x6) 12241 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \ 12242 1 12243 /* 12244 * Select inner VLAN PRI when 1 or 2 VLAN Tags are 12245 * present in the inner packet headers 12246 */ 12247 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \ 12248 (UINT32_C(0x0) << 1) 12249 /* 12250 * Select outer VLAN Tag PRI when 2 VLAN Tags are 12251 * present in the inner packet headers. 12252 * No VLAN PRI shall be selected for this configuration 12253 * if only one VLAN Tag is present in the inner 12254 * packet headers. 12255 */ 12256 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \ 12257 (UINT32_C(0x1) << 1) 12258 /* 12259 * Select outermost VLAN PRI when 1 or 2 VLAN Tags 12260 * are present in the inner packet headers 12261 */ 12262 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \ 12263 (UINT32_C(0x2) << 1) 12264 /* Unspecified */ 12265 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \ 12266 (UINT32_C(0x3) << 1) 12267 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \ 12268 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED 12269 /* 12270 * This field is used to specify selection of tunnel VLAN 12271 * PRI value based on whether one or two VLAN Tags are 12272 * present in tunnel headers. 12273 * This field is valid only if tunnel VLAN PRI to CoS mapping 12274 * is enabled. 12275 * If tunnel VLAN PRI to CoS mapping is not enabled, then this 12276 * field shall be ignored. 12277 */ 12278 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \ 12279 UINT32_C(0x18) 12280 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \ 12281 3 12282 /* 12283 * Select inner VLAN PRI when 1 or 2 VLAN Tags are 12284 * present in the tunnel packet headers 12285 */ 12286 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \ 12287 (UINT32_C(0x0) << 3) 12288 /* 12289 * Select outer VLAN Tag PRI when 2 VLAN Tags are 12290 * present in the tunnel packet headers. 12291 * No tunnel VLAN PRI shall be selected for this 12292 * configuration if only one VLAN Tag is present in 12293 * the tunnel packet headers. 12294 */ 12295 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \ 12296 (UINT32_C(0x1) << 3) 12297 /* 12298 * Select outermost VLAN PRI when 1 or 2 VLAN Tags 12299 * are present in the tunnel packet headers 12300 */ 12301 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \ 12302 (UINT32_C(0x2) << 3) 12303 /* Unspecified */ 12304 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \ 12305 (UINT32_C(0x3) << 3) 12306 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \ 12307 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED 12308 /* 12309 * This field shall be used to provide default CoS value 12310 * that has been configured on this port. 12311 * This field is valid only if default CoS mapping 12312 * is enabled. 12313 * If default CoS mapping is not enabled, then this 12314 * field shall be ignored. 12315 */ 12316 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \ 12317 UINT32_C(0xe0) 12318 #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \ 12319 5 12320 uint8_t unused_0[3]; 12321 } __attribute__((packed)); 12322 12323 /* hwrm_port_mac_cfg_output (size:128b/16B) */ 12324 struct hwrm_port_mac_cfg_output { 12325 /* The specific error status for the command. */ 12326 uint16_t error_code; 12327 /* The HWRM command request type. */ 12328 uint16_t req_type; 12329 /* The sequence ID from the original command. */ 12330 uint16_t seq_id; 12331 /* The length of the response data in number of bytes. */ 12332 uint16_t resp_len; 12333 /* 12334 * This is the configured maximum length of Ethernet packet 12335 * payload that is allowed to be received on the port. 12336 * This value does not include the number of bytes used by 12337 * Ethernet header and trailer (CRC). 12338 */ 12339 uint16_t mru; 12340 /* 12341 * This is the configured maximum length of Ethernet packet 12342 * payload that is allowed to be transmitted on the port. 12343 * This value does not include the number of bytes used by 12344 * Ethernet header and trailer (CRC). 12345 */ 12346 uint16_t mtu; 12347 /* Current configuration of the IPG value. */ 12348 uint8_t ipg; 12349 /* Current value of the loopback value. */ 12350 uint8_t lpbk; 12351 /* No loopback is selected. Normal operation. */ 12352 #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE UINT32_C(0x0) 12353 /* 12354 * The HW will be configured with local loopback such that 12355 * host data is sent back to the host without modification. 12356 */ 12357 #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL UINT32_C(0x1) 12358 /* 12359 * The HW will be configured with remote loopback such that 12360 * port logic will send packets back out the transmitter that 12361 * are received. 12362 */ 12363 #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2) 12364 #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LAST \ 12365 HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE 12366 uint8_t unused_0; 12367 /* 12368 * This field is used in Output records to indicate that the output 12369 * is completely written to RAM. This field should be read as '1' 12370 * to indicate that the output has been completely written. 12371 * When writing a command completion or response to an internal processor, 12372 * the order of writes has to be such that this field is written last. 12373 */ 12374 uint8_t valid; 12375 } __attribute__((packed)); 12376 12377 /********************** 12378 * hwrm_port_mac_qcfg * 12379 **********************/ 12380 12381 12382 /* hwrm_port_mac_qcfg_input (size:192b/24B) */ 12383 struct hwrm_port_mac_qcfg_input { 12384 /* The HWRM command request type. */ 12385 uint16_t req_type; 12386 /* 12387 * The completion ring to send the completion event on. This should 12388 * be the NQ ID returned from the `nq_alloc` HWRM command. 12389 */ 12390 uint16_t cmpl_ring; 12391 /* 12392 * The sequence ID is used by the driver for tracking multiple 12393 * commands. This ID is treated as opaque data by the firmware and 12394 * the value is returned in the `hwrm_resp_hdr` upon completion. 12395 */ 12396 uint16_t seq_id; 12397 /* 12398 * The target ID of the command: 12399 * * 0x0-0xFFF8 - The function ID 12400 * * 0xFFF8-0xFFFE - Reserved for internal processors 12401 * * 0xFFFF - HWRM 12402 */ 12403 uint16_t target_id; 12404 /* 12405 * A physical address pointer pointing to a host buffer that the 12406 * command's response data will be written. This can be either a host 12407 * physical address (HPA) or a guest physical address (GPA) and must 12408 * point to a physically contiguous block of memory. 12409 */ 12410 uint64_t resp_addr; 12411 /* Port ID of port that is to be configured. */ 12412 uint16_t port_id; 12413 uint8_t unused_0[6]; 12414 } __attribute__((packed)); 12415 12416 /* hwrm_port_mac_qcfg_output (size:192b/24B) */ 12417 struct hwrm_port_mac_qcfg_output { 12418 /* The specific error status for the command. */ 12419 uint16_t error_code; 12420 /* The HWRM command request type. */ 12421 uint16_t req_type; 12422 /* The sequence ID from the original command. */ 12423 uint16_t seq_id; 12424 /* The length of the response data in number of bytes. */ 12425 uint16_t resp_len; 12426 /* 12427 * This is the configured maximum length of Ethernet packet 12428 * payload that is allowed to be received on the port. 12429 * This value does not include the number of bytes used by the 12430 * Ethernet header and trailer (CRC). 12431 */ 12432 uint16_t mru; 12433 /* 12434 * This is the configured maximum length of Ethernet packet 12435 * payload that is allowed to be transmitted on the port. 12436 * This value does not include the number of bytes used by the 12437 * Ethernet header and trailer (CRC). 12438 */ 12439 uint16_t mtu; 12440 /* 12441 * The minimum IPG that will 12442 * be sent between packets by this port. 12443 */ 12444 uint8_t ipg; 12445 /* The loopback setting for the MAC. */ 12446 uint8_t lpbk; 12447 /* No loopback is selected. Normal operation. */ 12448 #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE UINT32_C(0x0) 12449 /* 12450 * The HW will be configured with local loopback such that 12451 * host data is sent back to the host without modification. 12452 */ 12453 #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL UINT32_C(0x1) 12454 /* 12455 * The HW will be configured with remote loopback such that 12456 * port logic will send packets back out the transmitter that 12457 * are received. 12458 */ 12459 #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2) 12460 #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LAST \ 12461 HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE 12462 /* 12463 * Priority setting for VLAN PRI to CoS mapping. 12464 * # Each XXX_pri variable shall have a unique priority value 12465 * when it is being used. 12466 * # When comparing priorities of mappings, higher value 12467 * indicates higher priority. 12468 * For example, a value of 0-3 is returned where 0 is being 12469 * the lowest priority and 3 is being the highest priority. 12470 * # If the correspoding CoS mapping is not enabled, then this 12471 * field should be ignored. 12472 * # This value indicates the normalized priority value retained 12473 * in the HWRM. 12474 */ 12475 uint8_t vlan_pri2cos_map_pri; 12476 /* 12477 * In this field, a number of CoS mappings related flags 12478 * are used to indicate configured CoS mappings. 12479 */ 12480 uint8_t flags; 12481 /* 12482 * When this bit is set to '1', the inner VLAN PRI to CoS mapping 12483 * is enabled. 12484 */ 12485 #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE \ 12486 UINT32_C(0x1) 12487 /* 12488 * When this bit is set to '1', tunnel VLAN PRI field to 12489 * CoS mapping is enabled. 12490 */ 12491 #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \ 12492 UINT32_C(0x2) 12493 /* 12494 * When this bit is set to '1', the IP DSCP to CoS mapping is 12495 * enabled. 12496 */ 12497 #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE \ 12498 UINT32_C(0x4) 12499 /* 12500 * When this bit is '1', the Out-Of-Box WoL is enabled on this 12501 * port. 12502 */ 12503 #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE \ 12504 UINT32_C(0x8) 12505 /* When this bit is '1', PTP is enabled for RX on this port. */ 12506 #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \ 12507 UINT32_C(0x10) 12508 /* When this bit is '1', PTP is enabled for TX on this port. */ 12509 #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \ 12510 UINT32_C(0x20) 12511 /* 12512 * Priority setting for tunnel VLAN PRI to CoS mapping. 12513 * # Each XXX_pri variable shall have a unique priority value 12514 * when it is being used. 12515 * # When comparing priorities of mappings, higher value 12516 * indicates higher priority. 12517 * For example, a value of 0-3 is returned where 0 is being 12518 * the lowest priority and 3 is being the highest priority. 12519 * # If the correspoding CoS mapping is not enabled, then this 12520 * field should be ignored. 12521 * # This value indicates the normalized priority value retained 12522 * in the HWRM. 12523 */ 12524 uint8_t tunnel_pri2cos_map_pri; 12525 /* 12526 * Priority setting for DSCP to PRI mapping. 12527 * # Each XXX_pri variable shall have a unique priority value 12528 * when it is being used. 12529 * # When comparing priorities of mappings, higher value 12530 * indicates higher priority. 12531 * For example, a value of 0-3 is returned where 0 is being 12532 * the lowest priority and 3 is being the highest priority. 12533 * # If the correspoding CoS mapping is not enabled, then this 12534 * field should be ignored. 12535 * # This value indicates the normalized priority value retained 12536 * in the HWRM. 12537 */ 12538 uint8_t dscp2pri_map_pri; 12539 /* 12540 * This is a 16-bit bit mask that represents the 12541 * current configuration of time stamp capture of PTP messages 12542 * on the receive side of this port. 12543 * If bit 'i' is set, then the receive side of the port 12544 * is configured to capture the time stamp of every 12545 * received PTP message with messageType field value set 12546 * to i. 12547 * If all bits are set to 0 (i.e. field value set 0), 12548 * then the receive side of the port is not configured 12549 * to capture timestamp for PTP messages. 12550 * If all bits are set to 1, then the receive side of the 12551 * port is configured to capture timestamp for all PTP 12552 * messages. 12553 */ 12554 uint16_t rx_ts_capture_ptp_msg_type; 12555 /* 12556 * This is a 16-bit bit mask that represents the 12557 * current configuration of time stamp capture of PTP messages 12558 * on the transmit side of this port. 12559 * If bit 'i' is set, then the transmit side of the port 12560 * is configured to capture the time stamp of every 12561 * received PTP message with messageType field value set 12562 * to i. 12563 * If all bits are set to 0 (i.e. field value set 0), 12564 * then the transmit side of the port is not configured 12565 * to capture timestamp for PTP messages. 12566 * If all bits are set to 1, then the transmit side of the 12567 * port is configured to capture timestamp for all PTP 12568 * messages. 12569 */ 12570 uint16_t tx_ts_capture_ptp_msg_type; 12571 /* Configuration of CoS fields. */ 12572 uint8_t cos_field_cfg; 12573 /* Reserved */ 12574 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD \ 12575 UINT32_C(0x1) 12576 /* 12577 * This field is used for selecting VLAN PRI value 12578 * based on whether one or two VLAN Tags are present in 12579 * the inner packet headers of tunneled packets or 12580 * non-tunneled packets. 12581 */ 12582 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \ 12583 UINT32_C(0x6) 12584 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \ 12585 1 12586 /* 12587 * Select inner VLAN PRI when 1 or 2 VLAN Tags are 12588 * present in the inner packet headers 12589 */ 12590 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \ 12591 (UINT32_C(0x0) << 1) 12592 /* 12593 * Select outer VLAN Tag PRI when 2 VLAN Tags are 12594 * present in the inner packet headers. 12595 * No VLAN PRI is selected for this configuration 12596 * if only one VLAN Tag is present in the inner 12597 * packet headers. 12598 */ 12599 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \ 12600 (UINT32_C(0x1) << 1) 12601 /* 12602 * Select outermost VLAN PRI when 1 or 2 VLAN Tags 12603 * are present in the inner packet headers 12604 */ 12605 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \ 12606 (UINT32_C(0x2) << 1) 12607 /* Unspecified */ 12608 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \ 12609 (UINT32_C(0x3) << 1) 12610 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \ 12611 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED 12612 /* 12613 * This field is used for selecting tunnel VLAN PRI value 12614 * based on whether one or two VLAN Tags are present in 12615 * the tunnel headers of tunneled packets. This selection 12616 * does not apply to non-tunneled packets. 12617 */ 12618 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \ 12619 UINT32_C(0x18) 12620 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \ 12621 3 12622 /* 12623 * Select inner VLAN PRI when 1 or 2 VLAN Tags are 12624 * present in the tunnel packet headers 12625 */ 12626 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \ 12627 (UINT32_C(0x0) << 3) 12628 /* 12629 * Select outer VLAN Tag PRI when 2 VLAN Tags are 12630 * present in the tunnel packet headers. 12631 * No VLAN PRI is selected for this configuration 12632 * if only one VLAN Tag is present in the tunnel 12633 * packet headers. 12634 */ 12635 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \ 12636 (UINT32_C(0x1) << 3) 12637 /* 12638 * Select outermost VLAN PRI when 1 or 2 VLAN Tags 12639 * are present in the tunnel packet headers 12640 */ 12641 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \ 12642 (UINT32_C(0x2) << 3) 12643 /* Unspecified */ 12644 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \ 12645 (UINT32_C(0x3) << 3) 12646 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \ 12647 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED 12648 /* 12649 * This field is used to provide default CoS value that 12650 * has been configured on this port. 12651 */ 12652 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \ 12653 UINT32_C(0xe0) 12654 #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \ 12655 5 12656 /* 12657 * This field is used in Output records to indicate that the output 12658 * is completely written to RAM. This field should be read as '1' 12659 * to indicate that the output has been completely written. 12660 * When writing a command completion or response to an internal processor, 12661 * the order of writes has to be such that this field is written last. 12662 */ 12663 uint8_t valid; 12664 } __attribute__((packed)); 12665 12666 /************************** 12667 * hwrm_port_mac_ptp_qcfg * 12668 **************************/ 12669 12670 12671 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */ 12672 struct hwrm_port_mac_ptp_qcfg_input { 12673 /* The HWRM command request type. */ 12674 uint16_t req_type; 12675 /* 12676 * The completion ring to send the completion event on. This should 12677 * be the NQ ID returned from the `nq_alloc` HWRM command. 12678 */ 12679 uint16_t cmpl_ring; 12680 /* 12681 * The sequence ID is used by the driver for tracking multiple 12682 * commands. This ID is treated as opaque data by the firmware and 12683 * the value is returned in the `hwrm_resp_hdr` upon completion. 12684 */ 12685 uint16_t seq_id; 12686 /* 12687 * The target ID of the command: 12688 * * 0x0-0xFFF8 - The function ID 12689 * * 0xFFF8-0xFFFE - Reserved for internal processors 12690 * * 0xFFFF - HWRM 12691 */ 12692 uint16_t target_id; 12693 /* 12694 * A physical address pointer pointing to a host buffer that the 12695 * command's response data will be written. This can be either a host 12696 * physical address (HPA) or a guest physical address (GPA) and must 12697 * point to a physically contiguous block of memory. 12698 */ 12699 uint64_t resp_addr; 12700 /* Port ID of port that is being queried. */ 12701 uint16_t port_id; 12702 uint8_t unused_0[6]; 12703 } __attribute__((packed)); 12704 12705 /* hwrm_port_mac_ptp_qcfg_output (size:640b/80B) */ 12706 struct hwrm_port_mac_ptp_qcfg_output { 12707 /* The specific error status for the command. */ 12708 uint16_t error_code; 12709 /* The HWRM command request type. */ 12710 uint16_t req_type; 12711 /* The sequence ID from the original command. */ 12712 uint16_t seq_id; 12713 /* The length of the response data in number of bytes. */ 12714 uint16_t resp_len; 12715 /* 12716 * In this field, a number of PTP related flags 12717 * are used to indicate configured PTP capabilities. 12718 */ 12719 uint8_t flags; 12720 /* 12721 * When this bit is set to '1', the PTP related registers are 12722 * directly accessible by the host. 12723 */ 12724 #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS \ 12725 UINT32_C(0x1) 12726 /* 12727 * When this bit is set to '1', the PTP information is accessible 12728 * via HWRM commands. 12729 */ 12730 #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS \ 12731 UINT32_C(0x2) 12732 uint8_t unused_0[3]; 12733 /* Offset of the PTP register for the lower 32 bits of timestamp for RX. */ 12734 uint32_t rx_ts_reg_off_lower; 12735 /* Offset of the PTP register for the upper 32 bits of timestamp for RX. */ 12736 uint32_t rx_ts_reg_off_upper; 12737 /* Offset of the PTP register for the sequence ID for RX. */ 12738 uint32_t rx_ts_reg_off_seq_id; 12739 /* Offset of the first PTP source ID for RX. */ 12740 uint32_t rx_ts_reg_off_src_id_0; 12741 /* Offset of the second PTP source ID for RX. */ 12742 uint32_t rx_ts_reg_off_src_id_1; 12743 /* Offset of the third PTP source ID for RX. */ 12744 uint32_t rx_ts_reg_off_src_id_2; 12745 /* Offset of the domain ID for RX. */ 12746 uint32_t rx_ts_reg_off_domain_id; 12747 /* Offset of the PTP FIFO register for RX. */ 12748 uint32_t rx_ts_reg_off_fifo; 12749 /* Offset of the PTP advance FIFO register for RX. */ 12750 uint32_t rx_ts_reg_off_fifo_adv; 12751 /* PTP timestamp granularity for RX. */ 12752 uint32_t rx_ts_reg_off_granularity; 12753 /* Offset of the PTP register for the lower 32 bits of timestamp for TX. */ 12754 uint32_t tx_ts_reg_off_lower; 12755 /* Offset of the PTP register for the upper 32 bits of timestamp for TX. */ 12756 uint32_t tx_ts_reg_off_upper; 12757 /* Offset of the PTP register for the sequence ID for TX. */ 12758 uint32_t tx_ts_reg_off_seq_id; 12759 /* Offset of the PTP FIFO register for TX. */ 12760 uint32_t tx_ts_reg_off_fifo; 12761 /* PTP timestamp granularity for TX. */ 12762 uint32_t tx_ts_reg_off_granularity; 12763 uint8_t unused_1[7]; 12764 /* 12765 * This field is used in Output records to indicate that the output 12766 * is completely written to RAM. This field should be read as '1' 12767 * to indicate that the output has been completely written. 12768 * When writing a command completion or response to an internal processor, 12769 * the order of writes has to be such that this field is written last. 12770 */ 12771 uint8_t valid; 12772 } __attribute__((packed)); 12773 12774 /* Port Tx Statistics Formats */ 12775 /* tx_port_stats (size:3264b/408B) */ 12776 struct tx_port_stats { 12777 /* Total Number of 64 Bytes frames transmitted */ 12778 uint64_t tx_64b_frames; 12779 /* Total Number of 65-127 Bytes frames transmitted */ 12780 uint64_t tx_65b_127b_frames; 12781 /* Total Number of 128-255 Bytes frames transmitted */ 12782 uint64_t tx_128b_255b_frames; 12783 /* Total Number of 256-511 Bytes frames transmitted */ 12784 uint64_t tx_256b_511b_frames; 12785 /* Total Number of 512-1023 Bytes frames transmitted */ 12786 uint64_t tx_512b_1023b_frames; 12787 /* Total Number of 1024-1518 Bytes frames transmitted */ 12788 uint64_t tx_1024b_1518b_frames; 12789 /* 12790 * Total Number of each good VLAN (exludes FCS errors) 12791 * frame transmitted which is 1519 to 1522 bytes in length 12792 * inclusive (excluding framing bits but including FCS bytes). 12793 */ 12794 uint64_t tx_good_vlan_frames; 12795 /* Total Number of 1519-2047 Bytes frames transmitted */ 12796 uint64_t tx_1519b_2047b_frames; 12797 /* Total Number of 2048-4095 Bytes frames transmitted */ 12798 uint64_t tx_2048b_4095b_frames; 12799 /* Total Number of 4096-9216 Bytes frames transmitted */ 12800 uint64_t tx_4096b_9216b_frames; 12801 /* Total Number of 9217-16383 Bytes frames transmitted */ 12802 uint64_t tx_9217b_16383b_frames; 12803 /* Total Number of good frames transmitted */ 12804 uint64_t tx_good_frames; 12805 /* Total Number of frames transmitted */ 12806 uint64_t tx_total_frames; 12807 /* Total number of unicast frames transmitted */ 12808 uint64_t tx_ucast_frames; 12809 /* Total number of multicast frames transmitted */ 12810 uint64_t tx_mcast_frames; 12811 /* Total number of broadcast frames transmitted */ 12812 uint64_t tx_bcast_frames; 12813 /* Total number of PAUSE control frames transmitted */ 12814 uint64_t tx_pause_frames; 12815 /* 12816 * Total number of PFC/per-priority PAUSE 12817 * control frames transmitted 12818 */ 12819 uint64_t tx_pfc_frames; 12820 /* Total number of jabber frames transmitted */ 12821 uint64_t tx_jabber_frames; 12822 /* Total number of frames transmitted with FCS error */ 12823 uint64_t tx_fcs_err_frames; 12824 /* Total number of control frames transmitted */ 12825 uint64_t tx_control_frames; 12826 /* Total number of over-sized frames transmitted */ 12827 uint64_t tx_oversz_frames; 12828 /* Total number of frames with single deferral */ 12829 uint64_t tx_single_dfrl_frames; 12830 /* Total number of frames with multiple deferrals */ 12831 uint64_t tx_multi_dfrl_frames; 12832 /* Total number of frames with single collision */ 12833 uint64_t tx_single_coll_frames; 12834 /* Total number of frames with multiple collisions */ 12835 uint64_t tx_multi_coll_frames; 12836 /* Total number of frames with late collisions */ 12837 uint64_t tx_late_coll_frames; 12838 /* Total number of frames with excessive collisions */ 12839 uint64_t tx_excessive_coll_frames; 12840 /* Total number of fragmented frames transmitted */ 12841 uint64_t tx_frag_frames; 12842 /* Total number of transmit errors */ 12843 uint64_t tx_err; 12844 /* Total number of single VLAN tagged frames transmitted */ 12845 uint64_t tx_tagged_frames; 12846 /* Total number of double VLAN tagged frames transmitted */ 12847 uint64_t tx_dbl_tagged_frames; 12848 /* Total number of runt frames transmitted */ 12849 uint64_t tx_runt_frames; 12850 /* Total number of TX FIFO under runs */ 12851 uint64_t tx_fifo_underruns; 12852 /* 12853 * Total number of PFC frames with PFC enabled bit for 12854 * Pri 0 transmitted 12855 */ 12856 uint64_t tx_pfc_ena_frames_pri0; 12857 /* 12858 * Total number of PFC frames with PFC enabled bit for 12859 * Pri 1 transmitted 12860 */ 12861 uint64_t tx_pfc_ena_frames_pri1; 12862 /* 12863 * Total number of PFC frames with PFC enabled bit for 12864 * Pri 2 transmitted 12865 */ 12866 uint64_t tx_pfc_ena_frames_pri2; 12867 /* 12868 * Total number of PFC frames with PFC enabled bit for 12869 * Pri 3 transmitted 12870 */ 12871 uint64_t tx_pfc_ena_frames_pri3; 12872 /* 12873 * Total number of PFC frames with PFC enabled bit for 12874 * Pri 4 transmitted 12875 */ 12876 uint64_t tx_pfc_ena_frames_pri4; 12877 /* 12878 * Total number of PFC frames with PFC enabled bit for 12879 * Pri 5 transmitted 12880 */ 12881 uint64_t tx_pfc_ena_frames_pri5; 12882 /* 12883 * Total number of PFC frames with PFC enabled bit for 12884 * Pri 6 transmitted 12885 */ 12886 uint64_t tx_pfc_ena_frames_pri6; 12887 /* 12888 * Total number of PFC frames with PFC enabled bit for 12889 * Pri 7 transmitted 12890 */ 12891 uint64_t tx_pfc_ena_frames_pri7; 12892 /* Total number of EEE LPI Events on TX */ 12893 uint64_t tx_eee_lpi_events; 12894 /* EEE LPI Duration Counter on TX */ 12895 uint64_t tx_eee_lpi_duration; 12896 /* 12897 * Total number of Link Level Flow Control (LLFC) messages 12898 * transmitted 12899 */ 12900 uint64_t tx_llfc_logical_msgs; 12901 /* Total number of HCFC messages transmitted */ 12902 uint64_t tx_hcfc_msgs; 12903 /* Total number of TX collisions */ 12904 uint64_t tx_total_collisions; 12905 /* Total number of transmitted bytes */ 12906 uint64_t tx_bytes; 12907 /* Total number of end-to-end HOL frames */ 12908 uint64_t tx_xthol_frames; 12909 /* Total Tx Drops per Port reported by STATS block */ 12910 uint64_t tx_stat_discard; 12911 /* Total Tx Error Drops per Port reported by STATS block */ 12912 uint64_t tx_stat_error; 12913 } __attribute__((packed)); 12914 12915 /* Port Rx Statistics Formats */ 12916 /* rx_port_stats (size:4224b/528B) */ 12917 struct rx_port_stats { 12918 /* Total Number of 64 Bytes frames received */ 12919 uint64_t rx_64b_frames; 12920 /* Total Number of 65-127 Bytes frames received */ 12921 uint64_t rx_65b_127b_frames; 12922 /* Total Number of 128-255 Bytes frames received */ 12923 uint64_t rx_128b_255b_frames; 12924 /* Total Number of 256-511 Bytes frames received */ 12925 uint64_t rx_256b_511b_frames; 12926 /* Total Number of 512-1023 Bytes frames received */ 12927 uint64_t rx_512b_1023b_frames; 12928 /* Total Number of 1024-1518 Bytes frames received */ 12929 uint64_t rx_1024b_1518b_frames; 12930 /* 12931 * Total Number of each good VLAN (exludes FCS errors) 12932 * frame received which is 1519 to 1522 bytes in length 12933 * inclusive (excluding framing bits but including FCS bytes). 12934 */ 12935 uint64_t rx_good_vlan_frames; 12936 /* Total Number of 1519-2047 Bytes frames received */ 12937 uint64_t rx_1519b_2047b_frames; 12938 /* Total Number of 2048-4095 Bytes frames received */ 12939 uint64_t rx_2048b_4095b_frames; 12940 /* Total Number of 4096-9216 Bytes frames received */ 12941 uint64_t rx_4096b_9216b_frames; 12942 /* Total Number of 9217-16383 Bytes frames received */ 12943 uint64_t rx_9217b_16383b_frames; 12944 /* Total number of frames received */ 12945 uint64_t rx_total_frames; 12946 /* Total number of unicast frames received */ 12947 uint64_t rx_ucast_frames; 12948 /* Total number of multicast frames received */ 12949 uint64_t rx_mcast_frames; 12950 /* Total number of broadcast frames received */ 12951 uint64_t rx_bcast_frames; 12952 /* Total number of received frames with FCS error */ 12953 uint64_t rx_fcs_err_frames; 12954 /* Total number of control frames received */ 12955 uint64_t rx_ctrl_frames; 12956 /* Total number of PAUSE frames received */ 12957 uint64_t rx_pause_frames; 12958 /* Total number of PFC frames received */ 12959 uint64_t rx_pfc_frames; 12960 /* 12961 * Total number of frames received with an unsupported 12962 * opcode 12963 */ 12964 uint64_t rx_unsupported_opcode_frames; 12965 /* 12966 * Total number of frames received with an unsupported 12967 * DA for pause and PFC 12968 */ 12969 uint64_t rx_unsupported_da_pausepfc_frames; 12970 /* Total number of frames received with an unsupported SA */ 12971 uint64_t rx_wrong_sa_frames; 12972 /* Total number of received packets with alignment error */ 12973 uint64_t rx_align_err_frames; 12974 /* Total number of received frames with out-of-range length */ 12975 uint64_t rx_oor_len_frames; 12976 /* Total number of received frames with error termination */ 12977 uint64_t rx_code_err_frames; 12978 /* 12979 * Total number of received frames with a false carrier is 12980 * detected during idle, as defined by RX_ER samples active 12981 * and RXD is 0xE. The event is reported along with the 12982 * statistics generated on the next received frame. Only 12983 * one false carrier condition can be detected and logged 12984 * between frames. 12985 * 12986 * Carrier event, valid for 10M/100M speed modes only. 12987 */ 12988 uint64_t rx_false_carrier_frames; 12989 /* Total number of over-sized frames received */ 12990 uint64_t rx_ovrsz_frames; 12991 /* Total number of jabber packets received */ 12992 uint64_t rx_jbr_frames; 12993 /* Total number of received frames with MTU error */ 12994 uint64_t rx_mtu_err_frames; 12995 /* Total number of received frames with CRC match */ 12996 uint64_t rx_match_crc_frames; 12997 /* Total number of frames received promiscuously */ 12998 uint64_t rx_promiscuous_frames; 12999 /* 13000 * Total number of received frames with one or two VLAN 13001 * tags 13002 */ 13003 uint64_t rx_tagged_frames; 13004 /* Total number of received frames with two VLAN tags */ 13005 uint64_t rx_double_tagged_frames; 13006 /* Total number of truncated frames received */ 13007 uint64_t rx_trunc_frames; 13008 /* Total number of good frames (without errors) received */ 13009 uint64_t rx_good_frames; 13010 /* 13011 * Total number of received PFC frames with transition from 13012 * XON to XOFF on Pri 0 13013 */ 13014 uint64_t rx_pfc_xon2xoff_frames_pri0; 13015 /* 13016 * Total number of received PFC frames with transition from 13017 * XON to XOFF on Pri 1 13018 */ 13019 uint64_t rx_pfc_xon2xoff_frames_pri1; 13020 /* 13021 * Total number of received PFC frames with transition from 13022 * XON to XOFF on Pri 2 13023 */ 13024 uint64_t rx_pfc_xon2xoff_frames_pri2; 13025 /* 13026 * Total number of received PFC frames with transition from 13027 * XON to XOFF on Pri 3 13028 */ 13029 uint64_t rx_pfc_xon2xoff_frames_pri3; 13030 /* 13031 * Total number of received PFC frames with transition from 13032 * XON to XOFF on Pri 4 13033 */ 13034 uint64_t rx_pfc_xon2xoff_frames_pri4; 13035 /* 13036 * Total number of received PFC frames with transition from 13037 * XON to XOFF on Pri 5 13038 */ 13039 uint64_t rx_pfc_xon2xoff_frames_pri5; 13040 /* 13041 * Total number of received PFC frames with transition from 13042 * XON to XOFF on Pri 6 13043 */ 13044 uint64_t rx_pfc_xon2xoff_frames_pri6; 13045 /* 13046 * Total number of received PFC frames with transition from 13047 * XON to XOFF on Pri 7 13048 */ 13049 uint64_t rx_pfc_xon2xoff_frames_pri7; 13050 /* 13051 * Total number of received PFC frames with PFC enabled 13052 * bit for Pri 0 13053 */ 13054 uint64_t rx_pfc_ena_frames_pri0; 13055 /* 13056 * Total number of received PFC frames with PFC enabled 13057 * bit for Pri 1 13058 */ 13059 uint64_t rx_pfc_ena_frames_pri1; 13060 /* 13061 * Total number of received PFC frames with PFC enabled 13062 * bit for Pri 2 13063 */ 13064 uint64_t rx_pfc_ena_frames_pri2; 13065 /* 13066 * Total number of received PFC frames with PFC enabled 13067 * bit for Pri 3 13068 */ 13069 uint64_t rx_pfc_ena_frames_pri3; 13070 /* 13071 * Total number of received PFC frames with PFC enabled 13072 * bit for Pri 4 13073 */ 13074 uint64_t rx_pfc_ena_frames_pri4; 13075 /* 13076 * Total number of received PFC frames with PFC enabled 13077 * bit for Pri 5 13078 */ 13079 uint64_t rx_pfc_ena_frames_pri5; 13080 /* 13081 * Total number of received PFC frames with PFC enabled 13082 * bit for Pri 6 13083 */ 13084 uint64_t rx_pfc_ena_frames_pri6; 13085 /* 13086 * Total number of received PFC frames with PFC enabled 13087 * bit for Pri 7 13088 */ 13089 uint64_t rx_pfc_ena_frames_pri7; 13090 /* Total Number of frames received with SCH CRC error */ 13091 uint64_t rx_sch_crc_err_frames; 13092 /* Total Number of under-sized frames received */ 13093 uint64_t rx_undrsz_frames; 13094 /* Total Number of fragmented frames received */ 13095 uint64_t rx_frag_frames; 13096 /* Total number of RX EEE LPI Events */ 13097 uint64_t rx_eee_lpi_events; 13098 /* EEE LPI Duration Counter on RX */ 13099 uint64_t rx_eee_lpi_duration; 13100 /* 13101 * Total number of physical type Link Level Flow Control 13102 * (LLFC) messages received 13103 */ 13104 uint64_t rx_llfc_physical_msgs; 13105 /* 13106 * Total number of logical type Link Level Flow Control 13107 * (LLFC) messages received 13108 */ 13109 uint64_t rx_llfc_logical_msgs; 13110 /* 13111 * Total number of logical type Link Level Flow Control 13112 * (LLFC) messages received with CRC error 13113 */ 13114 uint64_t rx_llfc_msgs_with_crc_err; 13115 /* Total number of HCFC messages received */ 13116 uint64_t rx_hcfc_msgs; 13117 /* Total number of HCFC messages received with CRC error */ 13118 uint64_t rx_hcfc_msgs_with_crc_err; 13119 /* Total number of received bytes */ 13120 uint64_t rx_bytes; 13121 /* Total number of bytes received in runt frames */ 13122 uint64_t rx_runt_bytes; 13123 /* Total number of runt frames received */ 13124 uint64_t rx_runt_frames; 13125 /* Total Rx Discards per Port reported by STATS block */ 13126 uint64_t rx_stat_discard; 13127 uint64_t rx_stat_err; 13128 } __attribute__((packed)); 13129 13130 /******************** 13131 * hwrm_port_qstats * 13132 ********************/ 13133 13134 13135 /* hwrm_port_qstats_input (size:320b/40B) */ 13136 struct hwrm_port_qstats_input { 13137 /* The HWRM command request type. */ 13138 uint16_t req_type; 13139 /* 13140 * The completion ring to send the completion event on. This should 13141 * be the NQ ID returned from the `nq_alloc` HWRM command. 13142 */ 13143 uint16_t cmpl_ring; 13144 /* 13145 * The sequence ID is used by the driver for tracking multiple 13146 * commands. This ID is treated as opaque data by the firmware and 13147 * the value is returned in the `hwrm_resp_hdr` upon completion. 13148 */ 13149 uint16_t seq_id; 13150 /* 13151 * The target ID of the command: 13152 * * 0x0-0xFFF8 - The function ID 13153 * * 0xFFF8-0xFFFE - Reserved for internal processors 13154 * * 0xFFFF - HWRM 13155 */ 13156 uint16_t target_id; 13157 /* 13158 * A physical address pointer pointing to a host buffer that the 13159 * command's response data will be written. This can be either a host 13160 * physical address (HPA) or a guest physical address (GPA) and must 13161 * point to a physically contiguous block of memory. 13162 */ 13163 uint64_t resp_addr; 13164 /* Port ID of port that is being queried. */ 13165 uint16_t port_id; 13166 uint8_t unused_0[6]; 13167 /* 13168 * This is the host address where 13169 * Tx port statistics will be stored 13170 */ 13171 uint64_t tx_stat_host_addr; 13172 /* 13173 * This is the host address where 13174 * Rx port statistics will be stored 13175 */ 13176 uint64_t rx_stat_host_addr; 13177 } __attribute__((packed)); 13178 13179 /* hwrm_port_qstats_output (size:128b/16B) */ 13180 struct hwrm_port_qstats_output { 13181 /* The specific error status for the command. */ 13182 uint16_t error_code; 13183 /* The HWRM command request type. */ 13184 uint16_t req_type; 13185 /* The sequence ID from the original command. */ 13186 uint16_t seq_id; 13187 /* The length of the response data in number of bytes. */ 13188 uint16_t resp_len; 13189 /* The size of TX port statistics block in bytes. */ 13190 uint16_t tx_stat_size; 13191 /* The size of RX port statistics block in bytes. */ 13192 uint16_t rx_stat_size; 13193 uint8_t unused_0[3]; 13194 /* 13195 * This field is used in Output records to indicate that the output 13196 * is completely written to RAM. This field should be read as '1' 13197 * to indicate that the output has been completely written. 13198 * When writing a command completion or response to an internal processor, 13199 * the order of writes has to be such that this field is written last. 13200 */ 13201 uint8_t valid; 13202 } __attribute__((packed)); 13203 13204 /* Port Tx Statistics extended Formats */ 13205 /* tx_port_stats_ext (size:2048b/256B) */ 13206 struct tx_port_stats_ext { 13207 /* Total number of tx bytes count on cos queue 0 */ 13208 uint64_t tx_bytes_cos0; 13209 /* Total number of tx bytes count on cos queue 1 */ 13210 uint64_t tx_bytes_cos1; 13211 /* Total number of tx bytes count on cos queue 2 */ 13212 uint64_t tx_bytes_cos2; 13213 /* Total number of tx bytes count on cos queue 3 */ 13214 uint64_t tx_bytes_cos3; 13215 /* Total number of tx bytes count on cos queue 4 */ 13216 uint64_t tx_bytes_cos4; 13217 /* Total number of tx bytes count on cos queue 5 */ 13218 uint64_t tx_bytes_cos5; 13219 /* Total number of tx bytes count on cos queue 6 */ 13220 uint64_t tx_bytes_cos6; 13221 /* Total number of tx bytes count on cos queue 7 */ 13222 uint64_t tx_bytes_cos7; 13223 /* Total number of tx packets count on cos queue 0 */ 13224 uint64_t tx_packets_cos0; 13225 /* Total number of tx packets count on cos queue 1 */ 13226 uint64_t tx_packets_cos1; 13227 /* Total number of tx packets count on cos queue 2 */ 13228 uint64_t tx_packets_cos2; 13229 /* Total number of tx packets count on cos queue 3 */ 13230 uint64_t tx_packets_cos3; 13231 /* Total number of tx packets count on cos queue 4 */ 13232 uint64_t tx_packets_cos4; 13233 /* Total number of tx packets count on cos queue 5 */ 13234 uint64_t tx_packets_cos5; 13235 /* Total number of tx packets count on cos queue 6 */ 13236 uint64_t tx_packets_cos6; 13237 /* Total number of tx packets count on cos queue 7 */ 13238 uint64_t tx_packets_cos7; 13239 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */ 13240 uint64_t pfc_pri0_tx_duration_us; 13241 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */ 13242 uint64_t pfc_pri0_tx_transitions; 13243 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */ 13244 uint64_t pfc_pri1_tx_duration_us; 13245 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */ 13246 uint64_t pfc_pri1_tx_transitions; 13247 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */ 13248 uint64_t pfc_pri2_tx_duration_us; 13249 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */ 13250 uint64_t pfc_pri2_tx_transitions; 13251 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */ 13252 uint64_t pfc_pri3_tx_duration_us; 13253 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */ 13254 uint64_t pfc_pri3_tx_transitions; 13255 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */ 13256 uint64_t pfc_pri4_tx_duration_us; 13257 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */ 13258 uint64_t pfc_pri4_tx_transitions; 13259 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */ 13260 uint64_t pfc_pri5_tx_duration_us; 13261 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */ 13262 uint64_t pfc_pri5_tx_transitions; 13263 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */ 13264 uint64_t pfc_pri6_tx_duration_us; 13265 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */ 13266 uint64_t pfc_pri6_tx_transitions; 13267 /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */ 13268 uint64_t pfc_pri7_tx_duration_us; 13269 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */ 13270 uint64_t pfc_pri7_tx_transitions; 13271 } __attribute__((packed)); 13272 13273 /* Port Rx Statistics extended Formats */ 13274 /* rx_port_stats_ext (size:2368b/296B) */ 13275 struct rx_port_stats_ext { 13276 /* Number of times link state changed to down */ 13277 uint64_t link_down_events; 13278 /* Number of times the idle rings with pause bit are found */ 13279 uint64_t continuous_pause_events; 13280 /* Number of times the active rings pause bit resumed back */ 13281 uint64_t resume_pause_events; 13282 /* Number of times, the ROCE cos queue PFC is disabled to avoid pause flood/burst */ 13283 uint64_t continuous_roce_pause_events; 13284 /* Number of times, the ROCE cos queue PFC is enabled back */ 13285 uint64_t resume_roce_pause_events; 13286 /* Total number of rx bytes count on cos queue 0 */ 13287 uint64_t rx_bytes_cos0; 13288 /* Total number of rx bytes count on cos queue 1 */ 13289 uint64_t rx_bytes_cos1; 13290 /* Total number of rx bytes count on cos queue 2 */ 13291 uint64_t rx_bytes_cos2; 13292 /* Total number of rx bytes count on cos queue 3 */ 13293 uint64_t rx_bytes_cos3; 13294 /* Total number of rx bytes count on cos queue 4 */ 13295 uint64_t rx_bytes_cos4; 13296 /* Total number of rx bytes count on cos queue 5 */ 13297 uint64_t rx_bytes_cos5; 13298 /* Total number of rx bytes count on cos queue 6 */ 13299 uint64_t rx_bytes_cos6; 13300 /* Total number of rx bytes count on cos queue 7 */ 13301 uint64_t rx_bytes_cos7; 13302 /* Total number of rx packets count on cos queue 0 */ 13303 uint64_t rx_packets_cos0; 13304 /* Total number of rx packets count on cos queue 1 */ 13305 uint64_t rx_packets_cos1; 13306 /* Total number of rx packets count on cos queue 2 */ 13307 uint64_t rx_packets_cos2; 13308 /* Total number of rx packets count on cos queue 3 */ 13309 uint64_t rx_packets_cos3; 13310 /* Total number of rx packets count on cos queue 4 */ 13311 uint64_t rx_packets_cos4; 13312 /* Total number of rx packets count on cos queue 5 */ 13313 uint64_t rx_packets_cos5; 13314 /* Total number of rx packets count on cos queue 6 */ 13315 uint64_t rx_packets_cos6; 13316 /* Total number of rx packets count on cos queue 7 */ 13317 uint64_t rx_packets_cos7; 13318 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */ 13319 uint64_t pfc_pri0_rx_duration_us; 13320 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */ 13321 uint64_t pfc_pri0_rx_transitions; 13322 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */ 13323 uint64_t pfc_pri1_rx_duration_us; 13324 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */ 13325 uint64_t pfc_pri1_rx_transitions; 13326 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */ 13327 uint64_t pfc_pri2_rx_duration_us; 13328 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */ 13329 uint64_t pfc_pri2_rx_transitions; 13330 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */ 13331 uint64_t pfc_pri3_rx_duration_us; 13332 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */ 13333 uint64_t pfc_pri3_rx_transitions; 13334 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */ 13335 uint64_t pfc_pri4_rx_duration_us; 13336 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */ 13337 uint64_t pfc_pri4_rx_transitions; 13338 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */ 13339 uint64_t pfc_pri5_rx_duration_us; 13340 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */ 13341 uint64_t pfc_pri5_rx_transitions; 13342 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */ 13343 uint64_t pfc_pri6_rx_duration_us; 13344 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */ 13345 uint64_t pfc_pri6_rx_transitions; 13346 /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */ 13347 uint64_t pfc_pri7_rx_duration_us; 13348 /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */ 13349 uint64_t pfc_pri7_rx_transitions; 13350 } __attribute__((packed)); 13351 13352 /************************ 13353 * hwrm_port_qstats_ext * 13354 ************************/ 13355 13356 13357 /* hwrm_port_qstats_ext_input (size:320b/40B) */ 13358 struct hwrm_port_qstats_ext_input { 13359 /* The HWRM command request type. */ 13360 uint16_t req_type; 13361 /* 13362 * The completion ring to send the completion event on. This should 13363 * be the NQ ID returned from the `nq_alloc` HWRM command. 13364 */ 13365 uint16_t cmpl_ring; 13366 /* 13367 * The sequence ID is used by the driver for tracking multiple 13368 * commands. This ID is treated as opaque data by the firmware and 13369 * the value is returned in the `hwrm_resp_hdr` upon completion. 13370 */ 13371 uint16_t seq_id; 13372 /* 13373 * The target ID of the command: 13374 * * 0x0-0xFFF8 - The function ID 13375 * * 0xFFF8-0xFFFE - Reserved for internal processors 13376 * * 0xFFFF - HWRM 13377 */ 13378 uint16_t target_id; 13379 /* 13380 * A physical address pointer pointing to a host buffer that the 13381 * command's response data will be written. This can be either a host 13382 * physical address (HPA) or a guest physical address (GPA) and must 13383 * point to a physically contiguous block of memory. 13384 */ 13385 uint64_t resp_addr; 13386 /* Port ID of port that is being queried. */ 13387 uint16_t port_id; 13388 /* 13389 * The size of TX port extended 13390 * statistics block in bytes. 13391 */ 13392 uint16_t tx_stat_size; 13393 /* 13394 * The size of RX port extended 13395 * statistics block in bytes 13396 */ 13397 uint16_t rx_stat_size; 13398 uint8_t unused_0[2]; 13399 /* 13400 * This is the host address where 13401 * Tx port statistics will be stored 13402 */ 13403 uint64_t tx_stat_host_addr; 13404 /* 13405 * This is the host address where 13406 * Rx port statistics will be stored 13407 */ 13408 uint64_t rx_stat_host_addr; 13409 } __attribute__((packed)); 13410 13411 /* hwrm_port_qstats_ext_output (size:128b/16B) */ 13412 struct hwrm_port_qstats_ext_output { 13413 /* The specific error status for the command. */ 13414 uint16_t error_code; 13415 /* The HWRM command request type. */ 13416 uint16_t req_type; 13417 /* The sequence ID from the original command. */ 13418 uint16_t seq_id; 13419 /* The length of the response data in number of bytes. */ 13420 uint16_t resp_len; 13421 /* The size of TX port statistics block in bytes. */ 13422 uint16_t tx_stat_size; 13423 /* The size of RX port statistics block in bytes. */ 13424 uint16_t rx_stat_size; 13425 /* Total number of active cos queues available. */ 13426 uint16_t total_active_cos_queues; 13427 uint8_t flags; 13428 /* 13429 * If set to 1, then this field indicates that clear 13430 * roce specific counters is supported. 13431 */ 13432 #define HWRM_PORT_QSTATS_EXT_OUTPUT_FLAGS_CLEAR_ROCE_COUNTERS_SUPPORTED \ 13433 UINT32_C(0x1) 13434 /* 13435 * This field is used in Output records to indicate that the output 13436 * is completely written to RAM. This field should be read as '1' 13437 * to indicate that the output has been completely written. 13438 * When writing a command completion or response to an internal processor, 13439 * the order of writes has to be such that this field is written last. 13440 */ 13441 uint8_t valid; 13442 } __attribute__((packed)); 13443 13444 /************************* 13445 * hwrm_port_lpbk_qstats * 13446 *************************/ 13447 13448 13449 /* hwrm_port_lpbk_qstats_input (size:128b/16B) */ 13450 struct hwrm_port_lpbk_qstats_input { 13451 /* The HWRM command request type. */ 13452 uint16_t req_type; 13453 /* 13454 * The completion ring to send the completion event on. This should 13455 * be the NQ ID returned from the `nq_alloc` HWRM command. 13456 */ 13457 uint16_t cmpl_ring; 13458 /* 13459 * The sequence ID is used by the driver for tracking multiple 13460 * commands. This ID is treated as opaque data by the firmware and 13461 * the value is returned in the `hwrm_resp_hdr` upon completion. 13462 */ 13463 uint16_t seq_id; 13464 /* 13465 * The target ID of the command: 13466 * * 0x0-0xFFF8 - The function ID 13467 * * 0xFFF8-0xFFFE - Reserved for internal processors 13468 * * 0xFFFF - HWRM 13469 */ 13470 uint16_t target_id; 13471 /* 13472 * A physical address pointer pointing to a host buffer that the 13473 * command's response data will be written. This can be either a host 13474 * physical address (HPA) or a guest physical address (GPA) and must 13475 * point to a physically contiguous block of memory. 13476 */ 13477 uint64_t resp_addr; 13478 } __attribute__((packed)); 13479 13480 /* hwrm_port_lpbk_qstats_output (size:768b/96B) */ 13481 struct hwrm_port_lpbk_qstats_output { 13482 /* The specific error status for the command. */ 13483 uint16_t error_code; 13484 /* The HWRM command request type. */ 13485 uint16_t req_type; 13486 /* The sequence ID from the original command. */ 13487 uint16_t seq_id; 13488 /* The length of the response data in number of bytes. */ 13489 uint16_t resp_len; 13490 /* Number of transmitted unicast frames */ 13491 uint64_t lpbk_ucast_frames; 13492 /* Number of transmitted multicast frames */ 13493 uint64_t lpbk_mcast_frames; 13494 /* Number of transmitted broadcast frames */ 13495 uint64_t lpbk_bcast_frames; 13496 /* Number of transmitted bytes for unicast traffic */ 13497 uint64_t lpbk_ucast_bytes; 13498 /* Number of transmitted bytes for multicast traffic */ 13499 uint64_t lpbk_mcast_bytes; 13500 /* Number of transmitted bytes for broadcast traffic */ 13501 uint64_t lpbk_bcast_bytes; 13502 /* Total Tx Drops for loopback traffic reported by STATS block */ 13503 uint64_t tx_stat_discard; 13504 /* Total Tx Error Drops for loopback traffic reported by STATS block */ 13505 uint64_t tx_stat_error; 13506 /* Total Rx Drops for loopback traffic reported by STATS block */ 13507 uint64_t rx_stat_discard; 13508 /* Total Rx Error Drops for loopback traffic reported by STATS block */ 13509 uint64_t rx_stat_error; 13510 uint8_t unused_0[7]; 13511 /* 13512 * This field is used in Output records to indicate that the output 13513 * is completely written to RAM. This field should be read as '1' 13514 * to indicate that the output has been completely written. 13515 * When writing a command completion or response to an internal processor, 13516 * the order of writes has to be such that this field is written last. 13517 */ 13518 uint8_t valid; 13519 } __attribute__((packed)); 13520 13521 /*********************** 13522 * hwrm_port_clr_stats * 13523 ***********************/ 13524 13525 13526 /* hwrm_port_clr_stats_input (size:192b/24B) */ 13527 struct hwrm_port_clr_stats_input { 13528 /* The HWRM command request type. */ 13529 uint16_t req_type; 13530 /* 13531 * The completion ring to send the completion event on. This should 13532 * be the NQ ID returned from the `nq_alloc` HWRM command. 13533 */ 13534 uint16_t cmpl_ring; 13535 /* 13536 * The sequence ID is used by the driver for tracking multiple 13537 * commands. This ID is treated as opaque data by the firmware and 13538 * the value is returned in the `hwrm_resp_hdr` upon completion. 13539 */ 13540 uint16_t seq_id; 13541 /* 13542 * The target ID of the command: 13543 * * 0x0-0xFFF8 - The function ID 13544 * * 0xFFF8-0xFFFE - Reserved for internal processors 13545 * * 0xFFFF - HWRM 13546 */ 13547 uint16_t target_id; 13548 /* 13549 * A physical address pointer pointing to a host buffer that the 13550 * command's response data will be written. This can be either a host 13551 * physical address (HPA) or a guest physical address (GPA) and must 13552 * point to a physically contiguous block of memory. 13553 */ 13554 uint64_t resp_addr; 13555 /* Port ID of port that is being queried. */ 13556 uint16_t port_id; 13557 uint8_t flags; 13558 /* 13559 * If set to 1, then this field indicates clear the following RoCE 13560 * specific counters. 13561 * RoCE associated TX/RX cos counters 13562 * CNP associated TX/RX cos counters 13563 * RoCE/CNP specific TX/RX flow counters 13564 * Firmware will determine the RoCE/CNP cos queue based on qos profile. 13565 * This flag is honored only when RoCE is enabled on that port. 13566 */ 13567 #define HWRM_PORT_CLR_STATS_INPUT_FLAGS_ROCE_COUNTERS UINT32_C(0x1) 13568 uint8_t unused_0[5]; 13569 } __attribute__((packed)); 13570 13571 /* hwrm_port_clr_stats_output (size:128b/16B) */ 13572 struct hwrm_port_clr_stats_output { 13573 /* The specific error status for the command. */ 13574 uint16_t error_code; 13575 /* The HWRM command request type. */ 13576 uint16_t req_type; 13577 /* The sequence ID from the original command. */ 13578 uint16_t seq_id; 13579 /* The length of the response data in number of bytes. */ 13580 uint16_t resp_len; 13581 uint8_t unused_0[7]; 13582 /* 13583 * This field is used in Output records to indicate that the output 13584 * is completely written to RAM. This field should be read as '1' 13585 * to indicate that the output has been completely written. 13586 * When writing a command completion or response to an internal processor, 13587 * the order of writes has to be such that this field is written last. 13588 */ 13589 uint8_t valid; 13590 } __attribute__((packed)); 13591 13592 /*********************** 13593 * hwrm_port_phy_qcaps * 13594 ***********************/ 13595 13596 13597 /* hwrm_port_phy_qcaps_input (size:192b/24B) */ 13598 struct hwrm_port_phy_qcaps_input { 13599 /* The HWRM command request type. */ 13600 uint16_t req_type; 13601 /* 13602 * The completion ring to send the completion event on. This should 13603 * be the NQ ID returned from the `nq_alloc` HWRM command. 13604 */ 13605 uint16_t cmpl_ring; 13606 /* 13607 * The sequence ID is used by the driver for tracking multiple 13608 * commands. This ID is treated as opaque data by the firmware and 13609 * the value is returned in the `hwrm_resp_hdr` upon completion. 13610 */ 13611 uint16_t seq_id; 13612 /* 13613 * The target ID of the command: 13614 * * 0x0-0xFFF8 - The function ID 13615 * * 0xFFF8-0xFFFE - Reserved for internal processors 13616 * * 0xFFFF - HWRM 13617 */ 13618 uint16_t target_id; 13619 /* 13620 * A physical address pointer pointing to a host buffer that the 13621 * command's response data will be written. This can be either a host 13622 * physical address (HPA) or a guest physical address (GPA) and must 13623 * point to a physically contiguous block of memory. 13624 */ 13625 uint64_t resp_addr; 13626 /* Port ID of port that is being queried. */ 13627 uint16_t port_id; 13628 uint8_t unused_0[6]; 13629 } __attribute__((packed)); 13630 13631 /* hwrm_port_phy_qcaps_output (size:192b/24B) */ 13632 struct hwrm_port_phy_qcaps_output { 13633 /* The specific error status for the command. */ 13634 uint16_t error_code; 13635 /* The HWRM command request type. */ 13636 uint16_t req_type; 13637 /* The sequence ID from the original command. */ 13638 uint16_t seq_id; 13639 /* The length of the response data in number of bytes. */ 13640 uint16_t resp_len; 13641 /* PHY capability flags */ 13642 uint8_t flags; 13643 /* 13644 * If set to 1, then this field indicates that the 13645 * link is capable of supporting EEE. 13646 */ 13647 #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED \ 13648 UINT32_C(0x1) 13649 /* 13650 * If set to 1, then this field indicates that the 13651 * PHY is capable of supporting external loopback. 13652 */ 13653 #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED \ 13654 UINT32_C(0x2) 13655 /* 13656 * Reserved field. The HWRM shall set this field to 0. 13657 * An HWRM client shall ignore this field. 13658 */ 13659 #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_MASK \ 13660 UINT32_C(0xfc) 13661 #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_SFT 2 13662 /* Number of front panel ports for this device. */ 13663 uint8_t port_cnt; 13664 /* Not supported or unknown */ 13665 #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN UINT32_C(0x0) 13666 /* single port device */ 13667 #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1 UINT32_C(0x1) 13668 /* 2-port device */ 13669 #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2 UINT32_C(0x2) 13670 /* 3-port device */ 13671 #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3 UINT32_C(0x3) 13672 /* 4-port device */ 13673 #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4 UINT32_C(0x4) 13674 #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_LAST \ 13675 HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4 13676 /* 13677 * This is a bit mask to indicate what speeds are supported 13678 * as forced speeds on this link. 13679 * For each speed that can be forced on this link, the 13680 * corresponding mask bit shall be set to '1'. 13681 */ 13682 uint16_t supported_speeds_force_mode; 13683 /* 100Mb link speed (Half-duplex) */ 13684 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD \ 13685 UINT32_C(0x1) 13686 /* 100Mb link speed (Full-duplex) */ 13687 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB \ 13688 UINT32_C(0x2) 13689 /* 1Gb link speed (Half-duplex) */ 13690 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD \ 13691 UINT32_C(0x4) 13692 /* 1Gb link speed (Full-duplex) */ 13693 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB \ 13694 UINT32_C(0x8) 13695 /* 2Gb link speed */ 13696 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB \ 13697 UINT32_C(0x10) 13698 /* 25Gb link speed */ 13699 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB \ 13700 UINT32_C(0x20) 13701 /* 10Gb link speed */ 13702 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB \ 13703 UINT32_C(0x40) 13704 /* 20Gb link speed */ 13705 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB \ 13706 UINT32_C(0x80) 13707 /* 25Gb link speed */ 13708 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB \ 13709 UINT32_C(0x100) 13710 /* 40Gb link speed */ 13711 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB \ 13712 UINT32_C(0x200) 13713 /* 50Gb link speed */ 13714 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB \ 13715 UINT32_C(0x400) 13716 /* 100Gb link speed */ 13717 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB \ 13718 UINT32_C(0x800) 13719 /* 10Mb link speed (Half-duplex) */ 13720 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD \ 13721 UINT32_C(0x1000) 13722 /* 10Mb link speed (Full-duplex) */ 13723 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB \ 13724 UINT32_C(0x2000) 13725 /* 13726 * This is a bit mask to indicate what speeds are supported 13727 * for autonegotiation on this link. 13728 * For each speed that can be autonegotiated on this link, the 13729 * corresponding mask bit shall be set to '1'. 13730 */ 13731 uint16_t supported_speeds_auto_mode; 13732 /* 100Mb link speed (Half-duplex) */ 13733 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD \ 13734 UINT32_C(0x1) 13735 /* 100Mb link speed (Full-duplex) */ 13736 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB \ 13737 UINT32_C(0x2) 13738 /* 1Gb link speed (Half-duplex) */ 13739 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD \ 13740 UINT32_C(0x4) 13741 /* 1Gb link speed (Full-duplex) */ 13742 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB \ 13743 UINT32_C(0x8) 13744 /* 2Gb link speed */ 13745 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB \ 13746 UINT32_C(0x10) 13747 /* 25Gb link speed */ 13748 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB \ 13749 UINT32_C(0x20) 13750 /* 10Gb link speed */ 13751 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB \ 13752 UINT32_C(0x40) 13753 /* 20Gb link speed */ 13754 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB \ 13755 UINT32_C(0x80) 13756 /* 25Gb link speed */ 13757 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB \ 13758 UINT32_C(0x100) 13759 /* 40Gb link speed */ 13760 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB \ 13761 UINT32_C(0x200) 13762 /* 50Gb link speed */ 13763 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB \ 13764 UINT32_C(0x400) 13765 /* 100Gb link speed */ 13766 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB \ 13767 UINT32_C(0x800) 13768 /* 10Mb link speed (Half-duplex) */ 13769 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD \ 13770 UINT32_C(0x1000) 13771 /* 10Mb link speed (Full-duplex) */ 13772 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB \ 13773 UINT32_C(0x2000) 13774 /* 13775 * This is a bit mask to indicate what speeds are supported 13776 * for EEE on this link. 13777 * For each speed that can be autonegotiated when EEE is enabled 13778 * on this link, the corresponding mask bit shall be set to '1'. 13779 * This field is only valid when the eee_suppotred is set to '1'. 13780 */ 13781 uint16_t supported_speeds_eee_mode; 13782 /* Reserved */ 13783 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 \ 13784 UINT32_C(0x1) 13785 /* 100Mb link speed (Full-duplex) */ 13786 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB \ 13787 UINT32_C(0x2) 13788 /* Reserved */ 13789 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2 \ 13790 UINT32_C(0x4) 13791 /* 1Gb link speed (Full-duplex) */ 13792 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB \ 13793 UINT32_C(0x8) 13794 /* Reserved */ 13795 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3 \ 13796 UINT32_C(0x10) 13797 /* Reserved */ 13798 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4 \ 13799 UINT32_C(0x20) 13800 /* 10Gb link speed */ 13801 #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB \ 13802 UINT32_C(0x40) 13803 uint32_t tx_lpi_timer_low; 13804 /* 13805 * The lowest value of TX LPI timer that can be set on this link 13806 * when EEE is enabled. This value is in microseconds. 13807 * This field is valid only when_eee_supported is set to '1'. 13808 */ 13809 #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK \ 13810 UINT32_C(0xffffff) 13811 #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT 0 13812 /* 13813 * Reserved field. The HWRM shall set this field to 0. 13814 * An HWRM client shall ignore this field. 13815 */ 13816 #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK \ 13817 UINT32_C(0xff000000) 13818 #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT 24 13819 uint32_t valid_tx_lpi_timer_high; 13820 /* 13821 * The highest value of TX LPI timer that can be set on this link 13822 * when EEE is enabled. This value is in microseconds. 13823 * This field is valid only when_eee_supported is set to '1'. 13824 */ 13825 #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK \ 13826 UINT32_C(0xffffff) 13827 #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT 0 13828 /* 13829 * This field is used in Output records to indicate that the output 13830 * is completely written to RAM. This field should be read as '1' 13831 * to indicate that the output has been completely written. 13832 * When writing a command completion or response to an internal processor, 13833 * the order of writes has to be such that this field is written last. 13834 */ 13835 #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_MASK \ 13836 UINT32_C(0xff000000) 13837 #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_SFT 24 13838 } __attribute__((packed)); 13839 13840 /********************* 13841 * hwrm_port_led_cfg * 13842 *********************/ 13843 13844 13845 /* hwrm_port_led_cfg_input (size:512b/64B) */ 13846 struct hwrm_port_led_cfg_input { 13847 /* The HWRM command request type. */ 13848 uint16_t req_type; 13849 /* 13850 * The completion ring to send the completion event on. This should 13851 * be the NQ ID returned from the `nq_alloc` HWRM command. 13852 */ 13853 uint16_t cmpl_ring; 13854 /* 13855 * The sequence ID is used by the driver for tracking multiple 13856 * commands. This ID is treated as opaque data by the firmware and 13857 * the value is returned in the `hwrm_resp_hdr` upon completion. 13858 */ 13859 uint16_t seq_id; 13860 /* 13861 * The target ID of the command: 13862 * * 0x0-0xFFF8 - The function ID 13863 * * 0xFFF8-0xFFFE - Reserved for internal processors 13864 * * 0xFFFF - HWRM 13865 */ 13866 uint16_t target_id; 13867 /* 13868 * A physical address pointer pointing to a host buffer that the 13869 * command's response data will be written. This can be either a host 13870 * physical address (HPA) or a guest physical address (GPA) and must 13871 * point to a physically contiguous block of memory. 13872 */ 13873 uint64_t resp_addr; 13874 uint32_t enables; 13875 /* 13876 * This bit must be '1' for the led0_id field to be 13877 * configured. 13878 */ 13879 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID \ 13880 UINT32_C(0x1) 13881 /* 13882 * This bit must be '1' for the led0_state field to be 13883 * configured. 13884 */ 13885 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE \ 13886 UINT32_C(0x2) 13887 /* 13888 * This bit must be '1' for the led0_color field to be 13889 * configured. 13890 */ 13891 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR \ 13892 UINT32_C(0x4) 13893 /* 13894 * This bit must be '1' for the led0_blink_on field to be 13895 * configured. 13896 */ 13897 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON \ 13898 UINT32_C(0x8) 13899 /* 13900 * This bit must be '1' for the led0_blink_off field to be 13901 * configured. 13902 */ 13903 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF \ 13904 UINT32_C(0x10) 13905 /* 13906 * This bit must be '1' for the led0_group_id field to be 13907 * configured. 13908 */ 13909 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID \ 13910 UINT32_C(0x20) 13911 /* 13912 * This bit must be '1' for the led1_id field to be 13913 * configured. 13914 */ 13915 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID \ 13916 UINT32_C(0x40) 13917 /* 13918 * This bit must be '1' for the led1_state field to be 13919 * configured. 13920 */ 13921 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE \ 13922 UINT32_C(0x80) 13923 /* 13924 * This bit must be '1' for the led1_color field to be 13925 * configured. 13926 */ 13927 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR \ 13928 UINT32_C(0x100) 13929 /* 13930 * This bit must be '1' for the led1_blink_on field to be 13931 * configured. 13932 */ 13933 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON \ 13934 UINT32_C(0x200) 13935 /* 13936 * This bit must be '1' for the led1_blink_off field to be 13937 * configured. 13938 */ 13939 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF \ 13940 UINT32_C(0x400) 13941 /* 13942 * This bit must be '1' for the led1_group_id field to be 13943 * configured. 13944 */ 13945 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID \ 13946 UINT32_C(0x800) 13947 /* 13948 * This bit must be '1' for the led2_id field to be 13949 * configured. 13950 */ 13951 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID \ 13952 UINT32_C(0x1000) 13953 /* 13954 * This bit must be '1' for the led2_state field to be 13955 * configured. 13956 */ 13957 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE \ 13958 UINT32_C(0x2000) 13959 /* 13960 * This bit must be '1' for the led2_color field to be 13961 * configured. 13962 */ 13963 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR \ 13964 UINT32_C(0x4000) 13965 /* 13966 * This bit must be '1' for the led2_blink_on field to be 13967 * configured. 13968 */ 13969 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON \ 13970 UINT32_C(0x8000) 13971 /* 13972 * This bit must be '1' for the led2_blink_off field to be 13973 * configured. 13974 */ 13975 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF \ 13976 UINT32_C(0x10000) 13977 /* 13978 * This bit must be '1' for the led2_group_id field to be 13979 * configured. 13980 */ 13981 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID \ 13982 UINT32_C(0x20000) 13983 /* 13984 * This bit must be '1' for the led3_id field to be 13985 * configured. 13986 */ 13987 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID \ 13988 UINT32_C(0x40000) 13989 /* 13990 * This bit must be '1' for the led3_state field to be 13991 * configured. 13992 */ 13993 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE \ 13994 UINT32_C(0x80000) 13995 /* 13996 * This bit must be '1' for the led3_color field to be 13997 * configured. 13998 */ 13999 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR \ 14000 UINT32_C(0x100000) 14001 /* 14002 * This bit must be '1' for the led3_blink_on field to be 14003 * configured. 14004 */ 14005 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON \ 14006 UINT32_C(0x200000) 14007 /* 14008 * This bit must be '1' for the led3_blink_off field to be 14009 * configured. 14010 */ 14011 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF \ 14012 UINT32_C(0x400000) 14013 /* 14014 * This bit must be '1' for the led3_group_id field to be 14015 * configured. 14016 */ 14017 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID \ 14018 UINT32_C(0x800000) 14019 /* Port ID of port whose LEDs are configured. */ 14020 uint16_t port_id; 14021 /* 14022 * The number of LEDs that are being configured. 14023 * Up to 4 LEDs can be configured with this command. 14024 */ 14025 uint8_t num_leds; 14026 /* Reserved field. */ 14027 uint8_t rsvd; 14028 /* An identifier for the LED #0. */ 14029 uint8_t led0_id; 14030 /* The requested state of the LED #0. */ 14031 uint8_t led0_state; 14032 /* Default state of the LED */ 14033 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT UINT32_C(0x0) 14034 /* Off */ 14035 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF UINT32_C(0x1) 14036 /* On */ 14037 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON UINT32_C(0x2) 14038 /* Blink */ 14039 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK UINT32_C(0x3) 14040 /* Blink Alternately */ 14041 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4) 14042 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_LAST \ 14043 HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT 14044 /* The requested color of LED #0. */ 14045 uint8_t led0_color; 14046 /* Default */ 14047 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT UINT32_C(0x0) 14048 /* Amber */ 14049 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER UINT32_C(0x1) 14050 /* Green */ 14051 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN UINT32_C(0x2) 14052 /* Green or Amber */ 14053 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3) 14054 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_LAST \ 14055 HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER 14056 uint8_t unused_0; 14057 /* 14058 * If the LED #0 state is "blink" or "blinkalt", then 14059 * this field represents the requested time in milliseconds 14060 * to keep LED on between cycles. 14061 */ 14062 uint16_t led0_blink_on; 14063 /* 14064 * If the LED #0 state is "blink" or "blinkalt", then 14065 * this field represents the requested time in milliseconds 14066 * to keep LED off between cycles. 14067 */ 14068 uint16_t led0_blink_off; 14069 /* 14070 * An identifier for the group of LEDs that LED #0 belongs 14071 * to. 14072 * If set to 0, then the LED #0 shall not be grouped and 14073 * shall be treated as an individual resource. 14074 * For all other non-zero values of this field, LED #0 shall 14075 * be grouped together with the LEDs with the same group ID 14076 * value. 14077 */ 14078 uint8_t led0_group_id; 14079 /* Reserved field. */ 14080 uint8_t rsvd0; 14081 /* An identifier for the LED #1. */ 14082 uint8_t led1_id; 14083 /* The requested state of the LED #1. */ 14084 uint8_t led1_state; 14085 /* Default state of the LED */ 14086 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT UINT32_C(0x0) 14087 /* Off */ 14088 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF UINT32_C(0x1) 14089 /* On */ 14090 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON UINT32_C(0x2) 14091 /* Blink */ 14092 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK UINT32_C(0x3) 14093 /* Blink Alternately */ 14094 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4) 14095 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_LAST \ 14096 HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT 14097 /* The requested color of LED #1. */ 14098 uint8_t led1_color; 14099 /* Default */ 14100 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT UINT32_C(0x0) 14101 /* Amber */ 14102 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER UINT32_C(0x1) 14103 /* Green */ 14104 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN UINT32_C(0x2) 14105 /* Green or Amber */ 14106 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3) 14107 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_LAST \ 14108 HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER 14109 uint8_t unused_1; 14110 /* 14111 * If the LED #1 state is "blink" or "blinkalt", then 14112 * this field represents the requested time in milliseconds 14113 * to keep LED on between cycles. 14114 */ 14115 uint16_t led1_blink_on; 14116 /* 14117 * If the LED #1 state is "blink" or "blinkalt", then 14118 * this field represents the requested time in milliseconds 14119 * to keep LED off between cycles. 14120 */ 14121 uint16_t led1_blink_off; 14122 /* 14123 * An identifier for the group of LEDs that LED #1 belongs 14124 * to. 14125 * If set to 0, then the LED #1 shall not be grouped and 14126 * shall be treated as an individual resource. 14127 * For all other non-zero values of this field, LED #1 shall 14128 * be grouped together with the LEDs with the same group ID 14129 * value. 14130 */ 14131 uint8_t led1_group_id; 14132 /* Reserved field. */ 14133 uint8_t rsvd1; 14134 /* An identifier for the LED #2. */ 14135 uint8_t led2_id; 14136 /* The requested state of the LED #2. */ 14137 uint8_t led2_state; 14138 /* Default state of the LED */ 14139 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT UINT32_C(0x0) 14140 /* Off */ 14141 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF UINT32_C(0x1) 14142 /* On */ 14143 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON UINT32_C(0x2) 14144 /* Blink */ 14145 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK UINT32_C(0x3) 14146 /* Blink Alternately */ 14147 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4) 14148 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_LAST \ 14149 HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT 14150 /* The requested color of LED #2. */ 14151 uint8_t led2_color; 14152 /* Default */ 14153 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT UINT32_C(0x0) 14154 /* Amber */ 14155 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER UINT32_C(0x1) 14156 /* Green */ 14157 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN UINT32_C(0x2) 14158 /* Green or Amber */ 14159 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3) 14160 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_LAST \ 14161 HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER 14162 uint8_t unused_2; 14163 /* 14164 * If the LED #2 state is "blink" or "blinkalt", then 14165 * this field represents the requested time in milliseconds 14166 * to keep LED on between cycles. 14167 */ 14168 uint16_t led2_blink_on; 14169 /* 14170 * If the LED #2 state is "blink" or "blinkalt", then 14171 * this field represents the requested time in milliseconds 14172 * to keep LED off between cycles. 14173 */ 14174 uint16_t led2_blink_off; 14175 /* 14176 * An identifier for the group of LEDs that LED #2 belongs 14177 * to. 14178 * If set to 0, then the LED #2 shall not be grouped and 14179 * shall be treated as an individual resource. 14180 * For all other non-zero values of this field, LED #2 shall 14181 * be grouped together with the LEDs with the same group ID 14182 * value. 14183 */ 14184 uint8_t led2_group_id; 14185 /* Reserved field. */ 14186 uint8_t rsvd2; 14187 /* An identifier for the LED #3. */ 14188 uint8_t led3_id; 14189 /* The requested state of the LED #3. */ 14190 uint8_t led3_state; 14191 /* Default state of the LED */ 14192 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT UINT32_C(0x0) 14193 /* Off */ 14194 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF UINT32_C(0x1) 14195 /* On */ 14196 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON UINT32_C(0x2) 14197 /* Blink */ 14198 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK UINT32_C(0x3) 14199 /* Blink Alternately */ 14200 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4) 14201 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_LAST \ 14202 HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT 14203 /* The requested color of LED #3. */ 14204 uint8_t led3_color; 14205 /* Default */ 14206 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT UINT32_C(0x0) 14207 /* Amber */ 14208 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER UINT32_C(0x1) 14209 /* Green */ 14210 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN UINT32_C(0x2) 14211 /* Green or Amber */ 14212 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3) 14213 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_LAST \ 14214 HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER 14215 uint8_t unused_3; 14216 /* 14217 * If the LED #3 state is "blink" or "blinkalt", then 14218 * this field represents the requested time in milliseconds 14219 * to keep LED on between cycles. 14220 */ 14221 uint16_t led3_blink_on; 14222 /* 14223 * If the LED #3 state is "blink" or "blinkalt", then 14224 * this field represents the requested time in milliseconds 14225 * to keep LED off between cycles. 14226 */ 14227 uint16_t led3_blink_off; 14228 /* 14229 * An identifier for the group of LEDs that LED #3 belongs 14230 * to. 14231 * If set to 0, then the LED #3 shall not be grouped and 14232 * shall be treated as an individual resource. 14233 * For all other non-zero values of this field, LED #3 shall 14234 * be grouped together with the LEDs with the same group ID 14235 * value. 14236 */ 14237 uint8_t led3_group_id; 14238 /* Reserved field. */ 14239 uint8_t rsvd3; 14240 } __attribute__((packed)); 14241 14242 /* hwrm_port_led_cfg_output (size:128b/16B) */ 14243 struct hwrm_port_led_cfg_output { 14244 /* The specific error status for the command. */ 14245 uint16_t error_code; 14246 /* The HWRM command request type. */ 14247 uint16_t req_type; 14248 /* The sequence ID from the original command. */ 14249 uint16_t seq_id; 14250 /* The length of the response data in number of bytes. */ 14251 uint16_t resp_len; 14252 uint8_t unused_0[7]; 14253 /* 14254 * This field is used in Output records to indicate that the output 14255 * is completely written to RAM. This field should be read as '1' 14256 * to indicate that the output has been completely written. 14257 * When writing a command completion or response to an internal processor, 14258 * the order of writes has to be such that this field is written last. 14259 */ 14260 uint8_t valid; 14261 } __attribute__((packed)); 14262 14263 /********************** 14264 * hwrm_port_led_qcfg * 14265 **********************/ 14266 14267 14268 /* hwrm_port_led_qcfg_input (size:192b/24B) */ 14269 struct hwrm_port_led_qcfg_input { 14270 /* The HWRM command request type. */ 14271 uint16_t req_type; 14272 /* 14273 * The completion ring to send the completion event on. This should 14274 * be the NQ ID returned from the `nq_alloc` HWRM command. 14275 */ 14276 uint16_t cmpl_ring; 14277 /* 14278 * The sequence ID is used by the driver for tracking multiple 14279 * commands. This ID is treated as opaque data by the firmware and 14280 * the value is returned in the `hwrm_resp_hdr` upon completion. 14281 */ 14282 uint16_t seq_id; 14283 /* 14284 * The target ID of the command: 14285 * * 0x0-0xFFF8 - The function ID 14286 * * 0xFFF8-0xFFFE - Reserved for internal processors 14287 * * 0xFFFF - HWRM 14288 */ 14289 uint16_t target_id; 14290 /* 14291 * A physical address pointer pointing to a host buffer that the 14292 * command's response data will be written. This can be either a host 14293 * physical address (HPA) or a guest physical address (GPA) and must 14294 * point to a physically contiguous block of memory. 14295 */ 14296 uint64_t resp_addr; 14297 /* Port ID of port whose LED configuration is being queried. */ 14298 uint16_t port_id; 14299 uint8_t unused_0[6]; 14300 } __attribute__((packed)); 14301 14302 /* hwrm_port_led_qcfg_output (size:448b/56B) */ 14303 struct hwrm_port_led_qcfg_output { 14304 /* The specific error status for the command. */ 14305 uint16_t error_code; 14306 /* The HWRM command request type. */ 14307 uint16_t req_type; 14308 /* The sequence ID from the original command. */ 14309 uint16_t seq_id; 14310 /* The length of the response data in number of bytes. */ 14311 uint16_t resp_len; 14312 /* 14313 * The number of LEDs that are configured on this port. 14314 * Up to 4 LEDs can be returned in the response. 14315 */ 14316 uint8_t num_leds; 14317 /* An identifier for the LED #0. */ 14318 uint8_t led0_id; 14319 /* The type of LED #0. */ 14320 uint8_t led0_type; 14321 /* Speed LED */ 14322 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED UINT32_C(0x0) 14323 /* Activity LED */ 14324 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1) 14325 /* Invalid */ 14326 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID UINT32_C(0xff) 14327 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_LAST \ 14328 HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID 14329 /* The current state of the LED #0. */ 14330 uint8_t led0_state; 14331 /* Default state of the LED */ 14332 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT UINT32_C(0x0) 14333 /* Off */ 14334 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF UINT32_C(0x1) 14335 /* On */ 14336 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON UINT32_C(0x2) 14337 /* Blink */ 14338 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK UINT32_C(0x3) 14339 /* Blink Alternately */ 14340 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4) 14341 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_LAST \ 14342 HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT 14343 /* The color of LED #0. */ 14344 uint8_t led0_color; 14345 /* Default */ 14346 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT UINT32_C(0x0) 14347 /* Amber */ 14348 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER UINT32_C(0x1) 14349 /* Green */ 14350 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN UINT32_C(0x2) 14351 /* Green or Amber */ 14352 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3) 14353 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_LAST \ 14354 HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER 14355 uint8_t unused_0; 14356 /* 14357 * If the LED #0 state is "blink" or "blinkalt", then 14358 * this field represents the requested time in milliseconds 14359 * to keep LED on between cycles. 14360 */ 14361 uint16_t led0_blink_on; 14362 /* 14363 * If the LED #0 state is "blink" or "blinkalt", then 14364 * this field represents the requested time in milliseconds 14365 * to keep LED off between cycles. 14366 */ 14367 uint16_t led0_blink_off; 14368 /* 14369 * An identifier for the group of LEDs that LED #0 belongs 14370 * to. 14371 * If set to 0, then the LED #0 is not grouped. 14372 * For all other non-zero values of this field, LED #0 is 14373 * grouped together with the LEDs with the same group ID 14374 * value. 14375 */ 14376 uint8_t led0_group_id; 14377 /* An identifier for the LED #1. */ 14378 uint8_t led1_id; 14379 /* The type of LED #1. */ 14380 uint8_t led1_type; 14381 /* Speed LED */ 14382 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED UINT32_C(0x0) 14383 /* Activity LED */ 14384 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1) 14385 /* Invalid */ 14386 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID UINT32_C(0xff) 14387 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_LAST \ 14388 HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID 14389 /* The current state of the LED #1. */ 14390 uint8_t led1_state; 14391 /* Default state of the LED */ 14392 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT UINT32_C(0x0) 14393 /* Off */ 14394 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF UINT32_C(0x1) 14395 /* On */ 14396 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON UINT32_C(0x2) 14397 /* Blink */ 14398 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK UINT32_C(0x3) 14399 /* Blink Alternately */ 14400 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4) 14401 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_LAST \ 14402 HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT 14403 /* The color of LED #1. */ 14404 uint8_t led1_color; 14405 /* Default */ 14406 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT UINT32_C(0x0) 14407 /* Amber */ 14408 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER UINT32_C(0x1) 14409 /* Green */ 14410 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN UINT32_C(0x2) 14411 /* Green or Amber */ 14412 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3) 14413 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_LAST \ 14414 HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER 14415 uint8_t unused_1; 14416 /* 14417 * If the LED #1 state is "blink" or "blinkalt", then 14418 * this field represents the requested time in milliseconds 14419 * to keep LED on between cycles. 14420 */ 14421 uint16_t led1_blink_on; 14422 /* 14423 * If the LED #1 state is "blink" or "blinkalt", then 14424 * this field represents the requested time in milliseconds 14425 * to keep LED off between cycles. 14426 */ 14427 uint16_t led1_blink_off; 14428 /* 14429 * An identifier for the group of LEDs that LED #1 belongs 14430 * to. 14431 * If set to 0, then the LED #1 is not grouped. 14432 * For all other non-zero values of this field, LED #1 is 14433 * grouped together with the LEDs with the same group ID 14434 * value. 14435 */ 14436 uint8_t led1_group_id; 14437 /* An identifier for the LED #2. */ 14438 uint8_t led2_id; 14439 /* The type of LED #2. */ 14440 uint8_t led2_type; 14441 /* Speed LED */ 14442 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED UINT32_C(0x0) 14443 /* Activity LED */ 14444 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1) 14445 /* Invalid */ 14446 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID UINT32_C(0xff) 14447 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_LAST \ 14448 HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID 14449 /* The current state of the LED #2. */ 14450 uint8_t led2_state; 14451 /* Default state of the LED */ 14452 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT UINT32_C(0x0) 14453 /* Off */ 14454 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF UINT32_C(0x1) 14455 /* On */ 14456 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON UINT32_C(0x2) 14457 /* Blink */ 14458 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK UINT32_C(0x3) 14459 /* Blink Alternately */ 14460 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4) 14461 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_LAST \ 14462 HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT 14463 /* The color of LED #2. */ 14464 uint8_t led2_color; 14465 /* Default */ 14466 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT UINT32_C(0x0) 14467 /* Amber */ 14468 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER UINT32_C(0x1) 14469 /* Green */ 14470 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN UINT32_C(0x2) 14471 /* Green or Amber */ 14472 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3) 14473 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_LAST \ 14474 HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER 14475 uint8_t unused_2; 14476 /* 14477 * If the LED #2 state is "blink" or "blinkalt", then 14478 * this field represents the requested time in milliseconds 14479 * to keep LED on between cycles. 14480 */ 14481 uint16_t led2_blink_on; 14482 /* 14483 * If the LED #2 state is "blink" or "blinkalt", then 14484 * this field represents the requested time in milliseconds 14485 * to keep LED off between cycles. 14486 */ 14487 uint16_t led2_blink_off; 14488 /* 14489 * An identifier for the group of LEDs that LED #2 belongs 14490 * to. 14491 * If set to 0, then the LED #2 is not grouped. 14492 * For all other non-zero values of this field, LED #2 is 14493 * grouped together with the LEDs with the same group ID 14494 * value. 14495 */ 14496 uint8_t led2_group_id; 14497 /* An identifier for the LED #3. */ 14498 uint8_t led3_id; 14499 /* The type of LED #3. */ 14500 uint8_t led3_type; 14501 /* Speed LED */ 14502 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED UINT32_C(0x0) 14503 /* Activity LED */ 14504 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1) 14505 /* Invalid */ 14506 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID UINT32_C(0xff) 14507 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_LAST \ 14508 HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID 14509 /* The current state of the LED #3. */ 14510 uint8_t led3_state; 14511 /* Default state of the LED */ 14512 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT UINT32_C(0x0) 14513 /* Off */ 14514 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF UINT32_C(0x1) 14515 /* On */ 14516 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON UINT32_C(0x2) 14517 /* Blink */ 14518 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK UINT32_C(0x3) 14519 /* Blink Alternately */ 14520 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4) 14521 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_LAST \ 14522 HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT 14523 /* The color of LED #3. */ 14524 uint8_t led3_color; 14525 /* Default */ 14526 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT UINT32_C(0x0) 14527 /* Amber */ 14528 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER UINT32_C(0x1) 14529 /* Green */ 14530 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN UINT32_C(0x2) 14531 /* Green or Amber */ 14532 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3) 14533 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_LAST \ 14534 HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER 14535 uint8_t unused_3; 14536 /* 14537 * If the LED #3 state is "blink" or "blinkalt", then 14538 * this field represents the requested time in milliseconds 14539 * to keep LED on between cycles. 14540 */ 14541 uint16_t led3_blink_on; 14542 /* 14543 * If the LED #3 state is "blink" or "blinkalt", then 14544 * this field represents the requested time in milliseconds 14545 * to keep LED off between cycles. 14546 */ 14547 uint16_t led3_blink_off; 14548 /* 14549 * An identifier for the group of LEDs that LED #3 belongs 14550 * to. 14551 * If set to 0, then the LED #3 is not grouped. 14552 * For all other non-zero values of this field, LED #3 is 14553 * grouped together with the LEDs with the same group ID 14554 * value. 14555 */ 14556 uint8_t led3_group_id; 14557 uint8_t unused_4[6]; 14558 /* 14559 * This field is used in Output records to indicate that the output 14560 * is completely written to RAM. This field should be read as '1' 14561 * to indicate that the output has been completely written. 14562 * When writing a command completion or response to an internal processor, 14563 * the order of writes has to be such that this field is written last. 14564 */ 14565 uint8_t valid; 14566 } __attribute__((packed)); 14567 14568 /*********************** 14569 * hwrm_port_led_qcaps * 14570 ***********************/ 14571 14572 14573 /* hwrm_port_led_qcaps_input (size:192b/24B) */ 14574 struct hwrm_port_led_qcaps_input { 14575 /* The HWRM command request type. */ 14576 uint16_t req_type; 14577 /* 14578 * The completion ring to send the completion event on. This should 14579 * be the NQ ID returned from the `nq_alloc` HWRM command. 14580 */ 14581 uint16_t cmpl_ring; 14582 /* 14583 * The sequence ID is used by the driver for tracking multiple 14584 * commands. This ID is treated as opaque data by the firmware and 14585 * the value is returned in the `hwrm_resp_hdr` upon completion. 14586 */ 14587 uint16_t seq_id; 14588 /* 14589 * The target ID of the command: 14590 * * 0x0-0xFFF8 - The function ID 14591 * * 0xFFF8-0xFFFE - Reserved for internal processors 14592 * * 0xFFFF - HWRM 14593 */ 14594 uint16_t target_id; 14595 /* 14596 * A physical address pointer pointing to a host buffer that the 14597 * command's response data will be written. This can be either a host 14598 * physical address (HPA) or a guest physical address (GPA) and must 14599 * point to a physically contiguous block of memory. 14600 */ 14601 uint64_t resp_addr; 14602 /* Port ID of port whose LED configuration is being queried. */ 14603 uint16_t port_id; 14604 uint8_t unused_0[6]; 14605 } __attribute__((packed)); 14606 14607 /* hwrm_port_led_qcaps_output (size:384b/48B) */ 14608 struct hwrm_port_led_qcaps_output { 14609 /* The specific error status for the command. */ 14610 uint16_t error_code; 14611 /* The HWRM command request type. */ 14612 uint16_t req_type; 14613 /* The sequence ID from the original command. */ 14614 uint16_t seq_id; 14615 /* The length of the response data in number of bytes. */ 14616 uint16_t resp_len; 14617 /* 14618 * The number of LEDs that are configured on this port. 14619 * Up to 4 LEDs can be returned in the response. 14620 */ 14621 uint8_t num_leds; 14622 /* Reserved for future use. */ 14623 uint8_t unused[3]; 14624 /* An identifier for the LED #0. */ 14625 uint8_t led0_id; 14626 /* The type of LED #0. */ 14627 uint8_t led0_type; 14628 /* Speed LED */ 14629 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED UINT32_C(0x0) 14630 /* Activity LED */ 14631 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1) 14632 /* Invalid */ 14633 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID UINT32_C(0xff) 14634 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_LAST \ 14635 HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID 14636 /* 14637 * An identifier for the group of LEDs that LED #0 belongs 14638 * to. 14639 * If set to 0, then the LED #0 cannot be grouped. 14640 * For all other non-zero values of this field, LED #0 is 14641 * grouped together with the LEDs with the same group ID 14642 * value. 14643 */ 14644 uint8_t led0_group_id; 14645 uint8_t unused_0; 14646 /* The states supported by LED #0. */ 14647 uint16_t led0_state_caps; 14648 /* 14649 * If set to 1, this LED is enabled. 14650 * If set to 0, this LED is disabled. 14651 */ 14652 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED \ 14653 UINT32_C(0x1) 14654 /* 14655 * If set to 1, off state is supported on this LED. 14656 * If set to 0, off state is not supported on this LED. 14657 */ 14658 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED \ 14659 UINT32_C(0x2) 14660 /* 14661 * If set to 1, on state is supported on this LED. 14662 * If set to 0, on state is not supported on this LED. 14663 */ 14664 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED \ 14665 UINT32_C(0x4) 14666 /* 14667 * If set to 1, blink state is supported on this LED. 14668 * If set to 0, blink state is not supported on this LED. 14669 */ 14670 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED \ 14671 UINT32_C(0x8) 14672 /* 14673 * If set to 1, blink_alt state is supported on this LED. 14674 * If set to 0, blink_alt state is not supported on this LED. 14675 */ 14676 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED \ 14677 UINT32_C(0x10) 14678 /* The colors supported by LED #0. */ 14679 uint16_t led0_color_caps; 14680 /* reserved. */ 14681 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD \ 14682 UINT32_C(0x1) 14683 /* 14684 * If set to 1, Amber color is supported on this LED. 14685 * If set to 0, Amber color is not supported on this LED. 14686 */ 14687 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED \ 14688 UINT32_C(0x2) 14689 /* 14690 * If set to 1, Green color is supported on this LED. 14691 * If set to 0, Green color is not supported on this LED. 14692 */ 14693 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED \ 14694 UINT32_C(0x4) 14695 /* An identifier for the LED #1. */ 14696 uint8_t led1_id; 14697 /* The type of LED #1. */ 14698 uint8_t led1_type; 14699 /* Speed LED */ 14700 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED UINT32_C(0x0) 14701 /* Activity LED */ 14702 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1) 14703 /* Invalid */ 14704 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID UINT32_C(0xff) 14705 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_LAST \ 14706 HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID 14707 /* 14708 * An identifier for the group of LEDs that LED #1 belongs 14709 * to. 14710 * If set to 0, then the LED #0 cannot be grouped. 14711 * For all other non-zero values of this field, LED #0 is 14712 * grouped together with the LEDs with the same group ID 14713 * value. 14714 */ 14715 uint8_t led1_group_id; 14716 uint8_t unused_1; 14717 /* The states supported by LED #1. */ 14718 uint16_t led1_state_caps; 14719 /* 14720 * If set to 1, this LED is enabled. 14721 * If set to 0, this LED is disabled. 14722 */ 14723 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED \ 14724 UINT32_C(0x1) 14725 /* 14726 * If set to 1, off state is supported on this LED. 14727 * If set to 0, off state is not supported on this LED. 14728 */ 14729 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED \ 14730 UINT32_C(0x2) 14731 /* 14732 * If set to 1, on state is supported on this LED. 14733 * If set to 0, on state is not supported on this LED. 14734 */ 14735 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED \ 14736 UINT32_C(0x4) 14737 /* 14738 * If set to 1, blink state is supported on this LED. 14739 * If set to 0, blink state is not supported on this LED. 14740 */ 14741 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED \ 14742 UINT32_C(0x8) 14743 /* 14744 * If set to 1, blink_alt state is supported on this LED. 14745 * If set to 0, blink_alt state is not supported on this LED. 14746 */ 14747 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED \ 14748 UINT32_C(0x10) 14749 /* The colors supported by LED #1. */ 14750 uint16_t led1_color_caps; 14751 /* reserved. */ 14752 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD \ 14753 UINT32_C(0x1) 14754 /* 14755 * If set to 1, Amber color is supported on this LED. 14756 * If set to 0, Amber color is not supported on this LED. 14757 */ 14758 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED \ 14759 UINT32_C(0x2) 14760 /* 14761 * If set to 1, Green color is supported on this LED. 14762 * If set to 0, Green color is not supported on this LED. 14763 */ 14764 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED \ 14765 UINT32_C(0x4) 14766 /* An identifier for the LED #2. */ 14767 uint8_t led2_id; 14768 /* The type of LED #2. */ 14769 uint8_t led2_type; 14770 /* Speed LED */ 14771 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED UINT32_C(0x0) 14772 /* Activity LED */ 14773 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1) 14774 /* Invalid */ 14775 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID UINT32_C(0xff) 14776 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_LAST \ 14777 HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID 14778 /* 14779 * An identifier for the group of LEDs that LED #0 belongs 14780 * to. 14781 * If set to 0, then the LED #0 cannot be grouped. 14782 * For all other non-zero values of this field, LED #0 is 14783 * grouped together with the LEDs with the same group ID 14784 * value. 14785 */ 14786 uint8_t led2_group_id; 14787 uint8_t unused_2; 14788 /* The states supported by LED #2. */ 14789 uint16_t led2_state_caps; 14790 /* 14791 * If set to 1, this LED is enabled. 14792 * If set to 0, this LED is disabled. 14793 */ 14794 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED \ 14795 UINT32_C(0x1) 14796 /* 14797 * If set to 1, off state is supported on this LED. 14798 * If set to 0, off state is not supported on this LED. 14799 */ 14800 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED \ 14801 UINT32_C(0x2) 14802 /* 14803 * If set to 1, on state is supported on this LED. 14804 * If set to 0, on state is not supported on this LED. 14805 */ 14806 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED \ 14807 UINT32_C(0x4) 14808 /* 14809 * If set to 1, blink state is supported on this LED. 14810 * If set to 0, blink state is not supported on this LED. 14811 */ 14812 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED \ 14813 UINT32_C(0x8) 14814 /* 14815 * If set to 1, blink_alt state is supported on this LED. 14816 * If set to 0, blink_alt state is not supported on this LED. 14817 */ 14818 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED \ 14819 UINT32_C(0x10) 14820 /* The colors supported by LED #2. */ 14821 uint16_t led2_color_caps; 14822 /* reserved. */ 14823 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD \ 14824 UINT32_C(0x1) 14825 /* 14826 * If set to 1, Amber color is supported on this LED. 14827 * If set to 0, Amber color is not supported on this LED. 14828 */ 14829 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED \ 14830 UINT32_C(0x2) 14831 /* 14832 * If set to 1, Green color is supported on this LED. 14833 * If set to 0, Green color is not supported on this LED. 14834 */ 14835 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED \ 14836 UINT32_C(0x4) 14837 /* An identifier for the LED #3. */ 14838 uint8_t led3_id; 14839 /* The type of LED #3. */ 14840 uint8_t led3_type; 14841 /* Speed LED */ 14842 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED UINT32_C(0x0) 14843 /* Activity LED */ 14844 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1) 14845 /* Invalid */ 14846 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID UINT32_C(0xff) 14847 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_LAST \ 14848 HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID 14849 /* 14850 * An identifier for the group of LEDs that LED #3 belongs 14851 * to. 14852 * If set to 0, then the LED #0 cannot be grouped. 14853 * For all other non-zero values of this field, LED #0 is 14854 * grouped together with the LEDs with the same group ID 14855 * value. 14856 */ 14857 uint8_t led3_group_id; 14858 uint8_t unused_3; 14859 /* The states supported by LED #3. */ 14860 uint16_t led3_state_caps; 14861 /* 14862 * If set to 1, this LED is enabled. 14863 * If set to 0, this LED is disabled. 14864 */ 14865 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED \ 14866 UINT32_C(0x1) 14867 /* 14868 * If set to 1, off state is supported on this LED. 14869 * If set to 0, off state is not supported on this LED. 14870 */ 14871 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED \ 14872 UINT32_C(0x2) 14873 /* 14874 * If set to 1, on state is supported on this LED. 14875 * If set to 0, on state is not supported on this LED. 14876 */ 14877 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED \ 14878 UINT32_C(0x4) 14879 /* 14880 * If set to 1, blink state is supported on this LED. 14881 * If set to 0, blink state is not supported on this LED. 14882 */ 14883 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED \ 14884 UINT32_C(0x8) 14885 /* 14886 * If set to 1, blink_alt state is supported on this LED. 14887 * If set to 0, blink_alt state is not supported on this LED. 14888 */ 14889 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED \ 14890 UINT32_C(0x10) 14891 /* The colors supported by LED #3. */ 14892 uint16_t led3_color_caps; 14893 /* reserved. */ 14894 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD \ 14895 UINT32_C(0x1) 14896 /* 14897 * If set to 1, Amber color is supported on this LED. 14898 * If set to 0, Amber color is not supported on this LED. 14899 */ 14900 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED \ 14901 UINT32_C(0x2) 14902 /* 14903 * If set to 1, Green color is supported on this LED. 14904 * If set to 0, Green color is not supported on this LED. 14905 */ 14906 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED \ 14907 UINT32_C(0x4) 14908 uint8_t unused_4[3]; 14909 /* 14910 * This field is used in Output records to indicate that the output 14911 * is completely written to RAM. This field should be read as '1' 14912 * to indicate that the output has been completely written. 14913 * When writing a command completion or response to an internal processor, 14914 * the order of writes has to be such that this field is written last. 14915 */ 14916 uint8_t valid; 14917 } __attribute__((packed)); 14918 14919 /*********************** 14920 * hwrm_queue_qportcfg * 14921 ***********************/ 14922 14923 14924 /* hwrm_queue_qportcfg_input (size:192b/24B) */ 14925 struct hwrm_queue_qportcfg_input { 14926 /* The HWRM command request type. */ 14927 uint16_t req_type; 14928 /* 14929 * The completion ring to send the completion event on. This should 14930 * be the NQ ID returned from the `nq_alloc` HWRM command. 14931 */ 14932 uint16_t cmpl_ring; 14933 /* 14934 * The sequence ID is used by the driver for tracking multiple 14935 * commands. This ID is treated as opaque data by the firmware and 14936 * the value is returned in the `hwrm_resp_hdr` upon completion. 14937 */ 14938 uint16_t seq_id; 14939 /* 14940 * The target ID of the command: 14941 * * 0x0-0xFFF8 - The function ID 14942 * * 0xFFF8-0xFFFE - Reserved for internal processors 14943 * * 0xFFFF - HWRM 14944 */ 14945 uint16_t target_id; 14946 /* 14947 * A physical address pointer pointing to a host buffer that the 14948 * command's response data will be written. This can be either a host 14949 * physical address (HPA) or a guest physical address (GPA) and must 14950 * point to a physically contiguous block of memory. 14951 */ 14952 uint64_t resp_addr; 14953 uint32_t flags; 14954 /* 14955 * Enumeration denoting the RX, TX type of the resource. 14956 * This enumeration is used for resources that are similar for both 14957 * TX and RX paths of the chip. 14958 */ 14959 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH UINT32_C(0x1) 14960 /* tx path */ 14961 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0) 14962 /* rx path */ 14963 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1) 14964 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \ 14965 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX 14966 /* 14967 * Port ID of port for which the queue configuration is being 14968 * queried. This field is only required when sent by IPC. 14969 */ 14970 uint16_t port_id; 14971 /* 14972 * Drivers will set this capability when it can use 14973 * queue_idx_service_profile to map the queues to application. 14974 */ 14975 uint8_t drv_qmap_cap; 14976 /* disabled */ 14977 #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0) 14978 /* enabled */ 14979 #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED UINT32_C(0x1) 14980 #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST \ 14981 HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED 14982 uint8_t unused_0; 14983 } __attribute__((packed)); 14984 14985 /* hwrm_queue_qportcfg_output (size:256b/32B) */ 14986 struct hwrm_queue_qportcfg_output { 14987 /* The specific error status for the command. */ 14988 uint16_t error_code; 14989 /* The HWRM command request type. */ 14990 uint16_t req_type; 14991 /* The sequence ID from the original command. */ 14992 uint16_t seq_id; 14993 /* The length of the response data in number of bytes. */ 14994 uint16_t resp_len; 14995 /* 14996 * The maximum number of queues that can be configured on this 14997 * port. 14998 * Valid values range from 1 through 8. 14999 */ 15000 uint8_t max_configurable_queues; 15001 /* 15002 * The maximum number of lossless queues that can be configured 15003 * on this port. 15004 * Valid values range from 0 through 8. 15005 */ 15006 uint8_t max_configurable_lossless_queues; 15007 /* 15008 * Bitmask indicating which queues can be configured by the 15009 * hwrm_queue_cfg command. 15010 * 15011 * Each bit represents a specific queue where bit 0 represents 15012 * queue 0 and bit 7 represents queue 7. 15013 * # A value of 0 indicates that the queue is not configurable 15014 * by the hwrm_queue_cfg command. 15015 * # A value of 1 indicates that the queue is configurable. 15016 * # A hwrm_queue_cfg command shall return error when trying to 15017 * configure a queue not configurable. 15018 */ 15019 uint8_t queue_cfg_allowed; 15020 /* Information about queue configuration. */ 15021 uint8_t queue_cfg_info; 15022 /* 15023 * If this flag is set to '1', then the queues are 15024 * configured asymmetrically on TX and RX sides. 15025 * If this flag is set to '0', then the queues are 15026 * configured symmetrically on TX and RX sides. For 15027 * symmetric configuration, the queue configuration 15028 * including queue ids and service profiles on the 15029 * TX side is the same as the corresponding queue 15030 * configuration on the RX side. 15031 */ 15032 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \ 15033 UINT32_C(0x1) 15034 /* 15035 * Bitmask indicating which queues can be configured by the 15036 * hwrm_queue_pfcenable_cfg command. 15037 * 15038 * Each bit represents a specific priority where bit 0 represents 15039 * priority 0 and bit 7 represents priority 7. 15040 * # A value of 0 indicates that the priority is not configurable by 15041 * the hwrm_queue_pfcenable_cfg command. 15042 * # A value of 1 indicates that the priority is configurable. 15043 * # A hwrm_queue_pfcenable_cfg command shall return error when 15044 * trying to configure a priority that is not configurable. 15045 */ 15046 uint8_t queue_pfcenable_cfg_allowed; 15047 /* 15048 * Bitmask indicating which queues can be configured by the 15049 * hwrm_queue_pri2cos_cfg command. 15050 * 15051 * Each bit represents a specific queue where bit 0 represents 15052 * queue 0 and bit 7 represents queue 7. 15053 * # A value of 0 indicates that the queue is not configurable 15054 * by the hwrm_queue_pri2cos_cfg command. 15055 * # A value of 1 indicates that the queue is configurable. 15056 * # A hwrm_queue_pri2cos_cfg command shall return error when 15057 * trying to configure a queue that is not configurable. 15058 */ 15059 uint8_t queue_pri2cos_cfg_allowed; 15060 /* 15061 * Bitmask indicating which queues can be configured by the 15062 * hwrm_queue_pri2cos_cfg command. 15063 * 15064 * Each bit represents a specific queue where bit 0 represents 15065 * queue 0 and bit 7 represents queue 7. 15066 * # A value of 0 indicates that the queue is not configurable 15067 * by the hwrm_queue_pri2cos_cfg command. 15068 * # A value of 1 indicates that the queue is configurable. 15069 * # A hwrm_queue_pri2cos_cfg command shall return error when 15070 * trying to configure a queue not configurable. 15071 */ 15072 uint8_t queue_cos2bw_cfg_allowed; 15073 /* 15074 * ID of CoS Queue 0. 15075 * FF - Invalid id 15076 * 15077 * # This ID can be used on any subsequent call to an hwrm command 15078 * that takes a queue id. 15079 * # IDs must always be queried by this command before any use 15080 * by the driver or software. 15081 * # Any driver or software should not make any assumptions about 15082 * queue IDs. 15083 * # A value of 0xff indicates that the queue is not available. 15084 * # Available queues may not be in sequential order. 15085 */ 15086 uint8_t queue_id0; 15087 /* This value is applicable to CoS queues only. */ 15088 uint8_t queue_id0_service_profile; 15089 /* Lossy (best-effort) */ 15090 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \ 15091 UINT32_C(0x0) 15092 /* Lossless (legacy) */ 15093 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \ 15094 UINT32_C(0x1) 15095 /* Lossless RoCE */ 15096 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE \ 15097 UINT32_C(0x1) 15098 /* Lossy RoCE CNP */ 15099 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP \ 15100 UINT32_C(0x2) 15101 /* Lossless NIC */ 15102 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC \ 15103 UINT32_C(0x3) 15104 /* Set to 0xFF... (All Fs) if there is no service profile specified */ 15105 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \ 15106 UINT32_C(0xff) 15107 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST \ 15108 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN 15109 /* 15110 * ID of CoS Queue 1. 15111 * FF - Invalid id 15112 * 15113 * # This ID can be used on any subsequent call to an hwrm command 15114 * that takes a queue id. 15115 * # IDs must always be queried by this command before any use 15116 * by the driver or software. 15117 * # Any driver or software should not make any assumptions about 15118 * queue IDs. 15119 * # A value of 0xff indicates that the queue is not available. 15120 * # Available queues may not be in sequential order. 15121 */ 15122 uint8_t queue_id1; 15123 /* This value is applicable to CoS queues only. */ 15124 uint8_t queue_id1_service_profile; 15125 /* Lossy (best-effort) */ 15126 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \ 15127 UINT32_C(0x0) 15128 /* Lossless (legacy) */ 15129 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \ 15130 UINT32_C(0x1) 15131 /* Lossless RoCE */ 15132 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE \ 15133 UINT32_C(0x1) 15134 /* Lossy RoCE CNP */ 15135 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP \ 15136 UINT32_C(0x2) 15137 /* Lossless NIC */ 15138 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC \ 15139 UINT32_C(0x3) 15140 /* Set to 0xFF... (All Fs) if there is no service profile specified */ 15141 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \ 15142 UINT32_C(0xff) 15143 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST \ 15144 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN 15145 /* 15146 * ID of CoS Queue 2. 15147 * FF - Invalid id 15148 * 15149 * # This ID can be used on any subsequent call to an hwrm command 15150 * that takes a queue id. 15151 * # IDs must always be queried by this command before any use 15152 * by the driver or software. 15153 * # Any driver or software should not make any assumptions about 15154 * queue IDs. 15155 * # A value of 0xff indicates that the queue is not available. 15156 * # Available queues may not be in sequential order. 15157 */ 15158 uint8_t queue_id2; 15159 /* This value is applicable to CoS queues only. */ 15160 uint8_t queue_id2_service_profile; 15161 /* Lossy (best-effort) */ 15162 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \ 15163 UINT32_C(0x0) 15164 /* Lossless (legacy) */ 15165 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \ 15166 UINT32_C(0x1) 15167 /* Lossless RoCE */ 15168 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE \ 15169 UINT32_C(0x1) 15170 /* Lossy RoCE CNP */ 15171 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP \ 15172 UINT32_C(0x2) 15173 /* Lossless NIC */ 15174 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC \ 15175 UINT32_C(0x3) 15176 /* Set to 0xFF... (All Fs) if there is no service profile specified */ 15177 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \ 15178 UINT32_C(0xff) 15179 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST \ 15180 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN 15181 /* 15182 * ID of CoS Queue 3. 15183 * FF - Invalid id 15184 * 15185 * # This ID can be used on any subsequent call to an hwrm command 15186 * that takes a queue id. 15187 * # IDs must always be queried by this command before any use 15188 * by the driver or software. 15189 * # Any driver or software should not make any assumptions about 15190 * queue IDs. 15191 * # A value of 0xff indicates that the queue is not available. 15192 * # Available queues may not be in sequential order. 15193 */ 15194 uint8_t queue_id3; 15195 /* This value is applicable to CoS queues only. */ 15196 uint8_t queue_id3_service_profile; 15197 /* Lossy (best-effort) */ 15198 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \ 15199 UINT32_C(0x0) 15200 /* Lossless (legacy) */ 15201 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \ 15202 UINT32_C(0x1) 15203 /* Lossless RoCE */ 15204 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE \ 15205 UINT32_C(0x1) 15206 /* Lossy RoCE CNP */ 15207 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP \ 15208 UINT32_C(0x2) 15209 /* Lossless NIC */ 15210 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC \ 15211 UINT32_C(0x3) 15212 /* Set to 0xFF... (All Fs) if there is no service profile specified */ 15213 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \ 15214 UINT32_C(0xff) 15215 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST \ 15216 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN 15217 /* 15218 * ID of CoS Queue 4. 15219 * FF - Invalid id 15220 * 15221 * # This ID can be used on any subsequent call to an hwrm command 15222 * that takes a queue id. 15223 * # IDs must always be queried by this command before any use 15224 * by the driver or software. 15225 * # Any driver or software should not make any assumptions about 15226 * queue IDs. 15227 * # A value of 0xff indicates that the queue is not available. 15228 * # Available queues may not be in sequential order. 15229 */ 15230 uint8_t queue_id4; 15231 /* This value is applicable to CoS queues only. */ 15232 uint8_t queue_id4_service_profile; 15233 /* Lossy (best-effort) */ 15234 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \ 15235 UINT32_C(0x0) 15236 /* Lossless (legacy) */ 15237 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \ 15238 UINT32_C(0x1) 15239 /* Lossless RoCE */ 15240 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE \ 15241 UINT32_C(0x1) 15242 /* Lossy RoCE CNP */ 15243 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP \ 15244 UINT32_C(0x2) 15245 /* Lossless NIC */ 15246 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC \ 15247 UINT32_C(0x3) 15248 /* Set to 0xFF... (All Fs) if there is no service profile specified */ 15249 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \ 15250 UINT32_C(0xff) 15251 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST \ 15252 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN 15253 /* 15254 * ID of CoS Queue 5. 15255 * FF - Invalid id 15256 * 15257 * # This ID can be used on any subsequent call to an hwrm command 15258 * that takes a queue id. 15259 * # IDs must always be queried by this command before any use 15260 * by the driver or software. 15261 * # Any driver or software should not make any assumptions about 15262 * queue IDs. 15263 * # A value of 0xff indicates that the queue is not available. 15264 * # Available queues may not be in sequential order. 15265 */ 15266 uint8_t queue_id5; 15267 /* This value is applicable to CoS queues only. */ 15268 uint8_t queue_id5_service_profile; 15269 /* Lossy (best-effort) */ 15270 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \ 15271 UINT32_C(0x0) 15272 /* Lossless (legacy) */ 15273 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \ 15274 UINT32_C(0x1) 15275 /* Lossless RoCE */ 15276 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE \ 15277 UINT32_C(0x1) 15278 /* Lossy RoCE CNP */ 15279 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP \ 15280 UINT32_C(0x2) 15281 /* Lossless NIC */ 15282 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC \ 15283 UINT32_C(0x3) 15284 /* Set to 0xFF... (All Fs) if there is no service profile specified */ 15285 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \ 15286 UINT32_C(0xff) 15287 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST \ 15288 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN 15289 /* 15290 * ID of CoS Queue 6. 15291 * FF - Invalid id 15292 * 15293 * # This ID can be used on any subsequent call to an hwrm command 15294 * that takes a queue id. 15295 * # IDs must always be queried by this command before any use 15296 * by the driver or software. 15297 * # Any driver or software should not make any assumptions about 15298 * queue IDs. 15299 * # A value of 0xff indicates that the queue is not available. 15300 * # Available queues may not be in sequential order. 15301 */ 15302 uint8_t queue_id6; 15303 /* This value is applicable to CoS queues only. */ 15304 uint8_t queue_id6_service_profile; 15305 /* Lossy (best-effort) */ 15306 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \ 15307 UINT32_C(0x0) 15308 /* Lossless (legacy) */ 15309 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \ 15310 UINT32_C(0x1) 15311 /* Lossless RoCE */ 15312 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE \ 15313 UINT32_C(0x1) 15314 /* Lossy RoCE CNP */ 15315 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP \ 15316 UINT32_C(0x2) 15317 /* Lossless NIC */ 15318 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC \ 15319 UINT32_C(0x3) 15320 /* Set to 0xFF... (All Fs) if there is no service profile specified */ 15321 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \ 15322 UINT32_C(0xff) 15323 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST \ 15324 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN 15325 /* 15326 * ID of CoS Queue 7. 15327 * FF - Invalid id 15328 * 15329 * # This ID can be used on any subsequent call to an hwrm command 15330 * that takes a queue id. 15331 * # IDs must always be queried by this command before any use 15332 * by the driver or software. 15333 * # Any driver or software should not make any assumptions about 15334 * queue IDs. 15335 * # A value of 0xff indicates that the queue is not available. 15336 * # Available queues may not be in sequential order. 15337 */ 15338 uint8_t queue_id7; 15339 /* This value is applicable to CoS queues only. */ 15340 uint8_t queue_id7_service_profile; 15341 /* Lossy (best-effort) */ 15342 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \ 15343 UINT32_C(0x0) 15344 /* Lossless (legacy) */ 15345 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \ 15346 UINT32_C(0x1) 15347 /* Lossless RoCE */ 15348 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE \ 15349 UINT32_C(0x1) 15350 /* Lossy RoCE CNP */ 15351 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP \ 15352 UINT32_C(0x2) 15353 /* Lossless NIC */ 15354 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC \ 15355 UINT32_C(0x3) 15356 /* Set to 0xFF... (All Fs) if there is no service profile specified */ 15357 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \ 15358 UINT32_C(0xff) 15359 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST \ 15360 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN 15361 /* 15362 * This field is used in Output records to indicate that the output 15363 * is completely written to RAM. This field should be read as '1' 15364 * to indicate that the output has been completely written. 15365 * When writing a command completion or response to an internal processor, 15366 * the order of writes has to be such that this field is written last. 15367 */ 15368 uint8_t valid; 15369 } __attribute__((packed)); 15370 15371 /******************* 15372 * hwrm_queue_qcfg * 15373 *******************/ 15374 15375 15376 /* hwrm_queue_qcfg_input (size:192b/24B) */ 15377 struct hwrm_queue_qcfg_input { 15378 /* The HWRM command request type. */ 15379 uint16_t req_type; 15380 /* 15381 * The completion ring to send the completion event on. This should 15382 * be the NQ ID returned from the `nq_alloc` HWRM command. 15383 */ 15384 uint16_t cmpl_ring; 15385 /* 15386 * The sequence ID is used by the driver for tracking multiple 15387 * commands. This ID is treated as opaque data by the firmware and 15388 * the value is returned in the `hwrm_resp_hdr` upon completion. 15389 */ 15390 uint16_t seq_id; 15391 /* 15392 * The target ID of the command: 15393 * * 0x0-0xFFF8 - The function ID 15394 * * 0xFFF8-0xFFFE - Reserved for internal processors 15395 * * 0xFFFF - HWRM 15396 */ 15397 uint16_t target_id; 15398 /* 15399 * A physical address pointer pointing to a host buffer that the 15400 * command's response data will be written. This can be either a host 15401 * physical address (HPA) or a guest physical address (GPA) and must 15402 * point to a physically contiguous block of memory. 15403 */ 15404 uint64_t resp_addr; 15405 uint32_t flags; 15406 /* 15407 * Enumeration denoting the RX, TX type of the resource. 15408 * This enumeration is used for resources that are similar for both 15409 * TX and RX paths of the chip. 15410 */ 15411 #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH UINT32_C(0x1) 15412 /* tx path */ 15413 #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0) 15414 /* rx path */ 15415 #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1) 15416 #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST \ 15417 HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX 15418 /* Queue ID of the queue. */ 15419 uint32_t queue_id; 15420 } __attribute__((packed)); 15421 15422 /* hwrm_queue_qcfg_output (size:128b/16B) */ 15423 struct hwrm_queue_qcfg_output { 15424 /* The specific error status for the command. */ 15425 uint16_t error_code; 15426 /* The HWRM command request type. */ 15427 uint16_t req_type; 15428 /* The sequence ID from the original command. */ 15429 uint16_t seq_id; 15430 /* The length of the response data in number of bytes. */ 15431 uint16_t resp_len; 15432 /* 15433 * This value is a the estimate packet length used in the 15434 * TX arbiter. 15435 */ 15436 uint32_t queue_len; 15437 /* This value is applicable to CoS queues only. */ 15438 uint8_t service_profile; 15439 /* Lossy (best-effort) */ 15440 #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY UINT32_C(0x0) 15441 /* Lossless */ 15442 #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1) 15443 /* Set to 0xFF... (All Fs) if there is no service profile specified */ 15444 #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff) 15445 #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LAST \ 15446 HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN 15447 /* Information about queue configuration. */ 15448 uint8_t queue_cfg_info; 15449 /* 15450 * If this flag is set to '1', then the queue is 15451 * configured asymmetrically on TX and RX sides. 15452 * If this flag is set to '0', then this queue is 15453 * configured symmetrically on TX and RX sides. 15454 */ 15455 #define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \ 15456 UINT32_C(0x1) 15457 uint8_t unused_0; 15458 /* 15459 * This field is used in Output records to indicate that the output 15460 * is completely written to RAM. This field should be read as '1' 15461 * to indicate that the output has been completely written. 15462 * When writing a command completion or response to an internal processor, 15463 * the order of writes has to be such that this field is written last. 15464 */ 15465 uint8_t valid; 15466 } __attribute__((packed)); 15467 15468 /****************** 15469 * hwrm_queue_cfg * 15470 ******************/ 15471 15472 15473 /* hwrm_queue_cfg_input (size:320b/40B) */ 15474 struct hwrm_queue_cfg_input { 15475 /* The HWRM command request type. */ 15476 uint16_t req_type; 15477 /* 15478 * The completion ring to send the completion event on. This should 15479 * be the NQ ID returned from the `nq_alloc` HWRM command. 15480 */ 15481 uint16_t cmpl_ring; 15482 /* 15483 * The sequence ID is used by the driver for tracking multiple 15484 * commands. This ID is treated as opaque data by the firmware and 15485 * the value is returned in the `hwrm_resp_hdr` upon completion. 15486 */ 15487 uint16_t seq_id; 15488 /* 15489 * The target ID of the command: 15490 * * 0x0-0xFFF8 - The function ID 15491 * * 0xFFF8-0xFFFE - Reserved for internal processors 15492 * * 0xFFFF - HWRM 15493 */ 15494 uint16_t target_id; 15495 /* 15496 * A physical address pointer pointing to a host buffer that the 15497 * command's response data will be written. This can be either a host 15498 * physical address (HPA) or a guest physical address (GPA) and must 15499 * point to a physically contiguous block of memory. 15500 */ 15501 uint64_t resp_addr; 15502 uint32_t flags; 15503 /* 15504 * Enumeration denoting the RX, TX, or both directions applicable to the resource. 15505 * This enumeration is used for resources that are similar for both 15506 * TX and RX paths of the chip. 15507 */ 15508 #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3) 15509 #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT 0 15510 /* tx path */ 15511 #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0) 15512 /* rx path */ 15513 #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1) 15514 /* Bi-directional (Symmetrically applicable to TX and RX paths) */ 15515 #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR UINT32_C(0x2) 15516 #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST \ 15517 HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR 15518 uint32_t enables; 15519 /* 15520 * This bit must be '1' for the dflt_len field to be 15521 * configured. 15522 */ 15523 #define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN UINT32_C(0x1) 15524 /* 15525 * This bit must be '1' for the service_profile field to be 15526 * configured. 15527 */ 15528 #define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE UINT32_C(0x2) 15529 /* Queue ID of queue that is to be configured by this function. */ 15530 uint32_t queue_id; 15531 /* 15532 * This value is a the estimate packet length used in the 15533 * TX arbiter. 15534 * Set to 0xFF... (All Fs) to not adjust this value. 15535 */ 15536 uint32_t dflt_len; 15537 /* This value is applicable to CoS queues only. */ 15538 uint8_t service_profile; 15539 /* Lossy (best-effort) */ 15540 #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY UINT32_C(0x0) 15541 /* Lossless */ 15542 #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1) 15543 /* Set to 0xFF... (All Fs) if there is no service profile specified */ 15544 #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN UINT32_C(0xff) 15545 #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST \ 15546 HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN 15547 uint8_t unused_0[7]; 15548 } __attribute__((packed)); 15549 15550 /* hwrm_queue_cfg_output (size:128b/16B) */ 15551 struct hwrm_queue_cfg_output { 15552 /* The specific error status for the command. */ 15553 uint16_t error_code; 15554 /* The HWRM command request type. */ 15555 uint16_t req_type; 15556 /* The sequence ID from the original command. */ 15557 uint16_t seq_id; 15558 /* The length of the response data in number of bytes. */ 15559 uint16_t resp_len; 15560 uint8_t unused_0[7]; 15561 /* 15562 * This field is used in Output records to indicate that the output 15563 * is completely written to RAM. This field should be read as '1' 15564 * to indicate that the output has been completely written. 15565 * When writing a command completion or response to an internal processor, 15566 * the order of writes has to be such that this field is written last. 15567 */ 15568 uint8_t valid; 15569 } __attribute__((packed)); 15570 15571 /***************************** 15572 * hwrm_queue_pfcenable_qcfg * 15573 *****************************/ 15574 15575 15576 /* hwrm_queue_pfcenable_qcfg_input (size:192b/24B) */ 15577 struct hwrm_queue_pfcenable_qcfg_input { 15578 /* The HWRM command request type. */ 15579 uint16_t req_type; 15580 /* 15581 * The completion ring to send the completion event on. This should 15582 * be the NQ ID returned from the `nq_alloc` HWRM command. 15583 */ 15584 uint16_t cmpl_ring; 15585 /* 15586 * The sequence ID is used by the driver for tracking multiple 15587 * commands. This ID is treated as opaque data by the firmware and 15588 * the value is returned in the `hwrm_resp_hdr` upon completion. 15589 */ 15590 uint16_t seq_id; 15591 /* 15592 * The target ID of the command: 15593 * * 0x0-0xFFF8 - The function ID 15594 * * 0xFFF8-0xFFFE - Reserved for internal processors 15595 * * 0xFFFF - HWRM 15596 */ 15597 uint16_t target_id; 15598 /* 15599 * A physical address pointer pointing to a host buffer that the 15600 * command's response data will be written. This can be either a host 15601 * physical address (HPA) or a guest physical address (GPA) and must 15602 * point to a physically contiguous block of memory. 15603 */ 15604 uint64_t resp_addr; 15605 /* 15606 * Port ID of port for which the table is being configured. 15607 * The HWRM needs to check whether this function is allowed 15608 * to configure pri2cos mapping on this port. 15609 */ 15610 uint16_t port_id; 15611 uint8_t unused_0[6]; 15612 } __attribute__((packed)); 15613 15614 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */ 15615 struct hwrm_queue_pfcenable_qcfg_output { 15616 /* The specific error status for the command. */ 15617 uint16_t error_code; 15618 /* The HWRM command request type. */ 15619 uint16_t req_type; 15620 /* The sequence ID from the original command. */ 15621 uint16_t seq_id; 15622 /* The length of the response data in number of bytes. */ 15623 uint16_t resp_len; 15624 uint32_t flags; 15625 /* If set to 1, then PFC is enabled on PRI 0. */ 15626 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED \ 15627 UINT32_C(0x1) 15628 /* If set to 1, then PFC is enabled on PRI 1. */ 15629 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED \ 15630 UINT32_C(0x2) 15631 /* If set to 1, then PFC is enabled on PRI 2. */ 15632 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED \ 15633 UINT32_C(0x4) 15634 /* If set to 1, then PFC is enabled on PRI 3. */ 15635 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED \ 15636 UINT32_C(0x8) 15637 /* If set to 1, then PFC is enabled on PRI 4. */ 15638 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED \ 15639 UINT32_C(0x10) 15640 /* If set to 1, then PFC is enabled on PRI 5. */ 15641 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED \ 15642 UINT32_C(0x20) 15643 /* If set to 1, then PFC is enabled on PRI 6. */ 15644 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED \ 15645 UINT32_C(0x40) 15646 /* If set to 1, then PFC is enabled on PRI 7. */ 15647 #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED \ 15648 UINT32_C(0x80) 15649 uint8_t unused_0[3]; 15650 /* 15651 * This field is used in Output records to indicate that the output 15652 * is completely written to RAM. This field should be read as '1' 15653 * to indicate that the output has been completely written. 15654 * When writing a command completion or response to an internal processor, 15655 * the order of writes has to be such that this field is written last. 15656 */ 15657 uint8_t valid; 15658 } __attribute__((packed)); 15659 15660 /**************************** 15661 * hwrm_queue_pfcenable_cfg * 15662 ****************************/ 15663 15664 15665 /* hwrm_queue_pfcenable_cfg_input (size:192b/24B) */ 15666 struct hwrm_queue_pfcenable_cfg_input { 15667 /* The HWRM command request type. */ 15668 uint16_t req_type; 15669 /* 15670 * The completion ring to send the completion event on. This should 15671 * be the NQ ID returned from the `nq_alloc` HWRM command. 15672 */ 15673 uint16_t cmpl_ring; 15674 /* 15675 * The sequence ID is used by the driver for tracking multiple 15676 * commands. This ID is treated as opaque data by the firmware and 15677 * the value is returned in the `hwrm_resp_hdr` upon completion. 15678 */ 15679 uint16_t seq_id; 15680 /* 15681 * The target ID of the command: 15682 * * 0x0-0xFFF8 - The function ID 15683 * * 0xFFF8-0xFFFE - Reserved for internal processors 15684 * * 0xFFFF - HWRM 15685 */ 15686 uint16_t target_id; 15687 /* 15688 * A physical address pointer pointing to a host buffer that the 15689 * command's response data will be written. This can be either a host 15690 * physical address (HPA) or a guest physical address (GPA) and must 15691 * point to a physically contiguous block of memory. 15692 */ 15693 uint64_t resp_addr; 15694 uint32_t flags; 15695 /* If set to 1, then PFC is requested to be enabled on PRI 0. */ 15696 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED \ 15697 UINT32_C(0x1) 15698 /* If set to 1, then PFC is requested to be enabled on PRI 1. */ 15699 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED \ 15700 UINT32_C(0x2) 15701 /* If set to 1, then PFC is requested to be enabled on PRI 2. */ 15702 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED \ 15703 UINT32_C(0x4) 15704 /* If set to 1, then PFC is requested to be enabled on PRI 3. */ 15705 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED \ 15706 UINT32_C(0x8) 15707 /* If set to 1, then PFC is requested to be enabled on PRI 4. */ 15708 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED \ 15709 UINT32_C(0x10) 15710 /* If set to 1, then PFC is requested to be enabled on PRI 5. */ 15711 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED \ 15712 UINT32_C(0x20) 15713 /* If set to 1, then PFC is requested to be enabled on PRI 6. */ 15714 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED \ 15715 UINT32_C(0x40) 15716 /* If set to 1, then PFC is requested to be enabled on PRI 7. */ 15717 #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED \ 15718 UINT32_C(0x80) 15719 /* 15720 * Port ID of port for which the table is being configured. 15721 * The HWRM needs to check whether this function is allowed 15722 * to configure pri2cos mapping on this port. 15723 */ 15724 uint16_t port_id; 15725 uint8_t unused_0[2]; 15726 } __attribute__((packed)); 15727 15728 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */ 15729 struct hwrm_queue_pfcenable_cfg_output { 15730 /* The specific error status for the command. */ 15731 uint16_t error_code; 15732 /* The HWRM command request type. */ 15733 uint16_t req_type; 15734 /* The sequence ID from the original command. */ 15735 uint16_t seq_id; 15736 /* The length of the response data in number of bytes. */ 15737 uint16_t resp_len; 15738 uint8_t unused_0[7]; 15739 /* 15740 * This field is used in Output records to indicate that the output 15741 * is completely written to RAM. This field should be read as '1' 15742 * to indicate that the output has been completely written. 15743 * When writing a command completion or response to an internal processor, 15744 * the order of writes has to be such that this field is written last. 15745 */ 15746 uint8_t valid; 15747 } __attribute__((packed)); 15748 15749 /*************************** 15750 * hwrm_queue_pri2cos_qcfg * 15751 ***************************/ 15752 15753 15754 /* hwrm_queue_pri2cos_qcfg_input (size:192b/24B) */ 15755 struct hwrm_queue_pri2cos_qcfg_input { 15756 /* The HWRM command request type. */ 15757 uint16_t req_type; 15758 /* 15759 * The completion ring to send the completion event on. This should 15760 * be the NQ ID returned from the `nq_alloc` HWRM command. 15761 */ 15762 uint16_t cmpl_ring; 15763 /* 15764 * The sequence ID is used by the driver for tracking multiple 15765 * commands. This ID is treated as opaque data by the firmware and 15766 * the value is returned in the `hwrm_resp_hdr` upon completion. 15767 */ 15768 uint16_t seq_id; 15769 /* 15770 * The target ID of the command: 15771 * * 0x0-0xFFF8 - The function ID 15772 * * 0xFFF8-0xFFFE - Reserved for internal processors 15773 * * 0xFFFF - HWRM 15774 */ 15775 uint16_t target_id; 15776 /* 15777 * A physical address pointer pointing to a host buffer that the 15778 * command's response data will be written. This can be either a host 15779 * physical address (HPA) or a guest physical address (GPA) and must 15780 * point to a physically contiguous block of memory. 15781 */ 15782 uint64_t resp_addr; 15783 uint32_t flags; 15784 /* 15785 * Enumeration denoting the RX, TX type of the resource. 15786 * This enumeration is used for resources that are similar for both 15787 * TX and RX paths of the chip. 15788 */ 15789 #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH UINT32_C(0x1) 15790 /* tx path */ 15791 #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0) 15792 /* rx path */ 15793 #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1) 15794 #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST \ 15795 HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX 15796 /* 15797 * When this bit is set to '0', the query is 15798 * for VLAN PRI field in tunnel headers. 15799 * When this bit is set to '1', the query is 15800 * for VLAN PRI field in inner packet headers. 15801 */ 15802 #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN UINT32_C(0x2) 15803 /* 15804 * Port ID of port for which the table is being configured. 15805 * The HWRM needs to check whether this function is allowed 15806 * to configure pri2cos mapping on this port. 15807 */ 15808 uint8_t port_id; 15809 uint8_t unused_0[3]; 15810 } __attribute__((packed)); 15811 15812 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */ 15813 struct hwrm_queue_pri2cos_qcfg_output { 15814 /* The specific error status for the command. */ 15815 uint16_t error_code; 15816 /* The HWRM command request type. */ 15817 uint16_t req_type; 15818 /* The sequence ID from the original command. */ 15819 uint16_t seq_id; 15820 /* The length of the response data in number of bytes. */ 15821 uint16_t resp_len; 15822 /* 15823 * CoS Queue assigned to priority 0. This value can only 15824 * be changed before traffic has started. 15825 * A value of 0xff indicates that no CoS queue is assigned to the 15826 * specified priority. 15827 */ 15828 uint8_t pri0_cos_queue_id; 15829 /* 15830 * CoS Queue assigned to priority 1. This value can only 15831 * be changed before traffic has started. 15832 * A value of 0xff indicates that no CoS queue is assigned to the 15833 * specified priority. 15834 */ 15835 uint8_t pri1_cos_queue_id; 15836 /* 15837 * CoS Queue assigned to priority 2 This value can only 15838 * be changed before traffic has started. 15839 * A value of 0xff indicates that no CoS queue is assigned to the 15840 * specified priority. 15841 */ 15842 uint8_t pri2_cos_queue_id; 15843 /* 15844 * CoS Queue assigned to priority 3. This value can only 15845 * be changed before traffic has started. 15846 * A value of 0xff indicates that no CoS queue is assigned to the 15847 * specified priority. 15848 */ 15849 uint8_t pri3_cos_queue_id; 15850 /* 15851 * CoS Queue assigned to priority 4. This value can only 15852 * be changed before traffic has started. 15853 * A value of 0xff indicates that no CoS queue is assigned to the 15854 * specified priority. 15855 */ 15856 uint8_t pri4_cos_queue_id; 15857 /* 15858 * CoS Queue assigned to priority 5. This value can only 15859 * be changed before traffic has started. 15860 * A value of 0xff indicates that no CoS queue is assigned to the 15861 * specified priority. 15862 */ 15863 uint8_t pri5_cos_queue_id; 15864 /* 15865 * CoS Queue assigned to priority 6. This value can only 15866 * be changed before traffic has started. 15867 * A value of 0xff indicates that no CoS queue is assigned to the 15868 * specified priority. 15869 */ 15870 uint8_t pri6_cos_queue_id; 15871 /* 15872 * CoS Queue assigned to priority 7. This value can only 15873 * be changed before traffic has started. 15874 * A value of 0xff indicates that no CoS queue is assigned to the 15875 * specified priority. 15876 */ 15877 uint8_t pri7_cos_queue_id; 15878 /* Information about queue configuration. */ 15879 uint8_t queue_cfg_info; 15880 /* 15881 * If this flag is set to '1', then the PRI to CoS 15882 * configuration is asymmetric on TX and RX sides. 15883 * If this flag is set to '0', then PRI to CoS configuration 15884 * is symmetric on TX and RX sides. 15885 */ 15886 #define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \ 15887 UINT32_C(0x1) 15888 uint8_t unused_0[6]; 15889 /* 15890 * This field is used in Output records to indicate that the output 15891 * is completely written to RAM. This field should be read as '1' 15892 * to indicate that the output has been completely written. 15893 * When writing a command completion or response to an internal processor, 15894 * the order of writes has to be such that this field is written last. 15895 */ 15896 uint8_t valid; 15897 } __attribute__((packed)); 15898 15899 /************************** 15900 * hwrm_queue_pri2cos_cfg * 15901 **************************/ 15902 15903 15904 /* hwrm_queue_pri2cos_cfg_input (size:320b/40B) */ 15905 struct hwrm_queue_pri2cos_cfg_input { 15906 /* The HWRM command request type. */ 15907 uint16_t req_type; 15908 /* 15909 * The completion ring to send the completion event on. This should 15910 * be the NQ ID returned from the `nq_alloc` HWRM command. 15911 */ 15912 uint16_t cmpl_ring; 15913 /* 15914 * The sequence ID is used by the driver for tracking multiple 15915 * commands. This ID is treated as opaque data by the firmware and 15916 * the value is returned in the `hwrm_resp_hdr` upon completion. 15917 */ 15918 uint16_t seq_id; 15919 /* 15920 * The target ID of the command: 15921 * * 0x0-0xFFF8 - The function ID 15922 * * 0xFFF8-0xFFFE - Reserved for internal processors 15923 * * 0xFFFF - HWRM 15924 */ 15925 uint16_t target_id; 15926 /* 15927 * A physical address pointer pointing to a host buffer that the 15928 * command's response data will be written. This can be either a host 15929 * physical address (HPA) or a guest physical address (GPA) and must 15930 * point to a physically contiguous block of memory. 15931 */ 15932 uint64_t resp_addr; 15933 uint32_t flags; 15934 /* 15935 * Enumeration denoting the RX, TX, or both directions applicable to the resource. 15936 * This enumeration is used for resources that are similar for both 15937 * TX and RX paths of the chip. 15938 */ 15939 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3) 15940 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT 0 15941 /* tx path */ 15942 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0) 15943 /* rx path */ 15944 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1) 15945 /* Bi-directional (Symmetrically applicable to TX and RX paths) */ 15946 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR UINT32_C(0x2) 15947 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST \ 15948 HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR 15949 /* 15950 * When this bit is set to '0', the mapping is requested 15951 * for VLAN PRI field in tunnel headers. 15952 * When this bit is set to '1', the mapping is requested 15953 * for VLAN PRI field in inner packet headers. 15954 */ 15955 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN UINT32_C(0x4) 15956 uint32_t enables; 15957 /* 15958 * This bit must be '1' for the pri0_cos_queue_id field to be 15959 * configured. 15960 */ 15961 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID \ 15962 UINT32_C(0x1) 15963 /* 15964 * This bit must be '1' for the pri1_cos_queue_id field to be 15965 * configured. 15966 */ 15967 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID \ 15968 UINT32_C(0x2) 15969 /* 15970 * This bit must be '1' for the pri2_cos_queue_id field to be 15971 * configured. 15972 */ 15973 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID \ 15974 UINT32_C(0x4) 15975 /* 15976 * This bit must be '1' for the pri3_cos_queue_id field to be 15977 * configured. 15978 */ 15979 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID \ 15980 UINT32_C(0x8) 15981 /* 15982 * This bit must be '1' for the pri4_cos_queue_id field to be 15983 * configured. 15984 */ 15985 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID \ 15986 UINT32_C(0x10) 15987 /* 15988 * This bit must be '1' for the pri5_cos_queue_id field to be 15989 * configured. 15990 */ 15991 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID \ 15992 UINT32_C(0x20) 15993 /* 15994 * This bit must be '1' for the pri6_cos_queue_id field to be 15995 * configured. 15996 */ 15997 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID \ 15998 UINT32_C(0x40) 15999 /* 16000 * This bit must be '1' for the pri7_cos_queue_id field to be 16001 * configured. 16002 */ 16003 #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID \ 16004 UINT32_C(0x80) 16005 /* 16006 * Port ID of port for which the table is being configured. 16007 * The HWRM needs to check whether this function is allowed 16008 * to configure pri2cos mapping on this port. 16009 */ 16010 uint8_t port_id; 16011 /* 16012 * CoS Queue assigned to priority 0. This value can only 16013 * be changed before traffic has started. 16014 */ 16015 uint8_t pri0_cos_queue_id; 16016 /* 16017 * CoS Queue assigned to priority 1. This value can only 16018 * be changed before traffic has started. 16019 */ 16020 uint8_t pri1_cos_queue_id; 16021 /* 16022 * CoS Queue assigned to priority 2 This value can only 16023 * be changed before traffic has started. 16024 */ 16025 uint8_t pri2_cos_queue_id; 16026 /* 16027 * CoS Queue assigned to priority 3. This value can only 16028 * be changed before traffic has started. 16029 */ 16030 uint8_t pri3_cos_queue_id; 16031 /* 16032 * CoS Queue assigned to priority 4. This value can only 16033 * be changed before traffic has started. 16034 */ 16035 uint8_t pri4_cos_queue_id; 16036 /* 16037 * CoS Queue assigned to priority 5. This value can only 16038 * be changed before traffic has started. 16039 */ 16040 uint8_t pri5_cos_queue_id; 16041 /* 16042 * CoS Queue assigned to priority 6. This value can only 16043 * be changed before traffic has started. 16044 */ 16045 uint8_t pri6_cos_queue_id; 16046 /* 16047 * CoS Queue assigned to priority 7. This value can only 16048 * be changed before traffic has started. 16049 */ 16050 uint8_t pri7_cos_queue_id; 16051 uint8_t unused_0[7]; 16052 } __attribute__((packed)); 16053 16054 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */ 16055 struct hwrm_queue_pri2cos_cfg_output { 16056 /* The specific error status for the command. */ 16057 uint16_t error_code; 16058 /* The HWRM command request type. */ 16059 uint16_t req_type; 16060 /* The sequence ID from the original command. */ 16061 uint16_t seq_id; 16062 /* The length of the response data in number of bytes. */ 16063 uint16_t resp_len; 16064 uint8_t unused_0[7]; 16065 /* 16066 * This field is used in Output records to indicate that the output 16067 * is completely written to RAM. This field should be read as '1' 16068 * to indicate that the output has been completely written. 16069 * When writing a command completion or response to an internal processor, 16070 * the order of writes has to be such that this field is written last. 16071 */ 16072 uint8_t valid; 16073 } __attribute__((packed)); 16074 16075 /************************** 16076 * hwrm_queue_cos2bw_qcfg * 16077 **************************/ 16078 16079 16080 /* hwrm_queue_cos2bw_qcfg_input (size:192b/24B) */ 16081 struct hwrm_queue_cos2bw_qcfg_input { 16082 /* The HWRM command request type. */ 16083 uint16_t req_type; 16084 /* 16085 * The completion ring to send the completion event on. This should 16086 * be the NQ ID returned from the `nq_alloc` HWRM command. 16087 */ 16088 uint16_t cmpl_ring; 16089 /* 16090 * The sequence ID is used by the driver for tracking multiple 16091 * commands. This ID is treated as opaque data by the firmware and 16092 * the value is returned in the `hwrm_resp_hdr` upon completion. 16093 */ 16094 uint16_t seq_id; 16095 /* 16096 * The target ID of the command: 16097 * * 0x0-0xFFF8 - The function ID 16098 * * 0xFFF8-0xFFFE - Reserved for internal processors 16099 * * 0xFFFF - HWRM 16100 */ 16101 uint16_t target_id; 16102 /* 16103 * A physical address pointer pointing to a host buffer that the 16104 * command's response data will be written. This can be either a host 16105 * physical address (HPA) or a guest physical address (GPA) and must 16106 * point to a physically contiguous block of memory. 16107 */ 16108 uint64_t resp_addr; 16109 /* 16110 * Port ID of port for which the table is being configured. 16111 * The HWRM needs to check whether this function is allowed 16112 * to configure TC BW assignment on this port. 16113 */ 16114 uint16_t port_id; 16115 uint8_t unused_0[6]; 16116 } __attribute__((packed)); 16117 16118 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */ 16119 struct hwrm_queue_cos2bw_qcfg_output { 16120 /* The specific error status for the command. */ 16121 uint16_t error_code; 16122 /* The HWRM command request type. */ 16123 uint16_t req_type; 16124 /* The sequence ID from the original command. */ 16125 uint16_t seq_id; 16126 /* The length of the response data in number of bytes. */ 16127 uint16_t resp_len; 16128 /* ID of CoS Queue 0. */ 16129 uint8_t queue_id0; 16130 uint8_t unused_0; 16131 uint16_t unused_1; 16132 /* 16133 * Minimum BW allocated to CoS Queue. 16134 * The HWRM will translate this value into byte counter and 16135 * time interval used for this COS inside the device. 16136 */ 16137 uint32_t queue_id0_min_bw; 16138 /* The bandwidth value. */ 16139 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \ 16140 UINT32_C(0xfffffff) 16141 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \ 16142 0 16143 /* The granularity of the value (bits or bytes). */ 16144 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE \ 16145 UINT32_C(0x10000000) 16146 /* Value is in bits. */ 16147 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \ 16148 (UINT32_C(0x0) << 28) 16149 /* Value is in bytes. */ 16150 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \ 16151 (UINT32_C(0x1) << 28) 16152 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \ 16153 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES 16154 /* bw_value_unit is 3 b */ 16155 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \ 16156 UINT32_C(0xe0000000) 16157 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \ 16158 29 16159 /* Value is in Mb or MB (base 10). */ 16160 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \ 16161 (UINT32_C(0x0) << 29) 16162 /* Value is in Kb or KB (base 10). */ 16163 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \ 16164 (UINT32_C(0x2) << 29) 16165 /* Value is in bits or bytes. */ 16166 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \ 16167 (UINT32_C(0x4) << 29) 16168 /* Value is in Gb or GB (base 10). */ 16169 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \ 16170 (UINT32_C(0x6) << 29) 16171 /* Value is in 1/100th of a percentage of total bandwidth. */ 16172 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16173 (UINT32_C(0x1) << 29) 16174 /* Invalid unit */ 16175 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \ 16176 (UINT32_C(0x7) << 29) 16177 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \ 16178 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID 16179 /* 16180 * Maximum BW allocated to CoS Queue. 16181 * The HWRM will translate this value into byte counter and 16182 * time interval used for this COS inside the device. 16183 */ 16184 uint32_t queue_id0_max_bw; 16185 /* The bandwidth value. */ 16186 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \ 16187 UINT32_C(0xfffffff) 16188 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \ 16189 0 16190 /* The granularity of the value (bits or bytes). */ 16191 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE \ 16192 UINT32_C(0x10000000) 16193 /* Value is in bits. */ 16194 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \ 16195 (UINT32_C(0x0) << 28) 16196 /* Value is in bytes. */ 16197 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \ 16198 (UINT32_C(0x1) << 28) 16199 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \ 16200 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES 16201 /* bw_value_unit is 3 b */ 16202 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \ 16203 UINT32_C(0xe0000000) 16204 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \ 16205 29 16206 /* Value is in Mb or MB (base 10). */ 16207 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \ 16208 (UINT32_C(0x0) << 29) 16209 /* Value is in Kb or KB (base 10). */ 16210 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \ 16211 (UINT32_C(0x2) << 29) 16212 /* Value is in bits or bytes. */ 16213 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \ 16214 (UINT32_C(0x4) << 29) 16215 /* Value is in Gb or GB (base 10). */ 16216 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \ 16217 (UINT32_C(0x6) << 29) 16218 /* Value is in 1/100th of a percentage of total bandwidth. */ 16219 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16220 (UINT32_C(0x1) << 29) 16221 /* Invalid unit */ 16222 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \ 16223 (UINT32_C(0x7) << 29) 16224 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \ 16225 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID 16226 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 16227 uint8_t queue_id0_tsa_assign; 16228 /* Strict Priority */ 16229 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP \ 16230 UINT32_C(0x0) 16231 /* Enhanced Transmission Selection */ 16232 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS \ 16233 UINT32_C(0x1) 16234 /* reserved. */ 16235 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \ 16236 UINT32_C(0x2) 16237 /* reserved. */ 16238 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \ 16239 UINT32_C(0xff) 16240 /* 16241 * Priority level for strict priority. Valid only when the 16242 * tsa_assign is 0 - Strict Priority (SP) 16243 * 0..7 - Valid values. 16244 * 8..255 - Reserved. 16245 */ 16246 uint8_t queue_id0_pri_lvl; 16247 /* 16248 * Weight used to allocate remaining BW for this COS after 16249 * servicing guaranteed bandwidths for all COS. 16250 */ 16251 uint8_t queue_id0_bw_weight; 16252 /* ID of CoS Queue 1. */ 16253 uint8_t queue_id1; 16254 /* 16255 * Minimum BW allocated to CoS Queue. 16256 * The HWRM will translate this value into byte counter and 16257 * time interval used for this COS inside the device. 16258 */ 16259 uint32_t queue_id1_min_bw; 16260 /* The bandwidth value. */ 16261 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \ 16262 UINT32_C(0xfffffff) 16263 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \ 16264 0 16265 /* The granularity of the value (bits or bytes). */ 16266 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE \ 16267 UINT32_C(0x10000000) 16268 /* Value is in bits. */ 16269 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \ 16270 (UINT32_C(0x0) << 28) 16271 /* Value is in bytes. */ 16272 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \ 16273 (UINT32_C(0x1) << 28) 16274 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \ 16275 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES 16276 /* bw_value_unit is 3 b */ 16277 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \ 16278 UINT32_C(0xe0000000) 16279 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \ 16280 29 16281 /* Value is in Mb or MB (base 10). */ 16282 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \ 16283 (UINT32_C(0x0) << 29) 16284 /* Value is in Kb or KB (base 10). */ 16285 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \ 16286 (UINT32_C(0x2) << 29) 16287 /* Value is in bits or bytes. */ 16288 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \ 16289 (UINT32_C(0x4) << 29) 16290 /* Value is in Gb or GB (base 10). */ 16291 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \ 16292 (UINT32_C(0x6) << 29) 16293 /* Value is in 1/100th of a percentage of total bandwidth. */ 16294 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16295 (UINT32_C(0x1) << 29) 16296 /* Invalid unit */ 16297 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \ 16298 (UINT32_C(0x7) << 29) 16299 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \ 16300 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID 16301 /* 16302 * Maximum BW allocated to CoS queue. 16303 * The HWRM will translate this value into byte counter and 16304 * time interval used for this COS inside the device. 16305 */ 16306 uint32_t queue_id1_max_bw; 16307 /* The bandwidth value. */ 16308 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \ 16309 UINT32_C(0xfffffff) 16310 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \ 16311 0 16312 /* The granularity of the value (bits or bytes). */ 16313 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE \ 16314 UINT32_C(0x10000000) 16315 /* Value is in bits. */ 16316 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \ 16317 (UINT32_C(0x0) << 28) 16318 /* Value is in bytes. */ 16319 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \ 16320 (UINT32_C(0x1) << 28) 16321 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \ 16322 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES 16323 /* bw_value_unit is 3 b */ 16324 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \ 16325 UINT32_C(0xe0000000) 16326 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \ 16327 29 16328 /* Value is in Mb or MB (base 10). */ 16329 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \ 16330 (UINT32_C(0x0) << 29) 16331 /* Value is in Kb or KB (base 10). */ 16332 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \ 16333 (UINT32_C(0x2) << 29) 16334 /* Value is in bits or bytes. */ 16335 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \ 16336 (UINT32_C(0x4) << 29) 16337 /* Value is in Gb or GB (base 10). */ 16338 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \ 16339 (UINT32_C(0x6) << 29) 16340 /* Value is in 1/100th of a percentage of total bandwidth. */ 16341 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16342 (UINT32_C(0x1) << 29) 16343 /* Invalid unit */ 16344 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \ 16345 (UINT32_C(0x7) << 29) 16346 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \ 16347 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID 16348 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 16349 uint8_t queue_id1_tsa_assign; 16350 /* Strict Priority */ 16351 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP \ 16352 UINT32_C(0x0) 16353 /* Enhanced Transmission Selection */ 16354 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS \ 16355 UINT32_C(0x1) 16356 /* reserved. */ 16357 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \ 16358 UINT32_C(0x2) 16359 /* reserved. */ 16360 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \ 16361 UINT32_C(0xff) 16362 /* 16363 * Priority level for strict priority. Valid only when the 16364 * tsa_assign is 0 - Strict Priority (SP) 16365 * 0..7 - Valid values. 16366 * 8..255 - Reserved. 16367 */ 16368 uint8_t queue_id1_pri_lvl; 16369 /* 16370 * Weight used to allocate remaining BW for this COS after 16371 * servicing guaranteed bandwidths for all COS. 16372 */ 16373 uint8_t queue_id1_bw_weight; 16374 /* ID of CoS Queue 2. */ 16375 uint8_t queue_id2; 16376 /* 16377 * Minimum BW allocated to CoS Queue. 16378 * The HWRM will translate this value into byte counter and 16379 * time interval used for this COS inside the device. 16380 */ 16381 uint32_t queue_id2_min_bw; 16382 /* The bandwidth value. */ 16383 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \ 16384 UINT32_C(0xfffffff) 16385 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \ 16386 0 16387 /* The granularity of the value (bits or bytes). */ 16388 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE \ 16389 UINT32_C(0x10000000) 16390 /* Value is in bits. */ 16391 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \ 16392 (UINT32_C(0x0) << 28) 16393 /* Value is in bytes. */ 16394 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \ 16395 (UINT32_C(0x1) << 28) 16396 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \ 16397 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES 16398 /* bw_value_unit is 3 b */ 16399 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \ 16400 UINT32_C(0xe0000000) 16401 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \ 16402 29 16403 /* Value is in Mb or MB (base 10). */ 16404 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \ 16405 (UINT32_C(0x0) << 29) 16406 /* Value is in Kb or KB (base 10). */ 16407 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \ 16408 (UINT32_C(0x2) << 29) 16409 /* Value is in bits or bytes. */ 16410 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \ 16411 (UINT32_C(0x4) << 29) 16412 /* Value is in Gb or GB (base 10). */ 16413 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \ 16414 (UINT32_C(0x6) << 29) 16415 /* Value is in 1/100th of a percentage of total bandwidth. */ 16416 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16417 (UINT32_C(0x1) << 29) 16418 /* Invalid unit */ 16419 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \ 16420 (UINT32_C(0x7) << 29) 16421 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \ 16422 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID 16423 /* 16424 * Maximum BW allocated to CoS queue. 16425 * The HWRM will translate this value into byte counter and 16426 * time interval used for this COS inside the device. 16427 */ 16428 uint32_t queue_id2_max_bw; 16429 /* The bandwidth value. */ 16430 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \ 16431 UINT32_C(0xfffffff) 16432 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \ 16433 0 16434 /* The granularity of the value (bits or bytes). */ 16435 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE \ 16436 UINT32_C(0x10000000) 16437 /* Value is in bits. */ 16438 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \ 16439 (UINT32_C(0x0) << 28) 16440 /* Value is in bytes. */ 16441 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \ 16442 (UINT32_C(0x1) << 28) 16443 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \ 16444 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES 16445 /* bw_value_unit is 3 b */ 16446 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \ 16447 UINT32_C(0xe0000000) 16448 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \ 16449 29 16450 /* Value is in Mb or MB (base 10). */ 16451 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \ 16452 (UINT32_C(0x0) << 29) 16453 /* Value is in Kb or KB (base 10). */ 16454 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \ 16455 (UINT32_C(0x2) << 29) 16456 /* Value is in bits or bytes. */ 16457 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \ 16458 (UINT32_C(0x4) << 29) 16459 /* Value is in Gb or GB (base 10). */ 16460 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \ 16461 (UINT32_C(0x6) << 29) 16462 /* Value is in 1/100th of a percentage of total bandwidth. */ 16463 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16464 (UINT32_C(0x1) << 29) 16465 /* Invalid unit */ 16466 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \ 16467 (UINT32_C(0x7) << 29) 16468 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \ 16469 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID 16470 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 16471 uint8_t queue_id2_tsa_assign; 16472 /* Strict Priority */ 16473 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP \ 16474 UINT32_C(0x0) 16475 /* Enhanced Transmission Selection */ 16476 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS \ 16477 UINT32_C(0x1) 16478 /* reserved. */ 16479 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \ 16480 UINT32_C(0x2) 16481 /* reserved. */ 16482 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \ 16483 UINT32_C(0xff) 16484 /* 16485 * Priority level for strict priority. Valid only when the 16486 * tsa_assign is 0 - Strict Priority (SP) 16487 * 0..7 - Valid values. 16488 * 8..255 - Reserved. 16489 */ 16490 uint8_t queue_id2_pri_lvl; 16491 /* 16492 * Weight used to allocate remaining BW for this COS after 16493 * servicing guaranteed bandwidths for all COS. 16494 */ 16495 uint8_t queue_id2_bw_weight; 16496 /* ID of CoS Queue 3. */ 16497 uint8_t queue_id3; 16498 /* 16499 * Minimum BW allocated to CoS Queue. 16500 * The HWRM will translate this value into byte counter and 16501 * time interval used for this COS inside the device. 16502 */ 16503 uint32_t queue_id3_min_bw; 16504 /* The bandwidth value. */ 16505 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \ 16506 UINT32_C(0xfffffff) 16507 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \ 16508 0 16509 /* The granularity of the value (bits or bytes). */ 16510 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE \ 16511 UINT32_C(0x10000000) 16512 /* Value is in bits. */ 16513 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \ 16514 (UINT32_C(0x0) << 28) 16515 /* Value is in bytes. */ 16516 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \ 16517 (UINT32_C(0x1) << 28) 16518 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \ 16519 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES 16520 /* bw_value_unit is 3 b */ 16521 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \ 16522 UINT32_C(0xe0000000) 16523 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \ 16524 29 16525 /* Value is in Mb or MB (base 10). */ 16526 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \ 16527 (UINT32_C(0x0) << 29) 16528 /* Value is in Kb or KB (base 10). */ 16529 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \ 16530 (UINT32_C(0x2) << 29) 16531 /* Value is in bits or bytes. */ 16532 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \ 16533 (UINT32_C(0x4) << 29) 16534 /* Value is in Gb or GB (base 10). */ 16535 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \ 16536 (UINT32_C(0x6) << 29) 16537 /* Value is in 1/100th of a percentage of total bandwidth. */ 16538 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16539 (UINT32_C(0x1) << 29) 16540 /* Invalid unit */ 16541 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \ 16542 (UINT32_C(0x7) << 29) 16543 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \ 16544 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID 16545 /* 16546 * Maximum BW allocated to CoS queue. 16547 * The HWRM will translate this value into byte counter and 16548 * time interval used for this COS inside the device. 16549 */ 16550 uint32_t queue_id3_max_bw; 16551 /* The bandwidth value. */ 16552 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \ 16553 UINT32_C(0xfffffff) 16554 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \ 16555 0 16556 /* The granularity of the value (bits or bytes). */ 16557 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE \ 16558 UINT32_C(0x10000000) 16559 /* Value is in bits. */ 16560 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \ 16561 (UINT32_C(0x0) << 28) 16562 /* Value is in bytes. */ 16563 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \ 16564 (UINT32_C(0x1) << 28) 16565 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \ 16566 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES 16567 /* bw_value_unit is 3 b */ 16568 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \ 16569 UINT32_C(0xe0000000) 16570 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \ 16571 29 16572 /* Value is in Mb or MB (base 10). */ 16573 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \ 16574 (UINT32_C(0x0) << 29) 16575 /* Value is in Kb or KB (base 10). */ 16576 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \ 16577 (UINT32_C(0x2) << 29) 16578 /* Value is in bits or bytes. */ 16579 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \ 16580 (UINT32_C(0x4) << 29) 16581 /* Value is in Gb or GB (base 10). */ 16582 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \ 16583 (UINT32_C(0x6) << 29) 16584 /* Value is in 1/100th of a percentage of total bandwidth. */ 16585 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16586 (UINT32_C(0x1) << 29) 16587 /* Invalid unit */ 16588 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \ 16589 (UINT32_C(0x7) << 29) 16590 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \ 16591 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID 16592 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 16593 uint8_t queue_id3_tsa_assign; 16594 /* Strict Priority */ 16595 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP \ 16596 UINT32_C(0x0) 16597 /* Enhanced Transmission Selection */ 16598 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS \ 16599 UINT32_C(0x1) 16600 /* reserved. */ 16601 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \ 16602 UINT32_C(0x2) 16603 /* reserved. */ 16604 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \ 16605 UINT32_C(0xff) 16606 /* 16607 * Priority level for strict priority. Valid only when the 16608 * tsa_assign is 0 - Strict Priority (SP) 16609 * 0..7 - Valid values. 16610 * 8..255 - Reserved. 16611 */ 16612 uint8_t queue_id3_pri_lvl; 16613 /* 16614 * Weight used to allocate remaining BW for this COS after 16615 * servicing guaranteed bandwidths for all COS. 16616 */ 16617 uint8_t queue_id3_bw_weight; 16618 /* ID of CoS Queue 4. */ 16619 uint8_t queue_id4; 16620 /* 16621 * Minimum BW allocated to CoS Queue. 16622 * The HWRM will translate this value into byte counter and 16623 * time interval used for this COS inside the device. 16624 */ 16625 uint32_t queue_id4_min_bw; 16626 /* The bandwidth value. */ 16627 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \ 16628 UINT32_C(0xfffffff) 16629 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \ 16630 0 16631 /* The granularity of the value (bits or bytes). */ 16632 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE \ 16633 UINT32_C(0x10000000) 16634 /* Value is in bits. */ 16635 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \ 16636 (UINT32_C(0x0) << 28) 16637 /* Value is in bytes. */ 16638 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \ 16639 (UINT32_C(0x1) << 28) 16640 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \ 16641 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES 16642 /* bw_value_unit is 3 b */ 16643 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \ 16644 UINT32_C(0xe0000000) 16645 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \ 16646 29 16647 /* Value is in Mb or MB (base 10). */ 16648 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \ 16649 (UINT32_C(0x0) << 29) 16650 /* Value is in Kb or KB (base 10). */ 16651 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \ 16652 (UINT32_C(0x2) << 29) 16653 /* Value is in bits or bytes. */ 16654 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \ 16655 (UINT32_C(0x4) << 29) 16656 /* Value is in Gb or GB (base 10). */ 16657 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \ 16658 (UINT32_C(0x6) << 29) 16659 /* Value is in 1/100th of a percentage of total bandwidth. */ 16660 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16661 (UINT32_C(0x1) << 29) 16662 /* Invalid unit */ 16663 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \ 16664 (UINT32_C(0x7) << 29) 16665 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \ 16666 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID 16667 /* 16668 * Maximum BW allocated to CoS queue. 16669 * The HWRM will translate this value into byte counter and 16670 * time interval used for this COS inside the device. 16671 */ 16672 uint32_t queue_id4_max_bw; 16673 /* The bandwidth value. */ 16674 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \ 16675 UINT32_C(0xfffffff) 16676 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \ 16677 0 16678 /* The granularity of the value (bits or bytes). */ 16679 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE \ 16680 UINT32_C(0x10000000) 16681 /* Value is in bits. */ 16682 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \ 16683 (UINT32_C(0x0) << 28) 16684 /* Value is in bytes. */ 16685 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \ 16686 (UINT32_C(0x1) << 28) 16687 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \ 16688 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES 16689 /* bw_value_unit is 3 b */ 16690 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \ 16691 UINT32_C(0xe0000000) 16692 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \ 16693 29 16694 /* Value is in Mb or MB (base 10). */ 16695 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \ 16696 (UINT32_C(0x0) << 29) 16697 /* Value is in Kb or KB (base 10). */ 16698 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \ 16699 (UINT32_C(0x2) << 29) 16700 /* Value is in bits or bytes. */ 16701 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \ 16702 (UINT32_C(0x4) << 29) 16703 /* Value is in Gb or GB (base 10). */ 16704 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \ 16705 (UINT32_C(0x6) << 29) 16706 /* Value is in 1/100th of a percentage of total bandwidth. */ 16707 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16708 (UINT32_C(0x1) << 29) 16709 /* Invalid unit */ 16710 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \ 16711 (UINT32_C(0x7) << 29) 16712 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \ 16713 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID 16714 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 16715 uint8_t queue_id4_tsa_assign; 16716 /* Strict Priority */ 16717 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP \ 16718 UINT32_C(0x0) 16719 /* Enhanced Transmission Selection */ 16720 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS \ 16721 UINT32_C(0x1) 16722 /* reserved. */ 16723 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \ 16724 UINT32_C(0x2) 16725 /* reserved. */ 16726 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \ 16727 UINT32_C(0xff) 16728 /* 16729 * Priority level for strict priority. Valid only when the 16730 * tsa_assign is 0 - Strict Priority (SP) 16731 * 0..7 - Valid values. 16732 * 8..255 - Reserved. 16733 */ 16734 uint8_t queue_id4_pri_lvl; 16735 /* 16736 * Weight used to allocate remaining BW for this COS after 16737 * servicing guaranteed bandwidths for all COS. 16738 */ 16739 uint8_t queue_id4_bw_weight; 16740 /* ID of CoS Queue 5. */ 16741 uint8_t queue_id5; 16742 /* 16743 * Minimum BW allocated to CoS Queue. 16744 * The HWRM will translate this value into byte counter and 16745 * time interval used for this COS inside the device. 16746 */ 16747 uint32_t queue_id5_min_bw; 16748 /* The bandwidth value. */ 16749 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \ 16750 UINT32_C(0xfffffff) 16751 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \ 16752 0 16753 /* The granularity of the value (bits or bytes). */ 16754 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE \ 16755 UINT32_C(0x10000000) 16756 /* Value is in bits. */ 16757 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \ 16758 (UINT32_C(0x0) << 28) 16759 /* Value is in bytes. */ 16760 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \ 16761 (UINT32_C(0x1) << 28) 16762 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \ 16763 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES 16764 /* bw_value_unit is 3 b */ 16765 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \ 16766 UINT32_C(0xe0000000) 16767 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \ 16768 29 16769 /* Value is in Mb or MB (base 10). */ 16770 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \ 16771 (UINT32_C(0x0) << 29) 16772 /* Value is in Kb or KB (base 10). */ 16773 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \ 16774 (UINT32_C(0x2) << 29) 16775 /* Value is in bits or bytes. */ 16776 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \ 16777 (UINT32_C(0x4) << 29) 16778 /* Value is in Gb or GB (base 10). */ 16779 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \ 16780 (UINT32_C(0x6) << 29) 16781 /* Value is in 1/100th of a percentage of total bandwidth. */ 16782 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16783 (UINT32_C(0x1) << 29) 16784 /* Invalid unit */ 16785 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \ 16786 (UINT32_C(0x7) << 29) 16787 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \ 16788 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID 16789 /* 16790 * Maximum BW allocated to CoS queue. 16791 * The HWRM will translate this value into byte counter and 16792 * time interval used for this COS inside the device. 16793 */ 16794 uint32_t queue_id5_max_bw; 16795 /* The bandwidth value. */ 16796 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \ 16797 UINT32_C(0xfffffff) 16798 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \ 16799 0 16800 /* The granularity of the value (bits or bytes). */ 16801 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE \ 16802 UINT32_C(0x10000000) 16803 /* Value is in bits. */ 16804 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \ 16805 (UINT32_C(0x0) << 28) 16806 /* Value is in bytes. */ 16807 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \ 16808 (UINT32_C(0x1) << 28) 16809 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \ 16810 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES 16811 /* bw_value_unit is 3 b */ 16812 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \ 16813 UINT32_C(0xe0000000) 16814 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \ 16815 29 16816 /* Value is in Mb or MB (base 10). */ 16817 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \ 16818 (UINT32_C(0x0) << 29) 16819 /* Value is in Kb or KB (base 10). */ 16820 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \ 16821 (UINT32_C(0x2) << 29) 16822 /* Value is in bits or bytes. */ 16823 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \ 16824 (UINT32_C(0x4) << 29) 16825 /* Value is in Gb or GB (base 10). */ 16826 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \ 16827 (UINT32_C(0x6) << 29) 16828 /* Value is in 1/100th of a percentage of total bandwidth. */ 16829 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16830 (UINT32_C(0x1) << 29) 16831 /* Invalid unit */ 16832 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \ 16833 (UINT32_C(0x7) << 29) 16834 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \ 16835 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID 16836 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 16837 uint8_t queue_id5_tsa_assign; 16838 /* Strict Priority */ 16839 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP \ 16840 UINT32_C(0x0) 16841 /* Enhanced Transmission Selection */ 16842 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS \ 16843 UINT32_C(0x1) 16844 /* reserved. */ 16845 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \ 16846 UINT32_C(0x2) 16847 /* reserved. */ 16848 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \ 16849 UINT32_C(0xff) 16850 /* 16851 * Priority level for strict priority. Valid only when the 16852 * tsa_assign is 0 - Strict Priority (SP) 16853 * 0..7 - Valid values. 16854 * 8..255 - Reserved. 16855 */ 16856 uint8_t queue_id5_pri_lvl; 16857 /* 16858 * Weight used to allocate remaining BW for this COS after 16859 * servicing guaranteed bandwidths for all COS. 16860 */ 16861 uint8_t queue_id5_bw_weight; 16862 /* ID of CoS Queue 6. */ 16863 uint8_t queue_id6; 16864 /* 16865 * Minimum BW allocated to CoS Queue. 16866 * The HWRM will translate this value into byte counter and 16867 * time interval used for this COS inside the device. 16868 */ 16869 uint32_t queue_id6_min_bw; 16870 /* The bandwidth value. */ 16871 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \ 16872 UINT32_C(0xfffffff) 16873 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \ 16874 0 16875 /* The granularity of the value (bits or bytes). */ 16876 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE \ 16877 UINT32_C(0x10000000) 16878 /* Value is in bits. */ 16879 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \ 16880 (UINT32_C(0x0) << 28) 16881 /* Value is in bytes. */ 16882 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \ 16883 (UINT32_C(0x1) << 28) 16884 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \ 16885 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES 16886 /* bw_value_unit is 3 b */ 16887 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \ 16888 UINT32_C(0xe0000000) 16889 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \ 16890 29 16891 /* Value is in Mb or MB (base 10). */ 16892 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \ 16893 (UINT32_C(0x0) << 29) 16894 /* Value is in Kb or KB (base 10). */ 16895 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \ 16896 (UINT32_C(0x2) << 29) 16897 /* Value is in bits or bytes. */ 16898 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \ 16899 (UINT32_C(0x4) << 29) 16900 /* Value is in Gb or GB (base 10). */ 16901 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \ 16902 (UINT32_C(0x6) << 29) 16903 /* Value is in 1/100th of a percentage of total bandwidth. */ 16904 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16905 (UINT32_C(0x1) << 29) 16906 /* Invalid unit */ 16907 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \ 16908 (UINT32_C(0x7) << 29) 16909 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \ 16910 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID 16911 /* 16912 * Maximum BW allocated to CoS queue. 16913 * The HWRM will translate this value into byte counter and 16914 * time interval used for this COS inside the device. 16915 */ 16916 uint32_t queue_id6_max_bw; 16917 /* The bandwidth value. */ 16918 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \ 16919 UINT32_C(0xfffffff) 16920 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \ 16921 0 16922 /* The granularity of the value (bits or bytes). */ 16923 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE \ 16924 UINT32_C(0x10000000) 16925 /* Value is in bits. */ 16926 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \ 16927 (UINT32_C(0x0) << 28) 16928 /* Value is in bytes. */ 16929 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \ 16930 (UINT32_C(0x1) << 28) 16931 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \ 16932 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES 16933 /* bw_value_unit is 3 b */ 16934 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \ 16935 UINT32_C(0xe0000000) 16936 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \ 16937 29 16938 /* Value is in Mb or MB (base 10). */ 16939 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \ 16940 (UINT32_C(0x0) << 29) 16941 /* Value is in Kb or KB (base 10). */ 16942 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \ 16943 (UINT32_C(0x2) << 29) 16944 /* Value is in bits or bytes. */ 16945 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \ 16946 (UINT32_C(0x4) << 29) 16947 /* Value is in Gb or GB (base 10). */ 16948 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \ 16949 (UINT32_C(0x6) << 29) 16950 /* Value is in 1/100th of a percentage of total bandwidth. */ 16951 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 16952 (UINT32_C(0x1) << 29) 16953 /* Invalid unit */ 16954 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \ 16955 (UINT32_C(0x7) << 29) 16956 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \ 16957 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID 16958 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 16959 uint8_t queue_id6_tsa_assign; 16960 /* Strict Priority */ 16961 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP \ 16962 UINT32_C(0x0) 16963 /* Enhanced Transmission Selection */ 16964 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS \ 16965 UINT32_C(0x1) 16966 /* reserved. */ 16967 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \ 16968 UINT32_C(0x2) 16969 /* reserved. */ 16970 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \ 16971 UINT32_C(0xff) 16972 /* 16973 * Priority level for strict priority. Valid only when the 16974 * tsa_assign is 0 - Strict Priority (SP) 16975 * 0..7 - Valid values. 16976 * 8..255 - Reserved. 16977 */ 16978 uint8_t queue_id6_pri_lvl; 16979 /* 16980 * Weight used to allocate remaining BW for this COS after 16981 * servicing guaranteed bandwidths for all COS. 16982 */ 16983 uint8_t queue_id6_bw_weight; 16984 /* ID of CoS Queue 7. */ 16985 uint8_t queue_id7; 16986 /* 16987 * Minimum BW allocated to CoS Queue. 16988 * The HWRM will translate this value into byte counter and 16989 * time interval used for this COS inside the device. 16990 */ 16991 uint32_t queue_id7_min_bw; 16992 /* The bandwidth value. */ 16993 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \ 16994 UINT32_C(0xfffffff) 16995 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \ 16996 0 16997 /* The granularity of the value (bits or bytes). */ 16998 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE \ 16999 UINT32_C(0x10000000) 17000 /* Value is in bits. */ 17001 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \ 17002 (UINT32_C(0x0) << 28) 17003 /* Value is in bytes. */ 17004 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \ 17005 (UINT32_C(0x1) << 28) 17006 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \ 17007 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES 17008 /* bw_value_unit is 3 b */ 17009 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \ 17010 UINT32_C(0xe0000000) 17011 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \ 17012 29 17013 /* Value is in Mb or MB (base 10). */ 17014 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \ 17015 (UINT32_C(0x0) << 29) 17016 /* Value is in Kb or KB (base 10). */ 17017 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \ 17018 (UINT32_C(0x2) << 29) 17019 /* Value is in bits or bytes. */ 17020 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \ 17021 (UINT32_C(0x4) << 29) 17022 /* Value is in Gb or GB (base 10). */ 17023 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \ 17024 (UINT32_C(0x6) << 29) 17025 /* Value is in 1/100th of a percentage of total bandwidth. */ 17026 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17027 (UINT32_C(0x1) << 29) 17028 /* Invalid unit */ 17029 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \ 17030 (UINT32_C(0x7) << 29) 17031 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \ 17032 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID 17033 /* 17034 * Maximum BW allocated to CoS queue. 17035 * The HWRM will translate this value into byte counter and 17036 * time interval used for this COS inside the device. 17037 */ 17038 uint32_t queue_id7_max_bw; 17039 /* The bandwidth value. */ 17040 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \ 17041 UINT32_C(0xfffffff) 17042 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \ 17043 0 17044 /* The granularity of the value (bits or bytes). */ 17045 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE \ 17046 UINT32_C(0x10000000) 17047 /* Value is in bits. */ 17048 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \ 17049 (UINT32_C(0x0) << 28) 17050 /* Value is in bytes. */ 17051 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \ 17052 (UINT32_C(0x1) << 28) 17053 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \ 17054 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES 17055 /* bw_value_unit is 3 b */ 17056 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \ 17057 UINT32_C(0xe0000000) 17058 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \ 17059 29 17060 /* Value is in Mb or MB (base 10). */ 17061 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \ 17062 (UINT32_C(0x0) << 29) 17063 /* Value is in Kb or KB (base 10). */ 17064 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \ 17065 (UINT32_C(0x2) << 29) 17066 /* Value is in bits or bytes. */ 17067 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \ 17068 (UINT32_C(0x4) << 29) 17069 /* Value is in Gb or GB (base 10). */ 17070 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \ 17071 (UINT32_C(0x6) << 29) 17072 /* Value is in 1/100th of a percentage of total bandwidth. */ 17073 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17074 (UINT32_C(0x1) << 29) 17075 /* Invalid unit */ 17076 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \ 17077 (UINT32_C(0x7) << 29) 17078 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \ 17079 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID 17080 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 17081 uint8_t queue_id7_tsa_assign; 17082 /* Strict Priority */ 17083 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP \ 17084 UINT32_C(0x0) 17085 /* Enhanced Transmission Selection */ 17086 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS \ 17087 UINT32_C(0x1) 17088 /* reserved. */ 17089 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \ 17090 UINT32_C(0x2) 17091 /* reserved. */ 17092 #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \ 17093 UINT32_C(0xff) 17094 /* 17095 * Priority level for strict priority. Valid only when the 17096 * tsa_assign is 0 - Strict Priority (SP) 17097 * 0..7 - Valid values. 17098 * 8..255 - Reserved. 17099 */ 17100 uint8_t queue_id7_pri_lvl; 17101 /* 17102 * Weight used to allocate remaining BW for this COS after 17103 * servicing guaranteed bandwidths for all COS. 17104 */ 17105 uint8_t queue_id7_bw_weight; 17106 uint8_t unused_2[4]; 17107 /* 17108 * This field is used in Output records to indicate that the output 17109 * is completely written to RAM. This field should be read as '1' 17110 * to indicate that the output has been completely written. 17111 * When writing a command completion or response to an internal processor, 17112 * the order of writes has to be such that this field is written last. 17113 */ 17114 uint8_t valid; 17115 } __attribute__((packed)); 17116 17117 /************************* 17118 * hwrm_queue_cos2bw_cfg * 17119 *************************/ 17120 17121 17122 /* hwrm_queue_cos2bw_cfg_input (size:1024b/128B) */ 17123 struct hwrm_queue_cos2bw_cfg_input { 17124 /* The HWRM command request type. */ 17125 uint16_t req_type; 17126 /* 17127 * The completion ring to send the completion event on. This should 17128 * be the NQ ID returned from the `nq_alloc` HWRM command. 17129 */ 17130 uint16_t cmpl_ring; 17131 /* 17132 * The sequence ID is used by the driver for tracking multiple 17133 * commands. This ID is treated as opaque data by the firmware and 17134 * the value is returned in the `hwrm_resp_hdr` upon completion. 17135 */ 17136 uint16_t seq_id; 17137 /* 17138 * The target ID of the command: 17139 * * 0x0-0xFFF8 - The function ID 17140 * * 0xFFF8-0xFFFE - Reserved for internal processors 17141 * * 0xFFFF - HWRM 17142 */ 17143 uint16_t target_id; 17144 /* 17145 * A physical address pointer pointing to a host buffer that the 17146 * command's response data will be written. This can be either a host 17147 * physical address (HPA) or a guest physical address (GPA) and must 17148 * point to a physically contiguous block of memory. 17149 */ 17150 uint64_t resp_addr; 17151 uint32_t flags; 17152 uint32_t enables; 17153 /* 17154 * If this bit is set to 1, then all queue_id0 related 17155 * parameters in this command are valid. 17156 */ 17157 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID \ 17158 UINT32_C(0x1) 17159 /* 17160 * If this bit is set to 1, then all queue_id1 related 17161 * parameters in this command are valid. 17162 */ 17163 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID \ 17164 UINT32_C(0x2) 17165 /* 17166 * If this bit is set to 1, then all queue_id2 related 17167 * parameters in this command are valid. 17168 */ 17169 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID \ 17170 UINT32_C(0x4) 17171 /* 17172 * If this bit is set to 1, then all queue_id3 related 17173 * parameters in this command are valid. 17174 */ 17175 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID \ 17176 UINT32_C(0x8) 17177 /* 17178 * If this bit is set to 1, then all queue_id4 related 17179 * parameters in this command are valid. 17180 */ 17181 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID \ 17182 UINT32_C(0x10) 17183 /* 17184 * If this bit is set to 1, then all queue_id5 related 17185 * parameters in this command are valid. 17186 */ 17187 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID \ 17188 UINT32_C(0x20) 17189 /* 17190 * If this bit is set to 1, then all queue_id6 related 17191 * parameters in this command are valid. 17192 */ 17193 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID \ 17194 UINT32_C(0x40) 17195 /* 17196 * If this bit is set to 1, then all queue_id7 related 17197 * parameters in this command are valid. 17198 */ 17199 #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID \ 17200 UINT32_C(0x80) 17201 /* 17202 * Port ID of port for which the table is being configured. 17203 * The HWRM needs to check whether this function is allowed 17204 * to configure TC BW assignment on this port. 17205 */ 17206 uint16_t port_id; 17207 /* ID of CoS Queue 0. */ 17208 uint8_t queue_id0; 17209 uint8_t unused_0; 17210 /* 17211 * Minimum BW allocated to CoS Queue. 17212 * The HWRM will translate this value into byte counter and 17213 * time interval used for this COS inside the device. 17214 */ 17215 uint32_t queue_id0_min_bw; 17216 /* The bandwidth value. */ 17217 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \ 17218 UINT32_C(0xfffffff) 17219 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \ 17220 0 17221 /* The granularity of the value (bits or bytes). */ 17222 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE \ 17223 UINT32_C(0x10000000) 17224 /* Value is in bits. */ 17225 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \ 17226 (UINT32_C(0x0) << 28) 17227 /* Value is in bytes. */ 17228 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \ 17229 (UINT32_C(0x1) << 28) 17230 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \ 17231 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES 17232 /* bw_value_unit is 3 b */ 17233 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \ 17234 UINT32_C(0xe0000000) 17235 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \ 17236 29 17237 /* Value is in Mb or MB (base 10). */ 17238 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \ 17239 (UINT32_C(0x0) << 29) 17240 /* Value is in Kb or KB (base 10). */ 17241 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \ 17242 (UINT32_C(0x2) << 29) 17243 /* Value is in bits or bytes. */ 17244 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \ 17245 (UINT32_C(0x4) << 29) 17246 /* Value is in Gb or GB (base 10). */ 17247 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \ 17248 (UINT32_C(0x6) << 29) 17249 /* Value is in 1/100th of a percentage of total bandwidth. */ 17250 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17251 (UINT32_C(0x1) << 29) 17252 /* Invalid unit */ 17253 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \ 17254 (UINT32_C(0x7) << 29) 17255 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \ 17256 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID 17257 /* 17258 * Maximum BW allocated to CoS Queue. 17259 * The HWRM will translate this value into byte counter and 17260 * time interval used for this COS inside the device. 17261 */ 17262 uint32_t queue_id0_max_bw; 17263 /* The bandwidth value. */ 17264 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \ 17265 UINT32_C(0xfffffff) 17266 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \ 17267 0 17268 /* The granularity of the value (bits or bytes). */ 17269 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE \ 17270 UINT32_C(0x10000000) 17271 /* Value is in bits. */ 17272 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \ 17273 (UINT32_C(0x0) << 28) 17274 /* Value is in bytes. */ 17275 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \ 17276 (UINT32_C(0x1) << 28) 17277 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \ 17278 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES 17279 /* bw_value_unit is 3 b */ 17280 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \ 17281 UINT32_C(0xe0000000) 17282 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \ 17283 29 17284 /* Value is in Mb or MB (base 10). */ 17285 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \ 17286 (UINT32_C(0x0) << 29) 17287 /* Value is in Kb or KB (base 10). */ 17288 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \ 17289 (UINT32_C(0x2) << 29) 17290 /* Value is in bits or bytes. */ 17291 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \ 17292 (UINT32_C(0x4) << 29) 17293 /* Value is in Gb or GB (base 10). */ 17294 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \ 17295 (UINT32_C(0x6) << 29) 17296 /* Value is in 1/100th of a percentage of total bandwidth. */ 17297 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17298 (UINT32_C(0x1) << 29) 17299 /* Invalid unit */ 17300 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \ 17301 (UINT32_C(0x7) << 29) 17302 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \ 17303 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID 17304 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 17305 uint8_t queue_id0_tsa_assign; 17306 /* Strict Priority */ 17307 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP \ 17308 UINT32_C(0x0) 17309 /* Enhanced Transmission Selection */ 17310 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS \ 17311 UINT32_C(0x1) 17312 /* reserved. */ 17313 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \ 17314 UINT32_C(0x2) 17315 /* reserved. */ 17316 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \ 17317 UINT32_C(0xff) 17318 /* 17319 * Priority level for strict priority. Valid only when the 17320 * tsa_assign is 0 - Strict Priority (SP) 17321 * 0..7 - Valid values. 17322 * 8..255 - Reserved. 17323 */ 17324 uint8_t queue_id0_pri_lvl; 17325 /* 17326 * Weight used to allocate remaining BW for this COS after 17327 * servicing guaranteed bandwidths for all COS. 17328 */ 17329 uint8_t queue_id0_bw_weight; 17330 /* ID of CoS Queue 1. */ 17331 uint8_t queue_id1; 17332 /* 17333 * Minimum BW allocated to CoS Queue. 17334 * The HWRM will translate this value into byte counter and 17335 * time interval used for this COS inside the device. 17336 */ 17337 uint32_t queue_id1_min_bw; 17338 /* The bandwidth value. */ 17339 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \ 17340 UINT32_C(0xfffffff) 17341 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \ 17342 0 17343 /* The granularity of the value (bits or bytes). */ 17344 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE \ 17345 UINT32_C(0x10000000) 17346 /* Value is in bits. */ 17347 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \ 17348 (UINT32_C(0x0) << 28) 17349 /* Value is in bytes. */ 17350 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \ 17351 (UINT32_C(0x1) << 28) 17352 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \ 17353 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES 17354 /* bw_value_unit is 3 b */ 17355 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \ 17356 UINT32_C(0xe0000000) 17357 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \ 17358 29 17359 /* Value is in Mb or MB (base 10). */ 17360 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \ 17361 (UINT32_C(0x0) << 29) 17362 /* Value is in Kb or KB (base 10). */ 17363 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \ 17364 (UINT32_C(0x2) << 29) 17365 /* Value is in bits or bytes. */ 17366 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \ 17367 (UINT32_C(0x4) << 29) 17368 /* Value is in Gb or GB (base 10). */ 17369 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \ 17370 (UINT32_C(0x6) << 29) 17371 /* Value is in 1/100th of a percentage of total bandwidth. */ 17372 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17373 (UINT32_C(0x1) << 29) 17374 /* Invalid unit */ 17375 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \ 17376 (UINT32_C(0x7) << 29) 17377 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \ 17378 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID 17379 /* 17380 * Maximum BW allocated to CoS queue. 17381 * The HWRM will translate this value into byte counter and 17382 * time interval used for this COS inside the device. 17383 */ 17384 uint32_t queue_id1_max_bw; 17385 /* The bandwidth value. */ 17386 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \ 17387 UINT32_C(0xfffffff) 17388 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \ 17389 0 17390 /* The granularity of the value (bits or bytes). */ 17391 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE \ 17392 UINT32_C(0x10000000) 17393 /* Value is in bits. */ 17394 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \ 17395 (UINT32_C(0x0) << 28) 17396 /* Value is in bytes. */ 17397 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \ 17398 (UINT32_C(0x1) << 28) 17399 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \ 17400 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES 17401 /* bw_value_unit is 3 b */ 17402 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \ 17403 UINT32_C(0xe0000000) 17404 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \ 17405 29 17406 /* Value is in Mb or MB (base 10). */ 17407 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \ 17408 (UINT32_C(0x0) << 29) 17409 /* Value is in Kb or KB (base 10). */ 17410 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \ 17411 (UINT32_C(0x2) << 29) 17412 /* Value is in bits or bytes. */ 17413 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \ 17414 (UINT32_C(0x4) << 29) 17415 /* Value is in Gb or GB (base 10). */ 17416 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \ 17417 (UINT32_C(0x6) << 29) 17418 /* Value is in 1/100th of a percentage of total bandwidth. */ 17419 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17420 (UINT32_C(0x1) << 29) 17421 /* Invalid unit */ 17422 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \ 17423 (UINT32_C(0x7) << 29) 17424 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \ 17425 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID 17426 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 17427 uint8_t queue_id1_tsa_assign; 17428 /* Strict Priority */ 17429 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP \ 17430 UINT32_C(0x0) 17431 /* Enhanced Transmission Selection */ 17432 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS \ 17433 UINT32_C(0x1) 17434 /* reserved. */ 17435 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \ 17436 UINT32_C(0x2) 17437 /* reserved. */ 17438 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \ 17439 UINT32_C(0xff) 17440 /* 17441 * Priority level for strict priority. Valid only when the 17442 * tsa_assign is 0 - Strict Priority (SP) 17443 * 0..7 - Valid values. 17444 * 8..255 - Reserved. 17445 */ 17446 uint8_t queue_id1_pri_lvl; 17447 /* 17448 * Weight used to allocate remaining BW for this COS after 17449 * servicing guaranteed bandwidths for all COS. 17450 */ 17451 uint8_t queue_id1_bw_weight; 17452 /* ID of CoS Queue 2. */ 17453 uint8_t queue_id2; 17454 /* 17455 * Minimum BW allocated to CoS Queue. 17456 * The HWRM will translate this value into byte counter and 17457 * time interval used for this COS inside the device. 17458 */ 17459 uint32_t queue_id2_min_bw; 17460 /* The bandwidth value. */ 17461 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \ 17462 UINT32_C(0xfffffff) 17463 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \ 17464 0 17465 /* The granularity of the value (bits or bytes). */ 17466 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE \ 17467 UINT32_C(0x10000000) 17468 /* Value is in bits. */ 17469 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \ 17470 (UINT32_C(0x0) << 28) 17471 /* Value is in bytes. */ 17472 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \ 17473 (UINT32_C(0x1) << 28) 17474 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \ 17475 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES 17476 /* bw_value_unit is 3 b */ 17477 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \ 17478 UINT32_C(0xe0000000) 17479 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \ 17480 29 17481 /* Value is in Mb or MB (base 10). */ 17482 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \ 17483 (UINT32_C(0x0) << 29) 17484 /* Value is in Kb or KB (base 10). */ 17485 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \ 17486 (UINT32_C(0x2) << 29) 17487 /* Value is in bits or bytes. */ 17488 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \ 17489 (UINT32_C(0x4) << 29) 17490 /* Value is in Gb or GB (base 10). */ 17491 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \ 17492 (UINT32_C(0x6) << 29) 17493 /* Value is in 1/100th of a percentage of total bandwidth. */ 17494 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17495 (UINT32_C(0x1) << 29) 17496 /* Invalid unit */ 17497 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \ 17498 (UINT32_C(0x7) << 29) 17499 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \ 17500 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID 17501 /* 17502 * Maximum BW allocated to CoS queue. 17503 * The HWRM will translate this value into byte counter and 17504 * time interval used for this COS inside the device. 17505 */ 17506 uint32_t queue_id2_max_bw; 17507 /* The bandwidth value. */ 17508 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \ 17509 UINT32_C(0xfffffff) 17510 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \ 17511 0 17512 /* The granularity of the value (bits or bytes). */ 17513 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE \ 17514 UINT32_C(0x10000000) 17515 /* Value is in bits. */ 17516 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \ 17517 (UINT32_C(0x0) << 28) 17518 /* Value is in bytes. */ 17519 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \ 17520 (UINT32_C(0x1) << 28) 17521 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \ 17522 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES 17523 /* bw_value_unit is 3 b */ 17524 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \ 17525 UINT32_C(0xe0000000) 17526 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \ 17527 29 17528 /* Value is in Mb or MB (base 10). */ 17529 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \ 17530 (UINT32_C(0x0) << 29) 17531 /* Value is in Kb or KB (base 10). */ 17532 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \ 17533 (UINT32_C(0x2) << 29) 17534 /* Value is in bits or bytes. */ 17535 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \ 17536 (UINT32_C(0x4) << 29) 17537 /* Value is in Gb or GB (base 10). */ 17538 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \ 17539 (UINT32_C(0x6) << 29) 17540 /* Value is in 1/100th of a percentage of total bandwidth. */ 17541 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17542 (UINT32_C(0x1) << 29) 17543 /* Invalid unit */ 17544 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \ 17545 (UINT32_C(0x7) << 29) 17546 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \ 17547 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID 17548 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 17549 uint8_t queue_id2_tsa_assign; 17550 /* Strict Priority */ 17551 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP \ 17552 UINT32_C(0x0) 17553 /* Enhanced Transmission Selection */ 17554 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS \ 17555 UINT32_C(0x1) 17556 /* reserved. */ 17557 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \ 17558 UINT32_C(0x2) 17559 /* reserved. */ 17560 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \ 17561 UINT32_C(0xff) 17562 /* 17563 * Priority level for strict priority. Valid only when the 17564 * tsa_assign is 0 - Strict Priority (SP) 17565 * 0..7 - Valid values. 17566 * 8..255 - Reserved. 17567 */ 17568 uint8_t queue_id2_pri_lvl; 17569 /* 17570 * Weight used to allocate remaining BW for this COS after 17571 * servicing guaranteed bandwidths for all COS. 17572 */ 17573 uint8_t queue_id2_bw_weight; 17574 /* ID of CoS Queue 3. */ 17575 uint8_t queue_id3; 17576 /* 17577 * Minimum BW allocated to CoS Queue. 17578 * The HWRM will translate this value into byte counter and 17579 * time interval used for this COS inside the device. 17580 */ 17581 uint32_t queue_id3_min_bw; 17582 /* The bandwidth value. */ 17583 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \ 17584 UINT32_C(0xfffffff) 17585 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \ 17586 0 17587 /* The granularity of the value (bits or bytes). */ 17588 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE \ 17589 UINT32_C(0x10000000) 17590 /* Value is in bits. */ 17591 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \ 17592 (UINT32_C(0x0) << 28) 17593 /* Value is in bytes. */ 17594 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \ 17595 (UINT32_C(0x1) << 28) 17596 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \ 17597 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES 17598 /* bw_value_unit is 3 b */ 17599 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \ 17600 UINT32_C(0xe0000000) 17601 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \ 17602 29 17603 /* Value is in Mb or MB (base 10). */ 17604 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \ 17605 (UINT32_C(0x0) << 29) 17606 /* Value is in Kb or KB (base 10). */ 17607 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \ 17608 (UINT32_C(0x2) << 29) 17609 /* Value is in bits or bytes. */ 17610 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \ 17611 (UINT32_C(0x4) << 29) 17612 /* Value is in Gb or GB (base 10). */ 17613 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \ 17614 (UINT32_C(0x6) << 29) 17615 /* Value is in 1/100th of a percentage of total bandwidth. */ 17616 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17617 (UINT32_C(0x1) << 29) 17618 /* Invalid unit */ 17619 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \ 17620 (UINT32_C(0x7) << 29) 17621 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \ 17622 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID 17623 /* 17624 * Maximum BW allocated to CoS queue. 17625 * The HWRM will translate this value into byte counter and 17626 * time interval used for this COS inside the device. 17627 */ 17628 uint32_t queue_id3_max_bw; 17629 /* The bandwidth value. */ 17630 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \ 17631 UINT32_C(0xfffffff) 17632 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \ 17633 0 17634 /* The granularity of the value (bits or bytes). */ 17635 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE \ 17636 UINT32_C(0x10000000) 17637 /* Value is in bits. */ 17638 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \ 17639 (UINT32_C(0x0) << 28) 17640 /* Value is in bytes. */ 17641 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \ 17642 (UINT32_C(0x1) << 28) 17643 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \ 17644 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES 17645 /* bw_value_unit is 3 b */ 17646 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \ 17647 UINT32_C(0xe0000000) 17648 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \ 17649 29 17650 /* Value is in Mb or MB (base 10). */ 17651 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \ 17652 (UINT32_C(0x0) << 29) 17653 /* Value is in Kb or KB (base 10). */ 17654 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \ 17655 (UINT32_C(0x2) << 29) 17656 /* Value is in bits or bytes. */ 17657 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \ 17658 (UINT32_C(0x4) << 29) 17659 /* Value is in Gb or GB (base 10). */ 17660 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \ 17661 (UINT32_C(0x6) << 29) 17662 /* Value is in 1/100th of a percentage of total bandwidth. */ 17663 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17664 (UINT32_C(0x1) << 29) 17665 /* Invalid unit */ 17666 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \ 17667 (UINT32_C(0x7) << 29) 17668 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \ 17669 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID 17670 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 17671 uint8_t queue_id3_tsa_assign; 17672 /* Strict Priority */ 17673 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP \ 17674 UINT32_C(0x0) 17675 /* Enhanced Transmission Selection */ 17676 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS \ 17677 UINT32_C(0x1) 17678 /* reserved. */ 17679 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \ 17680 UINT32_C(0x2) 17681 /* reserved. */ 17682 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \ 17683 UINT32_C(0xff) 17684 /* 17685 * Priority level for strict priority. Valid only when the 17686 * tsa_assign is 0 - Strict Priority (SP) 17687 * 0..7 - Valid values. 17688 * 8..255 - Reserved. 17689 */ 17690 uint8_t queue_id3_pri_lvl; 17691 /* 17692 * Weight used to allocate remaining BW for this COS after 17693 * servicing guaranteed bandwidths for all COS. 17694 */ 17695 uint8_t queue_id3_bw_weight; 17696 /* ID of CoS Queue 4. */ 17697 uint8_t queue_id4; 17698 /* 17699 * Minimum BW allocated to CoS Queue. 17700 * The HWRM will translate this value into byte counter and 17701 * time interval used for this COS inside the device. 17702 */ 17703 uint32_t queue_id4_min_bw; 17704 /* The bandwidth value. */ 17705 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \ 17706 UINT32_C(0xfffffff) 17707 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \ 17708 0 17709 /* The granularity of the value (bits or bytes). */ 17710 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE \ 17711 UINT32_C(0x10000000) 17712 /* Value is in bits. */ 17713 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \ 17714 (UINT32_C(0x0) << 28) 17715 /* Value is in bytes. */ 17716 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \ 17717 (UINT32_C(0x1) << 28) 17718 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \ 17719 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES 17720 /* bw_value_unit is 3 b */ 17721 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \ 17722 UINT32_C(0xe0000000) 17723 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \ 17724 29 17725 /* Value is in Mb or MB (base 10). */ 17726 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \ 17727 (UINT32_C(0x0) << 29) 17728 /* Value is in Kb or KB (base 10). */ 17729 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \ 17730 (UINT32_C(0x2) << 29) 17731 /* Value is in bits or bytes. */ 17732 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \ 17733 (UINT32_C(0x4) << 29) 17734 /* Value is in Gb or GB (base 10). */ 17735 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \ 17736 (UINT32_C(0x6) << 29) 17737 /* Value is in 1/100th of a percentage of total bandwidth. */ 17738 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17739 (UINT32_C(0x1) << 29) 17740 /* Invalid unit */ 17741 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \ 17742 (UINT32_C(0x7) << 29) 17743 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \ 17744 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID 17745 /* 17746 * Maximum BW allocated to CoS queue. 17747 * The HWRM will translate this value into byte counter and 17748 * time interval used for this COS inside the device. 17749 */ 17750 uint32_t queue_id4_max_bw; 17751 /* The bandwidth value. */ 17752 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \ 17753 UINT32_C(0xfffffff) 17754 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \ 17755 0 17756 /* The granularity of the value (bits or bytes). */ 17757 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE \ 17758 UINT32_C(0x10000000) 17759 /* Value is in bits. */ 17760 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \ 17761 (UINT32_C(0x0) << 28) 17762 /* Value is in bytes. */ 17763 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \ 17764 (UINT32_C(0x1) << 28) 17765 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \ 17766 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES 17767 /* bw_value_unit is 3 b */ 17768 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \ 17769 UINT32_C(0xe0000000) 17770 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \ 17771 29 17772 /* Value is in Mb or MB (base 10). */ 17773 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \ 17774 (UINT32_C(0x0) << 29) 17775 /* Value is in Kb or KB (base 10). */ 17776 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \ 17777 (UINT32_C(0x2) << 29) 17778 /* Value is in bits or bytes. */ 17779 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \ 17780 (UINT32_C(0x4) << 29) 17781 /* Value is in Gb or GB (base 10). */ 17782 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \ 17783 (UINT32_C(0x6) << 29) 17784 /* Value is in 1/100th of a percentage of total bandwidth. */ 17785 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17786 (UINT32_C(0x1) << 29) 17787 /* Invalid unit */ 17788 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \ 17789 (UINT32_C(0x7) << 29) 17790 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \ 17791 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID 17792 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 17793 uint8_t queue_id4_tsa_assign; 17794 /* Strict Priority */ 17795 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP \ 17796 UINT32_C(0x0) 17797 /* Enhanced Transmission Selection */ 17798 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS \ 17799 UINT32_C(0x1) 17800 /* reserved. */ 17801 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \ 17802 UINT32_C(0x2) 17803 /* reserved. */ 17804 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \ 17805 UINT32_C(0xff) 17806 /* 17807 * Priority level for strict priority. Valid only when the 17808 * tsa_assign is 0 - Strict Priority (SP) 17809 * 0..7 - Valid values. 17810 * 8..255 - Reserved. 17811 */ 17812 uint8_t queue_id4_pri_lvl; 17813 /* 17814 * Weight used to allocate remaining BW for this COS after 17815 * servicing guaranteed bandwidths for all COS. 17816 */ 17817 uint8_t queue_id4_bw_weight; 17818 /* ID of CoS Queue 5. */ 17819 uint8_t queue_id5; 17820 /* 17821 * Minimum BW allocated to CoS Queue. 17822 * The HWRM will translate this value into byte counter and 17823 * time interval used for this COS inside the device. 17824 */ 17825 uint32_t queue_id5_min_bw; 17826 /* The bandwidth value. */ 17827 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \ 17828 UINT32_C(0xfffffff) 17829 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \ 17830 0 17831 /* The granularity of the value (bits or bytes). */ 17832 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE \ 17833 UINT32_C(0x10000000) 17834 /* Value is in bits. */ 17835 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \ 17836 (UINT32_C(0x0) << 28) 17837 /* Value is in bytes. */ 17838 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \ 17839 (UINT32_C(0x1) << 28) 17840 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \ 17841 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES 17842 /* bw_value_unit is 3 b */ 17843 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \ 17844 UINT32_C(0xe0000000) 17845 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \ 17846 29 17847 /* Value is in Mb or MB (base 10). */ 17848 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \ 17849 (UINT32_C(0x0) << 29) 17850 /* Value is in Kb or KB (base 10). */ 17851 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \ 17852 (UINT32_C(0x2) << 29) 17853 /* Value is in bits or bytes. */ 17854 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \ 17855 (UINT32_C(0x4) << 29) 17856 /* Value is in Gb or GB (base 10). */ 17857 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \ 17858 (UINT32_C(0x6) << 29) 17859 /* Value is in 1/100th of a percentage of total bandwidth. */ 17860 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17861 (UINT32_C(0x1) << 29) 17862 /* Invalid unit */ 17863 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \ 17864 (UINT32_C(0x7) << 29) 17865 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \ 17866 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID 17867 /* 17868 * Maximum BW allocated to CoS queue. 17869 * The HWRM will translate this value into byte counter and 17870 * time interval used for this COS inside the device. 17871 */ 17872 uint32_t queue_id5_max_bw; 17873 /* The bandwidth value. */ 17874 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \ 17875 UINT32_C(0xfffffff) 17876 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \ 17877 0 17878 /* The granularity of the value (bits or bytes). */ 17879 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE \ 17880 UINT32_C(0x10000000) 17881 /* Value is in bits. */ 17882 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \ 17883 (UINT32_C(0x0) << 28) 17884 /* Value is in bytes. */ 17885 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \ 17886 (UINT32_C(0x1) << 28) 17887 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \ 17888 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES 17889 /* bw_value_unit is 3 b */ 17890 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \ 17891 UINT32_C(0xe0000000) 17892 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \ 17893 29 17894 /* Value is in Mb or MB (base 10). */ 17895 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \ 17896 (UINT32_C(0x0) << 29) 17897 /* Value is in Kb or KB (base 10). */ 17898 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \ 17899 (UINT32_C(0x2) << 29) 17900 /* Value is in bits or bytes. */ 17901 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \ 17902 (UINT32_C(0x4) << 29) 17903 /* Value is in Gb or GB (base 10). */ 17904 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \ 17905 (UINT32_C(0x6) << 29) 17906 /* Value is in 1/100th of a percentage of total bandwidth. */ 17907 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17908 (UINT32_C(0x1) << 29) 17909 /* Invalid unit */ 17910 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \ 17911 (UINT32_C(0x7) << 29) 17912 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \ 17913 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID 17914 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 17915 uint8_t queue_id5_tsa_assign; 17916 /* Strict Priority */ 17917 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP \ 17918 UINT32_C(0x0) 17919 /* Enhanced Transmission Selection */ 17920 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS \ 17921 UINT32_C(0x1) 17922 /* reserved. */ 17923 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \ 17924 UINT32_C(0x2) 17925 /* reserved. */ 17926 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \ 17927 UINT32_C(0xff) 17928 /* 17929 * Priority level for strict priority. Valid only when the 17930 * tsa_assign is 0 - Strict Priority (SP) 17931 * 0..7 - Valid values. 17932 * 8..255 - Reserved. 17933 */ 17934 uint8_t queue_id5_pri_lvl; 17935 /* 17936 * Weight used to allocate remaining BW for this COS after 17937 * servicing guaranteed bandwidths for all COS. 17938 */ 17939 uint8_t queue_id5_bw_weight; 17940 /* ID of CoS Queue 6. */ 17941 uint8_t queue_id6; 17942 /* 17943 * Minimum BW allocated to CoS Queue. 17944 * The HWRM will translate this value into byte counter and 17945 * time interval used for this COS inside the device. 17946 */ 17947 uint32_t queue_id6_min_bw; 17948 /* The bandwidth value. */ 17949 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \ 17950 UINT32_C(0xfffffff) 17951 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \ 17952 0 17953 /* The granularity of the value (bits or bytes). */ 17954 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE \ 17955 UINT32_C(0x10000000) 17956 /* Value is in bits. */ 17957 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \ 17958 (UINT32_C(0x0) << 28) 17959 /* Value is in bytes. */ 17960 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \ 17961 (UINT32_C(0x1) << 28) 17962 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \ 17963 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES 17964 /* bw_value_unit is 3 b */ 17965 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \ 17966 UINT32_C(0xe0000000) 17967 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \ 17968 29 17969 /* Value is in Mb or MB (base 10). */ 17970 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \ 17971 (UINT32_C(0x0) << 29) 17972 /* Value is in Kb or KB (base 10). */ 17973 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \ 17974 (UINT32_C(0x2) << 29) 17975 /* Value is in bits or bytes. */ 17976 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \ 17977 (UINT32_C(0x4) << 29) 17978 /* Value is in Gb or GB (base 10). */ 17979 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \ 17980 (UINT32_C(0x6) << 29) 17981 /* Value is in 1/100th of a percentage of total bandwidth. */ 17982 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 17983 (UINT32_C(0x1) << 29) 17984 /* Invalid unit */ 17985 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \ 17986 (UINT32_C(0x7) << 29) 17987 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \ 17988 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID 17989 /* 17990 * Maximum BW allocated to CoS queue. 17991 * The HWRM will translate this value into byte counter and 17992 * time interval used for this COS inside the device. 17993 */ 17994 uint32_t queue_id6_max_bw; 17995 /* The bandwidth value. */ 17996 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \ 17997 UINT32_C(0xfffffff) 17998 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \ 17999 0 18000 /* The granularity of the value (bits or bytes). */ 18001 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE \ 18002 UINT32_C(0x10000000) 18003 /* Value is in bits. */ 18004 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \ 18005 (UINT32_C(0x0) << 28) 18006 /* Value is in bytes. */ 18007 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \ 18008 (UINT32_C(0x1) << 28) 18009 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \ 18010 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES 18011 /* bw_value_unit is 3 b */ 18012 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \ 18013 UINT32_C(0xe0000000) 18014 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \ 18015 29 18016 /* Value is in Mb or MB (base 10). */ 18017 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \ 18018 (UINT32_C(0x0) << 29) 18019 /* Value is in Kb or KB (base 10). */ 18020 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \ 18021 (UINT32_C(0x2) << 29) 18022 /* Value is in bits or bytes. */ 18023 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \ 18024 (UINT32_C(0x4) << 29) 18025 /* Value is in Gb or GB (base 10). */ 18026 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \ 18027 (UINT32_C(0x6) << 29) 18028 /* Value is in 1/100th of a percentage of total bandwidth. */ 18029 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 18030 (UINT32_C(0x1) << 29) 18031 /* Invalid unit */ 18032 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \ 18033 (UINT32_C(0x7) << 29) 18034 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \ 18035 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID 18036 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 18037 uint8_t queue_id6_tsa_assign; 18038 /* Strict Priority */ 18039 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP \ 18040 UINT32_C(0x0) 18041 /* Enhanced Transmission Selection */ 18042 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS \ 18043 UINT32_C(0x1) 18044 /* reserved. */ 18045 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \ 18046 UINT32_C(0x2) 18047 /* reserved. */ 18048 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \ 18049 UINT32_C(0xff) 18050 /* 18051 * Priority level for strict priority. Valid only when the 18052 * tsa_assign is 0 - Strict Priority (SP) 18053 * 0..7 - Valid values. 18054 * 8..255 - Reserved. 18055 */ 18056 uint8_t queue_id6_pri_lvl; 18057 /* 18058 * Weight used to allocate remaining BW for this COS after 18059 * servicing guaranteed bandwidths for all COS. 18060 */ 18061 uint8_t queue_id6_bw_weight; 18062 /* ID of CoS Queue 7. */ 18063 uint8_t queue_id7; 18064 /* 18065 * Minimum BW allocated to CoS Queue. 18066 * The HWRM will translate this value into byte counter and 18067 * time interval used for this COS inside the device. 18068 */ 18069 uint32_t queue_id7_min_bw; 18070 /* The bandwidth value. */ 18071 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \ 18072 UINT32_C(0xfffffff) 18073 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \ 18074 0 18075 /* The granularity of the value (bits or bytes). */ 18076 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE \ 18077 UINT32_C(0x10000000) 18078 /* Value is in bits. */ 18079 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \ 18080 (UINT32_C(0x0) << 28) 18081 /* Value is in bytes. */ 18082 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \ 18083 (UINT32_C(0x1) << 28) 18084 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \ 18085 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES 18086 /* bw_value_unit is 3 b */ 18087 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \ 18088 UINT32_C(0xe0000000) 18089 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \ 18090 29 18091 /* Value is in Mb or MB (base 10). */ 18092 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \ 18093 (UINT32_C(0x0) << 29) 18094 /* Value is in Kb or KB (base 10). */ 18095 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \ 18096 (UINT32_C(0x2) << 29) 18097 /* Value is in bits or bytes. */ 18098 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \ 18099 (UINT32_C(0x4) << 29) 18100 /* Value is in Gb or GB (base 10). */ 18101 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \ 18102 (UINT32_C(0x6) << 29) 18103 /* Value is in 1/100th of a percentage of total bandwidth. */ 18104 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \ 18105 (UINT32_C(0x1) << 29) 18106 /* Invalid unit */ 18107 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \ 18108 (UINT32_C(0x7) << 29) 18109 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \ 18110 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID 18111 /* 18112 * Maximum BW allocated to CoS queue. 18113 * The HWRM will translate this value into byte counter and 18114 * time interval used for this COS inside the device. 18115 */ 18116 uint32_t queue_id7_max_bw; 18117 /* The bandwidth value. */ 18118 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \ 18119 UINT32_C(0xfffffff) 18120 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \ 18121 0 18122 /* The granularity of the value (bits or bytes). */ 18123 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE \ 18124 UINT32_C(0x10000000) 18125 /* Value is in bits. */ 18126 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \ 18127 (UINT32_C(0x0) << 28) 18128 /* Value is in bytes. */ 18129 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \ 18130 (UINT32_C(0x1) << 28) 18131 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \ 18132 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES 18133 /* bw_value_unit is 3 b */ 18134 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \ 18135 UINT32_C(0xe0000000) 18136 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \ 18137 29 18138 /* Value is in Mb or MB (base 10). */ 18139 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \ 18140 (UINT32_C(0x0) << 29) 18141 /* Value is in Kb or KB (base 10). */ 18142 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \ 18143 (UINT32_C(0x2) << 29) 18144 /* Value is in bits or bytes. */ 18145 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \ 18146 (UINT32_C(0x4) << 29) 18147 /* Value is in Gb or GB (base 10). */ 18148 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \ 18149 (UINT32_C(0x6) << 29) 18150 /* Value is in 1/100th of a percentage of total bandwidth. */ 18151 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 18152 (UINT32_C(0x1) << 29) 18153 /* Invalid unit */ 18154 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \ 18155 (UINT32_C(0x7) << 29) 18156 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \ 18157 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID 18158 /* Transmission Selection Algorithm (TSA) for CoS Queue. */ 18159 uint8_t queue_id7_tsa_assign; 18160 /* Strict Priority */ 18161 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP \ 18162 UINT32_C(0x0) 18163 /* Enhanced Transmission Selection */ 18164 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS \ 18165 UINT32_C(0x1) 18166 /* reserved. */ 18167 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \ 18168 UINT32_C(0x2) 18169 /* reserved. */ 18170 #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \ 18171 UINT32_C(0xff) 18172 /* 18173 * Priority level for strict priority. Valid only when the 18174 * tsa_assign is 0 - Strict Priority (SP) 18175 * 0..7 - Valid values. 18176 * 8..255 - Reserved. 18177 */ 18178 uint8_t queue_id7_pri_lvl; 18179 /* 18180 * Weight used to allocate remaining BW for this COS after 18181 * servicing guaranteed bandwidths for all COS. 18182 */ 18183 uint8_t queue_id7_bw_weight; 18184 uint8_t unused_1[5]; 18185 } __attribute__((packed)); 18186 18187 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */ 18188 struct hwrm_queue_cos2bw_cfg_output { 18189 /* The specific error status for the command. */ 18190 uint16_t error_code; 18191 /* The HWRM command request type. */ 18192 uint16_t req_type; 18193 /* The sequence ID from the original command. */ 18194 uint16_t seq_id; 18195 /* The length of the response data in number of bytes. */ 18196 uint16_t resp_len; 18197 uint8_t unused_0[7]; 18198 /* 18199 * This field is used in Output records to indicate that the output 18200 * is completely written to RAM. This field should be read as '1' 18201 * to indicate that the output has been completely written. 18202 * When writing a command completion or response to an internal processor, 18203 * the order of writes has to be such that this field is written last. 18204 */ 18205 uint8_t valid; 18206 } __attribute__((packed)); 18207 18208 /******************* 18209 * hwrm_vnic_alloc * 18210 *******************/ 18211 18212 18213 /* hwrm_vnic_alloc_input (size:192b/24B) */ 18214 struct hwrm_vnic_alloc_input { 18215 /* The HWRM command request type. */ 18216 uint16_t req_type; 18217 /* 18218 * The completion ring to send the completion event on. This should 18219 * be the NQ ID returned from the `nq_alloc` HWRM command. 18220 */ 18221 uint16_t cmpl_ring; 18222 /* 18223 * The sequence ID is used by the driver for tracking multiple 18224 * commands. This ID is treated as opaque data by the firmware and 18225 * the value is returned in the `hwrm_resp_hdr` upon completion. 18226 */ 18227 uint16_t seq_id; 18228 /* 18229 * The target ID of the command: 18230 * * 0x0-0xFFF8 - The function ID 18231 * * 0xFFF8-0xFFFE - Reserved for internal processors 18232 * * 0xFFFF - HWRM 18233 */ 18234 uint16_t target_id; 18235 /* 18236 * A physical address pointer pointing to a host buffer that the 18237 * command's response data will be written. This can be either a host 18238 * physical address (HPA) or a guest physical address (GPA) and must 18239 * point to a physically contiguous block of memory. 18240 */ 18241 uint64_t resp_addr; 18242 uint32_t flags; 18243 /* 18244 * When this bit is '1', this VNIC is requested to 18245 * be the default VNIC for this function. 18246 */ 18247 #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT UINT32_C(0x1) 18248 uint8_t unused_0[4]; 18249 } __attribute__((packed)); 18250 18251 /* hwrm_vnic_alloc_output (size:128b/16B) */ 18252 struct hwrm_vnic_alloc_output { 18253 /* The specific error status for the command. */ 18254 uint16_t error_code; 18255 /* The HWRM command request type. */ 18256 uint16_t req_type; 18257 /* The sequence ID from the original command. */ 18258 uint16_t seq_id; 18259 /* The length of the response data in number of bytes. */ 18260 uint16_t resp_len; 18261 /* Logical vnic ID */ 18262 uint32_t vnic_id; 18263 uint8_t unused_0[3]; 18264 /* 18265 * This field is used in Output records to indicate that the output 18266 * is completely written to RAM. This field should be read as '1' 18267 * to indicate that the output has been completely written. 18268 * When writing a command completion or response to an internal processor, 18269 * the order of writes has to be such that this field is written last. 18270 */ 18271 uint8_t valid; 18272 } __attribute__((packed)); 18273 18274 /****************** 18275 * hwrm_vnic_free * 18276 ******************/ 18277 18278 18279 /* hwrm_vnic_free_input (size:192b/24B) */ 18280 struct hwrm_vnic_free_input { 18281 /* The HWRM command request type. */ 18282 uint16_t req_type; 18283 /* 18284 * The completion ring to send the completion event on. This should 18285 * be the NQ ID returned from the `nq_alloc` HWRM command. 18286 */ 18287 uint16_t cmpl_ring; 18288 /* 18289 * The sequence ID is used by the driver for tracking multiple 18290 * commands. This ID is treated as opaque data by the firmware and 18291 * the value is returned in the `hwrm_resp_hdr` upon completion. 18292 */ 18293 uint16_t seq_id; 18294 /* 18295 * The target ID of the command: 18296 * * 0x0-0xFFF8 - The function ID 18297 * * 0xFFF8-0xFFFE - Reserved for internal processors 18298 * * 0xFFFF - HWRM 18299 */ 18300 uint16_t target_id; 18301 /* 18302 * A physical address pointer pointing to a host buffer that the 18303 * command's response data will be written. This can be either a host 18304 * physical address (HPA) or a guest physical address (GPA) and must 18305 * point to a physically contiguous block of memory. 18306 */ 18307 uint64_t resp_addr; 18308 /* Logical vnic ID */ 18309 uint32_t vnic_id; 18310 uint8_t unused_0[4]; 18311 } __attribute__((packed)); 18312 18313 /* hwrm_vnic_free_output (size:128b/16B) */ 18314 struct hwrm_vnic_free_output { 18315 /* The specific error status for the command. */ 18316 uint16_t error_code; 18317 /* The HWRM command request type. */ 18318 uint16_t req_type; 18319 /* The sequence ID from the original command. */ 18320 uint16_t seq_id; 18321 /* The length of the response data in number of bytes. */ 18322 uint16_t resp_len; 18323 uint8_t unused_0[7]; 18324 /* 18325 * This field is used in Output records to indicate that the output 18326 * is completely written to RAM. This field should be read as '1' 18327 * to indicate that the output has been completely written. 18328 * When writing a command completion or response to an internal processor, 18329 * the order of writes has to be such that this field is written last. 18330 */ 18331 uint8_t valid; 18332 } __attribute__((packed)); 18333 18334 /***************** 18335 * hwrm_vnic_cfg * 18336 *****************/ 18337 18338 18339 /* hwrm_vnic_cfg_input (size:320b/40B) */ 18340 struct hwrm_vnic_cfg_input { 18341 /* The HWRM command request type. */ 18342 uint16_t req_type; 18343 /* 18344 * The completion ring to send the completion event on. This should 18345 * be the NQ ID returned from the `nq_alloc` HWRM command. 18346 */ 18347 uint16_t cmpl_ring; 18348 /* 18349 * The sequence ID is used by the driver for tracking multiple 18350 * commands. This ID is treated as opaque data by the firmware and 18351 * the value is returned in the `hwrm_resp_hdr` upon completion. 18352 */ 18353 uint16_t seq_id; 18354 /* 18355 * The target ID of the command: 18356 * * 0x0-0xFFF8 - The function ID 18357 * * 0xFFF8-0xFFFE - Reserved for internal processors 18358 * * 0xFFFF - HWRM 18359 */ 18360 uint16_t target_id; 18361 /* 18362 * A physical address pointer pointing to a host buffer that the 18363 * command's response data will be written. This can be either a host 18364 * physical address (HPA) or a guest physical address (GPA) and must 18365 * point to a physically contiguous block of memory. 18366 */ 18367 uint64_t resp_addr; 18368 uint32_t flags; 18369 /* 18370 * When this bit is '1', the VNIC is requested to 18371 * be the default VNIC for the function. 18372 */ 18373 #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT \ 18374 UINT32_C(0x1) 18375 /* 18376 * When this bit is '1', the VNIC is being configured to 18377 * strip VLAN in the RX path. 18378 * If set to '0', then VLAN stripping is disabled on 18379 * this VNIC. 18380 */ 18381 #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE \ 18382 UINT32_C(0x2) 18383 /* 18384 * When this bit is '1', the VNIC is being configured to 18385 * buffer receive packets in the hardware until the host 18386 * posts new receive buffers. 18387 * If set to '0', then bd_stall is being configured to be 18388 * disabled on this VNIC. 18389 */ 18390 #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE \ 18391 UINT32_C(0x4) 18392 /* 18393 * When this bit is '1', the VNIC is being configured to 18394 * receive both RoCE and non-RoCE traffic. 18395 * If set to '0', then this VNIC is not configured to be 18396 * operating in dual VNIC mode. 18397 */ 18398 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE \ 18399 UINT32_C(0x8) 18400 /* 18401 * When this flag is set to '1', the VNIC is requested to 18402 * be configured to receive only RoCE traffic. 18403 * If this flag is set to '0', then this flag shall be 18404 * ignored by the HWRM. 18405 * If roce_dual_vnic_mode flag is set to '1' 18406 * or roce_mirroring_capable_vnic_mode flag to 1, 18407 * then the HWRM client shall not set this flag to '1'. 18408 */ 18409 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE \ 18410 UINT32_C(0x10) 18411 /* 18412 * When a VNIC uses one destination ring group for certain 18413 * application (e.g. Receive Flow Steering) where 18414 * exact match is used to direct packets to a VNIC with one 18415 * destination ring group only, there is no need to configure 18416 * RSS indirection table for that VNIC as only one destination 18417 * ring group is used. 18418 * 18419 * This flag is used to enable a mode where 18420 * RSS is enabled in the VNIC using a RSS context 18421 * for computing RSS hash but the RSS indirection table is 18422 * not configured using hwrm_vnic_rss_cfg. 18423 * 18424 * If this mode is enabled, then the driver should not program 18425 * RSS indirection table for the RSS context that is used for 18426 * computing RSS hash only. 18427 */ 18428 #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE \ 18429 UINT32_C(0x20) 18430 /* 18431 * When this bit is '1', the VNIC is being configured to 18432 * receive both RoCE and non-RoCE traffic, but forward only the 18433 * RoCE traffic further. Also, RoCE traffic can be mirrored to 18434 * L2 driver. 18435 */ 18436 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \ 18437 UINT32_C(0x40) 18438 uint32_t enables; 18439 /* 18440 * This bit must be '1' for the dflt_ring_grp field to be 18441 * configured. 18442 */ 18443 #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP \ 18444 UINT32_C(0x1) 18445 /* 18446 * This bit must be '1' for the rss_rule field to be 18447 * configured. 18448 */ 18449 #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE \ 18450 UINT32_C(0x2) 18451 /* 18452 * This bit must be '1' for the cos_rule field to be 18453 * configured. 18454 */ 18455 #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE \ 18456 UINT32_C(0x4) 18457 /* 18458 * This bit must be '1' for the lb_rule field to be 18459 * configured. 18460 */ 18461 #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE \ 18462 UINT32_C(0x8) 18463 /* 18464 * This bit must be '1' for the mru field to be 18465 * configured. 18466 */ 18467 #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU \ 18468 UINT32_C(0x10) 18469 /* 18470 * This bit must be '1' for the default_rx_ring_id field to be 18471 * configured. 18472 */ 18473 #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID \ 18474 UINT32_C(0x20) 18475 /* 18476 * This bit must be '1' for the default_cmpl_ring_id field to be 18477 * configured. 18478 */ 18479 #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID \ 18480 UINT32_C(0x40) 18481 /* Logical vnic ID */ 18482 uint16_t vnic_id; 18483 /* 18484 * Default Completion ring for the VNIC. This ring will 18485 * be chosen if packet does not match any RSS rules and if 18486 * there is no COS rule. 18487 */ 18488 uint16_t dflt_ring_grp; 18489 /* 18490 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if 18491 * there is no RSS rule. 18492 */ 18493 uint16_t rss_rule; 18494 /* 18495 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if 18496 * there is no COS rule. 18497 */ 18498 uint16_t cos_rule; 18499 /* 18500 * RSS ID for load balancing rule/table structure. 18501 * 0xFF... (All Fs) if there is no LB rule. 18502 */ 18503 uint16_t lb_rule; 18504 /* 18505 * The maximum receive unit of the vnic. 18506 * Each vnic is associated with a function. 18507 * The vnic mru value overwrites the mru setting of the 18508 * associated function. 18509 * The HWRM shall make sure that vnic mru does not exceed 18510 * the mru of the port the function is associated with. 18511 */ 18512 uint16_t mru; 18513 /* 18514 * Default Rx ring for the VNIC. This ring will 18515 * be chosen if packet does not match any RSS rules. 18516 * The aggregation ring associated with the Rx ring is 18517 * implied based on the Rx ring specified when the 18518 * aggregation ring was allocated. 18519 */ 18520 uint16_t default_rx_ring_id; 18521 /* 18522 * Default completion ring for the VNIC. This ring will 18523 * be chosen if packet does not match any RSS rules. 18524 */ 18525 uint16_t default_cmpl_ring_id; 18526 } __attribute__((packed)); 18527 18528 /* hwrm_vnic_cfg_output (size:128b/16B) */ 18529 struct hwrm_vnic_cfg_output { 18530 /* The specific error status for the command. */ 18531 uint16_t error_code; 18532 /* The HWRM command request type. */ 18533 uint16_t req_type; 18534 /* The sequence ID from the original command. */ 18535 uint16_t seq_id; 18536 /* The length of the response data in number of bytes. */ 18537 uint16_t resp_len; 18538 uint8_t unused_0[7]; 18539 /* 18540 * This field is used in Output records to indicate that the output 18541 * is completely written to RAM. This field should be read as '1' 18542 * to indicate that the output has been completely written. 18543 * When writing a command completion or response to an internal processor, 18544 * the order of writes has to be such that this field is written last. 18545 */ 18546 uint8_t valid; 18547 } __attribute__((packed)); 18548 18549 /****************** 18550 * hwrm_vnic_qcfg * 18551 ******************/ 18552 18553 18554 /* hwrm_vnic_qcfg_input (size:256b/32B) */ 18555 struct hwrm_vnic_qcfg_input { 18556 /* The HWRM command request type. */ 18557 uint16_t req_type; 18558 /* 18559 * The completion ring to send the completion event on. This should 18560 * be the NQ ID returned from the `nq_alloc` HWRM command. 18561 */ 18562 uint16_t cmpl_ring; 18563 /* 18564 * The sequence ID is used by the driver for tracking multiple 18565 * commands. This ID is treated as opaque data by the firmware and 18566 * the value is returned in the `hwrm_resp_hdr` upon completion. 18567 */ 18568 uint16_t seq_id; 18569 /* 18570 * The target ID of the command: 18571 * * 0x0-0xFFF8 - The function ID 18572 * * 0xFFF8-0xFFFE - Reserved for internal processors 18573 * * 0xFFFF - HWRM 18574 */ 18575 uint16_t target_id; 18576 /* 18577 * A physical address pointer pointing to a host buffer that the 18578 * command's response data will be written. This can be either a host 18579 * physical address (HPA) or a guest physical address (GPA) and must 18580 * point to a physically contiguous block of memory. 18581 */ 18582 uint64_t resp_addr; 18583 uint32_t enables; 18584 /* 18585 * This bit must be '1' for the vf_id_valid field to be 18586 * configured. 18587 */ 18588 #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID UINT32_C(0x1) 18589 /* Logical vnic ID */ 18590 uint32_t vnic_id; 18591 /* ID of Virtual Function whose VNIC resource is being queried. */ 18592 uint16_t vf_id; 18593 uint8_t unused_0[6]; 18594 } __attribute__((packed)); 18595 18596 /* hwrm_vnic_qcfg_output (size:256b/32B) */ 18597 struct hwrm_vnic_qcfg_output { 18598 /* The specific error status for the command. */ 18599 uint16_t error_code; 18600 /* The HWRM command request type. */ 18601 uint16_t req_type; 18602 /* The sequence ID from the original command. */ 18603 uint16_t seq_id; 18604 /* The length of the response data in number of bytes. */ 18605 uint16_t resp_len; 18606 /* Default Completion ring for the VNIC. */ 18607 uint16_t dflt_ring_grp; 18608 /* 18609 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if 18610 * there is no RSS rule. 18611 */ 18612 uint16_t rss_rule; 18613 /* 18614 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if 18615 * there is no COS rule. 18616 */ 18617 uint16_t cos_rule; 18618 /* 18619 * RSS ID for load balancing rule/table structure. 18620 * 0xFF... (All Fs) if there is no LB rule. 18621 */ 18622 uint16_t lb_rule; 18623 /* The maximum receive unit of the vnic. */ 18624 uint16_t mru; 18625 uint8_t unused_0[2]; 18626 uint32_t flags; 18627 /* 18628 * When this bit is '1', the VNIC is the default VNIC for 18629 * the function. 18630 */ 18631 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT \ 18632 UINT32_C(0x1) 18633 /* 18634 * When this bit is '1', the VNIC is configured to 18635 * strip VLAN in the RX path. 18636 * If set to '0', then VLAN stripping is disabled on 18637 * this VNIC. 18638 */ 18639 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE \ 18640 UINT32_C(0x2) 18641 /* 18642 * When this bit is '1', the VNIC is configured to 18643 * buffer receive packets in the hardware until the host 18644 * posts new receive buffers. 18645 * If set to '0', then bd_stall is disabled on 18646 * this VNIC. 18647 */ 18648 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE \ 18649 UINT32_C(0x4) 18650 /* 18651 * When this bit is '1', the VNIC is configured to 18652 * receive both RoCE and non-RoCE traffic. 18653 * If set to '0', then this VNIC is not configured to 18654 * operate in dual VNIC mode. 18655 */ 18656 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE \ 18657 UINT32_C(0x8) 18658 /* 18659 * When this flag is set to '1', the VNIC is configured to 18660 * receive only RoCE traffic. 18661 * When this flag is set to '0', the VNIC is not configured 18662 * to receive only RoCE traffic. 18663 * If roce_dual_vnic_mode flag and this flag both are set 18664 * to '1', then it is an invalid configuration of the 18665 * VNIC. The HWRM should not allow that type of 18666 * mis-configuration by HWRM clients. 18667 */ 18668 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE \ 18669 UINT32_C(0x10) 18670 /* 18671 * When a VNIC uses one destination ring group for certain 18672 * application (e.g. Receive Flow Steering) where 18673 * exact match is used to direct packets to a VNIC with one 18674 * destination ring group only, there is no need to configure 18675 * RSS indirection table for that VNIC as only one destination 18676 * ring group is used. 18677 * 18678 * When this bit is set to '1', then the VNIC is enabled in a 18679 * mode where RSS is enabled in the VNIC using a RSS context 18680 * for computing RSS hash but the RSS indirection table is 18681 * not configured. 18682 */ 18683 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE \ 18684 UINT32_C(0x20) 18685 /* 18686 * When this bit is '1', the VNIC is configured to 18687 * receive both RoCE and non-RoCE traffic, but forward only 18688 * RoCE traffic further. Also RoCE traffic can be mirrored to 18689 * L2 driver. 18690 */ 18691 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \ 18692 UINT32_C(0x40) 18693 uint8_t unused_1[7]; 18694 /* 18695 * This field is used in Output records to indicate that the output 18696 * is completely written to RAM. This field should be read as '1' 18697 * to indicate that the output has been completely written. 18698 * When writing a command completion or response to an internal processor, 18699 * the order of writes has to be such that this field is written last. 18700 */ 18701 uint8_t valid; 18702 } __attribute__((packed)); 18703 18704 /******************* 18705 * hwrm_vnic_qcaps * 18706 *******************/ 18707 18708 18709 /* hwrm_vnic_qcaps_input (size:192b/24B) */ 18710 struct hwrm_vnic_qcaps_input { 18711 /* The HWRM command request type. */ 18712 uint16_t req_type; 18713 /* 18714 * The completion ring to send the completion event on. This should 18715 * be the NQ ID returned from the `nq_alloc` HWRM command. 18716 */ 18717 uint16_t cmpl_ring; 18718 /* 18719 * The sequence ID is used by the driver for tracking multiple 18720 * commands. This ID is treated as opaque data by the firmware and 18721 * the value is returned in the `hwrm_resp_hdr` upon completion. 18722 */ 18723 uint16_t seq_id; 18724 /* 18725 * The target ID of the command: 18726 * * 0x0-0xFFF8 - The function ID 18727 * * 0xFFF8-0xFFFE - Reserved for internal processors 18728 * * 0xFFFF - HWRM 18729 */ 18730 uint16_t target_id; 18731 /* 18732 * A physical address pointer pointing to a host buffer that the 18733 * command's response data will be written. This can be either a host 18734 * physical address (HPA) or a guest physical address (GPA) and must 18735 * point to a physically contiguous block of memory. 18736 */ 18737 uint64_t resp_addr; 18738 uint32_t enables; 18739 uint8_t unused_0[4]; 18740 } __attribute__((packed)); 18741 18742 /* hwrm_vnic_qcaps_output (size:192b/24B) */ 18743 struct hwrm_vnic_qcaps_output { 18744 /* The specific error status for the command. */ 18745 uint16_t error_code; 18746 /* The HWRM command request type. */ 18747 uint16_t req_type; 18748 /* The sequence ID from the original command. */ 18749 uint16_t seq_id; 18750 /* The length of the response data in number of bytes. */ 18751 uint16_t resp_len; 18752 /* The maximum receive unit that is settable on a vnic. */ 18753 uint16_t mru; 18754 uint8_t unused_0[2]; 18755 uint32_t flags; 18756 /* Unused. */ 18757 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED \ 18758 UINT32_C(0x1) 18759 /* 18760 * When this bit is '1', the capability of stripping VLAN in 18761 * the RX path is supported on VNIC(s). 18762 * If set to '0', then VLAN stripping capability is 18763 * not supported on VNIC(s). 18764 */ 18765 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP \ 18766 UINT32_C(0x2) 18767 /* 18768 * When this bit is '1', the capability to buffer receive 18769 * packets in the hardware until the host posts new receive buffers 18770 * is supported on VNIC(s). 18771 * If set to '0', then bd_stall capability is not supported 18772 * on VNIC(s). 18773 */ 18774 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP \ 18775 UINT32_C(0x4) 18776 /* 18777 * When this bit is '1', the capability to 18778 * receive both RoCE and non-RoCE traffic on VNIC(s) is 18779 * supported. 18780 * If set to '0', then the capability to receive 18781 * both RoCE and non-RoCE traffic on VNIC(s) is 18782 * not supported. 18783 */ 18784 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP \ 18785 UINT32_C(0x8) 18786 /* 18787 * When this bit is set to '1', the capability to configure 18788 * a VNIC to receive only RoCE traffic is supported. 18789 * When this flag is set to '0', the VNIC capability to 18790 * configure to receive only RoCE traffic is not supported. 18791 */ 18792 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP \ 18793 UINT32_C(0x10) 18794 /* 18795 * When this bit is set to '1', then the capability to enable 18796 * a VNIC in a mode where RSS context without configuring 18797 * RSS indirection table is supported (for RSS hash computation). 18798 * When this bit is set to '0', then a VNIC can not be configured 18799 * with a mode to enable RSS context without configuring RSS 18800 * indirection table. 18801 */ 18802 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP \ 18803 UINT32_C(0x20) 18804 /* 18805 * When this bit is '1', the capability to 18806 * mirror the the RoCE traffic is supported. 18807 * If set to '0', then the capability to mirror the 18808 * RoCE traffic is not supported. 18809 */ 18810 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP \ 18811 UINT32_C(0x40) 18812 /* 18813 * When this bit is '1', the outermost RSS hashing capability 18814 * is supported. If set to '0', then the outermost RSS hashing 18815 * capability is not supported. 18816 */ 18817 #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_CAP \ 18818 UINT32_C(0x80) 18819 uint8_t unused_1[7]; 18820 /* 18821 * This field is used in Output records to indicate that the output 18822 * is completely written to RAM. This field should be read as '1' 18823 * to indicate that the output has been completely written. 18824 * When writing a command completion or response to an internal processor, 18825 * the order of writes has to be such that this field is written last. 18826 */ 18827 uint8_t valid; 18828 } __attribute__((packed)); 18829 18830 /********************* 18831 * hwrm_vnic_tpa_cfg * 18832 *********************/ 18833 18834 18835 /* hwrm_vnic_tpa_cfg_input (size:320b/40B) */ 18836 struct hwrm_vnic_tpa_cfg_input { 18837 /* The HWRM command request type. */ 18838 uint16_t req_type; 18839 /* 18840 * The completion ring to send the completion event on. This should 18841 * be the NQ ID returned from the `nq_alloc` HWRM command. 18842 */ 18843 uint16_t cmpl_ring; 18844 /* 18845 * The sequence ID is used by the driver for tracking multiple 18846 * commands. This ID is treated as opaque data by the firmware and 18847 * the value is returned in the `hwrm_resp_hdr` upon completion. 18848 */ 18849 uint16_t seq_id; 18850 /* 18851 * The target ID of the command: 18852 * * 0x0-0xFFF8 - The function ID 18853 * * 0xFFF8-0xFFFE - Reserved for internal processors 18854 * * 0xFFFF - HWRM 18855 */ 18856 uint16_t target_id; 18857 /* 18858 * A physical address pointer pointing to a host buffer that the 18859 * command's response data will be written. This can be either a host 18860 * physical address (HPA) or a guest physical address (GPA) and must 18861 * point to a physically contiguous block of memory. 18862 */ 18863 uint64_t resp_addr; 18864 uint32_t flags; 18865 /* 18866 * When this bit is '1', the VNIC shall be configured to 18867 * perform transparent packet aggregation (TPA) of 18868 * non-tunneled TCP packets. 18869 */ 18870 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA \ 18871 UINT32_C(0x1) 18872 /* 18873 * When this bit is '1', the VNIC shall be configured to 18874 * perform transparent packet aggregation (TPA) of 18875 * tunneled TCP packets. 18876 */ 18877 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA \ 18878 UINT32_C(0x2) 18879 /* 18880 * When this bit is '1', the VNIC shall be configured to 18881 * perform transparent packet aggregation (TPA) according 18882 * to Windows Receive Segment Coalescing (RSC) rules. 18883 */ 18884 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE \ 18885 UINT32_C(0x4) 18886 /* 18887 * When this bit is '1', the VNIC shall be configured to 18888 * perform transparent packet aggregation (TPA) according 18889 * to Linux Generic Receive Offload (GRO) rules. 18890 */ 18891 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO \ 18892 UINT32_C(0x8) 18893 /* 18894 * When this bit is '1', the VNIC shall be configured to 18895 * perform transparent packet aggregation (TPA) for TCP 18896 * packets with IP ECN set to non-zero. 18897 */ 18898 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN \ 18899 UINT32_C(0x10) 18900 /* 18901 * When this bit is '1', the VNIC shall be configured to 18902 * perform transparent packet aggregation (TPA) for 18903 * GRE tunneled TCP packets only if all packets have the 18904 * same GRE sequence. 18905 */ 18906 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \ 18907 UINT32_C(0x20) 18908 /* 18909 * When this bit is '1' and the GRO mode is enabled, 18910 * the VNIC shall be configured to 18911 * perform transparent packet aggregation (TPA) for 18912 * TCP/IPv4 packets with consecutively increasing IPIDs. 18913 * In other words, the last packet that is being 18914 * aggregated to an already existing aggregation context 18915 * shall have IPID 1 more than the IPID of the last packet 18916 * that was aggregated in that aggregation context. 18917 */ 18918 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK \ 18919 UINT32_C(0x40) 18920 /* 18921 * When this bit is '1' and the GRO mode is enabled, 18922 * the VNIC shall be configured to 18923 * perform transparent packet aggregation (TPA) for 18924 * TCP packets with the same TTL (IPv4) or Hop limit (IPv6) 18925 * value. 18926 */ 18927 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK \ 18928 UINT32_C(0x80) 18929 uint32_t enables; 18930 /* 18931 * This bit must be '1' for the max_agg_segs field to be 18932 * configured. 18933 */ 18934 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS UINT32_C(0x1) 18935 /* 18936 * This bit must be '1' for the max_aggs field to be 18937 * configured. 18938 */ 18939 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS UINT32_C(0x2) 18940 /* 18941 * This bit must be '1' for the max_agg_timer field to be 18942 * configured. 18943 */ 18944 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER UINT32_C(0x4) 18945 /* 18946 * This bit must be '1' for the min_agg_len field to be 18947 * configured. 18948 */ 18949 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN UINT32_C(0x8) 18950 /* Logical vnic ID */ 18951 uint16_t vnic_id; 18952 /* 18953 * This is the maximum number of TCP segments that can 18954 * be aggregated (unit is Log2). Max value is 31. 18955 */ 18956 uint16_t max_agg_segs; 18957 /* 1 segment */ 18958 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1 UINT32_C(0x0) 18959 /* 2 segments */ 18960 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2 UINT32_C(0x1) 18961 /* 4 segments */ 18962 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4 UINT32_C(0x2) 18963 /* 8 segments */ 18964 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8 UINT32_C(0x3) 18965 /* Any segment size larger than this is not valid */ 18966 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f) 18967 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_LAST \ 18968 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX 18969 /* 18970 * This is the maximum number of aggregations this VNIC is 18971 * allowed (unit is Log2). Max value is 7 18972 */ 18973 uint16_t max_aggs; 18974 /* 1 aggregation */ 18975 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1 UINT32_C(0x0) 18976 /* 2 aggregations */ 18977 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2 UINT32_C(0x1) 18978 /* 4 aggregations */ 18979 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4 UINT32_C(0x2) 18980 /* 8 aggregations */ 18981 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8 UINT32_C(0x3) 18982 /* 16 aggregations */ 18983 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16 UINT32_C(0x4) 18984 /* Any aggregation size larger than this is not valid */ 18985 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7) 18986 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_LAST \ 18987 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX 18988 uint8_t unused_0[2]; 18989 /* 18990 * This is the maximum amount of time allowed for 18991 * an aggregation context to complete after it was initiated. 18992 */ 18993 uint32_t max_agg_timer; 18994 /* 18995 * This is the minimum amount of payload length required to 18996 * start an aggregation context. 18997 */ 18998 uint32_t min_agg_len; 18999 } __attribute__((packed)); 19000 19001 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */ 19002 struct hwrm_vnic_tpa_cfg_output { 19003 /* The specific error status for the command. */ 19004 uint16_t error_code; 19005 /* The HWRM command request type. */ 19006 uint16_t req_type; 19007 /* The sequence ID from the original command. */ 19008 uint16_t seq_id; 19009 /* The length of the response data in number of bytes. */ 19010 uint16_t resp_len; 19011 uint8_t unused_0[7]; 19012 /* 19013 * This field is used in Output records to indicate that the output 19014 * is completely written to RAM. This field should be read as '1' 19015 * to indicate that the output has been completely written. 19016 * When writing a command completion or response to an internal processor, 19017 * the order of writes has to be such that this field is written last. 19018 */ 19019 uint8_t valid; 19020 } __attribute__((packed)); 19021 19022 /********************* 19023 * hwrm_vnic_rss_cfg * 19024 *********************/ 19025 19026 19027 /* hwrm_vnic_rss_cfg_input (size:384b/48B) */ 19028 struct hwrm_vnic_rss_cfg_input { 19029 /* The HWRM command request type. */ 19030 uint16_t req_type; 19031 /* 19032 * The completion ring to send the completion event on. This should 19033 * be the NQ ID returned from the `nq_alloc` HWRM command. 19034 */ 19035 uint16_t cmpl_ring; 19036 /* 19037 * The sequence ID is used by the driver for tracking multiple 19038 * commands. This ID is treated as opaque data by the firmware and 19039 * the value is returned in the `hwrm_resp_hdr` upon completion. 19040 */ 19041 uint16_t seq_id; 19042 /* 19043 * The target ID of the command: 19044 * * 0x0-0xFFF8 - The function ID 19045 * * 0xFFF8-0xFFFE - Reserved for internal processors 19046 * * 0xFFFF - HWRM 19047 */ 19048 uint16_t target_id; 19049 /* 19050 * A physical address pointer pointing to a host buffer that the 19051 * command's response data will be written. This can be either a host 19052 * physical address (HPA) or a guest physical address (GPA) and must 19053 * point to a physically contiguous block of memory. 19054 */ 19055 uint64_t resp_addr; 19056 uint32_t hash_type; 19057 /* 19058 * When this bit is '1', the RSS hash shall be computed 19059 * over source and destination IPv4 addresses of IPv4 19060 * packets. 19061 */ 19062 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4 UINT32_C(0x1) 19063 /* 19064 * When this bit is '1', the RSS hash shall be computed 19065 * over source/destination IPv4 addresses and 19066 * source/destination ports of TCP/IPv4 packets. 19067 */ 19068 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4 UINT32_C(0x2) 19069 /* 19070 * When this bit is '1', the RSS hash shall be computed 19071 * over source/destination IPv4 addresses and 19072 * source/destination ports of UDP/IPv4 packets. 19073 */ 19074 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4 UINT32_C(0x4) 19075 /* 19076 * When this bit is '1', the RSS hash shall be computed 19077 * over source and destination IPv4 addresses of IPv6 19078 * packets. 19079 */ 19080 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6 UINT32_C(0x8) 19081 /* 19082 * When this bit is '1', the RSS hash shall be computed 19083 * over source/destination IPv6 addresses and 19084 * source/destination ports of TCP/IPv6 packets. 19085 */ 19086 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6 UINT32_C(0x10) 19087 /* 19088 * When this bit is '1', the RSS hash shall be computed 19089 * over source/destination IPv6 addresses and 19090 * source/destination ports of UDP/IPv6 packets. 19091 */ 19092 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6 UINT32_C(0x20) 19093 /* VNIC ID of VNIC associated with RSS table being configured. */ 19094 uint16_t vnic_id; 19095 /* 19096 * Specifies which VNIC ring table pair to configure. 19097 * Valid values range from 0 to 7. 19098 */ 19099 uint8_t ring_table_pair_index; 19100 /* Flags to specify different RSS hash modes. */ 19101 uint8_t hash_mode_flags; 19102 /* 19103 * When this bit is '1', it indicates using current RSS 19104 * hash mode setting configured in the device. 19105 */ 19106 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT \ 19107 UINT32_C(0x1) 19108 /* 19109 * When this bit is '1', it indicates requesting support of 19110 * RSS hashing over innermost 4 tuples {l3.src, l3.dest, 19111 * l4.src, l4.dest} for tunnel packets. For none-tunnel 19112 * packets, the RSS hash is computed over the normal 19113 * src/dest l3 and src/dest l4 headers. 19114 */ 19115 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 \ 19116 UINT32_C(0x2) 19117 /* 19118 * When this bit is '1', it indicates requesting support of 19119 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for 19120 * tunnel packets. For none-tunnel packets, the RSS hash is 19121 * computed over the normal src/dest l3 headers. 19122 */ 19123 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 \ 19124 UINT32_C(0x4) 19125 /* 19126 * When this bit is '1', it indicates requesting support of 19127 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest, 19128 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel 19129 * packets, the RSS hash is computed over the normal 19130 * src/dest l3 and src/dest l4 headers. 19131 */ 19132 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 \ 19133 UINT32_C(0x8) 19134 /* 19135 * When this bit is '1', it indicates requesting support of 19136 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for 19137 * tunnel packets. For none-tunnel packets, the RSS hash is 19138 * computed over the normal src/dest l3 headers. 19139 */ 19140 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 \ 19141 UINT32_C(0x10) 19142 /* This is the address for rss ring group table */ 19143 uint64_t ring_grp_tbl_addr; 19144 /* This is the address for rss hash key table */ 19145 uint64_t hash_key_tbl_addr; 19146 /* Index to the rss indirection table. */ 19147 uint16_t rss_ctx_idx; 19148 uint8_t unused_1[6]; 19149 } __attribute__((packed)); 19150 19151 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */ 19152 struct hwrm_vnic_rss_cfg_output { 19153 /* The specific error status for the command. */ 19154 uint16_t error_code; 19155 /* The HWRM command request type. */ 19156 uint16_t req_type; 19157 /* The sequence ID from the original command. */ 19158 uint16_t seq_id; 19159 /* The length of the response data in number of bytes. */ 19160 uint16_t resp_len; 19161 uint8_t unused_0[7]; 19162 /* 19163 * This field is used in Output records to indicate that the output 19164 * is completely written to RAM. This field should be read as '1' 19165 * to indicate that the output has been completely written. 19166 * When writing a command completion or response to an internal processor, 19167 * the order of writes has to be such that this field is written last. 19168 */ 19169 uint8_t valid; 19170 } __attribute__((packed)); 19171 19172 /********************** 19173 * hwrm_vnic_rss_qcfg * 19174 **********************/ 19175 19176 19177 /* hwrm_vnic_rss_qcfg_input (size:192b/24B) */ 19178 struct hwrm_vnic_rss_qcfg_input { 19179 /* The HWRM command request type. */ 19180 uint16_t req_type; 19181 /* 19182 * The completion ring to send the completion event on. This should 19183 * be the NQ ID returned from the `nq_alloc` HWRM command. 19184 */ 19185 uint16_t cmpl_ring; 19186 /* 19187 * The sequence ID is used by the driver for tracking multiple 19188 * commands. This ID is treated as opaque data by the firmware and 19189 * the value is returned in the `hwrm_resp_hdr` upon completion. 19190 */ 19191 uint16_t seq_id; 19192 /* 19193 * The target ID of the command: 19194 * * 0x0-0xFFF8 - The function ID 19195 * * 0xFFF8-0xFFFE - Reserved for internal processors 19196 * * 0xFFFF - HWRM 19197 */ 19198 uint16_t target_id; 19199 /* 19200 * A physical address pointer pointing to a host buffer that the 19201 * command's response data will be written. This can be either a host 19202 * physical address (HPA) or a guest physical address (GPA) and must 19203 * point to a physically contiguous block of memory. 19204 */ 19205 uint64_t resp_addr; 19206 /* Index to the rss indirection table. */ 19207 uint16_t rss_ctx_idx; 19208 uint8_t unused_0[6]; 19209 } __attribute__((packed)); 19210 19211 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */ 19212 struct hwrm_vnic_rss_qcfg_output { 19213 /* The specific error status for the command. */ 19214 uint16_t error_code; 19215 /* The HWRM command request type. */ 19216 uint16_t req_type; 19217 /* The sequence ID from the original command. */ 19218 uint16_t seq_id; 19219 /* The length of the response data in number of bytes. */ 19220 uint16_t resp_len; 19221 uint32_t hash_type; 19222 /* 19223 * When this bit is '1', the RSS hash shall be computed 19224 * over source and destination IPv4 addresses of IPv4 19225 * packets. 19226 */ 19227 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4 UINT32_C(0x1) 19228 /* 19229 * When this bit is '1', the RSS hash shall be computed 19230 * over source/destination IPv4 addresses and 19231 * source/destination ports of TCP/IPv4 packets. 19232 */ 19233 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4 UINT32_C(0x2) 19234 /* 19235 * When this bit is '1', the RSS hash shall be computed 19236 * over source/destination IPv4 addresses and 19237 * source/destination ports of UDP/IPv4 packets. 19238 */ 19239 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4 UINT32_C(0x4) 19240 /* 19241 * When this bit is '1', the RSS hash shall be computed 19242 * over source and destination IPv4 addresses of IPv6 19243 * packets. 19244 */ 19245 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6 UINT32_C(0x8) 19246 /* 19247 * When this bit is '1', the RSS hash shall be computed 19248 * over source/destination IPv6 addresses and 19249 * source/destination ports of TCP/IPv6 packets. 19250 */ 19251 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6 UINT32_C(0x10) 19252 /* 19253 * When this bit is '1', the RSS hash shall be computed 19254 * over source/destination IPv6 addresses and 19255 * source/destination ports of UDP/IPv6 packets. 19256 */ 19257 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6 UINT32_C(0x20) 19258 uint8_t unused_0[4]; 19259 /* This is the value of rss hash key */ 19260 uint32_t hash_key[10]; 19261 /* Flags to specify different RSS hash modes. */ 19262 uint8_t hash_mode_flags; 19263 /* 19264 * When this bit is '1', it indicates using current RSS 19265 * hash mode setting configured in the device. 19266 */ 19267 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT \ 19268 UINT32_C(0x1) 19269 /* 19270 * When this bit is '1', it indicates requesting support of 19271 * RSS hashing over innermost 4 tuples {l3.src, l3.dest, 19272 * l4.src, l4.dest} for tunnel packets. For none-tunnel 19273 * packets, the RSS hash is computed over the normal 19274 * src/dest l3 and src/dest l4 headers. 19275 */ 19276 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 \ 19277 UINT32_C(0x2) 19278 /* 19279 * When this bit is '1', it indicates requesting support of 19280 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for 19281 * tunnel packets. For none-tunnel packets, the RSS hash is 19282 * computed over the normal src/dest l3 headers. 19283 */ 19284 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 \ 19285 UINT32_C(0x4) 19286 /* 19287 * When this bit is '1', it indicates requesting support of 19288 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest, 19289 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel 19290 * packets, the RSS hash is computed over the normal 19291 * src/dest l3 and src/dest l4 headers. 19292 */ 19293 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 \ 19294 UINT32_C(0x8) 19295 /* 19296 * When this bit is '1', it indicates requesting support of 19297 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for 19298 * tunnel packets. For none-tunnel packets, the RSS hash is 19299 * computed over the normal src/dest l3 headers. 19300 */ 19301 #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 \ 19302 UINT32_C(0x10) 19303 uint8_t unused_1[6]; 19304 /* 19305 * This field is used in Output records to indicate that the output 19306 * is completely written to RAM. This field should be read as '1' 19307 * to indicate that the output has been completely written. 19308 * When writing a command completion or response to an internal processor, 19309 * the order of writes has to be such that this field is written last. 19310 */ 19311 uint8_t valid; 19312 } __attribute__((packed)); 19313 19314 /************************** 19315 * hwrm_vnic_plcmodes_cfg * 19316 **************************/ 19317 19318 19319 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */ 19320 struct hwrm_vnic_plcmodes_cfg_input { 19321 /* The HWRM command request type. */ 19322 uint16_t req_type; 19323 /* 19324 * The completion ring to send the completion event on. This should 19325 * be the NQ ID returned from the `nq_alloc` HWRM command. 19326 */ 19327 uint16_t cmpl_ring; 19328 /* 19329 * The sequence ID is used by the driver for tracking multiple 19330 * commands. This ID is treated as opaque data by the firmware and 19331 * the value is returned in the `hwrm_resp_hdr` upon completion. 19332 */ 19333 uint16_t seq_id; 19334 /* 19335 * The target ID of the command: 19336 * * 0x0-0xFFF8 - The function ID 19337 * * 0xFFF8-0xFFFE - Reserved for internal processors 19338 * * 0xFFFF - HWRM 19339 */ 19340 uint16_t target_id; 19341 /* 19342 * A physical address pointer pointing to a host buffer that the 19343 * command's response data will be written. This can be either a host 19344 * physical address (HPA) or a guest physical address (GPA) and must 19345 * point to a physically contiguous block of memory. 19346 */ 19347 uint64_t resp_addr; 19348 uint32_t flags; 19349 /* 19350 * When this bit is '1', the VNIC shall be configured to 19351 * use regular placement algorithm. 19352 * By default, the regular placement algorithm shall be 19353 * enabled on the VNIC. 19354 */ 19355 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT \ 19356 UINT32_C(0x1) 19357 /* 19358 * When this bit is '1', the VNIC shall be configured 19359 * use the jumbo placement algorithm. 19360 */ 19361 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT \ 19362 UINT32_C(0x2) 19363 /* 19364 * When this bit is '1', the VNIC shall be configured 19365 * to enable Header-Data split for IPv4 packets according 19366 * to the following rules: 19367 * # If the packet is identified as TCP/IPv4, then the 19368 * packet is split at the beginning of the TCP payload. 19369 * # If the packet is identified as UDP/IPv4, then the 19370 * packet is split at the beginning of UDP payload. 19371 * # If the packet is identified as non-TCP and non-UDP 19372 * IPv4 packet, then the packet is split at the beginning 19373 * of the upper layer protocol header carried in the IPv4 19374 * packet. 19375 */ 19376 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 \ 19377 UINT32_C(0x4) 19378 /* 19379 * When this bit is '1', the VNIC shall be configured 19380 * to enable Header-Data split for IPv6 packets according 19381 * to the following rules: 19382 * # If the packet is identified as TCP/IPv6, then the 19383 * packet is split at the beginning of the TCP payload. 19384 * # If the packet is identified as UDP/IPv6, then the 19385 * packet is split at the beginning of UDP payload. 19386 * # If the packet is identified as non-TCP and non-UDP 19387 * IPv6 packet, then the packet is split at the beginning 19388 * of the upper layer protocol header carried in the IPv6 19389 * packet. 19390 */ 19391 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 \ 19392 UINT32_C(0x8) 19393 /* 19394 * When this bit is '1', the VNIC shall be configured 19395 * to enable Header-Data split for FCoE packets at the 19396 * beginning of FC payload. 19397 */ 19398 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE \ 19399 UINT32_C(0x10) 19400 /* 19401 * When this bit is '1', the VNIC shall be configured 19402 * to enable Header-Data split for RoCE packets at the 19403 * beginning of RoCE payload (after BTH/GRH headers). 19404 */ 19405 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE \ 19406 UINT32_C(0x20) 19407 uint32_t enables; 19408 /* 19409 * This bit must be '1' for the jumbo_thresh_valid field to be 19410 * configured. 19411 */ 19412 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID \ 19413 UINT32_C(0x1) 19414 /* 19415 * This bit must be '1' for the hds_offset_valid field to be 19416 * configured. 19417 */ 19418 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID \ 19419 UINT32_C(0x2) 19420 /* 19421 * This bit must be '1' for the hds_threshold_valid field to be 19422 * configured. 19423 */ 19424 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID \ 19425 UINT32_C(0x4) 19426 /* Logical vnic ID */ 19427 uint32_t vnic_id; 19428 /* 19429 * When jumbo placement algorithm is enabled, this value 19430 * is used to determine the threshold for jumbo placement. 19431 * Packets with length larger than this value will be 19432 * placed according to the jumbo placement algorithm. 19433 */ 19434 uint16_t jumbo_thresh; 19435 /* 19436 * This value is used to determine the offset into 19437 * packet buffer where the split data (payload) will be 19438 * placed according to one of of HDS placement algorithm. 19439 * 19440 * The lengths of packet buffers provided for split data 19441 * shall be larger than this value. 19442 */ 19443 uint16_t hds_offset; 19444 /* 19445 * When one of the HDS placement algorithm is enabled, this 19446 * value is used to determine the threshold for HDS 19447 * placement. 19448 * Packets with length larger than this value will be 19449 * placed according to the HDS placement algorithm. 19450 * This value shall be in multiple of 4 bytes. 19451 */ 19452 uint16_t hds_threshold; 19453 uint8_t unused_0[6]; 19454 } __attribute__((packed)); 19455 19456 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */ 19457 struct hwrm_vnic_plcmodes_cfg_output { 19458 /* The specific error status for the command. */ 19459 uint16_t error_code; 19460 /* The HWRM command request type. */ 19461 uint16_t req_type; 19462 /* The sequence ID from the original command. */ 19463 uint16_t seq_id; 19464 /* The length of the response data in number of bytes. */ 19465 uint16_t resp_len; 19466 uint8_t unused_0[7]; 19467 /* 19468 * This field is used in Output records to indicate that the output 19469 * is completely written to RAM. This field should be read as '1' 19470 * to indicate that the output has been completely written. 19471 * When writing a command completion or response to an internal processor, 19472 * the order of writes has to be such that this field is written last. 19473 */ 19474 uint8_t valid; 19475 } __attribute__((packed)); 19476 19477 /*************************** 19478 * hwrm_vnic_plcmodes_qcfg * 19479 ***************************/ 19480 19481 19482 /* hwrm_vnic_plcmodes_qcfg_input (size:192b/24B) */ 19483 struct hwrm_vnic_plcmodes_qcfg_input { 19484 /* The HWRM command request type. */ 19485 uint16_t req_type; 19486 /* 19487 * The completion ring to send the completion event on. This should 19488 * be the NQ ID returned from the `nq_alloc` HWRM command. 19489 */ 19490 uint16_t cmpl_ring; 19491 /* 19492 * The sequence ID is used by the driver for tracking multiple 19493 * commands. This ID is treated as opaque data by the firmware and 19494 * the value is returned in the `hwrm_resp_hdr` upon completion. 19495 */ 19496 uint16_t seq_id; 19497 /* 19498 * The target ID of the command: 19499 * * 0x0-0xFFF8 - The function ID 19500 * * 0xFFF8-0xFFFE - Reserved for internal processors 19501 * * 0xFFFF - HWRM 19502 */ 19503 uint16_t target_id; 19504 /* 19505 * A physical address pointer pointing to a host buffer that the 19506 * command's response data will be written. This can be either a host 19507 * physical address (HPA) or a guest physical address (GPA) and must 19508 * point to a physically contiguous block of memory. 19509 */ 19510 uint64_t resp_addr; 19511 /* Logical vnic ID */ 19512 uint32_t vnic_id; 19513 uint8_t unused_0[4]; 19514 } __attribute__((packed)); 19515 19516 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */ 19517 struct hwrm_vnic_plcmodes_qcfg_output { 19518 /* The specific error status for the command. */ 19519 uint16_t error_code; 19520 /* The HWRM command request type. */ 19521 uint16_t req_type; 19522 /* The sequence ID from the original command. */ 19523 uint16_t seq_id; 19524 /* The length of the response data in number of bytes. */ 19525 uint16_t resp_len; 19526 uint32_t flags; 19527 /* 19528 * When this bit is '1', the VNIC is configured to 19529 * use regular placement algorithm. 19530 */ 19531 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT \ 19532 UINT32_C(0x1) 19533 /* 19534 * When this bit is '1', the VNIC is configured to 19535 * use the jumbo placement algorithm. 19536 */ 19537 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT \ 19538 UINT32_C(0x2) 19539 /* 19540 * When this bit is '1', the VNIC is configured 19541 * to enable Header-Data split for IPv4 packets. 19542 */ 19543 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 \ 19544 UINT32_C(0x4) 19545 /* 19546 * When this bit is '1', the VNIC is configured 19547 * to enable Header-Data split for IPv6 packets. 19548 */ 19549 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 \ 19550 UINT32_C(0x8) 19551 /* 19552 * When this bit is '1', the VNIC is configured 19553 * to enable Header-Data split for FCoE packets. 19554 */ 19555 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE \ 19556 UINT32_C(0x10) 19557 /* 19558 * When this bit is '1', the VNIC is configured 19559 * to enable Header-Data split for RoCE packets. 19560 */ 19561 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE \ 19562 UINT32_C(0x20) 19563 /* 19564 * When this bit is '1', the VNIC is configured 19565 * to be the default VNIC of the requesting function. 19566 */ 19567 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC \ 19568 UINT32_C(0x40) 19569 /* 19570 * When jumbo placement algorithm is enabled, this value 19571 * is used to determine the threshold for jumbo placement. 19572 * Packets with length larger than this value will be 19573 * placed according to the jumbo placement algorithm. 19574 */ 19575 uint16_t jumbo_thresh; 19576 /* 19577 * This value is used to determine the offset into 19578 * packet buffer where the split data (payload) will be 19579 * placed according to one of of HDS placement algorithm. 19580 * 19581 * The lengths of packet buffers provided for split data 19582 * shall be larger than this value. 19583 */ 19584 uint16_t hds_offset; 19585 /* 19586 * When one of the HDS placement algorithm is enabled, this 19587 * value is used to determine the threshold for HDS 19588 * placement. 19589 * Packets with length larger than this value will be 19590 * placed according to the HDS placement algorithm. 19591 * This value shall be in multiple of 4 bytes. 19592 */ 19593 uint16_t hds_threshold; 19594 uint8_t unused_0[5]; 19595 /* 19596 * This field is used in Output records to indicate that the output 19597 * is completely written to RAM. This field should be read as '1' 19598 * to indicate that the output has been completely written. 19599 * When writing a command completion or response to an internal processor, 19600 * the order of writes has to be such that this field is written last. 19601 */ 19602 uint8_t valid; 19603 } __attribute__((packed)); 19604 19605 /********************************** 19606 * hwrm_vnic_rss_cos_lb_ctx_alloc * 19607 **********************************/ 19608 19609 19610 /* hwrm_vnic_rss_cos_lb_ctx_alloc_input (size:128b/16B) */ 19611 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input { 19612 /* The HWRM command request type. */ 19613 uint16_t req_type; 19614 /* 19615 * The completion ring to send the completion event on. This should 19616 * be the NQ ID returned from the `nq_alloc` HWRM command. 19617 */ 19618 uint16_t cmpl_ring; 19619 /* 19620 * The sequence ID is used by the driver for tracking multiple 19621 * commands. This ID is treated as opaque data by the firmware and 19622 * the value is returned in the `hwrm_resp_hdr` upon completion. 19623 */ 19624 uint16_t seq_id; 19625 /* 19626 * The target ID of the command: 19627 * * 0x0-0xFFF8 - The function ID 19628 * * 0xFFF8-0xFFFE - Reserved for internal processors 19629 * * 0xFFFF - HWRM 19630 */ 19631 uint16_t target_id; 19632 /* 19633 * A physical address pointer pointing to a host buffer that the 19634 * command's response data will be written. This can be either a host 19635 * physical address (HPA) or a guest physical address (GPA) and must 19636 * point to a physically contiguous block of memory. 19637 */ 19638 uint64_t resp_addr; 19639 } __attribute__((packed)); 19640 19641 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */ 19642 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output { 19643 /* The specific error status for the command. */ 19644 uint16_t error_code; 19645 /* The HWRM command request type. */ 19646 uint16_t req_type; 19647 /* The sequence ID from the original command. */ 19648 uint16_t seq_id; 19649 /* The length of the response data in number of bytes. */ 19650 uint16_t resp_len; 19651 /* rss_cos_lb_ctx_id is 16 b */ 19652 uint16_t rss_cos_lb_ctx_id; 19653 uint8_t unused_0[5]; 19654 /* 19655 * This field is used in Output records to indicate that the output 19656 * is completely written to RAM. This field should be read as '1' 19657 * to indicate that the output has been completely written. 19658 * When writing a command completion or response to an internal processor, 19659 * the order of writes has to be such that this field is written last. 19660 */ 19661 uint8_t valid; 19662 } __attribute__((packed)); 19663 19664 /********************************* 19665 * hwrm_vnic_rss_cos_lb_ctx_free * 19666 *********************************/ 19667 19668 19669 /* hwrm_vnic_rss_cos_lb_ctx_free_input (size:192b/24B) */ 19670 struct hwrm_vnic_rss_cos_lb_ctx_free_input { 19671 /* The HWRM command request type. */ 19672 uint16_t req_type; 19673 /* 19674 * The completion ring to send the completion event on. This should 19675 * be the NQ ID returned from the `nq_alloc` HWRM command. 19676 */ 19677 uint16_t cmpl_ring; 19678 /* 19679 * The sequence ID is used by the driver for tracking multiple 19680 * commands. This ID is treated as opaque data by the firmware and 19681 * the value is returned in the `hwrm_resp_hdr` upon completion. 19682 */ 19683 uint16_t seq_id; 19684 /* 19685 * The target ID of the command: 19686 * * 0x0-0xFFF8 - The function ID 19687 * * 0xFFF8-0xFFFE - Reserved for internal processors 19688 * * 0xFFFF - HWRM 19689 */ 19690 uint16_t target_id; 19691 /* 19692 * A physical address pointer pointing to a host buffer that the 19693 * command's response data will be written. This can be either a host 19694 * physical address (HPA) or a guest physical address (GPA) and must 19695 * point to a physically contiguous block of memory. 19696 */ 19697 uint64_t resp_addr; 19698 /* rss_cos_lb_ctx_id is 16 b */ 19699 uint16_t rss_cos_lb_ctx_id; 19700 uint8_t unused_0[6]; 19701 } __attribute__((packed)); 19702 19703 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */ 19704 struct hwrm_vnic_rss_cos_lb_ctx_free_output { 19705 /* The specific error status for the command. */ 19706 uint16_t error_code; 19707 /* The HWRM command request type. */ 19708 uint16_t req_type; 19709 /* The sequence ID from the original command. */ 19710 uint16_t seq_id; 19711 /* The length of the response data in number of bytes. */ 19712 uint16_t resp_len; 19713 uint8_t unused_0[7]; 19714 /* 19715 * This field is used in Output records to indicate that the output 19716 * is completely written to RAM. This field should be read as '1' 19717 * to indicate that the output has been completely written. 19718 * When writing a command completion or response to an internal processor, 19719 * the order of writes has to be such that this field is written last. 19720 */ 19721 uint8_t valid; 19722 } __attribute__((packed)); 19723 19724 /******************* 19725 * hwrm_ring_alloc * 19726 *******************/ 19727 19728 19729 /* hwrm_ring_alloc_input (size:704b/88B) */ 19730 struct hwrm_ring_alloc_input { 19731 /* The HWRM command request type. */ 19732 uint16_t req_type; 19733 /* 19734 * The completion ring to send the completion event on. This should 19735 * be the NQ ID returned from the `nq_alloc` HWRM command. 19736 */ 19737 uint16_t cmpl_ring; 19738 /* 19739 * The sequence ID is used by the driver for tracking multiple 19740 * commands. This ID is treated as opaque data by the firmware and 19741 * the value is returned in the `hwrm_resp_hdr` upon completion. 19742 */ 19743 uint16_t seq_id; 19744 /* 19745 * The target ID of the command: 19746 * * 0x0-0xFFF8 - The function ID 19747 * * 0xFFF8-0xFFFE - Reserved for internal processors 19748 * * 0xFFFF - HWRM 19749 */ 19750 uint16_t target_id; 19751 /* 19752 * A physical address pointer pointing to a host buffer that the 19753 * command's response data will be written. This can be either a host 19754 * physical address (HPA) or a guest physical address (GPA) and must 19755 * point to a physically contiguous block of memory. 19756 */ 19757 uint64_t resp_addr; 19758 uint32_t enables; 19759 /* 19760 * This bit must be '1' for the ring_arb_cfg field to be 19761 * configured. 19762 */ 19763 #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG \ 19764 UINT32_C(0x2) 19765 /* 19766 * This bit must be '1' for the stat_ctx_id_valid field to be 19767 * configured. 19768 */ 19769 #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID \ 19770 UINT32_C(0x8) 19771 /* 19772 * This bit must be '1' for the max_bw_valid field to be 19773 * configured. 19774 */ 19775 #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID \ 19776 UINT32_C(0x20) 19777 /* 19778 * This bit must be '1' for the rx_ring_id field to be 19779 * configured. 19780 */ 19781 #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID \ 19782 UINT32_C(0x40) 19783 /* 19784 * This bit must be '1' for the nq_ring_id field to be 19785 * configured. 19786 */ 19787 #define HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID \ 19788 UINT32_C(0x80) 19789 /* 19790 * This bit must be '1' for the rx_buf_size field to be 19791 * configured. 19792 */ 19793 #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID \ 19794 UINT32_C(0x100) 19795 /* Ring Type. */ 19796 uint8_t ring_type; 19797 /* L2 Completion Ring (CR) */ 19798 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0) 19799 /* TX Ring (TR) */ 19800 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX UINT32_C(0x1) 19801 /* RX Ring (RR) */ 19802 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX UINT32_C(0x2) 19803 /* RoCE Notification Completion Ring (ROCE_CR) */ 19804 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3) 19805 /* RX Aggregation Ring */ 19806 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG UINT32_C(0x4) 19807 /* Notification Queue */ 19808 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ UINT32_C(0x5) 19809 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_LAST \ 19810 HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ 19811 uint8_t unused_0; 19812 /* Ring allocation flags. */ 19813 uint16_t flags; 19814 /* 19815 * For Rx rings, the incoming packet data can be placed at either 19816 * a 0B or 2B offset from the start of the Rx packet buffer. When 19817 * '1', the received packet will be padded with 2B of zeros at the 19818 * front of the packet. Note that this flag is only used for 19819 * Rx rings and is ignored for all other rings included Rx 19820 * Aggregation rings. 19821 */ 19822 #define HWRM_RING_ALLOC_INPUT_FLAGS_RX_SOP_PAD UINT32_C(0x1) 19823 /* 19824 * This value is a pointer to the page table for the 19825 * Ring. 19826 */ 19827 uint64_t page_tbl_addr; 19828 /* First Byte Offset of the first entry in the first page. */ 19829 uint32_t fbo; 19830 /* 19831 * Actual page size in 2^page_size. The supported range is increments 19832 * in powers of 2 from 16 bytes to 1GB. 19833 * - 4 = 16 B 19834 * Page size is 16 B. 19835 * - 12 = 4 KB 19836 * Page size is 4 KB. 19837 * - 13 = 8 KB 19838 * Page size is 8 KB. 19839 * - 16 = 64 KB 19840 * Page size is 64 KB. 19841 * - 21 = 2 MB 19842 * Page size is 2 MB. 19843 * - 22 = 4 MB 19844 * Page size is 4 MB. 19845 * - 30 = 1 GB 19846 * Page size is 1 GB. 19847 */ 19848 uint8_t page_size; 19849 /* 19850 * This value indicates the depth of page table. 19851 * For this version of the specification, value other than 0 or 19852 * 1 shall be considered as an invalid value. 19853 * When the page_tbl_depth = 0, then it is treated as a 19854 * special case with the following. 19855 * 1. FBO and page size fields are not valid. 19856 * 2. page_tbl_addr is the physical address of the first 19857 * element of the ring. 19858 */ 19859 uint8_t page_tbl_depth; 19860 uint8_t unused_1[2]; 19861 /* 19862 * Number of 16B units in the ring. Minimum size for 19863 * a ring is 16 16B entries. 19864 */ 19865 uint32_t length; 19866 /* 19867 * Logical ring number for the ring to be allocated. 19868 * This value determines the position in the doorbell 19869 * area where the update to the ring will be made. 19870 * 19871 * For completion rings, this value is also the MSI-X 19872 * vector number for the function the completion ring is 19873 * associated with. 19874 */ 19875 uint16_t logical_id; 19876 /* 19877 * This field is used only when ring_type is a TX ring. 19878 * This value indicates what completion ring the TX ring 19879 * is associated with. 19880 */ 19881 uint16_t cmpl_ring_id; 19882 /* 19883 * This field is used only when ring_type is a TX ring. 19884 * This value indicates what CoS queue the TX ring 19885 * is associated with. 19886 */ 19887 uint16_t queue_id; 19888 /* 19889 * When allocating a Rx ring or Rx aggregation ring, this field 19890 * specifies the size of the buffer descriptors posted to the ring. 19891 */ 19892 uint16_t rx_buf_size; 19893 /* 19894 * When allocating an Rx aggregation ring, this field 19895 * specifies the associated Rx ring ID. 19896 */ 19897 uint16_t rx_ring_id; 19898 /* 19899 * When allocating a completion ring, this field 19900 * specifies the associated NQ ring ID. 19901 */ 19902 uint16_t nq_ring_id; 19903 /* 19904 * This field is used only when ring_type is a TX ring. 19905 * This field is used to configure arbitration related 19906 * parameters for a TX ring. 19907 */ 19908 uint16_t ring_arb_cfg; 19909 /* Arbitration policy used for the ring. */ 19910 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK \ 19911 UINT32_C(0xf) 19912 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT 0 19913 /* 19914 * Use strict priority for the TX ring. 19915 * Priority value is specified in arb_policy_param 19916 */ 19917 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP \ 19918 UINT32_C(0x1) 19919 /* 19920 * Use weighted fair queue arbitration for the TX ring. 19921 * Weight is specified in arb_policy_param 19922 */ 19923 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ \ 19924 UINT32_C(0x2) 19925 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST \ 19926 HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ 19927 /* Reserved field. */ 19928 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK \ 19929 UINT32_C(0xf0) 19930 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT 4 19931 /* 19932 * Arbitration policy specific parameter. 19933 * # For strict priority arbitration policy, this field 19934 * represents a priority value. If set to 0, then the priority 19935 * is not specified and the HWRM is allowed to select 19936 * any priority for this TX ring. 19937 * # For weighted fair queue arbitration policy, this field 19938 * represents a weight value. If set to 0, then the weight 19939 * is not specified and the HWRM is allowed to select 19940 * any weight for this TX ring. 19941 */ 19942 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK \ 19943 UINT32_C(0xff00) 19944 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8 19945 uint16_t unused_3; 19946 /* 19947 * This field is reserved for the future use. 19948 * It shall be set to 0. 19949 */ 19950 uint32_t reserved3; 19951 /* 19952 * This field is used only when ring_type is a TX ring. 19953 * This input indicates what statistics context this ring 19954 * should be associated with. 19955 */ 19956 uint32_t stat_ctx_id; 19957 /* 19958 * This field is reserved for the future use. 19959 * It shall be set to 0. 19960 */ 19961 uint32_t reserved4; 19962 /* 19963 * This field is used only when ring_type is a TX ring 19964 * to specify maximum BW allocated to the TX ring. 19965 * The HWRM will translate this value into byte counter and 19966 * time interval used for this ring inside the device. 19967 */ 19968 uint32_t max_bw; 19969 /* The bandwidth value. */ 19970 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK \ 19971 UINT32_C(0xfffffff) 19972 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT 0 19973 /* The granularity of the value (bits or bytes). */ 19974 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE \ 19975 UINT32_C(0x10000000) 19976 /* Value is in bits. */ 19977 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS \ 19978 (UINT32_C(0x0) << 28) 19979 /* Value is in bytes. */ 19980 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES \ 19981 (UINT32_C(0x1) << 28) 19982 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST \ 19983 HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES 19984 /* bw_value_unit is 3 b */ 19985 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \ 19986 UINT32_C(0xe0000000) 19987 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT 29 19988 /* Value is in Mb or MB (base 10). */ 19989 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \ 19990 (UINT32_C(0x0) << 29) 19991 /* Value is in Kb or KB (base 10). */ 19992 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \ 19993 (UINT32_C(0x2) << 29) 19994 /* Value is in bits or bytes. */ 19995 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \ 19996 (UINT32_C(0x4) << 29) 19997 /* Value is in Gb or GB (base 10). */ 19998 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \ 19999 (UINT32_C(0x6) << 29) 20000 /* Value is in 1/100th of a percentage of total bandwidth. */ 20001 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \ 20002 (UINT32_C(0x1) << 29) 20003 /* Invalid unit */ 20004 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \ 20005 (UINT32_C(0x7) << 29) 20006 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \ 20007 HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID 20008 /* 20009 * This field is used only when ring_type is a Completion ring. 20010 * This value indicates what interrupt mode should be used 20011 * on this completion ring. 20012 * Note: In the legacy interrupt mode, no more than 16 20013 * completion rings are allowed. 20014 */ 20015 uint8_t int_mode; 20016 /* Legacy INTA */ 20017 #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0) 20018 /* Reserved */ 20019 #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD UINT32_C(0x1) 20020 /* MSI-X */ 20021 #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX UINT32_C(0x2) 20022 /* No Interrupt - Polled mode */ 20023 #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL UINT32_C(0x3) 20024 #define HWRM_RING_ALLOC_INPUT_INT_MODE_LAST \ 20025 HWRM_RING_ALLOC_INPUT_INT_MODE_POLL 20026 uint8_t unused_4[3]; 20027 /* 20028 * The cq_handle is specified when allocating a completion ring. For 20029 * devices that support NQs, this cq_handle will be included in the 20030 * NQE to specify which CQ should be read to retrieve the completion 20031 * record. 20032 */ 20033 uint64_t cq_handle; 20034 } __attribute__((packed)); 20035 20036 /* hwrm_ring_alloc_output (size:128b/16B) */ 20037 struct hwrm_ring_alloc_output { 20038 /* The specific error status for the command. */ 20039 uint16_t error_code; 20040 /* The HWRM command request type. */ 20041 uint16_t req_type; 20042 /* The sequence ID from the original command. */ 20043 uint16_t seq_id; 20044 /* The length of the response data in number of bytes. */ 20045 uint16_t resp_len; 20046 /* 20047 * Physical number of ring allocated. 20048 * This value shall be unique for a ring type. 20049 */ 20050 uint16_t ring_id; 20051 /* Logical number of ring allocated. */ 20052 uint16_t logical_ring_id; 20053 uint8_t unused_0[3]; 20054 /* 20055 * This field is used in Output records to indicate that the output 20056 * is completely written to RAM. This field should be read as '1' 20057 * to indicate that the output has been completely written. 20058 * When writing a command completion or response to an internal processor, 20059 * the order of writes has to be such that this field is written last. 20060 */ 20061 uint8_t valid; 20062 } __attribute__((packed)); 20063 20064 /****************** 20065 * hwrm_ring_free * 20066 ******************/ 20067 20068 20069 /* hwrm_ring_free_input (size:192b/24B) */ 20070 struct hwrm_ring_free_input { 20071 /* The HWRM command request type. */ 20072 uint16_t req_type; 20073 /* 20074 * The completion ring to send the completion event on. This should 20075 * be the NQ ID returned from the `nq_alloc` HWRM command. 20076 */ 20077 uint16_t cmpl_ring; 20078 /* 20079 * The sequence ID is used by the driver for tracking multiple 20080 * commands. This ID is treated as opaque data by the firmware and 20081 * the value is returned in the `hwrm_resp_hdr` upon completion. 20082 */ 20083 uint16_t seq_id; 20084 /* 20085 * The target ID of the command: 20086 * * 0x0-0xFFF8 - The function ID 20087 * * 0xFFF8-0xFFFE - Reserved for internal processors 20088 * * 0xFFFF - HWRM 20089 */ 20090 uint16_t target_id; 20091 /* 20092 * A physical address pointer pointing to a host buffer that the 20093 * command's response data will be written. This can be either a host 20094 * physical address (HPA) or a guest physical address (GPA) and must 20095 * point to a physically contiguous block of memory. 20096 */ 20097 uint64_t resp_addr; 20098 /* Ring Type. */ 20099 uint8_t ring_type; 20100 /* L2 Completion Ring (CR) */ 20101 #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0) 20102 /* TX Ring (TR) */ 20103 #define HWRM_RING_FREE_INPUT_RING_TYPE_TX UINT32_C(0x1) 20104 /* RX Ring (RR) */ 20105 #define HWRM_RING_FREE_INPUT_RING_TYPE_RX UINT32_C(0x2) 20106 /* RoCE Notification Completion Ring (ROCE_CR) */ 20107 #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3) 20108 /* RX Aggregation Ring */ 20109 #define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG UINT32_C(0x4) 20110 /* Notification Queue */ 20111 #define HWRM_RING_FREE_INPUT_RING_TYPE_NQ UINT32_C(0x5) 20112 #define HWRM_RING_FREE_INPUT_RING_TYPE_LAST \ 20113 HWRM_RING_FREE_INPUT_RING_TYPE_NQ 20114 uint8_t unused_0; 20115 /* Physical number of ring allocated. */ 20116 uint16_t ring_id; 20117 uint8_t unused_1[4]; 20118 } __attribute__((packed)); 20119 20120 /* hwrm_ring_free_output (size:128b/16B) */ 20121 struct hwrm_ring_free_output { 20122 /* The specific error status for the command. */ 20123 uint16_t error_code; 20124 /* The HWRM command request type. */ 20125 uint16_t req_type; 20126 /* The sequence ID from the original command. */ 20127 uint16_t seq_id; 20128 /* The length of the response data in number of bytes. */ 20129 uint16_t resp_len; 20130 uint8_t unused_0[7]; 20131 /* 20132 * This field is used in Output records to indicate that the output 20133 * is completely written to RAM. This field should be read as '1' 20134 * to indicate that the output has been completely written. 20135 * When writing a command completion or response to an internal processor, 20136 * the order of writes has to be such that this field is written last. 20137 */ 20138 uint8_t valid; 20139 } __attribute__((packed)); 20140 20141 /******************* 20142 * hwrm_ring_reset * 20143 *******************/ 20144 20145 20146 /* hwrm_ring_reset_input (size:192b/24B) */ 20147 struct hwrm_ring_reset_input { 20148 /* The HWRM command request type. */ 20149 uint16_t req_type; 20150 /* 20151 * The completion ring to send the completion event on. This should 20152 * be the NQ ID returned from the `nq_alloc` HWRM command. 20153 */ 20154 uint16_t cmpl_ring; 20155 /* 20156 * The sequence ID is used by the driver for tracking multiple 20157 * commands. This ID is treated as opaque data by the firmware and 20158 * the value is returned in the `hwrm_resp_hdr` upon completion. 20159 */ 20160 uint16_t seq_id; 20161 /* 20162 * The target ID of the command: 20163 * * 0x0-0xFFF8 - The function ID 20164 * * 0xFFF8-0xFFFE - Reserved for internal processors 20165 * * 0xFFFF - HWRM 20166 */ 20167 uint16_t target_id; 20168 /* 20169 * A physical address pointer pointing to a host buffer that the 20170 * command's response data will be written. This can be either a host 20171 * physical address (HPA) or a guest physical address (GPA) and must 20172 * point to a physically contiguous block of memory. 20173 */ 20174 uint64_t resp_addr; 20175 /* Ring Type. */ 20176 uint8_t ring_type; 20177 /* L2 Completion Ring (CR) */ 20178 #define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0) 20179 /* TX Ring (TR) */ 20180 #define HWRM_RING_RESET_INPUT_RING_TYPE_TX UINT32_C(0x1) 20181 /* RX Ring (RR) */ 20182 #define HWRM_RING_RESET_INPUT_RING_TYPE_RX UINT32_C(0x2) 20183 /* RoCE Notification Completion Ring (ROCE_CR) */ 20184 #define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3) 20185 #define HWRM_RING_RESET_INPUT_RING_TYPE_LAST \ 20186 HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL 20187 uint8_t unused_0; 20188 /* Physical number of the ring. */ 20189 uint16_t ring_id; 20190 uint8_t unused_1[4]; 20191 } __attribute__((packed)); 20192 20193 /* hwrm_ring_reset_output (size:128b/16B) */ 20194 struct hwrm_ring_reset_output { 20195 /* The specific error status for the command. */ 20196 uint16_t error_code; 20197 /* The HWRM command request type. */ 20198 uint16_t req_type; 20199 /* The sequence ID from the original command. */ 20200 uint16_t seq_id; 20201 /* The length of the response data in number of bytes. */ 20202 uint16_t resp_len; 20203 uint8_t unused_0[7]; 20204 /* 20205 * This field is used in Output records to indicate that the output 20206 * is completely written to RAM. This field should be read as '1' 20207 * to indicate that the output has been completely written. 20208 * When writing a command completion or response to an internal processor, 20209 * the order of writes has to be such that this field is written last. 20210 */ 20211 uint8_t valid; 20212 } __attribute__((packed)); 20213 20214 /************************** 20215 * hwrm_ring_aggint_qcaps * 20216 **************************/ 20217 20218 20219 /* hwrm_ring_aggint_qcaps_input (size:128b/16B) */ 20220 struct hwrm_ring_aggint_qcaps_input { 20221 /* The HWRM command request type. */ 20222 uint16_t req_type; 20223 /* 20224 * The completion ring to send the completion event on. This should 20225 * be the NQ ID returned from the `nq_alloc` HWRM command. 20226 */ 20227 uint16_t cmpl_ring; 20228 /* 20229 * The sequence ID is used by the driver for tracking multiple 20230 * commands. This ID is treated as opaque data by the firmware and 20231 * the value is returned in the `hwrm_resp_hdr` upon completion. 20232 */ 20233 uint16_t seq_id; 20234 /* 20235 * The target ID of the command: 20236 * * 0x0-0xFFF8 - The function ID 20237 * * 0xFFF8-0xFFFE - Reserved for internal processors 20238 * * 0xFFFF - HWRM 20239 */ 20240 uint16_t target_id; 20241 /* 20242 * A physical address pointer pointing to a host buffer that the 20243 * command's response data will be written. This can be either a host 20244 * physical address (HPA) or a guest physical address (GPA) and must 20245 * point to a physically contiguous block of memory. 20246 */ 20247 uint64_t resp_addr; 20248 } __attribute__((packed)); 20249 20250 /* hwrm_ring_aggint_qcaps_output (size:384b/48B) */ 20251 struct hwrm_ring_aggint_qcaps_output { 20252 /* The specific error status for the command. */ 20253 uint16_t error_code; 20254 /* The HWRM command request type. */ 20255 uint16_t req_type; 20256 /* The sequence ID from the original command. */ 20257 uint16_t seq_id; 20258 /* The length of the response data in number of bytes. */ 20259 uint16_t resp_len; 20260 uint32_t cmpl_params; 20261 /* 20262 * When this bit is set to '1', int_lat_tmr_min can be configured 20263 * on completion rings. 20264 */ 20265 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MIN \ 20266 UINT32_C(0x1) 20267 /* 20268 * When this bit is set to '1', int_lat_tmr_max can be configured 20269 * on completion rings. 20270 */ 20271 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MAX \ 20272 UINT32_C(0x2) 20273 /* 20274 * When this bit is set to '1', timer_reset can be enabled 20275 * on completion rings. 20276 */ 20277 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_TIMER_RESET \ 20278 UINT32_C(0x4) 20279 /* 20280 * When this bit is set to '1', ring_idle can be enabled 20281 * on completion rings. 20282 */ 20283 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_RING_IDLE \ 20284 UINT32_C(0x8) 20285 /* 20286 * When this bit is set to '1', num_cmpl_dma_aggr can be configured 20287 * on completion rings. 20288 */ 20289 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR \ 20290 UINT32_C(0x10) 20291 /* 20292 * When this bit is set to '1', num_cmpl_dma_aggr_during_int can be configured 20293 * on completion rings. 20294 */ 20295 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR_DURING_INT \ 20296 UINT32_C(0x20) 20297 /* 20298 * When this bit is set to '1', cmpl_aggr_dma_tmr can be configured 20299 * on completion rings. 20300 */ 20301 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR \ 20302 UINT32_C(0x40) 20303 /* 20304 * When this bit is set to '1', cmpl_aggr_dma_tmr_during_int can be configured 20305 * on completion rings. 20306 */ 20307 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR_DURING_INT \ 20308 UINT32_C(0x80) 20309 /* 20310 * When this bit is set to '1', num_cmpl_aggr_int can be configured 20311 * on completion rings. 20312 */ 20313 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_AGGR_INT \ 20314 UINT32_C(0x100) 20315 uint32_t nq_params; 20316 /* 20317 * When this bit is set to '1', int_lat_tmr_min can be configured 20318 * on notification queues. 20319 */ 20320 #define HWRM_RING_AGGINT_QCAPS_OUTPUT_NQ_PARAMS_INT_LAT_TMR_MIN \ 20321 UINT32_C(0x1) 20322 /* Minimum value for num_cmpl_dma_aggr */ 20323 uint16_t num_cmpl_dma_aggr_min; 20324 /* Maximum value for num_cmpl_dma_aggr */ 20325 uint16_t num_cmpl_dma_aggr_max; 20326 /* Minimum value for num_cmpl_dma_aggr_during_int */ 20327 uint16_t num_cmpl_dma_aggr_during_int_min; 20328 /* Maximum value for num_cmpl_dma_aggr_during_int */ 20329 uint16_t num_cmpl_dma_aggr_during_int_max; 20330 /* Minimum value for cmpl_aggr_dma_tmr */ 20331 uint16_t cmpl_aggr_dma_tmr_min; 20332 /* Maximum value for cmpl_aggr_dma_tmr */ 20333 uint16_t cmpl_aggr_dma_tmr_max; 20334 /* Minimum value for cmpl_aggr_dma_tmr_during_int */ 20335 uint16_t cmpl_aggr_dma_tmr_during_int_min; 20336 /* Maximum value for cmpl_aggr_dma_tmr_during_int */ 20337 uint16_t cmpl_aggr_dma_tmr_during_int_max; 20338 /* Minimum value for int_lat_tmr_min */ 20339 uint16_t int_lat_tmr_min_min; 20340 /* Maximum value for int_lat_tmr_min */ 20341 uint16_t int_lat_tmr_min_max; 20342 /* Minimum value for int_lat_tmr_max */ 20343 uint16_t int_lat_tmr_max_min; 20344 /* Maximum value for int_lat_tmr_max */ 20345 uint16_t int_lat_tmr_max_max; 20346 /* Minimum value for num_cmpl_aggr_int */ 20347 uint16_t num_cmpl_aggr_int_min; 20348 /* Maximum value for num_cmpl_aggr_int */ 20349 uint16_t num_cmpl_aggr_int_max; 20350 /* The units for timer parameters, in nanoseconds. */ 20351 uint16_t timer_units; 20352 uint8_t unused_0[1]; 20353 /* 20354 * This field is used in Output records to indicate that the output 20355 * is completely written to RAM. This field should be read as '1' 20356 * to indicate that the output has been completely written. 20357 * When writing a command completion or response to an internal processor, 20358 * the order of writes has to be such that this field is written last. 20359 */ 20360 uint8_t valid; 20361 } __attribute__((packed)); 20362 20363 /************************************** 20364 * hwrm_ring_cmpl_ring_qaggint_params * 20365 **************************************/ 20366 20367 20368 /* hwrm_ring_cmpl_ring_qaggint_params_input (size:192b/24B) */ 20369 struct hwrm_ring_cmpl_ring_qaggint_params_input { 20370 /* The HWRM command request type. */ 20371 uint16_t req_type; 20372 /* 20373 * The completion ring to send the completion event on. This should 20374 * be the NQ ID returned from the `nq_alloc` HWRM command. 20375 */ 20376 uint16_t cmpl_ring; 20377 /* 20378 * The sequence ID is used by the driver for tracking multiple 20379 * commands. This ID is treated as opaque data by the firmware and 20380 * the value is returned in the `hwrm_resp_hdr` upon completion. 20381 */ 20382 uint16_t seq_id; 20383 /* 20384 * The target ID of the command: 20385 * * 0x0-0xFFF8 - The function ID 20386 * * 0xFFF8-0xFFFE - Reserved for internal processors 20387 * * 0xFFFF - HWRM 20388 */ 20389 uint16_t target_id; 20390 /* 20391 * A physical address pointer pointing to a host buffer that the 20392 * command's response data will be written. This can be either a host 20393 * physical address (HPA) or a guest physical address (GPA) and must 20394 * point to a physically contiguous block of memory. 20395 */ 20396 uint64_t resp_addr; 20397 /* Physical number of completion ring. */ 20398 uint16_t ring_id; 20399 uint8_t unused_0[6]; 20400 } __attribute__((packed)); 20401 20402 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */ 20403 struct hwrm_ring_cmpl_ring_qaggint_params_output { 20404 /* The specific error status for the command. */ 20405 uint16_t error_code; 20406 /* The HWRM command request type. */ 20407 uint16_t req_type; 20408 /* The sequence ID from the original command. */ 20409 uint16_t seq_id; 20410 /* The length of the response data in number of bytes. */ 20411 uint16_t resp_len; 20412 uint16_t flags; 20413 /* 20414 * When this bit is set to '1', interrupt max 20415 * timer is reset whenever a completion is received. 20416 */ 20417 #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET \ 20418 UINT32_C(0x1) 20419 /* 20420 * When this bit is set to '1', ring idle mode 20421 * aggregation will be enabled. 20422 */ 20423 #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE \ 20424 UINT32_C(0x2) 20425 /* 20426 * Number of completions to aggregate before DMA 20427 * during the normal mode. 20428 */ 20429 uint16_t num_cmpl_dma_aggr; 20430 /* 20431 * Number of completions to aggregate before DMA 20432 * during the interrupt mode. 20433 */ 20434 uint16_t num_cmpl_dma_aggr_during_int; 20435 /* 20436 * Timer in unit of 80-nsec used to aggregate completions before 20437 * DMA during the normal mode (not in interrupt mode). 20438 */ 20439 uint16_t cmpl_aggr_dma_tmr; 20440 /* 20441 * Timer in unit of 80-nsec used to aggregate completions before 20442 * DMA during the interrupt mode. 20443 */ 20444 uint16_t cmpl_aggr_dma_tmr_during_int; 20445 /* Minimum time (in unit of 80-nsec) between two interrupts. */ 20446 uint16_t int_lat_tmr_min; 20447 /* 20448 * Maximum wait time (in unit of 80-nsec) spent aggregating 20449 * completions before signaling the interrupt after the 20450 * interrupt is enabled. 20451 */ 20452 uint16_t int_lat_tmr_max; 20453 /* 20454 * Minimum number of completions aggregated before signaling 20455 * an interrupt. 20456 */ 20457 uint16_t num_cmpl_aggr_int; 20458 uint8_t unused_0[7]; 20459 /* 20460 * This field is used in Output records to indicate that the output 20461 * is completely written to RAM. This field should be read as '1' 20462 * to indicate that the output has been completely written. 20463 * When writing a command completion or response to an internal processor, 20464 * the order of writes has to be such that this field is written last. 20465 */ 20466 uint8_t valid; 20467 } __attribute__((packed)); 20468 20469 /***************************************** 20470 * hwrm_ring_cmpl_ring_cfg_aggint_params * 20471 *****************************************/ 20472 20473 20474 /* hwrm_ring_cmpl_ring_cfg_aggint_params_input (size:320b/40B) */ 20475 struct hwrm_ring_cmpl_ring_cfg_aggint_params_input { 20476 /* The HWRM command request type. */ 20477 uint16_t req_type; 20478 /* 20479 * The completion ring to send the completion event on. This should 20480 * be the NQ ID returned from the `nq_alloc` HWRM command. 20481 */ 20482 uint16_t cmpl_ring; 20483 /* 20484 * The sequence ID is used by the driver for tracking multiple 20485 * commands. This ID is treated as opaque data by the firmware and 20486 * the value is returned in the `hwrm_resp_hdr` upon completion. 20487 */ 20488 uint16_t seq_id; 20489 /* 20490 * The target ID of the command: 20491 * * 0x0-0xFFF8 - The function ID 20492 * * 0xFFF8-0xFFFE - Reserved for internal processors 20493 * * 0xFFFF - HWRM 20494 */ 20495 uint16_t target_id; 20496 /* 20497 * A physical address pointer pointing to a host buffer that the 20498 * command's response data will be written. This can be either a host 20499 * physical address (HPA) or a guest physical address (GPA) and must 20500 * point to a physically contiguous block of memory. 20501 */ 20502 uint64_t resp_addr; 20503 /* Physical number of completion ring. */ 20504 uint16_t ring_id; 20505 uint16_t flags; 20506 /* 20507 * When this bit is set to '1', interrupt latency max 20508 * timer is reset whenever a completion is received. 20509 */ 20510 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET \ 20511 UINT32_C(0x1) 20512 /* 20513 * When this bit is set to '1', ring idle mode 20514 * aggregation will be enabled. 20515 */ 20516 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE \ 20517 UINT32_C(0x2) 20518 /* 20519 * Set this flag to 1 when configuring parameters on a 20520 * notification queue. Set this flag to 0 when configuring 20521 * parameters on a completion queue. 20522 */ 20523 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ \ 20524 UINT32_C(0x4) 20525 /* 20526 * Number of completions to aggregate before DMA 20527 * during the normal mode. 20528 */ 20529 uint16_t num_cmpl_dma_aggr; 20530 /* 20531 * Number of completions to aggregate before DMA 20532 * during the interrupt mode. 20533 */ 20534 uint16_t num_cmpl_dma_aggr_during_int; 20535 /* 20536 * Timer in unit of 80-nsec used to aggregate completions before 20537 * DMA during the normal mode (not in interrupt mode). 20538 */ 20539 uint16_t cmpl_aggr_dma_tmr; 20540 /* 20541 * Timer in unit of 80-nsec used to aggregate completions before 20542 * DMA during the interrupt mode. 20543 */ 20544 uint16_t cmpl_aggr_dma_tmr_during_int; 20545 /* Minimum time (in unit of 80-nsec) between two interrupts. */ 20546 uint16_t int_lat_tmr_min; 20547 /* 20548 * Maximum wait time (in unit of 80-nsec) spent aggregating 20549 * cmpls before signaling the interrupt after the 20550 * interrupt is enabled. 20551 */ 20552 uint16_t int_lat_tmr_max; 20553 /* 20554 * Minimum number of completions aggregated before signaling 20555 * an interrupt. 20556 */ 20557 uint16_t num_cmpl_aggr_int; 20558 /* 20559 * Bitfield that indicates which parameters are to be applied. Only 20560 * required when configuring devices with notification queues, and 20561 * used in that case to set certain parameters on completion queues 20562 * and others on notification queues. 20563 */ 20564 uint16_t enables; 20565 /* 20566 * This bit must be '1' for the num_cmpl_dma_aggr field to be 20567 * configured. 20568 */ 20569 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR \ 20570 UINT32_C(0x1) 20571 /* 20572 * This bit must be '1' for the num_cmpl_dma_aggr_during_int field to be 20573 * configured. 20574 */ 20575 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR_DURING_INT \ 20576 UINT32_C(0x2) 20577 /* 20578 * This bit must be '1' for the cmpl_aggr_dma_tmr field to be 20579 * configured. 20580 */ 20581 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR \ 20582 UINT32_C(0x4) 20583 /* 20584 * This bit must be '1' for the int_lat_tmr_min field to be 20585 * configured. 20586 */ 20587 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MIN \ 20588 UINT32_C(0x8) 20589 /* 20590 * This bit must be '1' for the int_lat_tmr_max field to be 20591 * configured. 20592 */ 20593 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MAX \ 20594 UINT32_C(0x10) 20595 /* 20596 * This bit must be '1' for the num_cmpl_aggr_int field to be 20597 * configured. 20598 */ 20599 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT \ 20600 UINT32_C(0x20) 20601 uint8_t unused_0[4]; 20602 } __attribute__((packed)); 20603 20604 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */ 20605 struct hwrm_ring_cmpl_ring_cfg_aggint_params_output { 20606 /* The specific error status for the command. */ 20607 uint16_t error_code; 20608 /* The HWRM command request type. */ 20609 uint16_t req_type; 20610 /* The sequence ID from the original command. */ 20611 uint16_t seq_id; 20612 /* The length of the response data in number of bytes. */ 20613 uint16_t resp_len; 20614 uint8_t unused_0[7]; 20615 /* 20616 * This field is used in Output records to indicate that the output 20617 * is completely written to RAM. This field should be read as '1' 20618 * to indicate that the output has been completely written. 20619 * When writing a command completion or response to an internal processor, 20620 * the order of writes has to be such that this field is written last. 20621 */ 20622 uint8_t valid; 20623 } __attribute__((packed)); 20624 20625 /*********************** 20626 * hwrm_ring_grp_alloc * 20627 ***********************/ 20628 20629 20630 /* hwrm_ring_grp_alloc_input (size:192b/24B) */ 20631 struct hwrm_ring_grp_alloc_input { 20632 /* The HWRM command request type. */ 20633 uint16_t req_type; 20634 /* 20635 * The completion ring to send the completion event on. This should 20636 * be the NQ ID returned from the `nq_alloc` HWRM command. 20637 */ 20638 uint16_t cmpl_ring; 20639 /* 20640 * The sequence ID is used by the driver for tracking multiple 20641 * commands. This ID is treated as opaque data by the firmware and 20642 * the value is returned in the `hwrm_resp_hdr` upon completion. 20643 */ 20644 uint16_t seq_id; 20645 /* 20646 * The target ID of the command: 20647 * * 0x0-0xFFF8 - The function ID 20648 * * 0xFFF8-0xFFFE - Reserved for internal processors 20649 * * 0xFFFF - HWRM 20650 */ 20651 uint16_t target_id; 20652 /* 20653 * A physical address pointer pointing to a host buffer that the 20654 * command's response data will be written. This can be either a host 20655 * physical address (HPA) or a guest physical address (GPA) and must 20656 * point to a physically contiguous block of memory. 20657 */ 20658 uint64_t resp_addr; 20659 /* 20660 * This value identifies the CR associated with the ring 20661 * group. 20662 */ 20663 uint16_t cr; 20664 /* 20665 * This value identifies the main RR associated with the ring 20666 * group. 20667 */ 20668 uint16_t rr; 20669 /* 20670 * This value identifies the aggregation RR associated with 20671 * the ring group. If this value is 0xFF... (All Fs), then no 20672 * Aggregation ring will be set. 20673 */ 20674 uint16_t ar; 20675 /* 20676 * This value identifies the statistics context associated 20677 * with the ring group. 20678 */ 20679 uint16_t sc; 20680 } __attribute__((packed)); 20681 20682 /* hwrm_ring_grp_alloc_output (size:128b/16B) */ 20683 struct hwrm_ring_grp_alloc_output { 20684 /* The specific error status for the command. */ 20685 uint16_t error_code; 20686 /* The HWRM command request type. */ 20687 uint16_t req_type; 20688 /* The sequence ID from the original command. */ 20689 uint16_t seq_id; 20690 /* The length of the response data in number of bytes. */ 20691 uint16_t resp_len; 20692 /* 20693 * This is the ring group ID value. Use this value to program 20694 * the default ring group for the VNIC or as table entries 20695 * in an RSS/COS context. 20696 */ 20697 uint32_t ring_group_id; 20698 uint8_t unused_0[3]; 20699 /* 20700 * This field is used in Output records to indicate that the output 20701 * is completely written to RAM. This field should be read as '1' 20702 * to indicate that the output has been completely written. 20703 * When writing a command completion or response to an internal processor, 20704 * the order of writes has to be such that this field is written last. 20705 */ 20706 uint8_t valid; 20707 } __attribute__((packed)); 20708 20709 /********************** 20710 * hwrm_ring_grp_free * 20711 **********************/ 20712 20713 20714 /* hwrm_ring_grp_free_input (size:192b/24B) */ 20715 struct hwrm_ring_grp_free_input { 20716 /* The HWRM command request type. */ 20717 uint16_t req_type; 20718 /* 20719 * The completion ring to send the completion event on. This should 20720 * be the NQ ID returned from the `nq_alloc` HWRM command. 20721 */ 20722 uint16_t cmpl_ring; 20723 /* 20724 * The sequence ID is used by the driver for tracking multiple 20725 * commands. This ID is treated as opaque data by the firmware and 20726 * the value is returned in the `hwrm_resp_hdr` upon completion. 20727 */ 20728 uint16_t seq_id; 20729 /* 20730 * The target ID of the command: 20731 * * 0x0-0xFFF8 - The function ID 20732 * * 0xFFF8-0xFFFE - Reserved for internal processors 20733 * * 0xFFFF - HWRM 20734 */ 20735 uint16_t target_id; 20736 /* 20737 * A physical address pointer pointing to a host buffer that the 20738 * command's response data will be written. This can be either a host 20739 * physical address (HPA) or a guest physical address (GPA) and must 20740 * point to a physically contiguous block of memory. 20741 */ 20742 uint64_t resp_addr; 20743 /* This is the ring group ID value. */ 20744 uint32_t ring_group_id; 20745 uint8_t unused_0[4]; 20746 } __attribute__((packed)); 20747 20748 /* hwrm_ring_grp_free_output (size:128b/16B) */ 20749 struct hwrm_ring_grp_free_output { 20750 /* The specific error status for the command. */ 20751 uint16_t error_code; 20752 /* The HWRM command request type. */ 20753 uint16_t req_type; 20754 /* The sequence ID from the original command. */ 20755 uint16_t seq_id; 20756 /* The length of the response data in number of bytes. */ 20757 uint16_t resp_len; 20758 uint8_t unused_0[7]; 20759 /* 20760 * This field is used in Output records to indicate that the output 20761 * is completely written to RAM. This field should be read as '1' 20762 * to indicate that the output has been completely written. 20763 * When writing a command completion or response to an internal processor, 20764 * the order of writes has to be such that this field is written last. 20765 */ 20766 uint8_t valid; 20767 } __attribute__((packed)); 20768 20769 /**************************** 20770 * hwrm_cfa_l2_filter_alloc * 20771 ****************************/ 20772 20773 20774 /* hwrm_cfa_l2_filter_alloc_input (size:768b/96B) */ 20775 struct hwrm_cfa_l2_filter_alloc_input { 20776 /* The HWRM command request type. */ 20777 uint16_t req_type; 20778 /* 20779 * The completion ring to send the completion event on. This should 20780 * be the NQ ID returned from the `nq_alloc` HWRM command. 20781 */ 20782 uint16_t cmpl_ring; 20783 /* 20784 * The sequence ID is used by the driver for tracking multiple 20785 * commands. This ID is treated as opaque data by the firmware and 20786 * the value is returned in the `hwrm_resp_hdr` upon completion. 20787 */ 20788 uint16_t seq_id; 20789 /* 20790 * The target ID of the command: 20791 * * 0x0-0xFFF8 - The function ID 20792 * * 0xFFF8-0xFFFE - Reserved for internal processors 20793 * * 0xFFFF - HWRM 20794 */ 20795 uint16_t target_id; 20796 /* 20797 * A physical address pointer pointing to a host buffer that the 20798 * command's response data will be written. This can be either a host 20799 * physical address (HPA) or a guest physical address (GPA) and must 20800 * point to a physically contiguous block of memory. 20801 */ 20802 uint64_t resp_addr; 20803 uint32_t flags; 20804 /* 20805 * Enumeration denoting the RX, TX type of the resource. 20806 * This enumeration is used for resources that are similar for both 20807 * TX and RX paths of the chip. 20808 */ 20809 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH \ 20810 UINT32_C(0x1) 20811 /* tx path */ 20812 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \ 20813 UINT32_C(0x0) 20814 /* rx path */ 20815 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \ 20816 UINT32_C(0x1) 20817 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \ 20818 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX 20819 /* Setting of this flag indicates the applicability to the loopback path. */ 20820 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \ 20821 UINT32_C(0x2) 20822 /* 20823 * Setting of this flag indicates drop action. If this flag is not set, 20824 * then it should be considered accept action. 20825 */ 20826 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP \ 20827 UINT32_C(0x4) 20828 /* 20829 * If this flag is set, all t_l2_* fields are invalid 20830 * and they should not be specified. 20831 * If this flag is set, then l2_* fields refer to 20832 * fields of outermost L2 header. 20833 */ 20834 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST \ 20835 UINT32_C(0x8) 20836 /* 20837 * Enumeration denoting NO_ROCE_L2 to support old drivers. 20838 * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic 20839 */ 20840 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_MASK \ 20841 UINT32_C(0x30) 20842 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_SFT 4 20843 /* To support old drivers */ 20844 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \ 20845 (UINT32_C(0x0) << 4) 20846 /* Only L2 traffic */ 20847 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_L2 \ 20848 (UINT32_C(0x1) << 4) 20849 /* Roce & L2 traffic */ 20850 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE \ 20851 (UINT32_C(0x2) << 4) 20852 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_LAST \ 20853 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE 20854 uint32_t enables; 20855 /* 20856 * This bit must be '1' for the l2_addr field to be 20857 * configured. 20858 */ 20859 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \ 20860 UINT32_C(0x1) 20861 /* 20862 * This bit must be '1' for the l2_addr_mask field to be 20863 * configured. 20864 */ 20865 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \ 20866 UINT32_C(0x2) 20867 /* 20868 * This bit must be '1' for the l2_ovlan field to be 20869 * configured. 20870 */ 20871 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN \ 20872 UINT32_C(0x4) 20873 /* 20874 * This bit must be '1' for the l2_ovlan_mask field to be 20875 * configured. 20876 */ 20877 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \ 20878 UINT32_C(0x8) 20879 /* 20880 * This bit must be '1' for the l2_ivlan field to be 20881 * configured. 20882 */ 20883 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \ 20884 UINT32_C(0x10) 20885 /* 20886 * This bit must be '1' for the l2_ivlan_mask field to be 20887 * configured. 20888 */ 20889 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \ 20890 UINT32_C(0x20) 20891 /* 20892 * This bit must be '1' for the t_l2_addr field to be 20893 * configured. 20894 */ 20895 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR \ 20896 UINT32_C(0x40) 20897 /* 20898 * This bit must be '1' for the t_l2_addr_mask field to be 20899 * configured. 20900 */ 20901 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \ 20902 UINT32_C(0x80) 20903 /* 20904 * This bit must be '1' for the t_l2_ovlan field to be 20905 * configured. 20906 */ 20907 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \ 20908 UINT32_C(0x100) 20909 /* 20910 * This bit must be '1' for the t_l2_ovlan_mask field to be 20911 * configured. 20912 */ 20913 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \ 20914 UINT32_C(0x200) 20915 /* 20916 * This bit must be '1' for the t_l2_ivlan field to be 20917 * configured. 20918 */ 20919 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \ 20920 UINT32_C(0x400) 20921 /* 20922 * This bit must be '1' for the t_l2_ivlan_mask field to be 20923 * configured. 20924 */ 20925 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \ 20926 UINT32_C(0x800) 20927 /* 20928 * This bit must be '1' for the src_type field to be 20929 * configured. 20930 */ 20931 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE \ 20932 UINT32_C(0x1000) 20933 /* 20934 * This bit must be '1' for the src_id field to be 20935 * configured. 20936 */ 20937 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID \ 20938 UINT32_C(0x2000) 20939 /* 20940 * This bit must be '1' for the tunnel_type field to be 20941 * configured. 20942 */ 20943 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \ 20944 UINT32_C(0x4000) 20945 /* 20946 * This bit must be '1' for the dst_id field to be 20947 * configured. 20948 */ 20949 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID \ 20950 UINT32_C(0x8000) 20951 /* 20952 * This bit must be '1' for the mirror_vnic_id field to be 20953 * configured. 20954 */ 20955 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \ 20956 UINT32_C(0x10000) 20957 /* 20958 * This value sets the match value for the L2 MAC address. 20959 * Destination MAC address for RX path. 20960 * Source MAC address for TX path. 20961 */ 20962 uint8_t l2_addr[6]; 20963 uint8_t unused_0[2]; 20964 /* 20965 * This value sets the mask value for the L2 address. 20966 * A value of 0 will mask the corresponding bit from 20967 * compare. 20968 */ 20969 uint8_t l2_addr_mask[6]; 20970 /* This value sets VLAN ID value for outer VLAN. */ 20971 uint16_t l2_ovlan; 20972 /* 20973 * This value sets the mask value for the ovlan id. 20974 * A value of 0 will mask the corresponding bit from 20975 * compare. 20976 */ 20977 uint16_t l2_ovlan_mask; 20978 /* This value sets VLAN ID value for inner VLAN. */ 20979 uint16_t l2_ivlan; 20980 /* 20981 * This value sets the mask value for the ivlan id. 20982 * A value of 0 will mask the corresponding bit from 20983 * compare. 20984 */ 20985 uint16_t l2_ivlan_mask; 20986 uint8_t unused_1[2]; 20987 /* 20988 * This value sets the match value for the tunnel 20989 * L2 MAC address. 20990 * Destination MAC address for RX path. 20991 * Source MAC address for TX path. 20992 */ 20993 uint8_t t_l2_addr[6]; 20994 uint8_t unused_2[2]; 20995 /* 20996 * This value sets the mask value for the tunnel L2 20997 * address. 20998 * A value of 0 will mask the corresponding bit from 20999 * compare. 21000 */ 21001 uint8_t t_l2_addr_mask[6]; 21002 /* This value sets VLAN ID value for tunnel outer VLAN. */ 21003 uint16_t t_l2_ovlan; 21004 /* 21005 * This value sets the mask value for the tunnel ovlan id. 21006 * A value of 0 will mask the corresponding bit from 21007 * compare. 21008 */ 21009 uint16_t t_l2_ovlan_mask; 21010 /* This value sets VLAN ID value for tunnel inner VLAN. */ 21011 uint16_t t_l2_ivlan; 21012 /* 21013 * This value sets the mask value for the tunnel ivlan id. 21014 * A value of 0 will mask the corresponding bit from 21015 * compare. 21016 */ 21017 uint16_t t_l2_ivlan_mask; 21018 /* This value identifies the type of source of the packet. */ 21019 uint8_t src_type; 21020 /* Network port */ 21021 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0) 21022 /* Physical function */ 21023 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF UINT32_C(0x1) 21024 /* Virtual function */ 21025 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF UINT32_C(0x2) 21026 /* Virtual NIC of a function */ 21027 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC UINT32_C(0x3) 21028 /* Embedded processor for CFA management */ 21029 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG UINT32_C(0x4) 21030 /* Embedded processor for OOB management */ 21031 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE UINT32_C(0x5) 21032 /* Embedded processor for RoCE */ 21033 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO UINT32_C(0x6) 21034 /* Embedded processor for network proxy functions */ 21035 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG UINT32_C(0x7) 21036 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_LAST \ 21037 HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG 21038 uint8_t unused_3; 21039 /* 21040 * This value is the id of the source. 21041 * For a network port, it represents port_id. 21042 * For a physical function, it represents fid. 21043 * For a virtual function, it represents vf_id. 21044 * For a vnic, it represents vnic_id. 21045 * For embedded processors, this id is not valid. 21046 * 21047 * Notes: 21048 * 1. The function ID is implied if it src_id is 21049 * not provided for a src_type that is either 21050 */ 21051 uint32_t src_id; 21052 /* Tunnel Type. */ 21053 uint8_t tunnel_type; 21054 /* Non-tunnel */ 21055 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \ 21056 UINT32_C(0x0) 21057 /* Virtual eXtensible Local Area Network (VXLAN) */ 21058 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \ 21059 UINT32_C(0x1) 21060 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */ 21061 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \ 21062 UINT32_C(0x2) 21063 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */ 21064 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \ 21065 UINT32_C(0x3) 21066 /* IP in IP */ 21067 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \ 21068 UINT32_C(0x4) 21069 /* Generic Network Virtualization Encapsulation (Geneve) */ 21070 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \ 21071 UINT32_C(0x5) 21072 /* Multi-Protocol Lable Switching (MPLS) */ 21073 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \ 21074 UINT32_C(0x6) 21075 /* Stateless Transport Tunnel (STT) */ 21076 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \ 21077 UINT32_C(0x7) 21078 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */ 21079 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \ 21080 UINT32_C(0x8) 21081 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 21082 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \ 21083 UINT32_C(0x9) 21084 /* Any tunneled traffic */ 21085 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \ 21086 UINT32_C(0xff) 21087 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \ 21088 HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL 21089 uint8_t unused_4; 21090 /* 21091 * If set, this value shall represent the 21092 * Logical VNIC ID of the destination VNIC for the RX 21093 * path and network port id of the destination port for 21094 * the TX path. 21095 */ 21096 uint16_t dst_id; 21097 /* 21098 * Logical VNIC ID of the VNIC where traffic is 21099 * mirrored. 21100 */ 21101 uint16_t mirror_vnic_id; 21102 /* 21103 * This hint is provided to help in placing 21104 * the filter in the filter table. 21105 */ 21106 uint8_t pri_hint; 21107 /* No preference */ 21108 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \ 21109 UINT32_C(0x0) 21110 /* Above the given filter */ 21111 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \ 21112 UINT32_C(0x1) 21113 /* Below the given filter */ 21114 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \ 21115 UINT32_C(0x2) 21116 /* As high as possible */ 21117 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX \ 21118 UINT32_C(0x3) 21119 /* As low as possible */ 21120 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN \ 21121 UINT32_C(0x4) 21122 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_LAST \ 21123 HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN 21124 uint8_t unused_5; 21125 uint32_t unused_6; 21126 /* 21127 * This is the ID of the filter that goes along with 21128 * the pri_hint. 21129 * 21130 * This field is valid only for the following values. 21131 * 1 - Above the given filter 21132 * 2 - Below the given filter 21133 */ 21134 uint64_t l2_filter_id_hint; 21135 } __attribute__((packed)); 21136 21137 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */ 21138 struct hwrm_cfa_l2_filter_alloc_output { 21139 /* The specific error status for the command. */ 21140 uint16_t error_code; 21141 /* The HWRM command request type. */ 21142 uint16_t req_type; 21143 /* The sequence ID from the original command. */ 21144 uint16_t seq_id; 21145 /* The length of the response data in number of bytes. */ 21146 uint16_t resp_len; 21147 /* 21148 * This value identifies a set of CFA data structures used for an L2 21149 * context. 21150 */ 21151 uint64_t l2_filter_id; 21152 /* 21153 * This is the ID of the flow associated with this 21154 * filter. 21155 * This value shall be used to match and associate the 21156 * flow identifier returned in completion records. 21157 * A value of 0xFFFFFFFF shall indicate no flow id. 21158 */ 21159 uint32_t flow_id; 21160 uint8_t unused_0[3]; 21161 /* 21162 * This field is used in Output records to indicate that the output 21163 * is completely written to RAM. This field should be read as '1' 21164 * to indicate that the output has been completely written. 21165 * When writing a command completion or response to an internal processor, 21166 * the order of writes has to be such that this field is written last. 21167 */ 21168 uint8_t valid; 21169 } __attribute__((packed)); 21170 21171 /*************************** 21172 * hwrm_cfa_l2_filter_free * 21173 ***************************/ 21174 21175 21176 /* hwrm_cfa_l2_filter_free_input (size:192b/24B) */ 21177 struct hwrm_cfa_l2_filter_free_input { 21178 /* The HWRM command request type. */ 21179 uint16_t req_type; 21180 /* 21181 * The completion ring to send the completion event on. This should 21182 * be the NQ ID returned from the `nq_alloc` HWRM command. 21183 */ 21184 uint16_t cmpl_ring; 21185 /* 21186 * The sequence ID is used by the driver for tracking multiple 21187 * commands. This ID is treated as opaque data by the firmware and 21188 * the value is returned in the `hwrm_resp_hdr` upon completion. 21189 */ 21190 uint16_t seq_id; 21191 /* 21192 * The target ID of the command: 21193 * * 0x0-0xFFF8 - The function ID 21194 * * 0xFFF8-0xFFFE - Reserved for internal processors 21195 * * 0xFFFF - HWRM 21196 */ 21197 uint16_t target_id; 21198 /* 21199 * A physical address pointer pointing to a host buffer that the 21200 * command's response data will be written. This can be either a host 21201 * physical address (HPA) or a guest physical address (GPA) and must 21202 * point to a physically contiguous block of memory. 21203 */ 21204 uint64_t resp_addr; 21205 /* 21206 * This value identifies a set of CFA data structures used for an L2 21207 * context. 21208 */ 21209 uint64_t l2_filter_id; 21210 } __attribute__((packed)); 21211 21212 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */ 21213 struct hwrm_cfa_l2_filter_free_output { 21214 /* The specific error status for the command. */ 21215 uint16_t error_code; 21216 /* The HWRM command request type. */ 21217 uint16_t req_type; 21218 /* The sequence ID from the original command. */ 21219 uint16_t seq_id; 21220 /* The length of the response data in number of bytes. */ 21221 uint16_t resp_len; 21222 uint8_t unused_0[7]; 21223 /* 21224 * This field is used in Output records to indicate that the output 21225 * is completely written to RAM. This field should be read as '1' 21226 * to indicate that the output has been completely written. 21227 * When writing a command completion or response to an internal processor, 21228 * the order of writes has to be such that this field is written last. 21229 */ 21230 uint8_t valid; 21231 } __attribute__((packed)); 21232 21233 /************************** 21234 * hwrm_cfa_l2_filter_cfg * 21235 **************************/ 21236 21237 21238 /* hwrm_cfa_l2_filter_cfg_input (size:320b/40B) */ 21239 struct hwrm_cfa_l2_filter_cfg_input { 21240 /* The HWRM command request type. */ 21241 uint16_t req_type; 21242 /* 21243 * The completion ring to send the completion event on. This should 21244 * be the NQ ID returned from the `nq_alloc` HWRM command. 21245 */ 21246 uint16_t cmpl_ring; 21247 /* 21248 * The sequence ID is used by the driver for tracking multiple 21249 * commands. This ID is treated as opaque data by the firmware and 21250 * the value is returned in the `hwrm_resp_hdr` upon completion. 21251 */ 21252 uint16_t seq_id; 21253 /* 21254 * The target ID of the command: 21255 * * 0x0-0xFFF8 - The function ID 21256 * * 0xFFF8-0xFFFE - Reserved for internal processors 21257 * * 0xFFFF - HWRM 21258 */ 21259 uint16_t target_id; 21260 /* 21261 * A physical address pointer pointing to a host buffer that the 21262 * command's response data will be written. This can be either a host 21263 * physical address (HPA) or a guest physical address (GPA) and must 21264 * point to a physically contiguous block of memory. 21265 */ 21266 uint64_t resp_addr; 21267 uint32_t flags; 21268 /* 21269 * Enumeration denoting the RX, TX type of the resource. 21270 * This enumeration is used for resources that are similar for both 21271 * TX and RX paths of the chip. 21272 */ 21273 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH \ 21274 UINT32_C(0x1) 21275 /* tx path */ 21276 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX \ 21277 UINT32_C(0x0) 21278 /* rx path */ 21279 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX \ 21280 UINT32_C(0x1) 21281 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST \ 21282 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX 21283 /* 21284 * Setting of this flag indicates drop action. If this flag is not set, 21285 * then it should be considered accept action. 21286 */ 21287 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP \ 21288 UINT32_C(0x2) 21289 /* 21290 * Enumeration denoting NO_ROCE_L2 to support old drivers. 21291 * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic 21292 */ 21293 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_MASK \ 21294 UINT32_C(0xc) 21295 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_SFT 2 21296 /* To support old drivers */ 21297 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \ 21298 (UINT32_C(0x0) << 2) 21299 /* Only L2 traffic */ 21300 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_L2 \ 21301 (UINT32_C(0x1) << 2) 21302 /* Roce & L2 traffic */ 21303 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE \ 21304 (UINT32_C(0x2) << 2) 21305 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_LAST \ 21306 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE 21307 uint32_t enables; 21308 /* 21309 * This bit must be '1' for the dst_id field to be 21310 * configured. 21311 */ 21312 #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID \ 21313 UINT32_C(0x1) 21314 /* 21315 * This bit must be '1' for the new_mirror_vnic_id field to be 21316 * configured. 21317 */ 21318 #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \ 21319 UINT32_C(0x2) 21320 /* 21321 * This value identifies a set of CFA data structures used for an L2 21322 * context. 21323 */ 21324 uint64_t l2_filter_id; 21325 /* 21326 * If set, this value shall represent the 21327 * Logical VNIC ID of the destination VNIC for the RX 21328 * path and network port id of the destination port for 21329 * the TX path. 21330 */ 21331 uint32_t dst_id; 21332 /* 21333 * New Logical VNIC ID of the VNIC where traffic is 21334 * mirrored. 21335 */ 21336 uint32_t new_mirror_vnic_id; 21337 } __attribute__((packed)); 21338 21339 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */ 21340 struct hwrm_cfa_l2_filter_cfg_output { 21341 /* The specific error status for the command. */ 21342 uint16_t error_code; 21343 /* The HWRM command request type. */ 21344 uint16_t req_type; 21345 /* The sequence ID from the original command. */ 21346 uint16_t seq_id; 21347 /* The length of the response data in number of bytes. */ 21348 uint16_t resp_len; 21349 uint8_t unused_0[7]; 21350 /* 21351 * This field is used in Output records to indicate that the output 21352 * is completely written to RAM. This field should be read as '1' 21353 * to indicate that the output has been completely written. 21354 * When writing a command completion or response to an internal processor, 21355 * the order of writes has to be such that this field is written last. 21356 */ 21357 uint8_t valid; 21358 } __attribute__((packed)); 21359 21360 /*************************** 21361 * hwrm_cfa_l2_set_rx_mask * 21362 ***************************/ 21363 21364 21365 /* hwrm_cfa_l2_set_rx_mask_input (size:448b/56B) */ 21366 struct hwrm_cfa_l2_set_rx_mask_input { 21367 /* The HWRM command request type. */ 21368 uint16_t req_type; 21369 /* 21370 * The completion ring to send the completion event on. This should 21371 * be the NQ ID returned from the `nq_alloc` HWRM command. 21372 */ 21373 uint16_t cmpl_ring; 21374 /* 21375 * The sequence ID is used by the driver for tracking multiple 21376 * commands. This ID is treated as opaque data by the firmware and 21377 * the value is returned in the `hwrm_resp_hdr` upon completion. 21378 */ 21379 uint16_t seq_id; 21380 /* 21381 * The target ID of the command: 21382 * * 0x0-0xFFF8 - The function ID 21383 * * 0xFFF8-0xFFFE - Reserved for internal processors 21384 * * 0xFFFF - HWRM 21385 */ 21386 uint16_t target_id; 21387 /* 21388 * A physical address pointer pointing to a host buffer that the 21389 * command's response data will be written. This can be either a host 21390 * physical address (HPA) or a guest physical address (GPA) and must 21391 * point to a physically contiguous block of memory. 21392 */ 21393 uint64_t resp_addr; 21394 /* VNIC ID */ 21395 uint32_t vnic_id; 21396 uint32_t mask; 21397 /* 21398 * When this bit is '1', the function is requested to accept 21399 * multi-cast packets specified by the multicast addr table. 21400 */ 21401 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST \ 21402 UINT32_C(0x2) 21403 /* 21404 * When this bit is '1', the function is requested to accept 21405 * all multi-cast packets. 21406 */ 21407 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST \ 21408 UINT32_C(0x4) 21409 /* 21410 * When this bit is '1', the function is requested to accept 21411 * broadcast packets. 21412 */ 21413 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST \ 21414 UINT32_C(0x8) 21415 /* 21416 * When this bit is '1', the function is requested to be 21417 * put in the promiscuous mode. 21418 * 21419 * The HWRM should accept any function to set up 21420 * promiscuous mode. 21421 * 21422 * The HWRM shall follow the semantics below for the 21423 * promiscuous mode support. 21424 * # When partitioning is not enabled on a port 21425 * (i.e. single PF on the port), then the PF shall 21426 * be allowed to be in the promiscuous mode. When the 21427 * PF is in the promiscuous mode, then it shall 21428 * receive all host bound traffic on that port. 21429 * # When partitioning is enabled on a port 21430 * (i.e. multiple PFs per port) and a PF on that 21431 * port is in the promiscuous mode, then the PF 21432 * receives all traffic within that partition as 21433 * identified by a unique identifier for the 21434 * PF (e.g. S-Tag). If a unique outer VLAN 21435 * for the PF is specified, then the setting of 21436 * promiscuous mode on that PF shall result in the 21437 * PF receiving all host bound traffic with matching 21438 * outer VLAN. 21439 * # A VF shall can be set in the promiscuous mode. 21440 * In the promiscuous mode, the VF does not receive any 21441 * traffic unless a unique outer VLAN for the 21442 * VF is specified. If a unique outer VLAN 21443 * for the VF is specified, then the setting of 21444 * promiscuous mode on that VF shall result in the 21445 * VF receiving all host bound traffic with the 21446 * matching outer VLAN. 21447 * # The HWRM shall allow the setting of promiscuous 21448 * mode on a function independently from the 21449 * promiscuous mode settings on other functions. 21450 */ 21451 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS \ 21452 UINT32_C(0x10) 21453 /* 21454 * If this flag is set, the corresponding RX 21455 * filters shall be set up to cover multicast/broadcast 21456 * filters for the outermost Layer 2 destination MAC 21457 * address field. 21458 */ 21459 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST \ 21460 UINT32_C(0x20) 21461 /* 21462 * If this flag is set, the corresponding RX 21463 * filters shall be set up to cover multicast/broadcast 21464 * filters for the VLAN-tagged packets that match the 21465 * TPID and VID fields of VLAN tags in the VLAN tag 21466 * table specified in this command. 21467 */ 21468 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY \ 21469 UINT32_C(0x40) 21470 /* 21471 * If this flag is set, the corresponding RX 21472 * filters shall be set up to cover multicast/broadcast 21473 * filters for non-VLAN tagged packets and VLAN-tagged 21474 * packets that match the TPID and VID fields of VLAN 21475 * tags in the VLAN tag table specified in this command. 21476 */ 21477 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN \ 21478 UINT32_C(0x80) 21479 /* 21480 * If this flag is set, the corresponding RX 21481 * filters shall be set up to cover multicast/broadcast 21482 * filters for non-VLAN tagged packets and VLAN-tagged 21483 * packets matching any VLAN tag. 21484 * 21485 * If this flag is set, then the HWRM shall ignore 21486 * VLAN tags specified in vlan_tag_tbl. 21487 * 21488 * If none of vlanonly, vlan_nonvlan, and anyvlan_nonvlan 21489 * flags is set, then the HWRM shall ignore 21490 * VLAN tags specified in vlan_tag_tbl. 21491 * 21492 * The HWRM client shall set at most one flag out of 21493 * vlanonly, vlan_nonvlan, and anyvlan_nonvlan. 21494 */ 21495 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN \ 21496 UINT32_C(0x100) 21497 /* This is the address for mcast address tbl. */ 21498 uint64_t mc_tbl_addr; 21499 /* 21500 * This value indicates how many entries in mc_tbl are valid. 21501 * Each entry is 6 bytes. 21502 */ 21503 uint32_t num_mc_entries; 21504 uint8_t unused_0[4]; 21505 /* 21506 * This is the address for VLAN tag table. 21507 * Each VLAN entry in the table is 4 bytes of a VLAN tag 21508 * including TPID, PCP, DEI, and VID fields in network byte 21509 * order. 21510 */ 21511 uint64_t vlan_tag_tbl_addr; 21512 /* 21513 * This value indicates how many entries in vlan_tag_tbl are 21514 * valid. Each entry is 4 bytes. 21515 */ 21516 uint32_t num_vlan_tags; 21517 uint8_t unused_1[4]; 21518 } __attribute__((packed)); 21519 21520 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */ 21521 struct hwrm_cfa_l2_set_rx_mask_output { 21522 /* The specific error status for the command. */ 21523 uint16_t error_code; 21524 /* The HWRM command request type. */ 21525 uint16_t req_type; 21526 /* The sequence ID from the original command. */ 21527 uint16_t seq_id; 21528 /* The length of the response data in number of bytes. */ 21529 uint16_t resp_len; 21530 uint8_t unused_0[7]; 21531 /* 21532 * This field is used in Output records to indicate that the output 21533 * is completely written to RAM. This field should be read as '1' 21534 * to indicate that the output has been completely written. 21535 * When writing a command completion or response to an internal processor, 21536 * the order of writes has to be such that this field is written last. 21537 */ 21538 uint8_t valid; 21539 } __attribute__((packed)); 21540 21541 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */ 21542 struct hwrm_cfa_l2_set_rx_mask_cmd_err { 21543 /* 21544 * command specific error codes that goes to 21545 * the cmd_err field in Common HWRM Error Response. 21546 */ 21547 uint8_t code; 21548 /* Unknown error */ 21549 #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN \ 21550 UINT32_C(0x0) 21551 /* Unable to complete operation due to conflict with Ntuple Filter */ 21552 #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR \ 21553 UINT32_C(0x1) 21554 #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST \ 21555 HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR 21556 uint8_t unused_0[7]; 21557 } __attribute__((packed)); 21558 21559 /******************************* 21560 * hwrm_cfa_vlan_antispoof_cfg * 21561 *******************************/ 21562 21563 21564 /* hwrm_cfa_vlan_antispoof_cfg_input (size:256b/32B) */ 21565 struct hwrm_cfa_vlan_antispoof_cfg_input { 21566 /* The HWRM command request type. */ 21567 uint16_t req_type; 21568 /* 21569 * The completion ring to send the completion event on. This should 21570 * be the NQ ID returned from the `nq_alloc` HWRM command. 21571 */ 21572 uint16_t cmpl_ring; 21573 /* 21574 * The sequence ID is used by the driver for tracking multiple 21575 * commands. This ID is treated as opaque data by the firmware and 21576 * the value is returned in the `hwrm_resp_hdr` upon completion. 21577 */ 21578 uint16_t seq_id; 21579 /* 21580 * The target ID of the command: 21581 * * 0x0-0xFFF8 - The function ID 21582 * * 0xFFF8-0xFFFE - Reserved for internal processors 21583 * * 0xFFFF - HWRM 21584 */ 21585 uint16_t target_id; 21586 /* 21587 * A physical address pointer pointing to a host buffer that the 21588 * command's response data will be written. This can be either a host 21589 * physical address (HPA) or a guest physical address (GPA) and must 21590 * point to a physically contiguous block of memory. 21591 */ 21592 uint64_t resp_addr; 21593 /* 21594 * Function ID of the function that is being configured. 21595 * Only valid for a VF FID configured by the PF. 21596 */ 21597 uint16_t fid; 21598 uint8_t unused_0[2]; 21599 /* Number of VLAN entries in the vlan_tag_mask_tbl. */ 21600 uint32_t num_vlan_entries; 21601 /* 21602 * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN 21603 * antispoof table. Each table entry contains the 16-bit TPID 21604 * (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit mask, 21605 * all in network order to match hwrm_cfa_l2_set_rx_mask. 21606 * For an individual VLAN entry, the mask value should be 0xfff 21607 * for the 12-bit VLAN ID. 21608 */ 21609 uint64_t vlan_tag_mask_tbl_addr; 21610 } __attribute__((packed)); 21611 21612 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */ 21613 struct hwrm_cfa_vlan_antispoof_cfg_output { 21614 /* The specific error status for the command. */ 21615 uint16_t error_code; 21616 /* The HWRM command request type. */ 21617 uint16_t req_type; 21618 /* The sequence ID from the original command. */ 21619 uint16_t seq_id; 21620 /* The length of the response data in number of bytes. */ 21621 uint16_t resp_len; 21622 uint8_t unused_0[7]; 21623 /* 21624 * This field is used in Output records to indicate that the output 21625 * is completely written to RAM. This field should be read as '1' 21626 * to indicate that the output has been completely written. 21627 * When writing a command completion or response to an internal processor, 21628 * the order of writes has to be such that this field is written last. 21629 */ 21630 uint8_t valid; 21631 } __attribute__((packed)); 21632 21633 /******************************** 21634 * hwrm_cfa_vlan_antispoof_qcfg * 21635 ********************************/ 21636 21637 21638 /* hwrm_cfa_vlan_antispoof_qcfg_input (size:256b/32B) */ 21639 struct hwrm_cfa_vlan_antispoof_qcfg_input { 21640 /* The HWRM command request type. */ 21641 uint16_t req_type; 21642 /* 21643 * The completion ring to send the completion event on. This should 21644 * be the NQ ID returned from the `nq_alloc` HWRM command. 21645 */ 21646 uint16_t cmpl_ring; 21647 /* 21648 * The sequence ID is used by the driver for tracking multiple 21649 * commands. This ID is treated as opaque data by the firmware and 21650 * the value is returned in the `hwrm_resp_hdr` upon completion. 21651 */ 21652 uint16_t seq_id; 21653 /* 21654 * The target ID of the command: 21655 * * 0x0-0xFFF8 - The function ID 21656 * * 0xFFF8-0xFFFE - Reserved for internal processors 21657 * * 0xFFFF - HWRM 21658 */ 21659 uint16_t target_id; 21660 /* 21661 * A physical address pointer pointing to a host buffer that the 21662 * command's response data will be written. This can be either a host 21663 * physical address (HPA) or a guest physical address (GPA) and must 21664 * point to a physically contiguous block of memory. 21665 */ 21666 uint64_t resp_addr; 21667 /* 21668 * Function ID of the function that is being queried. 21669 * Only valid for a VF FID queried by the PF. 21670 */ 21671 uint16_t fid; 21672 uint8_t unused_0[2]; 21673 /* 21674 * Maximum number of VLAN entries the firmware is allowed to DMA 21675 * to vlan_tag_mask_tbl. 21676 */ 21677 uint32_t max_vlan_entries; 21678 /* 21679 * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN 21680 * antispoof table to which firmware will DMA to. Each table 21681 * entry will contain the 16-bit TPID (0x8100 or 0x88a8 only), 21682 * 16-bit VLAN ID, and a 16-bit mask, all in network order to 21683 * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry, 21684 * the mask value should be 0xfff for the 12-bit VLAN ID. 21685 */ 21686 uint64_t vlan_tag_mask_tbl_addr; 21687 } __attribute__((packed)); 21688 21689 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */ 21690 struct hwrm_cfa_vlan_antispoof_qcfg_output { 21691 /* The specific error status for the command. */ 21692 uint16_t error_code; 21693 /* The HWRM command request type. */ 21694 uint16_t req_type; 21695 /* The sequence ID from the original command. */ 21696 uint16_t seq_id; 21697 /* The length of the response data in number of bytes. */ 21698 uint16_t resp_len; 21699 /* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */ 21700 uint32_t num_vlan_entries; 21701 uint8_t unused_0[3]; 21702 /* 21703 * This field is used in Output records to indicate that the output 21704 * is completely written to RAM. This field should be read as '1' 21705 * to indicate that the output has been completely written. 21706 * When writing a command completion or response to an internal processor, 21707 * the order of writes has to be such that this field is written last. 21708 */ 21709 uint8_t valid; 21710 } __attribute__((packed)); 21711 21712 /******************************** 21713 * hwrm_cfa_tunnel_filter_alloc * 21714 ********************************/ 21715 21716 21717 /* hwrm_cfa_tunnel_filter_alloc_input (size:704b/88B) */ 21718 struct hwrm_cfa_tunnel_filter_alloc_input { 21719 /* The HWRM command request type. */ 21720 uint16_t req_type; 21721 /* 21722 * The completion ring to send the completion event on. This should 21723 * be the NQ ID returned from the `nq_alloc` HWRM command. 21724 */ 21725 uint16_t cmpl_ring; 21726 /* 21727 * The sequence ID is used by the driver for tracking multiple 21728 * commands. This ID is treated as opaque data by the firmware and 21729 * the value is returned in the `hwrm_resp_hdr` upon completion. 21730 */ 21731 uint16_t seq_id; 21732 /* 21733 * The target ID of the command: 21734 * * 0x0-0xFFF8 - The function ID 21735 * * 0xFFF8-0xFFFE - Reserved for internal processors 21736 * * 0xFFFF - HWRM 21737 */ 21738 uint16_t target_id; 21739 /* 21740 * A physical address pointer pointing to a host buffer that the 21741 * command's response data will be written. This can be either a host 21742 * physical address (HPA) or a guest physical address (GPA) and must 21743 * point to a physically contiguous block of memory. 21744 */ 21745 uint64_t resp_addr; 21746 uint32_t flags; 21747 /* Setting of this flag indicates the applicability to the loopback path. */ 21748 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \ 21749 UINT32_C(0x1) 21750 uint32_t enables; 21751 /* 21752 * This bit must be '1' for the l2_filter_id field to be 21753 * configured. 21754 */ 21755 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \ 21756 UINT32_C(0x1) 21757 /* 21758 * This bit must be '1' for the l2_addr field to be 21759 * configured. 21760 */ 21761 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \ 21762 UINT32_C(0x2) 21763 /* 21764 * This bit must be '1' for the l2_ivlan field to be 21765 * configured. 21766 */ 21767 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \ 21768 UINT32_C(0x4) 21769 /* 21770 * This bit must be '1' for the l3_addr field to be 21771 * configured. 21772 */ 21773 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR \ 21774 UINT32_C(0x8) 21775 /* 21776 * This bit must be '1' for the l3_addr_type field to be 21777 * configured. 21778 */ 21779 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR_TYPE \ 21780 UINT32_C(0x10) 21781 /* 21782 * This bit must be '1' for the t_l3_addr_type field to be 21783 * configured. 21784 */ 21785 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR_TYPE \ 21786 UINT32_C(0x20) 21787 /* 21788 * This bit must be '1' for the t_l3_addr field to be 21789 * configured. 21790 */ 21791 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR \ 21792 UINT32_C(0x40) 21793 /* 21794 * This bit must be '1' for the tunnel_type field to be 21795 * configured. 21796 */ 21797 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \ 21798 UINT32_C(0x80) 21799 /* 21800 * This bit must be '1' for the vni field to be 21801 * configured. 21802 */ 21803 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_VNI \ 21804 UINT32_C(0x100) 21805 /* 21806 * This bit must be '1' for the dst_vnic_id field to be 21807 * configured. 21808 */ 21809 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_DST_VNIC_ID \ 21810 UINT32_C(0x200) 21811 /* 21812 * This bit must be '1' for the mirror_vnic_id field to be 21813 * configured. 21814 */ 21815 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \ 21816 UINT32_C(0x400) 21817 /* 21818 * This value identifies a set of CFA data structures used for an L2 21819 * context. 21820 */ 21821 uint64_t l2_filter_id; 21822 /* 21823 * This value sets the match value for the inner L2 21824 * MAC address. 21825 * Destination MAC address for RX path. 21826 * Source MAC address for TX path. 21827 */ 21828 uint8_t l2_addr[6]; 21829 /* 21830 * This value sets VLAN ID value for inner VLAN. 21831 * Only 12-bits of VLAN ID are used in setting the filter. 21832 */ 21833 uint16_t l2_ivlan; 21834 /* 21835 * The value of inner destination IP address to be used in filtering. 21836 * For IPv4, first four bytes represent the IP address. 21837 */ 21838 uint32_t l3_addr[4]; 21839 /* 21840 * The value of tunnel destination IP address to be used in filtering. 21841 * For IPv4, first four bytes represent the IP address. 21842 */ 21843 uint32_t t_l3_addr[4]; 21844 /* 21845 * This value indicates the type of inner IP address. 21846 * 4 - IPv4 21847 * 6 - IPv6 21848 * All others are invalid. 21849 */ 21850 uint8_t l3_addr_type; 21851 /* 21852 * This value indicates the type of tunnel IP address. 21853 * 4 - IPv4 21854 * 6 - IPv6 21855 * All others are invalid. 21856 */ 21857 uint8_t t_l3_addr_type; 21858 /* Tunnel Type. */ 21859 uint8_t tunnel_type; 21860 /* Non-tunnel */ 21861 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \ 21862 UINT32_C(0x0) 21863 /* Virtual eXtensible Local Area Network (VXLAN) */ 21864 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \ 21865 UINT32_C(0x1) 21866 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */ 21867 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \ 21868 UINT32_C(0x2) 21869 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */ 21870 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \ 21871 UINT32_C(0x3) 21872 /* IP in IP */ 21873 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \ 21874 UINT32_C(0x4) 21875 /* Generic Network Virtualization Encapsulation (Geneve) */ 21876 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \ 21877 UINT32_C(0x5) 21878 /* Multi-Protocol Lable Switching (MPLS) */ 21879 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \ 21880 UINT32_C(0x6) 21881 /* Stateless Transport Tunnel (STT) */ 21882 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \ 21883 UINT32_C(0x7) 21884 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */ 21885 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \ 21886 UINT32_C(0x8) 21887 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 21888 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \ 21889 UINT32_C(0x9) 21890 /* Any tunneled traffic */ 21891 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \ 21892 UINT32_C(0xff) 21893 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \ 21894 HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL 21895 /* 21896 * tunnel_flags allows the user to indicate the tunnel tag detection 21897 * for the tunnel type specified in tunnel_type. 21898 */ 21899 uint8_t tunnel_flags; 21900 /* 21901 * If the tunnel_type is geneve, then this bit indicates if we 21902 * need to match the geneve OAM packet. 21903 * If the tunnel_type is nvgre or gre, then this bit indicates if 21904 * we need to detect checksum present bit in geneve header. 21905 * If the tunnel_type is mpls, then this bit indicates if we need 21906 * to match mpls packet with explicit IPV4/IPV6 null header. 21907 */ 21908 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_OAM_CHECKSUM_EXPLHDR \ 21909 UINT32_C(0x1) 21910 /* 21911 * If the tunnel_type is geneve, then this bit indicates if we 21912 * need to detect the critical option bit set in the oam packet. 21913 * If the tunnel_type is nvgre or gre, then this bit indicates 21914 * if we need to match nvgre packets with key present bit set in 21915 * gre header. 21916 * If the tunnel_type is mpls, then this bit indicates if we 21917 * need to match mpls packet with S bit from inner/second label. 21918 */ 21919 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_CRITICAL_OPT_S1 \ 21920 UINT32_C(0x2) 21921 /* 21922 * If the tunnel_type is geneve, then this bit indicates if we 21923 * need to match geneve packet with extended header bit set in 21924 * geneve header. 21925 * If the tunnel_type is nvgre or gre, then this bit indicates 21926 * if we need to match nvgre packets with sequence number 21927 * present bit set in gre header. 21928 * If the tunnel_type is mpls, then this bit indicates if we 21929 * need to match mpls packet with S bit from out/first label. 21930 */ 21931 #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_EXTHDR_SEQNUM_S0 \ 21932 UINT32_C(0x4) 21933 /* 21934 * Virtual Network Identifier (VNI). Only valid with 21935 * tunnel_types VXLAN, NVGRE, and Geneve. 21936 * Only lower 24-bits of VNI field are used 21937 * in setting up the filter. 21938 */ 21939 uint32_t vni; 21940 /* Logical VNIC ID of the destination VNIC. */ 21941 uint32_t dst_vnic_id; 21942 /* 21943 * Logical VNIC ID of the VNIC where traffic is 21944 * mirrored. 21945 */ 21946 uint32_t mirror_vnic_id; 21947 } __attribute__((packed)); 21948 21949 /* hwrm_cfa_tunnel_filter_alloc_output (size:192b/24B) */ 21950 struct hwrm_cfa_tunnel_filter_alloc_output { 21951 /* The specific error status for the command. */ 21952 uint16_t error_code; 21953 /* The HWRM command request type. */ 21954 uint16_t req_type; 21955 /* The sequence ID from the original command. */ 21956 uint16_t seq_id; 21957 /* The length of the response data in number of bytes. */ 21958 uint16_t resp_len; 21959 /* This value is an opaque id into CFA data structures. */ 21960 uint64_t tunnel_filter_id; 21961 /* 21962 * This is the ID of the flow associated with this 21963 * filter. 21964 * This value shall be used to match and associate the 21965 * flow identifier returned in completion records. 21966 * A value of 0xFFFFFFFF shall indicate no flow id. 21967 */ 21968 uint32_t flow_id; 21969 uint8_t unused_0[3]; 21970 /* 21971 * This field is used in Output records to indicate that the output 21972 * is completely written to RAM. This field should be read as '1' 21973 * to indicate that the output has been completely written. 21974 * When writing a command completion or response to an internal processor, 21975 * the order of writes has to be such that this field is written last. 21976 */ 21977 uint8_t valid; 21978 } __attribute__((packed)); 21979 21980 /******************************* 21981 * hwrm_cfa_tunnel_filter_free * 21982 *******************************/ 21983 21984 21985 /* hwrm_cfa_tunnel_filter_free_input (size:192b/24B) */ 21986 struct hwrm_cfa_tunnel_filter_free_input { 21987 /* The HWRM command request type. */ 21988 uint16_t req_type; 21989 /* 21990 * The completion ring to send the completion event on. This should 21991 * be the NQ ID returned from the `nq_alloc` HWRM command. 21992 */ 21993 uint16_t cmpl_ring; 21994 /* 21995 * The sequence ID is used by the driver for tracking multiple 21996 * commands. This ID is treated as opaque data by the firmware and 21997 * the value is returned in the `hwrm_resp_hdr` upon completion. 21998 */ 21999 uint16_t seq_id; 22000 /* 22001 * The target ID of the command: 22002 * * 0x0-0xFFF8 - The function ID 22003 * * 0xFFF8-0xFFFE - Reserved for internal processors 22004 * * 0xFFFF - HWRM 22005 */ 22006 uint16_t target_id; 22007 /* 22008 * A physical address pointer pointing to a host buffer that the 22009 * command's response data will be written. This can be either a host 22010 * physical address (HPA) or a guest physical address (GPA) and must 22011 * point to a physically contiguous block of memory. 22012 */ 22013 uint64_t resp_addr; 22014 /* This value is an opaque id into CFA data structures. */ 22015 uint64_t tunnel_filter_id; 22016 } __attribute__((packed)); 22017 22018 /* hwrm_cfa_tunnel_filter_free_output (size:128b/16B) */ 22019 struct hwrm_cfa_tunnel_filter_free_output { 22020 /* The specific error status for the command. */ 22021 uint16_t error_code; 22022 /* The HWRM command request type. */ 22023 uint16_t req_type; 22024 /* The sequence ID from the original command. */ 22025 uint16_t seq_id; 22026 /* The length of the response data in number of bytes. */ 22027 uint16_t resp_len; 22028 uint8_t unused_0[7]; 22029 /* 22030 * This field is used in Output records to indicate that the output 22031 * is completely written to RAM. This field should be read as '1' 22032 * to indicate that the output has been completely written. 22033 * When writing a command completion or response to an internal processor, 22034 * the order of writes has to be such that this field is written last. 22035 */ 22036 uint8_t valid; 22037 } __attribute__((packed)); 22038 22039 /*************************************** 22040 * hwrm_cfa_redirect_tunnel_type_alloc * 22041 ***************************************/ 22042 22043 22044 /* hwrm_cfa_redirect_tunnel_type_alloc_input (size:192b/24B) */ 22045 struct hwrm_cfa_redirect_tunnel_type_alloc_input { 22046 /* The HWRM command request type. */ 22047 uint16_t req_type; 22048 /* 22049 * The completion ring to send the completion event on. This should 22050 * be the NQ ID returned from the `nq_alloc` HWRM command. 22051 */ 22052 uint16_t cmpl_ring; 22053 /* 22054 * The sequence ID is used by the driver for tracking multiple 22055 * commands. This ID is treated as opaque data by the firmware and 22056 * the value is returned in the `hwrm_resp_hdr` upon completion. 22057 */ 22058 uint16_t seq_id; 22059 /* 22060 * The target ID of the command: 22061 * * 0x0-0xFFF8 - The function ID 22062 * * 0xFFF8-0xFFFE - Reserved for internal processors 22063 * * 0xFFFF - HWRM 22064 */ 22065 uint16_t target_id; 22066 /* 22067 * A physical address pointer pointing to a host buffer that the 22068 * command's response data will be written. This can be either a host 22069 * physical address (HPA) or a guest physical address (GPA) and must 22070 * point to a physically contiguous block of memory. 22071 */ 22072 uint64_t resp_addr; 22073 /* The destination function id, to whom the traffic is redirected. */ 22074 uint16_t dest_fid; 22075 /* Tunnel Type. */ 22076 uint8_t tunnel_type; 22077 /* Non-tunnel */ 22078 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \ 22079 UINT32_C(0x0) 22080 /* Virtual eXtensible Local Area Network (VXLAN) */ 22081 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \ 22082 UINT32_C(0x1) 22083 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */ 22084 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \ 22085 UINT32_C(0x2) 22086 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */ 22087 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \ 22088 UINT32_C(0x3) 22089 /* IP in IP */ 22090 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPIP \ 22091 UINT32_C(0x4) 22092 /* Generic Network Virtualization Encapsulation (Geneve) */ 22093 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \ 22094 UINT32_C(0x5) 22095 /* Multi-Protocol Lable Switching (MPLS) */ 22096 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_MPLS \ 22097 UINT32_C(0x6) 22098 /* Stateless Transport Tunnel (STT) */ 22099 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_STT \ 22100 UINT32_C(0x7) 22101 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */ 22102 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \ 22103 UINT32_C(0x8) 22104 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 22105 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \ 22106 UINT32_C(0x9) 22107 /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */ 22108 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \ 22109 UINT32_C(0xa) 22110 /* Any tunneled traffic */ 22111 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \ 22112 UINT32_C(0xff) 22113 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_LAST \ 22114 HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL 22115 /* Tunnel alloc flags. */ 22116 uint8_t flags; 22117 /* Setting of this flag indicates modify existing redirect tunnel to new destination function ID. */ 22118 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_FLAGS_MODIFY_DST \ 22119 UINT32_C(0x1) 22120 uint8_t unused_0[4]; 22121 } __attribute__((packed)); 22122 22123 /* hwrm_cfa_redirect_tunnel_type_alloc_output (size:128b/16B) */ 22124 struct hwrm_cfa_redirect_tunnel_type_alloc_output { 22125 /* The specific error status for the command. */ 22126 uint16_t error_code; 22127 /* The HWRM command request type. */ 22128 uint16_t req_type; 22129 /* The sequence ID from the original command. */ 22130 uint16_t seq_id; 22131 /* The length of the response data in number of bytes. */ 22132 uint16_t resp_len; 22133 uint8_t unused_0[7]; 22134 /* 22135 * This field is used in Output records to indicate that the output 22136 * is completely written to RAM. This field should be read as '1' 22137 * to indicate that the output has been completely written. 22138 * When writing a command completion or response to an internal processor, 22139 * the order of writes has to be such that this field is written last. 22140 */ 22141 uint8_t valid; 22142 } __attribute__((packed)); 22143 22144 /************************************** 22145 * hwrm_cfa_redirect_tunnel_type_free * 22146 **************************************/ 22147 22148 22149 /* hwrm_cfa_redirect_tunnel_type_free_input (size:192b/24B) */ 22150 struct hwrm_cfa_redirect_tunnel_type_free_input { 22151 /* The HWRM command request type. */ 22152 uint16_t req_type; 22153 /* 22154 * The completion ring to send the completion event on. This should 22155 * be the NQ ID returned from the `nq_alloc` HWRM command. 22156 */ 22157 uint16_t cmpl_ring; 22158 /* 22159 * The sequence ID is used by the driver for tracking multiple 22160 * commands. This ID is treated as opaque data by the firmware and 22161 * the value is returned in the `hwrm_resp_hdr` upon completion. 22162 */ 22163 uint16_t seq_id; 22164 /* 22165 * The target ID of the command: 22166 * * 0x0-0xFFF8 - The function ID 22167 * * 0xFFF8-0xFFFE - Reserved for internal processors 22168 * * 0xFFFF - HWRM 22169 */ 22170 uint16_t target_id; 22171 /* 22172 * A physical address pointer pointing to a host buffer that the 22173 * command's response data will be written. This can be either a host 22174 * physical address (HPA) or a guest physical address (GPA) and must 22175 * point to a physically contiguous block of memory. 22176 */ 22177 uint64_t resp_addr; 22178 /* The destination function id, to whom the traffic is redirected. */ 22179 uint16_t dest_fid; 22180 /* Tunnel Type. */ 22181 uint8_t tunnel_type; 22182 /* Non-tunnel */ 22183 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NONTUNNEL \ 22184 UINT32_C(0x0) 22185 /* Virtual eXtensible Local Area Network (VXLAN) */ 22186 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN \ 22187 UINT32_C(0x1) 22188 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */ 22189 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NVGRE \ 22190 UINT32_C(0x2) 22191 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */ 22192 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2GRE \ 22193 UINT32_C(0x3) 22194 /* IP in IP */ 22195 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPIP \ 22196 UINT32_C(0x4) 22197 /* Generic Network Virtualization Encapsulation (Geneve) */ 22198 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_GENEVE \ 22199 UINT32_C(0x5) 22200 /* Multi-Protocol Lable Switching (MPLS) */ 22201 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_MPLS \ 22202 UINT32_C(0x6) 22203 /* Stateless Transport Tunnel (STT) */ 22204 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_STT \ 22205 UINT32_C(0x7) 22206 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */ 22207 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE \ 22208 UINT32_C(0x8) 22209 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 22210 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \ 22211 UINT32_C(0x9) 22212 /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */ 22213 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \ 22214 UINT32_C(0xa) 22215 /* Any tunneled traffic */ 22216 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL \ 22217 UINT32_C(0xff) 22218 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_LAST \ 22219 HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL 22220 uint8_t unused_0[5]; 22221 } __attribute__((packed)); 22222 22223 /* hwrm_cfa_redirect_tunnel_type_free_output (size:128b/16B) */ 22224 struct hwrm_cfa_redirect_tunnel_type_free_output { 22225 /* The specific error status for the command. */ 22226 uint16_t error_code; 22227 /* The HWRM command request type. */ 22228 uint16_t req_type; 22229 /* The sequence ID from the original command. */ 22230 uint16_t seq_id; 22231 /* The length of the response data in number of bytes. */ 22232 uint16_t resp_len; 22233 uint8_t unused_0[7]; 22234 /* 22235 * This field is used in Output records to indicate that the output 22236 * is completely written to RAM. This field should be read as '1' 22237 * to indicate that the output has been completely written. 22238 * When writing a command completion or response to an internal processor, 22239 * the order of writes has to be such that this field is written last. 22240 */ 22241 uint8_t valid; 22242 } __attribute__((packed)); 22243 22244 /************************************** 22245 * hwrm_cfa_redirect_tunnel_type_info * 22246 **************************************/ 22247 22248 22249 /* hwrm_cfa_redirect_tunnel_type_info_input (size:192b/24B) */ 22250 struct hwrm_cfa_redirect_tunnel_type_info_input { 22251 /* The HWRM command request type. */ 22252 uint16_t req_type; 22253 /* 22254 * The completion ring to send the completion event on. This should 22255 * be the NQ ID returned from the `nq_alloc` HWRM command. 22256 */ 22257 uint16_t cmpl_ring; 22258 /* 22259 * The sequence ID is used by the driver for tracking multiple 22260 * commands. This ID is treated as opaque data by the firmware and 22261 * the value is returned in the `hwrm_resp_hdr` upon completion. 22262 */ 22263 uint16_t seq_id; 22264 /* 22265 * The target ID of the command: 22266 * * 0x0-0xFFF8 - The function ID 22267 * * 0xFFF8-0xFFFE - Reserved for internal processors 22268 * * 0xFFFF - HWRM 22269 */ 22270 uint16_t target_id; 22271 /* 22272 * A physical address pointer pointing to a host buffer that the 22273 * command's response data will be written. This can be either a host 22274 * physical address (HPA) or a guest physical address (GPA) and must 22275 * point to a physically contiguous block of memory. 22276 */ 22277 uint64_t resp_addr; 22278 /* The source function id. */ 22279 uint16_t src_fid; 22280 /* Tunnel Type. */ 22281 uint8_t tunnel_type; 22282 /* Non-tunnel */ 22283 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NONTUNNEL \ 22284 UINT32_C(0x0) 22285 /* Virtual eXtensible Local Area Network (VXLAN) */ 22286 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN \ 22287 UINT32_C(0x1) 22288 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */ 22289 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NVGRE \ 22290 UINT32_C(0x2) 22291 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */ 22292 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2GRE \ 22293 UINT32_C(0x3) 22294 /* IP in IP */ 22295 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPIP \ 22296 UINT32_C(0x4) 22297 /* Generic Network Virtualization Encapsulation (Geneve) */ 22298 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_GENEVE \ 22299 UINT32_C(0x5) 22300 /* Multi-Protocol Lable Switching (MPLS) */ 22301 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_MPLS \ 22302 UINT32_C(0x6) 22303 /* Stateless Transport Tunnel (STT) */ 22304 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_STT \ 22305 UINT32_C(0x7) 22306 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */ 22307 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE \ 22308 UINT32_C(0x8) 22309 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 22310 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_V4 \ 22311 UINT32_C(0x9) 22312 /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */ 22313 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE_V1 \ 22314 UINT32_C(0xa) 22315 /* Any tunneled traffic */ 22316 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL \ 22317 UINT32_C(0xff) 22318 #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_LAST \ 22319 HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL 22320 uint8_t unused_0[5]; 22321 } __attribute__((packed)); 22322 22323 /* hwrm_cfa_redirect_tunnel_type_info_output (size:128b/16B) */ 22324 struct hwrm_cfa_redirect_tunnel_type_info_output { 22325 /* The specific error status for the command. */ 22326 uint16_t error_code; 22327 /* The HWRM command request type. */ 22328 uint16_t req_type; 22329 /* The sequence ID from the original command. */ 22330 uint16_t seq_id; 22331 /* The length of the response data in number of bytes. */ 22332 uint16_t resp_len; 22333 /* The destination function id, to whom the traffic is redirected. */ 22334 uint16_t dest_fid; 22335 uint8_t unused_0[5]; 22336 /* 22337 * This field is used in Output records to indicate that the output 22338 * is completely written to RAM. This field should be read as '1' 22339 * to indicate that the output has been completely written. 22340 * When writing a command completion or response to an internal processor, 22341 * the order of writes has to be such that this field is written last. 22342 */ 22343 uint8_t valid; 22344 } __attribute__((packed)); 22345 22346 /* hwrm_vxlan_ipv4_hdr (size:128b/16B) */ 22347 struct hwrm_vxlan_ipv4_hdr { 22348 /* IPv4 version and header length. */ 22349 uint8_t ver_hlen; 22350 /* IPv4 header length */ 22351 #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_MASK UINT32_C(0xf) 22352 #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_SFT 0 22353 /* Version */ 22354 #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_MASK UINT32_C(0xf0) 22355 #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_SFT 4 22356 /* IPv4 type of service. */ 22357 uint8_t tos; 22358 /* IPv4 identification. */ 22359 uint16_t ip_id; 22360 /* IPv4 flags and offset. */ 22361 uint16_t flags_frag_offset; 22362 /* IPv4 TTL. */ 22363 uint8_t ttl; 22364 /* IPv4 protocol. */ 22365 uint8_t protocol; 22366 /* IPv4 source address. */ 22367 uint32_t src_ip_addr; 22368 /* IPv4 destination address. */ 22369 uint32_t dest_ip_addr; 22370 } __attribute__((packed)); 22371 22372 /* hwrm_vxlan_ipv6_hdr (size:320b/40B) */ 22373 struct hwrm_vxlan_ipv6_hdr { 22374 /* IPv6 version, traffic class and flow label. */ 22375 uint32_t ver_tc_flow_label; 22376 /* IPv6 version shift */ 22377 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_SFT \ 22378 UINT32_C(0x1c) 22379 /* IPv6 version mask */ 22380 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_MASK \ 22381 UINT32_C(0xf0000000) 22382 /* IPv6 TC shift */ 22383 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_SFT \ 22384 UINT32_C(0x14) 22385 /* IPv6 TC mask */ 22386 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_MASK \ 22387 UINT32_C(0xff00000) 22388 /* IPv6 flow label shift */ 22389 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_SFT \ 22390 UINT32_C(0x0) 22391 /* IPv6 flow label mask */ 22392 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK \ 22393 UINT32_C(0xfffff) 22394 #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_LAST \ 22395 HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK 22396 /* IPv6 payload length. */ 22397 uint16_t payload_len; 22398 /* IPv6 next header. */ 22399 uint8_t next_hdr; 22400 /* IPv6 TTL. */ 22401 uint8_t ttl; 22402 /* IPv6 source address. */ 22403 uint32_t src_ip_addr[4]; 22404 /* IPv6 destination address. */ 22405 uint32_t dest_ip_addr[4]; 22406 } __attribute__((packed)); 22407 22408 /* hwrm_cfa_encap_data_vxlan (size:640b/80B) */ 22409 struct hwrm_cfa_encap_data_vxlan { 22410 /* Source MAC address. */ 22411 uint8_t src_mac_addr[6]; 22412 /* reserved. */ 22413 uint16_t unused_0; 22414 /* Destination MAC address. */ 22415 uint8_t dst_mac_addr[6]; 22416 /* Number of VLAN tags. */ 22417 uint8_t num_vlan_tags; 22418 /* reserved. */ 22419 uint8_t unused_1; 22420 /* Outer VLAN TPID. */ 22421 uint16_t ovlan_tpid; 22422 /* Outer VLAN TCI. */ 22423 uint16_t ovlan_tci; 22424 /* Inner VLAN TPID. */ 22425 uint16_t ivlan_tpid; 22426 /* Inner VLAN TCI. */ 22427 uint16_t ivlan_tci; 22428 /* L3 header fields. */ 22429 uint32_t l3[10]; 22430 /* IP version mask. */ 22431 #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_MASK UINT32_C(0xf) 22432 /* IP version 4. */ 22433 #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV4 UINT32_C(0x4) 22434 /* IP version 6. */ 22435 #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6 UINT32_C(0x6) 22436 #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_LAST \ 22437 HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6 22438 /* UDP source port. */ 22439 uint16_t src_port; 22440 /* UDP destination port. */ 22441 uint16_t dst_port; 22442 /* VXLAN Network Identifier. */ 22443 uint32_t vni; 22444 /* 3 bytes VXLAN header reserve fields from 1st dword of the VXLAN header. */ 22445 uint8_t hdr_rsvd0[3]; 22446 /* 1 byte VXLAN header reserve field from 2nd dword of the VXLAN header. */ 22447 uint8_t hdr_rsvd1; 22448 /* VXLAN header flags field. */ 22449 uint8_t hdr_flags; 22450 uint8_t unused[3]; 22451 } __attribute__((packed)); 22452 22453 /******************************* 22454 * hwrm_cfa_encap_record_alloc * 22455 *******************************/ 22456 22457 22458 /* hwrm_cfa_encap_record_alloc_input (size:832b/104B) */ 22459 struct hwrm_cfa_encap_record_alloc_input { 22460 /* The HWRM command request type. */ 22461 uint16_t req_type; 22462 /* 22463 * The completion ring to send the completion event on. This should 22464 * be the NQ ID returned from the `nq_alloc` HWRM command. 22465 */ 22466 uint16_t cmpl_ring; 22467 /* 22468 * The sequence ID is used by the driver for tracking multiple 22469 * commands. This ID is treated as opaque data by the firmware and 22470 * the value is returned in the `hwrm_resp_hdr` upon completion. 22471 */ 22472 uint16_t seq_id; 22473 /* 22474 * The target ID of the command: 22475 * * 0x0-0xFFF8 - The function ID 22476 * * 0xFFF8-0xFFFE - Reserved for internal processors 22477 * * 0xFFFF - HWRM 22478 */ 22479 uint16_t target_id; 22480 /* 22481 * A physical address pointer pointing to a host buffer that the 22482 * command's response data will be written. This can be either a host 22483 * physical address (HPA) or a guest physical address (GPA) and must 22484 * point to a physically contiguous block of memory. 22485 */ 22486 uint64_t resp_addr; 22487 uint32_t flags; 22488 /* Setting of this flag indicates the applicability to the loopback path. */ 22489 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_LOOPBACK \ 22490 UINT32_C(0x1) 22491 /* Encapsulation Type. */ 22492 uint8_t encap_type; 22493 /* Virtual eXtensible Local Area Network (VXLAN) */ 22494 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN \ 22495 UINT32_C(0x1) 22496 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */ 22497 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_NVGRE \ 22498 UINT32_C(0x2) 22499 /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */ 22500 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2GRE \ 22501 UINT32_C(0x3) 22502 /* IP in IP */ 22503 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPIP \ 22504 UINT32_C(0x4) 22505 /* Generic Network Virtualization Encapsulation (Geneve) */ 22506 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_GENEVE \ 22507 UINT32_C(0x5) 22508 /* Multi-Protocol Lable Switching (MPLS) */ 22509 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_MPLS \ 22510 UINT32_C(0x6) 22511 /* VLAN */ 22512 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VLAN \ 22513 UINT32_C(0x7) 22514 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */ 22515 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE \ 22516 UINT32_C(0x8) 22517 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 22518 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_V4 \ 22519 UINT32_C(0x9) 22520 #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_LAST \ 22521 HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_V4 22522 uint8_t unused_0[3]; 22523 /* This value is encap data used for the given encap type. */ 22524 uint32_t encap_data[20]; 22525 } __attribute__((packed)); 22526 22527 /* hwrm_cfa_encap_record_alloc_output (size:128b/16B) */ 22528 struct hwrm_cfa_encap_record_alloc_output { 22529 /* The specific error status for the command. */ 22530 uint16_t error_code; 22531 /* The HWRM command request type. */ 22532 uint16_t req_type; 22533 /* The sequence ID from the original command. */ 22534 uint16_t seq_id; 22535 /* The length of the response data in number of bytes. */ 22536 uint16_t resp_len; 22537 /* This value is an opaque id into CFA data structures. */ 22538 uint32_t encap_record_id; 22539 uint8_t unused_0[3]; 22540 /* 22541 * This field is used in Output records to indicate that the output 22542 * is completely written to RAM. This field should be read as '1' 22543 * to indicate that the output has been completely written. 22544 * When writing a command completion or response to an internal processor, 22545 * the order of writes has to be such that this field is written last. 22546 */ 22547 uint8_t valid; 22548 } __attribute__((packed)); 22549 22550 /****************************** 22551 * hwrm_cfa_encap_record_free * 22552 ******************************/ 22553 22554 22555 /* hwrm_cfa_encap_record_free_input (size:192b/24B) */ 22556 struct hwrm_cfa_encap_record_free_input { 22557 /* The HWRM command request type. */ 22558 uint16_t req_type; 22559 /* 22560 * The completion ring to send the completion event on. This should 22561 * be the NQ ID returned from the `nq_alloc` HWRM command. 22562 */ 22563 uint16_t cmpl_ring; 22564 /* 22565 * The sequence ID is used by the driver for tracking multiple 22566 * commands. This ID is treated as opaque data by the firmware and 22567 * the value is returned in the `hwrm_resp_hdr` upon completion. 22568 */ 22569 uint16_t seq_id; 22570 /* 22571 * The target ID of the command: 22572 * * 0x0-0xFFF8 - The function ID 22573 * * 0xFFF8-0xFFFE - Reserved for internal processors 22574 * * 0xFFFF - HWRM 22575 */ 22576 uint16_t target_id; 22577 /* 22578 * A physical address pointer pointing to a host buffer that the 22579 * command's response data will be written. This can be either a host 22580 * physical address (HPA) or a guest physical address (GPA) and must 22581 * point to a physically contiguous block of memory. 22582 */ 22583 uint64_t resp_addr; 22584 /* This value is an opaque id into CFA data structures. */ 22585 uint32_t encap_record_id; 22586 uint8_t unused_0[4]; 22587 } __attribute__((packed)); 22588 22589 /* hwrm_cfa_encap_record_free_output (size:128b/16B) */ 22590 struct hwrm_cfa_encap_record_free_output { 22591 /* The specific error status for the command. */ 22592 uint16_t error_code; 22593 /* The HWRM command request type. */ 22594 uint16_t req_type; 22595 /* The sequence ID from the original command. */ 22596 uint16_t seq_id; 22597 /* The length of the response data in number of bytes. */ 22598 uint16_t resp_len; 22599 uint8_t unused_0[7]; 22600 /* 22601 * This field is used in Output records to indicate that the output 22602 * is completely written to RAM. This field should be read as '1' 22603 * to indicate that the output has been completely written. 22604 * When writing a command completion or response to an internal processor, 22605 * the order of writes has to be such that this field is written last. 22606 */ 22607 uint8_t valid; 22608 } __attribute__((packed)); 22609 22610 /******************************** 22611 * hwrm_cfa_ntuple_filter_alloc * 22612 ********************************/ 22613 22614 22615 /* hwrm_cfa_ntuple_filter_alloc_input (size:1024b/128B) */ 22616 struct hwrm_cfa_ntuple_filter_alloc_input { 22617 /* The HWRM command request type. */ 22618 uint16_t req_type; 22619 /* 22620 * The completion ring to send the completion event on. This should 22621 * be the NQ ID returned from the `nq_alloc` HWRM command. 22622 */ 22623 uint16_t cmpl_ring; 22624 /* 22625 * The sequence ID is used by the driver for tracking multiple 22626 * commands. This ID is treated as opaque data by the firmware and 22627 * the value is returned in the `hwrm_resp_hdr` upon completion. 22628 */ 22629 uint16_t seq_id; 22630 /* 22631 * The target ID of the command: 22632 * * 0x0-0xFFF8 - The function ID 22633 * * 0xFFF8-0xFFFE - Reserved for internal processors 22634 * * 0xFFFF - HWRM 22635 */ 22636 uint16_t target_id; 22637 /* 22638 * A physical address pointer pointing to a host buffer that the 22639 * command's response data will be written. This can be either a host 22640 * physical address (HPA) or a guest physical address (GPA) and must 22641 * point to a physically contiguous block of memory. 22642 */ 22643 uint64_t resp_addr; 22644 uint32_t flags; 22645 /* Setting of this flag indicates the applicability to the loopback path. */ 22646 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \ 22647 UINT32_C(0x1) 22648 /* 22649 * Setting of this flag indicates drop action. If this flag is not set, 22650 * then it should be considered accept action. 22651 */ 22652 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP \ 22653 UINT32_C(0x2) 22654 /* 22655 * Setting of this flag indicates that a meter is expected to be attached 22656 * to this flow. This hint can be used when choosing the action record 22657 * format required for the flow. 22658 */ 22659 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER \ 22660 UINT32_C(0x4) 22661 uint32_t enables; 22662 /* 22663 * This bit must be '1' for the l2_filter_id field to be 22664 * configured. 22665 */ 22666 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \ 22667 UINT32_C(0x1) 22668 /* 22669 * This bit must be '1' for the ethertype field to be 22670 * configured. 22671 */ 22672 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \ 22673 UINT32_C(0x2) 22674 /* 22675 * This bit must be '1' for the tunnel_type field to be 22676 * configured. 22677 */ 22678 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \ 22679 UINT32_C(0x4) 22680 /* 22681 * This bit must be '1' for the src_macaddr field to be 22682 * configured. 22683 */ 22684 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \ 22685 UINT32_C(0x8) 22686 /* 22687 * This bit must be '1' for the ipaddr_type field to be 22688 * configured. 22689 */ 22690 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \ 22691 UINT32_C(0x10) 22692 /* 22693 * This bit must be '1' for the src_ipaddr field to be 22694 * configured. 22695 */ 22696 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \ 22697 UINT32_C(0x20) 22698 /* 22699 * This bit must be '1' for the src_ipaddr_mask field to be 22700 * configured. 22701 */ 22702 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK \ 22703 UINT32_C(0x40) 22704 /* 22705 * This bit must be '1' for the dst_ipaddr field to be 22706 * configured. 22707 */ 22708 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \ 22709 UINT32_C(0x80) 22710 /* 22711 * This bit must be '1' for the dst_ipaddr_mask field to be 22712 * configured. 22713 */ 22714 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK \ 22715 UINT32_C(0x100) 22716 /* 22717 * This bit must be '1' for the ip_protocol field to be 22718 * configured. 22719 */ 22720 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \ 22721 UINT32_C(0x200) 22722 /* 22723 * This bit must be '1' for the src_port field to be 22724 * configured. 22725 */ 22726 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \ 22727 UINT32_C(0x400) 22728 /* 22729 * This bit must be '1' for the src_port_mask field to be 22730 * configured. 22731 */ 22732 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK \ 22733 UINT32_C(0x800) 22734 /* 22735 * This bit must be '1' for the dst_port field to be 22736 * configured. 22737 */ 22738 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \ 22739 UINT32_C(0x1000) 22740 /* 22741 * This bit must be '1' for the dst_port_mask field to be 22742 * configured. 22743 */ 22744 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK \ 22745 UINT32_C(0x2000) 22746 /* 22747 * This bit must be '1' for the pri_hint field to be 22748 * configured. 22749 */ 22750 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT \ 22751 UINT32_C(0x4000) 22752 /* 22753 * This bit must be '1' for the ntuple_filter_id field to be 22754 * configured. 22755 */ 22756 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID \ 22757 UINT32_C(0x8000) 22758 /* 22759 * This bit must be '1' for the dst_id field to be 22760 * configured. 22761 */ 22762 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID \ 22763 UINT32_C(0x10000) 22764 /* 22765 * This bit must be '1' for the mirror_vnic_id field to be 22766 * configured. 22767 */ 22768 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \ 22769 UINT32_C(0x20000) 22770 /* 22771 * This bit must be '1' for the dst_macaddr field to be 22772 * configured. 22773 */ 22774 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \ 22775 UINT32_C(0x40000) 22776 /* 22777 * This value identifies a set of CFA data structures used for an L2 22778 * context. 22779 */ 22780 uint64_t l2_filter_id; 22781 /* 22782 * This value indicates the source MAC address in 22783 * the Ethernet header. 22784 */ 22785 uint8_t src_macaddr[6]; 22786 /* This value indicates the ethertype in the Ethernet header. */ 22787 uint16_t ethertype; 22788 /* 22789 * This value indicates the type of IP address. 22790 * 4 - IPv4 22791 * 6 - IPv6 22792 * All others are invalid. 22793 */ 22794 uint8_t ip_addr_type; 22795 /* invalid */ 22796 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \ 22797 UINT32_C(0x0) 22798 /* IPv4 */ 22799 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \ 22800 UINT32_C(0x4) 22801 /* IPv6 */ 22802 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \ 22803 UINT32_C(0x6) 22804 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \ 22805 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 22806 /* 22807 * The value of protocol filed in IP header. 22808 * Applies to UDP and TCP traffic. 22809 * 6 - TCP 22810 * 17 - UDP 22811 */ 22812 uint8_t ip_protocol; 22813 /* invalid */ 22814 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \ 22815 UINT32_C(0x0) 22816 /* TCP */ 22817 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \ 22818 UINT32_C(0x6) 22819 /* UDP */ 22820 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \ 22821 UINT32_C(0x11) 22822 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \ 22823 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP 22824 /* 22825 * If set, this value shall represent the 22826 * Logical VNIC ID of the destination VNIC for the RX 22827 * path and network port id of the destination port for 22828 * the TX path. 22829 */ 22830 uint16_t dst_id; 22831 /* 22832 * Logical VNIC ID of the VNIC where traffic is 22833 * mirrored. 22834 */ 22835 uint16_t mirror_vnic_id; 22836 /* 22837 * This value indicates the tunnel type for this filter. 22838 * If this field is not specified, then the filter shall 22839 * apply to both non-tunneled and tunneled packets. 22840 * If this field conflicts with the tunnel_type specified 22841 * in the l2_filter_id, then the HWRM shall return an 22842 * error for this command. 22843 */ 22844 uint8_t tunnel_type; 22845 /* Non-tunnel */ 22846 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \ 22847 UINT32_C(0x0) 22848 /* Virtual eXtensible Local Area Network (VXLAN) */ 22849 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \ 22850 UINT32_C(0x1) 22851 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */ 22852 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \ 22853 UINT32_C(0x2) 22854 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */ 22855 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \ 22856 UINT32_C(0x3) 22857 /* IP in IP */ 22858 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \ 22859 UINT32_C(0x4) 22860 /* Generic Network Virtualization Encapsulation (Geneve) */ 22861 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \ 22862 UINT32_C(0x5) 22863 /* Multi-Protocol Lable Switching (MPLS) */ 22864 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \ 22865 UINT32_C(0x6) 22866 /* Stateless Transport Tunnel (STT) */ 22867 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \ 22868 UINT32_C(0x7) 22869 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */ 22870 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \ 22871 UINT32_C(0x8) 22872 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 22873 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \ 22874 UINT32_C(0x9) 22875 /* Any tunneled traffic */ 22876 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \ 22877 UINT32_C(0xff) 22878 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \ 22879 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL 22880 /* 22881 * This hint is provided to help in placing 22882 * the filter in the filter table. 22883 */ 22884 uint8_t pri_hint; 22885 /* No preference */ 22886 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \ 22887 UINT32_C(0x0) 22888 /* Above the given filter */ 22889 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE \ 22890 UINT32_C(0x1) 22891 /* Below the given filter */ 22892 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW \ 22893 UINT32_C(0x2) 22894 /* As high as possible */ 22895 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST \ 22896 UINT32_C(0x3) 22897 /* As low as possible */ 22898 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST \ 22899 UINT32_C(0x4) 22900 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LAST \ 22901 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST 22902 /* 22903 * The value of source IP address to be used in filtering. 22904 * For IPv4, first four bytes represent the IP address. 22905 */ 22906 uint32_t src_ipaddr[4]; 22907 /* 22908 * The value of source IP address mask to be used in 22909 * filtering. 22910 * For IPv4, first four bytes represent the IP address mask. 22911 */ 22912 uint32_t src_ipaddr_mask[4]; 22913 /* 22914 * The value of destination IP address to be used in filtering. 22915 * For IPv4, first four bytes represent the IP address. 22916 */ 22917 uint32_t dst_ipaddr[4]; 22918 /* 22919 * The value of destination IP address mask to be used in 22920 * filtering. 22921 * For IPv4, first four bytes represent the IP address mask. 22922 */ 22923 uint32_t dst_ipaddr_mask[4]; 22924 /* 22925 * The value of source port to be used in filtering. 22926 * Applies to UDP and TCP traffic. 22927 */ 22928 uint16_t src_port; 22929 /* 22930 * The value of source port mask to be used in filtering. 22931 * Applies to UDP and TCP traffic. 22932 */ 22933 uint16_t src_port_mask; 22934 /* 22935 * The value of destination port to be used in filtering. 22936 * Applies to UDP and TCP traffic. 22937 */ 22938 uint16_t dst_port; 22939 /* 22940 * The value of destination port mask to be used in 22941 * filtering. 22942 * Applies to UDP and TCP traffic. 22943 */ 22944 uint16_t dst_port_mask; 22945 /* 22946 * This is the ID of the filter that goes along with 22947 * the pri_hint. 22948 */ 22949 uint64_t ntuple_filter_id_hint; 22950 } __attribute__((packed)); 22951 22952 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */ 22953 struct hwrm_cfa_ntuple_filter_alloc_output { 22954 /* The specific error status for the command. */ 22955 uint16_t error_code; 22956 /* The HWRM command request type. */ 22957 uint16_t req_type; 22958 /* The sequence ID from the original command. */ 22959 uint16_t seq_id; 22960 /* The length of the response data in number of bytes. */ 22961 uint16_t resp_len; 22962 /* This value is an opaque id into CFA data structures. */ 22963 uint64_t ntuple_filter_id; 22964 /* 22965 * This is the ID of the flow associated with this 22966 * filter. 22967 * This value shall be used to match and associate the 22968 * flow identifier returned in completion records. 22969 * A value of 0xFFFFFFFF shall indicate no flow id. 22970 */ 22971 uint32_t flow_id; 22972 uint8_t unused_0[3]; 22973 /* 22974 * This field is used in Output records to indicate that the output 22975 * is completely written to RAM. This field should be read as '1' 22976 * to indicate that the output has been completely written. 22977 * When writing a command completion or response to an internal processor, 22978 * the order of writes has to be such that this field is written last. 22979 */ 22980 uint8_t valid; 22981 } __attribute__((packed)); 22982 22983 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */ 22984 struct hwrm_cfa_ntuple_filter_alloc_cmd_err { 22985 /* 22986 * command specific error codes that goes to 22987 * the cmd_err field in Common HWRM Error Response. 22988 */ 22989 uint8_t code; 22990 /* Unknown error */ 22991 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN \ 22992 UINT32_C(0x0) 22993 /* Unable to complete operation due to conflict with Rx Mask VLAN */ 22994 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR \ 22995 UINT32_C(0x1) 22996 #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST \ 22997 HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR 22998 uint8_t unused_0[7]; 22999 } __attribute__((packed)); 23000 23001 /******************************* 23002 * hwrm_cfa_ntuple_filter_free * 23003 *******************************/ 23004 23005 23006 /* hwrm_cfa_ntuple_filter_free_input (size:192b/24B) */ 23007 struct hwrm_cfa_ntuple_filter_free_input { 23008 /* The HWRM command request type. */ 23009 uint16_t req_type; 23010 /* 23011 * The completion ring to send the completion event on. This should 23012 * be the NQ ID returned from the `nq_alloc` HWRM command. 23013 */ 23014 uint16_t cmpl_ring; 23015 /* 23016 * The sequence ID is used by the driver for tracking multiple 23017 * commands. This ID is treated as opaque data by the firmware and 23018 * the value is returned in the `hwrm_resp_hdr` upon completion. 23019 */ 23020 uint16_t seq_id; 23021 /* 23022 * The target ID of the command: 23023 * * 0x0-0xFFF8 - The function ID 23024 * * 0xFFF8-0xFFFE - Reserved for internal processors 23025 * * 0xFFFF - HWRM 23026 */ 23027 uint16_t target_id; 23028 /* 23029 * A physical address pointer pointing to a host buffer that the 23030 * command's response data will be written. This can be either a host 23031 * physical address (HPA) or a guest physical address (GPA) and must 23032 * point to a physically contiguous block of memory. 23033 */ 23034 uint64_t resp_addr; 23035 /* This value is an opaque id into CFA data structures. */ 23036 uint64_t ntuple_filter_id; 23037 } __attribute__((packed)); 23038 23039 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */ 23040 struct hwrm_cfa_ntuple_filter_free_output { 23041 /* The specific error status for the command. */ 23042 uint16_t error_code; 23043 /* The HWRM command request type. */ 23044 uint16_t req_type; 23045 /* The sequence ID from the original command. */ 23046 uint16_t seq_id; 23047 /* The length of the response data in number of bytes. */ 23048 uint16_t resp_len; 23049 uint8_t unused_0[7]; 23050 /* 23051 * This field is used in Output records to indicate that the output 23052 * is completely written to RAM. This field should be read as '1' 23053 * to indicate that the output has been completely written. 23054 * When writing a command completion or response to an internal processor, 23055 * the order of writes has to be such that this field is written last. 23056 */ 23057 uint8_t valid; 23058 } __attribute__((packed)); 23059 23060 /****************************** 23061 * hwrm_cfa_ntuple_filter_cfg * 23062 ******************************/ 23063 23064 23065 /* hwrm_cfa_ntuple_filter_cfg_input (size:384b/48B) */ 23066 struct hwrm_cfa_ntuple_filter_cfg_input { 23067 /* The HWRM command request type. */ 23068 uint16_t req_type; 23069 /* 23070 * The completion ring to send the completion event on. This should 23071 * be the NQ ID returned from the `nq_alloc` HWRM command. 23072 */ 23073 uint16_t cmpl_ring; 23074 /* 23075 * The sequence ID is used by the driver for tracking multiple 23076 * commands. This ID is treated as opaque data by the firmware and 23077 * the value is returned in the `hwrm_resp_hdr` upon completion. 23078 */ 23079 uint16_t seq_id; 23080 /* 23081 * The target ID of the command: 23082 * * 0x0-0xFFF8 - The function ID 23083 * * 0xFFF8-0xFFFE - Reserved for internal processors 23084 * * 0xFFFF - HWRM 23085 */ 23086 uint16_t target_id; 23087 /* 23088 * A physical address pointer pointing to a host buffer that the 23089 * command's response data will be written. This can be either a host 23090 * physical address (HPA) or a guest physical address (GPA) and must 23091 * point to a physically contiguous block of memory. 23092 */ 23093 uint64_t resp_addr; 23094 uint32_t enables; 23095 /* 23096 * This bit must be '1' for the new_dst_id field to be 23097 * configured. 23098 */ 23099 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID \ 23100 UINT32_C(0x1) 23101 /* 23102 * This bit must be '1' for the new_mirror_vnic_id field to be 23103 * configured. 23104 */ 23105 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \ 23106 UINT32_C(0x2) 23107 /* 23108 * This bit must be '1' for the new_meter_instance_id field to be 23109 * configured. 23110 */ 23111 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID \ 23112 UINT32_C(0x4) 23113 uint8_t unused_0[4]; 23114 /* This value is an opaque id into CFA data structures. */ 23115 uint64_t ntuple_filter_id; 23116 /* 23117 * If set, this value shall represent the new 23118 * Logical VNIC ID of the destination VNIC for the RX 23119 * path and new network port id of the destination port for 23120 * the TX path. 23121 */ 23122 uint32_t new_dst_id; 23123 /* 23124 * New Logical VNIC ID of the VNIC where traffic is 23125 * mirrored. 23126 */ 23127 uint32_t new_mirror_vnic_id; 23128 /* 23129 * New meter to attach to the flow. Specifying the 23130 * invalid instance ID is used to remove any existing 23131 * meter from the flow. 23132 */ 23133 uint16_t new_meter_instance_id; 23134 /* 23135 * A value of 0xfff is considered invalid and implies the 23136 * instance is not configured. 23137 */ 23138 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID \ 23139 UINT32_C(0xffff) 23140 #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST \ 23141 HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID 23142 uint8_t unused_1[6]; 23143 } __attribute__((packed)); 23144 23145 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */ 23146 struct hwrm_cfa_ntuple_filter_cfg_output { 23147 /* The specific error status for the command. */ 23148 uint16_t error_code; 23149 /* The HWRM command request type. */ 23150 uint16_t req_type; 23151 /* The sequence ID from the original command. */ 23152 uint16_t seq_id; 23153 /* The length of the response data in number of bytes. */ 23154 uint16_t resp_len; 23155 uint8_t unused_0[7]; 23156 /* 23157 * This field is used in Output records to indicate that the output 23158 * is completely written to RAM. This field should be read as '1' 23159 * to indicate that the output has been completely written. 23160 * When writing a command completion or response to an internal processor, 23161 * the order of writes has to be such that this field is written last. 23162 */ 23163 uint8_t valid; 23164 } __attribute__((packed)); 23165 23166 /************************** 23167 * hwrm_cfa_em_flow_alloc * 23168 **************************/ 23169 23170 23171 /* hwrm_cfa_em_flow_alloc_input (size:896b/112B) */ 23172 struct hwrm_cfa_em_flow_alloc_input { 23173 /* The HWRM command request type. */ 23174 uint16_t req_type; 23175 /* 23176 * The completion ring to send the completion event on. This should 23177 * be the NQ ID returned from the `nq_alloc` HWRM command. 23178 */ 23179 uint16_t cmpl_ring; 23180 /* 23181 * The sequence ID is used by the driver for tracking multiple 23182 * commands. This ID is treated as opaque data by the firmware and 23183 * the value is returned in the `hwrm_resp_hdr` upon completion. 23184 */ 23185 uint16_t seq_id; 23186 /* 23187 * The target ID of the command: 23188 * * 0x0-0xFFF8 - The function ID 23189 * * 0xFFF8-0xFFFE - Reserved for internal processors 23190 * * 0xFFFF - HWRM 23191 */ 23192 uint16_t target_id; 23193 /* 23194 * A physical address pointer pointing to a host buffer that the 23195 * command's response data will be written. This can be either a host 23196 * physical address (HPA) or a guest physical address (GPA) and must 23197 * point to a physically contiguous block of memory. 23198 */ 23199 uint64_t resp_addr; 23200 uint32_t flags; 23201 /* 23202 * Enumeration denoting the RX, TX type of the resource. 23203 * This enumeration is used for resources that are similar for both 23204 * TX and RX paths of the chip. 23205 */ 23206 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH UINT32_C(0x1) 23207 /* tx path */ 23208 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX UINT32_C(0x0) 23209 /* rx path */ 23210 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX UINT32_C(0x1) 23211 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST \ 23212 HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX 23213 /* 23214 * Setting of this flag indicates enabling of a byte counter for a given 23215 * flow. 23216 */ 23217 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR UINT32_C(0x2) 23218 /* 23219 * Setting of this flag indicates enabling of a packet counter for a given 23220 * flow. 23221 */ 23222 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR UINT32_C(0x4) 23223 /* Setting of this flag indicates de-capsulation action for the given flow. */ 23224 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP UINT32_C(0x8) 23225 /* Setting of this flag indicates encapsulation action for the given flow. */ 23226 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP UINT32_C(0x10) 23227 /* 23228 * Setting of this flag indicates drop action. If this flag is not set, 23229 * then it should be considered accept action. 23230 */ 23231 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP UINT32_C(0x20) 23232 /* 23233 * Setting of this flag indicates that a meter is expected to be attached 23234 * to this flow. This hint can be used when choosing the action record 23235 * format required for the flow. 23236 */ 23237 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER UINT32_C(0x40) 23238 uint32_t enables; 23239 /* 23240 * This bit must be '1' for the l2_filter_id field to be 23241 * configured. 23242 */ 23243 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID \ 23244 UINT32_C(0x1) 23245 /* 23246 * This bit must be '1' for the tunnel_type field to be 23247 * configured. 23248 */ 23249 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \ 23250 UINT32_C(0x2) 23251 /* 23252 * This bit must be '1' for the tunnel_id field to be 23253 * configured. 23254 */ 23255 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID \ 23256 UINT32_C(0x4) 23257 /* 23258 * This bit must be '1' for the src_macaddr field to be 23259 * configured. 23260 */ 23261 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR \ 23262 UINT32_C(0x8) 23263 /* 23264 * This bit must be '1' for the dst_macaddr field to be 23265 * configured. 23266 */ 23267 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR \ 23268 UINT32_C(0x10) 23269 /* 23270 * This bit must be '1' for the ovlan_vid field to be 23271 * configured. 23272 */ 23273 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID \ 23274 UINT32_C(0x20) 23275 /* 23276 * This bit must be '1' for the ivlan_vid field to be 23277 * configured. 23278 */ 23279 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID \ 23280 UINT32_C(0x40) 23281 /* 23282 * This bit must be '1' for the ethertype field to be 23283 * configured. 23284 */ 23285 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE \ 23286 UINT32_C(0x80) 23287 /* 23288 * This bit must be '1' for the src_ipaddr field to be 23289 * configured. 23290 */ 23291 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR \ 23292 UINT32_C(0x100) 23293 /* 23294 * This bit must be '1' for the dst_ipaddr field to be 23295 * configured. 23296 */ 23297 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR \ 23298 UINT32_C(0x200) 23299 /* 23300 * This bit must be '1' for the ipaddr_type field to be 23301 * configured. 23302 */ 23303 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE \ 23304 UINT32_C(0x400) 23305 /* 23306 * This bit must be '1' for the ip_protocol field to be 23307 * configured. 23308 */ 23309 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL \ 23310 UINT32_C(0x800) 23311 /* 23312 * This bit must be '1' for the src_port field to be 23313 * configured. 23314 */ 23315 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT \ 23316 UINT32_C(0x1000) 23317 /* 23318 * This bit must be '1' for the dst_port field to be 23319 * configured. 23320 */ 23321 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT \ 23322 UINT32_C(0x2000) 23323 /* 23324 * This bit must be '1' for the dst_id field to be 23325 * configured. 23326 */ 23327 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID \ 23328 UINT32_C(0x4000) 23329 /* 23330 * This bit must be '1' for the mirror_vnic_id field to be 23331 * configured. 23332 */ 23333 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \ 23334 UINT32_C(0x8000) 23335 /* 23336 * This bit must be '1' for the encap_record_id field to be 23337 * configured. 23338 */ 23339 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID \ 23340 UINT32_C(0x10000) 23341 /* 23342 * This bit must be '1' for the meter_instance_id field to be 23343 * configured. 23344 */ 23345 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID \ 23346 UINT32_C(0x20000) 23347 /* 23348 * This value identifies a set of CFA data structures used for an L2 23349 * context. 23350 */ 23351 uint64_t l2_filter_id; 23352 /* Tunnel Type. */ 23353 uint8_t tunnel_type; 23354 /* Non-tunnel */ 23355 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \ 23356 UINT32_C(0x0) 23357 /* Virtual eXtensible Local Area Network (VXLAN) */ 23358 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \ 23359 UINT32_C(0x1) 23360 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */ 23361 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \ 23362 UINT32_C(0x2) 23363 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */ 23364 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \ 23365 UINT32_C(0x3) 23366 /* IP in IP */ 23367 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \ 23368 UINT32_C(0x4) 23369 /* Generic Network Virtualization Encapsulation (Geneve) */ 23370 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \ 23371 UINT32_C(0x5) 23372 /* Multi-Protocol Lable Switching (MPLS) */ 23373 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \ 23374 UINT32_C(0x6) 23375 /* Stateless Transport Tunnel (STT) */ 23376 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \ 23377 UINT32_C(0x7) 23378 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */ 23379 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \ 23380 UINT32_C(0x8) 23381 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 23382 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \ 23383 UINT32_C(0x9) 23384 /* Any tunneled traffic */ 23385 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \ 23386 UINT32_C(0xff) 23387 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \ 23388 HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL 23389 uint8_t unused_0[3]; 23390 /* 23391 * Tunnel identifier. 23392 * Virtual Network Identifier (VNI). Only valid with 23393 * tunnel_types VXLAN, NVGRE, and Geneve. 23394 * Only lower 24-bits of VNI field are used 23395 * in setting up the filter. 23396 */ 23397 uint32_t tunnel_id; 23398 /* 23399 * This value indicates the source MAC address in 23400 * the Ethernet header. 23401 */ 23402 uint8_t src_macaddr[6]; 23403 /* The meter instance to attach to the flow. */ 23404 uint16_t meter_instance_id; 23405 /* 23406 * A value of 0xfff is considered invalid and implies the 23407 * instance is not configured. 23408 */ 23409 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID \ 23410 UINT32_C(0xffff) 23411 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_LAST \ 23412 HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID 23413 /* 23414 * This value indicates the destination MAC address in 23415 * the Ethernet header. 23416 */ 23417 uint8_t dst_macaddr[6]; 23418 /* 23419 * This value indicates the VLAN ID of the outer VLAN tag 23420 * in the Ethernet header. 23421 */ 23422 uint16_t ovlan_vid; 23423 /* 23424 * This value indicates the VLAN ID of the inner VLAN tag 23425 * in the Ethernet header. 23426 */ 23427 uint16_t ivlan_vid; 23428 /* This value indicates the ethertype in the Ethernet header. */ 23429 uint16_t ethertype; 23430 /* 23431 * This value indicates the type of IP address. 23432 * 4 - IPv4 23433 * 6 - IPv6 23434 * All others are invalid. 23435 */ 23436 uint8_t ip_addr_type; 23437 /* invalid */ 23438 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0) 23439 /* IPv4 */ 23440 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 UINT32_C(0x4) 23441 /* IPv6 */ 23442 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 UINT32_C(0x6) 23443 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_LAST \ 23444 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 23445 /* 23446 * The value of protocol filed in IP header. 23447 * Applies to UDP and TCP traffic. 23448 * 6 - TCP 23449 * 17 - UDP 23450 */ 23451 uint8_t ip_protocol; 23452 /* invalid */ 23453 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0) 23454 /* TCP */ 23455 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP UINT32_C(0x6) 23456 /* UDP */ 23457 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP UINT32_C(0x11) 23458 #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_LAST \ 23459 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP 23460 uint8_t unused_1[2]; 23461 /* 23462 * The value of source IP address to be used in filtering. 23463 * For IPv4, first four bytes represent the IP address. 23464 */ 23465 uint32_t src_ipaddr[4]; 23466 /* 23467 * big_endian = True 23468 * The value of destination IP address to be used in filtering. 23469 * For IPv4, first four bytes represent the IP address. 23470 */ 23471 uint32_t dst_ipaddr[4]; 23472 /* 23473 * The value of source port to be used in filtering. 23474 * Applies to UDP and TCP traffic. 23475 */ 23476 uint16_t src_port; 23477 /* 23478 * The value of destination port to be used in filtering. 23479 * Applies to UDP and TCP traffic. 23480 */ 23481 uint16_t dst_port; 23482 /* 23483 * If set, this value shall represent the 23484 * Logical VNIC ID of the destination VNIC for the RX 23485 * path and network port id of the destination port for 23486 * the TX path. 23487 */ 23488 uint16_t dst_id; 23489 /* 23490 * Logical VNIC ID of the VNIC where traffic is 23491 * mirrored. 23492 */ 23493 uint16_t mirror_vnic_id; 23494 /* Logical ID of the encapsulation record. */ 23495 uint32_t encap_record_id; 23496 uint8_t unused_2[4]; 23497 } __attribute__((packed)); 23498 23499 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */ 23500 struct hwrm_cfa_em_flow_alloc_output { 23501 /* The specific error status for the command. */ 23502 uint16_t error_code; 23503 /* The HWRM command request type. */ 23504 uint16_t req_type; 23505 /* The sequence ID from the original command. */ 23506 uint16_t seq_id; 23507 /* The length of the response data in number of bytes. */ 23508 uint16_t resp_len; 23509 /* This value is an opaque id into CFA data structures. */ 23510 uint64_t em_filter_id; 23511 /* 23512 * This is the ID of the flow associated with this 23513 * filter. 23514 * This value shall be used to match and associate the 23515 * flow identifier returned in completion records. 23516 * A value of 0xFFFFFFFF shall indicate no flow id. 23517 */ 23518 uint32_t flow_id; 23519 uint8_t unused_0[3]; 23520 /* 23521 * This field is used in Output records to indicate that the output 23522 * is completely written to RAM. This field should be read as '1' 23523 * to indicate that the output has been completely written. 23524 * When writing a command completion or response to an internal processor, 23525 * the order of writes has to be such that this field is written last. 23526 */ 23527 uint8_t valid; 23528 } __attribute__((packed)); 23529 23530 /************************* 23531 * hwrm_cfa_em_flow_free * 23532 *************************/ 23533 23534 23535 /* hwrm_cfa_em_flow_free_input (size:192b/24B) */ 23536 struct hwrm_cfa_em_flow_free_input { 23537 /* The HWRM command request type. */ 23538 uint16_t req_type; 23539 /* 23540 * The completion ring to send the completion event on. This should 23541 * be the NQ ID returned from the `nq_alloc` HWRM command. 23542 */ 23543 uint16_t cmpl_ring; 23544 /* 23545 * The sequence ID is used by the driver for tracking multiple 23546 * commands. This ID is treated as opaque data by the firmware and 23547 * the value is returned in the `hwrm_resp_hdr` upon completion. 23548 */ 23549 uint16_t seq_id; 23550 /* 23551 * The target ID of the command: 23552 * * 0x0-0xFFF8 - The function ID 23553 * * 0xFFF8-0xFFFE - Reserved for internal processors 23554 * * 0xFFFF - HWRM 23555 */ 23556 uint16_t target_id; 23557 /* 23558 * A physical address pointer pointing to a host buffer that the 23559 * command's response data will be written. This can be either a host 23560 * physical address (HPA) or a guest physical address (GPA) and must 23561 * point to a physically contiguous block of memory. 23562 */ 23563 uint64_t resp_addr; 23564 /* This value is an opaque id into CFA data structures. */ 23565 uint64_t em_filter_id; 23566 } __attribute__((packed)); 23567 23568 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */ 23569 struct hwrm_cfa_em_flow_free_output { 23570 /* The specific error status for the command. */ 23571 uint16_t error_code; 23572 /* The HWRM command request type. */ 23573 uint16_t req_type; 23574 /* The sequence ID from the original command. */ 23575 uint16_t seq_id; 23576 /* The length of the response data in number of bytes. */ 23577 uint16_t resp_len; 23578 uint8_t unused_0[7]; 23579 /* 23580 * This field is used in Output records to indicate that the output 23581 * is completely written to RAM. This field should be read as '1' 23582 * to indicate that the output has been completely written. 23583 * When writing a command completion or response to an internal processor, 23584 * the order of writes has to be such that this field is written last. 23585 */ 23586 uint8_t valid; 23587 } __attribute__((packed)); 23588 23589 /******************************* 23590 * hwrm_cfa_decap_filter_alloc * 23591 *******************************/ 23592 23593 23594 /* hwrm_cfa_decap_filter_alloc_input (size:832b/104B) */ 23595 struct hwrm_cfa_decap_filter_alloc_input { 23596 /* The HWRM command request type. */ 23597 uint16_t req_type; 23598 /* 23599 * The completion ring to send the completion event on. This should 23600 * be the NQ ID returned from the `nq_alloc` HWRM command. 23601 */ 23602 uint16_t cmpl_ring; 23603 /* 23604 * The sequence ID is used by the driver for tracking multiple 23605 * commands. This ID is treated as opaque data by the firmware and 23606 * the value is returned in the `hwrm_resp_hdr` upon completion. 23607 */ 23608 uint16_t seq_id; 23609 /* 23610 * The target ID of the command: 23611 * * 0x0-0xFFF8 - The function ID 23612 * * 0xFFF8-0xFFFE - Reserved for internal processors 23613 * * 0xFFFF - HWRM 23614 */ 23615 uint16_t target_id; 23616 /* 23617 * A physical address pointer pointing to a host buffer that the 23618 * command's response data will be written. This can be either a host 23619 * physical address (HPA) or a guest physical address (GPA) and must 23620 * point to a physically contiguous block of memory. 23621 */ 23622 uint64_t resp_addr; 23623 uint32_t flags; 23624 /* ovs_tunnel is 1 b */ 23625 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_FLAGS_OVS_TUNNEL \ 23626 UINT32_C(0x1) 23627 uint32_t enables; 23628 /* 23629 * This bit must be '1' for the tunnel_type field to be 23630 * configured. 23631 */ 23632 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \ 23633 UINT32_C(0x1) 23634 /* 23635 * This bit must be '1' for the tunnel_id field to be 23636 * configured. 23637 */ 23638 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_ID \ 23639 UINT32_C(0x2) 23640 /* 23641 * This bit must be '1' for the src_macaddr field to be 23642 * configured. 23643 */ 23644 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \ 23645 UINT32_C(0x4) 23646 /* 23647 * This bit must be '1' for the dst_macaddr field to be 23648 * configured. 23649 */ 23650 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \ 23651 UINT32_C(0x8) 23652 /* 23653 * This bit must be '1' for the ovlan_vid field to be 23654 * configured. 23655 */ 23656 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_OVLAN_VID \ 23657 UINT32_C(0x10) 23658 /* 23659 * This bit must be '1' for the ivlan_vid field to be 23660 * configured. 23661 */ 23662 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IVLAN_VID \ 23663 UINT32_C(0x20) 23664 /* 23665 * This bit must be '1' for the t_ovlan_vid field to be 23666 * configured. 23667 */ 23668 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_OVLAN_VID \ 23669 UINT32_C(0x40) 23670 /* 23671 * This bit must be '1' for the t_ivlan_vid field to be 23672 * configured. 23673 */ 23674 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_IVLAN_VID \ 23675 UINT32_C(0x80) 23676 /* 23677 * This bit must be '1' for the ethertype field to be 23678 * configured. 23679 */ 23680 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \ 23681 UINT32_C(0x100) 23682 /* 23683 * This bit must be '1' for the src_ipaddr field to be 23684 * configured. 23685 */ 23686 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \ 23687 UINT32_C(0x200) 23688 /* 23689 * This bit must be '1' for the dst_ipaddr field to be 23690 * configured. 23691 */ 23692 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \ 23693 UINT32_C(0x400) 23694 /* 23695 * This bit must be '1' for the ipaddr_type field to be 23696 * configured. 23697 */ 23698 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \ 23699 UINT32_C(0x800) 23700 /* 23701 * This bit must be '1' for the ip_protocol field to be 23702 * configured. 23703 */ 23704 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \ 23705 UINT32_C(0x1000) 23706 /* 23707 * This bit must be '1' for the src_port field to be 23708 * configured. 23709 */ 23710 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \ 23711 UINT32_C(0x2000) 23712 /* 23713 * This bit must be '1' for the dst_port field to be 23714 * configured. 23715 */ 23716 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \ 23717 UINT32_C(0x4000) 23718 /* 23719 * This bit must be '1' for the dst_id field to be 23720 * configured. 23721 */ 23722 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_ID \ 23723 UINT32_C(0x8000) 23724 /* 23725 * This bit must be '1' for the mirror_vnic_id field to be 23726 * configured. 23727 */ 23728 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \ 23729 UINT32_C(0x10000) 23730 /* 23731 * Tunnel identifier. 23732 * Virtual Network Identifier (VNI). Only valid with 23733 * tunnel_types VXLAN, NVGRE, and Geneve. 23734 * Only lower 24-bits of VNI field are used 23735 * in setting up the filter. 23736 */ 23737 uint32_t tunnel_id; 23738 /* Tunnel Type. */ 23739 uint8_t tunnel_type; 23740 /* Non-tunnel */ 23741 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \ 23742 UINT32_C(0x0) 23743 /* Virtual eXtensible Local Area Network (VXLAN) */ 23744 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \ 23745 UINT32_C(0x1) 23746 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */ 23747 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \ 23748 UINT32_C(0x2) 23749 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */ 23750 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \ 23751 UINT32_C(0x3) 23752 /* IP in IP */ 23753 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \ 23754 UINT32_C(0x4) 23755 /* Generic Network Virtualization Encapsulation (Geneve) */ 23756 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \ 23757 UINT32_C(0x5) 23758 /* Multi-Protocol Lable Switching (MPLS) */ 23759 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \ 23760 UINT32_C(0x6) 23761 /* Stateless Transport Tunnel (STT) */ 23762 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \ 23763 UINT32_C(0x7) 23764 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */ 23765 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \ 23766 UINT32_C(0x8) 23767 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 23768 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \ 23769 UINT32_C(0x9) 23770 /* Any tunneled traffic */ 23771 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \ 23772 UINT32_C(0xff) 23773 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \ 23774 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL 23775 uint8_t unused_0; 23776 uint16_t unused_1; 23777 /* 23778 * This value indicates the source MAC address in 23779 * the Ethernet header. 23780 */ 23781 uint8_t src_macaddr[6]; 23782 uint8_t unused_2[2]; 23783 /* 23784 * This value indicates the destination MAC address in 23785 * the Ethernet header. 23786 */ 23787 uint8_t dst_macaddr[6]; 23788 /* 23789 * This value indicates the VLAN ID of the outer VLAN tag 23790 * in the Ethernet header. 23791 */ 23792 uint16_t ovlan_vid; 23793 /* 23794 * This value indicates the VLAN ID of the inner VLAN tag 23795 * in the Ethernet header. 23796 */ 23797 uint16_t ivlan_vid; 23798 /* 23799 * This value indicates the VLAN ID of the outer VLAN tag 23800 * in the tunnel Ethernet header. 23801 */ 23802 uint16_t t_ovlan_vid; 23803 /* 23804 * This value indicates the VLAN ID of the inner VLAN tag 23805 * in the tunnel Ethernet header. 23806 */ 23807 uint16_t t_ivlan_vid; 23808 /* This value indicates the ethertype in the Ethernet header. */ 23809 uint16_t ethertype; 23810 /* 23811 * This value indicates the type of IP address. 23812 * 4 - IPv4 23813 * 6 - IPv6 23814 * All others are invalid. 23815 */ 23816 uint8_t ip_addr_type; 23817 /* invalid */ 23818 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \ 23819 UINT32_C(0x0) 23820 /* IPv4 */ 23821 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \ 23822 UINT32_C(0x4) 23823 /* IPv6 */ 23824 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \ 23825 UINT32_C(0x6) 23826 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \ 23827 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 23828 /* 23829 * The value of protocol filed in IP header. 23830 * Applies to UDP and TCP traffic. 23831 * 6 - TCP 23832 * 17 - UDP 23833 */ 23834 uint8_t ip_protocol; 23835 /* invalid */ 23836 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \ 23837 UINT32_C(0x0) 23838 /* TCP */ 23839 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \ 23840 UINT32_C(0x6) 23841 /* UDP */ 23842 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \ 23843 UINT32_C(0x11) 23844 #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \ 23845 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP 23846 uint16_t unused_3; 23847 uint32_t unused_4; 23848 /* 23849 * The value of source IP address to be used in filtering. 23850 * For IPv4, first four bytes represent the IP address. 23851 */ 23852 uint32_t src_ipaddr[4]; 23853 /* 23854 * The value of destination IP address to be used in filtering. 23855 * For IPv4, first four bytes represent the IP address. 23856 */ 23857 uint32_t dst_ipaddr[4]; 23858 /* 23859 * The value of source port to be used in filtering. 23860 * Applies to UDP and TCP traffic. 23861 */ 23862 uint16_t src_port; 23863 /* 23864 * The value of destination port to be used in filtering. 23865 * Applies to UDP and TCP traffic. 23866 */ 23867 uint16_t dst_port; 23868 /* 23869 * If set, this value shall represent the 23870 * Logical VNIC ID of the destination VNIC for the RX 23871 * path. 23872 */ 23873 uint16_t dst_id; 23874 /* 23875 * If set, this value shall represent the L2 context that matches the L2 23876 * information of the decap filter. 23877 */ 23878 uint16_t l2_ctxt_ref_id; 23879 } __attribute__((packed)); 23880 23881 /* hwrm_cfa_decap_filter_alloc_output (size:128b/16B) */ 23882 struct hwrm_cfa_decap_filter_alloc_output { 23883 /* The specific error status for the command. */ 23884 uint16_t error_code; 23885 /* The HWRM command request type. */ 23886 uint16_t req_type; 23887 /* The sequence ID from the original command. */ 23888 uint16_t seq_id; 23889 /* The length of the response data in number of bytes. */ 23890 uint16_t resp_len; 23891 /* This value is an opaque id into CFA data structures. */ 23892 uint32_t decap_filter_id; 23893 uint8_t unused_0[3]; 23894 /* 23895 * This field is used in Output records to indicate that the output 23896 * is completely written to RAM. This field should be read as '1' 23897 * to indicate that the output has been completely written. 23898 * When writing a command completion or response to an internal processor, 23899 * the order of writes has to be such that this field is written last. 23900 */ 23901 uint8_t valid; 23902 } __attribute__((packed)); 23903 23904 /****************************** 23905 * hwrm_cfa_decap_filter_free * 23906 ******************************/ 23907 23908 23909 /* hwrm_cfa_decap_filter_free_input (size:192b/24B) */ 23910 struct hwrm_cfa_decap_filter_free_input { 23911 /* The HWRM command request type. */ 23912 uint16_t req_type; 23913 /* 23914 * The completion ring to send the completion event on. This should 23915 * be the NQ ID returned from the `nq_alloc` HWRM command. 23916 */ 23917 uint16_t cmpl_ring; 23918 /* 23919 * The sequence ID is used by the driver for tracking multiple 23920 * commands. This ID is treated as opaque data by the firmware and 23921 * the value is returned in the `hwrm_resp_hdr` upon completion. 23922 */ 23923 uint16_t seq_id; 23924 /* 23925 * The target ID of the command: 23926 * * 0x0-0xFFF8 - The function ID 23927 * * 0xFFF8-0xFFFE - Reserved for internal processors 23928 * * 0xFFFF - HWRM 23929 */ 23930 uint16_t target_id; 23931 /* 23932 * A physical address pointer pointing to a host buffer that the 23933 * command's response data will be written. This can be either a host 23934 * physical address (HPA) or a guest physical address (GPA) and must 23935 * point to a physically contiguous block of memory. 23936 */ 23937 uint64_t resp_addr; 23938 /* This value is an opaque id into CFA data structures. */ 23939 uint32_t decap_filter_id; 23940 uint8_t unused_0[4]; 23941 } __attribute__((packed)); 23942 23943 /* hwrm_cfa_decap_filter_free_output (size:128b/16B) */ 23944 struct hwrm_cfa_decap_filter_free_output { 23945 /* The specific error status for the command. */ 23946 uint16_t error_code; 23947 /* The HWRM command request type. */ 23948 uint16_t req_type; 23949 /* The sequence ID from the original command. */ 23950 uint16_t seq_id; 23951 /* The length of the response data in number of bytes. */ 23952 uint16_t resp_len; 23953 uint8_t unused_0[7]; 23954 /* 23955 * This field is used in Output records to indicate that the output 23956 * is completely written to RAM. This field should be read as '1' 23957 * to indicate that the output has been completely written. 23958 * When writing a command completion or response to an internal processor, 23959 * the order of writes has to be such that this field is written last. 23960 */ 23961 uint8_t valid; 23962 } __attribute__((packed)); 23963 23964 /*********************** 23965 * hwrm_cfa_flow_alloc * 23966 ***********************/ 23967 23968 23969 /* hwrm_cfa_flow_alloc_input (size:1024b/128B) */ 23970 struct hwrm_cfa_flow_alloc_input { 23971 /* The HWRM command request type. */ 23972 uint16_t req_type; 23973 /* 23974 * The completion ring to send the completion event on. This should 23975 * be the NQ ID returned from the `nq_alloc` HWRM command. 23976 */ 23977 uint16_t cmpl_ring; 23978 /* 23979 * The sequence ID is used by the driver for tracking multiple 23980 * commands. This ID is treated as opaque data by the firmware and 23981 * the value is returned in the `hwrm_resp_hdr` upon completion. 23982 */ 23983 uint16_t seq_id; 23984 /* 23985 * The target ID of the command: 23986 * * 0x0-0xFFF8 - The function ID 23987 * * 0xFFF8-0xFFFE - Reserved for internal processors 23988 * * 0xFFFF - HWRM 23989 */ 23990 uint16_t target_id; 23991 /* 23992 * A physical address pointer pointing to a host buffer that the 23993 * command's response data will be written. This can be either a host 23994 * physical address (HPA) or a guest physical address (GPA) and must 23995 * point to a physically contiguous block of memory. 23996 */ 23997 uint64_t resp_addr; 23998 uint16_t flags; 23999 /* tunnel is 1 b */ 24000 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_TUNNEL \ 24001 UINT32_C(0x1) 24002 /* num_vlan is 2 b */ 24003 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_MASK \ 24004 UINT32_C(0x6) 24005 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_SFT 1 24006 /* no tags */ 24007 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_NONE \ 24008 (UINT32_C(0x0) << 1) 24009 /* 1 tag */ 24010 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_ONE \ 24011 (UINT32_C(0x1) << 1) 24012 /* 2 tags */ 24013 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO \ 24014 (UINT32_C(0x2) << 1) 24015 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_LAST \ 24016 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO 24017 /* Enumeration denoting the Flow Type. */ 24018 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_MASK \ 24019 UINT32_C(0x38) 24020 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_SFT 3 24021 /* L2 flow */ 24022 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_L2 \ 24023 (UINT32_C(0x0) << 3) 24024 /* IPV4 flow */ 24025 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV4 \ 24026 (UINT32_C(0x1) << 3) 24027 /* IPV6 flow */ 24028 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6 \ 24029 (UINT32_C(0x2) << 3) 24030 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_LAST \ 24031 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6 24032 /* 24033 * when set to 1, indicates TX flow offload for function specified in src_fid and 24034 * the dst_fid should be set to invalid value. To indicate a VM to VM flow, both 24035 * of the path_tx and path_rx flags need to be set. For virtio vSwitch offload 24036 * case, the src_fid and dst_fid is set to the same fid value. For the SRIOV 24037 * vSwitch offload case, the src_fid and dst_fid must be set to the same VF FID 24038 * belong to the children VFs of the same PF to indicate VM to VM flow. 24039 */ 24040 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_TX \ 24041 UINT32_C(0x40) 24042 /* 24043 * when set to 1, indicates RX flow offload for function specified in dst_fid and 24044 * the src_fid should be set to invalid value. 24045 */ 24046 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_RX \ 24047 UINT32_C(0x80) 24048 /* 24049 * Set to 1 to indicate matching of VXLAN VNI from the custom vxlan header is 24050 * required and the VXLAN VNI value is stored in the first 24 bits of the dmac field. 24051 * This flag is only valid when the flow direction is RX. 24052 */ 24053 #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_MATCH_VXLAN_IP_VNI \ 24054 UINT32_C(0x100) 24055 /* 24056 * Tx Flow: vf fid. 24057 * Rx Flow: pf fid. 24058 */ 24059 uint16_t src_fid; 24060 /* Tunnel handle valid when tunnel flag is set. */ 24061 uint32_t tunnel_handle; 24062 uint16_t action_flags; 24063 /* 24064 * Setting of this flag indicates drop action. If this flag is not set, 24065 * then it should be considered accept action. 24066 */ 24067 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FWD \ 24068 UINT32_C(0x1) 24069 /* recycle is 1 b */ 24070 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_RECYCLE \ 24071 UINT32_C(0x2) 24072 /* 24073 * Setting of this flag indicates drop action. If this flag is not set, 24074 * then it should be considered accept action. 24075 */ 24076 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_DROP \ 24077 UINT32_C(0x4) 24078 /* meter is 1 b */ 24079 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_METER \ 24080 UINT32_C(0x8) 24081 /* tunnel is 1 b */ 24082 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL \ 24083 UINT32_C(0x10) 24084 /* nat_src is 1 b */ 24085 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_SRC \ 24086 UINT32_C(0x20) 24087 /* nat_dest is 1 b */ 24088 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_DEST \ 24089 UINT32_C(0x40) 24090 /* nat_ipv4_address is 1 b */ 24091 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_IPV4_ADDRESS \ 24092 UINT32_C(0x80) 24093 /* l2_header_rewrite is 1 b */ 24094 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_L2_HEADER_REWRITE \ 24095 UINT32_C(0x100) 24096 /* ttl_decrement is 1 b */ 24097 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TTL_DECREMENT \ 24098 UINT32_C(0x200) 24099 /* 24100 * If set to 1 and flow direction is TX, it indicates decap of L2 header 24101 * and encap of tunnel header. If set to 1 and flow direction is RX, it 24102 * indicates decap of tunnel header and encap L2 header. The type of tunnel 24103 * is specified in the tunnel_type field. 24104 */ 24105 #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL_IP \ 24106 UINT32_C(0x400) 24107 /* 24108 * Tx Flow: pf or vf fid. 24109 * Rx Flow: vf fid. 24110 */ 24111 uint16_t dst_fid; 24112 /* VLAN tpid, valid when push_vlan flag is set. */ 24113 uint16_t l2_rewrite_vlan_tpid; 24114 /* VLAN tci, valid when push_vlan flag is set. */ 24115 uint16_t l2_rewrite_vlan_tci; 24116 /* Meter id, valid when meter flag is set. */ 24117 uint16_t act_meter_id; 24118 /* Flow with the same l2 context tcam key. */ 24119 uint16_t ref_flow_handle; 24120 /* This value sets the match value for the ethertype. */ 24121 uint16_t ethertype; 24122 /* valid when num tags is 1 or 2. */ 24123 uint16_t outer_vlan_tci; 24124 /* This value sets the match value for the Destination MAC address. */ 24125 uint16_t dmac[3]; 24126 /* valid when num tags is 2. */ 24127 uint16_t inner_vlan_tci; 24128 /* This value sets the match value for the Source MAC address. */ 24129 uint16_t smac[3]; 24130 /* The bit length of destination IP address mask. */ 24131 uint8_t ip_dst_mask_len; 24132 /* The bit length of source IP address mask. */ 24133 uint8_t ip_src_mask_len; 24134 /* The value of destination IPv4/IPv6 address. */ 24135 uint32_t ip_dst[4]; 24136 /* The source IPv4/IPv6 address. */ 24137 uint32_t ip_src[4]; 24138 /* 24139 * The value of source port. 24140 * Applies to UDP and TCP traffic. 24141 */ 24142 uint16_t l4_src_port; 24143 /* 24144 * The value of source port mask. 24145 * Applies to UDP and TCP traffic. 24146 */ 24147 uint16_t l4_src_port_mask; 24148 /* 24149 * The value of destination port. 24150 * Applies to UDP and TCP traffic. 24151 */ 24152 uint16_t l4_dst_port; 24153 /* 24154 * The value of destination port mask. 24155 * Applies to UDP and TCP traffic. 24156 */ 24157 uint16_t l4_dst_port_mask; 24158 /* 24159 * NAT IPv4/6 address based on address type flag. 24160 * 0 values are ignored. 24161 */ 24162 uint32_t nat_ip_address[4]; 24163 /* L2 header re-write Destination MAC address. */ 24164 uint16_t l2_rewrite_dmac[3]; 24165 /* 24166 * The NAT source/destination port based on direction flag. 24167 * Applies to UDP and TCP traffic. 24168 * 0 values are ignored. 24169 */ 24170 uint16_t nat_port; 24171 /* L2 header re-write Source MAC address. */ 24172 uint16_t l2_rewrite_smac[3]; 24173 /* The value of ip protocol. */ 24174 uint8_t ip_proto; 24175 /* Tunnel Type. */ 24176 uint8_t tunnel_type; 24177 /* Non-tunnel */ 24178 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL UINT32_C(0x0) 24179 /* Virtual eXtensible Local Area Network (VXLAN) */ 24180 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1) 24181 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */ 24182 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE UINT32_C(0x2) 24183 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */ 24184 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3) 24185 /* IP in IP */ 24186 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4) 24187 /* Generic Network Virtualization Encapsulation (Geneve) */ 24188 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5) 24189 /* Multi-Protocol Lable Switching (MPLS) */ 24190 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6) 24191 /* Stateless Transport Tunnel (STT) */ 24192 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7) 24193 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */ 24194 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8) 24195 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 24196 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 UINT32_C(0x9) 24197 /* Any tunneled traffic */ 24198 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL UINT32_C(0xff) 24199 #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \ 24200 HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL 24201 } __attribute__((packed)); 24202 24203 /* hwrm_cfa_flow_alloc_output (size:256b/32B) */ 24204 struct hwrm_cfa_flow_alloc_output { 24205 /* The specific error status for the command. */ 24206 uint16_t error_code; 24207 /* The HWRM command request type. */ 24208 uint16_t req_type; 24209 /* The sequence ID from the original command. */ 24210 uint16_t seq_id; 24211 /* The length of the response data in number of bytes. */ 24212 uint16_t resp_len; 24213 /* Flow record index. */ 24214 uint16_t flow_handle; 24215 uint8_t unused_0[2]; 24216 /* 24217 * This is the ID of the flow associated with this 24218 * filter. 24219 * This value shall be used to match and associate the 24220 * flow identifier returned in completion records. 24221 * A value of 0xFFFFFFFF shall indicate no flow id. 24222 */ 24223 uint32_t flow_id; 24224 /* This value identifies a set of CFA data structures used for a flow. */ 24225 uint64_t ext_flow_handle; 24226 uint8_t unused_1[7]; 24227 /* 24228 * This field is used in Output records to indicate that the output 24229 * is completely written to RAM. This field should be read as '1' 24230 * to indicate that the output has been completely written. 24231 * When writing a command completion or response to an internal processor, 24232 * the order of writes has to be such that this field is written last. 24233 */ 24234 uint8_t valid; 24235 } __attribute__((packed)); 24236 24237 /********************** 24238 * hwrm_cfa_flow_free * 24239 **********************/ 24240 24241 24242 /* hwrm_cfa_flow_free_input (size:256b/32B) */ 24243 struct hwrm_cfa_flow_free_input { 24244 /* The HWRM command request type. */ 24245 uint16_t req_type; 24246 /* 24247 * The completion ring to send the completion event on. This should 24248 * be the NQ ID returned from the `nq_alloc` HWRM command. 24249 */ 24250 uint16_t cmpl_ring; 24251 /* 24252 * The sequence ID is used by the driver for tracking multiple 24253 * commands. This ID is treated as opaque data by the firmware and 24254 * the value is returned in the `hwrm_resp_hdr` upon completion. 24255 */ 24256 uint16_t seq_id; 24257 /* 24258 * The target ID of the command: 24259 * * 0x0-0xFFF8 - The function ID 24260 * * 0xFFF8-0xFFFE - Reserved for internal processors 24261 * * 0xFFFF - HWRM 24262 */ 24263 uint16_t target_id; 24264 /* 24265 * A physical address pointer pointing to a host buffer that the 24266 * command's response data will be written. This can be either a host 24267 * physical address (HPA) or a guest physical address (GPA) and must 24268 * point to a physically contiguous block of memory. 24269 */ 24270 uint64_t resp_addr; 24271 /* Flow record index. */ 24272 uint16_t flow_handle; 24273 uint8_t unused_0[6]; 24274 /* This value identifies a set of CFA data structures used for a flow. */ 24275 uint64_t ext_flow_handle; 24276 } __attribute__((packed)); 24277 24278 /* hwrm_cfa_flow_free_output (size:256b/32B) */ 24279 struct hwrm_cfa_flow_free_output { 24280 /* The specific error status for the command. */ 24281 uint16_t error_code; 24282 /* The HWRM command request type. */ 24283 uint16_t req_type; 24284 /* The sequence ID from the original command. */ 24285 uint16_t seq_id; 24286 /* The length of the response data in number of bytes. */ 24287 uint16_t resp_len; 24288 /* packet is 64 b */ 24289 uint64_t packet; 24290 /* byte is 64 b */ 24291 uint64_t byte; 24292 uint8_t unused_0[7]; 24293 /* 24294 * This field is used in Output records to indicate that the output 24295 * is completely written to RAM. This field should be read as '1' 24296 * to indicate that the output has been completely written. 24297 * When writing a command completion or response to an internal processor, 24298 * the order of writes has to be such that this field is written last. 24299 */ 24300 uint8_t valid; 24301 } __attribute__((packed)); 24302 24303 /*********************** 24304 * hwrm_cfa_flow_flush * 24305 ***********************/ 24306 24307 24308 /* hwrm_cfa_flow_flush_input (size:192b/24B) */ 24309 struct hwrm_cfa_flow_flush_input { 24310 /* The HWRM command request type. */ 24311 uint16_t req_type; 24312 /* 24313 * The completion ring to send the completion event on. This should 24314 * be the NQ ID returned from the `nq_alloc` HWRM command. 24315 */ 24316 uint16_t cmpl_ring; 24317 /* 24318 * The sequence ID is used by the driver for tracking multiple 24319 * commands. This ID is treated as opaque data by the firmware and 24320 * the value is returned in the `hwrm_resp_hdr` upon completion. 24321 */ 24322 uint16_t seq_id; 24323 /* 24324 * The target ID of the command: 24325 * * 0x0-0xFFF8 - The function ID 24326 * * 0xFFF8-0xFFFE - Reserved for internal processors 24327 * * 0xFFFF - HWRM 24328 */ 24329 uint16_t target_id; 24330 /* 24331 * A physical address pointer pointing to a host buffer that the 24332 * command's response data will be written. This can be either a host 24333 * physical address (HPA) or a guest physical address (GPA) and must 24334 * point to a physically contiguous block of memory. 24335 */ 24336 uint64_t resp_addr; 24337 uint32_t flags; 24338 uint8_t unused_0[4]; 24339 } __attribute__((packed)); 24340 24341 /* hwrm_cfa_flow_flush_output (size:128b/16B) */ 24342 struct hwrm_cfa_flow_flush_output { 24343 /* The specific error status for the command. */ 24344 uint16_t error_code; 24345 /* The HWRM command request type. */ 24346 uint16_t req_type; 24347 /* The sequence ID from the original command. */ 24348 uint16_t seq_id; 24349 /* The length of the response data in number of bytes. */ 24350 uint16_t resp_len; 24351 uint8_t unused_0[7]; 24352 /* 24353 * This field is used in Output records to indicate that the output 24354 * is completely written to RAM. This field should be read as '1' 24355 * to indicate that the output has been completely written. 24356 * When writing a command completion or response to an internal processor, 24357 * the order of writes has to be such that this field is written last. 24358 */ 24359 uint8_t valid; 24360 } __attribute__((packed)); 24361 24362 /*********************** 24363 * hwrm_cfa_flow_stats * 24364 ***********************/ 24365 24366 24367 /* hwrm_cfa_flow_stats_input (size:640b/80B) */ 24368 struct hwrm_cfa_flow_stats_input { 24369 /* The HWRM command request type. */ 24370 uint16_t req_type; 24371 /* 24372 * The completion ring to send the completion event on. This should 24373 * be the NQ ID returned from the `nq_alloc` HWRM command. 24374 */ 24375 uint16_t cmpl_ring; 24376 /* 24377 * The sequence ID is used by the driver for tracking multiple 24378 * commands. This ID is treated as opaque data by the firmware and 24379 * the value is returned in the `hwrm_resp_hdr` upon completion. 24380 */ 24381 uint16_t seq_id; 24382 /* 24383 * The target ID of the command: 24384 * * 0x0-0xFFF8 - The function ID 24385 * * 0xFFF8-0xFFFE - Reserved for internal processors 24386 * * 0xFFFF - HWRM 24387 */ 24388 uint16_t target_id; 24389 /* 24390 * A physical address pointer pointing to a host buffer that the 24391 * command's response data will be written. This can be either a host 24392 * physical address (HPA) or a guest physical address (GPA) and must 24393 * point to a physically contiguous block of memory. 24394 */ 24395 uint64_t resp_addr; 24396 /* Flow handle. */ 24397 uint16_t num_flows; 24398 /* Flow handle. */ 24399 uint16_t flow_handle_0; 24400 /* Flow handle. */ 24401 uint16_t flow_handle_1; 24402 /* Flow handle. */ 24403 uint16_t flow_handle_2; 24404 /* Flow handle. */ 24405 uint16_t flow_handle_3; 24406 /* Flow handle. */ 24407 uint16_t flow_handle_4; 24408 /* Flow handle. */ 24409 uint16_t flow_handle_5; 24410 /* Flow handle. */ 24411 uint16_t flow_handle_6; 24412 /* Flow handle. */ 24413 uint16_t flow_handle_7; 24414 /* Flow handle. */ 24415 uint16_t flow_handle_8; 24416 /* Flow handle. */ 24417 uint16_t flow_handle_9; 24418 uint8_t unused_0[2]; 24419 /* Flow ID of a flow. */ 24420 uint32_t flow_id_0; 24421 /* Flow ID of a flow. */ 24422 uint32_t flow_id_1; 24423 /* Flow ID of a flow. */ 24424 uint32_t flow_id_2; 24425 /* Flow ID of a flow. */ 24426 uint32_t flow_id_3; 24427 /* Flow ID of a flow. */ 24428 uint32_t flow_id_4; 24429 /* Flow ID of a flow. */ 24430 uint32_t flow_id_5; 24431 /* Flow ID of a flow. */ 24432 uint32_t flow_id_6; 24433 /* Flow ID of a flow. */ 24434 uint32_t flow_id_7; 24435 /* Flow ID of a flow. */ 24436 uint32_t flow_id_8; 24437 /* Flow ID of a flow. */ 24438 uint32_t flow_id_9; 24439 } __attribute__((packed)); 24440 24441 /* hwrm_cfa_flow_stats_output (size:1408b/176B) */ 24442 struct hwrm_cfa_flow_stats_output { 24443 /* The specific error status for the command. */ 24444 uint16_t error_code; 24445 /* The HWRM command request type. */ 24446 uint16_t req_type; 24447 /* The sequence ID from the original command. */ 24448 uint16_t seq_id; 24449 /* The length of the response data in number of bytes. */ 24450 uint16_t resp_len; 24451 /* packet_0 is 64 b */ 24452 uint64_t packet_0; 24453 /* packet_1 is 64 b */ 24454 uint64_t packet_1; 24455 /* packet_2 is 64 b */ 24456 uint64_t packet_2; 24457 /* packet_3 is 64 b */ 24458 uint64_t packet_3; 24459 /* packet_4 is 64 b */ 24460 uint64_t packet_4; 24461 /* packet_5 is 64 b */ 24462 uint64_t packet_5; 24463 /* packet_6 is 64 b */ 24464 uint64_t packet_6; 24465 /* packet_7 is 64 b */ 24466 uint64_t packet_7; 24467 /* packet_8 is 64 b */ 24468 uint64_t packet_8; 24469 /* packet_9 is 64 b */ 24470 uint64_t packet_9; 24471 /* byte_0 is 64 b */ 24472 uint64_t byte_0; 24473 /* byte_1 is 64 b */ 24474 uint64_t byte_1; 24475 /* byte_2 is 64 b */ 24476 uint64_t byte_2; 24477 /* byte_3 is 64 b */ 24478 uint64_t byte_3; 24479 /* byte_4 is 64 b */ 24480 uint64_t byte_4; 24481 /* byte_5 is 64 b */ 24482 uint64_t byte_5; 24483 /* byte_6 is 64 b */ 24484 uint64_t byte_6; 24485 /* byte_7 is 64 b */ 24486 uint64_t byte_7; 24487 /* byte_8 is 64 b */ 24488 uint64_t byte_8; 24489 /* byte_9 is 64 b */ 24490 uint64_t byte_9; 24491 uint8_t unused_0[7]; 24492 /* 24493 * This field is used in Output records to indicate that the output 24494 * is completely written to RAM. This field should be read as '1' 24495 * to indicate that the output has been completely written. 24496 * When writing a command completion or response to an internal processor, 24497 * the order of writes has to be such that this field is written last. 24498 */ 24499 uint8_t valid; 24500 } __attribute__((packed)); 24501 24502 /********************** 24503 * hwrm_cfa_pair_info * 24504 **********************/ 24505 24506 24507 /* hwrm_cfa_pair_info_input (size:448b/56B) */ 24508 struct hwrm_cfa_pair_info_input { 24509 /* The HWRM command request type. */ 24510 uint16_t req_type; 24511 /* 24512 * The completion ring to send the completion event on. This should 24513 * be the NQ ID returned from the `nq_alloc` HWRM command. 24514 */ 24515 uint16_t cmpl_ring; 24516 /* 24517 * The sequence ID is used by the driver for tracking multiple 24518 * commands. This ID is treated as opaque data by the firmware and 24519 * the value is returned in the `hwrm_resp_hdr` upon completion. 24520 */ 24521 uint16_t seq_id; 24522 /* 24523 * The target ID of the command: 24524 * * 0x0-0xFFF8 - The function ID 24525 * * 0xFFF8-0xFFFE - Reserved for internal processors 24526 * * 0xFFFF - HWRM 24527 */ 24528 uint16_t target_id; 24529 /* 24530 * A physical address pointer pointing to a host buffer that the 24531 * command's response data will be written. This can be either a host 24532 * physical address (HPA) or a guest physical address (GPA) and must 24533 * point to a physically contiguous block of memory. 24534 */ 24535 uint64_t resp_addr; 24536 uint32_t flags; 24537 /* If this flag is set, lookup by name else lookup by index. */ 24538 #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE UINT32_C(0x1) 24539 /* If this flag is set, lookup by PF id and VF id. */ 24540 #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_REPRE UINT32_C(0x2) 24541 /* Pair table index. */ 24542 uint16_t pair_index; 24543 /* Pair pf index. */ 24544 uint8_t pair_pfid; 24545 /* Pair vf index. */ 24546 uint8_t pair_vfid; 24547 /* Pair name (32 byte string). */ 24548 char pair_name[32]; 24549 } __attribute__((packed)); 24550 24551 /* hwrm_cfa_pair_info_output (size:576b/72B) */ 24552 struct hwrm_cfa_pair_info_output { 24553 /* The specific error status for the command. */ 24554 uint16_t error_code; 24555 /* The HWRM command request type. */ 24556 uint16_t req_type; 24557 /* The sequence ID from the original command. */ 24558 uint16_t seq_id; 24559 /* The length of the response data in number of bytes. */ 24560 uint16_t resp_len; 24561 /* Pair table index. */ 24562 uint16_t next_pair_index; 24563 /* Pair member a's fid. */ 24564 uint16_t a_fid; 24565 /* Logical host number. */ 24566 uint8_t host_a_index; 24567 /* Logical PF number. */ 24568 uint8_t pf_a_index; 24569 /* Pair member a's Linux logical VF number. */ 24570 uint16_t vf_a_index; 24571 /* Rx CFA code. */ 24572 uint16_t rx_cfa_code_a; 24573 /* Tx CFA action. */ 24574 uint16_t tx_cfa_action_a; 24575 /* Pair member b's fid. */ 24576 uint16_t b_fid; 24577 /* Logical host number. */ 24578 uint8_t host_b_index; 24579 /* Logical PF number. */ 24580 uint8_t pf_b_index; 24581 /* Pair member a's Linux logical VF number. */ 24582 uint16_t vf_b_index; 24583 /* Rx CFA code. */ 24584 uint16_t rx_cfa_code_b; 24585 /* Tx CFA action. */ 24586 uint16_t tx_cfa_action_b; 24587 /* Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair). */ 24588 uint8_t pair_mode; 24589 /* Pair between VF on local host with PF or VF on specified host. */ 24590 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_VF2FN UINT32_C(0x0) 24591 /* Pair between REP on local host with PF or VF on specified host. */ 24592 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2FN UINT32_C(0x1) 24593 /* Pair between REP on local host with REP on specified host. */ 24594 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2REP UINT32_C(0x2) 24595 /* Pair for the proxy interface. */ 24596 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PROXY UINT32_C(0x3) 24597 /* Pair for the PF interface. */ 24598 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR UINT32_C(0x4) 24599 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_LAST \ 24600 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR 24601 /* Pair state. */ 24602 uint8_t pair_state; 24603 /* Pair has been allocated */ 24604 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1) 24605 /* Both pair members are active */ 24606 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE UINT32_C(0x2) 24607 #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_LAST \ 24608 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE 24609 /* Pair name (32 byte string). */ 24610 char pair_name[32]; 24611 uint8_t unused_0[7]; 24612 /* 24613 * This field is used in Output records to indicate that the output 24614 * is completely written to RAM. This field should be read as '1' 24615 * to indicate that the output has been completely written. 24616 * When writing a command completion or response to an internal processor, 24617 * the order of writes has to be such that this field is written last. 24618 */ 24619 uint8_t valid; 24620 } __attribute__((packed)); 24621 24622 /*************************************** 24623 * hwrm_cfa_redirect_query_tunnel_type * 24624 ***************************************/ 24625 24626 24627 /* hwrm_cfa_redirect_query_tunnel_type_input (size:192b/24B) */ 24628 struct hwrm_cfa_redirect_query_tunnel_type_input { 24629 /* The HWRM command request type. */ 24630 uint16_t req_type; 24631 /* 24632 * The completion ring to send the completion event on. This should 24633 * be the NQ ID returned from the `nq_alloc` HWRM command. 24634 */ 24635 uint16_t cmpl_ring; 24636 /* 24637 * The sequence ID is used by the driver for tracking multiple 24638 * commands. This ID is treated as opaque data by the firmware and 24639 * the value is returned in the `hwrm_resp_hdr` upon completion. 24640 */ 24641 uint16_t seq_id; 24642 /* 24643 * The target ID of the command: 24644 * * 0x0-0xFFF8 - The function ID 24645 * * 0xFFF8-0xFFFE - Reserved for internal processors 24646 * * 0xFFFF - HWRM 24647 */ 24648 uint16_t target_id; 24649 /* 24650 * A physical address pointer pointing to a host buffer that the 24651 * command's response data will be written. This can be either a host 24652 * physical address (HPA) or a guest physical address (GPA) and must 24653 * point to a physically contiguous block of memory. 24654 */ 24655 uint64_t resp_addr; 24656 /* The source function id. */ 24657 uint16_t src_fid; 24658 uint8_t unused_0[6]; 24659 } __attribute__((packed)); 24660 24661 /* hwrm_cfa_redirect_query_tunnel_type_output (size:128b/16B) */ 24662 struct hwrm_cfa_redirect_query_tunnel_type_output { 24663 /* The specific error status for the command. */ 24664 uint16_t error_code; 24665 /* The HWRM command request type. */ 24666 uint16_t req_type; 24667 /* The sequence ID from the original command. */ 24668 uint16_t seq_id; 24669 /* The length of the response data in number of bytes. */ 24670 uint16_t resp_len; 24671 /* Tunnel Mask. */ 24672 uint32_t tunnel_mask; 24673 /* Non-tunnel */ 24674 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NONTUNNEL \ 24675 UINT32_C(0x1) 24676 /* Virtual eXtensible Local Area Network (VXLAN) */ 24677 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN \ 24678 UINT32_C(0x2) 24679 /* Network Virtualization Generic Routing Encapsulation (NVGRE) */ 24680 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NVGRE \ 24681 UINT32_C(0x4) 24682 /* Generic Routing Encapsulation (GRE) inside Ethernet payload */ 24683 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2GRE \ 24684 UINT32_C(0x8) 24685 /* IP in IP */ 24686 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPIP \ 24687 UINT32_C(0x10) 24688 /* Generic Network Virtualization Encapsulation (Geneve) */ 24689 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_GENEVE \ 24690 UINT32_C(0x20) 24691 /* Multi-Protocol Lable Switching (MPLS) */ 24692 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_MPLS \ 24693 UINT32_C(0x40) 24694 /* Stateless Transport Tunnel (STT) */ 24695 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_STT \ 24696 UINT32_C(0x80) 24697 /* Generic Routing Encapsulation (GRE) inside IP datagram payload */ 24698 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE \ 24699 UINT32_C(0x100) 24700 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 24701 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_V4 \ 24702 UINT32_C(0x200) 24703 /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */ 24704 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE_V1 \ 24705 UINT32_C(0x400) 24706 /* Any tunneled traffic */ 24707 #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_ANYTUNNEL \ 24708 UINT32_C(0x800) 24709 uint8_t unused_0[3]; 24710 /* 24711 * This field is used in Output records to indicate that the output 24712 * is completely written to RAM. This field should be read as '1' 24713 * to indicate that the output has been completely written. 24714 * When writing a command completion or response to an internal processor, 24715 * the order of writes has to be such that this field is written last. 24716 */ 24717 uint8_t valid; 24718 } __attribute__((packed)); 24719 24720 /****************************** 24721 * hwrm_tunnel_dst_port_query * 24722 ******************************/ 24723 24724 24725 /* hwrm_tunnel_dst_port_query_input (size:192b/24B) */ 24726 struct hwrm_tunnel_dst_port_query_input { 24727 /* The HWRM command request type. */ 24728 uint16_t req_type; 24729 /* 24730 * The completion ring to send the completion event on. This should 24731 * be the NQ ID returned from the `nq_alloc` HWRM command. 24732 */ 24733 uint16_t cmpl_ring; 24734 /* 24735 * The sequence ID is used by the driver for tracking multiple 24736 * commands. This ID is treated as opaque data by the firmware and 24737 * the value is returned in the `hwrm_resp_hdr` upon completion. 24738 */ 24739 uint16_t seq_id; 24740 /* 24741 * The target ID of the command: 24742 * * 0x0-0xFFF8 - The function ID 24743 * * 0xFFF8-0xFFFE - Reserved for internal processors 24744 * * 0xFFFF - HWRM 24745 */ 24746 uint16_t target_id; 24747 /* 24748 * A physical address pointer pointing to a host buffer that the 24749 * command's response data will be written. This can be either a host 24750 * physical address (HPA) or a guest physical address (GPA) and must 24751 * point to a physically contiguous block of memory. 24752 */ 24753 uint64_t resp_addr; 24754 /* Tunnel Type. */ 24755 uint8_t tunnel_type; 24756 /* Virtual eXtensible Local Area Network (VXLAN) */ 24757 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN \ 24758 UINT32_C(0x1) 24759 /* Generic Network Virtualization Encapsulation (Geneve) */ 24760 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE \ 24761 UINT32_C(0x5) 24762 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 24763 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4 \ 24764 UINT32_C(0x9) 24765 /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */ 24766 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1 \ 24767 UINT32_C(0xa) 24768 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST \ 24769 HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1 24770 uint8_t unused_0[7]; 24771 } __attribute__((packed)); 24772 24773 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */ 24774 struct hwrm_tunnel_dst_port_query_output { 24775 /* The specific error status for the command. */ 24776 uint16_t error_code; 24777 /* The HWRM command request type. */ 24778 uint16_t req_type; 24779 /* The sequence ID from the original command. */ 24780 uint16_t seq_id; 24781 /* The length of the response data in number of bytes. */ 24782 uint16_t resp_len; 24783 /* 24784 * This field represents the identifier of L4 destination port 24785 * used for the given tunnel type. This field is valid for 24786 * specific tunnel types that use layer 4 (e.g. UDP) 24787 * transports for tunneling. 24788 */ 24789 uint16_t tunnel_dst_port_id; 24790 /* 24791 * This field represents the value of L4 destination port 24792 * identified by tunnel_dst_port_id. This field is valid for 24793 * specific tunnel types that use layer 4 (e.g. UDP) 24794 * transports for tunneling. 24795 * This field is in network byte order. 24796 * 24797 * A value of 0 means that the destination port is not 24798 * configured. 24799 */ 24800 uint16_t tunnel_dst_port_val; 24801 uint8_t unused_0[3]; 24802 /* 24803 * This field is used in Output records to indicate that the output 24804 * is completely written to RAM. This field should be read as '1' 24805 * to indicate that the output has been completely written. 24806 * When writing a command completion or response to an internal processor, 24807 * the order of writes has to be such that this field is written last. 24808 */ 24809 uint8_t valid; 24810 } __attribute__((packed)); 24811 24812 /****************************** 24813 * hwrm_tunnel_dst_port_alloc * 24814 ******************************/ 24815 24816 24817 /* hwrm_tunnel_dst_port_alloc_input (size:192b/24B) */ 24818 struct hwrm_tunnel_dst_port_alloc_input { 24819 /* The HWRM command request type. */ 24820 uint16_t req_type; 24821 /* 24822 * The completion ring to send the completion event on. This should 24823 * be the NQ ID returned from the `nq_alloc` HWRM command. 24824 */ 24825 uint16_t cmpl_ring; 24826 /* 24827 * The sequence ID is used by the driver for tracking multiple 24828 * commands. This ID is treated as opaque data by the firmware and 24829 * the value is returned in the `hwrm_resp_hdr` upon completion. 24830 */ 24831 uint16_t seq_id; 24832 /* 24833 * The target ID of the command: 24834 * * 0x0-0xFFF8 - The function ID 24835 * * 0xFFF8-0xFFFE - Reserved for internal processors 24836 * * 0xFFFF - HWRM 24837 */ 24838 uint16_t target_id; 24839 /* 24840 * A physical address pointer pointing to a host buffer that the 24841 * command's response data will be written. This can be either a host 24842 * physical address (HPA) or a guest physical address (GPA) and must 24843 * point to a physically contiguous block of memory. 24844 */ 24845 uint64_t resp_addr; 24846 /* Tunnel Type. */ 24847 uint8_t tunnel_type; 24848 /* Virtual eXtensible Local Area Network (VXLAN) */ 24849 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \ 24850 UINT32_C(0x1) 24851 /* Generic Network Virtualization Encapsulation (Geneve) */ 24852 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \ 24853 UINT32_C(0x5) 24854 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 24855 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \ 24856 UINT32_C(0x9) 24857 /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */ 24858 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \ 24859 UINT32_C(0xa) 24860 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_LAST \ 24861 HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 24862 uint8_t unused_0; 24863 /* 24864 * This field represents the value of L4 destination port used 24865 * for the given tunnel type. This field is valid for 24866 * specific tunnel types that use layer 4 (e.g. UDP) 24867 * transports for tunneling. 24868 * 24869 * This field is in network byte order. 24870 * 24871 * A value of 0 shall fail the command. 24872 */ 24873 uint16_t tunnel_dst_port_val; 24874 uint8_t unused_1[4]; 24875 } __attribute__((packed)); 24876 24877 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */ 24878 struct hwrm_tunnel_dst_port_alloc_output { 24879 /* The specific error status for the command. */ 24880 uint16_t error_code; 24881 /* The HWRM command request type. */ 24882 uint16_t req_type; 24883 /* The sequence ID from the original command. */ 24884 uint16_t seq_id; 24885 /* The length of the response data in number of bytes. */ 24886 uint16_t resp_len; 24887 /* 24888 * Identifier of a tunnel L4 destination port value. Only applies to tunnel 24889 * types that has l4 destination port parameters. 24890 */ 24891 uint16_t tunnel_dst_port_id; 24892 uint8_t unused_0[5]; 24893 /* 24894 * This field is used in Output records to indicate that the output 24895 * is completely written to RAM. This field should be read as '1' 24896 * to indicate that the output has been completely written. 24897 * When writing a command completion or response to an internal processor, 24898 * the order of writes has to be such that this field is written last. 24899 */ 24900 uint8_t valid; 24901 } __attribute__((packed)); 24902 24903 /***************************** 24904 * hwrm_tunnel_dst_port_free * 24905 *****************************/ 24906 24907 24908 /* hwrm_tunnel_dst_port_free_input (size:192b/24B) */ 24909 struct hwrm_tunnel_dst_port_free_input { 24910 /* The HWRM command request type. */ 24911 uint16_t req_type; 24912 /* 24913 * The completion ring to send the completion event on. This should 24914 * be the NQ ID returned from the `nq_alloc` HWRM command. 24915 */ 24916 uint16_t cmpl_ring; 24917 /* 24918 * The sequence ID is used by the driver for tracking multiple 24919 * commands. This ID is treated as opaque data by the firmware and 24920 * the value is returned in the `hwrm_resp_hdr` upon completion. 24921 */ 24922 uint16_t seq_id; 24923 /* 24924 * The target ID of the command: 24925 * * 0x0-0xFFF8 - The function ID 24926 * * 0xFFF8-0xFFFE - Reserved for internal processors 24927 * * 0xFFFF - HWRM 24928 */ 24929 uint16_t target_id; 24930 /* 24931 * A physical address pointer pointing to a host buffer that the 24932 * command's response data will be written. This can be either a host 24933 * physical address (HPA) or a guest physical address (GPA) and must 24934 * point to a physically contiguous block of memory. 24935 */ 24936 uint64_t resp_addr; 24937 /* Tunnel Type. */ 24938 uint8_t tunnel_type; 24939 /* Virtual eXtensible Local Area Network (VXLAN) */ 24940 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN \ 24941 UINT32_C(0x1) 24942 /* Generic Network Virtualization Encapsulation (Geneve) */ 24943 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE \ 24944 UINT32_C(0x5) 24945 /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */ 24946 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \ 24947 UINT32_C(0x9) 24948 /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */ 24949 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \ 24950 UINT32_C(0xa) 24951 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_LAST \ 24952 HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 24953 uint8_t unused_0; 24954 /* 24955 * Identifier of a tunnel L4 destination port value. Only applies to tunnel 24956 * types that has l4 destination port parameters. 24957 */ 24958 uint16_t tunnel_dst_port_id; 24959 uint8_t unused_1[4]; 24960 } __attribute__((packed)); 24961 24962 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */ 24963 struct hwrm_tunnel_dst_port_free_output { 24964 /* The specific error status for the command. */ 24965 uint16_t error_code; 24966 /* The HWRM command request type. */ 24967 uint16_t req_type; 24968 /* The sequence ID from the original command. */ 24969 uint16_t seq_id; 24970 /* The length of the response data in number of bytes. */ 24971 uint16_t resp_len; 24972 uint8_t unused_1[7]; 24973 /* 24974 * This field is used in Output records to indicate that the output 24975 * is completely written to RAM. This field should be read as '1' 24976 * to indicate that the output has been completely written. 24977 * When writing a command completion or response to an internal processor, 24978 * the order of writes has to be such that this field is written last. 24979 */ 24980 uint8_t valid; 24981 } __attribute__((packed)); 24982 24983 /* Periodic statistics context DMA to host. */ 24984 /* ctx_hw_stats (size:1280b/160B) */ 24985 struct ctx_hw_stats { 24986 /* Number of received unicast packets */ 24987 uint64_t rx_ucast_pkts; 24988 /* Number of received multicast packets */ 24989 uint64_t rx_mcast_pkts; 24990 /* Number of received broadcast packets */ 24991 uint64_t rx_bcast_pkts; 24992 /* Number of discarded packets on received path */ 24993 uint64_t rx_discard_pkts; 24994 /* Number of dropped packets on received path */ 24995 uint64_t rx_drop_pkts; 24996 /* Number of received bytes for unicast traffic */ 24997 uint64_t rx_ucast_bytes; 24998 /* Number of received bytes for multicast traffic */ 24999 uint64_t rx_mcast_bytes; 25000 /* Number of received bytes for broadcast traffic */ 25001 uint64_t rx_bcast_bytes; 25002 /* Number of transmitted unicast packets */ 25003 uint64_t tx_ucast_pkts; 25004 /* Number of transmitted multicast packets */ 25005 uint64_t tx_mcast_pkts; 25006 /* Number of transmitted broadcast packets */ 25007 uint64_t tx_bcast_pkts; 25008 /* Number of discarded packets on transmit path */ 25009 uint64_t tx_discard_pkts; 25010 /* Number of dropped packets on transmit path */ 25011 uint64_t tx_drop_pkts; 25012 /* Number of transmitted bytes for unicast traffic */ 25013 uint64_t tx_ucast_bytes; 25014 /* Number of transmitted bytes for multicast traffic */ 25015 uint64_t tx_mcast_bytes; 25016 /* Number of transmitted bytes for broadcast traffic */ 25017 uint64_t tx_bcast_bytes; 25018 /* Number of TPA packets */ 25019 uint64_t tpa_pkts; 25020 /* Number of TPA bytes */ 25021 uint64_t tpa_bytes; 25022 /* Number of TPA events */ 25023 uint64_t tpa_events; 25024 /* Number of TPA aborts */ 25025 uint64_t tpa_aborts; 25026 } __attribute__((packed)); 25027 25028 /*********************** 25029 * hwrm_stat_ctx_alloc * 25030 ***********************/ 25031 25032 25033 /* hwrm_stat_ctx_alloc_input (size:256b/32B) */ 25034 struct hwrm_stat_ctx_alloc_input { 25035 /* The HWRM command request type. */ 25036 uint16_t req_type; 25037 /* 25038 * The completion ring to send the completion event on. This should 25039 * be the NQ ID returned from the `nq_alloc` HWRM command. 25040 */ 25041 uint16_t cmpl_ring; 25042 /* 25043 * The sequence ID is used by the driver for tracking multiple 25044 * commands. This ID is treated as opaque data by the firmware and 25045 * the value is returned in the `hwrm_resp_hdr` upon completion. 25046 */ 25047 uint16_t seq_id; 25048 /* 25049 * The target ID of the command: 25050 * * 0x0-0xFFF8 - The function ID 25051 * * 0xFFF8-0xFFFE - Reserved for internal processors 25052 * * 0xFFFF - HWRM 25053 */ 25054 uint16_t target_id; 25055 /* 25056 * A physical address pointer pointing to a host buffer that the 25057 * command's response data will be written. This can be either a host 25058 * physical address (HPA) or a guest physical address (GPA) and must 25059 * point to a physically contiguous block of memory. 25060 */ 25061 uint64_t resp_addr; 25062 /* This is the address for statistic block. */ 25063 uint64_t stats_dma_addr; 25064 /* 25065 * The statistic block update period in ms. 25066 * e.g. 250ms, 500ms, 750ms, 1000ms. 25067 * If update_period_ms is 0, then the stats update 25068 * shall be never done and the DMA address shall not be used. 25069 * In this case, the stat block can only be read by 25070 * hwrm_stat_ctx_query command. 25071 */ 25072 uint32_t update_period_ms; 25073 /* 25074 * This field is used to specify statistics context specific 25075 * configuration flags. 25076 */ 25077 uint8_t stat_ctx_flags; 25078 /* 25079 * When this bit is set to '1', the statistics context shall be 25080 * allocated for RoCE traffic only. In this case, traffic other 25081 * than offloaded RoCE traffic shall not be included in this 25082 * statistic context. 25083 * When this bit is set to '0', the statistics context shall be 25084 * used for the network traffic other than offloaded RoCE traffic. 25085 */ 25086 #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE UINT32_C(0x1) 25087 uint8_t unused_0[3]; 25088 } __attribute__((packed)); 25089 25090 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */ 25091 struct hwrm_stat_ctx_alloc_output { 25092 /* The specific error status for the command. */ 25093 uint16_t error_code; 25094 /* The HWRM command request type. */ 25095 uint16_t req_type; 25096 /* The sequence ID from the original command. */ 25097 uint16_t seq_id; 25098 /* The length of the response data in number of bytes. */ 25099 uint16_t resp_len; 25100 /* This is the statistics context ID value. */ 25101 uint32_t stat_ctx_id; 25102 uint8_t unused_0[3]; 25103 /* 25104 * This field is used in Output records to indicate that the output 25105 * is completely written to RAM. This field should be read as '1' 25106 * to indicate that the output has been completely written. 25107 * When writing a command completion or response to an internal processor, 25108 * the order of writes has to be such that this field is written last. 25109 */ 25110 uint8_t valid; 25111 } __attribute__((packed)); 25112 25113 /********************** 25114 * hwrm_stat_ctx_free * 25115 **********************/ 25116 25117 25118 /* hwrm_stat_ctx_free_input (size:192b/24B) */ 25119 struct hwrm_stat_ctx_free_input { 25120 /* The HWRM command request type. */ 25121 uint16_t req_type; 25122 /* 25123 * The completion ring to send the completion event on. This should 25124 * be the NQ ID returned from the `nq_alloc` HWRM command. 25125 */ 25126 uint16_t cmpl_ring; 25127 /* 25128 * The sequence ID is used by the driver for tracking multiple 25129 * commands. This ID is treated as opaque data by the firmware and 25130 * the value is returned in the `hwrm_resp_hdr` upon completion. 25131 */ 25132 uint16_t seq_id; 25133 /* 25134 * The target ID of the command: 25135 * * 0x0-0xFFF8 - The function ID 25136 * * 0xFFF8-0xFFFE - Reserved for internal processors 25137 * * 0xFFFF - HWRM 25138 */ 25139 uint16_t target_id; 25140 /* 25141 * A physical address pointer pointing to a host buffer that the 25142 * command's response data will be written. This can be either a host 25143 * physical address (HPA) or a guest physical address (GPA) and must 25144 * point to a physically contiguous block of memory. 25145 */ 25146 uint64_t resp_addr; 25147 /* ID of the statistics context that is being queried. */ 25148 uint32_t stat_ctx_id; 25149 uint8_t unused_0[4]; 25150 } __attribute__((packed)); 25151 25152 /* hwrm_stat_ctx_free_output (size:128b/16B) */ 25153 struct hwrm_stat_ctx_free_output { 25154 /* The specific error status for the command. */ 25155 uint16_t error_code; 25156 /* The HWRM command request type. */ 25157 uint16_t req_type; 25158 /* The sequence ID from the original command. */ 25159 uint16_t seq_id; 25160 /* The length of the response data in number of bytes. */ 25161 uint16_t resp_len; 25162 /* This is the statistics context ID value. */ 25163 uint32_t stat_ctx_id; 25164 uint8_t unused_0[3]; 25165 /* 25166 * This field is used in Output records to indicate that the output 25167 * is completely written to RAM. This field should be read as '1' 25168 * to indicate that the output has been completely written. 25169 * When writing a command completion or response to an internal processor, 25170 * the order of writes has to be such that this field is written last. 25171 */ 25172 uint8_t valid; 25173 } __attribute__((packed)); 25174 25175 /*********************** 25176 * hwrm_stat_ctx_query * 25177 ***********************/ 25178 25179 25180 /* hwrm_stat_ctx_query_input (size:192b/24B) */ 25181 struct hwrm_stat_ctx_query_input { 25182 /* The HWRM command request type. */ 25183 uint16_t req_type; 25184 /* 25185 * The completion ring to send the completion event on. This should 25186 * be the NQ ID returned from the `nq_alloc` HWRM command. 25187 */ 25188 uint16_t cmpl_ring; 25189 /* 25190 * The sequence ID is used by the driver for tracking multiple 25191 * commands. This ID is treated as opaque data by the firmware and 25192 * the value is returned in the `hwrm_resp_hdr` upon completion. 25193 */ 25194 uint16_t seq_id; 25195 /* 25196 * The target ID of the command: 25197 * * 0x0-0xFFF8 - The function ID 25198 * * 0xFFF8-0xFFFE - Reserved for internal processors 25199 * * 0xFFFF - HWRM 25200 */ 25201 uint16_t target_id; 25202 /* 25203 * A physical address pointer pointing to a host buffer that the 25204 * command's response data will be written. This can be either a host 25205 * physical address (HPA) or a guest physical address (GPA) and must 25206 * point to a physically contiguous block of memory. 25207 */ 25208 uint64_t resp_addr; 25209 /* ID of the statistics context that is being queried. */ 25210 uint32_t stat_ctx_id; 25211 uint8_t unused_0[4]; 25212 } __attribute__((packed)); 25213 25214 /* hwrm_stat_ctx_query_output (size:1408b/176B) */ 25215 struct hwrm_stat_ctx_query_output { 25216 /* The specific error status for the command. */ 25217 uint16_t error_code; 25218 /* The HWRM command request type. */ 25219 uint16_t req_type; 25220 /* The sequence ID from the original command. */ 25221 uint16_t seq_id; 25222 /* The length of the response data in number of bytes. */ 25223 uint16_t resp_len; 25224 /* Number of transmitted unicast packets */ 25225 uint64_t tx_ucast_pkts; 25226 /* Number of transmitted multicast packets */ 25227 uint64_t tx_mcast_pkts; 25228 /* Number of transmitted broadcast packets */ 25229 uint64_t tx_bcast_pkts; 25230 /* Number of transmitted packets with error */ 25231 uint64_t tx_err_pkts; 25232 /* Number of dropped packets on transmit path */ 25233 uint64_t tx_drop_pkts; 25234 /* Number of transmitted bytes for unicast traffic */ 25235 uint64_t tx_ucast_bytes; 25236 /* Number of transmitted bytes for multicast traffic */ 25237 uint64_t tx_mcast_bytes; 25238 /* Number of transmitted bytes for broadcast traffic */ 25239 uint64_t tx_bcast_bytes; 25240 /* Number of received unicast packets */ 25241 uint64_t rx_ucast_pkts; 25242 /* Number of received multicast packets */ 25243 uint64_t rx_mcast_pkts; 25244 /* Number of received broadcast packets */ 25245 uint64_t rx_bcast_pkts; 25246 /* Number of received packets with error */ 25247 uint64_t rx_err_pkts; 25248 /* Number of dropped packets on received path */ 25249 uint64_t rx_drop_pkts; 25250 /* Number of received bytes for unicast traffic */ 25251 uint64_t rx_ucast_bytes; 25252 /* Number of received bytes for multicast traffic */ 25253 uint64_t rx_mcast_bytes; 25254 /* Number of received bytes for broadcast traffic */ 25255 uint64_t rx_bcast_bytes; 25256 /* Number of aggregated unicast packets */ 25257 uint64_t rx_agg_pkts; 25258 /* Number of aggregated unicast bytes */ 25259 uint64_t rx_agg_bytes; 25260 /* Number of aggregation events */ 25261 uint64_t rx_agg_events; 25262 /* Number of aborted aggregations */ 25263 uint64_t rx_agg_aborts; 25264 uint8_t unused_0[7]; 25265 /* 25266 * This field is used in Output records to indicate that the output 25267 * is completely written to RAM. This field should be read as '1' 25268 * to indicate that the output has been completely written. 25269 * When writing a command completion or response to an internal processor, 25270 * the order of writes has to be such that this field is written last. 25271 */ 25272 uint8_t valid; 25273 } __attribute__((packed)); 25274 25275 /*************************** 25276 * hwrm_stat_ctx_clr_stats * 25277 ***************************/ 25278 25279 25280 /* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */ 25281 struct hwrm_stat_ctx_clr_stats_input { 25282 /* The HWRM command request type. */ 25283 uint16_t req_type; 25284 /* 25285 * The completion ring to send the completion event on. This should 25286 * be the NQ ID returned from the `nq_alloc` HWRM command. 25287 */ 25288 uint16_t cmpl_ring; 25289 /* 25290 * The sequence ID is used by the driver for tracking multiple 25291 * commands. This ID is treated as opaque data by the firmware and 25292 * the value is returned in the `hwrm_resp_hdr` upon completion. 25293 */ 25294 uint16_t seq_id; 25295 /* 25296 * The target ID of the command: 25297 * * 0x0-0xFFF8 - The function ID 25298 * * 0xFFF8-0xFFFE - Reserved for internal processors 25299 * * 0xFFFF - HWRM 25300 */ 25301 uint16_t target_id; 25302 /* 25303 * A physical address pointer pointing to a host buffer that the 25304 * command's response data will be written. This can be either a host 25305 * physical address (HPA) or a guest physical address (GPA) and must 25306 * point to a physically contiguous block of memory. 25307 */ 25308 uint64_t resp_addr; 25309 /* ID of the statistics context that is being queried. */ 25310 uint32_t stat_ctx_id; 25311 uint8_t unused_0[4]; 25312 } __attribute__((packed)); 25313 25314 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */ 25315 struct hwrm_stat_ctx_clr_stats_output { 25316 /* The specific error status for the command. */ 25317 uint16_t error_code; 25318 /* The HWRM command request type. */ 25319 uint16_t req_type; 25320 /* The sequence ID from the original command. */ 25321 uint16_t seq_id; 25322 /* The length of the response data in number of bytes. */ 25323 uint16_t resp_len; 25324 uint8_t unused_0[7]; 25325 /* 25326 * This field is used in Output records to indicate that the output 25327 * is completely written to RAM. This field should be read as '1' 25328 * to indicate that the output has been completely written. 25329 * When writing a command completion or response to an internal processor, 25330 * the order of writes has to be such that this field is written last. 25331 */ 25332 uint8_t valid; 25333 } __attribute__((packed)); 25334 25335 /******************** 25336 * hwrm_pcie_qstats * 25337 ********************/ 25338 25339 25340 /* hwrm_pcie_qstats_input (size:256b/32B) */ 25341 struct hwrm_pcie_qstats_input { 25342 /* The HWRM command request type. */ 25343 uint16_t req_type; 25344 /* 25345 * The completion ring to send the completion event on. This should 25346 * be the NQ ID returned from the `nq_alloc` HWRM command. 25347 */ 25348 uint16_t cmpl_ring; 25349 /* 25350 * The sequence ID is used by the driver for tracking multiple 25351 * commands. This ID is treated as opaque data by the firmware and 25352 * the value is returned in the `hwrm_resp_hdr` upon completion. 25353 */ 25354 uint16_t seq_id; 25355 /* 25356 * The target ID of the command: 25357 * * 0x0-0xFFF8 - The function ID 25358 * * 0xFFF8-0xFFFE - Reserved for internal processors 25359 * * 0xFFFF - HWRM 25360 */ 25361 uint16_t target_id; 25362 /* 25363 * A physical address pointer pointing to a host buffer that the 25364 * command's response data will be written. This can be either a host 25365 * physical address (HPA) or a guest physical address (GPA) and must 25366 * point to a physically contiguous block of memory. 25367 */ 25368 uint64_t resp_addr; 25369 /* 25370 * The size of PCIe statistics block in bytes. 25371 * Firmware will DMA the PCIe statistics to 25372 * the host with this field size in the response. 25373 */ 25374 uint16_t pcie_stat_size; 25375 uint8_t unused_0[6]; 25376 /* 25377 * This is the host address where 25378 * PCIe statistics will be stored 25379 */ 25380 uint64_t pcie_stat_host_addr; 25381 } __attribute__((packed)); 25382 25383 /* hwrm_pcie_qstats_output (size:128b/16B) */ 25384 struct hwrm_pcie_qstats_output { 25385 /* The specific error status for the command. */ 25386 uint16_t error_code; 25387 /* The HWRM command request type. */ 25388 uint16_t req_type; 25389 /* The sequence ID from the original command. */ 25390 uint16_t seq_id; 25391 /* The length of the response data in number of bytes. */ 25392 uint16_t resp_len; 25393 /* The size of PCIe statistics block in bytes. */ 25394 uint16_t pcie_stat_size; 25395 uint8_t unused_0[5]; 25396 /* 25397 * This field is used in Output records to indicate that the output 25398 * is completely written to RAM. This field should be read as '1' 25399 * to indicate that the output has been completely written. 25400 * When writing a command completion or response to an internal processor, 25401 * the order of writes has to be such that this field is written last. 25402 */ 25403 uint8_t valid; 25404 } __attribute__((packed)); 25405 25406 /* PCIe Statistics Formats */ 25407 /* pcie_ctx_hw_stats (size:768b/96B) */ 25408 struct pcie_ctx_hw_stats { 25409 /* Number of physical layer receiver errors */ 25410 uint64_t pcie_pl_signal_integrity; 25411 /* Number of DLLP CRC errors detected by Data Link Layer */ 25412 uint64_t pcie_dl_signal_integrity; 25413 /* 25414 * Number of TLP LCRC and sequence number errors detected 25415 * by Data Link Layer 25416 */ 25417 uint64_t pcie_tl_signal_integrity; 25418 /* Number of times LTSSM entered Recovery state */ 25419 uint64_t pcie_link_integrity; 25420 /* Number of TLP bytes that have been trasmitted */ 25421 uint64_t pcie_tx_traffic_rate; 25422 /* Number of TLP bytes that have been received */ 25423 uint64_t pcie_rx_traffic_rate; 25424 /* Number of DLLP bytes that have been trasmitted */ 25425 uint64_t pcie_tx_dllp_statistics; 25426 /* Number of DLLP bytes that have been received */ 25427 uint64_t pcie_rx_dllp_statistics; 25428 /* 25429 * Number of times spent in each phase of gen3 25430 * equalization 25431 */ 25432 uint64_t pcie_equalization_time; 25433 /* Records the last 16 transitions of the LTSSM */ 25434 uint32_t pcie_ltssm_histogram[4]; 25435 /* 25436 * Record the last 8 reasons on why LTSSM transitioned 25437 * to Recovery 25438 */ 25439 uint64_t pcie_recovery_histogram; 25440 } __attribute__((packed)); 25441 25442 /********************** 25443 * hwrm_exec_fwd_resp * 25444 **********************/ 25445 25446 25447 /* hwrm_exec_fwd_resp_input (size:1024b/128B) */ 25448 struct hwrm_exec_fwd_resp_input { 25449 /* The HWRM command request type. */ 25450 uint16_t req_type; 25451 /* 25452 * The completion ring to send the completion event on. This should 25453 * be the NQ ID returned from the `nq_alloc` HWRM command. 25454 */ 25455 uint16_t cmpl_ring; 25456 /* 25457 * The sequence ID is used by the driver for tracking multiple 25458 * commands. This ID is treated as opaque data by the firmware and 25459 * the value is returned in the `hwrm_resp_hdr` upon completion. 25460 */ 25461 uint16_t seq_id; 25462 /* 25463 * The target ID of the command: 25464 * * 0x0-0xFFF8 - The function ID 25465 * * 0xFFF8-0xFFFE - Reserved for internal processors 25466 * * 0xFFFF - HWRM 25467 */ 25468 uint16_t target_id; 25469 /* 25470 * A physical address pointer pointing to a host buffer that the 25471 * command's response data will be written. This can be either a host 25472 * physical address (HPA) or a guest physical address (GPA) and must 25473 * point to a physically contiguous block of memory. 25474 */ 25475 uint64_t resp_addr; 25476 /* 25477 * This is an encapsulated request. This request should 25478 * be executed by the HWRM and the response should be 25479 * provided in the response buffer inside the encapsulated 25480 * request. 25481 */ 25482 uint32_t encap_request[26]; 25483 /* 25484 * This value indicates the target id of the response to 25485 * the encapsulated request. 25486 * 0x0 - 0xFFF8 - Used for function ids 25487 * 0xFFF8 - 0xFFFE - Reserved for internal processors 25488 * 0xFFFF - HWRM 25489 */ 25490 uint16_t encap_resp_target_id; 25491 uint8_t unused_0[6]; 25492 } __attribute__((packed)); 25493 25494 /* hwrm_exec_fwd_resp_output (size:128b/16B) */ 25495 struct hwrm_exec_fwd_resp_output { 25496 /* The specific error status for the command. */ 25497 uint16_t error_code; 25498 /* The HWRM command request type. */ 25499 uint16_t req_type; 25500 /* The sequence ID from the original command. */ 25501 uint16_t seq_id; 25502 /* The length of the response data in number of bytes. */ 25503 uint16_t resp_len; 25504 uint8_t unused_0[7]; 25505 /* 25506 * This field is used in Output records to indicate that the output 25507 * is completely written to RAM. This field should be read as '1' 25508 * to indicate that the output has been completely written. 25509 * When writing a command completion or response to an internal processor, 25510 * the order of writes has to be such that this field is written last. 25511 */ 25512 uint8_t valid; 25513 } __attribute__((packed)); 25514 25515 /************************ 25516 * hwrm_reject_fwd_resp * 25517 ************************/ 25518 25519 25520 /* hwrm_reject_fwd_resp_input (size:1024b/128B) */ 25521 struct hwrm_reject_fwd_resp_input { 25522 /* The HWRM command request type. */ 25523 uint16_t req_type; 25524 /* 25525 * The completion ring to send the completion event on. This should 25526 * be the NQ ID returned from the `nq_alloc` HWRM command. 25527 */ 25528 uint16_t cmpl_ring; 25529 /* 25530 * The sequence ID is used by the driver for tracking multiple 25531 * commands. This ID is treated as opaque data by the firmware and 25532 * the value is returned in the `hwrm_resp_hdr` upon completion. 25533 */ 25534 uint16_t seq_id; 25535 /* 25536 * The target ID of the command: 25537 * * 0x0-0xFFF8 - The function ID 25538 * * 0xFFF8-0xFFFE - Reserved for internal processors 25539 * * 0xFFFF - HWRM 25540 */ 25541 uint16_t target_id; 25542 /* 25543 * A physical address pointer pointing to a host buffer that the 25544 * command's response data will be written. This can be either a host 25545 * physical address (HPA) or a guest physical address (GPA) and must 25546 * point to a physically contiguous block of memory. 25547 */ 25548 uint64_t resp_addr; 25549 /* 25550 * This is an encapsulated request. This request should 25551 * be rejected by the HWRM and the error response should be 25552 * provided in the response buffer inside the encapsulated 25553 * request. 25554 */ 25555 uint32_t encap_request[26]; 25556 /* 25557 * This value indicates the target id of the response to 25558 * the encapsulated request. 25559 * 0x0 - 0xFFF8 - Used for function ids 25560 * 0xFFF8 - 0xFFFE - Reserved for internal processors 25561 * 0xFFFF - HWRM 25562 */ 25563 uint16_t encap_resp_target_id; 25564 uint8_t unused_0[6]; 25565 } __attribute__((packed)); 25566 25567 /* hwrm_reject_fwd_resp_output (size:128b/16B) */ 25568 struct hwrm_reject_fwd_resp_output { 25569 /* The specific error status for the command. */ 25570 uint16_t error_code; 25571 /* The HWRM command request type. */ 25572 uint16_t req_type; 25573 /* The sequence ID from the original command. */ 25574 uint16_t seq_id; 25575 /* The length of the response data in number of bytes. */ 25576 uint16_t resp_len; 25577 uint8_t unused_0[7]; 25578 /* 25579 * This field is used in Output records to indicate that the output 25580 * is completely written to RAM. This field should be read as '1' 25581 * to indicate that the output has been completely written. 25582 * When writing a command completion or response to an internal processor, 25583 * the order of writes has to be such that this field is written last. 25584 */ 25585 uint8_t valid; 25586 } __attribute__((packed)); 25587 25588 /***************** 25589 * hwrm_fwd_resp * 25590 *****************/ 25591 25592 25593 /* hwrm_fwd_resp_input (size:1024b/128B) */ 25594 struct hwrm_fwd_resp_input { 25595 /* The HWRM command request type. */ 25596 uint16_t req_type; 25597 /* 25598 * The completion ring to send the completion event on. This should 25599 * be the NQ ID returned from the `nq_alloc` HWRM command. 25600 */ 25601 uint16_t cmpl_ring; 25602 /* 25603 * The sequence ID is used by the driver for tracking multiple 25604 * commands. This ID is treated as opaque data by the firmware and 25605 * the value is returned in the `hwrm_resp_hdr` upon completion. 25606 */ 25607 uint16_t seq_id; 25608 /* 25609 * The target ID of the command: 25610 * * 0x0-0xFFF8 - The function ID 25611 * * 0xFFF8-0xFFFE - Reserved for internal processors 25612 * * 0xFFFF - HWRM 25613 */ 25614 uint16_t target_id; 25615 /* 25616 * A physical address pointer pointing to a host buffer that the 25617 * command's response data will be written. This can be either a host 25618 * physical address (HPA) or a guest physical address (GPA) and must 25619 * point to a physically contiguous block of memory. 25620 */ 25621 uint64_t resp_addr; 25622 /* 25623 * This value indicates the target id of the encapsulated 25624 * response. 25625 * 0x0 - 0xFFF8 - Used for function ids 25626 * 0xFFF8 - 0xFFFE - Reserved for internal processors 25627 * 0xFFFF - HWRM 25628 */ 25629 uint16_t encap_resp_target_id; 25630 /* 25631 * This value indicates the completion ring the encapsulated 25632 * response will be optionally completed on. If the value is 25633 * -1, then no CR completion shall be generated for the 25634 * encapsulated response. Any other value must be a 25635 * valid CR ring_id value. If a valid encap_resp_cmpl_ring 25636 * is provided, then a CR completion shall be generated for 25637 * the encapsulated response. 25638 */ 25639 uint16_t encap_resp_cmpl_ring; 25640 /* This field indicates the length of encapsulated response. */ 25641 uint16_t encap_resp_len; 25642 uint8_t unused_0; 25643 uint8_t unused_1; 25644 /* 25645 * This is the host address where the encapsulated response 25646 * will be written. 25647 * This area must be 16B aligned and must be cleared to zero 25648 * before the original request is made. 25649 */ 25650 uint64_t encap_resp_addr; 25651 /* This is an encapsulated response. */ 25652 uint32_t encap_resp[24]; 25653 } __attribute__((packed)); 25654 25655 /* hwrm_fwd_resp_output (size:128b/16B) */ 25656 struct hwrm_fwd_resp_output { 25657 /* The specific error status for the command. */ 25658 uint16_t error_code; 25659 /* The HWRM command request type. */ 25660 uint16_t req_type; 25661 /* The sequence ID from the original command. */ 25662 uint16_t seq_id; 25663 /* The length of the response data in number of bytes. */ 25664 uint16_t resp_len; 25665 uint8_t unused_0[7]; 25666 /* 25667 * This field is used in Output records to indicate that the output 25668 * is completely written to RAM. This field should be read as '1' 25669 * to indicate that the output has been completely written. 25670 * When writing a command completion or response to an internal processor, 25671 * the order of writes has to be such that this field is written last. 25672 */ 25673 uint8_t valid; 25674 } __attribute__((packed)); 25675 25676 /***************************** 25677 * hwrm_fwd_async_event_cmpl * 25678 *****************************/ 25679 25680 25681 /* hwrm_fwd_async_event_cmpl_input (size:320b/40B) */ 25682 struct hwrm_fwd_async_event_cmpl_input { 25683 /* The HWRM command request type. */ 25684 uint16_t req_type; 25685 /* 25686 * The completion ring to send the completion event on. This should 25687 * be the NQ ID returned from the `nq_alloc` HWRM command. 25688 */ 25689 uint16_t cmpl_ring; 25690 /* 25691 * The sequence ID is used by the driver for tracking multiple 25692 * commands. This ID is treated as opaque data by the firmware and 25693 * the value is returned in the `hwrm_resp_hdr` upon completion. 25694 */ 25695 uint16_t seq_id; 25696 /* 25697 * The target ID of the command: 25698 * * 0x0-0xFFF8 - The function ID 25699 * * 0xFFF8-0xFFFE - Reserved for internal processors 25700 * * 0xFFFF - HWRM 25701 */ 25702 uint16_t target_id; 25703 /* 25704 * A physical address pointer pointing to a host buffer that the 25705 * command's response data will be written. This can be either a host 25706 * physical address (HPA) or a guest physical address (GPA) and must 25707 * point to a physically contiguous block of memory. 25708 */ 25709 uint64_t resp_addr; 25710 /* 25711 * This value indicates the target id of the encapsulated 25712 * asynchronous event. 25713 * 0x0 - 0xFFF8 - Used for function ids 25714 * 0xFFF8 - 0xFFFE - Reserved for internal processors 25715 * 0xFFFF - Broadcast to all children VFs (only applicable when 25716 * a PF is the requester) 25717 */ 25718 uint16_t encap_async_event_target_id; 25719 uint8_t unused_0[6]; 25720 /* This is an encapsulated asynchronous event completion. */ 25721 uint32_t encap_async_event_cmpl[4]; 25722 } __attribute__((packed)); 25723 25724 /* hwrm_fwd_async_event_cmpl_output (size:128b/16B) */ 25725 struct hwrm_fwd_async_event_cmpl_output { 25726 /* The specific error status for the command. */ 25727 uint16_t error_code; 25728 /* The HWRM command request type. */ 25729 uint16_t req_type; 25730 /* The sequence ID from the original command. */ 25731 uint16_t seq_id; 25732 /* The length of the response data in number of bytes. */ 25733 uint16_t resp_len; 25734 uint8_t unused_0[7]; 25735 /* 25736 * This field is used in Output records to indicate that the output 25737 * is completely written to RAM. This field should be read as '1' 25738 * to indicate that the output has been completely written. 25739 * When writing a command completion or response to an internal processor, 25740 * the order of writes has to be such that this field is written last. 25741 */ 25742 uint8_t valid; 25743 } __attribute__((packed)); 25744 25745 /************************** 25746 * hwrm_nvm_raw_write_blk * 25747 **************************/ 25748 25749 25750 /* hwrm_nvm_raw_write_blk_input (size:256b/32B) */ 25751 struct hwrm_nvm_raw_write_blk_input { 25752 /* The HWRM command request type. */ 25753 uint16_t req_type; 25754 /* 25755 * The completion ring to send the completion event on. This should 25756 * be the NQ ID returned from the `nq_alloc` HWRM command. 25757 */ 25758 uint16_t cmpl_ring; 25759 /* 25760 * The sequence ID is used by the driver for tracking multiple 25761 * commands. This ID is treated as opaque data by the firmware and 25762 * the value is returned in the `hwrm_resp_hdr` upon completion. 25763 */ 25764 uint16_t seq_id; 25765 /* 25766 * The target ID of the command: 25767 * * 0x0-0xFFF8 - The function ID 25768 * * 0xFFF8-0xFFFE - Reserved for internal processors 25769 * * 0xFFFF - HWRM 25770 */ 25771 uint16_t target_id; 25772 /* 25773 * A physical address pointer pointing to a host buffer that the 25774 * command's response data will be written. This can be either a host 25775 * physical address (HPA) or a guest physical address (GPA) and must 25776 * point to a physically contiguous block of memory. 25777 */ 25778 uint64_t resp_addr; 25779 /* 25780 * 64-bit Host Source Address. 25781 * This is the loation of the source data to be written. 25782 */ 25783 uint64_t host_src_addr; 25784 /* 25785 * 32-bit Destination Address. 25786 * This is the NVRAM byte-offset where the source data will be written to. 25787 */ 25788 uint32_t dest_addr; 25789 /* Length of data to be written, in bytes. */ 25790 uint32_t len; 25791 } __attribute__((packed)); 25792 25793 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */ 25794 struct hwrm_nvm_raw_write_blk_output { 25795 /* The specific error status for the command. */ 25796 uint16_t error_code; 25797 /* The HWRM command request type. */ 25798 uint16_t req_type; 25799 /* The sequence ID from the original command. */ 25800 uint16_t seq_id; 25801 /* The length of the response data in number of bytes. */ 25802 uint16_t resp_len; 25803 uint8_t unused_0[7]; 25804 /* 25805 * This field is used in Output records to indicate that the output 25806 * is completely written to RAM. This field should be read as '1' 25807 * to indicate that the output has been completely written. 25808 * When writing a command completion or response to an internal processor, 25809 * the order of writes has to be such that this field is written last. 25810 */ 25811 uint8_t valid; 25812 } __attribute__((packed)); 25813 25814 /***************** 25815 * hwrm_nvm_read * 25816 *****************/ 25817 25818 25819 /* hwrm_nvm_read_input (size:320b/40B) */ 25820 struct hwrm_nvm_read_input { 25821 /* The HWRM command request type. */ 25822 uint16_t req_type; 25823 /* 25824 * The completion ring to send the completion event on. This should 25825 * be the NQ ID returned from the `nq_alloc` HWRM command. 25826 */ 25827 uint16_t cmpl_ring; 25828 /* 25829 * The sequence ID is used by the driver for tracking multiple 25830 * commands. This ID is treated as opaque data by the firmware and 25831 * the value is returned in the `hwrm_resp_hdr` upon completion. 25832 */ 25833 uint16_t seq_id; 25834 /* 25835 * The target ID of the command: 25836 * * 0x0-0xFFF8 - The function ID 25837 * * 0xFFF8-0xFFFE - Reserved for internal processors 25838 * * 0xFFFF - HWRM 25839 */ 25840 uint16_t target_id; 25841 /* 25842 * A physical address pointer pointing to a host buffer that the 25843 * command's response data will be written. This can be either a host 25844 * physical address (HPA) or a guest physical address (GPA) and must 25845 * point to a physically contiguous block of memory. 25846 */ 25847 uint64_t resp_addr; 25848 /* 25849 * 64-bit Host Destination Address. 25850 * This is the host address where the data will be written to. 25851 */ 25852 uint64_t host_dest_addr; 25853 /* The 0-based index of the directory entry. */ 25854 uint16_t dir_idx; 25855 uint8_t unused_0[2]; 25856 /* The NVRAM byte-offset to read from. */ 25857 uint32_t offset; 25858 /* The length of the data to be read, in bytes. */ 25859 uint32_t len; 25860 uint8_t unused_1[4]; 25861 } __attribute__((packed)); 25862 25863 /* hwrm_nvm_read_output (size:128b/16B) */ 25864 struct hwrm_nvm_read_output { 25865 /* The specific error status for the command. */ 25866 uint16_t error_code; 25867 /* The HWRM command request type. */ 25868 uint16_t req_type; 25869 /* The sequence ID from the original command. */ 25870 uint16_t seq_id; 25871 /* The length of the response data in number of bytes. */ 25872 uint16_t resp_len; 25873 uint8_t unused_0[7]; 25874 /* 25875 * This field is used in Output records to indicate that the output 25876 * is completely written to RAM. This field should be read as '1' 25877 * to indicate that the output has been completely written. 25878 * When writing a command completion or response to an internal processor, 25879 * the order of writes has to be such that this field is written last. 25880 */ 25881 uint8_t valid; 25882 } __attribute__((packed)); 25883 25884 /********************* 25885 * hwrm_nvm_raw_dump * 25886 *********************/ 25887 25888 25889 /* hwrm_nvm_raw_dump_input (size:256b/32B) */ 25890 struct hwrm_nvm_raw_dump_input { 25891 /* The HWRM command request type. */ 25892 uint16_t req_type; 25893 /* 25894 * The completion ring to send the completion event on. This should 25895 * be the NQ ID returned from the `nq_alloc` HWRM command. 25896 */ 25897 uint16_t cmpl_ring; 25898 /* 25899 * The sequence ID is used by the driver for tracking multiple 25900 * commands. This ID is treated as opaque data by the firmware and 25901 * the value is returned in the `hwrm_resp_hdr` upon completion. 25902 */ 25903 uint16_t seq_id; 25904 /* 25905 * The target ID of the command: 25906 * * 0x0-0xFFF8 - The function ID 25907 * * 0xFFF8-0xFFFE - Reserved for internal processors 25908 * * 0xFFFF - HWRM 25909 */ 25910 uint16_t target_id; 25911 /* 25912 * A physical address pointer pointing to a host buffer that the 25913 * command's response data will be written. This can be either a host 25914 * physical address (HPA) or a guest physical address (GPA) and must 25915 * point to a physically contiguous block of memory. 25916 */ 25917 uint64_t resp_addr; 25918 /* 25919 * 64-bit Host Destination Address. 25920 * This is the host address where the data will be written to. 25921 */ 25922 uint64_t host_dest_addr; 25923 /* 32-bit NVRAM byte-offset to read from. */ 25924 uint32_t offset; 25925 /* Total length of NVRAM contents to be read, in bytes. */ 25926 uint32_t len; 25927 } __attribute__((packed)); 25928 25929 /* hwrm_nvm_raw_dump_output (size:128b/16B) */ 25930 struct hwrm_nvm_raw_dump_output { 25931 /* The specific error status for the command. */ 25932 uint16_t error_code; 25933 /* The HWRM command request type. */ 25934 uint16_t req_type; 25935 /* The sequence ID from the original command. */ 25936 uint16_t seq_id; 25937 /* The length of the response data in number of bytes. */ 25938 uint16_t resp_len; 25939 uint8_t unused_0[7]; 25940 /* 25941 * This field is used in Output records to indicate that the output 25942 * is completely written to RAM. This field should be read as '1' 25943 * to indicate that the output has been completely written. 25944 * When writing a command completion or response to an internal processor, 25945 * the order of writes has to be such that this field is written last. 25946 */ 25947 uint8_t valid; 25948 } __attribute__((packed)); 25949 25950 /**************************** 25951 * hwrm_nvm_get_dir_entries * 25952 ****************************/ 25953 25954 25955 /* hwrm_nvm_get_dir_entries_input (size:192b/24B) */ 25956 struct hwrm_nvm_get_dir_entries_input { 25957 /* The HWRM command request type. */ 25958 uint16_t req_type; 25959 /* 25960 * The completion ring to send the completion event on. This should 25961 * be the NQ ID returned from the `nq_alloc` HWRM command. 25962 */ 25963 uint16_t cmpl_ring; 25964 /* 25965 * The sequence ID is used by the driver for tracking multiple 25966 * commands. This ID is treated as opaque data by the firmware and 25967 * the value is returned in the `hwrm_resp_hdr` upon completion. 25968 */ 25969 uint16_t seq_id; 25970 /* 25971 * The target ID of the command: 25972 * * 0x0-0xFFF8 - The function ID 25973 * * 0xFFF8-0xFFFE - Reserved for internal processors 25974 * * 0xFFFF - HWRM 25975 */ 25976 uint16_t target_id; 25977 /* 25978 * A physical address pointer pointing to a host buffer that the 25979 * command's response data will be written. This can be either a host 25980 * physical address (HPA) or a guest physical address (GPA) and must 25981 * point to a physically contiguous block of memory. 25982 */ 25983 uint64_t resp_addr; 25984 /* 25985 * 64-bit Host Destination Address. 25986 * This is the host address where the directory will be written. 25987 */ 25988 uint64_t host_dest_addr; 25989 } __attribute__((packed)); 25990 25991 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */ 25992 struct hwrm_nvm_get_dir_entries_output { 25993 /* The specific error status for the command. */ 25994 uint16_t error_code; 25995 /* The HWRM command request type. */ 25996 uint16_t req_type; 25997 /* The sequence ID from the original command. */ 25998 uint16_t seq_id; 25999 /* The length of the response data in number of bytes. */ 26000 uint16_t resp_len; 26001 uint8_t unused_0[7]; 26002 /* 26003 * This field is used in Output records to indicate that the output 26004 * is completely written to RAM. This field should be read as '1' 26005 * to indicate that the output has been completely written. 26006 * When writing a command completion or response to an internal processor, 26007 * the order of writes has to be such that this field is written last. 26008 */ 26009 uint8_t valid; 26010 } __attribute__((packed)); 26011 26012 /************************* 26013 * hwrm_nvm_get_dir_info * 26014 *************************/ 26015 26016 26017 /* hwrm_nvm_get_dir_info_input (size:128b/16B) */ 26018 struct hwrm_nvm_get_dir_info_input { 26019 /* The HWRM command request type. */ 26020 uint16_t req_type; 26021 /* 26022 * The completion ring to send the completion event on. This should 26023 * be the NQ ID returned from the `nq_alloc` HWRM command. 26024 */ 26025 uint16_t cmpl_ring; 26026 /* 26027 * The sequence ID is used by the driver for tracking multiple 26028 * commands. This ID is treated as opaque data by the firmware and 26029 * the value is returned in the `hwrm_resp_hdr` upon completion. 26030 */ 26031 uint16_t seq_id; 26032 /* 26033 * The target ID of the command: 26034 * * 0x0-0xFFF8 - The function ID 26035 * * 0xFFF8-0xFFFE - Reserved for internal processors 26036 * * 0xFFFF - HWRM 26037 */ 26038 uint16_t target_id; 26039 /* 26040 * A physical address pointer pointing to a host buffer that the 26041 * command's response data will be written. This can be either a host 26042 * physical address (HPA) or a guest physical address (GPA) and must 26043 * point to a physically contiguous block of memory. 26044 */ 26045 uint64_t resp_addr; 26046 } __attribute__((packed)); 26047 26048 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */ 26049 struct hwrm_nvm_get_dir_info_output { 26050 /* The specific error status for the command. */ 26051 uint16_t error_code; 26052 /* The HWRM command request type. */ 26053 uint16_t req_type; 26054 /* The sequence ID from the original command. */ 26055 uint16_t seq_id; 26056 /* The length of the response data in number of bytes. */ 26057 uint16_t resp_len; 26058 /* Number of directory entries in the directory. */ 26059 uint32_t entries; 26060 /* Size of each directory entry, in bytes. */ 26061 uint32_t entry_length; 26062 uint8_t unused_0[7]; 26063 /* 26064 * This field is used in Output records to indicate that the output 26065 * is completely written to RAM. This field should be read as '1' 26066 * to indicate that the output has been completely written. 26067 * When writing a command completion or response to an internal processor, 26068 * the order of writes has to be such that this field is written last. 26069 */ 26070 uint8_t valid; 26071 } __attribute__((packed)); 26072 26073 /****************** 26074 * hwrm_nvm_write * 26075 ******************/ 26076 26077 26078 /* hwrm_nvm_write_input (size:384b/48B) */ 26079 struct hwrm_nvm_write_input { 26080 /* The HWRM command request type. */ 26081 uint16_t req_type; 26082 /* 26083 * The completion ring to send the completion event on. This should 26084 * be the NQ ID returned from the `nq_alloc` HWRM command. 26085 */ 26086 uint16_t cmpl_ring; 26087 /* 26088 * The sequence ID is used by the driver for tracking multiple 26089 * commands. This ID is treated as opaque data by the firmware and 26090 * the value is returned in the `hwrm_resp_hdr` upon completion. 26091 */ 26092 uint16_t seq_id; 26093 /* 26094 * The target ID of the command: 26095 * * 0x0-0xFFF8 - The function ID 26096 * * 0xFFF8-0xFFFE - Reserved for internal processors 26097 * * 0xFFFF - HWRM 26098 */ 26099 uint16_t target_id; 26100 /* 26101 * A physical address pointer pointing to a host buffer that the 26102 * command's response data will be written. This can be either a host 26103 * physical address (HPA) or a guest physical address (GPA) and must 26104 * point to a physically contiguous block of memory. 26105 */ 26106 uint64_t resp_addr; 26107 /* 26108 * 64-bit Host Source Address. 26109 * This is where the source data is. 26110 */ 26111 uint64_t host_src_addr; 26112 /* The Directory Entry Type (valid values are defined in the bnxnvm_directory_type enum defined in the file bnxnvm_defs.h). */ 26113 uint16_t dir_type; 26114 /* 26115 * Directory ordinal. 26116 * The 0-based instance of the combined Directory Entry Type and Extension. 26117 */ 26118 uint16_t dir_ordinal; 26119 /* The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file bnxnvm_defs.h). */ 26120 uint16_t dir_ext; 26121 /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file bnxnvm_defs.h). */ 26122 uint16_t dir_attr; 26123 /* 26124 * Length of data to write, in bytes. May be less than or equal to the allocated size for the directory entry. 26125 * The data length stored in the directory entry will be updated to reflect this value once the write is complete. 26126 */ 26127 uint32_t dir_data_length; 26128 /* Option. */ 26129 uint16_t option; 26130 uint16_t flags; 26131 /* 26132 * When this bit is '1', the original active image 26133 * will not be removed. TBD: what purpose is this? 26134 */ 26135 #define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG \ 26136 UINT32_C(0x1) 26137 /* 26138 * The requested length of the allocated NVM for the item, in bytes. This value may be greater than or equal to the specified data length (dir_data_length). 26139 * If this value is less than the specified data length, it will be ignored. 26140 * The response will contain the actual allocated item length, which may be greater than the requested item length. 26141 * The purpose for allocating more than the required number of bytes for an item's data is to pre-allocate extra storage (padding) to accomodate 26142 * the potential future growth of an item (e.g. upgraded firmware with a size increase, log growth, expanded configuration data). 26143 */ 26144 uint32_t dir_item_length; 26145 uint32_t unused_0; 26146 } __attribute__((packed)); 26147 26148 /* hwrm_nvm_write_output (size:128b/16B) */ 26149 struct hwrm_nvm_write_output { 26150 /* The specific error status for the command. */ 26151 uint16_t error_code; 26152 /* The HWRM command request type. */ 26153 uint16_t req_type; 26154 /* The sequence ID from the original command. */ 26155 uint16_t seq_id; 26156 /* The length of the response data in number of bytes. */ 26157 uint16_t resp_len; 26158 /* 26159 * Length of the allocated NVM for the item, in bytes. The value may be greater than or equal to the specified data length or the requested item length. 26160 * The actual item length used when creating a new directory entry will be a multiple of an NVM block size. 26161 */ 26162 uint32_t dir_item_length; 26163 /* The directory index of the created or modified item. */ 26164 uint16_t dir_idx; 26165 uint8_t unused_0; 26166 /* 26167 * This field is used in Output records to indicate that the output 26168 * is completely written to RAM. This field should be read as '1' 26169 * to indicate that the output has been completely written. 26170 * When writing a command completion or response to an internal processor, 26171 * the order of writes has to be such that this field is written last. 26172 */ 26173 uint8_t valid; 26174 } __attribute__((packed)); 26175 26176 /* hwrm_nvm_write_cmd_err (size:64b/8B) */ 26177 struct hwrm_nvm_write_cmd_err { 26178 /* 26179 * command specific error codes that goes to 26180 * the cmd_err field in Common HWRM Error Response. 26181 */ 26182 uint8_t code; 26183 /* Unknown error */ 26184 #define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0) 26185 /* Unable to complete operation due to fragmentation */ 26186 #define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1) 26187 /* nvm is completely full. */ 26188 #define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2) 26189 #define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST \ 26190 HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE 26191 uint8_t unused_0[7]; 26192 } __attribute__((packed)); 26193 26194 /******************* 26195 * hwrm_nvm_modify * 26196 *******************/ 26197 26198 26199 /* hwrm_nvm_modify_input (size:320b/40B) */ 26200 struct hwrm_nvm_modify_input { 26201 /* The HWRM command request type. */ 26202 uint16_t req_type; 26203 /* 26204 * The completion ring to send the completion event on. This should 26205 * be the NQ ID returned from the `nq_alloc` HWRM command. 26206 */ 26207 uint16_t cmpl_ring; 26208 /* 26209 * The sequence ID is used by the driver for tracking multiple 26210 * commands. This ID is treated as opaque data by the firmware and 26211 * the value is returned in the `hwrm_resp_hdr` upon completion. 26212 */ 26213 uint16_t seq_id; 26214 /* 26215 * The target ID of the command: 26216 * * 0x0-0xFFF8 - The function ID 26217 * * 0xFFF8-0xFFFE - Reserved for internal processors 26218 * * 0xFFFF - HWRM 26219 */ 26220 uint16_t target_id; 26221 /* 26222 * A physical address pointer pointing to a host buffer that the 26223 * command's response data will be written. This can be either a host 26224 * physical address (HPA) or a guest physical address (GPA) and must 26225 * point to a physically contiguous block of memory. 26226 */ 26227 uint64_t resp_addr; 26228 /* 26229 * 64-bit Host Source Address. 26230 * This is where the modified data is. 26231 */ 26232 uint64_t host_src_addr; 26233 /* 16-bit directory entry index. */ 26234 uint16_t dir_idx; 26235 uint8_t unused_0[2]; 26236 /* 32-bit NVRAM byte-offset to modify content from. */ 26237 uint32_t offset; 26238 /* 26239 * Length of data to be modified, in bytes. The length shall 26240 * be non-zero. 26241 */ 26242 uint32_t len; 26243 uint8_t unused_1[4]; 26244 } __attribute__((packed)); 26245 26246 /* hwrm_nvm_modify_output (size:128b/16B) */ 26247 struct hwrm_nvm_modify_output { 26248 /* The specific error status for the command. */ 26249 uint16_t error_code; 26250 /* The HWRM command request type. */ 26251 uint16_t req_type; 26252 /* The sequence ID from the original command. */ 26253 uint16_t seq_id; 26254 /* The length of the response data in number of bytes. */ 26255 uint16_t resp_len; 26256 uint8_t unused_0[7]; 26257 /* 26258 * This field is used in Output records to indicate that the output 26259 * is completely written to RAM. This field should be read as '1' 26260 * to indicate that the output has been completely written. 26261 * When writing a command completion or response to an internal processor, 26262 * the order of writes has to be such that this field is written last. 26263 */ 26264 uint8_t valid; 26265 } __attribute__((packed)); 26266 26267 /*************************** 26268 * hwrm_nvm_find_dir_entry * 26269 ***************************/ 26270 26271 26272 /* hwrm_nvm_find_dir_entry_input (size:256b/32B) */ 26273 struct hwrm_nvm_find_dir_entry_input { 26274 /* The HWRM command request type. */ 26275 uint16_t req_type; 26276 /* 26277 * The completion ring to send the completion event on. This should 26278 * be the NQ ID returned from the `nq_alloc` HWRM command. 26279 */ 26280 uint16_t cmpl_ring; 26281 /* 26282 * The sequence ID is used by the driver for tracking multiple 26283 * commands. This ID is treated as opaque data by the firmware and 26284 * the value is returned in the `hwrm_resp_hdr` upon completion. 26285 */ 26286 uint16_t seq_id; 26287 /* 26288 * The target ID of the command: 26289 * * 0x0-0xFFF8 - The function ID 26290 * * 0xFFF8-0xFFFE - Reserved for internal processors 26291 * * 0xFFFF - HWRM 26292 */ 26293 uint16_t target_id; 26294 /* 26295 * A physical address pointer pointing to a host buffer that the 26296 * command's response data will be written. This can be either a host 26297 * physical address (HPA) or a guest physical address (GPA) and must 26298 * point to a physically contiguous block of memory. 26299 */ 26300 uint64_t resp_addr; 26301 uint32_t enables; 26302 /* 26303 * This bit must be '1' for the dir_idx_valid field to be 26304 * configured. 26305 */ 26306 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID \ 26307 UINT32_C(0x1) 26308 /* Directory Entry Index */ 26309 uint16_t dir_idx; 26310 /* Directory Entry (Image) Type */ 26311 uint16_t dir_type; 26312 /* 26313 * Directory ordinal. 26314 * The instance of this Directory Type 26315 */ 26316 uint16_t dir_ordinal; 26317 /* The Directory Entry Extension flags. */ 26318 uint16_t dir_ext; 26319 /* This value indicates the search option using dir_ordinal. */ 26320 uint8_t opt_ordinal; 26321 /* This value indicates the search option using dir_ordinal. */ 26322 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK UINT32_C(0x3) 26323 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT 0 26324 /* Equal to specified ordinal value. */ 26325 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ UINT32_C(0x0) 26326 /* Greater than or equal to specified ordinal value */ 26327 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE UINT32_C(0x1) 26328 /* Greater than specified ordinal value */ 26329 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT UINT32_C(0x2) 26330 #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST \ 26331 HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT 26332 uint8_t unused_0[3]; 26333 } __attribute__((packed)); 26334 26335 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */ 26336 struct hwrm_nvm_find_dir_entry_output { 26337 /* The specific error status for the command. */ 26338 uint16_t error_code; 26339 /* The HWRM command request type. */ 26340 uint16_t req_type; 26341 /* The sequence ID from the original command. */ 26342 uint16_t seq_id; 26343 /* The length of the response data in number of bytes. */ 26344 uint16_t resp_len; 26345 /* Allocated NVRAM for this directory entry, in bytes. */ 26346 uint32_t dir_item_length; 26347 /* Size of the stored data for this directory entry, in bytes. */ 26348 uint32_t dir_data_length; 26349 /* 26350 * Firmware version. 26351 * Only valid if the directory entry is for embedded firmware stored in APE_BIN Format. 26352 */ 26353 uint32_t fw_ver; 26354 /* Directory ordinal. */ 26355 uint16_t dir_ordinal; 26356 /* Directory Entry Index */ 26357 uint16_t dir_idx; 26358 uint8_t unused_0[7]; 26359 /* 26360 * This field is used in Output records to indicate that the output 26361 * is completely written to RAM. This field should be read as '1' 26362 * to indicate that the output has been completely written. 26363 * When writing a command completion or response to an internal processor, 26364 * the order of writes has to be such that this field is written last. 26365 */ 26366 uint8_t valid; 26367 } __attribute__((packed)); 26368 26369 /**************************** 26370 * hwrm_nvm_erase_dir_entry * 26371 ****************************/ 26372 26373 26374 /* hwrm_nvm_erase_dir_entry_input (size:192b/24B) */ 26375 struct hwrm_nvm_erase_dir_entry_input { 26376 /* The HWRM command request type. */ 26377 uint16_t req_type; 26378 /* 26379 * The completion ring to send the completion event on. This should 26380 * be the NQ ID returned from the `nq_alloc` HWRM command. 26381 */ 26382 uint16_t cmpl_ring; 26383 /* 26384 * The sequence ID is used by the driver for tracking multiple 26385 * commands. This ID is treated as opaque data by the firmware and 26386 * the value is returned in the `hwrm_resp_hdr` upon completion. 26387 */ 26388 uint16_t seq_id; 26389 /* 26390 * The target ID of the command: 26391 * * 0x0-0xFFF8 - The function ID 26392 * * 0xFFF8-0xFFFE - Reserved for internal processors 26393 * * 0xFFFF - HWRM 26394 */ 26395 uint16_t target_id; 26396 /* 26397 * A physical address pointer pointing to a host buffer that the 26398 * command's response data will be written. This can be either a host 26399 * physical address (HPA) or a guest physical address (GPA) and must 26400 * point to a physically contiguous block of memory. 26401 */ 26402 uint64_t resp_addr; 26403 /* Directory Entry Index */ 26404 uint16_t dir_idx; 26405 uint8_t unused_0[6]; 26406 } __attribute__((packed)); 26407 26408 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */ 26409 struct hwrm_nvm_erase_dir_entry_output { 26410 /* The specific error status for the command. */ 26411 uint16_t error_code; 26412 /* The HWRM command request type. */ 26413 uint16_t req_type; 26414 /* The sequence ID from the original command. */ 26415 uint16_t seq_id; 26416 /* The length of the response data in number of bytes. */ 26417 uint16_t resp_len; 26418 uint8_t unused_0[7]; 26419 /* 26420 * This field is used in Output records to indicate that the output 26421 * is completely written to RAM. This field should be read as '1' 26422 * to indicate that the output has been completely written. 26423 * When writing a command completion or response to an internal processor, 26424 * the order of writes has to be such that this field is written last. 26425 */ 26426 uint8_t valid; 26427 } __attribute__((packed)); 26428 26429 /************************* 26430 * hwrm_nvm_get_dev_info * 26431 *************************/ 26432 26433 26434 /* hwrm_nvm_get_dev_info_input (size:128b/16B) */ 26435 struct hwrm_nvm_get_dev_info_input { 26436 /* The HWRM command request type. */ 26437 uint16_t req_type; 26438 /* 26439 * The completion ring to send the completion event on. This should 26440 * be the NQ ID returned from the `nq_alloc` HWRM command. 26441 */ 26442 uint16_t cmpl_ring; 26443 /* 26444 * The sequence ID is used by the driver for tracking multiple 26445 * commands. This ID is treated as opaque data by the firmware and 26446 * the value is returned in the `hwrm_resp_hdr` upon completion. 26447 */ 26448 uint16_t seq_id; 26449 /* 26450 * The target ID of the command: 26451 * * 0x0-0xFFF8 - The function ID 26452 * * 0xFFF8-0xFFFE - Reserved for internal processors 26453 * * 0xFFFF - HWRM 26454 */ 26455 uint16_t target_id; 26456 /* 26457 * A physical address pointer pointing to a host buffer that the 26458 * command's response data will be written. This can be either a host 26459 * physical address (HPA) or a guest physical address (GPA) and must 26460 * point to a physically contiguous block of memory. 26461 */ 26462 uint64_t resp_addr; 26463 } __attribute__((packed)); 26464 26465 /* hwrm_nvm_get_dev_info_output (size:256b/32B) */ 26466 struct hwrm_nvm_get_dev_info_output { 26467 /* The specific error status for the command. */ 26468 uint16_t error_code; 26469 /* The HWRM command request type. */ 26470 uint16_t req_type; 26471 /* The sequence ID from the original command. */ 26472 uint16_t seq_id; 26473 /* The length of the response data in number of bytes. */ 26474 uint16_t resp_len; 26475 /* Manufacturer ID. */ 26476 uint16_t manufacturer_id; 26477 /* Device ID. */ 26478 uint16_t device_id; 26479 /* Sector size of the NVRAM device. */ 26480 uint32_t sector_size; 26481 /* Total size, in bytes of the NVRAM device. */ 26482 uint32_t nvram_size; 26483 uint32_t reserved_size; 26484 /* Available size that can be used, in bytes. Available size is the NVRAM size take away the used size and reserved size. */ 26485 uint32_t available_size; 26486 uint8_t unused_0[3]; 26487 /* 26488 * This field is used in Output records to indicate that the output 26489 * is completely written to RAM. This field should be read as '1' 26490 * to indicate that the output has been completely written. 26491 * When writing a command completion or response to an internal processor, 26492 * the order of writes has to be such that this field is written last. 26493 */ 26494 uint8_t valid; 26495 } __attribute__((packed)); 26496 26497 /************************** 26498 * hwrm_nvm_mod_dir_entry * 26499 **************************/ 26500 26501 26502 /* hwrm_nvm_mod_dir_entry_input (size:256b/32B) */ 26503 struct hwrm_nvm_mod_dir_entry_input { 26504 /* The HWRM command request type. */ 26505 uint16_t req_type; 26506 /* 26507 * The completion ring to send the completion event on. This should 26508 * be the NQ ID returned from the `nq_alloc` HWRM command. 26509 */ 26510 uint16_t cmpl_ring; 26511 /* 26512 * The sequence ID is used by the driver for tracking multiple 26513 * commands. This ID is treated as opaque data by the firmware and 26514 * the value is returned in the `hwrm_resp_hdr` upon completion. 26515 */ 26516 uint16_t seq_id; 26517 /* 26518 * The target ID of the command: 26519 * * 0x0-0xFFF8 - The function ID 26520 * * 0xFFF8-0xFFFE - Reserved for internal processors 26521 * * 0xFFFF - HWRM 26522 */ 26523 uint16_t target_id; 26524 /* 26525 * A physical address pointer pointing to a host buffer that the 26526 * command's response data will be written. This can be either a host 26527 * physical address (HPA) or a guest physical address (GPA) and must 26528 * point to a physically contiguous block of memory. 26529 */ 26530 uint64_t resp_addr; 26531 uint32_t enables; 26532 /* 26533 * This bit must be '1' for the checksum field to be 26534 * configured. 26535 */ 26536 #define HWRM_NVM_MOD_DIR_ENTRY_INPUT_ENABLES_CHECKSUM UINT32_C(0x1) 26537 /* Directory Entry Index */ 26538 uint16_t dir_idx; 26539 /* 26540 * Directory ordinal. 26541 * The (0-based) instance of this Directory Type. 26542 */ 26543 uint16_t dir_ordinal; 26544 /* The Directory Entry Extension flags (see BNX_DIR_EXT_* for extension flag definitions). */ 26545 uint16_t dir_ext; 26546 /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute flag definitions). */ 26547 uint16_t dir_attr; 26548 /* 26549 * If valid, then this field updates the checksum 26550 * value of the content in the directory entry. 26551 */ 26552 uint32_t checksum; 26553 } __attribute__((packed)); 26554 26555 /* hwrm_nvm_mod_dir_entry_output (size:128b/16B) */ 26556 struct hwrm_nvm_mod_dir_entry_output { 26557 /* The specific error status for the command. */ 26558 uint16_t error_code; 26559 /* The HWRM command request type. */ 26560 uint16_t req_type; 26561 /* The sequence ID from the original command. */ 26562 uint16_t seq_id; 26563 /* The length of the response data in number of bytes. */ 26564 uint16_t resp_len; 26565 uint8_t unused_0[7]; 26566 /* 26567 * This field is used in Output records to indicate that the output 26568 * is completely written to RAM. This field should be read as '1' 26569 * to indicate that the output has been completely written. 26570 * When writing a command completion or response to an internal processor, 26571 * the order of writes has to be such that this field is written last. 26572 */ 26573 uint8_t valid; 26574 } __attribute__((packed)); 26575 26576 /************************** 26577 * hwrm_nvm_verify_update * 26578 **************************/ 26579 26580 26581 /* hwrm_nvm_verify_update_input (size:192b/24B) */ 26582 struct hwrm_nvm_verify_update_input { 26583 /* The HWRM command request type. */ 26584 uint16_t req_type; 26585 /* 26586 * The completion ring to send the completion event on. This should 26587 * be the NQ ID returned from the `nq_alloc` HWRM command. 26588 */ 26589 uint16_t cmpl_ring; 26590 /* 26591 * The sequence ID is used by the driver for tracking multiple 26592 * commands. This ID is treated as opaque data by the firmware and 26593 * the value is returned in the `hwrm_resp_hdr` upon completion. 26594 */ 26595 uint16_t seq_id; 26596 /* 26597 * The target ID of the command: 26598 * * 0x0-0xFFF8 - The function ID 26599 * * 0xFFF8-0xFFFE - Reserved for internal processors 26600 * * 0xFFFF - HWRM 26601 */ 26602 uint16_t target_id; 26603 /* 26604 * A physical address pointer pointing to a host buffer that the 26605 * command's response data will be written. This can be either a host 26606 * physical address (HPA) or a guest physical address (GPA) and must 26607 * point to a physically contiguous block of memory. 26608 */ 26609 uint64_t resp_addr; 26610 /* Directory Entry Type, to be verified. */ 26611 uint16_t dir_type; 26612 /* 26613 * Directory ordinal. 26614 * The instance of the Directory Type to be verified. 26615 */ 26616 uint16_t dir_ordinal; 26617 /* 26618 * The Directory Entry Extension flags. 26619 * The "UPDATE" extension flag must be set in this value. 26620 * A corresponding directory entry with the same type and ordinal values but *without* 26621 * the "UPDATE" extension flag must also exist. The other flags of the extension must 26622 * be identical between the active and update entries. 26623 */ 26624 uint16_t dir_ext; 26625 uint8_t unused_0[2]; 26626 } __attribute__((packed)); 26627 26628 /* hwrm_nvm_verify_update_output (size:128b/16B) */ 26629 struct hwrm_nvm_verify_update_output { 26630 /* The specific error status for the command. */ 26631 uint16_t error_code; 26632 /* The HWRM command request type. */ 26633 uint16_t req_type; 26634 /* The sequence ID from the original command. */ 26635 uint16_t seq_id; 26636 /* The length of the response data in number of bytes. */ 26637 uint16_t resp_len; 26638 uint8_t unused_0[7]; 26639 /* 26640 * This field is used in Output records to indicate that the output 26641 * is completely written to RAM. This field should be read as '1' 26642 * to indicate that the output has been completely written. 26643 * When writing a command completion or response to an internal processor, 26644 * the order of writes has to be such that this field is written last. 26645 */ 26646 uint8_t valid; 26647 } __attribute__((packed)); 26648 26649 /*************************** 26650 * hwrm_nvm_install_update * 26651 ***************************/ 26652 26653 26654 /* hwrm_nvm_install_update_input (size:192b/24B) */ 26655 struct hwrm_nvm_install_update_input { 26656 /* The HWRM command request type. */ 26657 uint16_t req_type; 26658 /* 26659 * The completion ring to send the completion event on. This should 26660 * be the NQ ID returned from the `nq_alloc` HWRM command. 26661 */ 26662 uint16_t cmpl_ring; 26663 /* 26664 * The sequence ID is used by the driver for tracking multiple 26665 * commands. This ID is treated as opaque data by the firmware and 26666 * the value is returned in the `hwrm_resp_hdr` upon completion. 26667 */ 26668 uint16_t seq_id; 26669 /* 26670 * The target ID of the command: 26671 * * 0x0-0xFFF8 - The function ID 26672 * * 0xFFF8-0xFFFE - Reserved for internal processors 26673 * * 0xFFFF - HWRM 26674 */ 26675 uint16_t target_id; 26676 /* 26677 * A physical address pointer pointing to a host buffer that the 26678 * command's response data will be written. This can be either a host 26679 * physical address (HPA) or a guest physical address (GPA) and must 26680 * point to a physically contiguous block of memory. 26681 */ 26682 uint64_t resp_addr; 26683 /* 26684 * Installation type. If the value 3 through 0xffff is used, 26685 * only packaged items with that type value will be installed and 26686 * conditional installation directives for those packaged items 26687 * will be over-ridden (i.e. 'create' or 'replace' will be treated 26688 * as 'install'). 26689 */ 26690 uint32_t install_type; 26691 /* 26692 * Perform a normal package installation. Conditional installation 26693 * directives (e.g. 'create' and 'replace') of packaged items 26694 * will be followed. 26695 */ 26696 #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_NORMAL UINT32_C(0x0) 26697 /* 26698 * Install all packaged items regardless of installation directive 26699 * (i.e. treat all packaged items as though they have an installation 26700 * directive of 'install'). 26701 */ 26702 #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL \ 26703 UINT32_C(0xffffffff) 26704 #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_LAST \ 26705 HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL 26706 uint16_t flags; 26707 /* If set to 1, then securely erase all unused locations in persistent storage. */ 26708 #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ERASE_UNUSED_SPACE \ 26709 UINT32_C(0x1) 26710 /* 26711 * If set to 1, then unspecifed images, images not in the package file, will be safely deleted. 26712 * When combined with erase_unused_space then unspecified images will be securely erased. 26713 */ 26714 #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_REMOVE_UNUSED_PKG \ 26715 UINT32_C(0x2) 26716 /* 26717 * If set to 1, FW will defragment the NVM if defragmentation is required for the update. 26718 * Allow additional time for this command to complete if this bit is set to 1. 26719 */ 26720 #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG \ 26721 UINT32_C(0x4) 26722 uint8_t unused_0[2]; 26723 } __attribute__((packed)); 26724 26725 /* hwrm_nvm_install_update_output (size:192b/24B) */ 26726 struct hwrm_nvm_install_update_output { 26727 /* The specific error status for the command. */ 26728 uint16_t error_code; 26729 /* The HWRM command request type. */ 26730 uint16_t req_type; 26731 /* The sequence ID from the original command. */ 26732 uint16_t seq_id; 26733 /* The length of the response data in number of bytes. */ 26734 uint16_t resp_len; 26735 /* 26736 * Bit-mask of successfully installed items. 26737 * Bit-0 corresponding to the first packaged item, Bit-1 for the second item, etc. 26738 * A value of 0 indicates that no items were successfully installed. 26739 */ 26740 uint64_t installed_items; 26741 /* result is 8 b */ 26742 uint8_t result; 26743 /* There was no problem with the package installation. */ 26744 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS UINT32_C(0x0) 26745 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_LAST \ 26746 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS 26747 /* problem_item is 8 b */ 26748 uint8_t problem_item; 26749 /* There was no problem with any packaged items. */ 26750 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_NONE \ 26751 UINT32_C(0x0) 26752 /* There was a problem with the NVM package itself. */ 26753 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE \ 26754 UINT32_C(0xff) 26755 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_LAST \ 26756 HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE 26757 /* reset_required is 8 b */ 26758 uint8_t reset_required; 26759 /* 26760 * No reset is required for installed/updated firmware or 26761 * microcode to take effect. 26762 */ 26763 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_NONE \ 26764 UINT32_C(0x0) 26765 /* 26766 * A PCIe reset (e.g. system reboot) is 26767 * required for newly installed/updated firmware or 26768 * microcode to take effect. 26769 */ 26770 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_PCI \ 26771 UINT32_C(0x1) 26772 /* 26773 * A controller power reset (e.g. system power-cycle) is 26774 * required for newly installed/updated firmware or 26775 * microcode to take effect. Some newly installed/updated 26776 * firmware or microcode may still take effect upon the 26777 * next PCIe reset. 26778 */ 26779 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER \ 26780 UINT32_C(0x2) 26781 #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_LAST \ 26782 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER 26783 uint8_t unused_0[4]; 26784 /* 26785 * This field is used in Output records to indicate that the output 26786 * is completely written to RAM. This field should be read as '1' 26787 * to indicate that the output has been completely written. 26788 * When writing a command completion or response to an internal processor, 26789 * the order of writes has to be such that this field is written last. 26790 */ 26791 uint8_t valid; 26792 } __attribute__((packed)); 26793 26794 /* hwrm_nvm_install_update_cmd_err (size:64b/8B) */ 26795 struct hwrm_nvm_install_update_cmd_err { 26796 /* 26797 * command specific error codes that goes to 26798 * the cmd_err field in Common HWRM Error Response. 26799 */ 26800 uint8_t code; 26801 /* Unknown error */ 26802 #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0) 26803 /* Unable to complete operation due to fragmentation */ 26804 #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1) 26805 /* nvm is completely full. */ 26806 #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2) 26807 #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_LAST \ 26808 HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE 26809 uint8_t unused_0[7]; 26810 } __attribute__((packed)); 26811 26812 /****************** 26813 * hwrm_nvm_flush * 26814 ******************/ 26815 26816 26817 /* hwrm_nvm_flush_input (size:128b/16B) */ 26818 struct hwrm_nvm_flush_input { 26819 /* The HWRM command request type. */ 26820 uint16_t req_type; 26821 /* 26822 * The completion ring to send the completion event on. This should 26823 * be the NQ ID returned from the `nq_alloc` HWRM command. 26824 */ 26825 uint16_t cmpl_ring; 26826 /* 26827 * The sequence ID is used by the driver for tracking multiple 26828 * commands. This ID is treated as opaque data by the firmware and 26829 * the value is returned in the `hwrm_resp_hdr` upon completion. 26830 */ 26831 uint16_t seq_id; 26832 /* 26833 * The target ID of the command: 26834 * * 0x0-0xFFF8 - The function ID 26835 * * 0xFFF8-0xFFFE - Reserved for internal processors 26836 * * 0xFFFF - HWRM 26837 */ 26838 uint16_t target_id; 26839 /* 26840 * A physical address pointer pointing to a host buffer that the 26841 * command's response data will be written. This can be either a host 26842 * physical address (HPA) or a guest physical address (GPA) and must 26843 * point to a physically contiguous block of memory. 26844 */ 26845 uint64_t resp_addr; 26846 } __attribute__((packed)); 26847 26848 /* hwrm_nvm_flush_output (size:128b/16B) */ 26849 struct hwrm_nvm_flush_output { 26850 /* The specific error status for the command. */ 26851 uint16_t error_code; 26852 /* The HWRM command request type. */ 26853 uint16_t req_type; 26854 /* The sequence ID from the original command. */ 26855 uint16_t seq_id; 26856 /* The length of the response data in number of bytes. */ 26857 uint16_t resp_len; 26858 uint8_t unused_0[7]; 26859 /* 26860 * This field is used in Output records to indicate that the output 26861 * is completely written to RAM. This field should be read as '1' 26862 * to indicate that the output has been completely written. 26863 * When writing a command completion or response to an internal processor, 26864 * the order of writes has to be such that this field is written last. 26865 */ 26866 uint8_t valid; 26867 } __attribute__((packed)); 26868 26869 /* hwrm_nvm_flush_cmd_err (size:64b/8B) */ 26870 struct hwrm_nvm_flush_cmd_err { 26871 /* 26872 * command specific error codes that goes to 26873 * the cmd_err field in Common HWRM Error Response. 26874 */ 26875 uint8_t code; 26876 /* Unknown error */ 26877 #define HWRM_NVM_FLUSH_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0) 26878 /* flush could not be performed */ 26879 #define HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL UINT32_C(0x1) 26880 #define HWRM_NVM_FLUSH_CMD_ERR_CODE_LAST \ 26881 HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL 26882 uint8_t unused_0[7]; 26883 } __attribute__((packed)); 26884 26885 /************************* 26886 * hwrm_nvm_get_variable * 26887 *************************/ 26888 26889 26890 /* hwrm_nvm_get_variable_input (size:320b/40B) */ 26891 struct hwrm_nvm_get_variable_input { 26892 /* The HWRM command request type. */ 26893 uint16_t req_type; 26894 /* 26895 * The completion ring to send the completion event on. This should 26896 * be the NQ ID returned from the `nq_alloc` HWRM command. 26897 */ 26898 uint16_t cmpl_ring; 26899 /* 26900 * The sequence ID is used by the driver for tracking multiple 26901 * commands. This ID is treated as opaque data by the firmware and 26902 * the value is returned in the `hwrm_resp_hdr` upon completion. 26903 */ 26904 uint16_t seq_id; 26905 /* 26906 * The target ID of the command: 26907 * * 0x0-0xFFF8 - The function ID 26908 * * 0xFFF8-0xFFFE - Reserved for internal processors 26909 * * 0xFFFF - HWRM 26910 */ 26911 uint16_t target_id; 26912 /* 26913 * A physical address pointer pointing to a host buffer that the 26914 * command's response data will be written. This can be either a host 26915 * physical address (HPA) or a guest physical address (GPA) and must 26916 * point to a physically contiguous block of memory. 26917 */ 26918 uint64_t resp_addr; 26919 /* 26920 * This is the host address where 26921 * nvm variable will be stored 26922 */ 26923 uint64_t dest_data_addr; 26924 /* size of data in bits */ 26925 uint16_t data_len; 26926 /* nvm cfg option number */ 26927 uint16_t option_num; 26928 /* reserved. */ 26929 #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_0 UINT32_C(0x0) 26930 /* reserved. */ 26931 #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \ 26932 UINT32_C(0xffff) 26933 #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_LAST \ 26934 HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF 26935 /* 26936 * Number of dimensions for this nvm configuration variable. 26937 * This value indicates how many of the indexN values to use. 26938 * A value of 0 means that none of the indexN values are valid. 26939 * A value of 1 requires at index0 is valued, a value of 2 26940 * requires that index0 and index1 are valid, and so forth 26941 */ 26942 uint16_t dimensions; 26943 /* index for the 1st dimensions */ 26944 uint16_t index_0; 26945 /* index for the 2nd dimensions */ 26946 uint16_t index_1; 26947 /* index for the 3rd dimensions */ 26948 uint16_t index_2; 26949 /* index for the 4th dimensions */ 26950 uint16_t index_3; 26951 uint8_t flags; 26952 /* 26953 * When this bit is set to 1, the factory default value will be returned, 26954 * 0 returns the operational value. 26955 */ 26956 #define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT \ 26957 UINT32_C(0x1) 26958 uint8_t unused_0; 26959 } __attribute__((packed)); 26960 26961 /* hwrm_nvm_get_variable_output (size:128b/16B) */ 26962 struct hwrm_nvm_get_variable_output { 26963 /* The specific error status for the command. */ 26964 uint16_t error_code; 26965 /* The HWRM command request type. */ 26966 uint16_t req_type; 26967 /* The sequence ID from the original command. */ 26968 uint16_t seq_id; 26969 /* The length of the response data in number of bytes. */ 26970 uint16_t resp_len; 26971 /* size of data of the actual variable retrieved in bits */ 26972 uint16_t data_len; 26973 /* 26974 * option_num is the option number for the data retrieved. It is possible in the 26975 * future that the option number returned would be different than requested. This 26976 * condition could occur if an option is deprecated and a new option id is defined 26977 * with similar characteristics, but has a slightly different definition. This 26978 * also makes it convenient for the caller to identify the variable result with 26979 * the option id from the response. 26980 */ 26981 uint16_t option_num; 26982 /* reserved. */ 26983 #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_0 UINT32_C(0x0) 26984 /* reserved. */ 26985 #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF \ 26986 UINT32_C(0xffff) 26987 #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_LAST \ 26988 HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF 26989 uint8_t unused_0[3]; 26990 /* 26991 * This field is used in Output records to indicate that the output 26992 * is completely written to RAM. This field should be read as '1' 26993 * to indicate that the output has been completely written. 26994 * When writing a command completion or response to an internal processor, 26995 * the order of writes has to be such that this field is written last. 26996 */ 26997 uint8_t valid; 26998 } __attribute__((packed)); 26999 27000 /* hwrm_nvm_get_variable_cmd_err (size:64b/8B) */ 27001 struct hwrm_nvm_get_variable_cmd_err { 27002 /* 27003 * command specific error codes that goes to 27004 * the cmd_err field in Common HWRM Error Response. 27005 */ 27006 uint8_t code; 27007 /* Unknown error */ 27008 #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0) 27009 /* variable does not exist */ 27010 #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1) 27011 /* configuration is corrupted and the variable cannot be saved */ 27012 #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR UINT32_C(0x2) 27013 /* length specified is too small */ 27014 #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT UINT32_C(0x3) 27015 #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LAST \ 27016 HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT 27017 uint8_t unused_0[7]; 27018 } __attribute__((packed)); 27019 27020 /************************* 27021 * hwrm_nvm_set_variable * 27022 *************************/ 27023 27024 27025 /* hwrm_nvm_set_variable_input (size:320b/40B) */ 27026 struct hwrm_nvm_set_variable_input { 27027 /* The HWRM command request type. */ 27028 uint16_t req_type; 27029 /* 27030 * The completion ring to send the completion event on. This should 27031 * be the NQ ID returned from the `nq_alloc` HWRM command. 27032 */ 27033 uint16_t cmpl_ring; 27034 /* 27035 * The sequence ID is used by the driver for tracking multiple 27036 * commands. This ID is treated as opaque data by the firmware and 27037 * the value is returned in the `hwrm_resp_hdr` upon completion. 27038 */ 27039 uint16_t seq_id; 27040 /* 27041 * The target ID of the command: 27042 * * 0x0-0xFFF8 - The function ID 27043 * * 0xFFF8-0xFFFE - Reserved for internal processors 27044 * * 0xFFFF - HWRM 27045 */ 27046 uint16_t target_id; 27047 /* 27048 * A physical address pointer pointing to a host buffer that the 27049 * command's response data will be written. This can be either a host 27050 * physical address (HPA) or a guest physical address (GPA) and must 27051 * point to a physically contiguous block of memory. 27052 */ 27053 uint64_t resp_addr; 27054 /* 27055 * This is the host address where 27056 * nvm variable will be copied from 27057 */ 27058 uint64_t src_data_addr; 27059 /* size of data in bits */ 27060 uint16_t data_len; 27061 /* nvm cfg option number */ 27062 uint16_t option_num; 27063 /* reserved. */ 27064 #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_0 UINT32_C(0x0) 27065 /* reserved. */ 27066 #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \ 27067 UINT32_C(0xffff) 27068 #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_LAST \ 27069 HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF 27070 /* 27071 * Number of dimensions for this nvm configuration variable. 27072 * This value indicates how many of the indexN values to use. 27073 * A value of 0 means that none of the indexN values are valid. 27074 * A value of 1 requires at index0 is valued, a value of 2 27075 * requires that index0 and index1 are valid, and so forth 27076 */ 27077 uint16_t dimensions; 27078 /* index for the 1st dimensions */ 27079 uint16_t index_0; 27080 /* index for the 2nd dimensions */ 27081 uint16_t index_1; 27082 /* index for the 3rd dimensions */ 27083 uint16_t index_2; 27084 /* index for the 4th dimensions */ 27085 uint16_t index_3; 27086 uint8_t flags; 27087 /* When this bit is 1, flush internal cache after this write operation (see hwrm_nvm_flush command.) */ 27088 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FORCE_FLUSH \ 27089 UINT32_C(0x1) 27090 /* encryption method */ 27091 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_MASK \ 27092 UINT32_C(0xe) 27093 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_SFT 1 27094 /* No encryption. */ 27095 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_NONE \ 27096 (UINT32_C(0x0) << 1) 27097 /* one-way encryption. */ 27098 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1 \ 27099 (UINT32_C(0x1) << 1) 27100 /* symmetric AES256 encryption. */ 27101 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_AES256 \ 27102 (UINT32_C(0x2) << 1) 27103 /* SHA1 digest appended to plaintext contents, for authentication */ 27104 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH \ 27105 (UINT32_C(0x3) << 1) 27106 #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_LAST \ 27107 HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH 27108 uint8_t unused_0; 27109 } __attribute__((packed)); 27110 27111 /* hwrm_nvm_set_variable_output (size:128b/16B) */ 27112 struct hwrm_nvm_set_variable_output { 27113 /* The specific error status for the command. */ 27114 uint16_t error_code; 27115 /* The HWRM command request type. */ 27116 uint16_t req_type; 27117 /* The sequence ID from the original command. */ 27118 uint16_t seq_id; 27119 /* The length of the response data in number of bytes. */ 27120 uint16_t resp_len; 27121 uint8_t unused_0[7]; 27122 /* 27123 * This field is used in Output records to indicate that the output 27124 * is completely written to RAM. This field should be read as '1' 27125 * to indicate that the output has been completely written. 27126 * When writing a command completion or response to an internal processor, 27127 * the order of writes has to be such that this field is written last. 27128 */ 27129 uint8_t valid; 27130 } __attribute__((packed)); 27131 27132 /* hwrm_nvm_set_variable_cmd_err (size:64b/8B) */ 27133 struct hwrm_nvm_set_variable_cmd_err { 27134 /* 27135 * command specific error codes that goes to 27136 * the cmd_err field in Common HWRM Error Response. 27137 */ 27138 uint8_t code; 27139 /* Unknown error */ 27140 #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0) 27141 /* variable does not exist */ 27142 #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1) 27143 /* configuration is corrupted and the variable cannot be saved */ 27144 #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR UINT32_C(0x2) 27145 #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_LAST \ 27146 HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR 27147 uint8_t unused_0[7]; 27148 } __attribute__((packed)); 27149 27150 /**************************** 27151 * hwrm_nvm_validate_option * 27152 ****************************/ 27153 27154 27155 /* hwrm_nvm_validate_option_input (size:320b/40B) */ 27156 struct hwrm_nvm_validate_option_input { 27157 /* The HWRM command request type. */ 27158 uint16_t req_type; 27159 /* 27160 * The completion ring to send the completion event on. This should 27161 * be the NQ ID returned from the `nq_alloc` HWRM command. 27162 */ 27163 uint16_t cmpl_ring; 27164 /* 27165 * The sequence ID is used by the driver for tracking multiple 27166 * commands. This ID is treated as opaque data by the firmware and 27167 * the value is returned in the `hwrm_resp_hdr` upon completion. 27168 */ 27169 uint16_t seq_id; 27170 /* 27171 * The target ID of the command: 27172 * * 0x0-0xFFF8 - The function ID 27173 * * 0xFFF8-0xFFFE - Reserved for internal processors 27174 * * 0xFFFF - HWRM 27175 */ 27176 uint16_t target_id; 27177 /* 27178 * A physical address pointer pointing to a host buffer that the 27179 * command's response data will be written. This can be either a host 27180 * physical address (HPA) or a guest physical address (GPA) and must 27181 * point to a physically contiguous block of memory. 27182 */ 27183 uint64_t resp_addr; 27184 /* 27185 * This is the host address where 27186 * nvm variable will be copied from 27187 */ 27188 uint64_t src_data_addr; 27189 /* size of data in bits */ 27190 uint16_t data_len; 27191 /* nvm cfg option number */ 27192 uint16_t option_num; 27193 /* reserved. */ 27194 #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_0 \ 27195 UINT32_C(0x0) 27196 /* reserved. */ 27197 #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF \ 27198 UINT32_C(0xffff) 27199 #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_LAST \ 27200 HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF 27201 /* 27202 * Number of dimensions for this nvm configuration variable. 27203 * This value indicates how many of the indexN values to use. 27204 * A value of 0 means that none of the indexN values are valid. 27205 * A value of 1 requires at index0 is valued, a value of 2 27206 * requires that index0 and index1 are valid, and so forth 27207 */ 27208 uint16_t dimensions; 27209 /* index for the 1st dimensions */ 27210 uint16_t index_0; 27211 /* index for the 2nd dimensions */ 27212 uint16_t index_1; 27213 /* index for the 3rd dimensions */ 27214 uint16_t index_2; 27215 /* index for the 4th dimensions */ 27216 uint16_t index_3; 27217 uint8_t unused_0[2]; 27218 } __attribute__((packed)); 27219 27220 /* hwrm_nvm_validate_option_output (size:128b/16B) */ 27221 struct hwrm_nvm_validate_option_output { 27222 /* The specific error status for the command. */ 27223 uint16_t error_code; 27224 /* The HWRM command request type. */ 27225 uint16_t req_type; 27226 /* The sequence ID from the original command. */ 27227 uint16_t seq_id; 27228 /* The length of the response data in number of bytes. */ 27229 uint16_t resp_len; 27230 uint8_t result; 27231 /* indicates that the value provided for the option is not matching with the saved data. */ 27232 #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_NOT_MATCH UINT32_C(0x0) 27233 /* indicates that the value provided for the option is matching the saved data. */ 27234 #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH UINT32_C(0x1) 27235 #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_LAST \ 27236 HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH 27237 uint8_t unused_0[6]; 27238 /* 27239 * This field is used in Output records to indicate that the output 27240 * is completely written to RAM. This field should be read as '1' 27241 * to indicate that the output has been completely written. 27242 * When writing a command completion or response to an internal processor, 27243 * the order of writes has to be such that this field is written last. 27244 */ 27245 uint8_t valid; 27246 } __attribute__((packed)); 27247 27248 /* hwrm_nvm_validate_option_cmd_err (size:64b/8B) */ 27249 struct hwrm_nvm_validate_option_cmd_err { 27250 /* 27251 * command specific error codes that goes to 27252 * the cmd_err field in Common HWRM Error Response. 27253 */ 27254 uint8_t code; 27255 /* Unknown error */ 27256 #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0) 27257 #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_LAST \ 27258 HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN 27259 uint8_t unused_0[7]; 27260 } __attribute__((packed)); 27261 27262 #endif /* _HSI_STRUCT_DEF_DPDK_H_ */ 27263