xref: /freebsd/sys/dev/bnxt/bnxt_en/hsi_struct_def.h (revision bb90baed6c275495b03adc5569346a59fce2a3c8)
1 /*-
2  *   BSD LICENSE
3  *
4  *   Copyright (c) 2025 Broadcom, All Rights Reserved.
5  *   The term Broadcom refers to Broadcom Limited and/or its subsidiaries
6  *
7  *   Redistribution and use in source and binary forms, with or without
8  *   modification, are permitted provided that the following conditions
9  *   are met:
10  *     * Redistributions of source code must retain the above copyright
11  *       notice, this list of conditions and the following disclaimer.
12  *     * Redistributions in binary form must reproduce the above copyright
13  *       notice, this list of conditions and the following disclaimer in
14  *       the documentation and/or other materials provided with the
15  *       distribution.
16  *
17  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #include <sys/cdefs.h>
31 __FBSDID("$FreeBSD$");
32 
33 /*
34  * Copyright(c) 2001-2025, Broadcom. All rights reserved. The
35  * term Broadcom refers to Broadcom Inc. and/or its subsidiaries.
36  * Proprietary and Confidential Information.
37  *
38  * This source file is the property of Broadcom Corporation, and
39  * may not be copied or distributed in any isomorphic form without
40  * the prior written consent of Broadcom Corporation.
41  *
42  * DO NOT MODIFY!!! This file is automatically generated.
43  */
44 
45 #ifndef _HSI_STRUCT_DEF_H_
46 #define _HSI_STRUCT_DEF_H_
47 
48 #if defined(HAVE_STDINT_H)
49 #include <stdint.h>
50 #endif
51 
52 /* This is the HWRM command header. */
53 /* hwrm_cmd_hdr (size:128b/16B) */
54 
55 typedef struct hwrm_cmd_hdr {
56 	/* The HWRM command request type. */
57 	uint16_t	req_type;
58 	/*
59 	 * The completion ring to send the completion event on. This should
60 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61 	 */
62 	uint16_t	cmpl_ring;
63 	/*
64 	 * The sequence ID is used by the driver for tracking multiple
65 	 * commands. This ID is treated as opaque data by the firmware and
66 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
67 	 */
68 	uint16_t	seq_id;
69 	/*
70 	 * The target ID of the command:
71 	 * * 0x0-0xFFF8 - The function ID
72 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
73 	 * * 0xFFFD - Reserved for user-space HWRM interface
74 	 * * 0xFFFF - HWRM
75 	 */
76 	uint16_t	target_id;
77 	/*
78 	 * A physical address pointer pointing to a host buffer that the
79 	 * command's response data will be written. This can be either a host
80 	 * physical address (HPA) or a guest physical address (GPA) and must
81 	 * point to a physically contiguous block of memory.
82 	 */
83 	uint64_t	resp_addr;
84 } hwrm_cmd_hdr_t, *phwrm_cmd_hdr_t;
85 
86 /* This is the HWRM response header. */
87 /* hwrm_resp_hdr (size:64b/8B) */
88 
89 typedef struct hwrm_resp_hdr {
90 	/* The specific error status for the command. */
91 	uint16_t	error_code;
92 	/* The HWRM command request type. */
93 	uint16_t	req_type;
94 	/* The sequence ID from the original command. */
95 	uint16_t	seq_id;
96 	/* The length of the response data in number of bytes. */
97 	uint16_t	resp_len;
98 } hwrm_resp_hdr_t, *phwrm_resp_hdr_t;
99 
100 /*
101  * TLV encapsulated message. Use the TLV type field of the
102  * TLV to determine the type of message encapsulated.
103  */
104 #define CMD_DISCR_TLV_ENCAP UINT32_C(0x8000)
105 #define CMD_DISCR_LAST	CMD_DISCR_TLV_ENCAP
106 
107 
108 /* HWRM request message */
109 #define TLV_TYPE_HWRM_REQUEST			UINT32_C(0x1)
110 /* HWRM response message */
111 #define TLV_TYPE_HWRM_RESPONSE		UINT32_C(0x2)
112 /* RoCE slow path command */
113 #define TLV_TYPE_ROCE_SP_COMMAND		UINT32_C(0x3)
114 /* RoCE slow path command to query CC Gen1 support. */
115 #define TLV_TYPE_QUERY_ROCE_CC_GEN1		UINT32_C(0x4)
116 /* RoCE slow path command to modify CC Gen1 support. */
117 #define TLV_TYPE_MODIFY_ROCE_CC_GEN1		UINT32_C(0x5)
118 /* RoCE slow path command to query CC Gen2 support. */
119 #define TLV_TYPE_QUERY_ROCE_CC_GEN2		UINT32_C(0x6)
120 /* RoCE slow path command to modify CC Gen2 support. */
121 #define TLV_TYPE_MODIFY_ROCE_CC_GEN2		UINT32_C(0x7)
122 /* Engine CKV - The Alias key EC curve and ECC public key information. */
123 #define TLV_TYPE_ENGINE_CKV_ALIAS_ECC_PUBLIC_KEY UINT32_C(0x8001)
124 /* Engine CKV - Initialization vector. */
125 #define TLV_TYPE_ENGINE_CKV_IV		UINT32_C(0x8003)
126 /* Engine CKV - Authentication tag. */
127 #define TLV_TYPE_ENGINE_CKV_AUTH_TAG		UINT32_C(0x8004)
128 /* Engine CKV - The encrypted data. */
129 #define TLV_TYPE_ENGINE_CKV_CIPHERTEXT	UINT32_C(0x8005)
130 /* Engine CKV - Supported host_algorithms. */
131 #define TLV_TYPE_ENGINE_CKV_HOST_ALGORITHMS	UINT32_C(0x8006)
132 /* Engine CKV - The Host EC curve name and ECC public key information. */
133 #define TLV_TYPE_ENGINE_CKV_HOST_ECC_PUBLIC_KEY  UINT32_C(0x8007)
134 /* Engine CKV - The ECDSA signature. */
135 #define TLV_TYPE_ENGINE_CKV_ECDSA_SIGNATURE	UINT32_C(0x8008)
136 /* Engine CKV - The firmware EC curve name and ECC public key information. */
137 #define TLV_TYPE_ENGINE_CKV_FW_ECC_PUBLIC_KEY	UINT32_C(0x8009)
138 /* Engine CKV - Supported firmware algorithms. */
139 #define TLV_TYPE_ENGINE_CKV_FW_ALGORITHMS	UINT32_C(0x800a)
140 #define TLV_TYPE_LAST			TLV_TYPE_ENGINE_CKV_FW_ALGORITHMS
141 
142 
143 /* tlv (size:64b/8B) */
144 
145 typedef struct tlv {
146 	/*
147 	 * The command discriminator is used to differentiate between various
148 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
149 	 * command messages as well as newer TLV encapsulated HWRM commands.
150 	 *
151 	 * For TLV encapsulated messages this field must be 0x8000.
152 	 */
153 	uint16_t	cmd_discr;
154 	uint8_t	reserved_8b;
155 	uint8_t	flags;
156 	/*
157 	 * Indicates the presence of additional TLV encapsulated data
158 	 * follows this TLV.
159 	 */
160 	#define TLV_FLAGS_MORE	UINT32_C(0x1)
161 	/* Last TLV in a sequence of TLVs. */
162 		#define TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
163 	/* More TLVs follow this TLV. */
164 		#define TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
165 	/*
166 	 * When an HWRM receiver detects a TLV type that it does not
167 	 * support with the TLV required flag set, the receiver must
168 	 * reject the HWRM message with an error code indicating an
169 	 * unsupported TLV type.
170 	 */
171 	#define TLV_FLAGS_REQUIRED	UINT32_C(0x2)
172 	/* No */
173 		#define TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
174 	/* Yes */
175 		#define TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
176 		#define TLV_FLAGS_REQUIRED_LAST TLV_FLAGS_REQUIRED_YES
177 	/*
178 	 * This field defines the TLV type value which is divided into
179 	 * two ranges to differentiate between global and local TLV types.
180 	 * Global TLV types must be unique across all defined TLV types.
181 	 * Local TLV types are valid only for extensions to a given
182 	 * HWRM message and may be repeated across different HWRM message
183 	 * types. There is a direct correlation of each HWRM message type
184 	 * to a single global TLV type value.
185 	 *
186 	 * Global TLV range: `0 - (63k-1)`
187 	 *
188 	 * Local TLV range: `63k - (64k-1)`
189 	 */
190 	uint16_t	tlv_type;
191 	/*
192 	 * Length of the message data encapsulated by this TLV in bytes.
193 	 * This length does not include the size of the TLV header itself
194 	 * and it must be an integer multiple of 8B.
195 	 */
196 	uint16_t	length;
197 } tlv_t, *ptlv_t;
198 
199 /* Input */
200 /* input (size:128b/16B) */
201 
202 typedef struct input {
203 	/*
204 	 * This value indicates what type of request this is. The format
205 	 * for the rest of the command is determined by this field.
206 	 */
207 	uint16_t	req_type;
208 	/*
209 	 * This value indicates the what completion ring the request will
210 	 * be optionally completed on. If the value is -1, then no
211 	 * CR completion will be generated. Any other value must be a
212 	 * valid CR ring_id value for this function.
213 	 */
214 	uint16_t	cmpl_ring;
215 	/* This value indicates the command sequence number. */
216 	uint16_t	seq_id;
217 	/*
218 	 * Target ID of this command.
219 	 *
220 	 * 0x0 - 0xFFF8 - Used for function ids
221 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
222 	 * 0xFFFF - HWRM
223 	 */
224 	uint16_t	target_id;
225 	/*
226 	 * This is the host address where the response will be written
227 	 * when the request is complete. This area must be 16B aligned
228 	 * and must be cleared to zero before the request is made.
229 	 */
230 	uint64_t	resp_addr;
231 } input_t, *pinput_t;
232 
233 /* Output */
234 /* output (size:64b/8B) */
235 
236 typedef struct output {
237 	/*
238 	 * Pass/Fail or error type
239 	 *
240 	 * Note: receiver to verify the in parameters, and fail the call
241 	 * with an error when appropriate
242 	 */
243 	uint16_t	error_code;
244 	/* This field returns the type of original request. */
245 	uint16_t	req_type;
246 	/* This field provides original sequence number of the command. */
247 	uint16_t	seq_id;
248 	/*
249 	 * This field is the length of the response in bytes. The
250 	 * last byte of the response is a valid flag that will read
251 	 * as '1' when the command has been completely written to
252 	 * memory.
253 	 */
254 	uint16_t	resp_len;
255 } output_t, *poutput_t;
256 
257 /* Short Command Structure */
258 /* hwrm_short_input (size:128b/16B) */
259 
260 typedef struct hwrm_short_input {
261 	/*
262 	 * This field indicates the type of request in the request buffer.
263 	 * The format for the rest of the command (request) is determined
264 	 * by this field.
265 	 */
266 	uint16_t	req_type;
267 	/*
268 	 * This field indicates a signature that is used to identify short
269 	 * form of the command listed here. This field shall be set to
270 	 * 17185 (0x4321).
271 	 */
272 	uint16_t	signature;
273 	/* Signature indicating this is a short form of HWRM command */
274 	#define HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD UINT32_C(0x4321)
275 	#define HWRM_SHORT_INPUT_SIGNATURE_LAST	HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD
276 	/* The target ID of the command */
277 	uint16_t	target_id;
278 	/* Default target_id (0x0) to maintain compatibility with old driver */
279 	#define HWRM_SHORT_INPUT_TARGET_ID_DEFAULT UINT32_C(0x0)
280 	/* Reserved for user-space HWRM interface */
281 	#define HWRM_SHORT_INPUT_TARGET_ID_TOOLS   UINT32_C(0xfffd)
282 	#define HWRM_SHORT_INPUT_TARGET_ID_LAST   HWRM_SHORT_INPUT_TARGET_ID_TOOLS
283 	/* This value indicates the length of the request. */
284 	uint16_t	size;
285 	/*
286 	 * This is the host address where the request was written.
287 	 * This area must be 16B aligned.
288 	 */
289 	uint64_t	req_addr;
290 } hwrm_short_input_t, *phwrm_short_input_t;
291 
292 #define GET_HWRM_REQ_TYPE(x) \
293 	(((x) < 0x80) ? \
294 	((x) == 0x0 ? "HWRM_VER_GET": \
295 	((x) == 0xb ? "HWRM_FUNC_ECHO_RESPONSE": \
296 	((x) == 0xc ? "HWRM_ERROR_RECOVERY_QCFG": \
297 	((x) == 0xd ? "HWRM_FUNC_DRV_IF_CHANGE": \
298 	((x) == 0xe ? "HWRM_FUNC_BUF_UNRGTR": \
299 	((x) == 0xf ? "HWRM_FUNC_VF_CFG": \
300 	((x) == 0x10 ? "HWRM_RESERVED1": \
301 	((x) == 0x11 ? "HWRM_FUNC_RESET": \
302 	((x) == 0x12 ? "HWRM_FUNC_GETFID": \
303 	((x) == 0x13 ? "HWRM_FUNC_VF_ALLOC": \
304 	((x) == 0x14 ? "HWRM_FUNC_VF_FREE": \
305 	((x) == 0x15 ? "HWRM_FUNC_QCAPS": \
306 	((x) == 0x16 ? "HWRM_FUNC_QCFG": \
307 	((x) == 0x17 ? "HWRM_FUNC_CFG": \
308 	((x) == 0x18 ? "HWRM_FUNC_QSTATS": \
309 	((x) == 0x19 ? "HWRM_FUNC_CLR_STATS": \
310 	((x) == 0x1a ? "HWRM_FUNC_DRV_UNRGTR": \
311 	((x) == 0x1b ? "HWRM_FUNC_VF_RESC_FREE": \
312 	((x) == 0x1c ? "HWRM_FUNC_VF_VNIC_IDS_QUERY": \
313 	((x) == 0x1d ? "HWRM_FUNC_DRV_RGTR": \
314 	((x) == 0x1e ? "HWRM_FUNC_DRV_QVER": \
315 	((x) == 0x1f ? "HWRM_FUNC_BUF_RGTR": \
316 	((x) == 0x20 ? "HWRM_PORT_PHY_CFG": \
317 	((x) == 0x21 ? "HWRM_PORT_MAC_CFG": \
318 	((x) == 0x22 ? "HWRM_PORT_TS_QUERY": \
319 	((x) == 0x23 ? "HWRM_PORT_QSTATS": \
320 	((x) == 0x24 ? "HWRM_PORT_LPBK_QSTATS": \
321 	((x) == 0x25 ? "HWRM_PORT_CLR_STATS": \
322 	((x) == 0x26 ? "HWRM_PORT_LPBK_CLR_STATS": \
323 	((x) == 0x27 ? "HWRM_PORT_PHY_QCFG": \
324 	((x) == 0x28 ? "HWRM_PORT_MAC_QCFG": \
325 	((x) == 0x29 ? "HWRM_PORT_MAC_PTP_QCFG": \
326 	((x) == 0x2a ? "HWRM_PORT_PHY_QCAPS": \
327 	((x) == 0x2b ? "HWRM_PORT_PHY_I2C_WRITE": \
328 	((x) == 0x2c ? "HWRM_PORT_PHY_I2C_READ": \
329 	((x) == 0x2d ? "HWRM_PORT_LED_CFG": \
330 	((x) == 0x2e ? "HWRM_PORT_LED_QCFG": \
331 	((x) == 0x2f ? "HWRM_PORT_LED_QCAPS": \
332 	((x) == 0x30 ? "HWRM_QUEUE_QPORTCFG": \
333 	((x) == 0x31 ? "HWRM_QUEUE_QCFG": \
334 	((x) == 0x32 ? "HWRM_QUEUE_CFG": \
335 	((x) == 0x33 ? "HWRM_FUNC_VLAN_CFG": \
336 	((x) == 0x34 ? "HWRM_FUNC_VLAN_QCFG": \
337 	((x) == 0x35 ? "HWRM_QUEUE_PFCENABLE_QCFG": \
338 	((x) == 0x36 ? "HWRM_QUEUE_PFCENABLE_CFG": \
339 	((x) == 0x37 ? "HWRM_QUEUE_PRI2COS_QCFG": \
340 	((x) == 0x38 ? "HWRM_QUEUE_PRI2COS_CFG": \
341 	((x) == 0x39 ? "HWRM_QUEUE_COS2BW_QCFG": \
342 	((x) == 0x3a ? "HWRM_QUEUE_COS2BW_CFG": \
343 	((x) == 0x3b ? "HWRM_QUEUE_DSCP_QCAPS": \
344 	((x) == 0x3c ? "HWRM_QUEUE_DSCP2PRI_QCFG": \
345 	((x) == 0x3d ? "HWRM_QUEUE_DSCP2PRI_CFG": \
346 	((x) == 0x40 ? "HWRM_VNIC_ALLOC": \
347 	((x) == 0x41 ? "HWRM_VNIC_FREE": \
348 	((x) == 0x42 ? "HWRM_VNIC_CFG": \
349 	((x) == 0x43 ? "HWRM_VNIC_QCFG": \
350 	((x) == 0x44 ? "HWRM_VNIC_TPA_CFG": \
351 	((x) == 0x45 ? "HWRM_VNIC_TPA_QCFG": \
352 	((x) == 0x46 ? "HWRM_VNIC_RSS_CFG": \
353 	((x) == 0x47 ? "HWRM_VNIC_RSS_QCFG": \
354 	((x) == 0x48 ? "HWRM_VNIC_PLCMODES_CFG": \
355 	((x) == 0x49 ? "HWRM_VNIC_PLCMODES_QCFG": \
356 	((x) == 0x4a ? "HWRM_VNIC_QCAPS": \
357 	((x) == 0x4b ? "HWRM_VNIC_UPDATE": \
358 	((x) == 0x50 ? "HWRM_RING_ALLOC": \
359 	((x) == 0x51 ? "HWRM_RING_FREE": \
360 	((x) == 0x52 ? "HWRM_RING_CMPL_RING_QAGGINT_PARAMS": \
361 	((x) == 0x53 ? "HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS": \
362 	((x) == 0x54 ? "HWRM_RING_AGGINT_QCAPS": \
363 	((x) == 0x55 ? "HWRM_RING_SCHQ_ALLOC": \
364 	((x) == 0x56 ? "HWRM_RING_SCHQ_CFG": \
365 	((x) == 0x57 ? "HWRM_RING_SCHQ_FREE": \
366 	((x) == 0x5e ? "HWRM_RING_RESET": \
367 	((x) == 0x60 ? "HWRM_RING_GRP_ALLOC": \
368 	((x) == 0x61 ? "HWRM_RING_GRP_FREE": \
369 	((x) == 0x62 ? "HWRM_RING_CFG": \
370 	((x) == 0x63 ? "HWRM_RING_QCFG": \
371 	((x) == 0x64 ? "HWRM_RESERVED5": \
372 	((x) == 0x65 ? "HWRM_RESERVED6": \
373 	((x) == 0x70 ? "HWRM_VNIC_RSS_COS_LB_CTX_ALLOC": \
374 	((x) == 0x71 ? "HWRM_VNIC_RSS_COS_LB_CTX_FREE": \
375 	"Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \
376 	(((x) < 0x100) ? \
377 	((x) == 0x80 ? "HWRM_QUEUE_MPLS_QCAPS": \
378 	((x) == 0x81 ? "HWRM_QUEUE_MPLSTC2PRI_QCFG": \
379 	((x) == 0x82 ? "HWRM_QUEUE_MPLSTC2PRI_CFG": \
380 	((x) == 0x83 ? "HWRM_QUEUE_VLANPRI_QCAPS": \
381 	((x) == 0x84 ? "HWRM_QUEUE_VLANPRI2PRI_QCFG": \
382 	((x) == 0x85 ? "HWRM_QUEUE_VLANPRI2PRI_CFG": \
383 	((x) == 0x86 ? "HWRM_QUEUE_GLOBAL_CFG": \
384 	((x) == 0x87 ? "HWRM_QUEUE_GLOBAL_QCFG": \
385 	((x) == 0x88 ? "HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG": \
386 	((x) == 0x89 ? "HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG": \
387 	((x) == 0x8a ? "HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG": \
388 	((x) == 0x8b ? "HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG": \
389 	((x) == 0x8c ? "HWRM_QUEUE_QCAPS": \
390 	((x) == 0x8d ? "HWRM_QUEUE_ADPTV_QOS_RX_TUNING_QCFG": \
391 	((x) == 0x8e ? "HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG": \
392 	((x) == 0x8f ? "HWRM_QUEUE_ADPTV_QOS_TX_TUNING_QCFG": \
393 	((x) == 0x90 ? "HWRM_CFA_L2_FILTER_ALLOC": \
394 	((x) == 0x91 ? "HWRM_CFA_L2_FILTER_FREE": \
395 	((x) == 0x92 ? "HWRM_CFA_L2_FILTER_CFG": \
396 	((x) == 0x93 ? "HWRM_CFA_L2_SET_RX_MASK": \
397 	((x) == 0x94 ? "HWRM_CFA_VLAN_ANTISPOOF_CFG": \
398 	((x) == 0x95 ? "HWRM_CFA_TUNNEL_FILTER_ALLOC": \
399 	((x) == 0x96 ? "HWRM_CFA_TUNNEL_FILTER_FREE": \
400 	((x) == 0x97 ? "HWRM_CFA_ENCAP_RECORD_ALLOC": \
401 	((x) == 0x98 ? "HWRM_CFA_ENCAP_RECORD_FREE": \
402 	((x) == 0x99 ? "HWRM_CFA_NTUPLE_FILTER_ALLOC": \
403 	((x) == 0x9a ? "HWRM_CFA_NTUPLE_FILTER_FREE": \
404 	((x) == 0x9b ? "HWRM_CFA_NTUPLE_FILTER_CFG": \
405 	((x) == 0x9c ? "HWRM_CFA_EM_FLOW_ALLOC": \
406 	((x) == 0x9d ? "HWRM_CFA_EM_FLOW_FREE": \
407 	((x) == 0x9e ? "HWRM_CFA_EM_FLOW_CFG": \
408 	((x) == 0xa0 ? "HWRM_TUNNEL_DST_PORT_QUERY": \
409 	((x) == 0xa1 ? "HWRM_TUNNEL_DST_PORT_ALLOC": \
410 	((x) == 0xa2 ? "HWRM_TUNNEL_DST_PORT_FREE": \
411 	((x) == 0xa3 ? "HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG": \
412 	((x) == 0xaf ? "HWRM_STAT_CTX_ENG_QUERY": \
413 	((x) == 0xb0 ? "HWRM_STAT_CTX_ALLOC": \
414 	((x) == 0xb1 ? "HWRM_STAT_CTX_FREE": \
415 	((x) == 0xb2 ? "HWRM_STAT_CTX_QUERY": \
416 	((x) == 0xb3 ? "HWRM_STAT_CTX_CLR_STATS": \
417 	((x) == 0xb4 ? "HWRM_PORT_QSTATS_EXT": \
418 	((x) == 0xb5 ? "HWRM_PORT_PHY_MDIO_WRITE": \
419 	((x) == 0xb6 ? "HWRM_PORT_PHY_MDIO_READ": \
420 	((x) == 0xb7 ? "HWRM_PORT_PHY_MDIO_BUS_ACQUIRE": \
421 	((x) == 0xb8 ? "HWRM_PORT_PHY_MDIO_BUS_RELEASE": \
422 	((x) == 0xb9 ? "HWRM_PORT_QSTATS_EXT_PFC_WD": \
423 	((x) == 0xba ? "HWRM_RESERVED7": \
424 	((x) == 0xbb ? "HWRM_PORT_TX_FIR_CFG": \
425 	((x) == 0xbc ? "HWRM_PORT_TX_FIR_QCFG": \
426 	((x) == 0xbd ? "HWRM_PORT_ECN_QSTATS": \
427 	((x) == 0xbe ? "HWRM_FW_LIVEPATCH_QUERY": \
428 	((x) == 0xbf ? "HWRM_FW_LIVEPATCH": \
429 	((x) == 0xc0 ? "HWRM_FW_RESET": \
430 	((x) == 0xc1 ? "HWRM_FW_QSTATUS": \
431 	((x) == 0xc2 ? "HWRM_FW_HEALTH_CHECK": \
432 	((x) == 0xc3 ? "HWRM_FW_SYNC": \
433 	((x) == 0xc4 ? "HWRM_FW_STATE_QCAPS": \
434 	((x) == 0xc5 ? "HWRM_FW_STATE_QUIESCE": \
435 	((x) == 0xc6 ? "HWRM_FW_STATE_BACKUP": \
436 	((x) == 0xc7 ? "HWRM_FW_STATE_RESTORE": \
437 	((x) == 0xc8 ? "HWRM_FW_SET_TIME": \
438 	((x) == 0xc9 ? "HWRM_FW_GET_TIME": \
439 	((x) == 0xca ? "HWRM_FW_SET_STRUCTURED_DATA": \
440 	((x) == 0xcb ? "HWRM_FW_GET_STRUCTURED_DATA": \
441 	((x) == 0xcc ? "HWRM_FW_IPC_MAILBOX": \
442 	((x) == 0xcd ? "HWRM_FW_ECN_CFG": \
443 	((x) == 0xce ? "HWRM_FW_ECN_QCFG": \
444 	((x) == 0xcf ? "HWRM_FW_SECURE_CFG": \
445 	((x) == 0xd0 ? "HWRM_EXEC_FWD_RESP": \
446 	((x) == 0xd1 ? "HWRM_REJECT_FWD_RESP": \
447 	((x) == 0xd2 ? "HWRM_FWD_RESP": \
448 	((x) == 0xd3 ? "HWRM_FWD_ASYNC_EVENT_CMPL": \
449 	((x) == 0xd4 ? "HWRM_OEM_CMD": \
450 	((x) == 0xd5 ? "HWRM_PORT_PRBS_TEST": \
451 	((x) == 0xd6 ? "HWRM_PORT_SFP_SIDEBAND_CFG": \
452 	((x) == 0xd7 ? "HWRM_PORT_SFP_SIDEBAND_QCFG": \
453 	((x) == 0xd8 ? "HWRM_FW_STATE_UNQUIESCE": \
454 	((x) == 0xd9 ? "HWRM_PORT_DSC_DUMP": \
455 	((x) == 0xda ? "HWRM_PORT_EP_TX_QCFG": \
456 	((x) == 0xdb ? "HWRM_PORT_EP_TX_CFG": \
457 	((x) == 0xdc ? "HWRM_PORT_CFG": \
458 	((x) == 0xdd ? "HWRM_PORT_QCFG": \
459 	((x) == 0xdf ? "HWRM_PORT_MAC_QCAPS": \
460 	((x) == 0xe0 ? "HWRM_TEMP_MONITOR_QUERY": \
461 	((x) == 0xe1 ? "HWRM_REG_POWER_QUERY": \
462 	((x) == 0xe2 ? "HWRM_CORE_FREQUENCY_QUERY": \
463 	((x) == 0xe3 ? "HWRM_REG_POWER_HISTOGRAM": \
464 	((x) == 0xf0 ? "HWRM_WOL_FILTER_ALLOC": \
465 	((x) == 0xf1 ? "HWRM_WOL_FILTER_FREE": \
466 	((x) == 0xf2 ? "HWRM_WOL_FILTER_QCFG": \
467 	((x) == 0xf3 ? "HWRM_WOL_REASON_QCFG": \
468 	((x) == 0xf4 ? "HWRM_CFA_METER_QCAPS": \
469 	((x) == 0xf5 ? "HWRM_CFA_METER_PROFILE_ALLOC": \
470 	((x) == 0xf6 ? "HWRM_CFA_METER_PROFILE_FREE": \
471 	((x) == 0xf7 ? "HWRM_CFA_METER_PROFILE_CFG": \
472 	((x) == 0xf8 ? "HWRM_CFA_METER_INSTANCE_ALLOC": \
473 	((x) == 0xf9 ? "HWRM_CFA_METER_INSTANCE_FREE": \
474 	((x) == 0xfa ? "HWRM_CFA_METER_INSTANCE_CFG": \
475 	((x) == 0xfd ? "HWRM_CFA_VFR_ALLOC": \
476 	((x) == 0xfe ? "HWRM_CFA_VFR_FREE": \
477 	"Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \
478 	(((x) < 0x180) ? \
479 	((x) == 0x100 ? "HWRM_CFA_VF_PAIR_ALLOC": \
480 	((x) == 0x101 ? "HWRM_CFA_VF_PAIR_FREE": \
481 	((x) == 0x102 ? "HWRM_CFA_VF_PAIR_INFO": \
482 	((x) == 0x103 ? "HWRM_CFA_FLOW_ALLOC": \
483 	((x) == 0x104 ? "HWRM_CFA_FLOW_FREE": \
484 	((x) == 0x105 ? "HWRM_CFA_FLOW_FLUSH": \
485 	((x) == 0x106 ? "HWRM_CFA_FLOW_STATS": \
486 	((x) == 0x107 ? "HWRM_CFA_FLOW_INFO": \
487 	((x) == 0x108 ? "HWRM_CFA_DECAP_FILTER_ALLOC": \
488 	((x) == 0x109 ? "HWRM_CFA_DECAP_FILTER_FREE": \
489 	((x) == 0x10a ? "HWRM_CFA_VLAN_ANTISPOOF_QCFG": \
490 	((x) == 0x10b ? "HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC": \
491 	((x) == 0x10c ? "HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE": \
492 	((x) == 0x10d ? "HWRM_CFA_PAIR_ALLOC": \
493 	((x) == 0x10e ? "HWRM_CFA_PAIR_FREE": \
494 	((x) == 0x10f ? "HWRM_CFA_PAIR_INFO": \
495 	((x) == 0x110 ? "HWRM_FW_IPC_MSG": \
496 	((x) == 0x111 ? "HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO": \
497 	((x) == 0x112 ? "HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE": \
498 	((x) == 0x113 ? "HWRM_CFA_FLOW_AGING_TIMER_RESET": \
499 	((x) == 0x114 ? "HWRM_CFA_FLOW_AGING_CFG": \
500 	((x) == 0x115 ? "HWRM_CFA_FLOW_AGING_QCFG": \
501 	((x) == 0x116 ? "HWRM_CFA_FLOW_AGING_QCAPS": \
502 	((x) == 0x117 ? "HWRM_CFA_CTX_MEM_RGTR": \
503 	((x) == 0x118 ? "HWRM_CFA_CTX_MEM_UNRGTR": \
504 	((x) == 0x119 ? "HWRM_CFA_CTX_MEM_QCTX": \
505 	((x) == 0x11a ? "HWRM_CFA_CTX_MEM_QCAPS": \
506 	((x) == 0x11b ? "HWRM_CFA_COUNTER_QCAPS": \
507 	((x) == 0x11c ? "HWRM_CFA_COUNTER_CFG": \
508 	((x) == 0x11d ? "HWRM_CFA_COUNTER_QCFG": \
509 	((x) == 0x11e ? "HWRM_CFA_COUNTER_QSTATS": \
510 	((x) == 0x11f ? "HWRM_CFA_TCP_FLAG_PROCESS_QCFG": \
511 	((x) == 0x120 ? "HWRM_CFA_EEM_QCAPS": \
512 	((x) == 0x121 ? "HWRM_CFA_EEM_CFG": \
513 	((x) == 0x122 ? "HWRM_CFA_EEM_QCFG": \
514 	((x) == 0x123 ? "HWRM_CFA_EEM_OP": \
515 	((x) == 0x124 ? "HWRM_CFA_ADV_FLOW_MGNT_QCAPS": \
516 	((x) == 0x125 ? "HWRM_CFA_TFLIB": \
517 	((x) == 0x126 ? "HWRM_CFA_LAG_GROUP_MEMBER_RGTR": \
518 	((x) == 0x127 ? "HWRM_CFA_LAG_GROUP_MEMBER_UNRGTR": \
519 	((x) == 0x128 ? "HWRM_CFA_TLS_FILTER_ALLOC": \
520 	((x) == 0x129 ? "HWRM_CFA_TLS_FILTER_FREE": \
521 	((x) == 0x12a ? "HWRM_CFA_RELEASE_AFM_FUNC": \
522 	((x) == 0x12e ? "HWRM_ENGINE_CKV_STATUS": \
523 	((x) == 0x12f ? "HWRM_ENGINE_CKV_CKEK_ADD": \
524 	((x) == 0x130 ? "HWRM_ENGINE_CKV_CKEK_DELETE": \
525 	((x) == 0x131 ? "HWRM_ENGINE_CKV_KEY_ADD": \
526 	((x) == 0x132 ? "HWRM_ENGINE_CKV_KEY_DELETE": \
527 	((x) == 0x133 ? "HWRM_ENGINE_CKV_FLUSH": \
528 	((x) == 0x134 ? "HWRM_ENGINE_CKV_RNG_GET": \
529 	((x) == 0x135 ? "HWRM_ENGINE_CKV_KEY_GEN": \
530 	((x) == 0x136 ? "HWRM_ENGINE_CKV_KEY_LABEL_CFG": \
531 	((x) == 0x137 ? "HWRM_ENGINE_CKV_KEY_LABEL_QCFG": \
532 	((x) == 0x13c ? "HWRM_ENGINE_QG_CONFIG_QUERY": \
533 	((x) == 0x13d ? "HWRM_ENGINE_QG_QUERY": \
534 	((x) == 0x13e ? "HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY": \
535 	((x) == 0x13f ? "HWRM_ENGINE_QG_METER_PROFILE_QUERY": \
536 	((x) == 0x140 ? "HWRM_ENGINE_QG_METER_PROFILE_ALLOC": \
537 	((x) == 0x141 ? "HWRM_ENGINE_QG_METER_PROFILE_FREE": \
538 	((x) == 0x142 ? "HWRM_ENGINE_QG_METER_QUERY": \
539 	((x) == 0x143 ? "HWRM_ENGINE_QG_METER_BIND": \
540 	((x) == 0x144 ? "HWRM_ENGINE_QG_METER_UNBIND": \
541 	((x) == 0x145 ? "HWRM_ENGINE_QG_FUNC_BIND": \
542 	((x) == 0x146 ? "HWRM_ENGINE_SG_CONFIG_QUERY": \
543 	((x) == 0x147 ? "HWRM_ENGINE_SG_QUERY": \
544 	((x) == 0x148 ? "HWRM_ENGINE_SG_METER_QUERY": \
545 	((x) == 0x149 ? "HWRM_ENGINE_SG_METER_CONFIG": \
546 	((x) == 0x14a ? "HWRM_ENGINE_SG_QG_BIND": \
547 	((x) == 0x14b ? "HWRM_ENGINE_QG_SG_UNBIND": \
548 	((x) == 0x154 ? "HWRM_ENGINE_CONFIG_QUERY": \
549 	((x) == 0x155 ? "HWRM_ENGINE_STATS_CONFIG": \
550 	((x) == 0x156 ? "HWRM_ENGINE_STATS_CLEAR": \
551 	((x) == 0x157 ? "HWRM_ENGINE_STATS_QUERY": \
552 	((x) == 0x158 ? "HWRM_ENGINE_STATS_QUERY_CONTINUOUS_ERROR": \
553 	((x) == 0x15e ? "HWRM_ENGINE_RQ_ALLOC": \
554 	((x) == 0x15f ? "HWRM_ENGINE_RQ_FREE": \
555 	((x) == 0x160 ? "HWRM_ENGINE_CQ_ALLOC": \
556 	((x) == 0x161 ? "HWRM_ENGINE_CQ_FREE": \
557 	((x) == 0x162 ? "HWRM_ENGINE_NQ_ALLOC": \
558 	((x) == 0x163 ? "HWRM_ENGINE_NQ_FREE": \
559 	((x) == 0x164 ? "HWRM_ENGINE_ON_DIE_RQE_CREDITS": \
560 	((x) == 0x165 ? "HWRM_ENGINE_FUNC_QCFG": \
561 	"Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \
562 	(((x) < 0x200) ? \
563 	((x) == 0x190 ? "HWRM_FUNC_RESOURCE_QCAPS": \
564 	((x) == 0x191 ? "HWRM_FUNC_VF_RESOURCE_CFG": \
565 	((x) == 0x192 ? "HWRM_FUNC_BACKING_STORE_QCAPS": \
566 	((x) == 0x193 ? "HWRM_FUNC_BACKING_STORE_CFG": \
567 	((x) == 0x194 ? "HWRM_FUNC_BACKING_STORE_QCFG": \
568 	((x) == 0x195 ? "HWRM_FUNC_VF_BW_CFG": \
569 	((x) == 0x196 ? "HWRM_FUNC_VF_BW_QCFG": \
570 	((x) == 0x197 ? "HWRM_FUNC_HOST_PF_IDS_QUERY": \
571 	((x) == 0x198 ? "HWRM_FUNC_QSTATS_EXT": \
572 	((x) == 0x199 ? "HWRM_STAT_EXT_CTX_QUERY": \
573 	((x) == 0x19a ? "HWRM_FUNC_SPD_CFG": \
574 	((x) == 0x19b ? "HWRM_FUNC_SPD_QCFG": \
575 	((x) == 0x19c ? "HWRM_FUNC_PTP_PIN_QCFG": \
576 	((x) == 0x19d ? "HWRM_FUNC_PTP_PIN_CFG": \
577 	((x) == 0x19e ? "HWRM_FUNC_PTP_CFG": \
578 	((x) == 0x19f ? "HWRM_FUNC_PTP_TS_QUERY": \
579 	((x) == 0x1a0 ? "HWRM_FUNC_PTP_EXT_CFG": \
580 	((x) == 0x1a1 ? "HWRM_FUNC_PTP_EXT_QCFG": \
581 	((x) == 0x1a2 ? "HWRM_FUNC_KEY_CTX_ALLOC": \
582 	((x) == 0x1a3 ? "HWRM_FUNC_BACKING_STORE_CFG_V2": \
583 	((x) == 0x1a4 ? "HWRM_FUNC_BACKING_STORE_QCFG_V2": \
584 	((x) == 0x1a5 ? "HWRM_FUNC_DBR_PACING_CFG": \
585 	((x) == 0x1a6 ? "HWRM_FUNC_DBR_PACING_QCFG": \
586 	((x) == 0x1a7 ? "HWRM_FUNC_DBR_PACING_BROADCAST_EVENT": \
587 	((x) == 0x1a8 ? "HWRM_FUNC_BACKING_STORE_QCAPS_V2": \
588 	((x) == 0x1a9 ? "HWRM_FUNC_DBR_PACING_NQLIST_QUERY": \
589 	((x) == 0x1aa ? "HWRM_FUNC_DBR_RECOVERY_COMPLETED": \
590 	((x) == 0x1ab ? "HWRM_FUNC_SYNCE_CFG": \
591 	((x) == 0x1ac ? "HWRM_FUNC_SYNCE_QCFG": \
592 	((x) == 0x1ad ? "HWRM_FUNC_KEY_CTX_FREE": \
593 	((x) == 0x1ae ? "HWRM_FUNC_LAG_MODE_CFG": \
594 	((x) == 0x1af ? "HWRM_FUNC_LAG_MODE_QCFG": \
595 	((x) == 0x1b0 ? "HWRM_FUNC_LAG_CREATE": \
596 	((x) == 0x1b1 ? "HWRM_FUNC_LAG_UPDATE": \
597 	((x) == 0x1b2 ? "HWRM_FUNC_LAG_FREE": \
598 	((x) == 0x1b3 ? "HWRM_FUNC_LAG_QCFG": \
599 	((x) == 0x1c2 ? "HWRM_FUNC_TIMEDTX_PACING_RATE_ADD": \
600 	((x) == 0x1c3 ? "HWRM_FUNC_TIMEDTX_PACING_RATE_DELETE": \
601 	((x) == 0x1c4 ? "HWRM_FUNC_TIMEDTX_PACING_RATE_QUERY": \
602 	"Unknown decode" ))))))))))))))))))))))))))))))))))))))) : \
603 	(((x) < 0x280) ? \
604 	((x) == 0x200 ? "HWRM_SELFTEST_QLIST": \
605 	((x) == 0x201 ? "HWRM_SELFTEST_EXEC": \
606 	((x) == 0x202 ? "HWRM_SELFTEST_IRQ": \
607 	((x) == 0x203 ? "HWRM_SELFTEST_RETRIEVE_SERDES_DATA": \
608 	((x) == 0x204 ? "HWRM_PCIE_QSTATS": \
609 	((x) == 0x205 ? "HWRM_MFG_FRU_WRITE_CONTROL": \
610 	((x) == 0x206 ? "HWRM_MFG_TIMERS_QUERY": \
611 	((x) == 0x207 ? "HWRM_MFG_OTP_CFG": \
612 	((x) == 0x208 ? "HWRM_MFG_OTP_QCFG": \
613 	((x) == 0x209 ? "HWRM_MFG_HDMA_TEST": \
614 	((x) == 0x20a ? "HWRM_MFG_FRU_EEPROM_WRITE": \
615 	((x) == 0x20b ? "HWRM_MFG_FRU_EEPROM_READ": \
616 	((x) == 0x20c ? "HWRM_MFG_SOC_IMAGE": \
617 	((x) == 0x20d ? "HWRM_MFG_SOC_QSTATUS": \
618 	((x) == 0x20e ? "HWRM_MFG_PARAM_CRITICAL_DATA_FINALIZE": \
619 	((x) == 0x20f ? "HWRM_MFG_PARAM_CRITICAL_DATA_READ": \
620 	((x) == 0x210 ? "HWRM_MFG_PARAM_CRITICAL_DATA_HEALTH": \
621 	((x) == 0x211 ? "HWRM_MFG_PRVSN_EXPORT_CSR": \
622 	((x) == 0x212 ? "HWRM_MFG_PRVSN_IMPORT_CERT": \
623 	((x) == 0x213 ? "HWRM_MFG_PRVSN_GET_STATE": \
624 	((x) == 0x214 ? "HWRM_MFG_GET_NVM_MEASUREMENT": \
625 	((x) == 0x215 ? "HWRM_MFG_PSOC_QSTATUS": \
626 	((x) == 0x216 ? "HWRM_MFG_SELFTEST_QLIST": \
627 	((x) == 0x217 ? "HWRM_MFG_SELFTEST_EXEC": \
628 	((x) == 0x218 ? "HWRM_STAT_GENERIC_QSTATS": \
629 	((x) == 0x219 ? "HWRM_MFG_PRVSN_EXPORT_CERT": \
630 	((x) == 0x21a ? "HWRM_STAT_DB_ERROR_QSTATS": \
631 	((x) == 0x230 ? "HWRM_PORT_POE_CFG": \
632 	((x) == 0x231 ? "HWRM_PORT_POE_QCFG": \
633 	((x) == 0x258 ? "HWRM_UDCC_QCAPS": \
634 	((x) == 0x259 ? "HWRM_UDCC_CFG": \
635 	((x) == 0x25a ? "HWRM_UDCC_QCFG": \
636 	((x) == 0x25b ? "HWRM_UDCC_SESSION_CFG": \
637 	((x) == 0x25c ? "HWRM_UDCC_SESSION_QCFG": \
638 	((x) == 0x25d ? "HWRM_UDCC_SESSION_QUERY": \
639 	((x) == 0x25e ? "HWRM_UDCC_COMP_CFG": \
640 	((x) == 0x25f ? "HWRM_UDCC_COMP_QCFG": \
641 	((x) == 0x260 ? "HWRM_UDCC_COMP_QUERY": \
642 	((x) == 0x261 ? "HWRM_QUEUE_PFCWD_TIMEOUT_QCAPS": \
643 	((x) == 0x262 ? "HWRM_QUEUE_PFCWD_TIMEOUT_CFG": \
644 	((x) == 0x263 ? "HWRM_QUEUE_PFCWD_TIMEOUT_QCFG": \
645 	"Unknown decode" ))))))))))))))))))))))))))))))))))))))))) : \
646 	(((x) < 0x300) ? \
647 	((x) == 0x2bc ? "HWRM_TF": \
648 	((x) == 0x2bd ? "HWRM_TF_VERSION_GET": \
649 	((x) == 0x2c6 ? "HWRM_TF_SESSION_OPEN": \
650 	((x) == 0x2c8 ? "HWRM_TF_SESSION_REGISTER": \
651 	((x) == 0x2c9 ? "HWRM_TF_SESSION_UNREGISTER": \
652 	((x) == 0x2ca ? "HWRM_TF_SESSION_CLOSE": \
653 	((x) == 0x2cb ? "HWRM_TF_SESSION_QCFG": \
654 	((x) == 0x2cc ? "HWRM_TF_SESSION_RESC_QCAPS": \
655 	((x) == 0x2cd ? "HWRM_TF_SESSION_RESC_ALLOC": \
656 	((x) == 0x2ce ? "HWRM_TF_SESSION_RESC_FREE": \
657 	((x) == 0x2cf ? "HWRM_TF_SESSION_RESC_FLUSH": \
658 	((x) == 0x2d0 ? "HWRM_TF_SESSION_RESC_INFO": \
659 	((x) == 0x2d1 ? "HWRM_TF_SESSION_HOTUP_STATE_SET": \
660 	((x) == 0x2d2 ? "HWRM_TF_SESSION_HOTUP_STATE_GET": \
661 	((x) == 0x2da ? "HWRM_TF_TBL_TYPE_GET": \
662 	((x) == 0x2db ? "HWRM_TF_TBL_TYPE_SET": \
663 	((x) == 0x2dc ? "HWRM_TF_TBL_TYPE_BULK_GET": \
664 	((x) == 0x2ea ? "HWRM_TF_EM_INSERT": \
665 	((x) == 0x2eb ? "HWRM_TF_EM_DELETE": \
666 	((x) == 0x2ec ? "HWRM_TF_EM_HASH_INSERT": \
667 	((x) == 0x2ed ? "HWRM_TF_EM_MOVE": \
668 	((x) == 0x2f8 ? "HWRM_TF_TCAM_SET": \
669 	((x) == 0x2f9 ? "HWRM_TF_TCAM_GET": \
670 	((x) == 0x2fa ? "HWRM_TF_TCAM_MOVE": \
671 	((x) == 0x2fb ? "HWRM_TF_TCAM_FREE": \
672 	((x) == 0x2fc ? "HWRM_TF_GLOBAL_CFG_SET": \
673 	((x) == 0x2fd ? "HWRM_TF_GLOBAL_CFG_GET": \
674 	((x) == 0x2fe ? "HWRM_TF_IF_TBL_SET": \
675 	((x) == 0x2ff ? "HWRM_TF_IF_TBL_GET": \
676 	"Unknown decode" ))))))))))))))))))))))))))))) : \
677 	(((x) < 0x380) ? \
678 	((x) == 0x300 ? "HWRM_TF_RESC_USAGE_SET": \
679 	((x) == 0x301 ? "HWRM_TF_RESC_USAGE_QUERY": \
680 	((x) == 0x302 ? "HWRM_TF_TBL_TYPE_ALLOC": \
681 	((x) == 0x303 ? "HWRM_TF_TBL_TYPE_FREE": \
682 	"Unknown decode" )))) : \
683 	(((x) < 0x400) ? \
684 	((x) == 0x380 ? "HWRM_TFC_TBL_SCOPE_QCAPS": \
685 	((x) == 0x381 ? "HWRM_TFC_TBL_SCOPE_ID_ALLOC": \
686 	((x) == 0x382 ? "HWRM_TFC_TBL_SCOPE_CONFIG": \
687 	((x) == 0x383 ? "HWRM_TFC_TBL_SCOPE_DECONFIG": \
688 	((x) == 0x384 ? "HWRM_TFC_TBL_SCOPE_FID_ADD": \
689 	((x) == 0x385 ? "HWRM_TFC_TBL_SCOPE_FID_REM": \
690 	((x) == 0x386 ? "HWRM_TFC_TBL_SCOPE_POOL_ALLOC": \
691 	((x) == 0x387 ? "HWRM_TFC_TBL_SCOPE_POOL_FREE": \
692 	((x) == 0x388 ? "HWRM_TFC_SESSION_ID_ALLOC": \
693 	((x) == 0x389 ? "HWRM_TFC_SESSION_FID_ADD": \
694 	((x) == 0x38a ? "HWRM_TFC_SESSION_FID_REM": \
695 	((x) == 0x38b ? "HWRM_TFC_IDENT_ALLOC": \
696 	((x) == 0x38c ? "HWRM_TFC_IDENT_FREE": \
697 	((x) == 0x38d ? "HWRM_TFC_IDX_TBL_ALLOC": \
698 	((x) == 0x38e ? "HWRM_TFC_IDX_TBL_ALLOC_SET": \
699 	((x) == 0x38f ? "HWRM_TFC_IDX_TBL_SET": \
700 	((x) == 0x390 ? "HWRM_TFC_IDX_TBL_GET": \
701 	((x) == 0x391 ? "HWRM_TFC_IDX_TBL_FREE": \
702 	((x) == 0x392 ? "HWRM_TFC_GLOBAL_ID_ALLOC": \
703 	((x) == 0x393 ? "HWRM_TFC_TCAM_SET": \
704 	((x) == 0x394 ? "HWRM_TFC_TCAM_GET": \
705 	((x) == 0x395 ? "HWRM_TFC_TCAM_ALLOC": \
706 	((x) == 0x396 ? "HWRM_TFC_TCAM_ALLOC_SET": \
707 	((x) == 0x397 ? "HWRM_TFC_TCAM_FREE": \
708 	((x) == 0x398 ? "HWRM_TFC_IF_TBL_SET": \
709 	((x) == 0x399 ? "HWRM_TFC_IF_TBL_GET": \
710 	((x) == 0x39a ? "HWRM_TFC_TBL_SCOPE_CONFIG_GET": \
711 	((x) == 0x39b ? "HWRM_TFC_RESC_USAGE_QUERY": \
712 	"Unknown decode" )))))))))))))))))))))))))))) : \
713 	(((x) < 0x480) ? \
714 	((x) == 0x400 ? "HWRM_SV": \
715 	"Unknown decode" ) : \
716 	(((x) < 0xff80) ? \
717 	((x) == 0xff0e ? "HWRM_DBG_SERDES_TEST": \
718 	((x) == 0xff0f ? "HWRM_DBG_LOG_BUFFER_FLUSH": \
719 	((x) == 0xff10 ? "HWRM_DBG_READ_DIRECT": \
720 	((x) == 0xff11 ? "HWRM_DBG_READ_INDIRECT": \
721 	((x) == 0xff12 ? "HWRM_DBG_WRITE_DIRECT": \
722 	((x) == 0xff13 ? "HWRM_DBG_WRITE_INDIRECT": \
723 	((x) == 0xff14 ? "HWRM_DBG_DUMP": \
724 	((x) == 0xff15 ? "HWRM_DBG_ERASE_NVM": \
725 	((x) == 0xff16 ? "HWRM_DBG_CFG": \
726 	((x) == 0xff17 ? "HWRM_DBG_COREDUMP_LIST": \
727 	((x) == 0xff18 ? "HWRM_DBG_COREDUMP_INITIATE": \
728 	((x) == 0xff19 ? "HWRM_DBG_COREDUMP_RETRIEVE": \
729 	((x) == 0xff1a ? "HWRM_DBG_FW_CLI": \
730 	((x) == 0xff1b ? "HWRM_DBG_I2C_CMD": \
731 	((x) == 0xff1c ? "HWRM_DBG_RING_INFO_GET": \
732 	((x) == 0xff1d ? "HWRM_DBG_CRASHDUMP_HEADER": \
733 	((x) == 0xff1e ? "HWRM_DBG_CRASHDUMP_ERASE": \
734 	((x) == 0xff1f ? "HWRM_DBG_DRV_TRACE": \
735 	((x) == 0xff20 ? "HWRM_DBG_QCAPS": \
736 	((x) == 0xff21 ? "HWRM_DBG_QCFG": \
737 	((x) == 0xff22 ? "HWRM_DBG_CRASHDUMP_MEDIUM_CFG": \
738 	((x) == 0xff23 ? "HWRM_DBG_USEQ_ALLOC": \
739 	((x) == 0xff24 ? "HWRM_DBG_USEQ_FREE": \
740 	((x) == 0xff25 ? "HWRM_DBG_USEQ_FLUSH": \
741 	((x) == 0xff26 ? "HWRM_DBG_USEQ_QCAPS": \
742 	((x) == 0xff27 ? "HWRM_DBG_USEQ_CW_CFG": \
743 	((x) == 0xff28 ? "HWRM_DBG_USEQ_SCHED_CFG": \
744 	((x) == 0xff29 ? "HWRM_DBG_USEQ_RUN": \
745 	((x) == 0xff2a ? "HWRM_DBG_USEQ_DELIVERY_REQ": \
746 	((x) == 0xff2b ? "HWRM_DBG_USEQ_RESP_HDR": \
747 	((x) == 0xff2c ? "HWRM_DBG_COREDUMP_CAPTURE": \
748 	((x) == 0xff2d ? "HWRM_DBG_PTRACE": \
749 	((x) == 0xff2e ? "HWRM_DBG_SIM_CABLE_STATE": \
750 	"Unknown decode" ))))))))))))))))))))))))))))))))) : \
751 	(((x) <= UINT16_MAX) ? \
752 	((x) == 0xffea ? "HWRM_NVM_GET_VPD_FIELD_INFO": \
753 	((x) == 0xffeb ? "HWRM_NVM_SET_VPD_FIELD_INFO": \
754 	((x) == 0xffec ? "HWRM_NVM_DEFRAG": \
755 	((x) == 0xffed ? "HWRM_NVM_REQ_ARBITRATION": \
756 	((x) == 0xffee ? "HWRM_NVM_FACTORY_DEFAULTS": \
757 	((x) == 0xffef ? "HWRM_NVM_VALIDATE_OPTION": \
758 	((x) == 0xfff0 ? "HWRM_NVM_FLUSH": \
759 	((x) == 0xfff1 ? "HWRM_NVM_GET_VARIABLE": \
760 	((x) == 0xfff2 ? "HWRM_NVM_SET_VARIABLE": \
761 	((x) == 0xfff3 ? "HWRM_NVM_INSTALL_UPDATE": \
762 	((x) == 0xfff4 ? "HWRM_NVM_MODIFY": \
763 	((x) == 0xfff5 ? "HWRM_NVM_VERIFY_UPDATE": \
764 	((x) == 0xfff6 ? "HWRM_NVM_GET_DEV_INFO": \
765 	((x) == 0xfff7 ? "HWRM_NVM_ERASE_DIR_ENTRY": \
766 	((x) == 0xfff8 ? "HWRM_NVM_MOD_DIR_ENTRY": \
767 	((x) == 0xfff9 ? "HWRM_NVM_FIND_DIR_ENTRY": \
768 	((x) == 0xfffa ? "HWRM_NVM_GET_DIR_ENTRIES": \
769 	((x) == 0xfffb ? "HWRM_NVM_GET_DIR_INFO": \
770 	((x) == 0xfffc ? "HWRM_NVM_RAW_DUMP": \
771 	((x) == 0xfffd ? "HWRM_NVM_READ": \
772 	((x) == 0xfffe ? "HWRM_NVM_WRITE": \
773 	((x) == 0xffff ? "HWRM_NVM_RAW_WRITE_BLK": \
774 	"Unknown decode" )))))))))))))))))))))) : \
775 	"Unknown decode" )))))))))))
776 
777 
778 /*
779  * Command numbering
780  * # NOTE - definitions already in hwrm_req_type, in hwrm_types.yaml
781  * #	So only structure definition is provided here.
782  */
783 /* cmd_nums (size:64b/8B) */
784 
785 typedef struct cmd_nums {
786 	/*
787 	 * This version of the specification defines the commands listed in
788 	 * the table below. The following are general implementation
789 	 * requirements for these commands:
790 	 *
791 	 * # All commands listed below that are marked neither
792 	 * reserved nor experimental shall be implemented by the HWRM.
793 	 * # A HWRM client compliant to this specification should not use
794 	 * commands outside of the list below.
795 	 * # A HWRM client compliant to this specification should not use
796 	 * command numbers marked reserved below.
797 	 * # A command marked experimental below may not be implemented
798 	 * by the HWRM.
799 	 * # A command marked experimental may change in the
800 	 * future version of the HWRM specification.
801 	 * # A command not listed below may be implemented by the HWRM.
802 	 * The behavior of commands that are not listed below is outside
803 	 * the scope of this specification.
804 	 */
805 	uint16_t	req_type;
806 	#define HWRM_VER_GET				UINT32_C(0x0)
807 	#define HWRM_FUNC_ECHO_RESPONSE		UINT32_C(0xb)
808 	#define HWRM_ERROR_RECOVERY_QCFG		UINT32_C(0xc)
809 	#define HWRM_FUNC_DRV_IF_CHANGE		UINT32_C(0xd)
810 	#define HWRM_FUNC_BUF_UNRGTR			UINT32_C(0xe)
811 	#define HWRM_FUNC_VF_CFG			UINT32_C(0xf)
812 	/* Reserved for future use. */
813 	#define HWRM_RESERVED1				UINT32_C(0x10)
814 	#define HWRM_FUNC_RESET			UINT32_C(0x11)
815 	#define HWRM_FUNC_GETFID			UINT32_C(0x12)
816 	#define HWRM_FUNC_VF_ALLOC			UINT32_C(0x13)
817 	#define HWRM_FUNC_VF_FREE			UINT32_C(0x14)
818 	#define HWRM_FUNC_QCAPS			UINT32_C(0x15)
819 	#define HWRM_FUNC_QCFG				UINT32_C(0x16)
820 	#define HWRM_FUNC_CFG				UINT32_C(0x17)
821 	#define HWRM_FUNC_QSTATS			UINT32_C(0x18)
822 	#define HWRM_FUNC_CLR_STATS			UINT32_C(0x19)
823 	#define HWRM_FUNC_DRV_UNRGTR			UINT32_C(0x1a)
824 	#define HWRM_FUNC_VF_RESC_FREE			UINT32_C(0x1b)
825 	#define HWRM_FUNC_VF_VNIC_IDS_QUERY		UINT32_C(0x1c)
826 	#define HWRM_FUNC_DRV_RGTR			UINT32_C(0x1d)
827 	#define HWRM_FUNC_DRV_QVER			UINT32_C(0x1e)
828 	#define HWRM_FUNC_BUF_RGTR			UINT32_C(0x1f)
829 	#define HWRM_PORT_PHY_CFG			UINT32_C(0x20)
830 	#define HWRM_PORT_MAC_CFG			UINT32_C(0x21)
831 	/* Experimental */
832 	#define HWRM_PORT_TS_QUERY			UINT32_C(0x22)
833 	#define HWRM_PORT_QSTATS			UINT32_C(0x23)
834 	#define HWRM_PORT_LPBK_QSTATS			UINT32_C(0x24)
835 	/* Experimental */
836 	#define HWRM_PORT_CLR_STATS			UINT32_C(0x25)
837 	/* Experimental */
838 	#define HWRM_PORT_LPBK_CLR_STATS		UINT32_C(0x26)
839 	#define HWRM_PORT_PHY_QCFG			UINT32_C(0x27)
840 	#define HWRM_PORT_MAC_QCFG			UINT32_C(0x28)
841 	/* Experimental */
842 	#define HWRM_PORT_MAC_PTP_QCFG			UINT32_C(0x29)
843 	#define HWRM_PORT_PHY_QCAPS			UINT32_C(0x2a)
844 	#define HWRM_PORT_PHY_I2C_WRITE		UINT32_C(0x2b)
845 	#define HWRM_PORT_PHY_I2C_READ			UINT32_C(0x2c)
846 	#define HWRM_PORT_LED_CFG			UINT32_C(0x2d)
847 	#define HWRM_PORT_LED_QCFG			UINT32_C(0x2e)
848 	#define HWRM_PORT_LED_QCAPS			UINT32_C(0x2f)
849 	#define HWRM_QUEUE_QPORTCFG			UINT32_C(0x30)
850 	#define HWRM_QUEUE_QCFG			UINT32_C(0x31)
851 	#define HWRM_QUEUE_CFG				UINT32_C(0x32)
852 	#define HWRM_FUNC_VLAN_CFG			UINT32_C(0x33)
853 	#define HWRM_FUNC_VLAN_QCFG			UINT32_C(0x34)
854 	#define HWRM_QUEUE_PFCENABLE_QCFG		UINT32_C(0x35)
855 	#define HWRM_QUEUE_PFCENABLE_CFG		UINT32_C(0x36)
856 	#define HWRM_QUEUE_PRI2COS_QCFG		UINT32_C(0x37)
857 	#define HWRM_QUEUE_PRI2COS_CFG			UINT32_C(0x38)
858 	#define HWRM_QUEUE_COS2BW_QCFG			UINT32_C(0x39)
859 	#define HWRM_QUEUE_COS2BW_CFG			UINT32_C(0x3a)
860 	#define HWRM_QUEUE_DSCP_QCAPS			UINT32_C(0x3b)
861 	#define HWRM_QUEUE_DSCP2PRI_QCFG		UINT32_C(0x3c)
862 	#define HWRM_QUEUE_DSCP2PRI_CFG		UINT32_C(0x3d)
863 	#define HWRM_VNIC_ALLOC			UINT32_C(0x40)
864 	#define HWRM_VNIC_FREE				UINT32_C(0x41)
865 	#define HWRM_VNIC_CFG				UINT32_C(0x42)
866 	#define HWRM_VNIC_QCFG				UINT32_C(0x43)
867 	#define HWRM_VNIC_TPA_CFG			UINT32_C(0x44)
868 	/* Experimental */
869 	#define HWRM_VNIC_TPA_QCFG			UINT32_C(0x45)
870 	#define HWRM_VNIC_RSS_CFG			UINT32_C(0x46)
871 	#define HWRM_VNIC_RSS_QCFG			UINT32_C(0x47)
872 	#define HWRM_VNIC_PLCMODES_CFG			UINT32_C(0x48)
873 	#define HWRM_VNIC_PLCMODES_QCFG		UINT32_C(0x49)
874 	#define HWRM_VNIC_QCAPS			UINT32_C(0x4a)
875 	/* Updates specific fields in RX VNIC structure */
876 	#define HWRM_VNIC_UPDATE			UINT32_C(0x4b)
877 	#define HWRM_RING_ALLOC			UINT32_C(0x50)
878 	#define HWRM_RING_FREE				UINT32_C(0x51)
879 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS	UINT32_C(0x52)
880 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS	UINT32_C(0x53)
881 	#define HWRM_RING_AGGINT_QCAPS			UINT32_C(0x54)
882 	#define HWRM_RING_SCHQ_ALLOC			UINT32_C(0x55)
883 	#define HWRM_RING_SCHQ_CFG			UINT32_C(0x56)
884 	#define HWRM_RING_SCHQ_FREE			UINT32_C(0x57)
885 	#define HWRM_RING_RESET			UINT32_C(0x5e)
886 	#define HWRM_RING_GRP_ALLOC			UINT32_C(0x60)
887 	#define HWRM_RING_GRP_FREE			UINT32_C(0x61)
888 	#define HWRM_RING_CFG				UINT32_C(0x62)
889 	#define HWRM_RING_QCFG				UINT32_C(0x63)
890 	/* Reserved for future use. */
891 	#define HWRM_RESERVED5				UINT32_C(0x64)
892 	/* Reserved for future use. */
893 	#define HWRM_RESERVED6				UINT32_C(0x65)
894 	#define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC		UINT32_C(0x70)
895 	#define HWRM_VNIC_RSS_COS_LB_CTX_FREE		UINT32_C(0x71)
896 	#define HWRM_QUEUE_MPLS_QCAPS			UINT32_C(0x80)
897 	#define HWRM_QUEUE_MPLSTC2PRI_QCFG		UINT32_C(0x81)
898 	#define HWRM_QUEUE_MPLSTC2PRI_CFG		UINT32_C(0x82)
899 	#define HWRM_QUEUE_VLANPRI_QCAPS		UINT32_C(0x83)
900 	#define HWRM_QUEUE_VLANPRI2PRI_QCFG		UINT32_C(0x84)
901 	#define HWRM_QUEUE_VLANPRI2PRI_CFG		UINT32_C(0x85)
902 	#define HWRM_QUEUE_GLOBAL_CFG			UINT32_C(0x86)
903 	#define HWRM_QUEUE_GLOBAL_QCFG			UINT32_C(0x87)
904 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG	UINT32_C(0x88)
905 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG	UINT32_C(0x89)
906 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG	UINT32_C(0x8a)
907 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG	UINT32_C(0x8b)
908 	#define HWRM_QUEUE_QCAPS			UINT32_C(0x8c)
909 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_QCFG	UINT32_C(0x8d)
910 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG	UINT32_C(0x8e)
911 	#define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_QCFG	UINT32_C(0x8f)
912 	#define HWRM_CFA_L2_FILTER_ALLOC		UINT32_C(0x90)
913 	#define HWRM_CFA_L2_FILTER_FREE		UINT32_C(0x91)
914 	#define HWRM_CFA_L2_FILTER_CFG			UINT32_C(0x92)
915 	#define HWRM_CFA_L2_SET_RX_MASK		UINT32_C(0x93)
916 	#define HWRM_CFA_VLAN_ANTISPOOF_CFG		UINT32_C(0x94)
917 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC		UINT32_C(0x95)
918 	#define HWRM_CFA_TUNNEL_FILTER_FREE		UINT32_C(0x96)
919 	/* Experimental */
920 	#define HWRM_CFA_ENCAP_RECORD_ALLOC		UINT32_C(0x97)
921 	/* Experimental */
922 	#define HWRM_CFA_ENCAP_RECORD_FREE		UINT32_C(0x98)
923 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC		UINT32_C(0x99)
924 	#define HWRM_CFA_NTUPLE_FILTER_FREE		UINT32_C(0x9a)
925 	#define HWRM_CFA_NTUPLE_FILTER_CFG		UINT32_C(0x9b)
926 	/* Experimental */
927 	#define HWRM_CFA_EM_FLOW_ALLOC			UINT32_C(0x9c)
928 	/* Experimental */
929 	#define HWRM_CFA_EM_FLOW_FREE			UINT32_C(0x9d)
930 	/* Experimental */
931 	#define HWRM_CFA_EM_FLOW_CFG			UINT32_C(0x9e)
932 	#define HWRM_TUNNEL_DST_PORT_QUERY		UINT32_C(0xa0)
933 	#define HWRM_TUNNEL_DST_PORT_ALLOC		UINT32_C(0xa1)
934 	#define HWRM_TUNNEL_DST_PORT_FREE		UINT32_C(0xa2)
935 	#define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG	UINT32_C(0xa3)
936 	#define HWRM_STAT_CTX_ENG_QUERY		UINT32_C(0xaf)
937 	#define HWRM_STAT_CTX_ALLOC			UINT32_C(0xb0)
938 	#define HWRM_STAT_CTX_FREE			UINT32_C(0xb1)
939 	#define HWRM_STAT_CTX_QUERY			UINT32_C(0xb2)
940 	#define HWRM_STAT_CTX_CLR_STATS		UINT32_C(0xb3)
941 	#define HWRM_PORT_QSTATS_EXT			UINT32_C(0xb4)
942 	#define HWRM_PORT_PHY_MDIO_WRITE		UINT32_C(0xb5)
943 	#define HWRM_PORT_PHY_MDIO_READ		UINT32_C(0xb6)
944 	#define HWRM_PORT_PHY_MDIO_BUS_ACQUIRE		UINT32_C(0xb7)
945 	#define HWRM_PORT_PHY_MDIO_BUS_RELEASE		UINT32_C(0xb8)
946 	#define HWRM_PORT_QSTATS_EXT_PFC_WD		UINT32_C(0xb9)
947 	/* Reserved. */
948 	#define HWRM_RESERVED7				UINT32_C(0xba)
949 	#define HWRM_PORT_TX_FIR_CFG			UINT32_C(0xbb)
950 	#define HWRM_PORT_TX_FIR_QCFG			UINT32_C(0xbc)
951 	#define HWRM_PORT_ECN_QSTATS			UINT32_C(0xbd)
952 	#define HWRM_FW_LIVEPATCH_QUERY		UINT32_C(0xbe)
953 	#define HWRM_FW_LIVEPATCH			UINT32_C(0xbf)
954 	#define HWRM_FW_RESET				UINT32_C(0xc0)
955 	#define HWRM_FW_QSTATUS			UINT32_C(0xc1)
956 	#define HWRM_FW_HEALTH_CHECK			UINT32_C(0xc2)
957 	#define HWRM_FW_SYNC				UINT32_C(0xc3)
958 	#define HWRM_FW_STATE_QCAPS			UINT32_C(0xc4)
959 	#define HWRM_FW_STATE_QUIESCE			UINT32_C(0xc5)
960 	#define HWRM_FW_STATE_BACKUP			UINT32_C(0xc6)
961 	#define HWRM_FW_STATE_RESTORE			UINT32_C(0xc7)
962 	/* Experimental */
963 	#define HWRM_FW_SET_TIME			UINT32_C(0xc8)
964 	/* Experimental */
965 	#define HWRM_FW_GET_TIME			UINT32_C(0xc9)
966 	/* Experimental */
967 	#define HWRM_FW_SET_STRUCTURED_DATA		UINT32_C(0xca)
968 	/* Experimental */
969 	#define HWRM_FW_GET_STRUCTURED_DATA		UINT32_C(0xcb)
970 	/* Experimental */
971 	#define HWRM_FW_IPC_MAILBOX			UINT32_C(0xcc)
972 	#define HWRM_FW_ECN_CFG			UINT32_C(0xcd)
973 	#define HWRM_FW_ECN_QCFG			UINT32_C(0xce)
974 	#define HWRM_FW_SECURE_CFG			UINT32_C(0xcf)
975 	#define HWRM_EXEC_FWD_RESP			UINT32_C(0xd0)
976 	#define HWRM_REJECT_FWD_RESP			UINT32_C(0xd1)
977 	#define HWRM_FWD_RESP				UINT32_C(0xd2)
978 	#define HWRM_FWD_ASYNC_EVENT_CMPL		UINT32_C(0xd3)
979 	#define HWRM_OEM_CMD				UINT32_C(0xd4)
980 	/* Tells the fw to run PRBS test on a given port and lane. */
981 	#define HWRM_PORT_PRBS_TEST			UINT32_C(0xd5)
982 	#define HWRM_PORT_SFP_SIDEBAND_CFG		UINT32_C(0xd6)
983 	#define HWRM_PORT_SFP_SIDEBAND_QCFG		UINT32_C(0xd7)
984 	#define HWRM_FW_STATE_UNQUIESCE		UINT32_C(0xd8)
985 	/* Tells the fw to collect dsc dump on a given port and lane. */
986 	#define HWRM_PORT_DSC_DUMP			UINT32_C(0xd9)
987 	#define HWRM_PORT_EP_TX_QCFG			UINT32_C(0xda)
988 	#define HWRM_PORT_EP_TX_CFG			UINT32_C(0xdb)
989 	#define HWRM_PORT_CFG				UINT32_C(0xdc)
990 	#define HWRM_PORT_QCFG				UINT32_C(0xdd)
991 	/* Queries MAC capabilities for the specified port */
992 	#define HWRM_PORT_MAC_QCAPS			UINT32_C(0xdf)
993 	#define HWRM_TEMP_MONITOR_QUERY		UINT32_C(0xe0)
994 	#define HWRM_REG_POWER_QUERY			UINT32_C(0xe1)
995 	#define HWRM_CORE_FREQUENCY_QUERY		UINT32_C(0xe2)
996 	#define HWRM_REG_POWER_HISTOGRAM		UINT32_C(0xe3)
997 	#define HWRM_WOL_FILTER_ALLOC			UINT32_C(0xf0)
998 	#define HWRM_WOL_FILTER_FREE			UINT32_C(0xf1)
999 	#define HWRM_WOL_FILTER_QCFG			UINT32_C(0xf2)
1000 	#define HWRM_WOL_REASON_QCFG			UINT32_C(0xf3)
1001 	/* Experimental */
1002 	#define HWRM_CFA_METER_QCAPS			UINT32_C(0xf4)
1003 	/* Experimental */
1004 	#define HWRM_CFA_METER_PROFILE_ALLOC		UINT32_C(0xf5)
1005 	/* Experimental */
1006 	#define HWRM_CFA_METER_PROFILE_FREE		UINT32_C(0xf6)
1007 	/* Experimental */
1008 	#define HWRM_CFA_METER_PROFILE_CFG		UINT32_C(0xf7)
1009 	/* Experimental */
1010 	#define HWRM_CFA_METER_INSTANCE_ALLOC		UINT32_C(0xf8)
1011 	/* Experimental */
1012 	#define HWRM_CFA_METER_INSTANCE_FREE		UINT32_C(0xf9)
1013 	/* Experimental */
1014 	#define HWRM_CFA_METER_INSTANCE_CFG		UINT32_C(0xfa)
1015 	/* Experimental */
1016 	#define HWRM_CFA_VFR_ALLOC			UINT32_C(0xfd)
1017 	/* Experimental */
1018 	#define HWRM_CFA_VFR_FREE			UINT32_C(0xfe)
1019 	/* Experimental */
1020 	#define HWRM_CFA_VF_PAIR_ALLOC			UINT32_C(0x100)
1021 	/* Experimental */
1022 	#define HWRM_CFA_VF_PAIR_FREE			UINT32_C(0x101)
1023 	/* Experimental */
1024 	#define HWRM_CFA_VF_PAIR_INFO			UINT32_C(0x102)
1025 	/* Experimental */
1026 	#define HWRM_CFA_FLOW_ALLOC			UINT32_C(0x103)
1027 	/* Experimental */
1028 	#define HWRM_CFA_FLOW_FREE			UINT32_C(0x104)
1029 	/* Experimental */
1030 	#define HWRM_CFA_FLOW_FLUSH			UINT32_C(0x105)
1031 	#define HWRM_CFA_FLOW_STATS			UINT32_C(0x106)
1032 	#define HWRM_CFA_FLOW_INFO			UINT32_C(0x107)
1033 	/* Experimental */
1034 	#define HWRM_CFA_DECAP_FILTER_ALLOC		UINT32_C(0x108)
1035 	/* Experimental */
1036 	#define HWRM_CFA_DECAP_FILTER_FREE		UINT32_C(0x109)
1037 	#define HWRM_CFA_VLAN_ANTISPOOF_QCFG		UINT32_C(0x10a)
1038 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC	UINT32_C(0x10b)
1039 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE	UINT32_C(0x10c)
1040 	/* Experimental */
1041 	#define HWRM_CFA_PAIR_ALLOC			UINT32_C(0x10d)
1042 	/* Experimental */
1043 	#define HWRM_CFA_PAIR_FREE			UINT32_C(0x10e)
1044 	/* Experimental */
1045 	#define HWRM_CFA_PAIR_INFO			UINT32_C(0x10f)
1046 	/* Experimental */
1047 	#define HWRM_FW_IPC_MSG			UINT32_C(0x110)
1048 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO	UINT32_C(0x111)
1049 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE	UINT32_C(0x112)
1050 	/* Experimental */
1051 	#define HWRM_CFA_FLOW_AGING_TIMER_RESET	UINT32_C(0x113)
1052 	/* Experimental */
1053 	#define HWRM_CFA_FLOW_AGING_CFG		UINT32_C(0x114)
1054 	/* Experimental */
1055 	#define HWRM_CFA_FLOW_AGING_QCFG		UINT32_C(0x115)
1056 	/* Experimental */
1057 	#define HWRM_CFA_FLOW_AGING_QCAPS		UINT32_C(0x116)
1058 	/* Experimental */
1059 	#define HWRM_CFA_CTX_MEM_RGTR			UINT32_C(0x117)
1060 	/* Experimental */
1061 	#define HWRM_CFA_CTX_MEM_UNRGTR		UINT32_C(0x118)
1062 	/* Experimental */
1063 	#define HWRM_CFA_CTX_MEM_QCTX			UINT32_C(0x119)
1064 	/* Experimental */
1065 	#define HWRM_CFA_CTX_MEM_QCAPS			UINT32_C(0x11a)
1066 	/* Experimental */
1067 	#define HWRM_CFA_COUNTER_QCAPS			UINT32_C(0x11b)
1068 	/* Experimental */
1069 	#define HWRM_CFA_COUNTER_CFG			UINT32_C(0x11c)
1070 	/* Experimental */
1071 	#define HWRM_CFA_COUNTER_QCFG			UINT32_C(0x11d)
1072 	/* Experimental */
1073 	#define HWRM_CFA_COUNTER_QSTATS		UINT32_C(0x11e)
1074 	/* Experimental */
1075 	#define HWRM_CFA_TCP_FLAG_PROCESS_QCFG		UINT32_C(0x11f)
1076 	/* Experimental */
1077 	#define HWRM_CFA_EEM_QCAPS			UINT32_C(0x120)
1078 	/* Experimental */
1079 	#define HWRM_CFA_EEM_CFG			UINT32_C(0x121)
1080 	/* Experimental */
1081 	#define HWRM_CFA_EEM_QCFG			UINT32_C(0x122)
1082 	/* Experimental */
1083 	#define HWRM_CFA_EEM_OP			UINT32_C(0x123)
1084 	/* Experimental */
1085 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS		UINT32_C(0x124)
1086 	/* Experimental - DEPRECATED */
1087 	#define HWRM_CFA_TFLIB				UINT32_C(0x125)
1088 	/* Experimental */
1089 	#define HWRM_CFA_LAG_GROUP_MEMBER_RGTR		UINT32_C(0x126)
1090 	/* Experimental */
1091 	#define HWRM_CFA_LAG_GROUP_MEMBER_UNRGTR	UINT32_C(0x127)
1092 	/* Experimental */
1093 	#define HWRM_CFA_TLS_FILTER_ALLOC		UINT32_C(0x128)
1094 	/* Experimental */
1095 	#define HWRM_CFA_TLS_FILTER_FREE		UINT32_C(0x129)
1096 	/* Release an AFM function for TF control */
1097 	#define HWRM_CFA_RELEASE_AFM_FUNC		UINT32_C(0x12a)
1098 	/*
1099 	 * Engine CKV - Get the current allocation status of keys provisioned in
1100 	 * the key vault.
1101 	 */
1102 	#define HWRM_ENGINE_CKV_STATUS			UINT32_C(0x12e)
1103 	/* Engine CKV - Add a new CKEK used to encrypt keys. */
1104 	#define HWRM_ENGINE_CKV_CKEK_ADD		UINT32_C(0x12f)
1105 	/* Engine CKV - Delete a previously added CKEK. */
1106 	#define HWRM_ENGINE_CKV_CKEK_DELETE		UINT32_C(0x130)
1107 	/* Engine CKV - Add a new key to the key vault. */
1108 	#define HWRM_ENGINE_CKV_KEY_ADD		UINT32_C(0x131)
1109 	/* Engine CKV - Delete a key from the key vault. */
1110 	#define HWRM_ENGINE_CKV_KEY_DELETE		UINT32_C(0x132)
1111 	/* Engine CKV - Delete all keys from the key vault. */
1112 	#define HWRM_ENGINE_CKV_FLUSH			UINT32_C(0x133)
1113 	/* Engine CKV - Get random data. */
1114 	#define HWRM_ENGINE_CKV_RNG_GET		UINT32_C(0x134)
1115 	/* Engine CKV - Generate and encrypt a new AES key. */
1116 	#define HWRM_ENGINE_CKV_KEY_GEN		UINT32_C(0x135)
1117 	/* Engine CKV - Configure a label index with a label value. */
1118 	#define HWRM_ENGINE_CKV_KEY_LABEL_CFG		UINT32_C(0x136)
1119 	/* Engine CKV - Query a label */
1120 	#define HWRM_ENGINE_CKV_KEY_LABEL_QCFG		UINT32_C(0x137)
1121 	/* Engine - Query the available queue groups configuration. */
1122 	#define HWRM_ENGINE_QG_CONFIG_QUERY		UINT32_C(0x13c)
1123 	/* Engine - Query the queue groups assigned to a function. */
1124 	#define HWRM_ENGINE_QG_QUERY			UINT32_C(0x13d)
1125 	/* Engine - Query the available queue group meter profile configuration. */
1126 	#define HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY UINT32_C(0x13e)
1127 	/* Engine - Query the configuration of a queue group meter profile. */
1128 	#define HWRM_ENGINE_QG_METER_PROFILE_QUERY	UINT32_C(0x13f)
1129 	/* Engine - Allocate a queue group meter profile. */
1130 	#define HWRM_ENGINE_QG_METER_PROFILE_ALLOC	UINT32_C(0x140)
1131 	/* Engine - Free a queue group meter profile. */
1132 	#define HWRM_ENGINE_QG_METER_PROFILE_FREE	UINT32_C(0x141)
1133 	/* Engine - Query the meters assigned to a queue group. */
1134 	#define HWRM_ENGINE_QG_METER_QUERY		UINT32_C(0x142)
1135 	/* Engine - Bind a queue group meter profile to a queue group. */
1136 	#define HWRM_ENGINE_QG_METER_BIND		UINT32_C(0x143)
1137 	/* Engine - Unbind a queue group meter profile from a queue group. */
1138 	#define HWRM_ENGINE_QG_METER_UNBIND		UINT32_C(0x144)
1139 	/* Engine - Bind a queue group to a function. */
1140 	#define HWRM_ENGINE_QG_FUNC_BIND		UINT32_C(0x145)
1141 	/* Engine - Query the scheduling group configuration. */
1142 	#define HWRM_ENGINE_SG_CONFIG_QUERY		UINT32_C(0x146)
1143 	/* Engine - Query the queue groups assigned to a scheduling group. */
1144 	#define HWRM_ENGINE_SG_QUERY			UINT32_C(0x147)
1145 	/* Engine - Query the configuration of a scheduling group's meter profiles. */
1146 	#define HWRM_ENGINE_SG_METER_QUERY		UINT32_C(0x148)
1147 	/* Engine - Configure a scheduling group's meter profiles. */
1148 	#define HWRM_ENGINE_SG_METER_CONFIG		UINT32_C(0x149)
1149 	/* Engine - Bind a queue group to a scheduling group. */
1150 	#define HWRM_ENGINE_SG_QG_BIND			UINT32_C(0x14a)
1151 	/* Engine - Unbind a queue group from its scheduling group. */
1152 	#define HWRM_ENGINE_QG_SG_UNBIND		UINT32_C(0x14b)
1153 	/* Engine - Query the Engine configuration. */
1154 	#define HWRM_ENGINE_CONFIG_QUERY		UINT32_C(0x154)
1155 	/* Engine - Configure the statistics accumulator for an Engine. */
1156 	#define HWRM_ENGINE_STATS_CONFIG		UINT32_C(0x155)
1157 	/* Engine - Clear the statistics accumulator for an Engine. */
1158 	#define HWRM_ENGINE_STATS_CLEAR		UINT32_C(0x156)
1159 	/* Engine - Query the statistics accumulator for an Engine. */
1160 	#define HWRM_ENGINE_STATS_QUERY		UINT32_C(0x157)
1161 	/*
1162 	 * Engine - Query statistics counters for continuous errors from all CDDIP
1163 	 * Engines.
1164 	 */
1165 	#define HWRM_ENGINE_STATS_QUERY_CONTINUOUS_ERROR  UINT32_C(0x158)
1166 	/* Engine - Allocate an Engine RQ. */
1167 	#define HWRM_ENGINE_RQ_ALLOC			UINT32_C(0x15e)
1168 	/* Engine - Free an Engine RQ. */
1169 	#define HWRM_ENGINE_RQ_FREE			UINT32_C(0x15f)
1170 	/* Engine - Allocate an Engine CQ. */
1171 	#define HWRM_ENGINE_CQ_ALLOC			UINT32_C(0x160)
1172 	/* Engine - Free an Engine CQ. */
1173 	#define HWRM_ENGINE_CQ_FREE			UINT32_C(0x161)
1174 	/* Engine - Allocate an NQ. */
1175 	#define HWRM_ENGINE_NQ_ALLOC			UINT32_C(0x162)
1176 	/* Engine - Free an NQ. */
1177 	#define HWRM_ENGINE_NQ_FREE			UINT32_C(0x163)
1178 	/* Engine - Set the on-die RQE credit update location. */
1179 	#define HWRM_ENGINE_ON_DIE_RQE_CREDITS		UINT32_C(0x164)
1180 	/* Engine - Query the engine function configuration. */
1181 	#define HWRM_ENGINE_FUNC_QCFG			UINT32_C(0x165)
1182 	/* Experimental */
1183 	#define HWRM_FUNC_RESOURCE_QCAPS		UINT32_C(0x190)
1184 	/* Experimental */
1185 	#define HWRM_FUNC_VF_RESOURCE_CFG		UINT32_C(0x191)
1186 	/* Experimental */
1187 	#define HWRM_FUNC_BACKING_STORE_QCAPS		UINT32_C(0x192)
1188 	/* Experimental */
1189 	#define HWRM_FUNC_BACKING_STORE_CFG		UINT32_C(0x193)
1190 	/* Experimental */
1191 	#define HWRM_FUNC_BACKING_STORE_QCFG		UINT32_C(0x194)
1192 	/* Configures the BW of any VF */
1193 	#define HWRM_FUNC_VF_BW_CFG			UINT32_C(0x195)
1194 	/* Queries the BW of any VF */
1195 	#define HWRM_FUNC_VF_BW_QCFG			UINT32_C(0x196)
1196 	/* Queries pf ids belong to specified host(s) */
1197 	#define HWRM_FUNC_HOST_PF_IDS_QUERY		UINT32_C(0x197)
1198 	/* Queries extended stats per function */
1199 	#define HWRM_FUNC_QSTATS_EXT			UINT32_C(0x198)
1200 	/* Queries extended statistics context */
1201 	#define HWRM_STAT_EXT_CTX_QUERY		UINT32_C(0x199)
1202 	/* Configure SoC packet DMA settings */
1203 	#define HWRM_FUNC_SPD_CFG			UINT32_C(0x19a)
1204 	/* Query SoC packet DMA settings */
1205 	#define HWRM_FUNC_SPD_QCFG			UINT32_C(0x19b)
1206 	/* PTP - Queries configuration of timesync IO pins. */
1207 	#define HWRM_FUNC_PTP_PIN_QCFG			UINT32_C(0x19c)
1208 	/* PTP - Configuration of timesync IO pins. */
1209 	#define HWRM_FUNC_PTP_PIN_CFG			UINT32_C(0x19d)
1210 	/* PTP - Configuration for disciplining PHC. */
1211 	#define HWRM_FUNC_PTP_CFG			UINT32_C(0x19e)
1212 	/* PTP - Queries for PHC timestamps. */
1213 	#define HWRM_FUNC_PTP_TS_QUERY			UINT32_C(0x19f)
1214 	/* PTP - Extended PTP configuration. */
1215 	#define HWRM_FUNC_PTP_EXT_CFG			UINT32_C(0x1a0)
1216 	/* PTP - Query extended PTP configuration. */
1217 	#define HWRM_FUNC_PTP_EXT_QCFG			UINT32_C(0x1a1)
1218 	/* The command is used to allocate KTLS or QUIC key contexts. */
1219 	#define HWRM_FUNC_KEY_CTX_ALLOC		UINT32_C(0x1a2)
1220 	/* The is the new API to configure backing stores. */
1221 	#define HWRM_FUNC_BACKING_STORE_CFG_V2		UINT32_C(0x1a3)
1222 	/* The is the new API to query backing store configurations. */
1223 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2	UINT32_C(0x1a4)
1224 	/* To support doorbell pacing configuration. */
1225 	#define HWRM_FUNC_DBR_PACING_CFG		UINT32_C(0x1a5)
1226 	/* To query doorbell pacing configuration. */
1227 	#define HWRM_FUNC_DBR_PACING_QCFG		UINT32_C(0x1a6)
1228 	/*
1229 	 * To broadcast the doorbell event to the drivers to
1230 	 * initiate pacing of doorbells.
1231 	 */
1232 	#define HWRM_FUNC_DBR_PACING_BROADCAST_EVENT	UINT32_C(0x1a7)
1233 	/* The is the new API to query backing store capabilities. */
1234 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2	UINT32_C(0x1a8)
1235 	/* To query doorbell pacing NQ id list configuration. */
1236 	#define HWRM_FUNC_DBR_PACING_NQLIST_QUERY	UINT32_C(0x1a9)
1237 	/*
1238 	 * To notify the firmware that recovery cycle has been
1239 	 * completed by host function drivers.
1240 	 */
1241 	#define HWRM_FUNC_DBR_RECOVERY_COMPLETED	UINT32_C(0x1aa)
1242 	/* Configures SyncE configurations. */
1243 	#define HWRM_FUNC_SYNCE_CFG			UINT32_C(0x1ab)
1244 	/* Queries SyncE configurations. */
1245 	#define HWRM_FUNC_SYNCE_QCFG			UINT32_C(0x1ac)
1246 	/* The command is used to deallocate KTLS or QUIC key contexts. */
1247 	#define HWRM_FUNC_KEY_CTX_FREE			UINT32_C(0x1ad)
1248 	/* The command is used to configure link aggr group mode. */
1249 	#define HWRM_FUNC_LAG_MODE_CFG			UINT32_C(0x1ae)
1250 	/* The command is used to query link aggr group mode. */
1251 	#define HWRM_FUNC_LAG_MODE_QCFG		UINT32_C(0x1af)
1252 	/* The command is used to create a link aggr group. */
1253 	#define HWRM_FUNC_LAG_CREATE			UINT32_C(0x1b0)
1254 	/* The command is used to update a link aggr group. */
1255 	#define HWRM_FUNC_LAG_UPDATE			UINT32_C(0x1b1)
1256 	/* The command is used to free a link aggr group. */
1257 	#define HWRM_FUNC_LAG_FREE			UINT32_C(0x1b2)
1258 	/* The command is used to query a link aggr group. */
1259 	#define HWRM_FUNC_LAG_QCFG			UINT32_C(0x1b3)
1260 	/* This command is use to add TimeTX packet pacing rate. */
1261 	#define HWRM_FUNC_TIMEDTX_PACING_RATE_ADD	UINT32_C(0x1c2)
1262 	/*
1263 	 * This command is use to delete TimeTX packet pacing rate
1264 	 * from the rate table.
1265 	 */
1266 	#define HWRM_FUNC_TIMEDTX_PACING_RATE_DELETE	UINT32_C(0x1c3)
1267 	/*
1268 	 * This command is used to retrieve all the TimeTX pacing rates
1269 	 * from the rate table that have been added for the function.
1270 	 */
1271 	#define HWRM_FUNC_TIMEDTX_PACING_RATE_QUERY	UINT32_C(0x1c4)
1272 	/* Experimental */
1273 	#define HWRM_SELFTEST_QLIST			UINT32_C(0x200)
1274 	/* Experimental */
1275 	#define HWRM_SELFTEST_EXEC			UINT32_C(0x201)
1276 	/* Experimental */
1277 	#define HWRM_SELFTEST_IRQ			UINT32_C(0x202)
1278 	/* Experimental (deprecated) */
1279 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA	UINT32_C(0x203)
1280 	/* Experimental */
1281 	#define HWRM_PCIE_QSTATS			UINT32_C(0x204)
1282 	/* Experimental */
1283 	#define HWRM_MFG_FRU_WRITE_CONTROL		UINT32_C(0x205)
1284 	/* Returns the current value of a free running counter from the device. */
1285 	#define HWRM_MFG_TIMERS_QUERY			UINT32_C(0x206)
1286 	/* Experimental */
1287 	#define HWRM_MFG_OTP_CFG			UINT32_C(0x207)
1288 	/* Experimental */
1289 	#define HWRM_MFG_OTP_QCFG			UINT32_C(0x208)
1290 	/*
1291 	 * Tells the fw to run the DMA read from the host and DMA write
1292 	 * to the host test.
1293 	 */
1294 	#define HWRM_MFG_HDMA_TEST			UINT32_C(0x209)
1295 	/* Tells the fw to program the fru memory */
1296 	#define HWRM_MFG_FRU_EEPROM_WRITE		UINT32_C(0x20a)
1297 	/* Tells the fw to read the fru memory */
1298 	#define HWRM_MFG_FRU_EEPROM_READ		UINT32_C(0x20b)
1299 	/* Used to provision SoC software images */
1300 	#define HWRM_MFG_SOC_IMAGE			UINT32_C(0x20c)
1301 	/* Retrieves the SoC status and image provisioning information */
1302 	#define HWRM_MFG_SOC_QSTATUS			UINT32_C(0x20d)
1303 	/* Tells the fw to finalize the critical data (store and lock it) */
1304 	#define HWRM_MFG_PARAM_CRITICAL_DATA_FINALIZE	UINT32_C(0x20e)
1305 	/* Tells the fw to read the critical data */
1306 	#define HWRM_MFG_PARAM_CRITICAL_DATA_READ	UINT32_C(0x20f)
1307 	/* Tells the fw to get the health of critical data */
1308 	#define HWRM_MFG_PARAM_CRITICAL_DATA_HEALTH	UINT32_C(0x210)
1309 	/*
1310 	 * The command is used for certificate provisioning to export a
1311 	 * Certificate Signing Request (CSR) from the device.
1312 	 */
1313 	#define HWRM_MFG_PRVSN_EXPORT_CSR		UINT32_C(0x211)
1314 	/*
1315 	 * The command is used for certificate provisioning to import a
1316 	 * CA-signed certificate chain to the device.
1317 	 */
1318 	#define HWRM_MFG_PRVSN_IMPORT_CERT		UINT32_C(0x212)
1319 	/*
1320 	 * The command is used for certificate provisioning to query the
1321 	 * provisioned state.
1322 	 */
1323 	#define HWRM_MFG_PRVSN_GET_STATE		UINT32_C(0x213)
1324 	/*
1325 	 * The command is used to get the hash of the NVM configuration that is
1326 	 * calculated during firmware boot.
1327 	 */
1328 	#define HWRM_MFG_GET_NVM_MEASUREMENT		UINT32_C(0x214)
1329 	/* Retrieves the PSOC status and provisioning information. */
1330 	#define HWRM_MFG_PSOC_QSTATUS			UINT32_C(0x215)
1331 	/*
1332 	 * This command allows manufacturing tool to determine which selftests
1333 	 * are available to be run.
1334 	 */
1335 	#define HWRM_MFG_SELFTEST_QLIST		UINT32_C(0x216)
1336 	/*
1337 	 * This command allows manufacturing tool to request which selftests
1338 	 * to run.
1339 	 */
1340 	#define HWRM_MFG_SELFTEST_EXEC			UINT32_C(0x217)
1341 	/* Queries the generic stats */
1342 	#define HWRM_STAT_GENERIC_QSTATS		UINT32_C(0x218)
1343 	/*
1344 	 * The command is used for certificate provisioning to export a
1345 	 * certificate chain from the device.
1346 	 */
1347 	#define HWRM_MFG_PRVSN_EXPORT_CERT		UINT32_C(0x219)
1348 	/* Query the statistics for doorbell drops due to various error conditions. */
1349 	#define HWRM_STAT_DB_ERROR_QSTATS		UINT32_C(0x21a)
1350 	/*
1351 	 * The command is used to enable/disable the power on ethernet for
1352 	 * a particular I/O expander port.
1353 	 */
1354 	#define HWRM_PORT_POE_CFG			UINT32_C(0x230)
1355 	/*
1356 	 * The command is used to query whether the power on ethernet
1357 	 * is enabled/disabled for a particular I/O expander port.
1358 	 */
1359 	#define HWRM_PORT_POE_QCFG			UINT32_C(0x231)
1360 	/*
1361 	 * This command returns the capabilities related to User Defined
1362 	 * Congestion Control on a function.
1363 	 */
1364 	#define HWRM_UDCC_QCAPS			UINT32_C(0x258)
1365 	/* This command configures User Defined Congestion Control on a function. */
1366 	#define HWRM_UDCC_CFG				UINT32_C(0x259)
1367 	/*
1368 	 * This command queries the configuration of User Defined Congestion
1369 	 * Control on a function.
1370 	 */
1371 	#define HWRM_UDCC_QCFG				UINT32_C(0x25a)
1372 	/* This command configures an existing UDCC session. */
1373 	#define HWRM_UDCC_SESSION_CFG			UINT32_C(0x25b)
1374 	/* This command queries the configuration of a UDCC session. */
1375 	#define HWRM_UDCC_SESSION_QCFG			UINT32_C(0x25c)
1376 	/* This command queries the UDCC session. */
1377 	#define HWRM_UDCC_SESSION_QUERY		UINT32_C(0x25d)
1378 	/* This command configures the computation unit. */
1379 	#define HWRM_UDCC_COMP_CFG			UINT32_C(0x25e)
1380 	/* This command queries the configuration of the computation unit. */
1381 	#define HWRM_UDCC_COMP_QCFG			UINT32_C(0x25f)
1382 	/* This command queries the status and statistics of the computation unit. */
1383 	#define HWRM_UDCC_COMP_QUERY			UINT32_C(0x260)
1384 	/*
1385 	 * This command is used to query the pfc watchdog max configurable
1386 	 * timeout value.
1387 	 */
1388 	#define HWRM_QUEUE_PFCWD_TIMEOUT_QCAPS		UINT32_C(0x261)
1389 	/* This command is used to set the PFC watchdog timeout value. */
1390 	#define HWRM_QUEUE_PFCWD_TIMEOUT_CFG		UINT32_C(0x262)
1391 	/*
1392 	 * This command is used to query the current configured pfc watchdog
1393 	 * timeout value.
1394 	 */
1395 	#define HWRM_QUEUE_PFCWD_TIMEOUT_QCFG		UINT32_C(0x263)
1396 	/* Experimental */
1397 	#define HWRM_TF				UINT32_C(0x2bc)
1398 	/* Experimental */
1399 	#define HWRM_TF_VERSION_GET			UINT32_C(0x2bd)
1400 	/* Experimental */
1401 	#define HWRM_TF_SESSION_OPEN			UINT32_C(0x2c6)
1402 	/* Experimental */
1403 	#define HWRM_TF_SESSION_REGISTER		UINT32_C(0x2c8)
1404 	/* Experimental */
1405 	#define HWRM_TF_SESSION_UNREGISTER		UINT32_C(0x2c9)
1406 	/* Experimental */
1407 	#define HWRM_TF_SESSION_CLOSE			UINT32_C(0x2ca)
1408 	/* Experimental */
1409 	#define HWRM_TF_SESSION_QCFG			UINT32_C(0x2cb)
1410 	/* Experimental */
1411 	#define HWRM_TF_SESSION_RESC_QCAPS		UINT32_C(0x2cc)
1412 	/* Experimental */
1413 	#define HWRM_TF_SESSION_RESC_ALLOC		UINT32_C(0x2cd)
1414 	/* Experimental */
1415 	#define HWRM_TF_SESSION_RESC_FREE		UINT32_C(0x2ce)
1416 	/* Experimental */
1417 	#define HWRM_TF_SESSION_RESC_FLUSH		UINT32_C(0x2cf)
1418 	/* Experimental */
1419 	#define HWRM_TF_SESSION_RESC_INFO		UINT32_C(0x2d0)
1420 	/* Experimental */
1421 	#define HWRM_TF_SESSION_HOTUP_STATE_SET	UINT32_C(0x2d1)
1422 	/* Experimental */
1423 	#define HWRM_TF_SESSION_HOTUP_STATE_GET	UINT32_C(0x2d2)
1424 	/* Experimental */
1425 	#define HWRM_TF_TBL_TYPE_GET			UINT32_C(0x2da)
1426 	/* Experimental */
1427 	#define HWRM_TF_TBL_TYPE_SET			UINT32_C(0x2db)
1428 	/* Experimental */
1429 	#define HWRM_TF_TBL_TYPE_BULK_GET		UINT32_C(0x2dc)
1430 	/* Experimental */
1431 	#define HWRM_TF_EM_INSERT			UINT32_C(0x2ea)
1432 	/* Experimental */
1433 	#define HWRM_TF_EM_DELETE			UINT32_C(0x2eb)
1434 	/* Experimental */
1435 	#define HWRM_TF_EM_HASH_INSERT			UINT32_C(0x2ec)
1436 	/* Experimental */
1437 	#define HWRM_TF_EM_MOVE			UINT32_C(0x2ed)
1438 	/* Experimental */
1439 	#define HWRM_TF_TCAM_SET			UINT32_C(0x2f8)
1440 	/* Experimental */
1441 	#define HWRM_TF_TCAM_GET			UINT32_C(0x2f9)
1442 	/* Experimental */
1443 	#define HWRM_TF_TCAM_MOVE			UINT32_C(0x2fa)
1444 	/* Experimental */
1445 	#define HWRM_TF_TCAM_FREE			UINT32_C(0x2fb)
1446 	/* Experimental */
1447 	#define HWRM_TF_GLOBAL_CFG_SET			UINT32_C(0x2fc)
1448 	/* Experimental */
1449 	#define HWRM_TF_GLOBAL_CFG_GET			UINT32_C(0x2fd)
1450 	/* Experimental */
1451 	#define HWRM_TF_IF_TBL_SET			UINT32_C(0x2fe)
1452 	/* Experimental */
1453 	#define HWRM_TF_IF_TBL_GET			UINT32_C(0x2ff)
1454 	/* Experimental */
1455 	#define HWRM_TF_RESC_USAGE_SET			UINT32_C(0x300)
1456 	/* Experimental */
1457 	#define HWRM_TF_RESC_USAGE_QUERY		UINT32_C(0x301)
1458 	/* Truflow command to allocate a table */
1459 	#define HWRM_TF_TBL_TYPE_ALLOC			UINT32_C(0x302)
1460 	/* Truflow command to free a table */
1461 	#define HWRM_TF_TBL_TYPE_FREE			UINT32_C(0x303)
1462 	/* TruFlow command to check firmware table scope capabilities. */
1463 	#define HWRM_TFC_TBL_SCOPE_QCAPS		UINT32_C(0x380)
1464 	/* TruFlow command to allocate a table scope ID and create the pools. */
1465 	#define HWRM_TFC_TBL_SCOPE_ID_ALLOC		UINT32_C(0x381)
1466 	/* TruFlow command to configure the table scope memory. */
1467 	#define HWRM_TFC_TBL_SCOPE_CONFIG		UINT32_C(0x382)
1468 	/* TruFlow command to deconfigure a table scope memory. */
1469 	#define HWRM_TFC_TBL_SCOPE_DECONFIG		UINT32_C(0x383)
1470 	/* TruFlow command to add a FID to a table scope. */
1471 	#define HWRM_TFC_TBL_SCOPE_FID_ADD		UINT32_C(0x384)
1472 	/* TruFlow command to remove a FID from a table scope. */
1473 	#define HWRM_TFC_TBL_SCOPE_FID_REM		UINT32_C(0x385)
1474 	/* DEPRECATED */
1475 	#define HWRM_TFC_TBL_SCOPE_POOL_ALLOC		UINT32_C(0x386)
1476 	/* DEPRECATED */
1477 	#define HWRM_TFC_TBL_SCOPE_POOL_FREE		UINT32_C(0x387)
1478 	/* Experimental */
1479 	#define HWRM_TFC_SESSION_ID_ALLOC		UINT32_C(0x388)
1480 	/* Experimental */
1481 	#define HWRM_TFC_SESSION_FID_ADD		UINT32_C(0x389)
1482 	/* Experimental */
1483 	#define HWRM_TFC_SESSION_FID_REM		UINT32_C(0x38a)
1484 	/* Experimental */
1485 	#define HWRM_TFC_IDENT_ALLOC			UINT32_C(0x38b)
1486 	/* Experimental */
1487 	#define HWRM_TFC_IDENT_FREE			UINT32_C(0x38c)
1488 	/* TruFlow command to allocate an index table entry */
1489 	#define HWRM_TFC_IDX_TBL_ALLOC			UINT32_C(0x38d)
1490 	/* TruFlow command to allocate and set an index table entry */
1491 	#define HWRM_TFC_IDX_TBL_ALLOC_SET		UINT32_C(0x38e)
1492 	/* TruFlow command to set an index table entry */
1493 	#define HWRM_TFC_IDX_TBL_SET			UINT32_C(0x38f)
1494 	/* TruFlow command to get an index table entry */
1495 	#define HWRM_TFC_IDX_TBL_GET			UINT32_C(0x390)
1496 	/* TruFlow command to free an index table entry */
1497 	#define HWRM_TFC_IDX_TBL_FREE			UINT32_C(0x391)
1498 	/* TruFlow command to allocate resources for a global id. */
1499 	#define HWRM_TFC_GLOBAL_ID_ALLOC		UINT32_C(0x392)
1500 	/* TruFlow command to set TCAM entry. */
1501 	#define HWRM_TFC_TCAM_SET			UINT32_C(0x393)
1502 	/* TruFlow command to get TCAM entry. */
1503 	#define HWRM_TFC_TCAM_GET			UINT32_C(0x394)
1504 	/* TruFlow command to allocate a TCAM entry. */
1505 	#define HWRM_TFC_TCAM_ALLOC			UINT32_C(0x395)
1506 	/* TruFlow command allocate and set TCAM entry. */
1507 	#define HWRM_TFC_TCAM_ALLOC_SET		UINT32_C(0x396)
1508 	/* TruFlow command to free a TCAM entry. */
1509 	#define HWRM_TFC_TCAM_FREE			UINT32_C(0x397)
1510 	/* Truflow command to set an interface table entry */
1511 	#define HWRM_TFC_IF_TBL_SET			UINT32_C(0x398)
1512 	/* Truflow command to get an interface table entry */
1513 	#define HWRM_TFC_IF_TBL_GET			UINT32_C(0x399)
1514 	/* TruFlow command to get configured info about a table scope. */
1515 	#define HWRM_TFC_TBL_SCOPE_CONFIG_GET		UINT32_C(0x39a)
1516 	/* TruFlow command to query the resource usage state. */
1517 	#define HWRM_TFC_RESC_USAGE_QUERY		UINT32_C(0x39b)
1518 	/* Experimental */
1519 	#define HWRM_SV				UINT32_C(0x400)
1520 	/* Run a PCIe or Ethernet serdes test and retrieve test data. */
1521 	#define HWRM_DBG_SERDES_TEST			UINT32_C(0xff0e)
1522 	/* Flush any trace buffer data that has not been sent to the host. */
1523 	#define HWRM_DBG_LOG_BUFFER_FLUSH		UINT32_C(0xff0f)
1524 	/* Experimental */
1525 	#define HWRM_DBG_READ_DIRECT			UINT32_C(0xff10)
1526 	/* Experimental */
1527 	#define HWRM_DBG_READ_INDIRECT			UINT32_C(0xff11)
1528 	/* Experimental */
1529 	#define HWRM_DBG_WRITE_DIRECT			UINT32_C(0xff12)
1530 	/* Experimental */
1531 	#define HWRM_DBG_WRITE_INDIRECT		UINT32_C(0xff13)
1532 	#define HWRM_DBG_DUMP				UINT32_C(0xff14)
1533 	/* Experimental */
1534 	#define HWRM_DBG_ERASE_NVM			UINT32_C(0xff15)
1535 	/* Experimental */
1536 	#define HWRM_DBG_CFG				UINT32_C(0xff16)
1537 	/* Experimental */
1538 	#define HWRM_DBG_COREDUMP_LIST			UINT32_C(0xff17)
1539 	/* Experimental */
1540 	#define HWRM_DBG_COREDUMP_INITIATE		UINT32_C(0xff18)
1541 	/* Experimental */
1542 	#define HWRM_DBG_COREDUMP_RETRIEVE		UINT32_C(0xff19)
1543 	/* Experimental */
1544 	#define HWRM_DBG_FW_CLI			UINT32_C(0xff1a)
1545 	/*  */
1546 	#define HWRM_DBG_I2C_CMD			UINT32_C(0xff1b)
1547 	/*  */
1548 	#define HWRM_DBG_RING_INFO_GET			UINT32_C(0xff1c)
1549 	/* Experimental */
1550 	#define HWRM_DBG_CRASHDUMP_HEADER		UINT32_C(0xff1d)
1551 	/* Experimental */
1552 	#define HWRM_DBG_CRASHDUMP_ERASE		UINT32_C(0xff1e)
1553 	/* Send driver debug information to firmware */
1554 	#define HWRM_DBG_DRV_TRACE			UINT32_C(0xff1f)
1555 	/* Query debug capabilities of firmware */
1556 	#define HWRM_DBG_QCAPS				UINT32_C(0xff20)
1557 	/* Retrieve debug settings of firmware */
1558 	#define HWRM_DBG_QCFG				UINT32_C(0xff21)
1559 	/* Set destination parameters for crashdump medium */
1560 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG		UINT32_C(0xff22)
1561 	/* Experimental */
1562 	#define HWRM_DBG_USEQ_ALLOC			UINT32_C(0xff23)
1563 	/* Experimental */
1564 	#define HWRM_DBG_USEQ_FREE			UINT32_C(0xff24)
1565 	/* Experimental */
1566 	#define HWRM_DBG_USEQ_FLUSH			UINT32_C(0xff25)
1567 	/* Experimental */
1568 	#define HWRM_DBG_USEQ_QCAPS			UINT32_C(0xff26)
1569 	/* Experimental */
1570 	#define HWRM_DBG_USEQ_CW_CFG			UINT32_C(0xff27)
1571 	/* Experimental */
1572 	#define HWRM_DBG_USEQ_SCHED_CFG		UINT32_C(0xff28)
1573 	/* Experimental */
1574 	#define HWRM_DBG_USEQ_RUN			UINT32_C(0xff29)
1575 	/* Experimental */
1576 	#define HWRM_DBG_USEQ_DELIVERY_REQ		UINT32_C(0xff2a)
1577 	/* Experimental */
1578 	#define HWRM_DBG_USEQ_RESP_HDR			UINT32_C(0xff2b)
1579 	/*
1580 	 * This command is used to request the firmware to store a coredump
1581 	 * into Host memory previously specified with the
1582 	 * HWRM_DBG_CRASHDUMP_MEDIUM_CFG API
1583 	 */
1584 	#define HWRM_DBG_COREDUMP_CAPTURE		UINT32_C(0xff2c)
1585 	#define HWRM_DBG_PTRACE			UINT32_C(0xff2d)
1586 	/*
1587 	 * This command is used to request the firmware to simulate cable insert
1588 	 * or removal.
1589 	 */
1590 	#define HWRM_DBG_SIM_CABLE_STATE		UINT32_C(0xff2e)
1591 	#define HWRM_NVM_GET_VPD_FIELD_INFO		UINT32_C(0xffea)
1592 	#define HWRM_NVM_SET_VPD_FIELD_INFO		UINT32_C(0xffeb)
1593 	#define HWRM_NVM_DEFRAG			UINT32_C(0xffec)
1594 	#define HWRM_NVM_REQ_ARBITRATION		UINT32_C(0xffed)
1595 	/* Experimental */
1596 	#define HWRM_NVM_FACTORY_DEFAULTS		UINT32_C(0xffee)
1597 	#define HWRM_NVM_VALIDATE_OPTION		UINT32_C(0xffef)
1598 	#define HWRM_NVM_FLUSH				UINT32_C(0xfff0)
1599 	#define HWRM_NVM_GET_VARIABLE			UINT32_C(0xfff1)
1600 	#define HWRM_NVM_SET_VARIABLE			UINT32_C(0xfff2)
1601 	#define HWRM_NVM_INSTALL_UPDATE		UINT32_C(0xfff3)
1602 	#define HWRM_NVM_MODIFY			UINT32_C(0xfff4)
1603 	#define HWRM_NVM_VERIFY_UPDATE			UINT32_C(0xfff5)
1604 	#define HWRM_NVM_GET_DEV_INFO			UINT32_C(0xfff6)
1605 	#define HWRM_NVM_ERASE_DIR_ENTRY		UINT32_C(0xfff7)
1606 	#define HWRM_NVM_MOD_DIR_ENTRY			UINT32_C(0xfff8)
1607 	#define HWRM_NVM_FIND_DIR_ENTRY		UINT32_C(0xfff9)
1608 	#define HWRM_NVM_GET_DIR_ENTRIES		UINT32_C(0xfffa)
1609 	#define HWRM_NVM_GET_DIR_INFO			UINT32_C(0xfffb)
1610 	#define HWRM_NVM_RAW_DUMP			UINT32_C(0xfffc)
1611 	#define HWRM_NVM_READ				UINT32_C(0xfffd)
1612 	#define HWRM_NVM_WRITE				UINT32_C(0xfffe)
1613 	#define HWRM_NVM_RAW_WRITE_BLK			UINT32_C(0xffff)
1614 	#define HWRM_LAST				HWRM_NVM_RAW_WRITE_BLK
1615 	uint16_t	unused_0[3];
1616 } cmd_nums_t, *pcmd_nums_t;
1617 
1618 /* Return Codes */
1619 /* ret_codes (size:64b/8B) */
1620 
1621 typedef struct ret_codes {
1622 	uint16_t	error_code;
1623 	/* Request was successfully executed by the HWRM. */
1624 	#define HWRM_ERR_CODE_SUCCESS			UINT32_C(0x0)
1625 	/* The HWRM failed to execute the request. */
1626 	#define HWRM_ERR_CODE_FAIL			UINT32_C(0x1)
1627 	/*
1628 	 * The request contains invalid argument(s) or input
1629 	 * parameters.
1630 	 */
1631 	#define HWRM_ERR_CODE_INVALID_PARAMS		UINT32_C(0x2)
1632 	/*
1633 	 * The requester is not allowed to access the requested
1634 	 * resource. This error code shall be provided in a
1635 	 * response to a request to query or modify an existing
1636 	 * resource that is not accessible by the requester.
1637 	 */
1638 	#define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED	UINT32_C(0x3)
1639 	/*
1640 	 * The HWRM is unable to allocate the requested resource.
1641 	 * This code only applies to requests for HWRM resource
1642 	 * allocations.
1643 	 */
1644 	#define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR	UINT32_C(0x4)
1645 	/*
1646 	 * Invalid combination of flags is specified in the
1647 	 * request.
1648 	 */
1649 	#define HWRM_ERR_CODE_INVALID_FLAGS		UINT32_C(0x5)
1650 	/*
1651 	 * Invalid combination of enables fields is specified in
1652 	 * the request.
1653 	 */
1654 	#define HWRM_ERR_CODE_INVALID_ENABLES		UINT32_C(0x6)
1655 	/*
1656 	 * Request contains a required TLV that is not supported by
1657 	 * the installed version of firmware.
1658 	 */
1659 	#define HWRM_ERR_CODE_UNSUPPORTED_TLV		UINT32_C(0x7)
1660 	/*
1661 	 * No firmware buffer available to accept the request. Driver
1662 	 * should retry the request.
1663 	 */
1664 	#define HWRM_ERR_CODE_NO_BUFFER			UINT32_C(0x8)
1665 	/*
1666 	 * This error code is only reported by firmware when some
1667 	 * sub-option of a supported HWRM command is unsupported.
1668 	 */
1669 	#define HWRM_ERR_CODE_UNSUPPORTED_OPTION_ERR	UINT32_C(0x9)
1670 	/*
1671 	 * This error code is only reported by firmware when the specific
1672 	 * request is not able to process when the HOT reset in progress.
1673 	 */
1674 	#define HWRM_ERR_CODE_HOT_RESET_PROGRESS	UINT32_C(0xa)
1675 	/*
1676 	 * This error code is only reported by firmware when the registered
1677 	 * driver instances are not capable of hot reset.
1678 	 */
1679 	#define HWRM_ERR_CODE_HOT_RESET_FAIL		UINT32_C(0xb)
1680 	/*
1681 	 * This error code is only reported by the firmware when during
1682 	 * flow allocation when a request for a flow counter fails because
1683 	 * the number of flow counters are exhausted.
1684 	 */
1685 	#define HWRM_ERR_CODE_NO_FLOW_COUNTER_DURING_ALLOC UINT32_C(0xc)
1686 	/*
1687 	 * This error code is only reported by firmware when the registered
1688 	 * driver instances requested to offloaded a flow but was unable to
1689 	 * because the requested key's hash collides with the installed keys.
1690 	 */
1691 	#define HWRM_ERR_CODE_KEY_HASH_COLLISION	UINT32_C(0xd)
1692 	/*
1693 	 * This error code is only reported by firmware when the registered
1694 	 * driver instances requested to offloaded a flow but was unable to
1695 	 * because the same key has already been installed.
1696 	 */
1697 	#define HWRM_ERR_CODE_KEY_ALREADY_EXISTS	UINT32_C(0xe)
1698 	/*
1699 	 * Generic HWRM execution error that represents an
1700 	 * internal error.
1701 	 */
1702 	#define HWRM_ERR_CODE_HWRM_ERROR		UINT32_C(0xf)
1703 	/*
1704 	 * Firmware is unable to service the request at the present time.
1705 	 * Caller may try again later.
1706 	 */
1707 	#define HWRM_ERR_CODE_BUSY			UINT32_C(0x10)
1708 	/*
1709 	 * This error code is reported by Firmware when an operation requested
1710 	 * by the host is not allowed due to a secure lock violation.
1711 	 */
1712 	#define HWRM_ERR_CODE_RESOURCE_LOCKED		UINT32_C(0x11)
1713 	/*
1714 	 * This error code is reported by Firmware when an operation requested
1715 	 * by a VF cannot be forwarded to the parent PF as required, either
1716 	 * because the PF is down or otherwise doesn't have an appropriate
1717 	 * async completion ring or associated forwarding buffers configured.
1718 	 */
1719 	#define HWRM_ERR_CODE_PF_UNAVAILABLE		UINT32_C(0x12)
1720 	/*
1721 	 * This error code is reported by Firmware when the specific entity
1722 	 * requested by the host is not present or does not exist.
1723 	 */
1724 	#define HWRM_ERR_CODE_ENTITY_NOT_PRESENT	UINT32_C(0x13)
1725 	/*
1726 	 * This value indicates that the HWRM response is in TLV format and
1727 	 * should be interpreted as one or more TLVs starting with the
1728 	 * hwrm_resp_hdr TLV. This value is not an indication of any error
1729 	 * by itself, just an indication that the response should be parsed
1730 	 * as TLV and the actual error code will be in the hwrm_resp_hdr TLV.
1731 	 */
1732 	#define HWRM_ERR_CODE_TLV_ENCAPSULATED_RESPONSE	UINT32_C(0x8000)
1733 	/* Unknown error */
1734 	#define HWRM_ERR_CODE_UNKNOWN_ERR		UINT32_C(0xfffe)
1735 	/* Unsupported or invalid command */
1736 	#define HWRM_ERR_CODE_CMD_NOT_SUPPORTED		UINT32_C(0xffff)
1737 	#define HWRM_ERR_CODE_LAST			HWRM_ERR_CODE_CMD_NOT_SUPPORTED
1738 	uint16_t	unused_0[3];
1739 } ret_codes_t, *pret_codes_t;
1740 
1741 #define GET_HWRM_ERROR_CODE(x) \
1742 	(((x) < 0x80) ? \
1743 	((x) == 0x0 ? "SUCCESS": \
1744 	((x) == 0x1 ? "FAIL": \
1745 	((x) == 0x2 ? "INVALID_PARAMS": \
1746 	((x) == 0x3 ? "RESOURCE_ACCESS_DENIED": \
1747 	((x) == 0x4 ? "RESOURCE_ALLOC_ERROR": \
1748 	((x) == 0x5 ? "INVALID_FLAGS": \
1749 	((x) == 0x6 ? "INVALID_ENABLES": \
1750 	((x) == 0x7 ? "UNSUPPORTED_TLV": \
1751 	((x) == 0x8 ? "NO_BUFFER": \
1752 	((x) == 0x9 ? "UNSUPPORTED_OPTION_ERR": \
1753 	((x) == 0xa ? "HOT_RESET_PROGRESS": \
1754 	((x) == 0xb ? "HOT_RESET_FAIL": \
1755 	((x) == 0xc ? "NO_FLOW_COUNTER_DURING_ALLOC": \
1756 	((x) == 0xd ? "KEY_HASH_COLLISION": \
1757 	((x) == 0xe ? "KEY_ALREADY_EXISTS": \
1758 	((x) == 0xf ? "HWRM_ERROR": \
1759 	((x) == 0x10 ? "BUSY": \
1760 	((x) == 0x11 ? "RESOURCE_LOCKED": \
1761 	((x) == 0x12 ? "PF_UNAVAILABLE": \
1762 	((x) == 0x13 ? "ENTITY_NOT_PRESENT": \
1763 	"Unknown decode" )))))))))))))))))))) : \
1764 	(((x) < 0x8080) ? \
1765 	((x) == 0x8000 ? "TLV_ENCAPSULATED_RESPONSE": \
1766 	"Unknown decode" ) : \
1767 	(((x) <= UINT16_MAX) ? \
1768 	((x) == 0xfffe ? "UNKNOWN_ERR": \
1769 	((x) == 0xffff ? "CMD_NOT_SUPPORTED": \
1770 	"Unknown decode" )) : \
1771 	"Unknown decode" )))
1772 
1773 
1774 /* Output */
1775 /* hwrm_err_output (size:128b/16B) */
1776 
1777 typedef struct hwrm_err_output {
1778 	/*
1779 	 * Pass/Fail or error type
1780 	 *
1781 	 * Note: receiver to verify the in parameters, and fail the call
1782 	 * with an error when appropriate
1783 	 */
1784 	uint16_t	error_code;
1785 	/* This field returns the type of original request. */
1786 	uint16_t	req_type;
1787 	/* This field provides original sequence number of the command. */
1788 	uint16_t	seq_id;
1789 	/*
1790 	 * This field is the length of the response in bytes. The
1791 	 * last byte of the response is a valid flag that will read
1792 	 * as '1' when the command has been completely written to
1793 	 * memory.
1794 	 */
1795 	uint16_t	resp_len;
1796 	/* debug info for this error response. */
1797 	uint32_t	opaque_0;
1798 	/* debug info for this error response. */
1799 	uint16_t	opaque_1;
1800 	/*
1801 	 * In the case of an error response, command specific error
1802 	 * code is returned in this field.
1803 	 */
1804 	uint8_t	cmd_err;
1805 	/*
1806 	 * This field is used in Output records to indicate that the output
1807 	 * is completely written to RAM. This field should be read as '1'
1808 	 * to indicate that the output has been completely written. When
1809 	 * writing a command completion or response to an internal processor,
1810 	 * the order of writes has to be such that this field is written last.
1811 	 */
1812 	uint8_t	valid;
1813 } hwrm_err_output_t, *phwrm_err_output_t;
1814 
1815 /*
1816  * Following is the signature for HWRM message field that indicates not
1817  * applicable (All F's). Need to cast it the size of the field if needed.
1818  */
1819 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
1820 /*
1821  * This is reflecting the size of the PF mailbox and not the maximum
1822  * command size for any of the HWRM command structures. To determine
1823  * the maximum size of an HWRM command supported by the firmware, see
1824  * the max_ext_req_len field in the response of the HWRM_VER_GET command.
1825  */
1826 #define HWRM_MAX_REQ_LEN 128
1827 /* hwrm_cfa_flow_info */
1828 #define HWRM_MAX_RESP_LEN 704
1829 /* 7 bit indirection table index. */
1830 #define HW_HASH_INDEX_SIZE 0x80
1831 #define HW_HASH_KEY_SIZE 40
1832 /* valid key for HWRM response */
1833 #define HWRM_RESP_VALID_KEY 1
1834 /* Reserved for BONO processor */
1835 #define HWRM_TARGET_ID_BONO 0xFFF8
1836 /* Reserved for KONG processor */
1837 #define HWRM_TARGET_ID_KONG 0xFFF9
1838 /* Reserved for APE processor */
1839 #define HWRM_TARGET_ID_APE 0xFFFA
1840 /*
1841  * This value will be used by tools for User-space HWRM Interface.
1842  * When tool execute any HWRM command with this target_id, firmware
1843  * will copy the response and/or data payload via register space instead
1844  * of DMAing it.
1845  */
1846 #define HWRM_TARGET_ID_TOOLS 0xFFFD
1847 #define HWRM_VERSION_MAJOR 1
1848 #define HWRM_VERSION_MINOR 10
1849 #define HWRM_VERSION_UPDATE 3
1850 /* non-zero means beta version */
1851 #define HWRM_VERSION_RSVD 61
1852 #define HWRM_VERSION_STR "1.10.3.61"
1853 
1854 /****************
1855  * hwrm_ver_get *
1856  ****************/
1857 
1858 
1859 /* hwrm_ver_get_input (size:192b/24B) */
1860 
1861 typedef struct hwrm_ver_get_input {
1862 	/* The HWRM command request type. */
1863 	uint16_t	req_type;
1864 	/*
1865 	 * The completion ring to send the completion event on. This should
1866 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
1867 	 */
1868 	uint16_t	cmpl_ring;
1869 	/*
1870 	 * The sequence ID is used by the driver for tracking multiple
1871 	 * commands. This ID is treated as opaque data by the firmware and
1872 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
1873 	 */
1874 	uint16_t	seq_id;
1875 	/*
1876 	 * The target ID of the command:
1877 	 * * 0x0-0xFFF8 - The function ID
1878 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
1879 	 * * 0xFFFD - Reserved for user-space HWRM interface
1880 	 * * 0xFFFF - HWRM
1881 	 */
1882 	uint16_t	target_id;
1883 	/*
1884 	 * A physical address pointer pointing to a host buffer that the
1885 	 * command's response data will be written. This can be either a host
1886 	 * physical address (HPA) or a guest physical address (GPA) and must
1887 	 * point to a physically contiguous block of memory.
1888 	 */
1889 	uint64_t	resp_addr;
1890 	/*
1891 	 * This field represents the major version of HWRM interface
1892 	 * specification supported by the driver HWRM implementation.
1893 	 * The interface major version is intended to change only when
1894 	 * non backward compatible changes are made to the HWRM
1895 	 * interface specification.
1896 	 */
1897 	uint8_t	hwrm_intf_maj;
1898 	/*
1899 	 * This field represents the minor version of HWRM interface
1900 	 * specification supported by the driver HWRM implementation.
1901 	 * A change in interface minor version is used to reflect
1902 	 * significant backward compatible modification to HWRM
1903 	 * interface specification.
1904 	 * This can be due to addition or removal of functionality.
1905 	 * HWRM interface specifications with the same major version
1906 	 * but different minor versions are compatible.
1907 	 */
1908 	uint8_t	hwrm_intf_min;
1909 	/*
1910 	 * This field represents the update version of HWRM interface
1911 	 * specification supported by the driver HWRM implementation.
1912 	 * The interface update version is used to reflect minor
1913 	 * changes or bug fixes to a released HWRM interface
1914 	 * specification.
1915 	 */
1916 	uint8_t	hwrm_intf_upd;
1917 	uint8_t	unused_0[5];
1918 } hwrm_ver_get_input_t, *phwrm_ver_get_input_t;
1919 
1920 /* hwrm_ver_get_output (size:1408b/176B) */
1921 
1922 typedef struct hwrm_ver_get_output {
1923 	/* The specific error status for the command. */
1924 	uint16_t	error_code;
1925 	/* The HWRM command request type. */
1926 	uint16_t	req_type;
1927 	/* The sequence ID from the original command. */
1928 	uint16_t	seq_id;
1929 	/* The length of the response data in number of bytes. */
1930 	uint16_t	resp_len;
1931 	/*
1932 	 * This field represents the major version of HWRM interface
1933 	 * specification supported by the HWRM implementation.
1934 	 * The interface major version is intended to change only when
1935 	 * non backward compatible changes are made to the HWRM
1936 	 * interface specification.
1937 	 * A HWRM implementation that is compliant with this
1938 	 * specification shall provide value of 1 in this field.
1939 	 */
1940 	uint8_t	hwrm_intf_maj_8b;
1941 	/*
1942 	 * This field represents the minor version of HWRM interface
1943 	 * specification supported by the HWRM implementation.
1944 	 * A change in interface minor version is used to reflect
1945 	 * significant backward compatible modification to HWRM
1946 	 * interface specification.
1947 	 * This can be due to addition or removal of functionality.
1948 	 * HWRM interface specifications with the same major version
1949 	 * but different minor versions are compatible.
1950 	 * A HWRM implementation that is compliant with this
1951 	 * specification shall provide value of 2 in this field.
1952 	 */
1953 	uint8_t	hwrm_intf_min_8b;
1954 	/*
1955 	 * This field represents the update version of HWRM interface
1956 	 * specification supported by the HWRM implementation.
1957 	 * The interface update version is used to reflect minor
1958 	 * changes or bug fixes to a released HWRM interface
1959 	 * specification.
1960 	 * A HWRM implementation that is compliant with this
1961 	 * specification shall provide value of 2 in this field.
1962 	 */
1963 	uint8_t	hwrm_intf_upd_8b;
1964 	uint8_t	hwrm_intf_rsvd_8b;
1965 	/*
1966 	 * This field represents the major version of HWRM firmware.
1967 	 * A change in firmware major version represents a major
1968 	 * firmware release.
1969 	 */
1970 	uint8_t	hwrm_fw_maj_8b;
1971 	/*
1972 	 * This field represents the minor version of HWRM firmware.
1973 	 * A change in firmware minor version represents significant
1974 	 * firmware functionality changes.
1975 	 */
1976 	uint8_t	hwrm_fw_min_8b;
1977 	/*
1978 	 * This field represents the build version of HWRM firmware.
1979 	 * A change in firmware build version represents bug fixes
1980 	 * to a released firmware.
1981 	 */
1982 	uint8_t	hwrm_fw_bld_8b;
1983 	/*
1984 	 * This field is a reserved field. This field can be used to
1985 	 * represent firmware branches or customer specific releases
1986 	 * tied to a specific (major,minor,update) version of the
1987 	 * HWRM firmware.
1988 	 */
1989 	uint8_t	hwrm_fw_rsvd_8b;
1990 	/*
1991 	 * This field represents the major version of mgmt firmware.
1992 	 * A change in major version represents a major release.
1993 	 */
1994 	uint8_t	mgmt_fw_maj_8b;
1995 	/*
1996 	 * This field represents the minor version of mgmt firmware.
1997 	 * A change in minor version represents significant
1998 	 * functionality changes.
1999 	 */
2000 	uint8_t	mgmt_fw_min_8b;
2001 	/*
2002 	 * This field represents the build version of mgmt firmware.
2003 	 * A change in update version represents bug fixes.
2004 	 */
2005 	uint8_t	mgmt_fw_bld_8b;
2006 	/*
2007 	 * This field is a reserved field. This field can be used to
2008 	 * represent firmware branches or customer specific releases
2009 	 * tied to a specific (major,minor,update) version
2010 	 */
2011 	uint8_t	mgmt_fw_rsvd_8b;
2012 	/*
2013 	 * This field represents the major version of network
2014 	 * control firmware.
2015 	 * A change in major version represents a major release.
2016 	 */
2017 	uint8_t	netctrl_fw_maj_8b;
2018 	/*
2019 	 * This field represents the minor version of network
2020 	 * control firmware.
2021 	 * A change in minor version represents significant
2022 	 * functionality changes.
2023 	 */
2024 	uint8_t	netctrl_fw_min_8b;
2025 	/*
2026 	 * This field represents the build version of network
2027 	 * control firmware.
2028 	 * A change in update version represents bug fixes.
2029 	 */
2030 	uint8_t	netctrl_fw_bld_8b;
2031 	/*
2032 	 * This field is a reserved field. This field can be used to
2033 	 * represent firmware branches or customer specific releases
2034 	 * tied to a specific (major,minor,update) version
2035 	 */
2036 	uint8_t	netctrl_fw_rsvd_8b;
2037 	/*
2038 	 * This field is used to indicate device's capabilities and
2039 	 * configurations.
2040 	 */
2041 	uint32_t	dev_caps_cfg;
2042 	/*
2043 	 * If set to 1, then secure firmware update behavior
2044 	 * is supported.
2045 	 * If set to 0, then secure firmware update behavior is
2046 	 * not supported.
2047 	 */
2048 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED		UINT32_C(0x1)
2049 	/*
2050 	 * If set to 1, then firmware based DCBX agent is supported.
2051 	 * If set to 0, then firmware based DCBX agent capability
2052 	 * is not supported on this device.
2053 	 */
2054 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED		UINT32_C(0x2)
2055 	/*
2056 	 * If set to 1, then HWRM short command format is supported.
2057 	 * If set to 0, then HWRM short command format is not supported.
2058 	 */
2059 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED			UINT32_C(0x4)
2060 	/*
2061 	 * If set to 1, then HWRM short command format is required.
2062 	 * If set to 0, then HWRM short command format is not required.
2063 	 */
2064 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED			UINT32_C(0x8)
2065 	/*
2066 	 * If set to 1, then the KONG host mailbox channel is supported.
2067 	 * If set to 0, then the KONG host mailbox channel is not supported.
2068 	 * By default, this flag should be 0 for older version of core
2069 	 * firmware.
2070 	 */
2071 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_KONG_MB_CHNL_SUPPORTED		UINT32_C(0x10)
2072 	/*
2073 	 * If set to 1, then the 64bit flow handle is supported in addition
2074 	 * to the legacy 16bit flow handle. If set to 0, then the 64bit flow
2075 	 * handle is not supported. By default, this flag should be 0 for
2076 	 * older version of core firmware.
2077 	 */
2078 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_HANDLE_64BIT_SUPPORTED		UINT32_C(0x20)
2079 	/*
2080 	 * If set to 1, then filter type can be provided in filter_alloc or
2081 	 * filter_cfg filter types like L2 for l2 traffic and ROCE for roce &
2082 	 * l2 traffic. If set to 0, then filter types not supported. By
2083 	 * default, this flag should be 0 for older version of core firmware.
2084 	 */
2085 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_L2_FILTER_TYPES_ROCE_OR_L2_SUPPORTED	UINT32_C(0x40)
2086 	/*
2087 	 * If set to 1, firmware is capable to support virtio vSwitch offload
2088 	 * model. If set to 0, firmware can't supported virtio vSwitch
2089 	 * offload model.
2090 	 * By default, this flag should be 0 for older version of core
2091 	 * firmware.
2092 	 */
2093 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_VIRTIO_VSWITCH_OFFLOAD_SUPPORTED	UINT32_C(0x80)
2094 	/*
2095 	 * If set to 1, firmware is capable to support trusted VF.
2096 	 * If set to 0, firmware is not capable to support trusted VF.
2097 	 * By default, this flag should be 0 for older version of core
2098 	 * firmware.
2099 	 */
2100 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_TRUSTED_VF_SUPPORTED			UINT32_C(0x100)
2101 	/*
2102 	 * If set to 1, firmware is capable to support flow aging.
2103 	 * If set to 0, firmware is not capable to support flow aging.
2104 	 * By default, this flag should be 0 for older version of core
2105 	 * firmware. (deprecated)
2106 	 */
2107 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_AGING_SUPPORTED			UINT32_C(0x200)
2108 	/*
2109 	 * If set to 1, firmware is capable to support advanced flow counters
2110 	 * like, Meter drop counters and EEM counters.
2111 	 * If set to 0, firmware is not capable to support advanced flow
2112 	 * counters. By default, this flag should be 0 for older version of
2113 	 * core firmware. (deprecated)
2114 	 */
2115 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_ADV_FLOW_COUNTERS_SUPPORTED		UINT32_C(0x400)
2116 	/*
2117 	 * If set to 1, the firmware is able to support the use of the CFA
2118 	 * Extended Exact Match(EEM) feature.
2119 	 * If set to 0, firmware is not capable to support the use of the
2120 	 * CFA EEM feature.
2121 	 * By default, this flag should be 0 for older version of core
2122 	 * firmware. (deprecated)
2123 	 */
2124 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_EEM_SUPPORTED			UINT32_C(0x800)
2125 	/*
2126 	 * If set to 1, the firmware is able to support advance CFA flow
2127 	 * management features reported in the HWRM_CFA_FLOW_MGNT_QCAPS.
2128 	 * If set to 0, then the firmware doesn't support the advance CFA
2129 	 * flow management features.
2130 	 * By default, this flag should be 0 for older version of core
2131 	 * firmware.
2132 	 */
2133 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_ADV_FLOW_MGNT_SUPPORTED		UINT32_C(0x1000)
2134 	/*
2135 	 * Deprecated and replaced with cfa_truflow_supported.
2136 	 * If set to 1, the firmware is able to support TFLIB features.
2137 	 * If set to 0, then the firmware doesn't support TFLIB features.
2138 	 * By default, this flag should be 0 for older version of core
2139 	 * firmware.
2140 	 */
2141 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TFLIB_SUPPORTED			UINT32_C(0x2000)
2142 	/*
2143 	 * If set to 1, the firmware is able to support TruFlow features.
2144 	 * If set to 0, then the firmware doesn't support TruFlow features.
2145 	 * By default, this flag should be 0 for older version of
2146 	 * core firmware.
2147 	 */
2148 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TRUFLOW_SUPPORTED			UINT32_C(0x4000)
2149 	/*
2150 	 * If set to 1, then firmware supports secure boot.
2151 	 * If set to 0, then firmware doesn't support secure boot.
2152 	 */
2153 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_BOOT_CAPABLE			UINT32_C(0x8000)
2154 	/*
2155 	 * If set to 1, then firmware is able to support the secure solution
2156 	 * feature.
2157 	 * If set to 0, then firmware does not support the secure solution
2158 	 * feature.
2159 	 */
2160 	#define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_SOC_CAPABLE			UINT32_C(0x10000)
2161 	/*
2162 	 * This field represents the major version of RoCE firmware.
2163 	 * A change in major version represents a major release.
2164 	 */
2165 	uint8_t	roce_fw_maj_8b;
2166 	/*
2167 	 * This field represents the minor version of RoCE firmware.
2168 	 * A change in minor version represents significant
2169 	 * functionality changes.
2170 	 */
2171 	uint8_t	roce_fw_min_8b;
2172 	/*
2173 	 * This field represents the build version of RoCE firmware.
2174 	 * A change in update version represents bug fixes.
2175 	 */
2176 	uint8_t	roce_fw_bld_8b;
2177 	/*
2178 	 * This field is a reserved field. This field can be used to
2179 	 * represent firmware branches or customer specific releases
2180 	 * tied to a specific (major,minor,update) version
2181 	 */
2182 	uint8_t	roce_fw_rsvd_8b;
2183 	/*
2184 	 * This field represents the name of HWRM FW (ASCII chars
2185 	 * with NULL at the end).
2186 	 */
2187 	char	hwrm_fw_name[16];
2188 	/*
2189 	 * This field represents the name of mgmt FW (ASCII chars
2190 	 * with NULL at the end).
2191 	 */
2192 	char	mgmt_fw_name[16];
2193 	/*
2194 	 * This field represents the name of network control
2195 	 * firmware (ASCII chars with NULL at the end).
2196 	 */
2197 	char	netctrl_fw_name[16];
2198 	/* This field represents the active board package name. */
2199 	char	active_pkg_name[16];
2200 	/*
2201 	 * This field represents the name of RoCE FW (ASCII chars
2202 	 * with NULL at the end).
2203 	 */
2204 	char	roce_fw_name[16];
2205 	/* This field returns the chip number. */
2206 	uint16_t	chip_num;
2207 	/* This field returns the revision of chip. */
2208 	uint8_t	chip_rev;
2209 	/* This field returns the chip metal number. */
2210 	uint8_t	chip_metal;
2211 	/* This field returns the bond id of the chip. */
2212 	uint8_t	chip_bond_id;
2213 	/*
2214 	 * This value indicates the type of platform used for chip
2215 	 * implementation.
2216 	 */
2217 	uint8_t	chip_platform_type;
2218 	/* ASIC */
2219 	#define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC	UINT32_C(0x0)
2220 	/* FPGA platform of the chip. */
2221 	#define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA	UINT32_C(0x1)
2222 	/* Palladium platform of the chip. */
2223 	#define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2)
2224 	#define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_LAST	HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM
2225 	/*
2226 	 * This field returns the maximum value of request window that
2227 	 * is supported by the HWRM. The request window is mapped
2228 	 * into device address space using MMIO.
2229 	 */
2230 	uint16_t	max_req_win_len;
2231 	/*
2232 	 * This field returns the maximum value of response buffer in
2233 	 * bytes.
2234 	 */
2235 	uint16_t	max_resp_len;
2236 	/*
2237 	 * This field returns the default request timeout value in
2238 	 * milliseconds.
2239 	 */
2240 	uint16_t	def_req_timeout;
2241 	/*
2242 	 * This field will indicate if any subsystems is not fully
2243 	 * initialized.
2244 	 */
2245 	uint8_t	flags;
2246 	/*
2247 	 * If set to 1, it will indicate to host drivers that firmware is
2248 	 * not ready to start full blown HWRM commands. Host drivers should
2249 	 * re-try HWRM_VER_GET with some timeout period. The timeout period
2250 	 * can be selected up to 5 seconds. Host drivers should also check
2251 	 * for dev_not_rdy_backing_store to identify if flag is set due to
2252 	 * backing store not been available.
2253 	 * For Example, PCIe hot-plug:
2254 	 *	Hot plug timing is system dependent. It generally takes up to
2255 	 *	600 milliseconds for firmware to clear DEV_NOT_RDY flag.
2256 	 * If set to 0, device is ready to accept all HWRM commands.
2257 	 */
2258 	#define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY		UINT32_C(0x1)
2259 	/*
2260 	 * If set to 1, external version present.
2261 	 * If set to 0, external version not present.
2262 	 */
2263 	#define HWRM_VER_GET_OUTPUT_FLAGS_EXT_VER_AVAIL		UINT32_C(0x2)
2264 	/*
2265 	 * Firmware sets this flag along with dev_not_rdy flag to indicate
2266 	 * host drivers that it has not completed resource initialization
2267 	 * required for data path operations. Host drivers should not send
2268 	 * any HWRM command that requires data path resources. Firmware will
2269 	 * fail those commands with HWRM_ERR_CODE_BUSY. Host drivers can
2270 	 * retry those commands once both the flags are cleared.
2271 	 * If this flag and dev_not_rdy flag are set to 0, device is ready
2272 	 * to accept all HWRM commands.
2273 	 */
2274 	#define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY_BACKING_STORE	UINT32_C(0x4)
2275 	uint8_t	unused_0[2];
2276 	/*
2277 	 * For backward compatibility this field must be set to 1.
2278 	 * Older drivers might look for this field to be 1 before
2279 	 * processing the message.
2280 	 */
2281 	uint8_t	always_1;
2282 	/*
2283 	 * This field represents the major version of HWRM interface
2284 	 * specification supported by the HWRM implementation.
2285 	 * The interface major version is intended to change only when
2286 	 * non backward compatible changes are made to the HWRM
2287 	 * interface specification. A HWRM implementation that is
2288 	 * compliant with this specification shall provide value of 1
2289 	 * in this field.
2290 	 */
2291 	uint16_t	hwrm_intf_major;
2292 	/*
2293 	 * This field represents the minor version of HWRM interface
2294 	 * specification supported by the HWRM implementation.
2295 	 * A change in interface minor version is used to reflect
2296 	 * significant backward compatible modification to HWRM
2297 	 * interface specification. This can be due to addition or
2298 	 * removal of functionality. HWRM interface specifications
2299 	 * with the same major version but different minor versions are
2300 	 * compatible. A HWRM implementation that is compliant with
2301 	 * this specification shall provide value of 2 in this field.
2302 	 */
2303 	uint16_t	hwrm_intf_minor;
2304 	/*
2305 	 * This field represents the update version of HWRM interface
2306 	 * specification supported by the HWRM implementation. The
2307 	 * interface update version is used to reflect minor changes or
2308 	 * bug fixes to a released HWRM interface specification.
2309 	 * A HWRM implementation that is compliant with this
2310 	 * specification shall provide value of 2 in this field.
2311 	 */
2312 	uint16_t	hwrm_intf_build;
2313 	/*
2314 	 * This field represents the patch version of HWRM interface
2315 	 * specification supported by the HWRM implementation.
2316 	 */
2317 	uint16_t	hwrm_intf_patch;
2318 	/*
2319 	 * This field represents the major version of HWRM firmware.
2320 	 * A change in firmware major version represents a major
2321 	 * firmware release.
2322 	 */
2323 	uint16_t	hwrm_fw_major;
2324 	/*
2325 	 * This field represents the minor version of HWRM firmware.
2326 	 * A change in firmware minor version represents significant
2327 	 * firmware functionality changes.
2328 	 */
2329 	uint16_t	hwrm_fw_minor;
2330 	/*
2331 	 * This field represents the build version of HWRM firmware.
2332 	 * A change in firmware build version represents bug fixes to
2333 	 * a released firmware.
2334 	 */
2335 	uint16_t	hwrm_fw_build;
2336 	/*
2337 	 * This field is a reserved field.
2338 	 * This field can be used to represent firmware branches or customer
2339 	 * specific releases tied to a specific (major,minor,update) version
2340 	 * of the HWRM firmware.
2341 	 */
2342 	uint16_t	hwrm_fw_patch;
2343 	/*
2344 	 * This field represents the major version of mgmt firmware.
2345 	 * A change in major version represents a major release.
2346 	 */
2347 	uint16_t	mgmt_fw_major;
2348 	/*
2349 	 * This field represents the minor version of HWRM firmware.
2350 	 * A change in firmware minor version represents significant
2351 	 * firmware functionality changes.
2352 	 */
2353 	uint16_t	mgmt_fw_minor;
2354 	/*
2355 	 * This field represents the build version of mgmt firmware.
2356 	 * A change in update version represents bug fixes.
2357 	 */
2358 	uint16_t	mgmt_fw_build;
2359 	/*
2360 	 * This field is a reserved field. This field can be used to
2361 	 * represent firmware branches or customer specific releases
2362 	 * tied to a specific (major,minor,update) version.
2363 	 */
2364 	uint16_t	mgmt_fw_patch;
2365 	/*
2366 	 * This field represents the major version of network control
2367 	 * firmware. A change in major version represents
2368 	 * a major release.
2369 	 */
2370 	uint16_t	netctrl_fw_major;
2371 	/*
2372 	 * This field represents the minor version of network control
2373 	 * firmware. A change in minor version represents significant
2374 	 * functionality changes.
2375 	 */
2376 	uint16_t	netctrl_fw_minor;
2377 	/*
2378 	 * This field represents the build version of network control
2379 	 * firmware. A change in update version represents bug fixes.
2380 	 */
2381 	uint16_t	netctrl_fw_build;
2382 	/*
2383 	 * This field is a reserved field. This field can be used to
2384 	 * represent firmware branches or customer specific releases
2385 	 * tied to a specific (major,minor,update) version
2386 	 */
2387 	uint16_t	netctrl_fw_patch;
2388 	/*
2389 	 * This field represents the major version of RoCE firmware.
2390 	 * A change in major version represents a major release.
2391 	 */
2392 	uint16_t	roce_fw_major;
2393 	/*
2394 	 * This field represents the minor version of RoCE firmware.
2395 	 * A change in minor version represents significant
2396 	 * functionality changes.
2397 	 */
2398 	uint16_t	roce_fw_minor;
2399 	/*
2400 	 * This field represents the build version of RoCE firmware.
2401 	 * A change in update version represents bug fixes.
2402 	 */
2403 	uint16_t	roce_fw_build;
2404 	/*
2405 	 * This field is a reserved field. This field can be used to
2406 	 * represent firmware branches or customer specific releases
2407 	 * tied to a specific (major,minor,update) version
2408 	 */
2409 	uint16_t	roce_fw_patch;
2410 	/*
2411 	 * This field returns the maximum extended request length acceptable
2412 	 * by the device which allows requests greater than mailbox size when
2413 	 * used with the short cmd request format.
2414 	 */
2415 	uint16_t	max_ext_req_len;
2416 	/*
2417 	 * This field returns the maximum request timeout value in seconds.
2418 	 * For backward compatibility, a value of zero should be interpreted
2419 	 * as the default value of 40 seconds. Drivers should always honor the
2420 	 * maximum timeout, but are permitted to warn if a longer duration than
2421 	 * this default is advertised. Values larger than 40 seconds should
2422 	 * only be used as a stopgap measure to address a device limitation or
2423 	 * for the purposes of test and debugging. The long term goal is for
2424 	 * firmware to significantly reduce this value in the passage of time.
2425 	 */
2426 	uint16_t	max_req_timeout;
2427 	uint8_t	unused_1[3];
2428 	/*
2429 	 * This field is used in Output records to indicate that the output
2430 	 * is completely written to RAM. This field should be read as '1'
2431 	 * to indicate that the output has been completely written. When
2432 	 * writing a command completion or response to an internal processor,
2433 	 * the order of writes has to be such that this field is written last.
2434 	 */
2435 	uint8_t	valid;
2436 } hwrm_ver_get_output_t, *phwrm_ver_get_output_t;
2437 
2438 /* cfa_bds_read_cmd_data_msg (size:128b/16B) */
2439 
2440 typedef struct cfa_bds_read_cmd_data_msg {
2441 	/* This value selects the format for the mid-path command for the CFA. */
2442 	uint8_t	opcode;
2443 	/*
2444 	 * This is read command. From 32 to 128B can be read from a table
2445 	 * using this command.
2446 	 */
2447 	#define CFA_BDS_READ_CMD_DATA_MSG_OPCODE_READ UINT32_C(0x0)
2448 	#define CFA_BDS_READ_CMD_DATA_MSG_OPCODE_LAST CFA_BDS_READ_CMD_DATA_MSG_OPCODE_READ
2449 	/* This value selects the table type to be acted upon. */
2450 	uint8_t	table_type;
2451 	/* This value selects the table type to be acted upon. */
2452 	#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
2453 	#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_SFT   0
2454 	/* This command acts on the action table of the specified scope. */
2455 		#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
2456 	/* This command acts on the exact match table of the specified scope. */
2457 		#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_EM	UINT32_C(0x1)
2458 		#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_LAST   CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_EM
2459 	/* This value selects which table scope will be accessed. */
2460 	uint8_t	table_scope;
2461 	#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2462 	#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2463 	/*
2464 	 * This value identifies the number of 32B units will be accessed. A
2465 	 * value of zero is invalid. Maximum value is 4.
2466 	 */
2467 	uint8_t	data_size;
2468 	#define CFA_BDS_READ_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2469 	#define CFA_BDS_READ_CMD_DATA_MSG_DATA_SIZE_SFT 0
2470 	/* This is the 32B index into the selected table to access. */
2471 	uint32_t	table_index;
2472 	#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2473 	#define CFA_BDS_READ_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2474 	/*
2475 	 * This is the 64b host address where you want the data returned to. The
2476 	 * data will be written to the same function as the one that owns the SQ
2477 	 * this command is read from. The bottom two bits of this value must be
2478 	 * zero. The size of the write is controlled by the data_size field.
2479 	 */
2480 	uint64_t	host_address;
2481 } cfa_bds_read_cmd_data_msg_t, *pcfa_bds_read_cmd_data_msg_t;
2482 
2483 /* cfa_bds_write_cmd_data_msg (size:1152b/144B) */
2484 
2485 typedef struct cfa_bds_write_cmd_data_msg {
2486 	/* This value selects the format for the mid-path command for the CFA. */
2487 	uint8_t	opcode;
2488 	/*
2489 	 * This is write command. From 32 to 128B can be written to a table
2490 	 * using this command.
2491 	 */
2492 	#define CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_WRITE UINT32_C(0x1)
2493 	#define CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_LAST CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_WRITE
2494 	/* This value selects the table type to be acted upon. */
2495 	uint8_t	write_thru_table_type;
2496 	/* This value selects the table type to be acted upon. */
2497 	#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
2498 	#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_SFT   0
2499 	/* This command acts on the action table of the specified scope. */
2500 		#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
2501 	/* This command acts on the exact match table of the specified scope. */
2502 		#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_EM	UINT32_C(0x1)
2503 		#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_LAST   CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_EM
2504 	/*
2505 	 * Indicates write-through control. Indicates write-through when set,
2506 	 * or write back when cleared.
2507 	 */
2508 	#define CFA_BDS_WRITE_CMD_DATA_MSG_WRITE_THRU	UINT32_C(0x10)
2509 	/* This value selects which table scope will be accessed. */
2510 	uint8_t	table_scope;
2511 	#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2512 	#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2513 	/*
2514 	 * This value identifies the number of 32B units will be accessed. A
2515 	 * value of zero is invalid. Maximum value is 4.
2516 	 */
2517 	uint8_t	data_size;
2518 	#define CFA_BDS_WRITE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2519 	#define CFA_BDS_WRITE_CMD_DATA_MSG_DATA_SIZE_SFT 0
2520 	/* This is the 32B index into the selected table to access. */
2521 	uint32_t	table_index;
2522 	#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2523 	#define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2524 	uint32_t	unused0;
2525 	uint32_t	unused1;
2526 	/*
2527 	 * This is the data to be written. Data length is determined by the
2528 	 * data_size field. The bd_cnt in the encapsulating BD must also be set
2529 	 * correctly to ensure that the BD is processed correctly and the full
2530 	 * WRITE_CMD message is extracted from the BD.
2531 	 */
2532 	uint32_t	dta[32];
2533 } cfa_bds_write_cmd_data_msg_t, *pcfa_bds_write_cmd_data_msg_t;
2534 
2535 /* cfa_bds_read_clr_cmd_data_msg (size:256b/32B) */
2536 
2537 typedef struct cfa_bds_read_clr_cmd_data_msg {
2538 	/* This value selects the format for the mid-path command for the CFA. */
2539 	uint8_t	opcode;
2540 	/*
2541 	 * This is read-clear command. 32B can be read from a table and
2542 	 * a 16b mask can be used to clear specific 16b units after the
2543 	 * read as an atomic operation.
2544 	 */
2545 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_READ_CLR UINT32_C(0x2)
2546 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_LAST	CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_READ_CLR
2547 	/* This value selects the table type to be acted upon. */
2548 	uint8_t	table_type;
2549 	/* This value selects the table type to be acted upon. */
2550 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
2551 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_SFT   0
2552 	/* This command acts on the action table of the specified scope. */
2553 		#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
2554 	/* This command acts on the exact match table of the specified scope. */
2555 		#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_EM	UINT32_C(0x1)
2556 		#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_LAST   CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_EM
2557 	/* This value selects which table scope will be accessed. */
2558 	uint8_t	table_scope;
2559 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2560 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2561 	/*
2562 	 * This value identifies the number of 32B units will be accessed.
2563 	 * Always set the value to 1.
2564 	 */
2565 	uint8_t	data_size;
2566 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2567 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_DATA_SIZE_SFT 0
2568 	/* This is the 32B index into the selected table to access. */
2569 	uint32_t	table_index;
2570 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2571 	#define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2572 	/*
2573 	 * This is the 64b host address where you want the data returned to. The
2574 	 * data will be written to the same function as the one that owns the SQ
2575 	 * this command is read from. The bottom two bits of this value must be
2576 	 * zero. The size of the write is controlled by the data_size field.
2577 	 */
2578 	uint64_t	host_address;
2579 	/*
2580 	 * This is active high clear mask for the 32B of data that this command
2581 	 * can read. Bit 0 of the field will clear bits 15:0 of the first word
2582 	 * of data read when set to '1'.
2583 	 */
2584 	uint16_t	clear_mask;
2585 	uint16_t	unused0[3];
2586 	uint16_t	unused1[4];
2587 } cfa_bds_read_clr_cmd_data_msg_t, *pcfa_bds_read_clr_cmd_data_msg_t;
2588 
2589 /* cfa_bds_em_insert_cmd_data_msg (size:1152b/144B) */
2590 
2591 typedef struct cfa_bds_em_insert_cmd_data_msg {
2592 	/* This value selects the format for the mid-path command for the CFA. */
2593 	uint8_t	opcode;
2594 	/*
2595 	 * An exact match table insert will be attempted into the table.
2596 	 * If there is a free location in the bucket, the payload will
2597 	 * be written to the bucket.
2598 	 */
2599 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_EM_INSERT UINT32_C(0x3)
2600 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_LAST	CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_EM_INSERT
2601 	/*
2602 	 * Indicates write-through control. Indicates write-through when set,
2603 	 * or write back when cleared.
2604 	 */
2605 	uint8_t	write_thru;
2606 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_UNUSED_MASK	UINT32_C(0xf)
2607 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_UNUSED_SFT	0
2608 	/*
2609 	 * Indicates write-through control. Indicates write-through when set,
2610 	 * or write back when cleared.
2611 	 */
2612 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_WRITE_THRU	UINT32_C(0x10)
2613 	/* This value selects which table scope will be accessed. */
2614 	uint8_t	table_scope;
2615 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2616 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2617 	/*
2618 	 * This value identifies the number of 32B units will be accessed. A
2619 	 * value of zero is invalid. Maximum value is 4.
2620 	 */
2621 	uint8_t	data_size;
2622 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2623 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_DATA_SIZE_SFT 0
2624 	/* This is the 32B index into the selected table to access. */
2625 	uint32_t	table_index;
2626 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2627 	#define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2628 	/*
2629 	 * This is the 64b host address where you want the data returned to. The
2630 	 * data will be written to the same function as the one that owns the SQ
2631 	 */
2632 	uint64_t	host_address;
2633 	/*
2634 	 * This is the Exact Match Lookup Record. Data length is determined by
2635 	 * the data_size field. The bd_cnt in the encapsulating BD must also be
2636 	 */
2637 	uint32_t	dta[32];
2638 } cfa_bds_em_insert_cmd_data_msg_t, *pcfa_bds_em_insert_cmd_data_msg_t;
2639 
2640 /* cfa_bds_em_delete_cmd_data_msg (size:256b/32B) */
2641 
2642 typedef struct cfa_bds_em_delete_cmd_data_msg {
2643 	/* This value selects the format for the mid-path command for the CFA. */
2644 	uint8_t	opcode;
2645 	/* An exact match table delete will be attempted. */
2646 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_EM_DELETE UINT32_C(0x4)
2647 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_LAST	CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_EM_DELETE
2648 	/*
2649 	 * Indicates write-through control. Indicates write-through when set,
2650 	 * or write back when cleared.
2651 	 */
2652 	uint8_t	write_thru;
2653 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_UNUSED_MASK	UINT32_C(0xf)
2654 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_UNUSED_SFT	0
2655 	/*
2656 	 * Indicates write-through control. Indicates write-through when set,
2657 	 * or write back when cleared.
2658 	 */
2659 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_WRITE_THRU	UINT32_C(0x10)
2660 	/* This value selects which table scope will be accessed. */
2661 	uint8_t	table_scope;
2662 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2663 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2664 	/*
2665 	 * This value identifies the number of 32B units will be accessed. A
2666 	 * value of zero is invalid. Maximum value is 4.
2667 	 */
2668 	uint8_t	data_size;
2669 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2670 	#define CFA_BDS_EM_DELETE_CMD_DATA_MSG_DATA_SIZE_SFT 0
2671 	uint32_t	unused0;
2672 	/*
2673 	 * This is the 64b host address where you want the data returned to. The
2674 	 * data will be written to the same function as the one that owns the SQ
2675 	 */
2676 	uint64_t	host_address;
2677 	/*
2678 	 * This is the Exact Match Lookup Record. Data length is determined by
2679 	 * the data_size field. The bd_cnt in the encapsulating BD must also be
2680 	 */
2681 	uint64_t	dta;
2682 	uint64_t	unused1;
2683 } cfa_bds_em_delete_cmd_data_msg_t, *pcfa_bds_em_delete_cmd_data_msg_t;
2684 
2685 /* cfa_bds_invalidate_cmd_data_msg (size:128b/16B) */
2686 
2687 typedef struct cfa_bds_invalidate_cmd_data_msg {
2688 	/* This value selects the format for the mid-path command for the CFA. */
2689 	uint8_t	opcode;
2690 	/*
2691 	 * The specified table area will be invalidated. If it is needed.
2692 	 * again, it will be read from the backing store.
2693 	 */
2694 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_INVALIDATE UINT32_C(0x5)
2695 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_LAST	CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_INVALIDATE
2696 	/* This value selects the table type to be acted upon. */
2697 	uint8_t	table_type;
2698 	/* This value selects the table type to be acted upon. */
2699 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
2700 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_SFT   0
2701 	/* This command acts on the action table of the specified scope. */
2702 		#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
2703 	/* This command acts on the exact match table of the specified scope. */
2704 		#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_EM	UINT32_C(0x1)
2705 		#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_LAST   CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_EM
2706 	/* This value selects which table scope will be accessed. */
2707 	uint8_t	table_scope;
2708 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2709 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2710 	/* This value specifies the number of cache lines to invalidate. */
2711 	uint8_t	data_size;
2712 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2713 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_DATA_SIZE_SFT 0
2714 	/* This is the 32B index into the selected table to access. */
2715 	uint32_t	table_index;
2716 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
2717 	#define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_INDEX_SFT 0
2718 	uint64_t	unused;
2719 } cfa_bds_invalidate_cmd_data_msg_t, *pcfa_bds_invalidate_cmd_data_msg_t;
2720 
2721 /* cfa_bds_event_collect_cmd_data_msg (size:128b/16B) */
2722 
2723 typedef struct cfa_bds_event_collect_cmd_data_msg {
2724 	/* This value selects the format for the mid-path command for the CFA. */
2725 	uint8_t	opcode;
2726 	/* Reads notification messages from the Host Notification Queue. */
2727 	#define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_EVENT_COLLECT UINT32_C(0x6)
2728 	#define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_LAST	CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_EVENT_COLLECT
2729 	uint8_t	unused0;
2730 	/* This value selects which table scope will be accessed. */
2731 	uint8_t	table_scope;
2732 	#define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
2733 	#define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
2734 	/*
2735 	 * This value identifies the number of 32B units will be accessed. A
2736 	 * value of zero is invalid. Maximum value is 4.
2737 	 */
2738 	uint8_t	data_size;
2739 	#define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
2740 	#define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_DATA_SIZE_SFT 0
2741 	uint32_t	unused1;
2742 	/*
2743 	 * This is the 64b host address where you want the data returned to. The
2744 	 * data will be written to the same function as the one that owns the SQ
2745 	 */
2746 	uint64_t	host_address;
2747 } cfa_bds_event_collect_cmd_data_msg_t, *pcfa_bds_event_collect_cmd_data_msg_t;
2748 
2749 /* ce_bds_add_data_msg (size:576b/72B) */
2750 
2751 typedef struct ce_bds_add_data_msg {
2752 	uint32_t	version_algorithm_kid_opcode;
2753 	/*
2754 	 * This value selects the operation for the mid-path command for the
2755 	 * crypto blocks.
2756 	 */
2757 	#define CE_BDS_ADD_DATA_MSG_OPCODE_MASK		UINT32_C(0xf)
2758 	#define CE_BDS_ADD_DATA_MSG_OPCODE_SFT		0
2759 	/*
2760 	 * This is the add command. Using this opcode, Host Driver can add
2761 	 * information required for kTLS processing. The information is
2762 	 * updated in the CFCK context.
2763 	 */
2764 		#define CE_BDS_ADD_DATA_MSG_OPCODE_ADD		UINT32_C(0x1)
2765 		#define CE_BDS_ADD_DATA_MSG_OPCODE_LAST		CE_BDS_ADD_DATA_MSG_OPCODE_ADD
2766 	/*
2767 	 * This field is the Crypto Context ID. The KID is used to store
2768 	 * information used by the associated kTLS offloaded connection.
2769 	 */
2770 	#define CE_BDS_ADD_DATA_MSG_KID_MASK		UINT32_C(0xfffff0)
2771 	#define CE_BDS_ADD_DATA_MSG_KID_SFT		4
2772 	/*
2773 	 * Currently only two algorithms are supported, AES_GCM_128 and
2774 	 * AES_GCM_256. Additional bits for future growth.
2775 	 */
2776 	#define CE_BDS_ADD_DATA_MSG_ALGORITHM_MASK		UINT32_C(0xf000000)
2777 	#define CE_BDS_ADD_DATA_MSG_ALGORITHM_SFT		24
2778 	/* AES_GCM_128 Algorithm */
2779 	#define CE_BDS_ADD_DATA_MSG_ALGORITHM_AES_GCM_128	UINT32_C(0x1000000)
2780 	/* AES_GCM_256 Algorithm */
2781 	#define CE_BDS_ADD_DATA_MSG_ALGORITHM_AES_GCM_256	UINT32_C(0x2000000)
2782 	/*
2783 	 * Version number of TLS connection. HW will provide registers that
2784 	 * converts the 4b encoded version number to 16b of actual version
2785 	 * number in the TLS Header. This field is initialized/updated by
2786 	 * this "KTLS crypto add" mid-path command.
2787 	 */
2788 	#define CE_BDS_ADD_DATA_MSG_VERSION_MASK		UINT32_C(0xf0000000)
2789 	#define CE_BDS_ADD_DATA_MSG_VERSION_SFT		28
2790 	/* TLS1.2 Version */
2791 		#define CE_BDS_ADD_DATA_MSG__TLS1_2			(UINT32_C(0x0) << 28)
2792 	/* TLS1.3 Version */
2793 		#define CE_BDS_ADD_DATA_MSG__TLS1_3			(UINT32_C(0x1) << 28)
2794 		#define CE_BDS_ADD_DATA_MSG__LAST			CE_BDS_ADD_DATA_MSG__TLS1_3
2795 	uint8_t	ctx_kind;
2796 	/* This field selects the context kind for the request. */
2797 	#define CE_BDS_ADD_DATA_MSG_CTX_KIND_MASK UINT32_C(0x1f)
2798 	#define CE_BDS_ADD_DATA_MSG_CTX_KIND_SFT  0
2799 	/* Crypto key transmit context */
2800 		#define CE_BDS_ADD_DATA_MSG_CTX_KIND_CK_TX  UINT32_C(0x11)
2801 	/* Crypto key receive context */
2802 		#define CE_BDS_ADD_DATA_MSG_CTX_KIND_CK_RX  UINT32_C(0x12)
2803 		#define CE_BDS_ADD_DATA_MSG_CTX_KIND_LAST  CE_BDS_ADD_DATA_MSG_CTX_KIND_CK_RX
2804 	uint8_t	unused0[3];
2805 	/*
2806 	 * Salt is part of the nonce that is used as the Initial Vector (IV) in
2807 	 * AES-GCM cipher suites. These are exchanged as part of the handshake
2808 	 * process and is either the client_write_iv (when the client is
2809 	 * sending) or server_write_iv (when the server is sending). In
2810 	 * TLS1.2, 4B of Salt is concatenated with 8B of explicit_nonce to
2811 	 * generate the 12B of IV. In TLS1.3, 8B of TLS record sequence number
2812 	 * is zero padded to 12B and then xor'ed with the 4B of salt to generate
2813 	 * the 12B of IV. This value is initialized by this mid-path command.
2814 	 */
2815 	uint8_t	salt[4];
2816 	uint8_t	unused1[4];
2817 	/*
2818 	 * This field keeps track of the TCP sequence number that is expected as
2819 	 * the first byte in the next TCP packet. This field is calculated by HW
2820 	 * using the output of the parser. The field is initialized as part of
2821 	 * the Mid-path BD download/update of a kTLS connection. For every TCP
2822 	 * packet processed, TCE HW will update the value to Current packet TCP
2823 	 * sequence number + Current packet TCP Payload Length.
2824 	 */
2825 	uint32_t	pkt_tcp_seq_num;
2826 	/*
2827 	 * This field maintains the TCP sequence number of the first byte in the
2828 	 * header of the active TLS record. This field is initialized as part of
2829 	 * the Mid-path BD download/update of a kTLS connection. For every
2830 	 * record that is processed, TCE HW copies the value from the
2831 	 * next_tls_header_tcp_seq_num field.
2832 	 */
2833 	uint32_t	tls_header_tcp_seq_num;
2834 	/*
2835 	 * This is sequence number for the TLS record in a particular session.
2836 	 * In TLS1.2, record sequence number is part of the Associated Data (AD)
2837 	 * in the AEAD algorithm. In TLS1.3, record sequence number is part of
2838 	 * the Initial Vector (IV). The field is initialized as part of the
2839 	 * mid-path BD download/update of a kTLS connection. TCE HW increments
2840 	 * the field after that for every record processed as it parses the TCP
2841 	 * packet.
2842 	 */
2843 	uint64_t	record_seq_num;
2844 	/*
2845 	 * Key used for encrypting or decrypting TLS records. The Key is
2846 	 * exchanged during the hand-shake protocol by the client-server and
2847 	 * provided to HW through this mid-path BD.
2848 	 */
2849 	uint8_t	session_key[32];
2850 	/*
2851 	 * Additional IV that is exchanged as part of sessions setup between
2852 	 * the two end points. This field is used for TLS1.3 only.
2853 	 */
2854 	uint8_t	addl_iv[8];
2855 } ce_bds_add_data_msg_t, *pce_bds_add_data_msg_t;
2856 
2857 /* ce_bds_delete_data_msg (size:32b/4B) */
2858 
2859 typedef struct ce_bds_delete_data_msg {
2860 	uint32_t	kid_opcode_ctx_kind;
2861 	/*
2862 	 * This value selects the operation for the mid-path command for the
2863 	 * crypto blocks.
2864 	 */
2865 	#define CE_BDS_DELETE_DATA_MSG_OPCODE_MASK	UINT32_C(0xf)
2866 	#define CE_BDS_DELETE_DATA_MSG_OPCODE_SFT	0
2867 	/*
2868 	 * This is the delete command. Using this opcode, the host Driver
2869 	 * can remove a key context from the CFCK. If context is deleted
2870 	 * and packets with the same KID come through the pipeline, the
2871 	 * following actions are taken. For transmit packets, no crypto
2872 	 * operation will be performed, payload will be zero'ed out. For
2873 	 * receive packets, no crypto operation will be performed,
2874 	 * payload will be unmodified.
2875 	 */
2876 		#define CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE	UINT32_C(0x2)
2877 		#define CE_BDS_DELETE_DATA_MSG_OPCODE_LAST	CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE
2878 	/*
2879 	 * This field is the Crypto Context ID. The KID is used to store
2880 	 * information used by the associated kTLS offloaded connection.
2881 	 */
2882 	#define CE_BDS_DELETE_DATA_MSG_KID_MASK	UINT32_C(0xfffff0)
2883 	#define CE_BDS_DELETE_DATA_MSG_KID_SFT	4
2884 	/* This field selects the context kind for the request. */
2885 	#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_MASK   UINT32_C(0x1f000000)
2886 	#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_SFT	24
2887 	/* Crypto Key Transmit Context. */
2888 		#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_CK_TX	(UINT32_C(0x11) << 24)
2889 	/* Crypto Key Receive Context. */
2890 		#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_CK_RX	(UINT32_C(0x12) << 24)
2891 	/* QUIC Key Transmit Context. */
2892 		#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_QUIC_TX  (UINT32_C(0x14) << 24)
2893 	/* QUIC Key Receive Context. */
2894 		#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_QUIC_RX  (UINT32_C(0x15) << 24)
2895 		#define CE_BDS_DELETE_DATA_MSG_CTX_KIND_LAST	CE_BDS_DELETE_DATA_MSG_CTX_KIND_QUIC_RX
2896 } ce_bds_delete_data_msg_t, *pce_bds_delete_data_msg_t;
2897 
2898 /* ce_bds_resync_resp_ack_msg (size:128b/16B) */
2899 
2900 typedef struct ce_bds_resync_resp_ack_msg {
2901 	uint32_t	resync_status_kid_opcode;
2902 	/*
2903 	 * This value selects the operation for the mid-path command for the
2904 	 * crypto blocks.
2905 	 */
2906 	#define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_MASK	UINT32_C(0xf)
2907 	#define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_SFT	0
2908 	/*
2909 	 * This command is used by the driver as a response to the resync
2910 	 * request sent by the crypto engine.
2911 	 */
2912 		#define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_RESYNC	UINT32_C(0x3)
2913 		#define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_LAST	CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_RESYNC
2914 	/*
2915 	 * This field is the Crypto Context ID. The KID is used to store
2916 	 * information used by the associated kTLS offloaded connection.
2917 	 */
2918 	#define CE_BDS_RESYNC_RESP_ACK_MSG_KID_MASK	UINT32_C(0xfffff0)
2919 	#define CE_BDS_RESYNC_RESP_ACK_MSG_KID_SFT	4
2920 	/*
2921 	 * This field indicates if the resync request resulted in a success or
2922 	 * a failure.
2923 	 */
2924 	#define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS	UINT32_C(0x1000000)
2925 	/*
2926 	 * An ACK indicates that the driver was able to find the TLS record
2927 	 * associated with TCP sequence number provided by the HW
2928 	 */
2929 		#define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_ACK   (UINT32_C(0x0) << 24)
2930 		#define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_LAST CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_ACK
2931 	/*
2932 	 * This field is the echo of the TCP sequence number provided in the
2933 	 * resync request by the HW. If HW sent multiple resync requests, it
2934 	 * only tracks the latest TCP sequence number. When the response from
2935 	 * the Driver doesn't match the latest request, HW will drop the resync
2936 	 * response.
2937 	 */
2938 	uint32_t	resync_record_tcp_seq_num;
2939 	/*
2940 	 * This field indicates the TLS record sequence number associated with
2941 	 * the resync request. HW will take this number and add the delta records
2942 	 * it has found since sending the resync request, update the context and
2943 	 * resume decrypting records.
2944 	 */
2945 	uint64_t	resync_record_seq_num;
2946 } ce_bds_resync_resp_ack_msg_t, *pce_bds_resync_resp_ack_msg_t;
2947 
2948 /* ce_bds_resync_resp_nack_msg (size:64b/8B) */
2949 
2950 typedef struct ce_bds_resync_resp_nack_msg {
2951 	uint32_t	resync_status_kid_opcode;
2952 	/*
2953 	 * This value selects the operation for the mid-path command for the
2954 	 * crypto blocks.
2955 	 */
2956 	#define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_MASK	UINT32_C(0xf)
2957 	#define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_SFT	0
2958 	/*
2959 	 * This command is used by the driver as a response to the resync
2960 	 * request sent by the crypto engine.
2961 	 */
2962 		#define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_RESYNC	UINT32_C(0x3)
2963 		#define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_LAST	CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_RESYNC
2964 	/*
2965 	 * This field is the Crypto Context ID. The KID is used to store
2966 	 * information used by the associated kTLS offloaded connection.
2967 	 */
2968 	#define CE_BDS_RESYNC_RESP_NACK_MSG_KID_MASK	UINT32_C(0xfffff0)
2969 	#define CE_BDS_RESYNC_RESP_NACK_MSG_KID_SFT	4
2970 	/*
2971 	 * This field indicates if the resync request resulted in a success or
2972 	 * a failure.
2973 	 */
2974 	#define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS	UINT32_C(0x1000000)
2975 	/*
2976 	 * An NAK indicates that the driver wasn't able to find the TLS
2977 	 * record associated with TCP sequence number provided by the HW
2978 	 */
2979 		#define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_NACK  (UINT32_C(0x1) << 24)
2980 		#define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_LAST CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_NACK
2981 	/*
2982 	 * This field is the echo of the TCP sequence number provided in the
2983 	 * resync request by the HW. If HW sent multiple resync requests, it
2984 	 * only tracks the latest TCP sequence number. When the response from
2985 	 * the Driver doesn't match the latest request, HW will drop the resync
2986 	 * response.
2987 	 */
2988 	uint32_t	resync_record_tcp_seq_num;
2989 } ce_bds_resync_resp_nack_msg_t, *pce_bds_resync_resp_nack_msg_t;
2990 
2991 /* crypto_presync_bd_cmd (size:256b/32B) */
2992 
2993 typedef struct crypto_presync_bd_cmd {
2994 	uint8_t	flags;
2995 	/*
2996 	 * Typically, presync BDs are used for packet retransmissions. Source
2997 	 * port sends all the packets in order over the network to destination
2998 	 * port and packets get dropped in the network. The destination port
2999 	 * will request retransmission of dropped packets and source port
3000 	 * driver will send presync BD to setup the transmitter appropriately.
3001 	 * It will provide the start and end TCP sequence number of the data to
3002 	 * be transmitted. HW keeps two sets of context variable, one for in
3003 	 * order traffic and one for retransmission traffic. HW is designed to
3004 	 * transmit everything posted in the presync BD and return to in order
3005 	 * mode after that. No inorder context variables are updated in the
3006 	 * process. There is a special case where packets can be dropped
3007 	 * between the TCP stack and Device Driver (Berkeley Packet Filter for
3008 	 * ex) and HW still needs to transmit rest of the traffic. In this
3009 	 * mode, driver will send a presync BD as if it is a retransmission but
3010 	 * at the end of the transmission, the in order variables need to be
3011 	 * updated. This flag is used by driver to indicate that in order
3012 	 * variables needs to be updated at the end of completing the task
3013 	 * associated with the presync BD.
3014 	 */
3015 	#define CRYPTO_PRESYNC_BD_CMD_FLAGS_UPDATE_IN_ORDER_VAR	UINT32_C(0x1)
3016 	/*
3017 	 * When packet with an authentication TAG is lost in the network,
3018 	 * During retransmission Device driver will post the entire record for
3019 	 * the hardware to recalculate the TAG. Hardware is set to retransmit
3020 	 * only portions of the record, it does so by looking at the Header
3021 	 * TCP Sequence Number and Start TCP Sequence Number. However, there
3022 	 * is a case where the header packet gets dropped in the stack for ex
3023 	 * BPF packet filter and it is impossible for the Hardware to
3024 	 * determine if this is a case of full replay for only the TAG
3025 	 * generation.
3026 	 */
3027 	#define CRYPTO_PRESYNC_BD_CMD_FLAGS_FULL_REPLAY_RETRAN	UINT32_C(0x2)
3028 	uint8_t	unused0;
3029 	uint16_t	unused1;
3030 	/*
3031 	 * This field maintains the TCP sequence number of the first byte in the
3032 	 * Header of the active TLS record. This field is set to 0 during
3033 	 * mid-path BD updates, but is set to correct value when a presync BD is
3034 	 * detected. For every record that is processed, the value from the
3035 	 * next_tls_header_tcp_seq_num field is copied.
3036 	 */
3037 	uint32_t	header_tcp_seq_num;
3038 	/*
3039 	 * When a retransmitted packet has a TLS authentication TAG present and
3040 	 * the data spans multiple TCP Packets, HW is required to read the entire
3041 	 * record to recalculate the TAG but only transmit what is required. This
3042 	 * field is the start TCP sequence number of the packet(s) that need to
3043 	 * be re-transmitted. This field is initialized to 0 during Mid-path BD
3044 	 * add command and initialized to value provided by the driver when
3045 	 * Pre-sync BD is detected. This field is never updated unless another
3046 	 * Pre-sync BD signaling a new retransmission is scheduled.
3047 	 */
3048 	uint32_t	start_tcp_seq_num;
3049 	/*
3050 	 * When a retransmitted packet has a TLS authentication TAG present and
3051 	 * the data spans multiple TCP Packets, HW is required to read the
3052 	 * entire record to recalculate the TAG but only transmit what is
3053 	 * required. This field is the end TCP sequence number of the packet(s)
3054 	 * that need to be re-transmitted. This field is initialized to 0 during
3055 	 * Mid-path BD add command and initialized to value provided by the
3056 	 * driver when Pre-sync BD is detected. This field is never updated
3057 	 * unless another Pre-sync BD signaling a new retransmission is
3058 	 * scheduled.
3059 	 */
3060 	uint32_t	end_tcp_seq_num;
3061 	/*
3062 	 * For TLS1.2, an explicit nonce is used as part of the IV (concatenated
3063 	 * with the SALT). For retrans packets, this field is extracted from the
3064 	 * TLS record, field right after the TLS Header and stored in the
3065 	 * context. This field needs to be stored in context as TCP segmentation
3066 	 * could have split the field into multiple TCP packets. This value is
3067 	 * initialized to 0 when presync BD is detected by taking the value from
3068 	 * the first TLS header. When subsequent TLS Headers are detected, the
3069 	 * value is extracted from packet.
3070 	 */
3071 	uint8_t	explicit_nonce[8];
3072 	/*
3073 	 * This is sequence number for the TLS record in a particular session. In
3074 	 * TLS1.2, record sequence number is part of the Associated Data (AD) in
3075 	 * the AEAD algorithm. In TLS1.3, record sequence number is part of the
3076 	 * Initial Vector (IV). The field is initialized to 0 during Mid-path BD
3077 	 * download. Is initialized to correct value when a pre-sync BD is
3078 	 * detected. TCE HW increments the field after that for every record
3079 	 * processed as it parses the TCP packet. Subsequent pre-sync BDs
3080 	 * delivering more retransmission instruction will also update this
3081 	 * field.
3082 	 */
3083 	uint64_t	record_seq_num;
3084 } crypto_presync_bd_cmd_t, *pcrypto_presync_bd_cmd_t;
3085 
3086 /* ce_bds_quic_add_data_msg (size:832b/104B) */
3087 
3088 typedef struct ce_bds_quic_add_data_msg {
3089 	uint32_t	ver_algo_kid_opcode;
3090 	/*
3091 	 * This value selects the operation for the mid-path command for the
3092 	 * crypto blocks.
3093 	 */
3094 	#define CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_MASK	UINT32_C(0xf)
3095 	#define CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_SFT	0
3096 	/*
3097 	 * This is the add command. Using this opcode, Host Driver can add
3098 	 * information required for QUIC processing. The information is
3099 	 * updated in the CFCK context.
3100 	 */
3101 		#define CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_ADD		UINT32_C(0x1)
3102 		#define CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_LAST	CE_BDS_QUIC_ADD_DATA_MSG_OPCODE_ADD
3103 	/*
3104 	 * This field is the Crypto Context ID. The KID is used to store
3105 	 * information used by the associated QUIC offloaded connection.
3106 	 */
3107 	#define CE_BDS_QUIC_ADD_DATA_MSG_KID_MASK		UINT32_C(0xfffff0)
3108 	#define CE_BDS_QUIC_ADD_DATA_MSG_KID_SFT		4
3109 	/* Algorithm used for encryption and decryption. */
3110 	#define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_MASK	UINT32_C(0xf000000)
3111 	#define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_SFT	24
3112 	/* AES_GCM_128 Algorithm. */
3113 		#define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_AES_GCM_128  (UINT32_C(0x1) << 24)
3114 	/* AES_GCM_256 Algorithm. */
3115 		#define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_AES_GCM_256  (UINT32_C(0x2) << 24)
3116 	/* Chacha20 Algorithm. */
3117 		#define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_CHACHA20	(UINT32_C(0x3) << 24)
3118 		#define CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_LAST	CE_BDS_QUIC_ADD_DATA_MSG_ALGORITHM_CHACHA20
3119 	/* Version number of QUIC connection. */
3120 	#define CE_BDS_QUIC_ADD_DATA_MSG_VERSION_MASK	UINT32_C(0xf0000000)
3121 	#define CE_BDS_QUIC_ADD_DATA_MSG_VERSION_SFT	28
3122 	/* TLS1.2 Version */
3123 		#define CE_BDS_QUIC_ADD_DATA_MSG__TLS1_2		(UINT32_C(0x0) << 28)
3124 	/* TLS1.3 Version */
3125 		#define CE_BDS_QUIC_ADD_DATA_MSG__TLS1_3		(UINT32_C(0x1) << 28)
3126 	/* DTLS1.2 Version */
3127 		#define CE_BDS_QUIC_ADD_DATA_MSG__DTLS1_2		(UINT32_C(0x2) << 28)
3128 	/* DTLS1.2 for RoCE Version */
3129 		#define CE_BDS_QUIC_ADD_DATA_MSG__DTLS1_2_ROCE	(UINT32_C(0x3) << 28)
3130 	/* QUIC Version */
3131 		#define CE_BDS_QUIC_ADD_DATA_MSG__QUIC		(UINT32_C(0x4) << 28)
3132 		#define CE_BDS_QUIC_ADD_DATA_MSG__LAST		CE_BDS_QUIC_ADD_DATA_MSG__QUIC
3133 	uint32_t	ctx_kind_dcid_width_key_phase;
3134 	/* Key phase. */
3135 	#define CE_BDS_QUIC_ADD_DATA_MSG_KEY_PHASE	UINT32_C(0x1)
3136 	/* Destination connection ID width. */
3137 	#define CE_BDS_QUIC_ADD_DATA_MSG_DCID_WIDTH_MASK UINT32_C(0x3e)
3138 	#define CE_BDS_QUIC_ADD_DATA_MSG_DCID_WIDTH_SFT  1
3139 	/* This field selects the context kind for the request. */
3140 	#define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_MASK   UINT32_C(0x7c0)
3141 	#define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_SFT	6
3142 	/* QUIC key transmit context */
3143 		#define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_QUIC_TX  (UINT32_C(0x14) << 6)
3144 	/* QUIC key receive context */
3145 		#define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_QUIC_RX  (UINT32_C(0x15) << 6)
3146 		#define CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_LAST	CE_BDS_QUIC_ADD_DATA_MSG_CTX_KIND_QUIC_RX
3147 	uint64_t	unused_0;
3148 	/*
3149 	 * Least-significant 64 bits (of 96) of additional IV that is
3150 	 * exchanged as part of sessions setup between the two end
3151 	 * points for QUIC operations.
3152 	 */
3153 	uint8_t	quic_iv_lo[8];
3154 	/*
3155 	 * Most-significant 32 bits (of 96) of additional IV that is
3156 	 * exchanged as part of sessions setup between the two end
3157 	 * points for QUIC operations.
3158 	 */
3159 	uint8_t	quic_iv_hi[4];
3160 	uint32_t	unused_1;
3161 	/*
3162 	 * Key used for encrypting or decrypting records. The Key is exchanged
3163 	 * as part of sessions setup between the two end points through this
3164 	 * mid-path BD.
3165 	 */
3166 	uint8_t	session_key[32];
3167 	/* Header protection key. */
3168 	uint8_t	hp_key[32];
3169 	/* Packet number associated with the QUIC connection. */
3170 	uint64_t	pkt_number;
3171 } ce_bds_quic_add_data_msg_t, *pce_bds_quic_add_data_msg_t;
3172 
3173 /* bd_base (size:64b/8B) */
3174 
3175 typedef struct bd_base {
3176 	uint8_t	type;
3177 	/* This value identifies the type of buffer descriptor. */
3178 	#define BD_BASE_TYPE_MASK		UINT32_C(0x3f)
3179 	#define BD_BASE_TYPE_SFT		0
3180 	/*
3181 	 * Indicates that this BD is 16B long and is used for
3182 	 * normal L2 packet transmission.
3183 	 */
3184 		#define BD_BASE_TYPE_TX_BD_SHORT	UINT32_C(0x0)
3185 	/*
3186 	 * Indicates that this BD is 1BB long and is an empty
3187 	 * TX BD. Not valid for use by the driver.
3188 	 */
3189 		#define BD_BASE_TYPE_TX_BD_EMPTY	UINT32_C(0x1)
3190 	/*
3191 	 * Indicates that this BD is 16B long and is an RX Producer
3192 	 * (i.e. empty) buffer descriptor.
3193 	 */
3194 		#define BD_BASE_TYPE_RX_PROD_PKT	UINT32_C(0x4)
3195 	/*
3196 	 * Indicates that this BD is 16B long and is an RX
3197 	 * Producer Buffer BD.
3198 	 */
3199 		#define BD_BASE_TYPE_RX_PROD_BFR	UINT32_C(0x5)
3200 	/*
3201 	 * Indicates that this BD is 16B long and is an
3202 	 * RX Producer Assembly Buffer Descriptor.
3203 	 */
3204 		#define BD_BASE_TYPE_RX_PROD_AGG	UINT32_C(0x6)
3205 	/*
3206 	 * Indicates that this BD is used to issue a command to one of
3207 	 * the mid-path destinations.
3208 	 */
3209 		#define BD_BASE_TYPE_TX_BD_MP_CMD	UINT32_C(0x8)
3210 	/*
3211 	 * Indicates that this BD is used to issue a cryptographic pre-
3212 	 * sync command through the fast path and destined for TCE.
3213 	 */
3214 		#define BD_BASE_TYPE_TX_BD_PRESYNC_CMD  UINT32_C(0x9)
3215 	/*
3216 	 * Indicates a timed transmit BD. This is a 16b BD that is inserted
3217 	 * into a packet BD chain immediately after the first BD. It is used
3218 	 * to control the flow in a timed transmit operation.
3219 	 */
3220 		#define BD_BASE_TYPE_TX_BD_TIMEDTX	UINT32_C(0xa)
3221 	/*
3222 	 * Indicates that this BD is 32B long and is used for
3223 	 * normal L2 packet transmission.
3224 	 */
3225 		#define BD_BASE_TYPE_TX_BD_LONG	UINT32_C(0x10)
3226 	/*
3227 	 * Indicates that this BD is 32B long and is used for
3228 	 * L2 packet transmission for small packets that require
3229 	 * low latency.
3230 	 */
3231 		#define BD_BASE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
3232 		#define BD_BASE_TYPE_LAST		BD_BASE_TYPE_TX_BD_LONG_INLINE
3233 	uint8_t	unused_1[7];
3234 } bd_base_t, *pbd_base_t;
3235 
3236 /* tx_bd_short (size:128b/16B) */
3237 
3238 typedef struct tx_bd_short {
3239 	/*
3240 	 * All bits in this field must be valid on the first BD of a packet.
3241 	 * Only the packet_end bit must be valid for the remaining BDs
3242 	 * of a packet.
3243 	 */
3244 	uint16_t	flags_type;
3245 	/* This value identifies the type of buffer descriptor. */
3246 	#define TX_BD_SHORT_TYPE_MASK		UINT32_C(0x3f)
3247 	#define TX_BD_SHORT_TYPE_SFT		0
3248 	/*
3249 	 * Indicates that this BD is 16B long and is used for
3250 	 * normal L2 packet transmission.
3251 	 */
3252 		#define TX_BD_SHORT_TYPE_TX_BD_SHORT	UINT32_C(0x0)
3253 		#define TX_BD_SHORT_TYPE_LAST		TX_BD_SHORT_TYPE_TX_BD_SHORT
3254 	/*
3255 	 * All bits in this field must be valid on the first BD of a packet.
3256 	 * Only the packet_end bit must be valid for the remaining BDs
3257 	 * of a packet.
3258 	 */
3259 	#define TX_BD_SHORT_FLAGS_MASK	UINT32_C(0xffc0)
3260 	#define TX_BD_SHORT_FLAGS_SFT		6
3261 	/*
3262 	 * If set to 1, the packet ends with the data in the buffer
3263 	 * pointed to by this descriptor. This flag must be
3264 	 * valid on every BD.
3265 	 */
3266 	#define TX_BD_SHORT_FLAGS_PACKET_END	UINT32_C(0x40)
3267 	/*
3268 	 * If set to 1, the device will not generate a completion for
3269 	 * this transmit packet unless there is an error in it's
3270 	 * processing.
3271 	 * If this bit
3272 	 * is set to 0, then the packet will be completed normally.
3273 	 *
3274 	 * This bit must be valid only on the first BD of a packet.
3275 	 */
3276 	#define TX_BD_SHORT_FLAGS_NO_CMPL	UINT32_C(0x80)
3277 	/*
3278 	 * This value indicates how many 16B BD locations are consumed
3279 	 * in the ring by this packet.
3280 	 * A value of 1 indicates that this BD is the only BD (and that
3281 	 * it is a short BD). A value
3282 	 * of 3 indicates either 3 short BDs or 1 long BD and one short
3283 	 * BD in the packet. A value of 0 indicates
3284 	 * that there are 32 BD locations in the packet (the maximum).
3285 	 *
3286 	 * This field is valid only on the first BD of a packet.
3287 	 */
3288 	#define TX_BD_SHORT_FLAGS_BD_CNT_MASK	UINT32_C(0x1f00)
3289 	#define TX_BD_SHORT_FLAGS_BD_CNT_SFT	8
3290 	/*
3291 	 * This value is a hint for the length of the entire packet.
3292 	 * It is used by the chip to optimize internal processing.
3293 	 *
3294 	 * The packet will be dropped if the hint is too short.
3295 	 *
3296 	 * This field is valid only on the first BD of a packet.
3297 	 */
3298 	#define TX_BD_SHORT_FLAGS_LHINT_MASK	UINT32_C(0x6000)
3299 	#define TX_BD_SHORT_FLAGS_LHINT_SFT	13
3300 	/* indicates packet length < 512B */
3301 		#define TX_BD_SHORT_FLAGS_LHINT_LT512	(UINT32_C(0x0) << 13)
3302 	/* indicates 512 <= packet length < 1KB */
3303 		#define TX_BD_SHORT_FLAGS_LHINT_LT1K	(UINT32_C(0x1) << 13)
3304 	/* indicates 1KB <= packet length < 2KB */
3305 		#define TX_BD_SHORT_FLAGS_LHINT_LT2K	(UINT32_C(0x2) << 13)
3306 	/* indicates packet length >= 2KB */
3307 		#define TX_BD_SHORT_FLAGS_LHINT_GTE2K	(UINT32_C(0x3) << 13)
3308 		#define TX_BD_SHORT_FLAGS_LHINT_LAST	TX_BD_SHORT_FLAGS_LHINT_GTE2K
3309 	/*
3310 	 * If set to 1, the device immediately updates the Send Consumer
3311 	 * Index after the buffer associated with this descriptor has
3312 	 * been transferred via DMA to NIC memory from host memory. An
3313 	 * interrupt may or may not be generated according to the state
3314 	 * of the interrupt avoidance mechanisms. If this bit
3315 	 * is set to 0, then the Consumer Index is only updated as soon
3316 	 * as one of the host interrupt coalescing conditions has been met.
3317 	 *
3318 	 * This bit must be valid on the first BD of a packet.
3319 	 */
3320 	#define TX_BD_SHORT_FLAGS_COAL_NOW	UINT32_C(0x8000)
3321 	/*
3322 	 * This is the length of the host physical buffer this BD describes
3323 	 * in bytes.
3324 	 *
3325 	 * This field must be valid on all BDs of a packet.
3326 	 */
3327 	uint16_t	len;
3328 	/*
3329 	 * The opaque data field is pass through to the completion and can be
3330 	 * used for any data that the driver wants to associate with the
3331 	 * transmit BD.
3332 	 *
3333 	 * This field must be valid on the first BD of a packet. If completion
3334 	 * coalescing is enabled on the TX ring, it is suggested that the driver
3335 	 * populate the opaque field to indicate the specific TX ring with which
3336 	 * the completion is associated, then utilize the opaque and sq_cons_idx
3337 	 * fields in the coalesced completion record to determine the specific
3338 	 * packets that are to be completed on that ring.
3339 	 */
3340 	uint32_t	opaque;
3341 	/*
3342 	 * This is the host physical address for the portion of the packet
3343 	 * described by this TX BD.
3344 	 *
3345 	 * This value must be valid on all BDs of a packet.
3346 	 */
3347 	uint64_t	addr;
3348 } tx_bd_short_t, *ptx_bd_short_t;
3349 
3350 /* tx_bd_long (size:128b/16B) */
3351 
3352 typedef struct tx_bd_long {
3353 	/* This value identifies the type of buffer descriptor. */
3354 	uint16_t	flags_type;
3355 	/*
3356 	 * This value indicates the type of buffer descriptor.
3357 	 * packet.
3358 	 */
3359 	#define TX_BD_LONG_TYPE_MASK		UINT32_C(0x3f)
3360 	#define TX_BD_LONG_TYPE_SFT		0
3361 	/*
3362 	 * Indicates that this BD is 32B long and is used for
3363 	 * normal L2 packet transmission.
3364 	 */
3365 		#define TX_BD_LONG_TYPE_TX_BD_LONG	UINT32_C(0x10)
3366 		#define TX_BD_LONG_TYPE_LAST		TX_BD_LONG_TYPE_TX_BD_LONG
3367 	/*
3368 	 * All bits in this field must be valid on the first BD of a packet.
3369 	 * Only the packet_end bit must be valid for the remaining BDs
3370 	 * of a packet.
3371 	 */
3372 	#define TX_BD_LONG_FLAGS_MASK	UINT32_C(0xffc0)
3373 	#define TX_BD_LONG_FLAGS_SFT		6
3374 	/*
3375 	 * If set to 1, the packet ends with the data in the buffer
3376 	 * pointed to by this descriptor. This flag must be
3377 	 * valid on every BD.
3378 	 */
3379 	#define TX_BD_LONG_FLAGS_PACKET_END	UINT32_C(0x40)
3380 	/*
3381 	 * If set to 1, the device will not generate a completion for
3382 	 * this transmit packet unless there is an error in it's
3383 	 * processing.
3384 	 * If this bit
3385 	 * is set to 0, then the packet will be completed normally.
3386 	 *
3387 	 * This bit must be valid only on the first BD of a packet.
3388 	 */
3389 	#define TX_BD_LONG_FLAGS_NO_CMPL	UINT32_C(0x80)
3390 	/*
3391 	 * This value indicates how many 16B BD locations are consumed
3392 	 * in the ring by this packet.
3393 	 * A value of 1 indicates that this BD is the only BD (and that
3394 	 * it is a short BD). A value
3395 	 * of 3 indicates either 3 short BDs or 1 long BD and one short
3396 	 * BD in the packet. A value of 0 indicates
3397 	 * that there are 32 BD locations in the packet (the maximum).
3398 	 *
3399 	 * This field is valid only on the first BD of a packet.
3400 	 */
3401 	#define TX_BD_LONG_FLAGS_BD_CNT_MASK	UINT32_C(0x1f00)
3402 	#define TX_BD_LONG_FLAGS_BD_CNT_SFT	8
3403 	/*
3404 	 * This value is a hint for the length of the entire packet.
3405 	 * It is used by the chip to optimize internal processing.
3406 	 *
3407 	 * The packet will be dropped if the hint is too short.
3408 	 *
3409 	 * This field is valid only on the first BD of a packet.
3410 	 */
3411 	#define TX_BD_LONG_FLAGS_LHINT_MASK	UINT32_C(0x6000)
3412 	#define TX_BD_LONG_FLAGS_LHINT_SFT	13
3413 	/* indicates packet length < 512B */
3414 		#define TX_BD_LONG_FLAGS_LHINT_LT512	(UINT32_C(0x0) << 13)
3415 	/* indicates 512 <= packet length < 1KB */
3416 		#define TX_BD_LONG_FLAGS_LHINT_LT1K	(UINT32_C(0x1) << 13)
3417 	/* indicates 1KB <= packet length < 2KB */
3418 		#define TX_BD_LONG_FLAGS_LHINT_LT2K	(UINT32_C(0x2) << 13)
3419 	/* indicates packet length >= 2KB */
3420 		#define TX_BD_LONG_FLAGS_LHINT_GTE2K	(UINT32_C(0x3) << 13)
3421 		#define TX_BD_LONG_FLAGS_LHINT_LAST	TX_BD_LONG_FLAGS_LHINT_GTE2K
3422 	/*
3423 	 * If set to 1, the device immediately updates the Send Consumer
3424 	 * Index after the buffer associated with this descriptor has
3425 	 * been transferred via DMA to NIC memory from host memory. An
3426 	 * interrupt may or may not be generated according to the state
3427 	 * of the interrupt avoidance mechanisms. If this bit
3428 	 * is set to 0, then the Consumer Index is only updated as soon
3429 	 * as one of the host interrupt coalescing conditions has been met.
3430 	 *
3431 	 * This bit must be valid on the first BD of a packet.
3432 	 */
3433 	#define TX_BD_LONG_FLAGS_COAL_NOW	UINT32_C(0x8000)
3434 	/*
3435 	 * This is the length of the host physical buffer this BD describes
3436 	 * in bytes.
3437 	 *
3438 	 * This field must be valid on all BDs of a packet.
3439 	 */
3440 	uint16_t	len;
3441 	/*
3442 	 * The opaque data field is passed through to the completion and can be
3443 	 * used for any data that the driver wants to associate with the
3444 	 * transmit BD.
3445 	 *
3446 	 * This field must be valid on the first BD of a packet. If completion
3447 	 * coalescing is enabled on the TX ring, it is suggested that the driver
3448 	 * populate the opaque field to indicate the specific TX ring with which
3449 	 * the completion is associated, then utilize the opaque and sq_cons_idx
3450 	 * fields in the coalesced completion record to determine the specific
3451 	 * packets that are to be completed on that ring.
3452 	 */
3453 	uint32_t	opaque;
3454 	/*
3455 	 * This is the host physical address for the portion of the packet
3456 	 * described by this TX BD.
3457 	 *
3458 	 * This value must be valid on all BDs of a packet.
3459 	 */
3460 	uint64_t	addr;
3461 } tx_bd_long_t, *ptx_bd_long_t;
3462 
3463 /* Last 16 bytes of tx_bd_long. */
3464 /* tx_bd_long_hi (size:128b/16B) */
3465 
3466 typedef struct tx_bd_long_hi {
3467 	/*
3468 	 * All bits in this field must be valid on the first BD of a packet.
3469 	 * Their value on other BDs of the packet will be ignored.
3470 	 */
3471 	uint16_t	lflags;
3472 	/*
3473 	 * If set to 1, the controller replaces the TCP/UPD checksum
3474 	 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
3475 	 * checksum field of the encapsulated TCP/UDP packets with the
3476 	 * hardware calculated TCP/UDP checksum for the packet associated
3477 	 * with this descriptor. The flag is ignored if the LSO flag is set.
3478 	 *
3479 	 * This bit must be valid on the first BD of a packet.
3480 	 */
3481 	#define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
3482 	/*
3483 	 * If set to 1, the controller replaces the IP checksum of the
3484 	 * normal packets, or the inner IP checksum of the encapsulated
3485 	 * packets with the hardware calculated IP checksum for the
3486 	 * packet associated with this descriptor.
3487 	 *
3488 	 * This bit must be valid on the first BD of a packet.
3489 	 */
3490 	#define TX_BD_LONG_LFLAGS_IP_CHKSUM	UINT32_C(0x2)
3491 	/*
3492 	 * If set to 1, the controller will not append an Ethernet CRC
3493 	 * to the end of the frame.
3494 	 *
3495 	 * This bit must be valid on the first BD of a packet.
3496 	 *
3497 	 * Packet must be 64B or longer when this flag is set. It is not
3498 	 * useful to use this bit with any form of TX offload such as
3499 	 * CSO or LSO. The intent is that the packet from the host already
3500 	 * has a valid Ethernet CRC on the packet.
3501 	 */
3502 	#define TX_BD_LONG_LFLAGS_NOCRC		UINT32_C(0x4)
3503 	/*
3504 	 * This bit, in conjunction with the stamp_1step bit, controls whether
3505 	 * a TX packet timestamp is collected and the type of timestamp that
3506 	 * is collected.
3507 	 *
3508 	 * This bit must be valid on the first BD of a packet.
3509 	 *
3510 	 * Enumerations of the concatenation { stamp, stamp_1step } are
3511 	 * as follows:
3512 	 *
3513 	 * - 2'b00: ts_none - no timestamp
3514 	 * - 2'b01: ts_ptp_1step - 1-step PTP
3515 	 * - 2'b10: ts_2cmpl - 2-step PTP timestamp or PA timestamp
3516 	 * - 2'b11: ts_rsvd - reserved, same behavior as ts_none
3517 	 * For the ts_2cmpl enumeration, an additional completion is returned.
3518 	 * This additional completion may carry a 2-step PTP timestamp or a PA
3519 	 * timestamp, depending on parsing of the transmitted packet.
3520 	 */
3521 	#define TX_BD_LONG_LFLAGS_STAMP		UINT32_C(0x8)
3522 	/*
3523 	 * If set to 1, The controller replaces the tunnel IP checksum
3524 	 * field with hardware calculated IP checksum for the IP header
3525 	 * of the packet associated with this descriptor.
3526 	 *
3527 	 * For outer UDP checksum, global outer UDP checksum TE_NIC register
3528 	 * needs to be enabled. If the global outer UDP checksum TE_NIC
3529 	 * register bit is set, outer UDP checksum will be calculated for
3530 	 * the following cases:
3531 	 * 1. Packets with tcp_udp_chksum flag set to offload checksum for
3532 	 * inner packet AND the inner packet is TCP/UDP. If the inner packet
3533 	 * is ICMP for example (non-TCP/UDP), even if the tcp_udp_chksum is
3534 	 * set, the outer UDP checksum will not be calculated.
3535 	 * 2. Packets with lso flag set which implies inner TCP checksum
3536 	 * calculation as part of LSO operation.
3537 	 */
3538 	#define TX_BD_LONG_LFLAGS_T_IP_CHKSUM	UINT32_C(0x10)
3539 	/*
3540 	 * If set to 1, the device will treat this packet with LSO(Large
3541 	 * Send Offload) processing for both normal or encapsulated
3542 	 * packets, which is a form of TCP segmentation. When this bit
3543 	 * is 1, the hdr_size and mss fields must be valid. The driver
3544 	 * doesn't need to set ot_ip_chksum, t_ip_chksum, ip_chksum, and
3545 	 * tcp_udp_chksum flags since the controller will replace the
3546 	 * appropriate checksum fields for segmented packets.
3547 	 *
3548 	 * When this bit is 1, the hdr_size and mss fields must be valid.
3549 	 */
3550 	#define TX_BD_LONG_LFLAGS_LSO		UINT32_C(0x20)
3551 	/*
3552 	 * If set to zero when LSO is '1', then the IPID will be treated
3553 	 * as a 16b number and will be wrapped if it exceeds a value of
3554 	 * 0xffff.
3555 	 *
3556 	 * If set to one when LSO is '1', then the IPID will be treated
3557 	 * as a 15b number and will be wrapped if it exceeds a value of
3558 	 * 0x7fff.
3559 	 */
3560 	#define TX_BD_LONG_LFLAGS_IPID_FMT	UINT32_C(0x40)
3561 	/*
3562 	 * If set to zero when LSO is '1', then the IPID of the tunnel
3563 	 * IP header will not be modified during LSO operations.
3564 	 *
3565 	 * If set to one when LSO is '1', then the IPID of the tunnel
3566 	 * IP header will be incremented for each subsequent segment of an
3567 	 * LSO operation.
3568 	 *
3569 	 * The flag is ignored if the LSO packet is a normal (non-tunneled)
3570 	 * TCP packet.
3571 	 */
3572 	#define TX_BD_LONG_LFLAGS_T_IPID		UINT32_C(0x80)
3573 	/*
3574 	 * If set to '1', then the RoCE ICRC will be appended to the
3575 	 * packet. Packet must be a valid RoCE format packet.
3576 	 */
3577 	#define TX_BD_LONG_LFLAGS_ROCE_CRC	UINT32_C(0x100)
3578 	/*
3579 	 * If set to '1', then the FCoE CRC will be appended to the
3580 	 * packet. Packet must be a valid FCoE format packet.
3581 	 */
3582 	#define TX_BD_LONG_LFLAGS_FCOE_CRC	UINT32_C(0x200)
3583 	/*
3584 	 * If set to '1', then the timestamp from the BD is used. If cleared
3585 	 * to 0, then TWE provides the timestamp.
3586 	 */
3587 	/*
3588 	 * The BD timestamp feature cannot be enabled concurrently with
3589 	 * cryptography (KTLS), thus lflags.bd_ts_en and lflags.crypto_en
3590 	 * shall never both be set in a BD.
3591 	 */
3592 	#define TX_BD_LONG_LFLAGS_BD_TS_EN	UINT32_C(0x400)
3593 	/*
3594 	 * If set to '1', this operation will cause a trace capture in each
3595 	 * block it passes through.
3596 	 */
3597 	#define TX_BD_LONG_LFLAGS_DEBUG_TRACE	UINT32_C(0x800)
3598 	/*
3599 	 * This bit, in conjunction with the stamp bit, controls whether a
3600 	 * TX packet timestamp is collected and the type of timestamp that
3601 	 * is collected.
3602 	 *
3603 	 * See the stamp field for a description of the valid combinations of
3604 	 * stamp and stamp_1step.
3605 	 *
3606 	 * This bit must be valid on the first BD of a packet.
3607 	 */
3608 	#define TX_BD_LONG_LFLAGS_STAMP_1STEP	UINT32_C(0x1000)
3609 	/*
3610 	 * If set to '1', the controller replaces the Outer-tunnel IP checksum
3611 	 * field with hardware calculated IP checksum for the IP header of the
3612 	 * packet associated with this descriptor. For outer UDP checksum, it
3613 	 * will be the following behavior for all cases independent of
3614 	 * settings of inner LSO and checksum offload BD flags.
3615 	 * If outer UDP checksum is 0, then do not update it.
3616 	 * If outer UDP checksum is non zero, then the hardware should
3617 	 * compute and update it.
3618 	 */
3619 	#define TX_BD_LONG_LFLAGS_OT_IP_CHKSUM	UINT32_C(0x2000)
3620 	/*
3621 	 * If set to zero when LSO is '1', then the IPID of the Outer-tunnel
3622 	 * IP header will not be modified during LSO operations. If set to one
3623 	 * when LSO is '1', then the IPID of the Outer-tunnel IP header will
3624 	 * be incremented for each subsequent segment of an LSO operation. The
3625 	 * flag is ignored if the LSO packet is a normal (non-tunneled) TCP
3626 	 * packet.
3627 	 */
3628 	#define TX_BD_LONG_LFLAGS_OT_IPID		UINT32_C(0x4000)
3629 	/*
3630 	 * If set to '1', When set to 1, KTLS encryption will be enabled for
3631 	 * the packet.
3632 	 */
3633 	/*
3634 	 * The BD timestamp feature cannot be enabled concurrently with
3635 	 * cryptography (KTLS), thus lflags.bd_ts_en and lflags.crypto_en
3636 	 * shall never both be set in a BD.
3637 	 */
3638 	#define TX_BD_LONG_LFLAGS_CRYPTO_EN	UINT32_C(0x8000)
3639 	uint16_t	kid_or_ts_low_hdr_size;
3640 	/*
3641 	 * When LSO is '1', this field must contain the offset of the
3642 	 * TCP payload from the beginning of the packet in as
3643 	 * 16b words. In case of encapsulated/tunneling packet, this field
3644 	 * contains the offset of the inner TCP payload from beginning of the
3645 	 * packet as 16-bit words.
3646 	 *
3647 	 * This value must be valid on the first BD of a packet.
3648 	 */
3649 	#define TX_BD_LONG_HDR_SIZE_MASK	UINT32_C(0x1ff)
3650 	#define TX_BD_LONG_HDR_SIZE_SFT	0
3651 	/*
3652 	 * If lflags.bd_ts_en is 1, this is the lower 7 bits of the 24-bit
3653 	 * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of
3654 	 * the 20-bit KID.
3655 	 */
3656 	/*
3657 	 * The KID value of all-ones is reserved for non-KTLS packets, which
3658 	 * only implies that this value must not be used when filling this
3659 	 * field for crypto packets.
3660 	 */
3661 	#define TX_BD_LONG_KID_OR_TS_LOW_MASK UINT32_C(0xfe00)
3662 	#define TX_BD_LONG_KID_OR_TS_LOW_SFT 9
3663 	uint32_t	kid_or_ts_high_mss;
3664 	/*
3665 	 * This is the MSS value that will be used to do the LSO processing.
3666 	 * The value is the length in bytes of the TCP payload for each
3667 	 * segment generated by the LSO operation.
3668 	 *
3669 	 * This value must be valid on the first BD of a packet.
3670 	 */
3671 	#define TX_BD_LONG_MSS_MASK	UINT32_C(0x7fff)
3672 	#define TX_BD_LONG_MSS_SFT		0
3673 	/*
3674 	 * If lflags.bd_ts_en is 1, this is the upper 17 bits of the 24-bit
3675 	 * timestamp. If lflags.crypto_en is 1, the least significant 13 bits
3676 	 * of this field contain the upper 13 bits of the 20-bit KID.
3677 	 */
3678 	/*
3679 	 * The KID value of all-ones is reserved for non-KTLS packets, which
3680 	 * only implies that this value must not be used when filling this
3681 	 * field for crypto packets.
3682 	 */
3683 	#define TX_BD_LONG_KID_OR_TS_HIGH_MASK UINT32_C(0xffff8000)
3684 	#define TX_BD_LONG_KID_OR_TS_HIGH_SFT 15
3685 	/*
3686 	 * This value selects bits 25:16 of the CFA action to perform on the
3687 	 * packet. See the cfa_action field for more information.
3688 	 */
3689 	uint16_t	cfa_action_high;
3690 	#define TX_BD_LONG_CFA_ACTION_HIGH_MASK UINT32_C(0x3ff)
3691 	#define TX_BD_LONG_CFA_ACTION_HIGH_SFT 0
3692 	/*
3693 	 * This value selects a CFA action to perform on the packet.
3694 	 * Set this value to zero if no CFA action is desired.
3695 	 *
3696 	 * This value must be valid on the first BD of a packet.
3697 	 */
3698 	uint16_t	cfa_action;
3699 	/*
3700 	 * This value is action meta-data that defines CFA edit operations
3701 	 * that are done in addition to any action editing.
3702 	 */
3703 	uint32_t	cfa_meta;
3704 	/* When key=1, This is the VLAN tag VID value. */
3705 	#define TX_BD_LONG_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
3706 	#define TX_BD_LONG_CFA_META_VLAN_VID_SFT	0
3707 	/* When key=1, This is the VLAN tag DE value. */
3708 	#define TX_BD_LONG_CFA_META_VLAN_DE		UINT32_C(0x1000)
3709 	/* When key=1, This is the VLAN tag PRI value. */
3710 	#define TX_BD_LONG_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
3711 	#define TX_BD_LONG_CFA_META_VLAN_PRI_SFT	13
3712 	/* When key=1, This is the VLAN tag TPID select value. */
3713 	#define TX_BD_LONG_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
3714 	#define TX_BD_LONG_CFA_META_VLAN_TPID_SFT	16
3715 	/* 0x88a8 */
3716 		#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8	(UINT32_C(0x0) << 16)
3717 	/* 0x8100 */
3718 		#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100	(UINT32_C(0x1) << 16)
3719 	/* 0x9100 */
3720 		#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100	(UINT32_C(0x2) << 16)
3721 	/* 0x9200 */
3722 		#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200	(UINT32_C(0x3) << 16)
3723 	/* 0x9300 */
3724 		#define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300	(UINT32_C(0x4) << 16)
3725 	/* Value programmed in CFA VLANTPID register. */
3726 		#define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG	(UINT32_C(0x5) << 16)
3727 		#define TX_BD_LONG_CFA_META_VLAN_TPID_LAST	TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
3728 	/* When key=1, This is the VLAN tag TPID select value. */
3729 	#define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK   UINT32_C(0xff80000)
3730 	#define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT	19
3731 	/*
3732 	 * This field identifies the type of edit to be performed
3733 	 * on the packet.
3734 	 *
3735 	 * This value must be valid on the first BD of a packet.
3736 	 */
3737 	#define TX_BD_LONG_CFA_META_KEY_MASK		UINT32_C(0xf0000000)
3738 	#define TX_BD_LONG_CFA_META_KEY_SFT		28
3739 	/* No editing */
3740 		#define TX_BD_LONG_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
3741 	/*
3742 	 * - meta[17:16] - TPID select value (0 = 0x8100).
3743 	 * - meta[15:12] - PRI/DE value.
3744 	 * - meta[11:0] - VID value.
3745 	 */
3746 		#define TX_BD_LONG_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
3747 	/*
3748 	 * Provide metadata
3749 	 * - Wh+/SR - this option is not supported.
3750 	 * - Thor - cfa_meta[15:0] is used for metadata output if en_bd_meta
3751 	 *   is set in the Lookup Table.
3752 	 * - SR2 - {4'd0, cfa_meta[27:0]} is used for metadata output if
3753 	 *   en_bd_meta is set in the Lookup Table.
3754 	 */
3755 		#define TX_BD_LONG_CFA_META_KEY_METADATA_TRANSFER  (UINT32_C(0x2) << 28)
3756 		#define TX_BD_LONG_CFA_META_KEY_LAST		TX_BD_LONG_CFA_META_KEY_METADATA_TRANSFER
3757 } tx_bd_long_hi_t, *ptx_bd_long_hi_t;
3758 
3759 /*
3760  * This structure is used to inform the NIC of packet data that needs to
3761  * be transmitted with additional processing that requires extra data
3762  * such as VLAN insertion plus attached inline data.
3763  * This BD type may be used to improve latency for small packets needing
3764  * the additional extended features supported by long BDs.
3765  */
3766 /* tx_bd_long_inline (size:256b/32B) */
3767 
3768 typedef struct tx_bd_long_inline {
3769 	uint16_t	flags_type;
3770 	/* This value identifies the type of buffer descriptor. */
3771 	#define TX_BD_LONG_INLINE_TYPE_MASK		UINT32_C(0x3f)
3772 	#define TX_BD_LONG_INLINE_TYPE_SFT		0
3773 	/*
3774 	 * This type of BD is 32B long and is used for inline L2 packet
3775 	 * transmission.
3776 	 */
3777 		#define TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
3778 		#define TX_BD_LONG_INLINE_TYPE_LAST		TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE
3779 	/*
3780 	 * All bits in this field may be set on the first BD of a packet.
3781 	 * Only the packet_end bit may be set in non-first BDs.
3782 	 */
3783 	#define TX_BD_LONG_INLINE_FLAGS_MASK		UINT32_C(0xffc0)
3784 	#define TX_BD_LONG_INLINE_FLAGS_SFT		6
3785 	/*
3786 	 * If set to 1, the packet ends with the data in the buffer
3787 	 * pointed to by this descriptor. This flag must be
3788 	 * valid on every BD.
3789 	 */
3790 	#define TX_BD_LONG_INLINE_FLAGS_PACKET_END	UINT32_C(0x40)
3791 	/*
3792 	 * If set to 1, the device will not generate a completion for
3793 	 * this transmit packet unless there is an error in its processing.
3794 	 * If this bit is set to 0, then the packet will be completed
3795 	 * normally.
3796 	 *
3797 	 * This bit may be set only on the first BD of a packet.
3798 	 */
3799 	#define TX_BD_LONG_INLINE_FLAGS_NO_CMPL	UINT32_C(0x80)
3800 	/*
3801 	 * This value indicates how many 16B BD locations are consumed
3802 	 * in the ring by this packet, including the BD and inline
3803 	 * data.
3804 	 */
3805 	#define TX_BD_LONG_INLINE_FLAGS_BD_CNT_MASK	UINT32_C(0x1f00)
3806 	#define TX_BD_LONG_INLINE_FLAGS_BD_CNT_SFT	8
3807 	/* This field is deprecated. */
3808 	#define TX_BD_LONG_INLINE_FLAGS_LHINT_MASK	UINT32_C(0x6000)
3809 	#define TX_BD_LONG_INLINE_FLAGS_LHINT_SFT	13
3810 	/*
3811 	 * If set to 1, the device immediately updates the Send Consumer
3812 	 * Index after the buffer associated with this descriptor has
3813 	 * been transferred via DMA to NIC memory from host memory. An
3814 	 * interrupt may or may not be generated according to the state
3815 	 * of the interrupt avoidance mechanisms. If this bit
3816 	 * is set to 0, then the Consumer Index is only updated as soon
3817 	 * as one of the host interrupt coalescing conditions has been met.
3818 	 *
3819 	 * This bit must be valid on the first BD of a packet.
3820 	 */
3821 	#define TX_BD_LONG_INLINE_FLAGS_COAL_NOW	UINT32_C(0x8000)
3822 	/*
3823 	 * This is the length of the inline data, not including BD length, in
3824 	 * bytes.
3825 	 * The maximum value is 480.
3826 	 *
3827 	 * This field must be valid on all BDs of a packet.
3828 	 */
3829 	/*
3830 	 * A fatal error will be generated if the value of this field
3831 	 * does not correspond with the value of flags.bd_cnt. For example, if
3832 	 * this field carries a value of 20, then bd_cnt must equal 4.
3833 	 */
3834 	uint16_t	len;
3835 	/*
3836 	 * The opaque data field is passed through to the completion and can be
3837 	 * used for any data that the driver wants to associate with the
3838 	 * transmit BD. This field must be valid on the first BD of a packet.
3839 	 * If completion coalescing is enabled on the TX ring, it is suggested
3840 	 * that the driver populate the opaque field to indicate the specific
3841 	 * TX ring with which the completion is associated, then utilize the
3842 	 * opaque and sq_cons_idx fields in the coalesced completion record to
3843 	 * determine the specific packets that are to be completed on that ring.
3844 	 *
3845 	 * This field must be valid on the first BD of a packet.
3846 	 */
3847 	uint32_t	opaque;
3848 	uint64_t	unused1;
3849 	/*
3850 	 * All bits in this field must be valid on the first BD of a packet.
3851 	 * Their value on other BDs of the packet is ignored.
3852 	 */
3853 	uint16_t	lflags;
3854 	/*
3855 	 * If set to 1, the controller replaces the TCP/UPD checksum
3856 	 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
3857 	 * checksum field of the encapsulated TCP/UDP packets with the
3858 	 * hardware calculated TCP/UDP checksum for the packet associated
3859 	 * with this descriptor. The flag is ignored if the LSO flag is set.
3860 	 */
3861 	#define TX_BD_LONG_INLINE_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
3862 	/*
3863 	 * If set to 1, the controller replaces the IP checksum of the
3864 	 * normal packets, or the inner IP checksum of the encapsulated
3865 	 * packets with the hardware calculated IP checksum for the
3866 	 * packet associated with this descriptor.
3867 	 */
3868 	#define TX_BD_LONG_INLINE_LFLAGS_IP_CHKSUM	UINT32_C(0x2)
3869 	/*
3870 	 * If set to 1, the controller will not append an Ethernet CRC
3871 	 * to the end of the frame.
3872 	 *
3873 	 * Packet must be 64B or longer when this flag is set. It is not
3874 	 * useful to use this bit with any form of TX offload such as
3875 	 * CSO or LSO. The intent is that the packet from the host already
3876 	 * has a valid Ethernet CRC on the packet.
3877 	 */
3878 	#define TX_BD_LONG_INLINE_LFLAGS_NOCRC		UINT32_C(0x4)
3879 	/*
3880 	 * If set to 1, the device will record the time at which the packet
3881 	 * was actually transmitted at the TX MAC for 2-step time sync. This
3882 	 * bit must be valid on the first BD of a packet.
3883 	 */
3884 	#define TX_BD_LONG_INLINE_LFLAGS_STAMP		UINT32_C(0x8)
3885 	/*
3886 	 * If set to 1, the controller replaces the tunnel IP checksum
3887 	 * field with hardware calculated IP checksum for the IP header
3888 	 * of the packet associated with this descriptor. The hardware
3889 	 * updates an outer UDP checksum if it is non-zero.
3890 	 */
3891 	#define TX_BD_LONG_INLINE_LFLAGS_T_IP_CHKSUM	UINT32_C(0x10)
3892 	/*
3893 	 * This bit must be 0 for BDs of this type. LSO is not supported with
3894 	 * inline BDs.
3895 	 */
3896 	#define TX_BD_LONG_INLINE_LFLAGS_LSO		UINT32_C(0x20)
3897 	/* Since LSO is not supported with inline BDs, this bit is not used. */
3898 	#define TX_BD_LONG_INLINE_LFLAGS_IPID_FMT	UINT32_C(0x40)
3899 	/* Since LSO is not supported with inline BDs, this bit is not used. */
3900 	#define TX_BD_LONG_INLINE_LFLAGS_T_IPID		UINT32_C(0x80)
3901 	/*
3902 	 * If set to '1', then the RoCE ICRC will be appended to the
3903 	 * packet. Packet must be a valid RoCE format packet.
3904 	 */
3905 	#define TX_BD_LONG_INLINE_LFLAGS_ROCE_CRC	UINT32_C(0x100)
3906 	/*
3907 	 * If set to '1', then the FCoE CRC will be appended to the
3908 	 * packet. Packet must be a valid FCoE format packet.
3909 	 */
3910 	#define TX_BD_LONG_INLINE_LFLAGS_FCOE_CRC	UINT32_C(0x200)
3911 	/*
3912 	 * If set to '1', then the timestamp from the BD is used. If cleared
3913 	 * to 0, then TWE provides the timestamp.
3914 	 */
3915 	/*
3916 	 * The BD timestamp feature cannot be enabled concurrently with
3917 	 * cryptography (KTLS), thus lflags.bd_ts_en and lflags.crypto_en
3918 	 * shall never both be set in a BD.
3919 	 */
3920 	#define TX_BD_LONG_INLINE_LFLAGS_BD_TS_EN	UINT32_C(0x400)
3921 	/*
3922 	 * If set to '1', this operation will cause a trace capture in each
3923 	 * block it passes through.
3924 	 */
3925 	#define TX_BD_LONG_INLINE_LFLAGS_DEBUG_TRACE	UINT32_C(0x800)
3926 	/*
3927 	 * If set to '1', the device will record the time at which the packet
3928 	 * was actually transmitted at the TX MAC for 1-step time sync. This
3929 	 * bit must be valid on the first BD of a packet.
3930 	 */
3931 	#define TX_BD_LONG_INLINE_LFLAGS_STAMP_1STEP	UINT32_C(0x1000)
3932 	/*
3933 	 * If set to '1', the controller replaces the Outer-tunnel IP checksum
3934 	 * field with hardware calculated IP checksum for the IP header of the
3935 	 * packet associated with this descriptor. For outer UDP checksum, it
3936 	 * will be the following behavior for all cases independent of settings
3937 	 * of inner LSO and checksum offload BD flags. If outer UDP checksum
3938 	 * is 0, then do not update it. If outer UDP checksum is non zero, then
3939 	 * the hardware should compute and update it.
3940 	 */
3941 	#define TX_BD_LONG_INLINE_LFLAGS_OT_IP_CHKSUM	UINT32_C(0x2000)
3942 	/*
3943 	 * If set to zero when LSO is '1', then the IPID of the Outer-tunnel IP
3944 	 * header will not be modified during LSO operations. If set to one
3945 	 * when LSO is '1', then the IPID of the Outer-tunnel IP header will be
3946 	 * incremented for each subsequent segment of an LSO operation. The
3947 	 * flag is ignored if the LSO packet is a normal (non-tunneled) TCP
3948 	 * packet.
3949 	 */
3950 	#define TX_BD_LONG_INLINE_LFLAGS_OT_IPID		UINT32_C(0x4000)
3951 	/*
3952 	 * If set to '1', When set to 1, KTLS encryption will be enabled for
3953 	 * the packet.
3954 	 */
3955 	/*
3956 	 * The BD timestamp feature cannot be enabled concurrently with
3957 	 * cryptography (KTLS), thus lflags.bd_ts_en and lflags.crypto_en
3958 	 * shall never both be set in a BD.
3959 	 */
3960 	#define TX_BD_LONG_INLINE_LFLAGS_CRYPTO_EN	UINT32_C(0x8000)
3961 	uint8_t	unused2;
3962 	uint8_t	kid_or_ts_low;
3963 	#define TX_BD_LONG_INLINE_UNUSED		UINT32_C(0x1)
3964 	/*
3965 	 * If lflags.bd_ts_en is 1, this is the lower 7 bits of the 24-bit
3966 	 * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of
3967 	 * the 20-bit KID.
3968 	 */
3969 	/*
3970 	 * The KID value of all-ones is reserved for non-KTLS packets, which
3971 	 * only implies that this value must not be used when filling this
3972 	 * field for crypto packets.
3973 	 */
3974 	#define TX_BD_LONG_INLINE_KID_OR_TS_LOW_MASK UINT32_C(0xfe)
3975 	#define TX_BD_LONG_INLINE_KID_OR_TS_LOW_SFT 1
3976 	uint32_t	kid_or_ts_high;
3977 	#define TX_BD_LONG_INLINE_UNUSED_MASK	UINT32_C(0x7fff)
3978 	#define TX_BD_LONG_INLINE_UNUSED_SFT	0
3979 	/*
3980 	 * If lflags.bd_ts_en is 1, this is the upper 17 bits of the 24-bit
3981 	 * timestamp. If lflags.crypto_en is 1, the least significant 13 bits
3982 	 * of this field contain the upper 13 bits of the 20-bit KID.
3983 	 */
3984 	/*
3985 	 * The KID value of all-ones is reserved for non-KTLS packets, which
3986 	 * only implies that this value must not be used when filling this
3987 	 * field for crypto packets.
3988 	 */
3989 	#define TX_BD_LONG_INLINE_KID_OR_TS_HIGH_MASK UINT32_C(0xffff8000)
3990 	#define TX_BD_LONG_INLINE_KID_OR_TS_HIGH_SFT 15
3991 	/*
3992 	 * This value selects bits 25:16 of the CFA action to perform on the
3993 	 * packet. See the cfa_action field for more information.
3994 	 */
3995 	uint16_t	cfa_action_high;
3996 	#define TX_BD_LONG_INLINE_CFA_ACTION_HIGH_MASK UINT32_C(0x3ff)
3997 	#define TX_BD_LONG_INLINE_CFA_ACTION_HIGH_SFT 0
3998 	/*
3999 	 * This value selects a CFA action to perform on the packet.
4000 	 * Set this value to zero if no CFA action is desired.
4001 	 *
4002 	 * This value must be valid on the first BD of a packet.
4003 	 */
4004 	uint16_t	cfa_action;
4005 	/*
4006 	 * This value is action meta-data that defines CFA edit operations
4007 	 * that are done in addition to any action editing.
4008 	 */
4009 	uint32_t	cfa_meta;
4010 	/* When key = 1, this is the VLAN tag VID value. */
4011 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
4012 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_SFT	0
4013 	/* When key = 1, this is the VLAN tag DE value. */
4014 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_DE		UINT32_C(0x1000)
4015 	/* When key = 1, this is the VLAN tag PRI value. */
4016 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
4017 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_SFT	13
4018 	/* When key = 1, this is the VLAN tag TPID select value. */
4019 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
4020 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_SFT	16
4021 	/* 0x88a8 */
4022 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID88A8	(UINT32_C(0x0) << 16)
4023 	/* 0x8100 */
4024 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID8100	(UINT32_C(0x1) << 16)
4025 	/* 0x9100 */
4026 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9100	(UINT32_C(0x2) << 16)
4027 	/* 0x9200 */
4028 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9200	(UINT32_C(0x3) << 16)
4029 	/* 0x9300 */
4030 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9300	(UINT32_C(0x4) << 16)
4031 	/* Value programmed in CFA VLANTPID register. */
4032 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG	(UINT32_C(0x5) << 16)
4033 		#define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_LAST	TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG
4034 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_MASK   UINT32_C(0xff80000)
4035 	#define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_SFT	19
4036 	/*
4037 	 * This field identifies the type of edit to be performed
4038 	 * on the packet.
4039 	 *
4040 	 * This value must be valid on the first BD of a packet.
4041 	 */
4042 	#define TX_BD_LONG_INLINE_CFA_META_KEY_MASK		UINT32_C(0xf0000000)
4043 	#define TX_BD_LONG_INLINE_CFA_META_KEY_SFT		28
4044 	/* No editing */
4045 		#define TX_BD_LONG_INLINE_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
4046 	/*
4047 	 * - meta[17:16] - TPID select value (0 = 0x8100).
4048 	 * - meta[15:12] - PRI/DE value.
4049 	 * - meta[11:0] - VID value.
4050 	 */
4051 		#define TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
4052 	/*
4053 	 * Provide metadata
4054 	 * - Wh+/SR - this option is not supported.
4055 	 * - Thor - cfa_meta[15:0] is used for metadata output if en_bd_meta
4056 	 *   is set in the Lookup Table.
4057 	 * - SR2 - {4'd0, cfa_meta[27:0]} is used for metadata output if
4058 	 *   en_bd_meta is set in the Lookup Table.
4059 	 */
4060 		#define TX_BD_LONG_INLINE_CFA_META_KEY_METADATA_TRANSFER  (UINT32_C(0x2) << 28)
4061 		#define TX_BD_LONG_INLINE_CFA_META_KEY_LAST		TX_BD_LONG_INLINE_CFA_META_KEY_METADATA_TRANSFER
4062 } tx_bd_long_inline_t, *ptx_bd_long_inline_t;
4063 
4064 /* tx_bd_empty (size:128b/16B) */
4065 
4066 typedef struct tx_bd_empty {
4067 	/* This value identifies the type of buffer descriptor. */
4068 	uint8_t	type;
4069 	#define TX_BD_EMPTY_TYPE_MASK	UINT32_C(0x3f)
4070 	#define TX_BD_EMPTY_TYPE_SFT	0
4071 	/*
4072 	 * Indicates that this BD is 1BB long and is an empty
4073 	 * TX BD. Not valid for use by the driver.
4074 	 */
4075 		#define TX_BD_EMPTY_TYPE_TX_BD_EMPTY  UINT32_C(0x1)
4076 		#define TX_BD_EMPTY_TYPE_LAST	TX_BD_EMPTY_TYPE_TX_BD_EMPTY
4077 	uint8_t	unused_1[3];
4078 	uint8_t	unused_2;
4079 	uint8_t	unused_3[3];
4080 	uint8_t	unused_4[8];
4081 } tx_bd_empty_t, *ptx_bd_empty_t;
4082 
4083 /* tx_bd_mp_cmd (size:128b/16B) */
4084 
4085 typedef struct tx_bd_mp_cmd {
4086 	/* Unless otherwise stated, sub-fields of this field are always valid. */
4087 	uint16_t	flags_type;
4088 	/* This value identifies the type of buffer descriptor. */
4089 	#define TX_BD_MP_CMD_TYPE_MASK	UINT32_C(0x3f)
4090 	#define TX_BD_MP_CMD_TYPE_SFT	0
4091 	/*
4092 	 * Indicates that this BD is used to issue a command to one of
4093 	 * the mid-path destinations.
4094 	 */
4095 		#define TX_BD_MP_CMD_TYPE_TX_BD_MP_CMD  UINT32_C(0x8)
4096 		#define TX_BD_MP_CMD_TYPE_LAST	TX_BD_MP_CMD_TYPE_TX_BD_MP_CMD
4097 	#define TX_BD_MP_CMD_FLAGS_MASK	UINT32_C(0xffc0)
4098 	#define TX_BD_MP_CMD_FLAGS_SFT	6
4099 	/*  */
4100 	#define TX_BD_MP_CMD_FLAGS_UNUSED_MASK UINT32_C(0xc0)
4101 	#define TX_BD_MP_CMD_FLAGS_UNUSED_SFT  6
4102 	/*
4103 	 * This value indicates the number of 16B BD locations (slots)
4104 	 * consumed in the ring by this mid-path command BD, including the
4105 	 * BD header and the command field.
4106 	 */
4107 	#define TX_BD_MP_CMD_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
4108 	#define TX_BD_MP_CMD_FLAGS_BD_CNT_SFT  8
4109 	/*
4110 	 * This value defines the length of command field in bytes. The maximum
4111 	 * value shall be 496.
4112 	 */
4113 	/*
4114 	 * Note that a fatal error will be generated if the value of this field
4115 	 * does not correspond with the value of flags.bd_cnt. For example, if
4116 	 * this field carries a value of 20, then bd_cnt must equal 3.
4117 	 */
4118 	uint16_t	len;
4119 	/*
4120 	 * The opaque data field is pass through to the completion and can be
4121 	 * used for any data that the driver wants to associate with this
4122 	 * Tx mid-path command.
4123 	 */
4124 	uint32_t	opaque;
4125 	uint64_t	unused1;
4126 } tx_bd_mp_cmd_t, *ptx_bd_mp_cmd_t;
4127 
4128 /* tx_bd_presync_cmd (size:128b/16B) */
4129 
4130 typedef struct tx_bd_presync_cmd {
4131 	/* Unless otherwise stated, sub-fields of this field are always valid. */
4132 	uint16_t	flags_type;
4133 	/* This value identifies the type of buffer descriptor. */
4134 	#define TX_BD_PRESYNC_CMD_TYPE_MASK		UINT32_C(0x3f)
4135 	#define TX_BD_PRESYNC_CMD_TYPE_SFT		0
4136 	/*
4137 	 * Indicates that this BD is used to issue a cryptographic pre-
4138 	 * sync command through the fast path and destined for TCE.
4139 	 */
4140 		#define TX_BD_PRESYNC_CMD_TYPE_TX_BD_PRESYNC_CMD  UINT32_C(0x9)
4141 		#define TX_BD_PRESYNC_CMD_TYPE_LAST		TX_BD_PRESYNC_CMD_TYPE_TX_BD_PRESYNC_CMD
4142 	#define TX_BD_PRESYNC_CMD_FLAGS_MASK		UINT32_C(0xffc0)
4143 	#define TX_BD_PRESYNC_CMD_FLAGS_SFT		6
4144 	/*  */
4145 	#define TX_BD_PRESYNC_CMD_FLAGS_UNUSED_MASK	UINT32_C(0xc0)
4146 	#define TX_BD_PRESYNC_CMD_FLAGS_UNUSED_SFT	6
4147 	/*
4148 	 * This value indicates the number of 16B BD locations (slots)
4149 	 * consumed in the ring by this pre-sync command BD, including the
4150 	 * BD header and the command field.
4151 	 */
4152 	#define TX_BD_PRESYNC_CMD_FLAGS_BD_CNT_MASK	UINT32_C(0x1f00)
4153 	#define TX_BD_PRESYNC_CMD_FLAGS_BD_CNT_SFT	8
4154 	/*
4155 	 * This value defines the length of command field in bytes. The maximum
4156 	 * value shall be 496.
4157 	 */
4158 	/*
4159 	 * Note that a fatal error will be generated if the value of this field
4160 	 * does not correspond with the value of flags.bd_cnt. For example, if
4161 	 * this field carries a value of 20, then bd_cnt must equal 3.
4162 	 */
4163 	uint16_t	len;
4164 	/*
4165 	 * The opaque data field is pass through to TCE and can be used for
4166 	 * debug.
4167 	 */
4168 	uint32_t	opaque;
4169 	/*
4170 	 * This field is the Crypto Context ID to which the retransmit packet is
4171 	 * applied. The KID references the context fields used by the
4172 	 * associated kTLS offloaded connection.
4173 	 */
4174 	uint32_t	kid;
4175 	/*
4176 	 * The KID value of all-ones is reserved for non-KTLS packets, which
4177 	 * only implies that this value must not be used when filling this
4178 	 * field for crypto packets.
4179 	 */
4180 	#define TX_BD_PRESYNC_CMD_KID_VAL_MASK UINT32_C(0xfffff)
4181 	#define TX_BD_PRESYNC_CMD_KID_VAL_SFT 0
4182 	uint32_t	unused_1;
4183 } tx_bd_presync_cmd_t, *ptx_bd_presync_cmd_t;
4184 
4185 /*
4186  * This structure is used to send additional information for transmitting
4187  * packets using timed transmit scheduling. It must only to be applied as
4188  * the second BD of a BD chain that represents a packet. Any subsequent
4189  * BDs will follow the timed transmit BD.
4190  */
4191 /* tx_bd_timedtx (size:128b/16B) */
4192 
4193 typedef struct tx_bd_timedtx {
4194 	uint16_t	flags_type;
4195 	/* This value identifies the type of buffer descriptor. */
4196 	#define TX_BD_TIMEDTX_TYPE_MASK	UINT32_C(0x3f)
4197 	#define TX_BD_TIMEDTX_TYPE_SFT		0
4198 	/*
4199 	 * Indicates a timed transmit BD. This is a 16b BD that is inserted
4200 	 * into a packet BD chain immediately after the first BD. It is used
4201 	 * to control the flow in a timed transmit operation.
4202 	 */
4203 		#define TX_BD_TIMEDTX_TYPE_TX_BD_TIMEDTX	UINT32_C(0xa)
4204 		#define TX_BD_TIMEDTX_TYPE_LAST		TX_BD_TIMEDTX_TYPE_TX_BD_TIMEDTX
4205 	/* Unless otherwise stated, sub-fields of this field are always valid. */
4206 	#define TX_BD_TIMEDTX_FLAGS_MASK	UINT32_C(0xffc0)
4207 	#define TX_BD_TIMEDTX_FLAGS_SFT	6
4208 	/*
4209 	 * This value identifies the kind of buffer timed transmit mode that
4210 	 * is to be enabled for the packet.
4211 	 */
4212 	#define TX_BD_TIMEDTX_FLAGS_KIND_MASK	UINT32_C(0x1c0)
4213 	#define TX_BD_TIMEDTX_FLAGS_KIND_SFT	6
4214 	/*
4215 	 * This timed transmit mode indicates that the packet will be
4216 	 * scheduled and send immediately (or as soon as possible), once
4217 	 * it is scheduled in the transmitter.
4218 	 * Note: This mode is similar to regular (non-timed transmit)
4219 	 * operation. Its main purpose is to cancel pace mode timed
4220 	 * transmit.
4221 	 */
4222 		#define TX_BD_TIMEDTX_FLAGS_KIND_ASAP	(UINT32_C(0x0) << 6)
4223 	/*
4224 	 * This timed transmit mode is used to schedule transmission of
4225 	 * the packet no earlier than the time given in the tx_time
4226 	 * field of the BD.
4227 	 * Note: In case subsequent packets don't include a timed transmit
4228 	 * BD, they will be scheduled subsequently for transmission
4229 	 * without any timed transmit constraint.
4230 	 */
4231 		#define TX_BD_TIMEDTX_FLAGS_KIND_SO_TXTIME   (UINT32_C(0x1) << 6)
4232 	/*
4233 	 * This timed transmit mode is used to enable rate control for the
4234 	 * flow (QP) at a rate as defined by the rate field of this BD.
4235 	 * Note: In case subsequent, adjacent packets on the same flow
4236 	 * don't include a timed transmit BD, they will continue to be
4237 	 * paced by the transmitter at the same rate as given in this BD.
4238 	 */
4239 		#define TX_BD_TIMEDTX_FLAGS_KIND_PACE	(UINT32_C(0x2) << 6)
4240 		#define TX_BD_TIMEDTX_FLAGS_KIND_LAST	TX_BD_TIMEDTX_FLAGS_KIND_PACE
4241 	/*
4242 	 * This field exists in all Tx BDs. It doesn't apply to this particular
4243 	 * BD type since the BD never represents an SGL or inline data; i.e. it
4244 	 * is only a command. This field must be zero.
4245 	 */
4246 	/*
4247 	 * Note that if this field is not zero, a fatal length error will be
4248 	 * generated as it will be included in the aggregate of SGE lengths for
4249 	 * the packet.
4250 	 */
4251 	uint16_t	len;
4252 	/*
4253 	 * This field represents the rate of the flow (QP) in terms of KB/s.
4254 	 * This applies to pace mode timed transmit.
4255 	 */
4256 	uint32_t	rate;
4257 	/*
4258 	 * Applying this rate to a QP will result in this and all subsequent
4259 	 * packets of the flow being paced at the given rate, until such time
4260 	 * that the timed transmit mode is either changed or the rate is
4261 	 * updated in a future packet on the flow.
4262 	 * This field is applicable only if flags.kind is pace.
4263 	 */
4264 	#define TX_BD_TIMEDTX_RATE_VAL_MASK UINT32_C(0x1ffffff)
4265 	#define TX_BD_TIMEDTX_RATE_VAL_SFT 0
4266 	/*
4267 	 * This field represents the nano-second time to transmit the
4268 	 * corresponding packet using SO_TXTIME mode of timed transmit.
4269 	 * This field is applicable only if flags.kind is so_txtime.
4270 	 */
4271 	uint64_t	tx_time;
4272 } tx_bd_timedtx_t, *ptx_bd_timedtx_t;
4273 
4274 /* rx_prod_pkt_bd (size:128b/16B) */
4275 
4276 typedef struct rx_prod_pkt_bd {
4277 	/* This value identifies the type of buffer descriptor. */
4278 	uint16_t	flags_type;
4279 	/* This value identifies the type of buffer descriptor. */
4280 	#define RX_PROD_PKT_BD_TYPE_MASK	UINT32_C(0x3f)
4281 	#define RX_PROD_PKT_BD_TYPE_SFT	0
4282 	/*
4283 	 * Indicates that this BD is 16B long and is an RX Producer
4284 	 * (i.e. empty) buffer descriptor.
4285 	 */
4286 		#define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT	UINT32_C(0x4)
4287 		#define RX_PROD_PKT_BD_TYPE_LAST	RX_PROD_PKT_BD_TYPE_RX_PROD_PKT
4288 	#define RX_PROD_PKT_BD_FLAGS_MASK	UINT32_C(0xffc0)
4289 	#define RX_PROD_PKT_BD_FLAGS_SFT	6
4290 	/*
4291 	 * If set to 1, the packet will be placed at the address plus
4292 	 * 2B. The 2 Bytes of padding will be written as zero.
4293 	 */
4294 	/*
4295 	 * This is intended to be used when the host buffer is
4296 	 * cache-line aligned to produce packets that are easy to
4297 	 * parse in host memory while still allowing writes to be cache
4298 	 * line aligned.
4299 	 */
4300 	#define RX_PROD_PKT_BD_FLAGS_SOP_PAD	UINT32_C(0x40)
4301 	/*
4302 	 * If set to 1, the packet write will be padded out to the
4303 	 * nearest cache-line with zero value padding.
4304 	 */
4305 	/*
4306 	 * If receive buffers start/end on cache-line boundaries, this
4307 	 * feature will ensure that all data writes on the PCI bus
4308 	 * start/end on cache line boundaries.
4309 	 */
4310 	#define RX_PROD_PKT_BD_FLAGS_EOP_PAD	UINT32_C(0x80)
4311 	/*
4312 	 * This field has been deprecated. There can be no additional
4313 	 * BDs for this packet from this ring.
4314 	 *
4315 	 * Old definition:
4316 	 * This value is the number of additional buffers in the ring that
4317 	 * describe the buffer space to be consumed for this packet.
4318 	 * If the value is zero, then the packet must fit within the
4319 	 * space described by this BD. If this value is 1 or more, it
4320 	 * indicates how many additional "buffer" BDs are in the ring
4321 	 * immediately following this BD to be used for the same
4322 	 * network packet. Even if the packet to be placed does not need
4323 	 * all the additional buffers, they will be consumed anyway.
4324 	 */
4325 	#define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
4326 	#define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT  8
4327 	/*
4328 	 * This is the length in Bytes of the host physical buffer where
4329 	 * data for the packet may be placed in host memory.
4330 	 */
4331 	/*
4332 	 * While this is a Byte resolution value, it is often advantageous
4333 	 * to ensure that the buffers provided end on a host cache line.
4334 	 */
4335 	uint16_t	len;
4336 	/*
4337 	 * The opaque data field is pass through to the completion and can be
4338 	 * used for any data that the driver wants to associate with this
4339 	 * receive buffer set.
4340 	 */
4341 	uint32_t	opaque;
4342 	/*
4343 	 * This is the host physical address where data for the packet may
4344 	 * be placed in host memory.
4345 	 */
4346 	/*
4347 	 * While this is a Byte resolution value, it is often advantageous
4348 	 * to ensure that the buffers provide start on a host cache line.
4349 	 */
4350 	uint64_t	addr;
4351 } rx_prod_pkt_bd_t, *prx_prod_pkt_bd_t;
4352 
4353 /* rx_prod_bfr_bd (size:128b/16B) */
4354 
4355 typedef struct rx_prod_bfr_bd {
4356 	/* This value identifies the type of buffer descriptor. */
4357 	uint16_t	flags_type;
4358 	/* This value identifies the type of buffer descriptor. */
4359 	#define RX_PROD_BFR_BD_TYPE_MASK	UINT32_C(0x3f)
4360 	#define RX_PROD_BFR_BD_TYPE_SFT	0
4361 	/*
4362 	 * Indicates that this BD is 16B long and is an RX
4363 	 * Producer Buffer BD.
4364 	 */
4365 		#define RX_PROD_BFR_BD_TYPE_RX_PROD_BFR  UINT32_C(0x5)
4366 		#define RX_PROD_BFR_BD_TYPE_LAST	RX_PROD_BFR_BD_TYPE_RX_PROD_BFR
4367 	#define RX_PROD_BFR_BD_FLAGS_MASK	UINT32_C(0xffc0)
4368 	#define RX_PROD_BFR_BD_FLAGS_SFT	6
4369 	/*
4370 	 * This is the length in Bytes of the host physical buffer where
4371 	 * data for the packet may be placed in host memory.
4372 	 */
4373 	/*
4374 	 * While this is a Byte resolution value, it is often advantageous
4375 	 * to ensure that the buffers provided end on a host cache line.
4376 	 */
4377 	uint16_t	len;
4378 	/* This field is not used. */
4379 	uint32_t	opaque;
4380 	/*
4381 	 * This is the host physical address where data for the packet may
4382 	 * be placed in host memory.
4383 	 */
4384 	/*
4385 	 * While this is a Byte resolution value, it is often advantageous
4386 	 * to ensure that the buffers provide start on a host cache line.
4387 	 */
4388 	uint64_t	addr;
4389 } rx_prod_bfr_bd_t, *prx_prod_bfr_bd_t;
4390 
4391 /* rx_prod_agg_bd (size:128b/16B) */
4392 
4393 typedef struct rx_prod_agg_bd {
4394 	/* This value identifies the type of buffer descriptor. */
4395 	uint16_t	flags_type;
4396 	/* This value identifies the type of buffer descriptor. */
4397 	#define RX_PROD_AGG_BD_TYPE_MASK	UINT32_C(0x3f)
4398 	#define RX_PROD_AGG_BD_TYPE_SFT	0
4399 	/*
4400 	 * Indicates that this BD is 16B long and is an
4401 	 * RX Producer Assembly Buffer Descriptor.
4402 	 */
4403 		#define RX_PROD_AGG_BD_TYPE_RX_PROD_AGG	UINT32_C(0x6)
4404 		#define RX_PROD_AGG_BD_TYPE_LAST	RX_PROD_AGG_BD_TYPE_RX_PROD_AGG
4405 	#define RX_PROD_AGG_BD_FLAGS_MASK	UINT32_C(0xffc0)
4406 	#define RX_PROD_AGG_BD_FLAGS_SFT	6
4407 	/*
4408 	 * If set to 1, the packet write will be padded out to the
4409 	 * nearest cache-line with zero value padding.
4410 	 */
4411 	/*
4412 	 * If receive buffers start/end on cache-line boundaries, this
4413 	 * feature will ensure that all data writes on the PCI bus
4414 	 * end on cache line boundaries.
4415 	 */
4416 	#define RX_PROD_AGG_BD_FLAGS_EOP_PAD	UINT32_C(0x40)
4417 	/*
4418 	 * This is the length in Bytes of the host physical buffer where
4419 	 * data for the packet may be placed in host memory.
4420 	 */
4421 	/*
4422 	 * While this is a Byte resolution value, it is often advantageous
4423 	 * to ensure that the buffers provided end on a host cache line.
4424 	 */
4425 	uint16_t	len;
4426 	/*
4427 	 * The opaque data field is pass through to the completion and can be
4428 	 * used for any data that the driver wants to associate with this
4429 	 * receive assembly buffer.
4430 	 */
4431 	uint32_t	opaque;
4432 	/*
4433 	 * This is the host physical address where data for the packet may
4434 	 * be placed in host memory.
4435 	 */
4436 	/*
4437 	 * While this is a Byte resolution value, it is often advantageous
4438 	 * to ensure that the buffers provide start on a host cache line.
4439 	 */
4440 	uint64_t	addr;
4441 } rx_prod_agg_bd_t, *prx_prod_agg_bd_t;
4442 
4443 /* cfa_cmpls_cmp_data_msg (size:128b/16B) */
4444 
4445 typedef struct cfa_cmpls_cmp_data_msg {
4446 	uint32_t	mp_client_dma_length_opcode_status_type;
4447 	/*
4448 	 * This field represents the Mid-Path client that generated the
4449 	 * completion.
4450 	 */
4451 	/*
4452 	 * This field indicates the exact type of the completion. By
4453 	 * convention, the LSB identifies the length of the record in 16B
4454 	 * units. Even values indicate 16B records. Odd values indicate 32B
4455 	 * records.
4456 	 */
4457 	#define CFA_CMPLS_CMP_DATA_MSG_TYPE_MASK		UINT32_C(0x3f)
4458 	#define CFA_CMPLS_CMP_DATA_MSG_TYPE_SFT		0
4459 	/* Mid Path Short Completion with length = 16B. */
4460 		#define CFA_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT	UINT32_C(0x1e)
4461 		#define CFA_CMPLS_CMP_DATA_MSG_TYPE_LAST		CFA_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT
4462 	/* This value indicates the status for the command. */
4463 	#define CFA_CMPLS_CMP_DATA_MSG_STATUS_MASK		UINT32_C(0x3c0)
4464 	#define CFA_CMPLS_CMP_DATA_MSG_STATUS_SFT		6
4465 	/* Completed without error. */
4466 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_OK		(UINT32_C(0x0) << 6)
4467 	/* Indicates an unsupported CFA opcode in the command. */
4468 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_UNSPRT_ERR	(UINT32_C(0x1) << 6)
4469 	/*
4470 	 * Indicates a CFA command formatting error. This error can occur on
4471 	 * any of the supported CFA commands.
4472 	 */
4473 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_FMT_ERR		(UINT32_C(0x2) << 6)
4474 	/*
4475 	 * Indicates an SVIF-Table scope error. This error can occur on any
4476 	 * of the supported CFA commands.
4477 	 */
4478 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_SCOPE_ERR	(UINT32_C(0x3) << 6)
4479 	/*
4480 	 * Indicates that the table_index is either outside of the
4481 	 * table_scope range set by its EM_SIZE or, for EM Insert, it is in
4482 	 * the static bucket range. This error can occur on EM Insert
4483 	 * commands. It can also occur on Read, Read Clear, Write, and
4484 	 * Invalidate commands if the table_type is EM.
4485 	 */
4486 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_ADDR_ERR		(UINT32_C(0x4) << 6)
4487 	/*
4488 	 * Cache operation responded with an error. This error can occur on
4489 	 * Read, Read Clear, Write, EM Insert, and EM Delete commands.
4490 	 */
4491 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_CACHE_ERR	(UINT32_C(0x5) << 6)
4492 	/*
4493 	 * Indicates failure on EM Insert or EM Delete Command. Hash index
4494 	 * and hash msb are returned in table_index and hash_msb fields.
4495 	 * Dma_length is set to 1 if the bucket is also returned (as dma
4496 	 * data).
4497 	 */
4498 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_EM_FAIL		(UINT32_C(0x6) << 6)
4499 	/*
4500 	 * Indicates no notifications were available on an Event Collection
4501 	 * command.
4502 	 */
4503 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_EVENT_COLLECT_FAIL  (UINT32_C(0x7) << 6)
4504 		#define CFA_CMPLS_CMP_DATA_MSG_STATUS_LAST		CFA_CMPLS_CMP_DATA_MSG_STATUS_EVENT_COLLECT_FAIL
4505 	#define CFA_CMPLS_CMP_DATA_MSG_UNUSED0_MASK		UINT32_C(0xc00)
4506 	#define CFA_CMPLS_CMP_DATA_MSG_UNUSED0_SFT		10
4507 	/* This is the opcode from the command. */
4508 	#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_MASK		UINT32_C(0xff000)
4509 	#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_SFT		12
4510 	/*
4511 	 * This is read command. From 32 to 128B can be read from a table
4512 	 * using this command.
4513 	 */
4514 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_READ		(UINT32_C(0x0) << 12)
4515 	/*
4516 	 * This is write command. From 32 to 128B can be written to a table
4517 	 * using this command.
4518 	 */
4519 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_WRITE		(UINT32_C(0x1) << 12)
4520 	/*
4521 	 * This is read-clear command. 32B can be read from a table and a 16b
4522 	 * mask can be used to clear specific 16b units after the read as an
4523 	 * atomic operation.
4524 	 */
4525 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_READ_CLR		(UINT32_C(0x2) << 12)
4526 	/*
4527 	 * An exact match table insert will be attempted into the table. If
4528 	 * there is a free location in the bucket, the payload will be
4529 	 * written to the bucket.
4530 	 */
4531 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EM_INSERT	(UINT32_C(0x3) << 12)
4532 	/* An exact match table delete will be attempted. */
4533 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EM_DELETE	(UINT32_C(0x4) << 12)
4534 	/*
4535 	 * The specified table area will be invalidated. If it is needed
4536 	 * again, it will be read from the backing store.
4537 	 */
4538 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_INVALIDATE	(UINT32_C(0x5) << 12)
4539 	/* Reads notification messages from the Host Notification Queue. */
4540 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EVENT_COLLECT	(UINT32_C(0x6) << 12)
4541 		#define CFA_CMPLS_CMP_DATA_MSG_OPCODE_LAST		CFA_CMPLS_CMP_DATA_MSG_OPCODE_EVENT_COLLECT
4542 	/*
4543 	 * This field indicates the length of the DMA that accompanies the
4544 	 * completion. Specified in units of DWords (32b). Valid values are
4545 	 * between 0 and 128. A value of zero indicates that there is no DMA
4546 	 * that accompanies the completion.
4547 	 */
4548 	#define CFA_CMPLS_CMP_DATA_MSG_DMA_LENGTH_MASK	UINT32_C(0xff00000)
4549 	#define CFA_CMPLS_CMP_DATA_MSG_DMA_LENGTH_SFT	20
4550 	/*
4551 	 * This field represents the Mid-Path client that generated the
4552 	 * completion.
4553 	 */
4554 	#define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_MASK	UINT32_C(0xf0000000)
4555 	#define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_SFT		28
4556 	/* TX configurable flow processing block. */
4557 		#define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_TE_CFA	(UINT32_C(0x2) << 28)
4558 	/* RX configurable flow processing block. */
4559 		#define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_RE_CFA	(UINT32_C(0x3) << 28)
4560 		#define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_LAST		CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_RE_CFA
4561 	/*
4562 	 * This is a copy of the opaque field from the mid path BD of this
4563 	 * command.
4564 	 */
4565 	uint32_t	opaque;
4566 	uint16_t	hash_msb_v;
4567 	/*
4568 	 * This value is written by the NIC such that it will be different for
4569 	 * each pass through the completion queue. The even passes will
4570 	 * write 1. The odd passes will write 0.
4571 	 */
4572 	#define CFA_CMPLS_CMP_DATA_MSG_V		UINT32_C(0x1)
4573 	#define CFA_CMPLS_CMP_DATA_MSG_UNUSED1_MASK UINT32_C(0xe)
4574 	#define CFA_CMPLS_CMP_DATA_MSG_UNUSED1_SFT  1
4575 	/*
4576 	 * This is the upper 12b of the hash, returned on Exact Match
4577 	 * Insertion/Deletion Commands.
4578 	 */
4579 	#define CFA_CMPLS_CMP_DATA_MSG_HASH_MSB_MASK UINT32_C(0xfff0)
4580 	#define CFA_CMPLS_CMP_DATA_MSG_HASH_MSB_SFT 4
4581 	/* This is the table type from the command. */
4582 	uint8_t	table_type;
4583 	#define CFA_CMPLS_CMP_DATA_MSG_UNUSED2_MASK	UINT32_C(0xf)
4584 	#define CFA_CMPLS_CMP_DATA_MSG_UNUSED2_SFT	0
4585 	#define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf0)
4586 	#define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_SFT   4
4587 	/* This command acts on the action table of the specified scope. */
4588 		#define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_ACTION  (UINT32_C(0x0) << 4)
4589 	/* This command acts on the exact match table of the specified scope. */
4590 		#define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_EM	(UINT32_C(0x1) << 4)
4591 		#define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_LAST   CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_EM
4592 	uint8_t	table_scope;
4593 	/* This is the table scope from the command. */
4594 	#define CFA_CMPLS_CMP_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
4595 	#define CFA_CMPLS_CMP_DATA_MSG_TABLE_SCOPE_SFT 0
4596 	uint32_t	table_index;
4597 	/*
4598 	 * This is the table index from the command (if it exists). However, if
4599 	 * an Exact Match Insertion/Deletion command failed, then this is the
4600 	 * table index of the calculated static hash bucket.
4601 	 */
4602 	#define CFA_CMPLS_CMP_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
4603 	#define CFA_CMPLS_CMP_DATA_MSG_TABLE_INDEX_SFT 0
4604 } cfa_cmpls_cmp_data_msg_t, *pcfa_cmpls_cmp_data_msg_t;
4605 
4606 /* CFA Mid-Path 32B DMA Message */
4607 /* cfa_dma32b_data_msg (size:256b/32B) */
4608 
4609 typedef struct cfa_dma32b_data_msg {
4610 	/* DMA data value. */
4611 	uint32_t	dta[8];
4612 } cfa_dma32b_data_msg_t, *pcfa_dma32b_data_msg_t;
4613 
4614 /* CFA Mid-Path 64B DMA Message */
4615 /* cfa_dma64b_data_msg (size:512b/64B) */
4616 
4617 typedef struct cfa_dma64b_data_msg {
4618 	/* DMA data value. */
4619 	uint32_t	dta[16];
4620 } cfa_dma64b_data_msg_t, *pcfa_dma64b_data_msg_t;
4621 
4622 /* CFA Mid-Path 96B DMA Message */
4623 /* cfa_dma96b_data_msg (size:768b/96B) */
4624 
4625 typedef struct cfa_dma96b_data_msg {
4626 	/* DMA data value. */
4627 	uint32_t	dta[24];
4628 } cfa_dma96b_data_msg_t, *pcfa_dma96b_data_msg_t;
4629 
4630 /* CFA Mid-Path 128B DMA Message */
4631 /* cfa_dma128b_data_msg (size:1024b/128B) */
4632 
4633 typedef struct cfa_dma128b_data_msg {
4634 	/* DMA data value. */
4635 	uint32_t	dta[32];
4636 } cfa_dma128b_data_msg_t, *pcfa_dma128b_data_msg_t;
4637 
4638 /* ce_cmpls_cmp_data_msg (size:128b/16B) */
4639 
4640 typedef struct ce_cmpls_cmp_data_msg {
4641 	uint16_t	client_subtype_type;
4642 	/*
4643 	 * This field indicates the exact type of the completion. By
4644 	 * convention, the LSB identifies the length of the record in 16B
4645 	 * units. Even values indicate 16B records. Odd values indicate 32B
4646 	 * records.
4647 	 */
4648 	#define CE_CMPLS_CMP_DATA_MSG_TYPE_MASK	UINT32_C(0x3f)
4649 	#define CE_CMPLS_CMP_DATA_MSG_TYPE_SFT	0
4650 	/* Completion of a Mid Path Command. Length = 16B */
4651 		#define CE_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT  UINT32_C(0x1e)
4652 		#define CE_CMPLS_CMP_DATA_MSG_TYPE_LAST	CE_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT
4653 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED0_MASK	UINT32_C(0xc0)
4654 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED0_SFT	6
4655 	/*
4656 	 * This value indicates the CE sub-type operation that is being
4657 	 * completed.
4658 	 */
4659 	#define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_MASK	UINT32_C(0xf00)
4660 	#define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_SFT	8
4661 	/* Completion Response for a Solicited Command. */
4662 		#define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_SOLICITED	(UINT32_C(0x0) << 8)
4663 	/* Error Completion (Unsolicited). */
4664 		#define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_ERR	(UINT32_C(0x1) << 8)
4665 	/* Re-Sync Completion (Unsolicited) */
4666 		#define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_RESYNC	(UINT32_C(0x2) << 8)
4667 		#define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_LAST	CE_CMPLS_CMP_DATA_MSG_SUBTYPE_RESYNC
4668 	/*
4669 	 * This field represents the Mid-Path client that generated the
4670 	 * completion.
4671 	 */
4672 	#define CE_CMPLS_CMP_DATA_MSG_MP_CLIENT_MASK	UINT32_C(0xf000)
4673 	#define CE_CMPLS_CMP_DATA_MSG_MP_CLIENT_SFT	12
4674 	/* TX crypto engine block. */
4675 		#define CE_CMPLS_CMP_DATA_MSG_MP_CLIENT_TCE	(UINT32_C(0x0) << 12)
4676 	/* RX crypto engine block. */
4677 		#define CE_CMPLS_CMP_DATA_MSG_MP_CLIENT_RCE	(UINT32_C(0x1) << 12)
4678 		#define CE_CMPLS_CMP_DATA_MSG_MP_CLIENT_LAST	CE_CMPLS_CMP_DATA_MSG_MP_CLIENT_RCE
4679 	uint16_t	status;
4680 	/* This value indicates the status for the command. */
4681 	#define CE_CMPLS_CMP_DATA_MSG_STATUS_MASK	UINT32_C(0xf)
4682 	#define CE_CMPLS_CMP_DATA_MSG_STATUS_SFT	0
4683 	/* Completed without error. */
4684 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_OK	UINT32_C(0x0)
4685 	/* CFCK load error. */
4686 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_CTX_LD_ERR   UINT32_C(0x1)
4687 	/* FID check error. */
4688 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_FID_CHK_ERR  UINT32_C(0x2)
4689 	/* Context kind / MP version mismatch error. */
4690 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_CTX_VER_ERR  UINT32_C(0x3)
4691 	/* Unsupported Destination Connection ID Length. */
4692 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_DST_ID_ERR   UINT32_C(0x4)
4693 	/*
4694 	 * Invalid MP Command [anything other than ADD or DELETE
4695 	 * triggers this for QUIC].
4696 	 */
4697 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_MP_CMD_ERR   UINT32_C(0x5)
4698 		#define CE_CMPLS_CMP_DATA_MSG_STATUS_LAST	CE_CMPLS_CMP_DATA_MSG_STATUS_MP_CMD_ERR
4699 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED1_MASK	UINT32_C(0xfff0)
4700 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED1_SFT	4
4701 	/*
4702 	 * This is a copy of the opaque field from the mid path BD of this
4703 	 * command.
4704 	 */
4705 	uint32_t	opaque;
4706 	uint32_t	v;
4707 	/*
4708 	 * This value is written by the NIC such that it will be different
4709 	 * for each pass through the completion queue. The even passes will
4710 	 * write 1. The odd passes will write 0.
4711 	 */
4712 	#define CE_CMPLS_CMP_DATA_MSG_V	UINT32_C(0x1)
4713 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED2_MASK UINT32_C(0xfffffffe)
4714 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED2_SFT 1
4715 	uint32_t	kid;
4716 	/*
4717 	 * This field is the Crypto Context ID. The KID is used to store
4718 	 * information used by the associated kTLS offloaded connection.
4719 	 */
4720 	#define CE_CMPLS_CMP_DATA_MSG_KID_MASK	UINT32_C(0xfffff)
4721 	#define CE_CMPLS_CMP_DATA_MSG_KID_SFT	0
4722 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED3_MASK UINT32_C(0xfff00000)
4723 	#define CE_CMPLS_CMP_DATA_MSG_UNUSED3_SFT 20
4724 } ce_cmpls_cmp_data_msg_t, *pce_cmpls_cmp_data_msg_t;
4725 
4726 /* cmpl_base (size:128b/16B) */
4727 
4728 typedef struct cmpl_base {
4729 	uint16_t	type;
4730 	/*
4731 	 * This field indicates the exact type of the completion.
4732 	 * By convention, the LSB identifies the length of the
4733 	 * record in 16B units. Even values indicate 16B
4734 	 * records. Odd values indicate 32B
4735 	 * records.
4736 	 */
4737 	#define CMPL_BASE_TYPE_MASK		UINT32_C(0x3f)
4738 	#define CMPL_BASE_TYPE_SFT		0
4739 	/*
4740 	 * TX L2 completion:
4741 	 * Completion of TX packet. Length = 16B
4742 	 */
4743 		#define CMPL_BASE_TYPE_TX_L2		UINT32_C(0x0)
4744 	/*
4745 	 * NO-OP completion:
4746 	 * Completion of NO-OP. Length = 16B
4747 	 */
4748 		#define CMPL_BASE_TYPE_NO_OP		UINT32_C(0x1)
4749 	/*
4750 	 * TX L2 coalesced completion:
4751 	 * Completion of coalesced TX packet. Length = 16B
4752 	 */
4753 		#define CMPL_BASE_TYPE_TX_L2_COAL	UINT32_C(0x2)
4754 	/*
4755 	 * TX L2 Packet Timestamp completion:
4756 	 * Completion of an L2 Packet Timestamp Packet. Length = 16B
4757 	 */
4758 		#define CMPL_BASE_TYPE_TX_L2_PKT_TS	UINT32_C(0x4)
4759 	/*
4760 	 * RX L2 TPA Start V2 Completion:
4761 	 * Completion of and L2 RX packet. Length = 32B
4762 	 * This is the new version of the RX_TPA_START completion used
4763 	 * in SR2 and later chips.
4764 	 */
4765 		#define CMPL_BASE_TYPE_RX_TPA_START_V2   UINT32_C(0xd)
4766 	/*
4767 	 * RX L2 V2 completion:
4768 	 * Completion of and L2 RX packet. Length = 32B
4769 	 * This is the new version of the RX_L2 completion used in SR2
4770 	 * and later chips.
4771 	 */
4772 		#define CMPL_BASE_TYPE_RX_L2_V2	UINT32_C(0xf)
4773 	/*
4774 	 * RX L2 completion:
4775 	 * This is the compressed version of Rx Completion for performance
4776 	 * applications. Length = 16B
4777 	 */
4778 		#define CMPL_BASE_TYPE_RX_L2_COMPRESS	UINT32_C(0x10)
4779 	/*
4780 	 * RX L2 completion:
4781 	 * Completion of and L2 RX packet. Length = 32B
4782 	 */
4783 		#define CMPL_BASE_TYPE_RX_L2		UINT32_C(0x11)
4784 	/*
4785 	 * RX Aggregation Buffer completion:
4786 	 * Completion of an L2 aggregation buffer in support of
4787 	 * TPA, HDS, or Jumbo packet completion. Length = 16B
4788 	 */
4789 		#define CMPL_BASE_TYPE_RX_AGG		UINT32_C(0x12)
4790 	/*
4791 	 * RX L2 TPA Start Completion:
4792 	 * Completion at the beginning of a TPA operation.
4793 	 * Length = 32B
4794 	 */
4795 		#define CMPL_BASE_TYPE_RX_TPA_START	UINT32_C(0x13)
4796 	/*
4797 	 * RX L2 TPA End Completion:
4798 	 * Completion at the end of a TPA operation.
4799 	 * Length = 32B
4800 	 */
4801 		#define CMPL_BASE_TYPE_RX_TPA_END	UINT32_C(0x15)
4802 	/*
4803 	 * RX TPA Aggregation Buffer Completion:
4804 	 * Completion of an L2 aggregation buffer in support of TPA packet
4805 	 * completion.
4806 	 * Length = 16B
4807 	 */
4808 		#define CMPL_BASE_TYPE_RX_TPA_AGG	UINT32_C(0x16)
4809 	/*
4810 	 * RX L2 completion: Completion of and L2 RX packet.
4811 	 * Length = 32B
4812 	 */
4813 		#define CMPL_BASE_TYPE_RX_L2_V3	UINT32_C(0x17)
4814 	/*
4815 	 * RX L2 TPA Start completion: Completion at the beginning of a TPA
4816 	 * operation.
4817 	 * Length = 32B
4818 	 */
4819 		#define CMPL_BASE_TYPE_RX_TPA_START_V3   UINT32_C(0x19)
4820 	/*
4821 	 * Statistics Ejection Completion:
4822 	 * Completion of statistics data ejection buffer.
4823 	 * Length = 16B
4824 	 */
4825 		#define CMPL_BASE_TYPE_STAT_EJECT	UINT32_C(0x1a)
4826 	/*
4827 	 * VEE Flush Completion:
4828 	 * This completion is inserted manually by
4829 	 * the Primate and processed by the VEE hardware to ensure that
4830 	 * all completions on a VEE function have been processed by the
4831 	 * VEE hardware before FLR process is completed.
4832 	 */
4833 		#define CMPL_BASE_TYPE_VEE_FLUSH	UINT32_C(0x1c)
4834 	/*
4835 	 * Mid Path Short Completion :
4836 	 * Completion of a Mid Path Command. Length = 16B
4837 	 */
4838 		#define CMPL_BASE_TYPE_MID_PATH_SHORT	UINT32_C(0x1e)
4839 	/*
4840 	 * Mid Path Long Completion :
4841 	 * Completion of a Mid Path Command. Length = 32B
4842 	 */
4843 		#define CMPL_BASE_TYPE_MID_PATH_LONG	UINT32_C(0x1f)
4844 	/*
4845 	 * HWRM Command Completion:
4846 	 * Completion of an HWRM command.
4847 	 */
4848 		#define CMPL_BASE_TYPE_HWRM_DONE	UINT32_C(0x20)
4849 	/* Forwarded HWRM Request */
4850 		#define CMPL_BASE_TYPE_HWRM_FWD_REQ	UINT32_C(0x22)
4851 	/* Forwarded HWRM Response */
4852 		#define CMPL_BASE_TYPE_HWRM_FWD_RESP	UINT32_C(0x24)
4853 	/* HWRM Asynchronous Event Information */
4854 		#define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
4855 	/* CQ Notification */
4856 		#define CMPL_BASE_TYPE_CQ_NOTIFICATION   UINT32_C(0x30)
4857 	/* SRQ Threshold Event */
4858 		#define CMPL_BASE_TYPE_SRQ_EVENT	UINT32_C(0x32)
4859 	/* DBQ Threshold Event */
4860 		#define CMPL_BASE_TYPE_DBQ_EVENT	UINT32_C(0x34)
4861 	/* QP Async Notification */
4862 		#define CMPL_BASE_TYPE_QP_EVENT	UINT32_C(0x38)
4863 	/* Function Async Notification */
4864 		#define CMPL_BASE_TYPE_FUNC_EVENT	UINT32_C(0x3a)
4865 		#define CMPL_BASE_TYPE_LAST		CMPL_BASE_TYPE_FUNC_EVENT
4866 	/* info1 is 16 b */
4867 	uint16_t	info1;
4868 	/* info2 is 32 b */
4869 	uint32_t	info2;
4870 	/*
4871 	 * This value is written by the NIC such that it will be different
4872 	 * for each pass through the completion queue. The even passes
4873 	 * will write 1. The odd passes will write 0.
4874 	 */
4875 	uint32_t	info3_v;
4876 	#define CMPL_BASE_V	UINT32_C(0x1)
4877 	#define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
4878 	#define CMPL_BASE_INFO3_SFT 1
4879 	/* info4 is 32 b */
4880 	uint32_t	info4;
4881 } cmpl_base_t, *pcmpl_base_t;
4882 
4883 /* tx_cmpl (size:128b/16B) */
4884 
4885 typedef struct tx_cmpl {
4886 	uint16_t	flags_type;
4887 	/*
4888 	 * This field indicates the exact type of the completion.
4889 	 * By convention, the LSB identifies the length of the
4890 	 * record in 16B units. Even values indicate 16B
4891 	 * records. Odd values indicate 32B
4892 	 * records.
4893 	 */
4894 	#define TX_CMPL_TYPE_MASK	UINT32_C(0x3f)
4895 	#define TX_CMPL_TYPE_SFT	0
4896 	/*
4897 	 * TX L2 completion:
4898 	 * Completion of TX packet. Length = 16B
4899 	 */
4900 		#define TX_CMPL_TYPE_TX_L2	UINT32_C(0x0)
4901 		#define TX_CMPL_TYPE_LAST	TX_CMPL_TYPE_TX_L2
4902 	#define TX_CMPL_FLAGS_MASK	UINT32_C(0xffc0)
4903 	#define TX_CMPL_FLAGS_SFT	6
4904 	/*
4905 	 * When this bit is '1', it indicates a packet that has an
4906 	 * error of some type. Type of error is indicated in
4907 	 * error_flags.
4908 	 */
4909 	#define TX_CMPL_FLAGS_ERROR	UINT32_C(0x40)
4910 	/*
4911 	 * When this bit is '1', it indicates that the packet completed
4912 	 * was transmitted using the push acceleration data provided
4913 	 * by the driver. When this bit is '0', it indicates that the
4914 	 * packet had not push acceleration data written or was executed
4915 	 * as a normal packet even though push data was provided.
4916 	 */
4917 	#define TX_CMPL_FLAGS_PUSH	UINT32_C(0x80)
4918 	/* unused1 is 16 b */
4919 	uint16_t	unused_0;
4920 	/*
4921 	 * This is a copy of the opaque field from the first TX BD of this
4922 	 * transmitted packet. Note that, if the packet was described by a short
4923 	 * CSO or short CSO inline BD, then the 16-bit opaque field from the
4924 	 * short CSO BD will appear in the bottom 16 bits of this field.
4925 	 */
4926 	uint32_t	opaque;
4927 	uint16_t	errors_v;
4928 	/*
4929 	 * This value is written by the NIC such that it will be different
4930 	 * for each pass through the completion queue. The even passes
4931 	 * will write 1. The odd passes will write 0.
4932 	 */
4933 	#define TX_CMPL_V				UINT32_C(0x1)
4934 	#define TX_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
4935 	#define TX_CMPL_ERRORS_SFT			1
4936 	/*
4937 	 * This error indicates that there was some sort of problem
4938 	 * with the BDs for the packet.
4939 	 */
4940 	#define TX_CMPL_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
4941 	#define TX_CMPL_ERRORS_BUFFER_ERROR_SFT		1
4942 	/* No error */
4943 		#define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR	(UINT32_C(0x0) << 1)
4944 	/*
4945 	 * Bad Format:
4946 	 * BDs were not formatted correctly.
4947 	 */
4948 		#define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT	(UINT32_C(0x2) << 1)
4949 		#define TX_CMPL_ERRORS_BUFFER_ERROR_LAST		TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
4950 	/*
4951 	 * When this bit is '1', it indicates that the length of
4952 	 * the packet was zero. No packet was transmitted.
4953 	 */
4954 	#define TX_CMPL_ERRORS_ZERO_LENGTH_PKT		UINT32_C(0x10)
4955 	/*
4956 	 * When this bit is '1', it indicates that the packet
4957 	 * was longer than the programmed limit in TDI. No
4958 	 * packet was transmitted.
4959 	 */
4960 	#define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH	UINT32_C(0x20)
4961 	/*
4962 	 * When this bit is '1', it indicates that one or more of the
4963 	 * BDs associated with this packet generated a PCI error.
4964 	 * This probably means the address was not valid.
4965 	 */
4966 	#define TX_CMPL_ERRORS_DMA_ERROR			UINT32_C(0x40)
4967 	/*
4968 	 * When this bit is '1', it indicates that the packet was longer
4969 	 * than indicated by the hint. No packet was transmitted.
4970 	 */
4971 	#define TX_CMPL_ERRORS_HINT_TOO_SHORT		UINT32_C(0x80)
4972 	/*
4973 	 * When this bit is '1', it indicates that the packet was
4974 	 * dropped due to Poison TLP error on one or more of the
4975 	 * TLPs in the PXP completion.
4976 	 */
4977 	#define TX_CMPL_ERRORS_POISON_TLP_ERROR		UINT32_C(0x100)
4978 	/*
4979 	 * When this bit is '1', it indicates that the packet was dropped
4980 	 * due to a transient internal error in TDC. The packet or LSO can
4981 	 * be retried and may transmit successfully on a subsequent attempt.
4982 	 */
4983 	#define TX_CMPL_ERRORS_INTERNAL_ERROR		UINT32_C(0x200)
4984 	/*
4985 	 * When this bit is '1', it was not possible to collect a timestamp
4986 	 * for a PTP completion, in which case the timestamp_hi and
4987 	 * timestamp_lo fields are invalid. When this bit is '0' for a PTP
4988 	 * completion, the timestamp_hi and timestamp_lo fields are valid.
4989 	 * RJRN will copy the value of this bit into the field of the same
4990 	 * name in all TX completions, regardless of whether such completions
4991 	 * are PTP completions or other TX completions.
4992 	 */
4993 	#define TX_CMPL_ERRORS_TIMESTAMP_INVALID_ERROR	UINT32_C(0x400)
4994 	/* unused2 is 16 b */
4995 	uint16_t	unused_1;
4996 	/* unused3 is 32 b */
4997 	uint32_t	unused_2;
4998 } tx_cmpl_t, *ptx_cmpl_t;
4999 
5000 /* tx_cmpl_coal (size:128b/16B) */
5001 
5002 typedef struct tx_cmpl_coal {
5003 	uint16_t	flags_type;
5004 	/*
5005 	 * This field indicates the exact type of the completion.
5006 	 * By convention, the LSB identifies the length of the
5007 	 * record in 16B units. Even values indicate 16B
5008 	 * records. Odd values indicate 32B
5009 	 * records.
5010 	 */
5011 	#define TX_CMPL_COAL_TYPE_MASK	UINT32_C(0x3f)
5012 	#define TX_CMPL_COAL_TYPE_SFT	0
5013 	/*
5014 	 * TX L2 coalesced completion:
5015 	 * Completion of TX packet. Length = 16B
5016 	 */
5017 		#define TX_CMPL_COAL_TYPE_TX_L2_COAL   UINT32_C(0x2)
5018 		#define TX_CMPL_COAL_TYPE_LAST	TX_CMPL_COAL_TYPE_TX_L2_COAL
5019 	#define TX_CMPL_COAL_FLAGS_MASK	UINT32_C(0xffc0)
5020 	#define TX_CMPL_COAL_FLAGS_SFT	6
5021 	/*
5022 	 * When this bit is '1', it indicates a packet that has an
5023 	 * error of some type. Type of error is indicated in
5024 	 * error_flags.
5025 	 */
5026 	#define TX_CMPL_COAL_FLAGS_ERROR	UINT32_C(0x40)
5027 	/*
5028 	 * When this bit is '1', it indicates that the packet completed
5029 	 * was transmitted using the push acceleration data provided
5030 	 * by the driver. When this bit is '0', it indicates that the
5031 	 * packet had not push acceleration data written or was executed
5032 	 * as a normal packet even though push data was provided.
5033 	 */
5034 	#define TX_CMPL_COAL_FLAGS_PUSH	UINT32_C(0x80)
5035 	/* unused1 is 16 b */
5036 	uint16_t	unused_0;
5037 	/*
5038 	 * This is a copy of the opaque field from the first TX BD of the packet
5039 	 * which corresponds with the reported sq_cons_idx. Note that, with
5040 	 * coalesced completions, completions are generated for only some of the
5041 	 * packets. The driver will see the opaque field for only those packets.
5042 	 * Note that, if the packet was described by a short CSO or short CSO
5043 	 * inline BD, then the 16-bit opaque field from the short CSO BD will
5044 	 * appear in the bottom 16 bits of this field. For TX rings with
5045 	 * completion coalescing enabled (which would use the coalesced
5046 	 * completion record), it is suggested that the driver populate the
5047 	 * opaque field to indicate the specific TX ring with which the
5048 	 * completion is associated, then utilize the opaque and sq_cons_idx
5049 	 * fields in the coalesced completion record to determine the specific
5050 	 * packets that are to be completed on that ring.
5051 	 */
5052 	uint32_t	opaque;
5053 	uint16_t	errors_v;
5054 	/*
5055 	 * This value is written by the NIC such that it will be different
5056 	 * for each pass through the completion queue. The even passes
5057 	 * will write 1. The odd passes will write 0.
5058 	 */
5059 	#define TX_CMPL_COAL_V				UINT32_C(0x1)
5060 	#define TX_CMPL_COAL_ERRORS_MASK			UINT32_C(0xfffe)
5061 	#define TX_CMPL_COAL_ERRORS_SFT			1
5062 	/*
5063 	 * This error indicates that there was some sort of problem
5064 	 * with the BDs for the packet.
5065 	 */
5066 	#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
5067 	#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_SFT		1
5068 	/* No error */
5069 		#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_NO_ERROR	(UINT32_C(0x0) << 1)
5070 	/*
5071 	 * Bad Format:
5072 	 * BDs were not formatted correctly.
5073 	 */
5074 		#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT	(UINT32_C(0x2) << 1)
5075 		#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_LAST		TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT
5076 	/*
5077 	 * When this bit is '1', it indicates that the length of
5078 	 * the packet was zero. No packet was transmitted.
5079 	 */
5080 	#define TX_CMPL_COAL_ERRORS_ZERO_LENGTH_PKT		UINT32_C(0x10)
5081 	/*
5082 	 * When this bit is '1', it indicates that the packet
5083 	 * was longer than the programmed limit in TDI. No
5084 	 * packet was transmitted.
5085 	 */
5086 	#define TX_CMPL_COAL_ERRORS_EXCESSIVE_BD_LENGTH	UINT32_C(0x20)
5087 	/*
5088 	 * When this bit is '1', it indicates that one or more of the
5089 	 * BDs associated with this packet generated a PCI error.
5090 	 * This probably means the address was not valid.
5091 	 */
5092 	#define TX_CMPL_COAL_ERRORS_DMA_ERROR			UINT32_C(0x40)
5093 	/*
5094 	 * When this bit is '1', it indicates that the packet was longer
5095 	 * than indicated by the hint. No packet was transmitted.
5096 	 */
5097 	#define TX_CMPL_COAL_ERRORS_HINT_TOO_SHORT		UINT32_C(0x80)
5098 	/*
5099 	 * When this bit is '1', it indicates that the packet was
5100 	 * dropped due to Poison TLP error on one or more of the
5101 	 * TLPs in the PXP completion.
5102 	 */
5103 	#define TX_CMPL_COAL_ERRORS_POISON_TLP_ERROR		UINT32_C(0x100)
5104 	/*
5105 	 * When this bit is '1', it indicates that the packet was dropped
5106 	 * due to a transient internal error in TDC. The packet or LSO can
5107 	 * be retried and may transmit successfully on a subsequent attempt.
5108 	 */
5109 	#define TX_CMPL_COAL_ERRORS_INTERNAL_ERROR		UINT32_C(0x200)
5110 	/*
5111 	 * When this bit is '1', it was not possible to collect a a timestamp
5112 	 * for a PTP completion, in which case the timestamp_hi and
5113 	 * timestamp_lo fields are invalid. When this bit is '0' for a PTP
5114 	 * completion, the timestamp_hi and timestamp_lo fields are valid.
5115 	 * RJRN will copy the value of this bit into the field of the same
5116 	 * name in all TX completions, regardless of whether such
5117 	 * completions are PTP completions or other TX completions.
5118 	 */
5119 	#define TX_CMPL_COAL_ERRORS_TIMESTAMP_INVALID_ERROR	UINT32_C(0x400)
5120 	/* unused2 is 16 b */
5121 	uint16_t	unused_1;
5122 	uint32_t	sq_cons_idx;
5123 	/*
5124 	 * This value is SQ index for the start of the packet following the
5125 	 * last completed packet.
5126 	 */
5127 	#define TX_CMPL_COAL_SQ_CONS_IDX_MASK UINT32_C(0xffffff)
5128 	#define TX_CMPL_COAL_SQ_CONS_IDX_SFT 0
5129 } tx_cmpl_coal_t, *ptx_cmpl_coal_t;
5130 
5131 /* tx_cmpl_packet_timestamp (size:128b/16B) */
5132 
5133 typedef struct tx_cmpl_packet_timestamp {
5134 	uint16_t	ts_sub_ns_flags_type;
5135 	/*
5136 	 * This field indicates the exact type of the completion. By
5137 	 * convention, the LSB identifies the length of the record in 16B
5138 	 * units. Even values indicate 16B records. Odd values indicate
5139 	 * 32B records.
5140 	 */
5141 	#define TX_CMPL_PACKET_TIMESTAMP_TYPE_MASK		UINT32_C(0x3f)
5142 	#define TX_CMPL_PACKET_TIMESTAMP_TYPE_SFT		0
5143 	/*
5144 	 * TX L2 Packet Timestamp completion:
5145 	 * Completion of an L2 Packet Timestamp Packet. Length = 16B
5146 	 */
5147 		#define TX_CMPL_PACKET_TIMESTAMP_TYPE_TX_L2_PKT_TS	UINT32_C(0x4)
5148 		#define TX_CMPL_PACKET_TIMESTAMP_TYPE_LAST		TX_CMPL_PACKET_TIMESTAMP_TYPE_TX_L2_PKT_TS
5149 	#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_MASK		UINT32_C(0xfc0)
5150 	#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_SFT		6
5151 	/*
5152 	 * When this bit is '1', it indicates a packet that has an error
5153 	 * of some type. Type of error is indicated in error_flags.
5154 	 */
5155 	#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_ERROR		UINT32_C(0x40)
5156 	/*
5157 	 * This field indicates the TX packet timestamp type that is
5158 	 * represented by a TX Packet Timestamp Completion. Note that
5159 	 * this field is invalid if the timestamp_invalid_error flag
5160 	 * is set.
5161 	 */
5162 	#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_TS_TYPE	UINT32_C(0x80)
5163 	/* The packet timestamp came from PM. */
5164 		#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_TS_TYPE_TS_PM	(UINT32_C(0x0) << 7)
5165 	/* The packet timestamp came from PA. */
5166 		#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_TS_TYPE_TS_PA	(UINT32_C(0x1) << 7)
5167 		#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_TS_TYPE_LAST	TX_CMPL_PACKET_TIMESTAMP_FLAGS_TS_TYPE_TS_PA
5168 	/*
5169 	 * This flag indicates that the timestamp should have come from PM,
5170 	 * but came instead from PA because all PM timestamp resources were
5171 	 * in use. This can occur in the following circumstances:
5172 	 * 1. The BD specified ts_2cmpl_auto and the packet was a PTP packet
5173 	 *	but PA could not request a PM timestamp
5174 	 * 2. The BD specified ts_2cmpl_pm, but PA could not request a PM
5175 	 *	timestamp
5176 	 */
5177 	#define TX_CMPL_PACKET_TIMESTAMP_FLAGS_TS_FALLBACK	UINT32_C(0x100)
5178 	/*
5179 	 * For 2-step PTP timestamps, bits[3:0] of this field represent the
5180 	 * sub-nanosecond portion of the packet timestamp, returned from PM
5181 	 * for 2-step PTP timestamps. For PA timestamps, this field also
5182 	 * represents the sub-nanosecond portion of the packet timestamp;
5183 	 * however, due to synchronization uncertainties, the accuracy of
5184 	 * PA timestamps is limited to approximately +/- 4 ns. Therefore
5185 	 * this field is of dubious value for PA timestamps.
5186 	 */
5187 	#define TX_CMPL_PACKET_TIMESTAMP_TS_SUB_NS_MASK	UINT32_C(0xf000)
5188 	#define TX_CMPL_PACKET_TIMESTAMP_TS_SUB_NS_SFT	12
5189 	/*
5190 	 * This is bits [47:32] of the nanoseconds portion of the packet
5191 	 * timestamp, returned from PM for 2-step PTP timestamps or from
5192 	 * PA for PA timestamps. This field is in units of 2^32 ns.
5193 	 */
5194 	uint16_t	ts_ns_mid;
5195 	/*
5196 	 * This is a copy of the opaque field from the first TX BD of this
5197 	 * transmitted packet. Note that, if the packet was described by a
5198 	 * short CSO or short CSO inline BD, then the 16-bit opaque field
5199 	 * from the short CSO BD will appear in the bottom 16 bits of this
5200 	 * field.
5201 	 */
5202 	uint32_t	opaque;
5203 	uint16_t	errors_v;
5204 	/*
5205 	 * This value is written by the NIC such that it will be different
5206 	 * for each pass through the completion queue. The even passes
5207 	 * will write 1. The odd passes will write 0.
5208 	 */
5209 	#define TX_CMPL_PACKET_TIMESTAMP_V				UINT32_C(0x1)
5210 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_MASK			UINT32_C(0xfffe)
5211 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_SFT			1
5212 	/*
5213 	 * This field was previously used to indicate fatal errors, which
5214 	 * now result in aborting and bringing down the ring. This field
5215 	 * is deprecated.
5216 	 */
5217 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
5218 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_BUFFER_ERROR_SFT		1
5219 	/* No error. */
5220 		#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_BUFFER_ERROR_NO_ERROR	(UINT32_C(0x0) << 1)
5221 	/* Deprecated. */
5222 		#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_BUFFER_ERROR_BAD_FMT	(UINT32_C(0x2) << 1)
5223 		#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_BUFFER_ERROR_LAST		TX_CMPL_PACKET_TIMESTAMP_ERRORS_BUFFER_ERROR_BAD_FMT
5224 	/*
5225 	 * This error is fatal and results in aborting and bringing down the
5226 	 * ring, thus is deprecated.
5227 	 */
5228 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_ZERO_LENGTH_PKT		UINT32_C(0x10)
5229 	/*
5230 	 * This error is fatal and results in aborting and bringing down the
5231 	 * ring, thus is deprecated.
5232 	 */
5233 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_EXCESSIVE_BD_LENGTH	UINT32_C(0x20)
5234 	/*
5235 	 * When this bit is '1', it indicates that one or more of the BDs
5236 	 * associated with this packet generated a PCI error when accessing
5237 	 * header/payload data from host memory. It most likely indicates
5238 	 * that the address was not valid. Note that this bit has no meaning
5239 	 * for the timestamp completion and will always be '0'.
5240 	 */
5241 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_DMA_ERROR			UINT32_C(0x40)
5242 	/*
5243 	 * This error is fatal and results in aborting and bringing down the
5244 	 * ring, thus is deprecated.
5245 	 */
5246 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_HINT_TOO_SHORT		UINT32_C(0x80)
5247 	/*
5248 	 * When this bit is '1', it indicates that the packet was dropped
5249 	 * due to Poison TLP error on one or more of the TLPs in one or more
5250 	 * of the associated PXP completion(s) when accessing header/payload
5251 	 * data from host memory. Note that this bit has no meaning for the
5252 	 * timestamp completion, and will always be '0'.
5253 	 */
5254 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_POISON_TLP_ERROR		UINT32_C(0x100)
5255 	/*
5256 	 * When this bit is '1', it indicates that the packet was dropped
5257 	 * due to a transient internal error in TDC. The packet or LSO can
5258 	 * be retried and may transmit successfully on a subsequent attempt.
5259 	 * Note that this bit has no meaning for the timestamp completion
5260 	 * and will always be '0'.
5261 	 */
5262 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_INTERNAL_ERROR		UINT32_C(0x200)
5263 	/*
5264 	 * When this bit is '1', it was not possible to collect a timestamp
5265 	 * for a timestamp completion, in which case the ts_ns and ts_sub_ns
5266 	 * fields are invalid. When this bit is '0' in a timestamp
5267 	 * completion record, the ts_sub_ns, ts_ns_lo, and ts_ns_mid fields
5268 	 * are valid. Note that this bit has meaning only for the timestamp
5269 	 * completion. For types other than the timestamp completion, this
5270 	 * bit will always be '0'.
5271 	 */
5272 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_TIMESTAMP_INVALID_ERROR	UINT32_C(0x400)
5273 	/*
5274 	 * When this bit is '1', it indicates that a Timed Transmit
5275 	 * SO-TXTIME packet violated the max_ttx_overtime constraint i.e.,
5276 	 * the time the packet was processed for transmission in TWE was
5277 	 * later than the time given by (TimedTx_BD.tx_time +
5278 	 * max_ttx_overtime) and as result, the packet was dropped.
5279 	 * Note that max_ttx_overtime is a global configuration in TWE.
5280 	 * Note that this bit has no meaning in a timestamp completion,
5281 	 * and will always be '0'.
5282 	 */
5283 	#define TX_CMPL_PACKET_TIMESTAMP_ERRORS_TTX_OVERTIME_ERROR	UINT32_C(0x800)
5284 	/* unused2 is 16 b */
5285 	uint16_t	unused_2;
5286 	/*
5287 	 * This is bits [31:0] of the nanoseconds portion of the packet
5288 	 * timestamp, returned from PM for 2-step PTP timestamp or from
5289 	 * PA for PA timestamps. This field is in units of ns.
5290 	 */
5291 	uint32_t	ts_ns_lo;
5292 } tx_cmpl_packet_timestamp_t, *ptx_cmpl_packet_timestamp_t;
5293 
5294 /* rx_pkt_cmpl (size:128b/16B) */
5295 
5296 typedef struct rx_pkt_cmpl {
5297 	uint16_t	flags_type;
5298 	/*
5299 	 * This field indicates the exact type of the completion.
5300 	 * By convention, the LSB identifies the length of the
5301 	 * record in 16B units. Even values indicate 16B
5302 	 * records. Odd values indicate 32B
5303 	 * records.
5304 	 */
5305 	#define RX_PKT_CMPL_TYPE_MASK			UINT32_C(0x3f)
5306 	#define RX_PKT_CMPL_TYPE_SFT			0
5307 	/*
5308 	 * RX L2 completion:
5309 	 * Completion of and L2 RX packet. Length = 32B
5310 	 */
5311 		#define RX_PKT_CMPL_TYPE_RX_L2			UINT32_C(0x11)
5312 		#define RX_PKT_CMPL_TYPE_LAST			RX_PKT_CMPL_TYPE_RX_L2
5313 	#define RX_PKT_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
5314 	#define RX_PKT_CMPL_FLAGS_SFT			6
5315 	/*
5316 	 * When this bit is '1', it indicates a packet that has an
5317 	 * error of some type. Type of error is indicated in
5318 	 * error_flags.
5319 	 */
5320 	#define RX_PKT_CMPL_FLAGS_ERROR			UINT32_C(0x40)
5321 	/* This field indicates how the packet was placed in the buffer. */
5322 	#define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
5323 	#define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT		7
5324 	/*
5325 	 * Normal:
5326 	 * Packet was placed using normal algorithm.
5327 	 */
5328 		#define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL		(UINT32_C(0x0) << 7)
5329 	/*
5330 	 * Jumbo:
5331 	 * Packet was placed using jumbo algorithm.
5332 	 */
5333 		#define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
5334 	/*
5335 	 * Header/Data Separation:
5336 	 * Packet was placed using Header/Data separation algorithm.
5337 	 * The separation location is indicated by the itype field.
5338 	 */
5339 		#define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
5340 		#define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST		RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
5341 	/* This bit is '1' if the RSS field in this completion is valid. */
5342 	#define RX_PKT_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
5343 	/*
5344 	 * This bit is '1' if metadata has been added to the end of the
5345 	 * packet in host memory.
5346 	 */
5347 	#define RX_PKT_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
5348 	/*
5349 	 * This value indicates what the inner packet determined for the
5350 	 * packet was.
5351 	 */
5352 	#define RX_PKT_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
5353 	#define RX_PKT_CMPL_FLAGS_ITYPE_SFT		12
5354 	/*
5355 	 * Not Known:
5356 	 * Indicates that the packet type was not known.
5357 	 */
5358 		#define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN		(UINT32_C(0x0) << 12)
5359 	/*
5360 	 * IP Packet:
5361 	 * Indicates that the packet was an IP packet, but further
5362 	 * classification was not possible.
5363 	 */
5364 		#define RX_PKT_CMPL_FLAGS_ITYPE_IP			(UINT32_C(0x1) << 12)
5365 	/*
5366 	 * TCP Packet:
5367 	 * Indicates that the packet was IP and TCP.
5368 	 * This indicates that the payload_offset field is valid.
5369 	 */
5370 		#define RX_PKT_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
5371 	/*
5372 	 * UDP Packet:
5373 	 * Indicates that the packet was IP and UDP.
5374 	 * This indicates that the payload_offset field is valid.
5375 	 */
5376 		#define RX_PKT_CMPL_FLAGS_ITYPE_UDP		(UINT32_C(0x3) << 12)
5377 	/*
5378 	 * FCoE Packet:
5379 	 * Indicates that the packet was recognized as a FCoE.
5380 	 * This also indicates that the payload_offset field is valid.
5381 	 */
5382 		#define RX_PKT_CMPL_FLAGS_ITYPE_FCOE		(UINT32_C(0x4) << 12)
5383 	/*
5384 	 * RoCE Packet:
5385 	 * Indicates that the packet was recognized as a RoCE.
5386 	 * This also indicates that the payload_offset field is valid.
5387 	 */
5388 		#define RX_PKT_CMPL_FLAGS_ITYPE_ROCE		(UINT32_C(0x5) << 12)
5389 	/*
5390 	 * ICMP Packet:
5391 	 * Indicates that the packet was recognized as ICMP.
5392 	 * This indicates that the payload_offset field is valid.
5393 	 */
5394 		#define RX_PKT_CMPL_FLAGS_ITYPE_ICMP		(UINT32_C(0x7) << 12)
5395 	/*
5396 	 * PTP packet wo/timestamp:
5397 	 * Indicates that the packet was recognized as a PTP
5398 	 * packet.
5399 	 */
5400 		#define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP	(UINT32_C(0x8) << 12)
5401 	/*
5402 	 * PTP packet w/timestamp:
5403 	 * Indicates that the packet was recognized as a PTP
5404 	 * packet and that a timestamp was taken for the packet.
5405 	 */
5406 		#define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 12)
5407 		#define RX_PKT_CMPL_FLAGS_ITYPE_LAST		RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
5408 	/*
5409 	 * This is the length of the data for the packet stored in the
5410 	 * buffer(s) identified by the opaque value. This includes
5411 	 * the packet BD and any associated buffer BDs. This does not include
5412 	 * the length of any data places in aggregation BDs.
5413 	 */
5414 	uint16_t	len;
5415 	/*
5416 	 * This is a copy of the opaque field from the RX BD this completion
5417 	 * corresponds to.
5418 	 */
5419 	uint32_t	opaque;
5420 	uint8_t	agg_bufs_v1;
5421 	/*
5422 	 * This value is written by the NIC such that it will be different
5423 	 * for each pass through the completion queue. The even passes
5424 	 * will write 1. The odd passes will write 0.
5425 	 */
5426 	#define RX_PKT_CMPL_V1	UINT32_C(0x1)
5427 	/*
5428 	 * This value is the number of aggregation buffers that follow this
5429 	 * entry in the completion ring that are a part of this packet.
5430 	 * If the value is zero, then the packet is completely contained
5431 	 * in the buffer space provided for the packet in the RX ring.
5432 	 */
5433 	#define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
5434 	#define RX_PKT_CMPL_AGG_BUFS_SFT 1
5435 	/* unused1 is 2 b */
5436 	#define RX_PKT_CMPL_UNUSED1_MASK UINT32_C(0xc0)
5437 	#define RX_PKT_CMPL_UNUSED1_SFT  6
5438 	/*
5439 	 * This is the RSS hash type for the packet. The value is packed
5440 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
5441 	 * The value of tuple_extrac_op provides the information about
5442 	 * what fields the hash was computed on.
5443 	 * Note that 4-tuples values listed below are applicable
5444 	 * for layer 4 protocols supported and enabled for RSS in the hardware,
5445 	 * HWRM firmware, and drivers. For example, if RSS hash is supported and
5446 	 * enabled for TCP traffic only, then the values of tuple_extract_op
5447 	 * corresponding to 4-tuples are only valid for TCP traffic.
5448 	 */
5449 	uint8_t	rss_hash_type;
5450 	/*
5451 	 * The RSS hash was computed over source IP address,
5452 	 * destination IP address, source port, and destination port of inner
5453 	 * IP and TCP or UDP headers. Note: For non-tunneled packets,
5454 	 * the packet headers are considered inner packet headers for the RSS
5455 	 * hash computation purpose.
5456 	 */
5457 	#define RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_0 UINT32_C(0x0)
5458 	/*
5459 	 * The RSS hash was computed over source IP address and destination
5460 	 * IP address of inner IP header. Note: For non-tunneled packets,
5461 	 * the packet headers are considered inner packet headers for the RSS
5462 	 * hash computation purpose.
5463 	 */
5464 	#define RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_1 UINT32_C(0x1)
5465 	/*
5466 	 * The RSS hash was computed over source IP address,
5467 	 * destination IP address, source port, and destination port of
5468 	 * IP and TCP or UDP headers of outer tunnel headers.
5469 	 * Note: For non-tunneled packets, this value is not applicable.
5470 	 */
5471 	#define RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_2 UINT32_C(0x2)
5472 	/*
5473 	 * The RSS hash was computed over source IP address and
5474 	 * destination IP address of IP header of outer tunnel headers.
5475 	 * Note: For non-tunneled packets, this value is not applicable.
5476 	 */
5477 	#define RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_3 UINT32_C(0x3)
5478 	#define RX_PKT_CMPL_RSS_HASH_TYPE_LAST  RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_3
5479 	/*
5480 	 * This value indicates the offset in bytes from the beginning of the
5481 	 * packet where the inner payload starts. This value is valid for TCP,
5482 	 * UDP, FCoE, and RoCE packets.
5483 	 *
5484 	 * A value of zero indicates that header is 256B into the packet.
5485 	 */
5486 	uint8_t	payload_offset;
5487 	/* unused2 is 8 b */
5488 	uint8_t	unused1;
5489 	/*
5490 	 * This value is the RSS hash value calculated for the packet
5491 	 * based on the mode bits and key value in the VNIC.
5492 	 */
5493 	uint32_t	rss_hash;
5494 } rx_pkt_cmpl_t, *prx_pkt_cmpl_t;
5495 
5496 /* Last 16 bytes of rx_pkt_cmpl. */
5497 /* rx_pkt_cmpl_hi (size:128b/16B) */
5498 
5499 typedef struct rx_pkt_cmpl_hi {
5500 	uint32_t	flags2;
5501 	/*
5502 	 * This indicates that the ip checksum was calculated for the
5503 	 * inner packet and that the ip_cs_error field indicates if there
5504 	 * was an error.
5505 	 */
5506 	#define RX_PKT_CMPL_FLAGS2_IP_CS_CALC		UINT32_C(0x1)
5507 	/*
5508 	 * This indicates that the TCP, UDP or ICMP checksum was
5509 	 * calculated for the inner packet and that the l4_cs_error field
5510 	 * indicates if there was an error.
5511 	 */
5512 	#define RX_PKT_CMPL_FLAGS2_L4_CS_CALC		UINT32_C(0x2)
5513 	/*
5514 	 * This indicates that the ip checksum was calculated for the
5515 	 * tunnel header and that the t_ip_cs_error field indicates if there
5516 	 * was an error.
5517 	 */
5518 	#define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC		UINT32_C(0x4)
5519 	/*
5520 	 * This indicates that the UDP checksum was
5521 	 * calculated for the tunnel packet and that the t_l4_cs_error field
5522 	 * indicates if there was an error.
5523 	 */
5524 	#define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC		UINT32_C(0x8)
5525 	/* This value indicates what format the metadata field is. */
5526 	#define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
5527 	#define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT		4
5528 	/* No metadata information. Value is zero. */
5529 		#define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
5530 	/*
5531 	 * The metadata field contains the VLAN tag and TPID value.
5532 	 * - metadata[11:0] contains the vlan VID value.
5533 	 * - metadata[12] contains the vlan DE value.
5534 	 * - metadata[15:13] contains the vlan PRI value.
5535 	 * - metadata[31:16] contains the vlan TPID value.
5536 	 */
5537 		#define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN		(UINT32_C(0x1) << 4)
5538 	/*
5539 	 * If ext_meta_format is equal to 1, the metadata field
5540 	 * contains the lower 16b of the tunnel ID value, justified
5541 	 * to LSB
5542 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
5543 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
5544 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
5545 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
5546 	 * - IPV4 = 0 (not populated)
5547 	 * - IPV6 = Flow Label[19:0]
5548 	 * - PPPoE = sessionID[15:0]
5549 	 * - MPLs = Outer label[19:0]
5550 	 * - UPAR = Selected[31:0] with bit mask
5551 	 */
5552 		#define RX_PKT_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
5553 	/*
5554 	 * if ext_meta_format is equal to 1, metadata field contains
5555 	 * 16b metadata from the prepended header (chdr_data).
5556 	 */
5557 		#define RX_PKT_CMPL_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
5558 	/*
5559 	 * If ext_meta_format is equal to 1, the metadata field contains
5560 	 * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
5561 	 * inner_l4_size.
5562 	 * - metadata[8:0] contains the outer_l3_offset.
5563 	 * - metadata[17:9] contains the inner_l2_offset.
5564 	 * - metadata[26:18] contains the inner_l3_offset.
5565 	 * - metadata[31:27] contains the inner_l4_size.
5566 	 */
5567 		#define RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
5568 		#define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST		RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
5569 	/*
5570 	 * This field indicates the IP type for the inner-most IP header.
5571 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
5572 	 * This value is only valid if itype indicates a packet
5573 	 * with an IP header.
5574 	 */
5575 	#define RX_PKT_CMPL_FLAGS2_IP_TYPE			UINT32_C(0x100)
5576 	/*
5577 	 * This indicates that the complete 1's complement checksum was
5578 	 * calculated for the packet.
5579 	 */
5580 	#define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
5581 	/*
5582 	 * The combination of this value and meta_format indicated what
5583 	 * format the metadata field is.
5584 	 */
5585 	#define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_MASK	UINT32_C(0xc00)
5586 	#define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_SFT	10
5587 	/*
5588 	 * This value is the complete 1's complement checksum calculated from
5589 	 * the start of the outer L3 header to the end of the packet (not
5590 	 * including the ethernet crc). It is valid when the
5591 	 * 'complete_checksum_calc' flag is set.
5592 	 */
5593 	#define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
5594 	#define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT	16
5595 	/*
5596 	 * This is data from the CFA block as indicated by the meta_format
5597 	 * field.
5598 	 */
5599 	uint32_t	metadata;
5600 	/* When meta_format=1, this value is the VLAN VID. */
5601 	#define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
5602 	#define RX_PKT_CMPL_METADATA_VID_SFT  0
5603 	/* When meta_format=1, this value is the VLAN DE. */
5604 	#define RX_PKT_CMPL_METADATA_DE	UINT32_C(0x1000)
5605 	/* When meta_format=1, this value is the VLAN PRI. */
5606 	#define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
5607 	#define RX_PKT_CMPL_METADATA_PRI_SFT  13
5608 	/* When meta_format=1, this value is the VLAN TPID. */
5609 	#define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
5610 	#define RX_PKT_CMPL_METADATA_TPID_SFT 16
5611 	uint16_t	errors_v2;
5612 	/*
5613 	 * This value is written by the NIC such that it will be different
5614 	 * for each pass through the completion queue. The even passes
5615 	 * will write 1. The odd passes will write 0.
5616 	 */
5617 	#define RX_PKT_CMPL_V2					UINT32_C(0x1)
5618 	#define RX_PKT_CMPL_ERRORS_MASK				UINT32_C(0xfffe)
5619 	#define RX_PKT_CMPL_ERRORS_SFT				1
5620 	/*
5621 	 * This error indicates that there was some sort of problem with
5622 	 * the BDs for the packet that was found after part of the
5623 	 * packet was already placed. The packet should be treated as
5624 	 * invalid.
5625 	 */
5626 	#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
5627 	#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT		1
5628 	/* No buffer error */
5629 		#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER		(UINT32_C(0x0) << 1)
5630 	/*
5631 	 * Did Not Fit:
5632 	 * Packet did not fit into packet buffer provided.
5633 	 * For regular placement, this means the packet did not fit
5634 	 * in the buffer provided. For HDS and jumbo placement, this
5635 	 * means that the packet could not be placed into 7 physical
5636 	 * buffers or less.
5637 	 */
5638 		#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT		(UINT32_C(0x1) << 1)
5639 	/*
5640 	 * Not On Chip:
5641 	 * All BDs needed for the packet were not on-chip when
5642 	 * the packet arrived.
5643 	 */
5644 		#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP		(UINT32_C(0x2) << 1)
5645 	/*
5646 	 * Bad Format:
5647 	 * BDs were not formatted correctly.
5648 	 */
5649 		#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT		(UINT32_C(0x3) << 1)
5650 	/*
5651 	 * Flush:
5652 	 * There was a bad_format error on the previous operation
5653 	 */
5654 		#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH		(UINT32_C(0x5) << 1)
5655 		#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST		RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
5656 	/*
5657 	 * This indicates that there was an error in the IP header
5658 	 * checksum.
5659 	 */
5660 	#define RX_PKT_CMPL_ERRORS_IP_CS_ERROR			UINT32_C(0x10)
5661 	/*
5662 	 * This indicates that there was an error in the TCP, UDP
5663 	 * or ICMP checksum.
5664 	 */
5665 	#define RX_PKT_CMPL_ERRORS_L4_CS_ERROR			UINT32_C(0x20)
5666 	/*
5667 	 * This indicates that there was an error in the tunnel
5668 	 * IP header checksum.
5669 	 */
5670 	#define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR			UINT32_C(0x40)
5671 	/*
5672 	 * This indicates that there was an error in the tunnel
5673 	 * UDP checksum.
5674 	 */
5675 	#define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR			UINT32_C(0x80)
5676 	/*
5677 	 * This indicates that there was a CRC error on either an FCoE
5678 	 * or RoCE packet. The itype indicates the packet type.
5679 	 */
5680 	#define RX_PKT_CMPL_ERRORS_CRC_ERROR			UINT32_C(0x100)
5681 	/*
5682 	 * This indicates that there was an error in the tunnel
5683 	 * portion of the packet when this
5684 	 * field is non-zero.
5685 	 */
5686 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe00)
5687 	#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT			9
5688 	/*
5689 	 * No additional error occurred on the tunnel portion
5690 	 * or the packet of the packet does not have a tunnel.
5691 	 */
5692 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 9)
5693 	/*
5694 	 * Indicates that IP header version does not match
5695 	 * expectation from L2 Ethertype for IPv4 and IPv6
5696 	 * in the tunnel header.
5697 	 */
5698 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 9)
5699 	/*
5700 	 * Indicates that header length is out of range in the
5701 	 * tunnel header. Valid for
5702 	 * IPv4.
5703 	 */
5704 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 9)
5705 	/*
5706 	 * Indicates that the physical packet is shorter than that
5707 	 * claimed by the PPPoE header length for a tunnel PPPoE
5708 	 * packet.
5709 	 */
5710 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR	(UINT32_C(0x3) << 9)
5711 	/*
5712 	 * Indicates that physical packet is shorter than that claimed
5713 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6
5714 	 * tunnel packet packets.
5715 	 */
5716 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x4) << 9)
5717 	/*
5718 	 * Indicates that the physical packet is shorter than that
5719 	 * claimed by the tunnel UDP header length for a tunnel
5720 	 * UDP packet that is not fragmented.
5721 	 */
5722 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x5) << 9)
5723 	/*
5724 	 * indicates that the IPv4 TTL or IPv6 hop limit check
5725 	 * have failed (e.g. TTL = 0) in the tunnel header. Valid
5726 	 * for IPv4, and IPv6.
5727 	 */
5728 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x6) << 9)
5729 		#define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST			RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
5730 	/*
5731 	 * This indicates that there was an error in the inner
5732 	 * portion of the packet when this
5733 	 * field is non-zero.
5734 	 */
5735 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK			UINT32_C(0xf000)
5736 	#define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT			12
5737 	/*
5738 	 * No additional error occurred on the tunnel portion
5739 	 * or the packet of the packet does not have a tunnel.
5740 	 */
5741 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 12)
5742 	/*
5743 	 * Indicates that IP header version does not match
5744 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
5745 	 * option other than VFT was parsed on
5746 	 * FCoE packet.
5747 	 */
5748 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 12)
5749 	/*
5750 	 * indicates that header length is out of range. Valid for
5751 	 * IPv4 and RoCE
5752 	 */
5753 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 12)
5754 	/*
5755 	 * indicates that the IPv4 TTL or IPv6 hop limit check
5756 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
5757 	 */
5758 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 12)
5759 	/*
5760 	 * Indicates that physical packet is shorter than that
5761 	 * claimed by the l3 header length. Valid for IPv4,
5762 	 * IPv6 packet or RoCE packets.
5763 	 */
5764 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 12)
5765 	/*
5766 	 * Indicates that the physical packet is shorter than that
5767 	 * claimed by the UDP header length for a UDP packet that is
5768 	 * not fragmented.
5769 	 */
5770 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR		(UINT32_C(0x5) << 12)
5771 	/*
5772 	 * Indicates that TCP header length > IP payload. Valid for
5773 	 * TCP packets only.
5774 	 */
5775 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 12)
5776 	/* Indicates that TCP header length < 5. Valid for TCP. */
5777 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL   (UINT32_C(0x7) << 12)
5778 	/*
5779 	 * Indicates that TCP option headers result in a TCP header
5780 	 * size that does not match data offset in TCP header. Valid
5781 	 * for TCP.
5782 	 */
5783 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 12)
5784 		#define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST			RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
5785 	/*
5786 	 * This field identifies the CFA action rule that was used for this
5787 	 * packet.
5788 	 */
5789 	uint16_t	cfa_code;
5790 	uint32_t	reorder;
5791 	/*
5792 	 * This value holds the reordering sequence number for the packet.
5793 	 * If the reordering sequence is not valid, then this value is zero.
5794 	 * The reordering domain for the packet is in the bottom 8 to 10b of
5795 	 * the rss_hash value. The bottom 20b of this value contain the
5796 	 * ordering domain value for the packet.
5797 	 */
5798 	#define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
5799 	#define RX_PKT_CMPL_REORDER_SFT 0
5800 } rx_pkt_cmpl_hi_t, *prx_pkt_cmpl_hi_t;
5801 
5802 /* rx_pkt_v2_cmpl (size:128b/16B) */
5803 
5804 typedef struct rx_pkt_v2_cmpl {
5805 	uint16_t	flags_type;
5806 	/*
5807 	 * This field indicates the exact type of the completion.
5808 	 * By convention, the LSB identifies the length of the
5809 	 * record in 16B units. Even values indicate 16B
5810 	 * records. Odd values indicate 32B
5811 	 * records.
5812 	 */
5813 	#define RX_PKT_V2_CMPL_TYPE_MASK			UINT32_C(0x3f)
5814 	#define RX_PKT_V2_CMPL_TYPE_SFT			0
5815 	/*
5816 	 * RX L2 V2 completion:
5817 	 * Completion of and L2 RX packet. Length = 32B
5818 	 * This is the new version of the RX_L2 completion used in SR2
5819 	 * and later chips.
5820 	 */
5821 		#define RX_PKT_V2_CMPL_TYPE_RX_L2_V2			UINT32_C(0xf)
5822 		#define RX_PKT_V2_CMPL_TYPE_LAST			RX_PKT_V2_CMPL_TYPE_RX_L2_V2
5823 	#define RX_PKT_V2_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
5824 	#define RX_PKT_V2_CMPL_FLAGS_SFT			6
5825 	/*
5826 	 * When this bit is '1', it indicates a packet that has an
5827 	 * error of some type. Type of error is indicated in
5828 	 * error_flags.
5829 	 */
5830 	#define RX_PKT_V2_CMPL_FLAGS_ERROR			UINT32_C(0x40)
5831 	/* This field indicates how the packet was placed in the buffer. */
5832 	#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
5833 	#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_SFT		7
5834 	/*
5835 	 * Normal:
5836 	 * Packet was placed using normal algorithm.
5837 	 */
5838 		#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_NORMAL		(UINT32_C(0x0) << 7)
5839 	/*
5840 	 * Jumbo:
5841 	 * Packet was placed using jumbo algorithm.
5842 	 */
5843 		#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
5844 	/*
5845 	 * Header/Data Separation:
5846 	 * Packet was placed using Header/Data separation algorithm.
5847 	 * The separation location is indicated by the itype field.
5848 	 */
5849 		#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
5850 	/*
5851 	 * Truncation:
5852 	 * Packet was placed using truncation algorithm. The
5853 	 * placed (truncated) length is indicated in the payload_offset
5854 	 * field. The original length is indicated in the len field.
5855 	 */
5856 		#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION	(UINT32_C(0x3) << 7)
5857 		#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_LAST		RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION
5858 	/* This bit is '1' if the RSS field in this completion is valid. */
5859 	#define RX_PKT_V2_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
5860 	/*
5861 	 * This bit is '1' if metadata has been added to the end of the
5862 	 * packet in host memory. Metadata starts at the first 32B boundary
5863 	 * after the end of the packet for regular and jumbo placement.
5864 	 * It starts at the first 32B boundary after the end of the header
5865 	 * for HDS placement. The length of the metadata is indicated in the
5866 	 * metadata itself.
5867 	 */
5868 	#define RX_PKT_V2_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
5869 	/*
5870 	 * This value indicates what the inner packet determined for the
5871 	 * packet was.
5872 	 */
5873 	#define RX_PKT_V2_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
5874 	#define RX_PKT_V2_CMPL_FLAGS_ITYPE_SFT		12
5875 	/*
5876 	 * Not Known:
5877 	 * Indicates that the packet type was not known.
5878 	 */
5879 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_NOT_KNOWN		(UINT32_C(0x0) << 12)
5880 	/*
5881 	 * IP Packet:
5882 	 * Indicates that the packet was an IP packet, but further
5883 	 * classification was not possible.
5884 	 */
5885 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_IP			(UINT32_C(0x1) << 12)
5886 	/*
5887 	 * TCP Packet:
5888 	 * Indicates that the packet was IP and TCP.
5889 	 * This indicates that the payload_offset field is valid.
5890 	 */
5891 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
5892 	/*
5893 	 * UDP Packet:
5894 	 * Indicates that the packet was IP and UDP.
5895 	 * This indicates that the payload_offset field is valid.
5896 	 */
5897 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_UDP		(UINT32_C(0x3) << 12)
5898 	/*
5899 	 * FCoE Packet:
5900 	 * Indicates that the packet was recognized as a FCoE.
5901 	 * This also indicates that the payload_offset field is valid.
5902 	 */
5903 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_FCOE		(UINT32_C(0x4) << 12)
5904 	/*
5905 	 * RoCE Packet:
5906 	 * Indicates that the packet was recognized as a RoCE.
5907 	 * This also indicates that the payload_offset field is valid.
5908 	 */
5909 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_ROCE		(UINT32_C(0x5) << 12)
5910 	/*
5911 	 * ICMP Packet:
5912 	 * Indicates that the packet was recognized as ICMP.
5913 	 * This indicates that the payload_offset field is valid.
5914 	 */
5915 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_ICMP		(UINT32_C(0x7) << 12)
5916 	/*
5917 	 * PTP packet wo/timestamp:
5918 	 * Indicates that the packet was recognized as a PTP
5919 	 * packet.
5920 	 */
5921 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP	(UINT32_C(0x8) << 12)
5922 	/*
5923 	 * PTP packet w/timestamp:
5924 	 * Indicates that the packet was recognized as a PTP
5925 	 * packet and that a timestamp was taken for the packet.
5926 	 */
5927 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 12)
5928 		#define RX_PKT_V2_CMPL_FLAGS_ITYPE_LAST		RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
5929 	/*
5930 	 * This is the length of the data for the packet stored in the
5931 	 * buffer(s) identified by the opaque value. This includes
5932 	 * the packet BD and any associated buffer BDs. This does not include
5933 	 * the length of any data places in aggregation BDs.
5934 	 */
5935 	uint16_t	len;
5936 	/*
5937 	 * This is a copy of the opaque field from the RX BD this completion
5938 	 * corresponds to.
5939 	 */
5940 	uint32_t	opaque;
5941 	uint8_t	agg_bufs_v1;
5942 	/*
5943 	 * This value is written by the NIC such that it will be different
5944 	 * for each pass through the completion queue. The even passes
5945 	 * will write 1. The odd passes will write 0.
5946 	 */
5947 	#define RX_PKT_V2_CMPL_V1	UINT32_C(0x1)
5948 	/*
5949 	 * This value is the number of aggregation buffers that follow this
5950 	 * entry in the completion ring that are a part of this packet.
5951 	 * If the value is zero, then the packet is completely contained
5952 	 * in the buffer space provided for the packet in the RX ring.
5953 	 */
5954 	#define RX_PKT_V2_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
5955 	#define RX_PKT_V2_CMPL_AGG_BUFS_SFT 1
5956 	/* unused1 is 2 b */
5957 	#define RX_PKT_V2_CMPL_UNUSED1_MASK UINT32_C(0xc0)
5958 	#define RX_PKT_V2_CMPL_UNUSED1_SFT  6
5959 	/*
5960 	 * This is the RSS hash type for the packet. The value is packed
5961 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
5962 	 * The value of tuple_extrac_op provides the information about
5963 	 * what fields the hash was computed on.
5964 	 * Note that 4-tuples values listed below are applicable
5965 	 * for layer 4 protocols supported and enabled for RSS in the hardware,
5966 	 * HWRM firmware, and drivers. For example, if RSS hash is supported and
5967 	 * enabled for TCP traffic only, then the values of tuple_extract_op
5968 	 * corresponding to 4-tuples are only valid for TCP traffic.
5969 	 */
5970 	uint8_t	rss_hash_type;
5971 	/*
5972 	 * The RSS hash was computed over source IP address,
5973 	 * destination IP address, source port, and destination port of inner
5974 	 * IP and TCP or UDP headers. Note: For non-tunneled packets,
5975 	 * the packet headers are considered inner packet headers for the RSS
5976 	 * hash computation purpose.
5977 	 */
5978 	#define RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_0 UINT32_C(0x0)
5979 	/*
5980 	 * The RSS hash was computed over source IP address and destination
5981 	 * IP address of inner IP header. Note: For non-tunneled packets,
5982 	 * the packet headers are considered inner packet headers for the RSS
5983 	 * hash computation purpose.
5984 	 */
5985 	#define RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_1 UINT32_C(0x1)
5986 	/*
5987 	 * The RSS hash was computed over source IP address,
5988 	 * destination IP address, source port, and destination port of
5989 	 * IP and TCP or UDP headers of outer tunnel headers.
5990 	 * Note: For non-tunneled packets, this value is not applicable.
5991 	 */
5992 	#define RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_2 UINT32_C(0x2)
5993 	/*
5994 	 * The RSS hash was computed over source IP address and
5995 	 * destination IP address of IP header of outer tunnel headers.
5996 	 * Note: For non-tunneled packets, this value is not applicable.
5997 	 */
5998 	#define RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_3 UINT32_C(0x3)
5999 	#define RX_PKT_V2_CMPL_RSS_HASH_TYPE_LAST  RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_3
6000 	uint16_t	metadata1_payload_offset;
6001 	/*
6002 	 * This is data from the CFA as indicated by the meta_format field.
6003 	 * If truncation placement is not used, this value indicates the offset
6004 	 * in bytes from the beginning of the packet where the inner payload
6005 	 * starts. This value is valid for TCP, UDP, FCoE, and RoCE packets. If
6006 	 * truncation placement is used, this value represents the placed
6007 	 * (truncated) length of the packet.
6008 	 */
6009 	#define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_MASK	UINT32_C(0x1ff)
6010 	#define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_SFT	0
6011 	/* This is data from the CFA as indicated by the meta_format field. */
6012 	#define RX_PKT_V2_CMPL_METADATA1_MASK		UINT32_C(0xf000)
6013 	#define RX_PKT_V2_CMPL_METADATA1_SFT		12
6014 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
6015 	#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_MASK	UINT32_C(0x7000)
6016 	#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_SFT	12
6017 	/* 0x88a8 */
6018 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 12)
6019 	/* 0x8100 */
6020 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 12)
6021 	/* 0x9100 */
6022 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 12)
6023 	/* 0x9200 */
6024 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 12)
6025 	/* 0x9300 */
6026 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 12)
6027 	/* Value programmed in CFA VLANTPID register. */
6028 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 12)
6029 		#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_LAST	RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG
6030 	/* When meta_format != 0, this value is the VLAN valid. */
6031 	#define RX_PKT_V2_CMPL_METADATA1_VALID		UINT32_C(0x8000)
6032 	/*
6033 	 * This value is the RSS hash value calculated for the packet
6034 	 * based on the mode bits and key value in the VNIC. When vee_cmpl_mode
6035 	 * is set in VNIC context, this is the lower 32b of the host address
6036 	 * from the first BD used to place the packet.
6037 	 */
6038 	uint32_t	rss_hash;
6039 } rx_pkt_v2_cmpl_t, *prx_pkt_v2_cmpl_t;
6040 
6041 /* Last 16 bytes of RX Packet V2 Completion Record */
6042 /* rx_pkt_v2_cmpl_hi (size:128b/16B) */
6043 
6044 typedef struct rx_pkt_v2_cmpl_hi {
6045 	uint32_t	flags2;
6046 	/*
6047 	 * When this bit is '0', the cs_ok field has the following definition:-
6048 	 * ip_cs_ok[2:0] = The number of header groups with a valid IP checksum
6049 	 * in the delivered packet, counted from the outer-most header group to
6050 	 * the inner-most header group, stopping at the first error. -
6051 	 * l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum
6052 	 * in the delivered packet, counted from the outer-most header group to
6053 	 * the inner-most header group, stopping at the first error. When this
6054 	 * bit is '1', the cs_ok field has the following definition: -
6055 	 * hdr_cnt[2:0] = The number of header groups that were parsed by the
6056 	 * chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit
6057 	 * will be '1' if all the parsed header groups with an IP checksum are
6058 	 * valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed
6059 	 * header groups with an L4 checksum are valid.
6060 	 */
6061 	#define RX_PKT_V2_CMPL_HI_FLAGS2_CS_ALL_OK_MODE		UINT32_C(0x8)
6062 	/* This value indicates what format the metadata field is. */
6063 	#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
6064 	#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_SFT		4
6065 	/* There is no metadata information. Values are zero. */
6066 		#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
6067 	/*
6068 	 * The {metadata1, metadata0} fields contain the vtag
6069 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
6070 	 * de, vid[11:0]} The metadata2 field contains the table scope
6071 	 * and action record pointer. - metadata2[25:0] contains the
6072 	 * action record pointer. - metadata2[31:26] contains the table
6073 	 * scope.
6074 	 */
6075 		#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_ACT_REC_PTR	(UINT32_C(0x1) << 4)
6076 	/*
6077 	 * The {metadata1, metadata0} fields contain the vtag
6078 	 * information:
6079 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
6080 	 * The metadata2 field contains the Tunnel ID
6081 	 * value, justified to LSB.
6082 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
6083 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
6084 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
6085 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
6086 	 * - IPv4 = 0 (not populated)
6087 	 * - IPv6 = Flow Label[19:0]
6088 	 * - PPPoE = sessionID[15:0]
6089 	 * - MPLs = Outer label[19:0]
6090 	 * - UPAR = Selected[31:0] with bit mask
6091 	 */
6092 		#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
6093 	/*
6094 	 * The {metadata1, metadata0} fields contain the vtag
6095 	 * information:
6096 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
6097 	 * The metadata2 field contains the 32b metadata from the prepended
6098 	 * header (chdr_data).
6099 	 */
6100 		#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
6101 	/*
6102 	 * The {metadata1, metadata0} fields contain the vtag
6103 	 * information:
6104 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
6105 	 * The metadata2 field contains the outer_l3_offset,
6106 	 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
6107 	 * - metadata2[8:0] contains the outer_l3_offset.
6108 	 * - metadata2[17:9] contains the inner_l2_offset.
6109 	 * - metadata2[26:18] contains the inner_l3_offset.
6110 	 * - metadata2[31:27] contains the inner_l4_size.
6111 	 */
6112 		#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
6113 		#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_LAST		RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET
6114 	/*
6115 	 * This field indicates the IP type for the inner-most IP header.
6116 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
6117 	 * This value is only valid if itype indicates a packet
6118 	 * with an IP header.
6119 	 */
6120 	#define RX_PKT_V2_CMPL_HI_FLAGS2_IP_TYPE			UINT32_C(0x100)
6121 	/*
6122 	 * This indicates that the complete 1's complement checksum was
6123 	 * calculated for the packet.
6124 	 */
6125 	#define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
6126 	/*
6127 	 * This field indicates the status of IP and L4 CS calculations done
6128 	 * by the chip. The format of this field is indicated by the
6129 	 * cs_all_ok_mode bit.
6130 	 */
6131 	#define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_MASK		UINT32_C(0xfc00)
6132 	#define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_SFT		10
6133 	/*
6134 	 * This value is the complete 1's complement checksum calculated from
6135 	 * the start of the outer L3 header to the end of the packet (not
6136 	 * including the ethernet crc). It is valid when the
6137 	 * 'complete_checksum_calc' flag is set.
6138 	 */
6139 	#define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
6140 	#define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_SFT	16
6141 	/*
6142 	 * This is data from the CFA block as indicated by the meta_format
6143 	 * field.
6144 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
6145 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
6146 	 *   act_rec_ptr[25:0]}
6147 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
6148 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
6149 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
6150 	 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
6151 	 * of the host address from the first BD used to place the packet.
6152 	 */
6153 	uint32_t	metadata2;
6154 	uint16_t	errors_v2;
6155 	/*
6156 	 * This value is written by the NIC such that it will be different
6157 	 * for each pass through the completion queue. The even passes
6158 	 * will write 1. The odd passes will write 0.
6159 	 */
6160 	#define RX_PKT_V2_CMPL_HI_V2					UINT32_C(0x1)
6161 	#define RX_PKT_V2_CMPL_HI_ERRORS_MASK				UINT32_C(0xfffe)
6162 	#define RX_PKT_V2_CMPL_HI_ERRORS_SFT				1
6163 	/*
6164 	 * This error indicates that there was some sort of problem with
6165 	 * the BDs for the packet that was found after part of the
6166 	 * packet was already placed. The packet should be treated as
6167 	 * invalid.
6168 	 */
6169 	#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
6170 	#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_SFT		1
6171 	/* No buffer error */
6172 		#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NO_BUFFER		(UINT32_C(0x0) << 1)
6173 	/*
6174 	 * Did Not Fit: Packet did not fit into packet buffer provided.
6175 	 * For regular placement, this means the packet did not fit in
6176 	 * the buffer provided. For HDS and jumbo placement, this means
6177 	 * that the packet could not be placed into 8 physical buffers
6178 	 * (if fixed-size buffers are used), or that the packet could
6179 	 * not be placed in the number of physical buffers configured
6180 	 * for the VNIC (if variable-size buffers are used)
6181 	 */
6182 		#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_DID_NOT_FIT		(UINT32_C(0x1) << 1)
6183 	/*
6184 	 * Not On Chip: All BDs needed for the packet were not on-chip
6185 	 * when the packet arrived. For regular placement, this error is
6186 	 * not valid. For HDS and jumbo placement, this means that not
6187 	 * enough agg BDs were posted to place the packet.
6188 	 */
6189 		#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NOT_ON_CHIP		(UINT32_C(0x2) << 1)
6190 	/*
6191 	 * Bad Format:
6192 	 * BDs were not formatted correctly.
6193 	 */
6194 		#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_BAD_FORMAT		(UINT32_C(0x3) << 1)
6195 	/*
6196 	 * Flush:
6197 	 * There was a bad_format error on the previous operation
6198 	 */
6199 		#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH		(UINT32_C(0x5) << 1)
6200 		#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_LAST		RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH
6201 	/*
6202 	 * This indicates that there was an error in the outer tunnel
6203 	 * portion of the packet when this field is non-zero.
6204 	 */
6205 	#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_MASK		UINT32_C(0x70)
6206 	#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_SFT		4
6207 	/*
6208 	 * No additional error occurred on the outer tunnel portion
6209 	 * of the packet or the packet does not have a outer tunnel.
6210 	 */
6211 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 4)
6212 	/*
6213 	 * Indicates that IP header version does not match expectation
6214 	 * from L2 Ethertype for IPv4 and IPv6 in the outer tunnel header.
6215 	 */
6216 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_VERSION	(UINT32_C(0x1) << 4)
6217 	/*
6218 	 * Indicates that header length is out of range in the outer
6219 	 * tunnel header. Valid for IPv4.
6220 	 */
6221 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 4)
6222 	/*
6223 	 * Indicates that physical packet is shorter than that claimed
6224 	 * by the outer tunnel l3 header length. Valid for IPv4, or
6225 	 * IPv6 outer tunnel packets.
6226 	 */
6227 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_TOTAL_ERROR	(UINT32_C(0x3) << 4)
6228 	/*
6229 	 * Indicates that the physical packet is shorter than that
6230 	 * claimed by the outer tunnel UDP header length for a outer
6231 	 * tunnel UDP packet that is not fragmented.
6232 	 */
6233 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_UDP_TOTAL_ERROR	(UINT32_C(0x4) << 4)
6234 	/*
6235 	 * Indicates that the IPv4 TTL or IPv6 hop limit check have
6236 	 * failed (e.g. TTL = 0) in the outer tunnel header. Valid for
6237 	 * IPv4, and IPv6.
6238 	 */
6239 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_TTL	(UINT32_C(0x5) << 4)
6240 	/*
6241 	 * Indicates that the IP checksum failed its check in the outer
6242 	 * tunnel header.
6243 	 */
6244 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_CS_ERROR	(UINT32_C(0x6) << 4)
6245 	/*
6246 	 * Indicates that the L4 checksum failed its check in the outer
6247 	 * tunnel header.
6248 	 */
6249 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR	(UINT32_C(0x7) << 4)
6250 		#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_LAST		RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR
6251 	/*
6252 	 * This indicates that there was a CRC error on either an FCoE
6253 	 * or RoCE packet. The itype indicates the packet type.
6254 	 */
6255 	#define RX_PKT_V2_CMPL_HI_ERRORS_CRC_ERROR			UINT32_C(0x100)
6256 	/*
6257 	 * This indicates that there was an error in the tunnel portion
6258 	 * of the packet when this field is non-zero.
6259 	 */
6260 	#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe00)
6261 	#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_SFT			9
6262 	/*
6263 	 * No additional error occurred on the tunnel portion
6264 	 * of the packet or the packet does not have a tunnel.
6265 	 */
6266 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 9)
6267 	/*
6268 	 * Indicates that IP header version does not match expectation
6269 	 * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
6270 	 */
6271 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 9)
6272 	/*
6273 	 * Indicates that header length is out of range in the tunnel
6274 	 * header. Valid for IPv4.
6275 	 */
6276 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 9)
6277 	/*
6278 	 * Indicates that physical packet is shorter than that claimed
6279 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel
6280 	 * packet packets.
6281 	 */
6282 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x3) << 9)
6283 	/*
6284 	 * Indicates that the physical packet is shorter than that claimed
6285 	 * by the tunnel UDP header length for a tunnel UDP packet that is
6286 	 * not fragmented.
6287 	 */
6288 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x4) << 9)
6289 	/*
6290 	 * Indicates that the IPv4 TTL or IPv6 hop limit check have failed
6291 	 * (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6.
6292 	 */
6293 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x5) << 9)
6294 	/*
6295 	 * Indicates that the IP checksum failed its check in the tunnel
6296 	 * header.
6297 	 */
6298 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_CS_ERROR		(UINT32_C(0x6) << 9)
6299 	/*
6300 	 * Indicates that the L4 checksum failed its check in the tunnel
6301 	 * header.
6302 	 */
6303 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR		(UINT32_C(0x7) << 9)
6304 		#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_LAST			RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR
6305 	/*
6306 	 * This indicates that there was an error in the inner
6307 	 * portion of the packet when this
6308 	 * field is non-zero.
6309 	 */
6310 	#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_MASK			UINT32_C(0xf000)
6311 	#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_SFT			12
6312 	/*
6313 	 * No additional error occurred on the tunnel portion
6314 	 * or the packet of the packet does not have a tunnel.
6315 	 */
6316 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 12)
6317 	/*
6318 	 * Indicates that IP header version does not match
6319 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
6320 	 * option other than VFT was parsed on
6321 	 * FCoE packet.
6322 	 */
6323 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 12)
6324 	/*
6325 	 * indicates that header length is out of range. Valid for
6326 	 * IPv4 and RoCE
6327 	 */
6328 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 12)
6329 	/*
6330 	 * indicates that the IPv4 TTL or IPv6 hop limit check
6331 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
6332 	 */
6333 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 12)
6334 	/*
6335 	 * Indicates that physical packet is shorter than that
6336 	 * claimed by the l3 header length. Valid for IPv4,
6337 	 * IPv6 packet or RoCE packets.
6338 	 */
6339 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 12)
6340 	/*
6341 	 * Indicates that the physical packet is shorter than that
6342 	 * claimed by the UDP header length for a UDP packet that is
6343 	 * not fragmented.
6344 	 */
6345 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR		(UINT32_C(0x5) << 12)
6346 	/*
6347 	 * Indicates that TCP header length > IP payload. Valid for
6348 	 * TCP packets only.
6349 	 */
6350 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 12)
6351 	/* Indicates that TCP header length < 5. Valid for TCP. */
6352 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL   (UINT32_C(0x7) << 12)
6353 	/*
6354 	 * Indicates that TCP option headers result in a TCP header
6355 	 * size that does not match data offset in TCP header. Valid
6356 	 * for TCP.
6357 	 */
6358 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 12)
6359 	/*
6360 	 * Indicates that the IP checksum failed its check in the
6361 	 * inner header.
6362 	 */
6363 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_CS_ERROR		(UINT32_C(0x9) << 12)
6364 	/*
6365 	 * Indicates that the L4 checksum failed its check in the
6366 	 * inner header.
6367 	 */
6368 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR		(UINT32_C(0xa) << 12)
6369 		#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_LAST			RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR
6370 	/*
6371 	 * This is data from the CFA block as indicated by the meta_format
6372 	 * field.
6373 	 */
6374 	uint16_t	metadata0;
6375 	/* When meta_format=1, this value is the VLAN VID. */
6376 	#define RX_PKT_V2_CMPL_HI_METADATA0_VID_MASK UINT32_C(0xfff)
6377 	#define RX_PKT_V2_CMPL_HI_METADATA0_VID_SFT 0
6378 	/* When meta_format=1, this value is the VLAN DE. */
6379 	#define RX_PKT_V2_CMPL_HI_METADATA0_DE	UINT32_C(0x1000)
6380 	/* When meta_format=1, this value is the VLAN PRI. */
6381 	#define RX_PKT_V2_CMPL_HI_METADATA0_PRI_MASK UINT32_C(0xe000)
6382 	#define RX_PKT_V2_CMPL_HI_METADATA0_PRI_SFT 13
6383 	/*
6384 	 * The timestamp field contains the 32b timestamp for the packet from
6385 	 * the MAC.
6386 	 */
6387 	uint32_t	timestamp;
6388 } rx_pkt_v2_cmpl_hi_t, *prx_pkt_v2_cmpl_hi_t;
6389 
6390 /* rx_pkt_v3_cmpl (size:128b/16B) */
6391 
6392 typedef struct rx_pkt_v3_cmpl {
6393 	uint16_t	flags_type;
6394 	/*
6395 	 * This field indicates the exact type of the completion.
6396 	 * By convention, the LSB identifies the length of the
6397 	 * record in 16B units. Even values indicate 16B
6398 	 * records. Odd values indicate 32B
6399 	 * records.
6400 	 */
6401 	#define RX_PKT_V3_CMPL_TYPE_MASK			UINT32_C(0x3f)
6402 	#define RX_PKT_V3_CMPL_TYPE_SFT			0
6403 	/*
6404 	 * RX L2 V3 completion:
6405 	 * Completion of and L2 RX packet. Length = 32B
6406 	 * This is the new version of the RX_L2 completion used in Thor2
6407 	 * and later chips.
6408 	 */
6409 		#define RX_PKT_V3_CMPL_TYPE_RX_L2_V3			UINT32_C(0x17)
6410 		#define RX_PKT_V3_CMPL_TYPE_LAST			RX_PKT_V3_CMPL_TYPE_RX_L2_V3
6411 	#define RX_PKT_V3_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
6412 	#define RX_PKT_V3_CMPL_FLAGS_SFT			6
6413 	/*
6414 	 * When this bit is '1', it indicates a packet that has an
6415 	 * error of some type. Type of error is indicated in
6416 	 * error_flags.
6417 	 */
6418 	#define RX_PKT_V3_CMPL_FLAGS_ERROR			UINT32_C(0x40)
6419 	/* This field indicates how the packet was placed in the buffer. */
6420 	#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
6421 	#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_SFT		7
6422 	/*
6423 	 * Normal:
6424 	 * Packet was placed using normal algorithm.
6425 	 */
6426 		#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_NORMAL		(UINT32_C(0x0) << 7)
6427 	/*
6428 	 * Jumbo:
6429 	 * Packet was placed using jumbo algorithm.
6430 	 */
6431 		#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
6432 	/*
6433 	 * Header/Data Separation:
6434 	 * Packet was placed using Header/Data separation algorithm.
6435 	 * The separation location is indicated by the itype field.
6436 	 */
6437 		#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
6438 	/*
6439 	 * Truncation:
6440 	 * Packet was placed using truncation algorithm. The
6441 	 * placed (truncated) length is indicated in the payload_offset
6442 	 * field. The original length is indicated in the len field.
6443 	 */
6444 		#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_TRUNCATION	(UINT32_C(0x3) << 7)
6445 		#define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_LAST		RX_PKT_V3_CMPL_FLAGS_PLACEMENT_TRUNCATION
6446 	/* This bit is '1' if the RSS field in this completion is valid. */
6447 	#define RX_PKT_V3_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
6448 	/*
6449 	 * This bit is '1' if metadata has been added to the end of the
6450 	 * packet in host memory. Metadata starts at the first 32B boundary
6451 	 * after the end of the packet for regular and jumbo placement.
6452 	 * It starts at the first 32B boundary after the end of the header
6453 	 * for HDS placement. The length of the metadata is indicated in the
6454 	 * metadata itself.
6455 	 */
6456 	#define RX_PKT_V3_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
6457 	/*
6458 	 * This value indicates what the inner packet determined for the
6459 	 * packet was.
6460 	 */
6461 	#define RX_PKT_V3_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
6462 	#define RX_PKT_V3_CMPL_FLAGS_ITYPE_SFT		12
6463 	/*
6464 	 * Not Known:
6465 	 * Indicates that the packet type was not known.
6466 	 */
6467 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_NOT_KNOWN		(UINT32_C(0x0) << 12)
6468 	/*
6469 	 * IP Packet:
6470 	 * Indicates that the packet was an IP packet, but further
6471 	 * classification was not possible.
6472 	 */
6473 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_IP			(UINT32_C(0x1) << 12)
6474 	/*
6475 	 * TCP Packet:
6476 	 * Indicates that the packet was IP and TCP.
6477 	 * This indicates that the payload_offset field is valid.
6478 	 */
6479 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
6480 	/*
6481 	 * UDP Packet:
6482 	 * Indicates that the packet was IP and UDP.
6483 	 * This indicates that the payload_offset field is valid.
6484 	 */
6485 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_UDP		(UINT32_C(0x3) << 12)
6486 	/*
6487 	 * FCoE Packet:
6488 	 * Indicates that the packet was recognized as a FCoE.
6489 	 * This also indicates that the payload_offset field is valid.
6490 	 */
6491 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_FCOE		(UINT32_C(0x4) << 12)
6492 	/*
6493 	 * RoCE Packet:
6494 	 * Indicates that the packet was recognized as a RoCE.
6495 	 * This also indicates that the payload_offset field is valid.
6496 	 */
6497 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_ROCE		(UINT32_C(0x5) << 12)
6498 	/*
6499 	 * ICMP Packet:
6500 	 * Indicates that the packet was recognized as ICMP.
6501 	 * This indicates that the payload_offset field is valid.
6502 	 */
6503 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_ICMP		(UINT32_C(0x7) << 12)
6504 	/*
6505 	 * PTP packet wo/timestamp:
6506 	 * Indicates that the packet was recognized as a PTP
6507 	 * packet.
6508 	 */
6509 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP	(UINT32_C(0x8) << 12)
6510 	/*
6511 	 * PTP packet w/timestamp:
6512 	 * Indicates that the packet was recognized as a PTP
6513 	 * packet and that a timestamp was taken for the packet.
6514 	 * The 4b sub-nanosecond portion of the timestamp is in
6515 	 * the payload_offset field.
6516 	 */
6517 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 12)
6518 		#define RX_PKT_V3_CMPL_FLAGS_ITYPE_LAST		RX_PKT_V3_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
6519 	/*
6520 	 * This is the length of the data for the packet stored in the
6521 	 * buffer(s) identified by the opaque value. This includes
6522 	 * the packet BD and any associated buffer BDs. This does not include
6523 	 * the length of any data places in aggregation BDs.
6524 	 */
6525 	uint16_t	len;
6526 	/*
6527 	 * This is a copy of the opaque field from the RX BD this completion
6528 	 * corresponds to.
6529 	 */
6530 	uint32_t	opaque;
6531 	uint16_t	rss_hash_type_agg_bufs_v1;
6532 	/*
6533 	 * This value is written by the NIC such that it will be different
6534 	 * for each pass through the completion queue. The even passes
6535 	 * will write 1. The odd passes will write 0.
6536 	 */
6537 	#define RX_PKT_V3_CMPL_V1		UINT32_C(0x1)
6538 	/*
6539 	 * This value is the number of aggregation buffers that follow this
6540 	 * entry in the completion ring that are a part of this packet.
6541 	 * If the value is zero, then the packet is completely contained
6542 	 * in the buffer space provided for the packet in the RX ring.
6543 	 */
6544 	#define RX_PKT_V3_CMPL_AGG_BUFS_MASK	UINT32_C(0x3e)
6545 	#define RX_PKT_V3_CMPL_AGG_BUFS_SFT	1
6546 	/* unused1 is 1 b */
6547 	#define RX_PKT_V3_CMPL_UNUSED1		UINT32_C(0x40)
6548 	/*
6549 	 * This is the RSS hash type for the packet. The value is packed
6550 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
6551 	 * The value of tuple_extrac_op provides the information about
6552 	 * what fields the hash was computed on.
6553 	 * Note that 4-tuples values listed below are applicable
6554 	 * for layer 4 protocols supported and enabled for RSS in the
6555 	 * hardware, HWRM firmware, and drivers. For example, if RSS hash
6556 	 * is supported and enabled for TCP traffic only, then the values of
6557 	 * tuple_extract_op corresponding to 4-tuples are only valid for
6558 	 * TCP traffic.
6559 	 */
6560 	#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_MASK   UINT32_C(0xff80)
6561 	#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_SFT	7
6562 	/*
6563 	 * The RSS hash was computed over source IP address,
6564 	 * destination IP address, source port, and destination port of
6565 	 * inner IP and TCP or UDP headers.
6566 	 */
6567 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_0   (UINT32_C(0x0) << 7)
6568 	/*
6569 	 * The RSS hash was computed over source IP address and
6570 	 * destination IP address of inner IP header.
6571 	 */
6572 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_1   (UINT32_C(0x1) << 7)
6573 	/*
6574 	 * The RSS hash was computed over source IP address,
6575 	 * destination IP address, source port, and destination port of
6576 	 * IP and TCP or UDP headers of outer tunnel headers.
6577 	 * Note: For non-tunneled packets, this value is not applicable.
6578 	 */
6579 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_2   (UINT32_C(0x2) << 7)
6580 	/*
6581 	 * The RSS hash was computed over source IP address and
6582 	 * destination IP address of IP header of outer tunnel headers.
6583 	 * Note: For non-tunneled packets, this value is not applicable.
6584 	 */
6585 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_3   (UINT32_C(0x3) << 7)
6586 	/*
6587 	 * The RSS hash was computed over source IP address of the inner
6588 	 * IP header.
6589 	 */
6590 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_4   (UINT32_C(0x4) << 7)
6591 	/*
6592 	 * The RSS hash was computed over destination IP address of the
6593 	 * inner IP header.
6594 	 */
6595 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_5   (UINT32_C(0x5) << 7)
6596 	/*
6597 	 * The RSS hash was computed over source IP address of the outer
6598 	 * IP header.
6599 	 * Note: For non-tunneled packets, this value is not applicable.
6600 	 */
6601 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_6   (UINT32_C(0x6) << 7)
6602 	/*
6603 	 * The RSS hash was computed over destination IP address of the
6604 	 * outer IP header.
6605 	 * Note: For non-tunneled packets, this value is not applicable.
6606 	 */
6607 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_7   (UINT32_C(0x7) << 7)
6608 	/*
6609 	 * The RSS hash was computed over source IP address, destination
6610 	 * IP address, and flow label of the inner IP header.
6611 	 * Note: For packets without an inner IPv6 header, this value is not
6612 	 * this value is not applicable.
6613 	 */
6614 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_8   (UINT32_C(0x8) << 7)
6615 	/*
6616 	 * The RSS hash was computed over the flow label of the inner
6617 	 * IP header.
6618 	 * Note: For packets without an inner IPv6 header, this value
6619 	 * is not applicable.
6620 	 */
6621 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_9   (UINT32_C(0x9) << 7)
6622 	/*
6623 	 * The RSS hash was computed over source IP address, destination
6624 	 * IP address, and flow label of the outer IP header.
6625 	 * Note: For packets without an outer IPv6 header, this value is not
6626 	 * applicable.
6627 	 */
6628 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_10  (UINT32_C(0xa) << 7)
6629 	/*
6630 	 * The RSS hash was computed over the flow label of the outer
6631 	 * IP header.
6632 	 * Note: For packets without an outer IPv6 header, this value
6633 	 * is not applicable.
6634 	 */
6635 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_11  (UINT32_C(0xb) << 7)
6636 	/* The RSS hash was computed over tunnel context and tunnel ID field. */
6637 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_12  (UINT32_C(0xc) << 7)
6638 	/*
6639 	 * The RSS hash was computed over tunnel source IP address, tunnel
6640 	 * destination IP address, and tunnel ID field.
6641 	 */
6642 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_13  (UINT32_C(0xd) << 7)
6643 	/*
6644 	 * The RSS hash was computed over tunnel source IP address, tunnel
6645 	 * destination IP address, tunnel context, and tunnel ID field.
6646 	 */
6647 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_14  (UINT32_C(0xe) << 7)
6648 		#define RX_PKT_V3_CMPL_RSS_HASH_TYPE_LAST	RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_14
6649 	uint16_t	metadata1_payload_offset;
6650 	/*
6651 	 * If truncation placement is not used, this value indicates the offset
6652 	 * in bytes from the beginning of the packet where the inner payload
6653 	 * starts. This value is valid for TCP, UDP, FCoE, and RoCE packets.
6654 	 * For PTP packets with timestamp (as indicated by the flags_itype
6655 	 * field), this field contains the 4b sub-nanosecond portion of the
6656 	 * timestamp.
6657 	 *
6658 	 * If truncation placement is used, this value represents the placed
6659 	 * (truncated) length of the packet.
6660 	 */
6661 	#define RX_PKT_V3_CMPL_PAYLOAD_OFFSET_MASK	UINT32_C(0x1ff)
6662 	#define RX_PKT_V3_CMPL_PAYLOAD_OFFSET_SFT	0
6663 	/* This is data from the CFA as indicated by the meta_format field. */
6664 	#define RX_PKT_V3_CMPL_METADATA1_MASK		UINT32_C(0xf000)
6665 	#define RX_PKT_V3_CMPL_METADATA1_SFT		12
6666 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
6667 	#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_MASK	UINT32_C(0x7000)
6668 	#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_SFT	12
6669 	/* 0x88a8 */
6670 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 12)
6671 	/* 0x8100 */
6672 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 12)
6673 	/* 0x9100 */
6674 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 12)
6675 	/* 0x9200 */
6676 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 12)
6677 	/* 0x9300 */
6678 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 12)
6679 	/* Value programmed in CFA VLANTPID register. */
6680 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 12)
6681 		#define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_LAST	RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPIDCFG
6682 	/* When meta_format != 0, this value is the VLAN valid. */
6683 	#define RX_PKT_V3_CMPL_METADATA1_VALID		UINT32_C(0x8000)
6684 	/*
6685 	 * This value is the RSS hash value calculated for the packet
6686 	 * based on the mode bits and key value in the VNIC. When hairpin_en
6687 	 * is set in VNIC context, this is the lower 32b of the host address
6688 	 * from the first BD used to place the packet.
6689 	 */
6690 	uint32_t	rss_hash;
6691 } rx_pkt_v3_cmpl_t, *prx_pkt_v3_cmpl_t;
6692 
6693 /* Last 16 bytes of RX Packet V3 Completion Record */
6694 /* rx_pkt_v3_cmpl_hi (size:128b/16B) */
6695 
6696 typedef struct rx_pkt_v3_cmpl_hi {
6697 	uint32_t	flags2;
6698 	/*
6699 	 * This indicates that the ip checksum was calculated for the inner
6700 	 * packet and that the ip_cs_error field indicates if there was an
6701 	 * error.
6702 	 */
6703 	#define RX_PKT_V3_CMPL_HI_FLAGS2_IP_CS_CALC		UINT32_C(0x1)
6704 	/*
6705 	 * This indicates that the TCP, UDP or ICMP checksum was calculated
6706 	 * for the inner packet and that the l4_cs_error field indicates if
6707 	 * there was an error.
6708 	 */
6709 	#define RX_PKT_V3_CMPL_HI_FLAGS2_L4_CS_CALC		UINT32_C(0x2)
6710 	/*
6711 	 * This indicates that the ip checksum was calculated for the tunnel
6712 	 * header and that the t_ip_cs_error field indicates if there was an
6713 	 * error.
6714 	 */
6715 	#define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_CS_CALC		UINT32_C(0x4)
6716 	/*
6717 	 * This indicates that the UDP checksum was calculated for the tunnel
6718 	 * packet and that the t_l4_cs_error field indicates if there was an
6719 	 * error.
6720 	 */
6721 	#define RX_PKT_V3_CMPL_HI_FLAGS2_T_L4_CS_CALC		UINT32_C(0x8)
6722 	/* This value indicates what format the metadata field is. */
6723 	#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
6724 	#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_SFT		4
6725 	/* There is no metadata information. Values are zero. */
6726 		#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
6727 	/*
6728 	 * The {metadata1, metadata0} fields contain the vtag
6729 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
6730 	 * de, vid[11:0]} The metadata2 field contains the table scope
6731 	 * and action record pointer. - metadata2[25:0] contains the
6732 	 * action record pointer. - metadata2[31:26] contains the table
6733 	 * scope.
6734 	 */
6735 		#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_ACT_REC_PTR	(UINT32_C(0x1) << 4)
6736 	/*
6737 	 * The {metadata1, metadata0} fields contain the vtag
6738 	 * information:
6739 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
6740 	 * The metadata2 field contains the Tunnel ID
6741 	 * value, justified to LSB.
6742 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
6743 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
6744 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
6745 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
6746 	 * - IPv4 = 0 (not populated)
6747 	 * - IPv6 = Flow Label[19:0]
6748 	 * - PPPoE = sessionID[15:0]
6749 	 * - MPLs = Outer label[19:0]
6750 	 * - UPAR = Selected[31:0] with bit mask
6751 	 */
6752 		#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
6753 	/*
6754 	 * The {metadata1, metadata0} fields contain the vtag
6755 	 * information:
6756 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
6757 	 * The metadata2 field contains the 32b metadata from the prepended
6758 	 * header (chdr_data).
6759 	 */
6760 		#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
6761 	/*
6762 	 * The {metadata1, metadata0} fields contain the vtag
6763 	 * information:
6764 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
6765 	 * The metadata2 field contains the outer_l3_offset,
6766 	 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
6767 	 * - metadata2[8:0] contains the outer_l3_offset.
6768 	 * - metadata2[17:9] contains the inner_l2_offset.
6769 	 * - metadata2[26:18] contains the inner_l3_offset.
6770 	 * - metadata2[31:27] contains the inner_l4_size.
6771 	 */
6772 		#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
6773 		#define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_LAST		RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET
6774 	/*
6775 	 * This field indicates the IP type for the inner-most IP header.
6776 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
6777 	 * This value is only valid if itype indicates a packet
6778 	 * with an IP header.
6779 	 */
6780 	#define RX_PKT_V3_CMPL_HI_FLAGS2_IP_TYPE			UINT32_C(0x100)
6781 	/*
6782 	 * This indicates that the complete 1's complement checksum was
6783 	 * calculated for the packet.
6784 	 */
6785 	#define RX_PKT_V3_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
6786 	/*
6787 	 * This field indicates the status of IP and L4 CS calculations done
6788 	 * by the chip. The format of this field is indicated by the
6789 	 * cs_all_ok_mode bit.
6790 	 */
6791 	#define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE		UINT32_C(0x400)
6792 	/* Indicates that the Tunnel IP type was IPv4 */
6793 		#define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE_IPV4		(UINT32_C(0x0) << 10)
6794 	/* Indicates that the Tunnel IP type was IPv6 */
6795 		#define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE_IPV6		(UINT32_C(0x1) << 10)
6796 		#define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE_LAST		RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE_IPV6
6797 	/*
6798 	 * This value is the complete 1's complement checksum calculated from
6799 	 * the start of the outer L3 header to the end of the packet (not
6800 	 * including the ethernet crc). It is valid when the
6801 	 * 'complete_checksum_calc' flag is set.
6802 	 */
6803 	#define RX_PKT_V3_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
6804 	#define RX_PKT_V3_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_SFT	16
6805 	/*
6806 	 * This is data from the CFA block as indicated by the meta_format
6807 	 * field.
6808 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
6809 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
6810 	 *   act_rec_ptr[25:0]}
6811 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
6812 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
6813 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
6814 	 */
6815 	uint32_t	metadata2;
6816 	uint16_t	errors_v2;
6817 	/*
6818 	 * This value is written by the NIC such that it will be different
6819 	 * for each pass through the completion queue. The even passes
6820 	 * will write 1. The odd passes will write 0.
6821 	 */
6822 	#define RX_PKT_V3_CMPL_HI_V2					UINT32_C(0x1)
6823 	#define RX_PKT_V3_CMPL_HI_ERRORS_MASK				UINT32_C(0xfffe)
6824 	#define RX_PKT_V3_CMPL_HI_ERRORS_SFT				1
6825 	/*
6826 	 * This error indicates that there was some sort of problem with
6827 	 * the BDs for the packet that was found after part of the
6828 	 * packet was already placed. The packet should be treated as
6829 	 * invalid.
6830 	 */
6831 	#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_MASK		UINT32_C(0xe)
6832 	#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_SFT		1
6833 	/* No buffer error */
6834 		#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_NO_BUFFER		(UINT32_C(0x0) << 1)
6835 	/*
6836 	 * Did Not Fit: Packet did not fit into packet buffer provided.
6837 	 * For regular placement, this means the packet did not fit in
6838 	 * the buffer provided. For HDS and jumbo placement, this means
6839 	 * that the packet could not be placed into 8 physical buffers.
6840 	 */
6841 		#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_DID_NOT_FIT		(UINT32_C(0x1) << 1)
6842 	/*
6843 	 * Not On Chip: All BDs needed for the packet were not on-chip
6844 	 * when the packet arrived. For regular placement, this error is
6845 	 * not valid. For HDS and jumbo placement, this means that not
6846 	 * enough agg BDs were posted to place the packet.
6847 	 */
6848 		#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_NOT_ON_CHIP		(UINT32_C(0x2) << 1)
6849 	/*
6850 	 * Bad Format:
6851 	 * BDs were not formatted correctly.
6852 	 */
6853 		#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_BAD_FORMAT		(UINT32_C(0x3) << 1)
6854 	/*
6855 	 * Flush:
6856 	 * There was a bad_format error on the previous operation
6857 	 */
6858 		#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH		(UINT32_C(0x5) << 1)
6859 		#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_LAST		RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH
6860 	/* This indicates that there was an error in the IP header checksum. */
6861 	#define RX_PKT_V3_CMPL_HI_ERRORS_IP_CS_ERROR			UINT32_C(0x10)
6862 	/*
6863 	 * This indicates that there was an error in the TCP, UDP or ICMP
6864 	 * checksum.
6865 	 */
6866 	#define RX_PKT_V3_CMPL_HI_ERRORS_L4_CS_ERROR			UINT32_C(0x20)
6867 	/*
6868 	 * This indicates that there was an error in the tunnel IP header
6869 	 * checksum.
6870 	 */
6871 	#define RX_PKT_V3_CMPL_HI_ERRORS_T_IP_CS_ERROR			UINT32_C(0x40)
6872 	/* This indicates that there was an error in the tunnel UDP checksum. */
6873 	#define RX_PKT_V3_CMPL_HI_ERRORS_T_L4_CS_ERROR			UINT32_C(0x80)
6874 	/*
6875 	 * This indicates that there was a CRC error on either an FCoE
6876 	 * or RoCE packet. The itype indicates the packet type.
6877 	 */
6878 	#define RX_PKT_V3_CMPL_HI_ERRORS_CRC_ERROR			UINT32_C(0x100)
6879 	/*
6880 	 * This indicates that there was an error in the tunnel portion
6881 	 * of the packet when this field is non-zero.
6882 	 */
6883 	#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe00)
6884 	#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_SFT			9
6885 	/*
6886 	 * No additional error occurred on the tunnel portion
6887 	 * of the packet or the packet does not have a tunnel.
6888 	 */
6889 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 9)
6890 	/*
6891 	 * Indicates that IP header version does not match expectation
6892 	 * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
6893 	 */
6894 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 9)
6895 	/*
6896 	 * Indicates that header length is out of range in the tunnel
6897 	 * header. Valid for IPv4.
6898 	 */
6899 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 9)
6900 	/*
6901 	 * Indicates that physical packet is shorter than that claimed
6902 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel
6903 	 * packet packets.
6904 	 */
6905 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x3) << 9)
6906 	/*
6907 	 * Indicates that the physical packet is shorter than that claimed
6908 	 * by the tunnel UDP header length for a tunnel UDP packet that is
6909 	 * not fragmented.
6910 	 */
6911 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x4) << 9)
6912 	/*
6913 	 * Indicates that the IPv4 TTL or IPv6 hop limit check have failed
6914 	 * (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6.
6915 	 */
6916 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x5) << 9)
6917 	/*
6918 	 * Indicates that the physical packet is shorter than that claimed
6919 	 * by the tunnel header length. Valid for GTPv1-U packets.
6920 	 * header.
6921 	 */
6922 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_TOTAL_ERROR		(UINT32_C(0x6) << 9)
6923 		#define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_LAST			RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_TOTAL_ERROR
6924 	/*
6925 	 * This indicates that there was an error in the inner
6926 	 * portion of the packet when this
6927 	 * field is non-zero.
6928 	 */
6929 	#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_MASK			UINT32_C(0xf000)
6930 	#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_SFT			12
6931 	/*
6932 	 * No additional error occurred on the tunnel portion
6933 	 * or the packet of the packet does not have a tunnel.
6934 	 */
6935 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 12)
6936 	/*
6937 	 * Indicates that IP header version does not match
6938 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
6939 	 * option other than VFT was parsed on
6940 	 * FCoE packet.
6941 	 */
6942 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 12)
6943 	/*
6944 	 * indicates that header length is out of range. Valid for
6945 	 * IPv4 and RoCE
6946 	 */
6947 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 12)
6948 	/*
6949 	 * indicates that the IPv4 TTL or IPv6 hop limit check
6950 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
6951 	 */
6952 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 12)
6953 	/*
6954 	 * Indicates that physical packet is shorter than that
6955 	 * claimed by the l3 header length. Valid for IPv4,
6956 	 * IPv6 packet or RoCE packets.
6957 	 */
6958 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 12)
6959 	/*
6960 	 * Indicates that the physical packet is shorter than that
6961 	 * claimed by the UDP header length for a UDP packet that is
6962 	 * not fragmented.
6963 	 */
6964 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR		(UINT32_C(0x5) << 12)
6965 	/*
6966 	 * Indicates that TCP header length > IP payload. Valid for
6967 	 * TCP packets only.
6968 	 */
6969 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 12)
6970 	/* Indicates that TCP header length < 5. Valid for TCP. */
6971 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL   (UINT32_C(0x7) << 12)
6972 	/*
6973 	 * Indicates that TCP option headers result in a TCP header
6974 	 * size that does not match data offset in TCP header. Valid
6975 	 * for TCP.
6976 	 */
6977 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 12)
6978 		#define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_LAST			RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
6979 	/*
6980 	 * This is data from the CFA block as indicated by the meta_format
6981 	 * field.
6982 	 */
6983 	uint16_t	metadata0;
6984 	/* When meta_format=1, this value is the VLAN VID. */
6985 	#define RX_PKT_V3_CMPL_HI_METADATA0_VID_MASK UINT32_C(0xfff)
6986 	#define RX_PKT_V3_CMPL_HI_METADATA0_VID_SFT 0
6987 	/* When meta_format=1, this value is the VLAN DE. */
6988 	#define RX_PKT_V3_CMPL_HI_METADATA0_DE	UINT32_C(0x1000)
6989 	/* When meta_format=1, this value is the VLAN PRI. */
6990 	#define RX_PKT_V3_CMPL_HI_METADATA0_PRI_MASK UINT32_C(0xe000)
6991 	#define RX_PKT_V3_CMPL_HI_METADATA0_PRI_SFT 13
6992 	/*
6993 	 * The timestamp field contains the 32b timestamp for the packet from
6994 	 * the MAC.
6995 	 *
6996 	 * When hairpin_en is set in VNIC context, this is the upper 32b of the
6997 	 * host address from the first BD used to place the packet.
6998 	 */
6999 	uint32_t	timestamp;
7000 } rx_pkt_v3_cmpl_hi_t, *prx_pkt_v3_cmpl_hi_t;
7001 
7002 /* rx_pkt_compress_cmpl (size:128b/16B) */
7003 
7004 typedef struct rx_pkt_compress_cmpl {
7005 	uint16_t	flags_type;
7006 	/*
7007 	 * This field indicates the exact type of the completion.
7008 	 * By convention, the LSB identifies the length of the
7009 	 * record in 16B units. Even values indicate 16B
7010 	 * records. Odd values indicate 32B
7011 	 * records.
7012 	 */
7013 	#define RX_PKT_COMPRESS_CMPL_TYPE_MASK		UINT32_C(0x3f)
7014 	#define RX_PKT_COMPRESS_CMPL_TYPE_SFT			0
7015 	/*
7016 	 * RX L2 completion:
7017 	 * This is the compressed version of Rx Completion for performance
7018 	 * applications. Length = 16B
7019 	 * This version of the completion record is used in Thor2 and later
7020 	 * chips.
7021 	 */
7022 		#define RX_PKT_COMPRESS_CMPL_TYPE_RX_L2_COMPRESS	UINT32_C(0x10)
7023 		#define RX_PKT_COMPRESS_CMPL_TYPE_LAST			RX_PKT_COMPRESS_CMPL_TYPE_RX_L2_COMPRESS
7024 	#define RX_PKT_COMPRESS_CMPL_FLAGS_MASK		UINT32_C(0xffc0)
7025 	#define RX_PKT_COMPRESS_CMPL_FLAGS_SFT		6
7026 	/*
7027 	 * When this bit is '1', it indicates a packet that has an
7028 	 * error of some type. Type of error is indicated in
7029 	 * error_flags.
7030 	 */
7031 	#define RX_PKT_COMPRESS_CMPL_FLAGS_ERROR		UINT32_C(0x40)
7032 	/*
7033 	 * This field indicates the status of IP and L4 CS calculations done
7034 	 * by the chip. The format of this field is indicated by the
7035 	 * cs_all_ok_mode bit.
7036 	 */
7037 	#define RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE		UINT32_C(0x100)
7038 	/* Indicates that the Tunnel IP type was IPv4 */
7039 		#define RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE_IPV4	(UINT32_C(0x0) << 8)
7040 	/* Indicates that the Tunnel IP type was IPv6 */
7041 		#define RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE_IPV6	(UINT32_C(0x1) << 8)
7042 		#define RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE_LAST	RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE_IPV6
7043 	/*
7044 	 * This field indicates the IP type for the inner-most IP header.
7045 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
7046 	 * This value is only valid if itype indicates a packet
7047 	 * with an IP header.
7048 	 */
7049 	#define RX_PKT_COMPRESS_CMPL_FLAGS_IP_TYPE		UINT32_C(0x200)
7050 	/* This bit is '1' if the RSS field in this completion is valid. */
7051 	#define RX_PKT_COMPRESS_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
7052 	/*
7053 	 * This value indicates what the inner packet determined for the
7054 	 * packet was.
7055 	 */
7056 	#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
7057 	#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_SFT		12
7058 	/*
7059 	 * Not Known:
7060 	 * Indicates that the packet type was not known.
7061 	 */
7062 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_NOT_KNOWN	(UINT32_C(0x0) << 12)
7063 	/*
7064 	 * IP Packet:
7065 	 * Indicates that the packet was an IP packet, but further
7066 	 * classification was not possible.
7067 	 */
7068 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_IP		(UINT32_C(0x1) << 12)
7069 	/*
7070 	 * TCP Packet:
7071 	 * Indicates that the packet was IP and TCP.
7072 	 * This indicates that the payload_offset field is valid.
7073 	 */
7074 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
7075 	/*
7076 	 * UDP Packet:
7077 	 * Indicates that the packet was IP and UDP.
7078 	 * This indicates that the payload_offset field is valid.
7079 	 */
7080 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_UDP		(UINT32_C(0x3) << 12)
7081 	/*
7082 	 * FCoE Packet:
7083 	 * Indicates that the packet was recognized as a FCoE.
7084 	 * This also indicates that the payload_offset field is valid.
7085 	 */
7086 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_FCOE		(UINT32_C(0x4) << 12)
7087 	/*
7088 	 * RoCE Packet:
7089 	 * Indicates that the packet was recognized as a RoCE.
7090 	 * This also indicates that the payload_offset field is valid.
7091 	 */
7092 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_ROCE		(UINT32_C(0x5) << 12)
7093 	/*
7094 	 * ICMP Packet:
7095 	 * Indicates that the packet was recognized as ICMP.
7096 	 * This indicates that the payload_offset field is valid.
7097 	 */
7098 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_ICMP		(UINT32_C(0x7) << 12)
7099 	/*
7100 	 * PTP packet wo/timestamp:
7101 	 * Indicates that the packet was recognized as a PTP
7102 	 * packet.
7103 	 */
7104 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP   (UINT32_C(0x8) << 12)
7105 	/*
7106 	 * PTP packet w/timestamp:
7107 	 * Indicates that the packet was recognized as a PTP
7108 	 * packet and that a timestamp was taken for the packet.
7109 	 * The 4b sub-nanosecond portion of the timestamp is in
7110 	 * the payload_offset field.
7111 	 */
7112 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 12)
7113 		#define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_LAST		RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
7114 	/*
7115 	 * This is the length of the data for the packet stored in the
7116 	 * buffer(s) identified by the opaque value. This includes
7117 	 * the packet BD and any associated buffer BDs. This does not include
7118 	 * the length of any data places in aggregation BDs.
7119 	 */
7120 	uint16_t	len;
7121 	/*
7122 	 * This value is the RSS hash value calculated for the packet
7123 	 * based on the mode bits and key value in the VNIC. When hairpin_en
7124 	 * is set in VNIC context, this is the lower 32b of the host address
7125 	 * from the first BD used to place the packet.
7126 	 */
7127 	uint32_t	rss_hash;
7128 	uint16_t	metadata1_cs_error_calc_v1;
7129 	/*
7130 	 * This value is written by the NIC such that it will be different
7131 	 * for each pass through the completion queue. The even passes
7132 	 * will write 1. The odd passes will write 0.
7133 	 */
7134 	#define RX_PKT_COMPRESS_CMPL_V1				UINT32_C(0x1)
7135 	/* unused is 3 b */
7136 	#define RX_PKT_COMPRESS_CMPL_UNUSED_MASK			UINT32_C(0xe)
7137 	#define RX_PKT_COMPRESS_CMPL_UNUSED_SFT			1
7138 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_MASK		UINT32_C(0xff0)
7139 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_SFT		4
7140 	/* This indicates that there was an error in the IP header checksum. */
7141 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_IP_CS_ERROR	UINT32_C(0x10)
7142 	/*
7143 	 * This indicates that there was an error in the TCP, UDP or ICMP
7144 	 * checksum.
7145 	 */
7146 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_L4_CS_ERROR	UINT32_C(0x20)
7147 	/*
7148 	 * This indicates that there was an error in the tunnel IP header
7149 	 * checksum.
7150 	 */
7151 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_T_IP_CS_ERROR	UINT32_C(0x40)
7152 	/* This indicates that there was an error in the tunnel UDP checksum. */
7153 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_T_L4_CS_ERROR	UINT32_C(0x80)
7154 	/*
7155 	 * This indicates that the ip checksum was calculated for the inner
7156 	 * packet and that the ip_cs_error field indicates if there was an
7157 	 * error.
7158 	 */
7159 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_IP_CS_CALC	UINT32_C(0x100)
7160 	/*
7161 	 * This indicates that the TCP, UDP or ICMP checksum was calculated
7162 	 * for the inner packet and that the l4_cs_error field indicates if
7163 	 * there was an error.
7164 	 */
7165 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_L4_CS_CALC	UINT32_C(0x200)
7166 	/*
7167 	 * This indicates that the ip checksum was calculated for the tunnel
7168 	 * header and that the t_ip_cs_error field indicates if there was an
7169 	 * error.
7170 	 */
7171 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_T_IP_CS_CALC	UINT32_C(0x400)
7172 	/*
7173 	 * This indicates that the UDP checksum was calculated for the tunnel
7174 	 * packet and that the t_l4_cs_error field indicates if there was an
7175 	 * error.
7176 	 */
7177 	#define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_T_L4_CS_CALC	UINT32_C(0x800)
7178 	/* This is data from the CFA as indicated by the meta_format field. */
7179 	#define RX_PKT_COMPRESS_CMPL_METADATA1_MASK		UINT32_C(0xf000)
7180 	#define RX_PKT_COMPRESS_CMPL_METADATA1_SFT		12
7181 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
7182 	#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_MASK	UINT32_C(0x7000)
7183 	#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_SFT	12
7184 	/* 0x88a8 */
7185 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID88A8	(UINT32_C(0x0) << 12)
7186 	/* 0x8100 */
7187 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID8100	(UINT32_C(0x1) << 12)
7188 	/* 0x9100 */
7189 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID9100	(UINT32_C(0x2) << 12)
7190 	/* 0x9200 */
7191 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID9200	(UINT32_C(0x3) << 12)
7192 	/* 0x9300 */
7193 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID9300	(UINT32_C(0x4) << 12)
7194 	/* Value programmed in CFA VLANTPID register. */
7195 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 12)
7196 		#define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_LAST	RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPIDCFG
7197 	/* When meta_format != 0, this value is the VLAN valid. */
7198 	#define RX_PKT_COMPRESS_CMPL_METADATA1_VALID		UINT32_C(0x8000)
7199 	/* This is data from the CFA as indicated by the meta_format field. */
7200 	uint16_t	vlanc_tcid;
7201 	/* When meta_format!=0, this value is the VLAN VID. */
7202 	#define RX_PKT_COMPRESS_CMPL_VLANC_TCID_VID_MASK UINT32_C(0xfff)
7203 	#define RX_PKT_COMPRESS_CMPL_VLANC_TCID_VID_SFT 0
7204 	/* When meta_format!=0, this value is the VLAN DE. */
7205 	#define RX_PKT_COMPRESS_CMPL_VLANC_TCID_DE	UINT32_C(0x1000)
7206 	/* When meta_format!=0, this value is the VLAN PRI. */
7207 	#define RX_PKT_COMPRESS_CMPL_VLANC_TCID_PRI_MASK UINT32_C(0xe000)
7208 	#define RX_PKT_COMPRESS_CMPL_VLANC_TCID_PRI_SFT 13
7209 	uint32_t	errors_agg_bufs_opaque;
7210 	/* Lower 16bits of the Opaque field provided in the Rx BD. */
7211 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_OPAQUE_MASK				UINT32_C(0xffff)
7212 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_OPAQUE_SFT				0
7213 	/*
7214 	 * This value is the number of aggregation buffers that follow this
7215 	 * entry in the completion ring that are a part of this packet.
7216 	 * If the value is zero, then the packet is completely contained
7217 	 * in the buffer space provided for the packet in the RX ring.
7218 	 */
7219 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_AGG_BUFS_MASK				UINT32_C(0x1f0000)
7220 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_AGG_BUFS_SFT				16
7221 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_MASK				UINT32_C(0x1fe00000)
7222 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_SFT				21
7223 	/*
7224 	 * This indicates that there was an error in the inner
7225 	 * portion of the packet when this
7226 	 * field is non-zero.
7227 	 */
7228 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_MASK			UINT32_C(0x1e00000)
7229 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_SFT			21
7230 	/*
7231 	 * No additional error occurred on the tunnel portion
7232 	 * or the packet of the packet does not have a tunnel.
7233 	 */
7234 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 21)
7235 	/*
7236 	 * Indicates that IP header version does not match
7237 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
7238 	 * option other than VFT was parsed on
7239 	 * FCoE packet.
7240 	 */
7241 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 21)
7242 	/*
7243 	 * indicates that header length is out of range. Valid for
7244 	 * IPv4 and RoCE
7245 	 */
7246 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 21)
7247 	/*
7248 	 * indicates that the IPv4 TTL or IPv6 hop limit check
7249 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
7250 	 */
7251 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 21)
7252 	/*
7253 	 * Indicates that physical packet is shorter than that
7254 	 * claimed by the l3 header length. Valid for IPv4,
7255 	 * IPv6 packet or RoCE packets.
7256 	 */
7257 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 21)
7258 	/*
7259 	 * Indicates that the physical packet is shorter than that
7260 	 * claimed by the UDP header length for a UDP packet that is
7261 	 * not fragmented.
7262 	 */
7263 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR		(UINT32_C(0x5) << 21)
7264 	/*
7265 	 * Indicates that TCP header length > IP payload. Valid for
7266 	 * TCP packets only.
7267 	 */
7268 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 21)
7269 	/* Indicates that TCP header length < 5. Valid for TCP. */
7270 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL   (UINT32_C(0x7) << 21)
7271 	/*
7272 	 * Indicates that TCP option headers result in a TCP header
7273 	 * size that does not match data offset in TCP header. Valid
7274 	 * for TCP.
7275 	 */
7276 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 21)
7277 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_LAST			RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
7278 	/*
7279 	 * This indicates that there was an error in the tunnel portion
7280 	 * of the packet when this field is non-zero.
7281 	 */
7282 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe000000)
7283 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_SFT			25
7284 	/*
7285 	 * No additional error occurred on the tunnel portion
7286 	 * of the packet or the packet does not have a tunnel.
7287 	 */
7288 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 25)
7289 	/*
7290 	 * Indicates that IP header version does not match expectation
7291 	 * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
7292 	 */
7293 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 25)
7294 	/*
7295 	 * Indicates that header length is out of range in the tunnel
7296 	 * header. Valid for IPv4.
7297 	 */
7298 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 25)
7299 	/*
7300 	 * Indicates that physical packet is shorter than that claimed
7301 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel
7302 	 * packet packets.
7303 	 */
7304 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x3) << 25)
7305 	/*
7306 	 * Indicates that the physical packet is shorter than that claimed
7307 	 * by the tunnel UDP header length for a tunnel UDP packet that is
7308 	 * not fragmented.
7309 	 */
7310 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x4) << 25)
7311 	/*
7312 	 * Indicates that the IPv4 TTL or IPv6 hop limit check have failed
7313 	 * (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6.
7314 	 */
7315 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x5) << 25)
7316 	/*
7317 	 * Indicates that the IP checksum failed its check in the tunnel
7318 	 * header.
7319 	 */
7320 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_IP_CS_ERROR		(UINT32_C(0x6) << 25)
7321 	/*
7322 	 * Indicates that the L4 checksum failed its check in the tunnel
7323 	 * header.
7324 	 */
7325 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR		(UINT32_C(0x7) << 25)
7326 		#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_LAST			RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR
7327 	/*
7328 	 * This indicates that there was a CRC error on either an FCoE
7329 	 * or RoCE packet. The itype indicates the packet type.
7330 	 */
7331 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_CRC_ERROR			UINT32_C(0x10000000)
7332 	/* unused1 is 3 b */
7333 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_UNUSED1_MASK				UINT32_C(0xe0000000)
7334 	#define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_UNUSED1_SFT				29
7335 } rx_pkt_compress_cmpl_t, *prx_pkt_compress_cmpl_t;
7336 
7337 /*
7338  * This TPA completion structure is used on devices where the
7339  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7340  */
7341 /* rx_tpa_start_cmpl (size:128b/16B) */
7342 
7343 typedef struct rx_tpa_start_cmpl {
7344 	uint16_t	flags_type;
7345 	/*
7346 	 * This field indicates the exact type of the completion.
7347 	 * By convention, the LSB identifies the length of the
7348 	 * record in 16B units. Even values indicate 16B
7349 	 * records. Odd values indicate 32B
7350 	 * records.
7351 	 */
7352 	#define RX_TPA_START_CMPL_TYPE_MASK		UINT32_C(0x3f)
7353 	#define RX_TPA_START_CMPL_TYPE_SFT		0
7354 	/*
7355 	 * RX L2 TPA Start Completion:
7356 	 * Completion at the beginning of a TPA operation.
7357 	 * Length = 32B
7358 	 */
7359 		#define RX_TPA_START_CMPL_TYPE_RX_TPA_START	UINT32_C(0x13)
7360 		#define RX_TPA_START_CMPL_TYPE_LAST		RX_TPA_START_CMPL_TYPE_RX_TPA_START
7361 	#define RX_TPA_START_CMPL_FLAGS_MASK		UINT32_C(0xffc0)
7362 	#define RX_TPA_START_CMPL_FLAGS_SFT		6
7363 	/* This bit will always be '0' for TPA start completions. */
7364 	#define RX_TPA_START_CMPL_FLAGS_ERROR		UINT32_C(0x40)
7365 	/* This field indicates how the packet was placed in the buffer. */
7366 	#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK	UINT32_C(0x380)
7367 	#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT	7
7368 	/*
7369 	 * Jumbo:
7370 	 * TPA Packet was placed using jumbo algorithm. This means
7371 	 * that the first buffer will be filled with data before
7372 	 * moving to aggregation buffers. Each aggregation buffer
7373 	 * will be filled before moving to the next aggregation
7374 	 * buffer.
7375 	 */
7376 		#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO	(UINT32_C(0x1) << 7)
7377 	/*
7378 	 * Header/Data Separation:
7379 	 * Packet was placed using Header/Data separation algorithm.
7380 	 * The separation location is indicated by the itype field.
7381 	 */
7382 		#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS	(UINT32_C(0x2) << 7)
7383 	/*
7384 	 * GRO/Jumbo:
7385 	 * Packet will be placed using GRO/Jumbo where the first
7386 	 * packet is filled with data. Subsequent packets will be
7387 	 * placed such that any one packet does not span two
7388 	 * aggregation buffers unless it starts at the beginning of
7389 	 * an aggregation buffer.
7390 	 */
7391 		#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO   (UINT32_C(0x5) << 7)
7392 	/*
7393 	 * GRO/Header-Data Separation:
7394 	 * Packet will be placed using GRO/HDS where the header
7395 	 * is in the first packet.
7396 	 * Payload of each packet will be
7397 	 * placed such that any one packet does not span two
7398 	 * aggregation buffers unless it starts at the beginning of
7399 	 * an aggregation buffer.
7400 	 */
7401 		#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
7402 		#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST	RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
7403 	/* This bit is '1' if the RSS field in this completion is valid. */
7404 	#define RX_TPA_START_CMPL_FLAGS_RSS_VALID	UINT32_C(0x400)
7405 	/* unused is 1 b */
7406 	#define RX_TPA_START_CMPL_FLAGS_UNUSED		UINT32_C(0x800)
7407 	/*
7408 	 * This value indicates what the inner packet determined for the
7409 	 * packet was.
7410 	 */
7411 	#define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK	UINT32_C(0xf000)
7412 	#define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT	12
7413 	/*
7414 	 * TCP Packet:
7415 	 * Indicates that the packet was IP and TCP.
7416 	 */
7417 		#define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
7418 		#define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST	RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
7419 	/*
7420 	 * This value indicates the amount of packet data written to the
7421 	 * buffer the opaque field in this completion corresponds to.
7422 	 */
7423 	uint16_t	len;
7424 	/*
7425 	 * This is a copy of the opaque field from the RX BD this completion
7426 	 * corresponds to.
7427 	 */
7428 	uint32_t	opaque;
7429 	/*
7430 	 * This value is written by the NIC such that it will be different
7431 	 * for each pass through the completion queue. The even passes
7432 	 * will write 1. The odd passes will write 0.
7433 	 */
7434 	uint8_t	v1;
7435 	/*
7436 	 * This value is written by the NIC such that it will be different
7437 	 * for each pass through the completion queue. The even passes
7438 	 * will write 1. The odd passes will write 0.
7439 	 */
7440 	#define RX_TPA_START_CMPL_V1 UINT32_C(0x1)
7441 	#define RX_TPA_START_CMPL_LAST RX_TPA_START_CMPL_V1
7442 	/*
7443 	 * This is the RSS hash type for the packet. The value is packed
7444 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
7445 	 *
7446 	 * The value of tuple_extrac_op provides the information about
7447 	 * what fields the hash was computed on.
7448 	 * * 0: The RSS hash was computed over source IP address,
7449 	 * destination IP address, source port, and destination port of inner
7450 	 * IP and TCP or UDP headers. Note: For non-tunneled packets,
7451 	 * the packet headers are considered inner packet headers for the RSS
7452 	 * hash computation purpose.
7453 	 * * 1: The RSS hash was computed over source IP address and destination
7454 	 * IP address of inner IP header. Note: For non-tunneled packets,
7455 	 * the packet headers are considered inner packet headers for the RSS
7456 	 * hash computation purpose.
7457 	 * * 2: The RSS hash was computed over source IP address,
7458 	 * destination IP address, source port, and destination port of
7459 	 * IP and TCP or UDP headers of outer tunnel headers.
7460 	 * Note: For non-tunneled packets, this value is not applicable.
7461 	 * * 3: The RSS hash was computed over source IP address and
7462 	 * destination IP address of IP header of outer tunnel headers.
7463 	 * Note: For non-tunneled packets, this value is not applicable.
7464 	 *
7465 	 * Note that 4-tuples values listed above are applicable
7466 	 * for layer 4 protocols supported and enabled for RSS in the hardware,
7467 	 * HWRM firmware, and drivers. For example, if RSS hash is supported and
7468 	 * enabled for TCP traffic only, then the values of tuple_extract_op
7469 	 * corresponding to 4-tuples are only valid for TCP traffic.
7470 	 */
7471 	uint8_t	rss_hash_type;
7472 	/*
7473 	 * This is the aggregation ID that the completion is associated
7474 	 * with. Use this number to correlate the TPA start completion
7475 	 * with the TPA end completion.
7476 	 */
7477 	uint16_t	agg_id;
7478 	/* unused2 is 9 b */
7479 	#define RX_TPA_START_CMPL_UNUSED2_MASK UINT32_C(0x1ff)
7480 	#define RX_TPA_START_CMPL_UNUSED2_SFT 0
7481 	/*
7482 	 * This is the aggregation ID that the completion is associated
7483 	 * with. Use this number to correlate the TPA start completion
7484 	 * with the TPA end completion.
7485 	 */
7486 	#define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00)
7487 	#define RX_TPA_START_CMPL_AGG_ID_SFT  9
7488 	/*
7489 	 * This value is the RSS hash value calculated for the packet
7490 	 * based on the mode bits and key value in the VNIC.
7491 	 */
7492 	uint32_t	rss_hash;
7493 } rx_tpa_start_cmpl_t, *prx_tpa_start_cmpl_t;
7494 
7495 /*
7496  * Last 16 bytes of rx_tpa_start_cmpl.
7497  *
7498  * This TPA completion structure is used on devices where the
7499  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7500  */
7501 /* rx_tpa_start_cmpl_hi (size:128b/16B) */
7502 
7503 typedef struct rx_tpa_start_cmpl_hi {
7504 	uint32_t	flags2;
7505 	/*
7506 	 * This indicates that the ip checksum was calculated for the
7507 	 * inner packet and that the sum passed for all segments
7508 	 * included in the aggregation.
7509 	 */
7510 	#define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC	UINT32_C(0x1)
7511 	/*
7512 	 * This indicates that the TCP, UDP or ICMP checksum was
7513 	 * calculated for the inner packet and that the sum passed
7514 	 * for all segments included in the aggregation.
7515 	 */
7516 	#define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC	UINT32_C(0x2)
7517 	/*
7518 	 * This indicates that the ip checksum was calculated for the
7519 	 * tunnel header and that the sum passed for all segments
7520 	 * included in the aggregation.
7521 	 */
7522 	#define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC	UINT32_C(0x4)
7523 	/*
7524 	 * This indicates that the UDP checksum was
7525 	 * calculated for the tunnel packet and that the sum passed for
7526 	 * all segments included in the aggregation.
7527 	 */
7528 	#define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC	UINT32_C(0x8)
7529 	/* This value indicates what format the metadata field is. */
7530 	#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
7531 	#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT  4
7532 	/* No metadata information. Value is zero. */
7533 		#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE   (UINT32_C(0x0) << 4)
7534 	/*
7535 	 * The metadata field contains the VLAN tag and TPID value.
7536 	 * - metadata[11:0] contains the vlan VID value.
7537 	 * - metadata[12] contains the vlan DE value.
7538 	 * - metadata[15:13] contains the vlan PRI value.
7539 	 * - metadata[31:16] contains the vlan TPID value.
7540 	 */
7541 		#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN   (UINT32_C(0x1) << 4)
7542 		#define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST  RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN
7543 	/*
7544 	 * This field indicates the IP type for the inner-most IP header.
7545 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
7546 	 */
7547 	#define RX_TPA_START_CMPL_FLAGS2_IP_TYPE	UINT32_C(0x100)
7548 	/*
7549 	 * This is data from the CFA block as indicated by the meta_format
7550 	 * field.
7551 	 */
7552 	uint32_t	metadata;
7553 	/* When meta_format=1, this value is the VLAN VID. */
7554 	#define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
7555 	#define RX_TPA_START_CMPL_METADATA_VID_SFT  0
7556 	/* When meta_format=1, this value is the VLAN DE. */
7557 	#define RX_TPA_START_CMPL_METADATA_DE	UINT32_C(0x1000)
7558 	/* When meta_format=1, this value is the VLAN PRI. */
7559 	#define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
7560 	#define RX_TPA_START_CMPL_METADATA_PRI_SFT  13
7561 	/* When meta_format=1, this value is the VLAN TPID. */
7562 	#define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
7563 	#define RX_TPA_START_CMPL_METADATA_TPID_SFT 16
7564 	uint16_t	v2;
7565 	/*
7566 	 * This value is written by the NIC such that it will be different
7567 	 * for each pass through the completion queue. The even passes
7568 	 * will write 1. The odd passes will write 0.
7569 	 */
7570 	#define RX_TPA_START_CMPL_V2	UINT32_C(0x1)
7571 	/*
7572 	 * This field identifies the CFA action rule that was used for this
7573 	 * packet.
7574 	 */
7575 	uint16_t	cfa_code;
7576 	/*
7577 	 * This is the size in bytes of the inner most L4 header.
7578 	 * This can be subtracted from the payload_offset to determine
7579 	 * the start of the inner most L4 header.
7580 	 */
7581 	uint32_t	inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
7582 	/*
7583 	 * This is the offset from the beginning of the packet in bytes for
7584 	 * the outer L3 header. If there is no outer L3 header, then this
7585 	 * value is zero.
7586 	 */
7587 	#define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
7588 	#define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0
7589 	/*
7590 	 * This is the offset from the beginning of the packet in bytes for
7591 	 * the inner most L2 header.
7592 	 */
7593 	#define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
7594 	#define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9
7595 	/*
7596 	 * This is the offset from the beginning of the packet in bytes for
7597 	 * the inner most L3 header.
7598 	 */
7599 	#define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
7600 	#define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18
7601 	/*
7602 	 * This is the size in bytes of the inner most L4 header.
7603 	 * This can be subtracted from the payload_offset to determine
7604 	 * the start of the inner most L4 header.
7605 	 */
7606 	#define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
7607 	#define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT   27
7608 } rx_tpa_start_cmpl_hi_t, *prx_tpa_start_cmpl_hi_t;
7609 
7610 /*
7611  * This TPA completion structure is used on devices where the
7612  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7613  * RX L2 TPA Start V2 Completion Record (32 bytes split to 2 16-byte
7614  * struct)
7615  */
7616 /* rx_tpa_start_v2_cmpl (size:128b/16B) */
7617 
7618 typedef struct rx_tpa_start_v2_cmpl {
7619 	uint16_t	flags_type;
7620 	/*
7621 	 * This field indicates the exact type of the completion.
7622 	 * By convention, the LSB identifies the length of the
7623 	 * record in 16B units. Even values indicate 16B
7624 	 * records. Odd values indicate 32B
7625 	 * records.
7626 	 */
7627 	#define RX_TPA_START_V2_CMPL_TYPE_MASK			UINT32_C(0x3f)
7628 	#define RX_TPA_START_V2_CMPL_TYPE_SFT			0
7629 	/*
7630 	 * RX L2 TPA Start V2 Completion:
7631 	 * Completion at the beginning of a TPA operation.
7632 	 * Length = 32B
7633 	 * This is the new version of the RX_TPA_START completion used
7634 	 * in SR2 and later chips.
7635 	 */
7636 		#define RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2		UINT32_C(0xd)
7637 		#define RX_TPA_START_V2_CMPL_TYPE_LAST			RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2
7638 	#define RX_TPA_START_V2_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
7639 	#define RX_TPA_START_V2_CMPL_FLAGS_SFT			6
7640 	/*
7641 	 * When this bit is '1', it indicates a packet that has an error
7642 	 * of some type. Type of error is indicated in error_flags.
7643 	 */
7644 	#define RX_TPA_START_V2_CMPL_FLAGS_ERROR			UINT32_C(0x40)
7645 	/* This field indicates how the packet was placed in the buffer. */
7646 	#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
7647 	#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_SFT		7
7648 	/*
7649 	 * Jumbo:
7650 	 * TPA Packet was placed using jumbo algorithm. This means
7651 	 * that the first buffer will be filled with data before
7652 	 * moving to aggregation buffers. Each aggregation buffer
7653 	 * will be filled before moving to the next aggregation
7654 	 * buffer.
7655 	 */
7656 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
7657 	/*
7658 	 * Header/Data Separation:
7659 	 * Packet was placed using Header/Data separation algorithm.
7660 	 * The separation location is indicated by the itype field.
7661 	 */
7662 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
7663 	/*
7664 	 * IOC/Jumbo:
7665 	 * Packet will be placed using In-Order Completion/Jumbo where
7666 	 * the first packet of the aggregation is placed using Jumbo
7667 	 * Placement. Subsequent packets will be placed such that each
7668 	 * packet starts at the beginning of an aggregation buffer.
7669 	 */
7670 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_JUMBO	(UINT32_C(0x4) << 7)
7671 	/*
7672 	 * GRO/Jumbo:
7673 	 * Packet will be placed using GRO/Jumbo where the first
7674 	 * packet is filled with data. Subsequent packets will be
7675 	 * placed such that any one packet does not span two
7676 	 * aggregation buffers unless it starts at the beginning of
7677 	 * an aggregation buffer.
7678 	 */
7679 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_JUMBO	(UINT32_C(0x5) << 7)
7680 	/*
7681 	 * GRO/Header-Data Separation:
7682 	 * Packet will be placed using GRO/HDS where the header
7683 	 * is in the first packet.
7684 	 * Payload of each packet will be
7685 	 * placed such that any one packet does not span two
7686 	 * aggregation buffers unless it starts at the beginning of
7687 	 * an aggregation buffer.
7688 	 */
7689 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
7690 	/*
7691 	 * IOC/Header-Data Separation:
7692 	 * Packet will be placed using In-Order Completion/HDS where
7693 	 * the header is in the first packet buffer. Payload of each
7694 	 * packet will be placed such that each packet starts at the
7695 	 * beginning of an aggregation buffer.
7696 	 */
7697 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS	(UINT32_C(0x7) << 7)
7698 		#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_LAST		RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS
7699 	/* This bit is '1' if the RSS field in this completion is valid. */
7700 	#define RX_TPA_START_V2_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
7701 	/*
7702 	 * This bit is '1' if metadata has been added to the end of the
7703 	 * packet in host memory. Metadata starts at the first 32B boundary
7704 	 * after the end of the packet for regular and jumbo placement. It
7705 	 * starts at the first 32B boundary after the end of the header for
7706 	 * HDS placement. The length of the metadata is indicated in the
7707 	 * metadata itself.
7708 	 */
7709 	#define RX_TPA_START_V2_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
7710 	/*
7711 	 * This value indicates what the inner packet determined for the
7712 	 * packet was.
7713 	 */
7714 	#define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
7715 	#define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_SFT		12
7716 	/*
7717 	 * TCP Packet:
7718 	 * Indicates that the packet was IP and TCP.
7719 	 */
7720 		#define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
7721 		#define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_LAST		RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP
7722 	/*
7723 	 * This value indicates the amount of packet data written to the
7724 	 * buffer the opaque field in this completion corresponds to.
7725 	 */
7726 	uint16_t	len;
7727 	/*
7728 	 * This is a copy of the opaque field from the RX BD this completion
7729 	 * corresponds to. If the VNIC is configured to not use an Rx BD for
7730 	 * the TPA Start completion, then this is a copy of the opaque field
7731 	 * from the first BD used to place the TPA Start packet.
7732 	 */
7733 	uint32_t	opaque;
7734 	/*
7735 	 * This value is written by the NIC such that it will be different
7736 	 * for each pass through the completion queue. The even passes
7737 	 * will write 1. The odd passes will write 0.
7738 	 */
7739 	uint8_t	v1;
7740 	/*
7741 	 * This value is written by the NIC such that it will be different
7742 	 * for each pass through the completion queue. The even passes
7743 	 * will write 1. The odd passes will write 0.
7744 	 */
7745 	#define RX_TPA_START_V2_CMPL_V1 UINT32_C(0x1)
7746 	#define RX_TPA_START_V2_CMPL_LAST RX_TPA_START_V2_CMPL_V1
7747 	/*
7748 	 * This is the RSS hash type for the packet. The value is packed
7749 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
7750 	 *
7751 	 * The value of tuple_extrac_op provides the information about
7752 	 * what fields the hash was computed on.
7753 	 * * 0: The RSS hash was computed over source IP address,
7754 	 * destination IP address, source port, and destination port of inner
7755 	 * IP and TCP or UDP headers. Note: For non-tunneled packets,
7756 	 * the packet headers are considered inner packet headers for the RSS
7757 	 * hash computation purpose.
7758 	 * * 1: The RSS hash was computed over source IP address and destination
7759 	 * IP address of inner IP header. Note: For non-tunneled packets,
7760 	 * the packet headers are considered inner packet headers for the RSS
7761 	 * hash computation purpose.
7762 	 * * 2: The RSS hash was computed over source IP address,
7763 	 * destination IP address, source port, and destination port of
7764 	 * IP and TCP or UDP headers of outer tunnel headers.
7765 	 * Note: For non-tunneled packets, this value is not applicable.
7766 	 * * 3: The RSS hash was computed over source IP address and
7767 	 * destination IP address of IP header of outer tunnel headers.
7768 	 * Note: For non-tunneled packets, this value is not applicable.
7769 	 *
7770 	 * Note that 4-tuples values listed above are applicable
7771 	 * for layer 4 protocols supported and enabled for RSS in the hardware,
7772 	 * HWRM firmware, and drivers. For example, if RSS hash is supported and
7773 	 * enabled for TCP traffic only, then the values of tuple_extract_op
7774 	 * corresponding to 4-tuples are only valid for TCP traffic.
7775 	 */
7776 	uint8_t	rss_hash_type;
7777 	/*
7778 	 * This is the aggregation ID that the completion is associated
7779 	 * with. Use this number to correlate the TPA start completion
7780 	 * with the TPA end completion.
7781 	 */
7782 	uint16_t	agg_id;
7783 	/*
7784 	 * This is the aggregation ID that the completion is associated
7785 	 * with. Use this number to correlate the TPA start completion
7786 	 * with the TPA end completion.
7787 	 */
7788 	#define RX_TPA_START_V2_CMPL_AGG_ID_MASK		UINT32_C(0xfff)
7789 	#define RX_TPA_START_V2_CMPL_AGG_ID_SFT		0
7790 	#define RX_TPA_START_V2_CMPL_METADATA1_MASK		UINT32_C(0xf000)
7791 	#define RX_TPA_START_V2_CMPL_METADATA1_SFT		12
7792 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
7793 	#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_MASK	UINT32_C(0x7000)
7794 	#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_SFT	12
7795 	/* 0x88a8 */
7796 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 12)
7797 	/* 0x8100 */
7798 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 12)
7799 	/* 0x9100 */
7800 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 12)
7801 	/* 0x9200 */
7802 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 12)
7803 	/* 0x9300 */
7804 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 12)
7805 	/* Value programmed in CFA VLANTPID register. */
7806 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 12)
7807 		#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_LAST	RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG
7808 	/* When meta_format != 0, this value is the VLAN valid. */
7809 	#define RX_TPA_START_V2_CMPL_METADATA1_VALID		UINT32_C(0x8000)
7810 	/*
7811 	 * This value is the RSS hash value calculated for the packet
7812 	 * based on the mode bits and key value in the VNIC.
7813 	 * When vee_cmpl_mode is set in VNIC context, this is the lower
7814 	 * 32b of the host address from the first BD used to place the packet.
7815 	 */
7816 	uint32_t	rss_hash;
7817 } rx_tpa_start_v2_cmpl_t, *prx_tpa_start_v2_cmpl_t;
7818 
7819 /*
7820  * Last 16 bytes of RX L2 TPA Start V2 Completion Record
7821  *
7822  * This TPA completion structure is used on devices where the
7823  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7824  */
7825 /* rx_tpa_start_v2_cmpl_hi (size:128b/16B) */
7826 
7827 typedef struct rx_tpa_start_v2_cmpl_hi {
7828 	uint32_t	flags2;
7829 	/* This indicates that the aggregation was done using GRO rules. */
7830 	#define RX_TPA_START_V2_CMPL_FLAGS2_AGG_GRO			UINT32_C(0x4)
7831 	/*
7832 	 * When this bit is '0', the cs_ok field has the following definition:-
7833 	 * ip_cs_ok[2:0] = The number of header groups with a valid IP checksum
7834 	 * in the delivered packet, counted from the outer-most header group to
7835 	 * the inner-most header group, stopping at the first error. -
7836 	 * l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum
7837 	 * in the delivered packet, counted from the outer-most header group to
7838 	 * the inner-most header group, stopping at the first error. When this
7839 	 * bit is '1', the cs_ok field has the following definition: -
7840 	 * hdr_cnt[2:0] = The number of header groups that were parsed by the
7841 	 * chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit
7842 	 * will be '1' if all the parsed header groups with an IP checksum are
7843 	 * valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed
7844 	 * header groups with an L4 checksum are valid.
7845 	 */
7846 	#define RX_TPA_START_V2_CMPL_FLAGS2_CS_ALL_OK_MODE		UINT32_C(0x8)
7847 	/* This value indicates what format the metadata field is. */
7848 	#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
7849 	#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_SFT		4
7850 	/* There is no metadata information. Values are zero. */
7851 		#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
7852 	/*
7853 	 * The {metadata1, metadata0} fields contain the vtag
7854 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
7855 	 * de, vid[11:0]} The metadata2 field contains the table scope
7856 	 * and action record pointer. - metadata2[25:0] contains the
7857 	 * action record pointer. - metadata2[31:26] contains the table
7858 	 * scope.
7859 	 */
7860 		#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_ACT_REC_PTR	(UINT32_C(0x1) << 4)
7861 	/*
7862 	 * The {metadata1, metadata0} fields contain the vtag
7863 	 * information:
7864 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
7865 	 * The metadata2 field contains the Tunnel ID
7866 	 * value, justified to LSB.
7867 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
7868 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
7869 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
7870 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
7871 	 * - IPv4 = 0 (not populated)
7872 	 * - IPv6 = Flow Label[19:0]
7873 	 * - PPPoE = sessionID[15:0]
7874 	 * - MPLs = Outer label[19:0]
7875 	 * - UPAR = Selected[31:0] with bit mask
7876 	 */
7877 		#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
7878 	/*
7879 	 * The {metadata1, metadata0} fields contain the vtag
7880 	 * information:
7881 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
7882 	 * The metadata2 field contains the 32b metadata from the prepended
7883 	 * header (chdr_data).
7884 	 */
7885 		#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
7886 	/*
7887 	 * The {metadata1, metadata0} fields contain the vtag
7888 	 * information:
7889 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
7890 	 * The metadata2 field contains the outer_l3_offset,
7891 	 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
7892 	 * - metadata2[8:0] contains the outer_l3_offset.
7893 	 * - metadata2[17:9] contains the inner_l2_offset.
7894 	 * - metadata2[26:18] contains the inner_l3_offset.
7895 	 * - metadata2[31:27] contains the inner_l4_size.
7896 	 */
7897 		#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
7898 		#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_LAST		RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
7899 	/*
7900 	 * This field indicates the IP type for the inner-most IP header.
7901 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
7902 	 * This value is only valid if itype indicates a packet
7903 	 * with an IP header.
7904 	 */
7905 	#define RX_TPA_START_V2_CMPL_FLAGS2_IP_TYPE			UINT32_C(0x100)
7906 	/*
7907 	 * This indicates that the complete 1's complement checksum was
7908 	 * calculated for the packet in the aggregation.
7909 	 */
7910 	#define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
7911 	/*
7912 	 * This field indicates the status of IP and L4 CS calculations done
7913 	 * by the chip. The format of this field is indicated by the
7914 	 * cs_all_ok_mode bit.
7915 	 * CS status for TPA packets is always valid. This means that "all_ok"
7916 	 * status will always be set. The ok count status will be set
7917 	 * appropriately for the packet header, such that all existing CS
7918 	 * values are ok.
7919 	 */
7920 	#define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_MASK		UINT32_C(0xfc00)
7921 	#define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_SFT		10
7922 	/*
7923 	 * This value is the complete 1's complement checksum calculated from
7924 	 * the start of the outer L3 header to the end of the packet (not
7925 	 * including the ethernet crc). It is valid when the
7926 	 * 'complete_checksum_calc' flag is set. For TPA Start completions,
7927 	 * the complete checksum is calculated for the first packet in the
7928 	 * aggregation only.
7929 	 */
7930 	#define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
7931 	#define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT	16
7932 	/*
7933 	 * This is data from the CFA block as indicated by the meta_format
7934 	 * field.
7935 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
7936 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
7937 	 *   act_rec_ptr[25:0]}
7938 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
7939 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
7940 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
7941 	 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
7942 	 * of the host address from the first BD used to place the packet.
7943 	 */
7944 	uint32_t	metadata2;
7945 	uint16_t	errors_v2;
7946 	/*
7947 	 * This value is written by the NIC such that it will be different
7948 	 * for each pass through the completion queue. The even passes
7949 	 * will write 1. The odd passes will write 0.
7950 	 */
7951 	#define RX_TPA_START_V2_CMPL_V2				UINT32_C(0x1)
7952 	#define RX_TPA_START_V2_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
7953 	#define RX_TPA_START_V2_CMPL_ERRORS_SFT			1
7954 	/*
7955 	 * This error indicates that there was some sort of problem with
7956 	 * the BDs for the packetThe packet should be treated as
7957 	 * invalid.
7958 	 */
7959 	#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
7960 	#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_SFT	1
7961 	/* No buffer error */
7962 		#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER	(UINT32_C(0x0) << 1)
7963 	/*
7964 	 * Did Not Fit:
7965 	 * Packet did not fit into packet buffer provided. This means
7966 	 * that the TPA Start packet was too big to be placed into the
7967 	 * per-packet maximum number of physical buffers configured for
7968 	 * the VNIC, or that it was too big to be placed into the
7969 	 * per-aggregation maximum number of physical buffers configured
7970 	 * for the VNIC. This error only occurs when the VNIC is
7971 	 * configured for variable size receive buffers.
7972 	 */
7973 		#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT   (UINT32_C(0x1) << 1)
7974 	/*
7975 	 * Bad Format:
7976 	 * BDs were not formatted correctly.
7977 	 */
7978 		#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT	(UINT32_C(0x3) << 1)
7979 	/*
7980 	 * Flush:
7981 	 * There was a bad_format error on the previous operation
7982 	 */
7983 		#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH	(UINT32_C(0x5) << 1)
7984 		#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_LAST	RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH
7985 	/*
7986 	 * This is data from the CFA block as indicated by the meta_format
7987 	 * field.
7988 	 */
7989 	uint16_t	metadata0;
7990 	/* When meta_format != 0, this value is the VLAN VID. */
7991 	#define RX_TPA_START_V2_CMPL_METADATA0_VID_MASK UINT32_C(0xfff)
7992 	#define RX_TPA_START_V2_CMPL_METADATA0_VID_SFT 0
7993 	/* When meta_format != 0, this value is the VLAN DE. */
7994 	#define RX_TPA_START_V2_CMPL_METADATA0_DE	UINT32_C(0x1000)
7995 	/* When meta_format != 0, this value is the VLAN PRI. */
7996 	#define RX_TPA_START_V2_CMPL_METADATA0_PRI_MASK UINT32_C(0xe000)
7997 	#define RX_TPA_START_V2_CMPL_METADATA0_PRI_SFT 13
7998 	/*
7999 	 * This field contains the outer_l3_offset, inner_l2_offset,
8000 	 * inner_l3_offset, and inner_l4_size.
8001 	 *
8002 	 * hdr_offsets[8:0] contains the outer_l3_offset.
8003 	 * hdr_offsets[17:9] contains the inner_l2_offset.
8004 	 * hdr_offsets[26:18] contains the inner_l3_offset.
8005 	 * hdr_offsets[31:27] contains the inner_l4_size.
8006 	 */
8007 	uint32_t	hdr_offsets;
8008 } rx_tpa_start_v2_cmpl_hi_t, *prx_tpa_start_v2_cmpl_hi_t;
8009 
8010 /*
8011  * This TPA completion structure is used on devices where the
8012  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
8013  * RX L2 TPA Start V3 Completion Record (32 bytes split to 2 16-byte
8014  * struct)
8015  */
8016 /* rx_tpa_start_v3_cmpl (size:128b/16B) */
8017 
8018 typedef struct rx_tpa_start_v3_cmpl {
8019 	uint16_t	flags_type;
8020 	/*
8021 	 * This field indicates the exact type of the completion.
8022 	 * By convention, the LSB identifies the length of the
8023 	 * record in 16B units. Even values indicate 16B
8024 	 * records. Odd values indicate 32B
8025 	 * records.
8026 	 */
8027 	#define RX_TPA_START_V3_CMPL_TYPE_MASK			UINT32_C(0x3f)
8028 	#define RX_TPA_START_V3_CMPL_TYPE_SFT			0
8029 	/*
8030 	 * RX L2 TPA Start V3 completion:
8031 	 * Completion at the beginning of a TPA operation.
8032 	 * Length = 32B
8033 	 * This is the new version of the RX_TPA_START completion used
8034 	 * in Thor2 and later chips.
8035 	 */
8036 		#define RX_TPA_START_V3_CMPL_TYPE_RX_TPA_START_V3		UINT32_C(0x19)
8037 		#define RX_TPA_START_V3_CMPL_TYPE_LAST			RX_TPA_START_V3_CMPL_TYPE_RX_TPA_START_V3
8038 	#define RX_TPA_START_V3_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
8039 	#define RX_TPA_START_V3_CMPL_FLAGS_SFT			6
8040 	/*
8041 	 * When this bit is '1', it indicates a packet that has an error
8042 	 * of some type. Type of error is indicated in error_flags.
8043 	 */
8044 	#define RX_TPA_START_V3_CMPL_FLAGS_ERROR			UINT32_C(0x40)
8045 	/* This field indicates how the packet was placed in the buffer. */
8046 	#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
8047 	#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_SFT		7
8048 	/*
8049 	 * Jumbo:
8050 	 * TPA Packet was placed using jumbo algorithm. This means
8051 	 * that the first buffer will be filled with data before
8052 	 * moving to aggregation buffers. Each aggregation buffer
8053 	 * will be filled before moving to the next aggregation
8054 	 * buffer.
8055 	 */
8056 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
8057 	/*
8058 	 * Header/Data Separation:
8059 	 * Packet was placed using Header/Data separation algorithm.
8060 	 * The separation location is indicated by the itype field.
8061 	 */
8062 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
8063 	/*
8064 	 * IOC/Jumbo:
8065 	 * Packet will be placed using In-Order Completion/Jumbo where
8066 	 * the first packet of the aggregation is placed using Jumbo
8067 	 * Placement. Subsequent packets will be placed such that each
8068 	 * packet starts at the beginning of an aggregation buffer.
8069 	 */
8070 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_IOC_JUMBO	(UINT32_C(0x4) << 7)
8071 	/*
8072 	 * GRO/Jumbo:
8073 	 * Packet will be placed using GRO/Jumbo where the first
8074 	 * packet is filled with data. Subsequent packets will be
8075 	 * placed such that any one packet does not span two
8076 	 * aggregation buffers unless it starts at the beginning of
8077 	 * an aggregation buffer.
8078 	 */
8079 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_GRO_JUMBO	(UINT32_C(0x5) << 7)
8080 	/*
8081 	 * GRO/Header-Data Separation:
8082 	 * Packet will be placed using GRO/HDS where the header
8083 	 * is in the first packet.
8084 	 * Payload of each packet will be
8085 	 * placed such that any one packet does not span two
8086 	 * aggregation buffers unless it starts at the beginning of
8087 	 * an aggregation buffer.
8088 	 */
8089 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
8090 	/*
8091 	 * IOC/Header-Data Separation:
8092 	 * Packet will be placed using In-Order Completion/HDS where
8093 	 * the header is in the first packet buffer. Payload of each
8094 	 * packet will be placed such that each packet starts at the
8095 	 * beginning of an aggregation buffer.
8096 	 */
8097 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_IOC_HDS	(UINT32_C(0x7) << 7)
8098 		#define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_LAST		RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_IOC_HDS
8099 	/* This bit is '1' if the RSS field in this completion is valid. */
8100 	#define RX_TPA_START_V3_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
8101 	/*
8102 	 * This bit is '1' if metadata has been added to the end of the
8103 	 * packet in host memory. Metadata starts at the first 32B boundary
8104 	 * after the end of the packet for regular and jumbo placement. It
8105 	 * starts at the first 32B boundary after the end of the header for
8106 	 * HDS placement. The length of the metadata is indicated in the
8107 	 * metadata itself.
8108 	 */
8109 	#define RX_TPA_START_V3_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
8110 	/*
8111 	 * This value indicates what the inner packet determined for the
8112 	 * packet was.
8113 	 */
8114 	#define RX_TPA_START_V3_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
8115 	#define RX_TPA_START_V3_CMPL_FLAGS_ITYPE_SFT		12
8116 	/*
8117 	 * TCP Packet:
8118 	 * Indicates that the packet was IP and TCP.
8119 	 */
8120 		#define RX_TPA_START_V3_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
8121 		#define RX_TPA_START_V3_CMPL_FLAGS_ITYPE_LAST		RX_TPA_START_V3_CMPL_FLAGS_ITYPE_TCP
8122 	/*
8123 	 * This value indicates the amount of packet data written to the
8124 	 * buffer the opaque field in this completion corresponds to.
8125 	 */
8126 	uint16_t	len;
8127 	/*
8128 	 * This is a copy of the opaque field from the RX BD this completion
8129 	 * corresponds to. If the VNIC is configured to not use an Rx BD for
8130 	 * the TPA Start completion, then this is a copy of the opaque field
8131 	 * from the first BD used to place the TPA Start packet.
8132 	 */
8133 	uint32_t	opaque;
8134 	uint16_t	rss_hash_type_v1;
8135 	/*
8136 	 * This value is written by the NIC such that it will be different
8137 	 * for each pass through the completion queue. The even passes
8138 	 * will write 1. The odd passes will write 0.
8139 	 */
8140 	#define RX_TPA_START_V3_CMPL_V1		UINT32_C(0x1)
8141 	/* unused1 is 6 b. */
8142 	#define RX_TPA_START_V3_CMPL_UNUSED1_MASK	UINT32_C(0x7e)
8143 	#define RX_TPA_START_V3_CMPL_UNUSED1_SFT	1
8144 	/*
8145 	 * This is the RSS hash type for the packet. The value is packed
8146 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
8147 	 *
8148 	 * The value of tuple_extrac_op provides the information about
8149 	 * what fields the hash was computed on.
8150 	 * * 0: The RSS hash was computed over source IP address,
8151 	 * destination IP address, source port, and destination port of inner
8152 	 * IP and TCP or UDP headers.
8153 	 * * 1: The RSS hash was computed over source IP address and
8154 	 * destination IP address of inner IP header.
8155 	 * * 2: The RSS hash was computed over source IP address,
8156 	 * destination IP address, source port, and destination port of
8157 	 * IP and TCP or UDP headers of outer tunnel headers.
8158 	 * Note: For non-tunneled packets, this value is not applicable.
8159 	 * * 3: The RSS hash was computed over source IP address and
8160 	 * destination IP address of IP header of outer tunnel headers.
8161 	 * Note: For non-tunneled packets, this value is not applicable.
8162 	 * * 4: The RSS hash was computed over source IP address of the inner
8163 	 * IP header.
8164 	 * * 5: The RSS hash was computed over destination IP address of the
8165 	 * inner IP header.
8166 	 * * 6: The RSS hash was computed over source IP address of the outer
8167 	 * IP header. Note: For non-tunneled packets, this value is not
8168 	 * applicable
8169 	 * * 7: The RSS hash was computed over destination IP address of the
8170 	 * outer IP header.
8171 	 * Note: For non-tunneled packets, this value is not applicable.
8172 	 * * 8: The RSS hash was computed over source IP address, destination
8173 	 * IP address, and flow label of the inner IP header.
8174 	 * Note: For packets without an inner IPv6 header, this value is not
8175 	 * applicable.
8176 	 * * 9: The RSS hash was computed over the flow label of the inner
8177 	 * IP header.
8178 	 * Note: For packets without an inner IPv6 header, this value
8179 	 * is not applicable.
8180 	 * * 10: The RSS hash was computed over source IP address, destination
8181 	 * IP address, and flow label of the outer IP header.
8182 	 * Note: For packets without an outer IPv6 header, this value is not
8183 	 * applicable.
8184 	 * * 11: The RSS hash was computed over the flow label of the outer
8185 	 * IP header. Note: For packets without an outer IPv6 header, this
8186 	 * value is not applicable.
8187 	 *
8188 	 * Note that 4-tuples values listed above are applicable
8189 	 * for layer 4 protocols supported and enabled for RSS in the hardware,
8190 	 * HWRM firmware, and drivers. For example, if RSS hash is supported
8191 	 * and enabled for TCP traffic only, then the values of
8192 	 * tuple_extract_op corresponding to 4-tuples are only valid for TCP
8193 	 * traffic
8194 	 */
8195 	#define RX_TPA_START_V3_CMPL_RSS_HASH_TYPE_MASK UINT32_C(0xff80)
8196 	#define RX_TPA_START_V3_CMPL_RSS_HASH_TYPE_SFT 7
8197 	/*
8198 	 * This is the aggregation ID that the completion is associated
8199 	 * with. Use this number to correlate the TPA start completion
8200 	 * with the TPA end completion.
8201 	 */
8202 	uint16_t	agg_id;
8203 	/*
8204 	 * This is the aggregation ID that the completion is associated
8205 	 * with. Use this number to correlate the TPA start completion
8206 	 * with the TPA end completion.
8207 	 */
8208 	#define RX_TPA_START_V3_CMPL_AGG_ID_MASK		UINT32_C(0xfff)
8209 	#define RX_TPA_START_V3_CMPL_AGG_ID_SFT		0
8210 	#define RX_TPA_START_V3_CMPL_METADATA1_MASK		UINT32_C(0xf000)
8211 	#define RX_TPA_START_V3_CMPL_METADATA1_SFT		12
8212 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
8213 	#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_MASK	UINT32_C(0x7000)
8214 	#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_SFT	12
8215 	/* 0x88a8 */
8216 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 12)
8217 	/* 0x8100 */
8218 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 12)
8219 	/* 0x9100 */
8220 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 12)
8221 	/* 0x9200 */
8222 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 12)
8223 	/* 0x9300 */
8224 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 12)
8225 	/* Value programmed in CFA VLANTPID register. */
8226 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 12)
8227 		#define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_LAST	RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPIDCFG
8228 	/* When meta_format != 0, this value is the VLAN valid. */
8229 	#define RX_TPA_START_V3_CMPL_METADATA1_VALID		UINT32_C(0x8000)
8230 	/*
8231 	 * This value is the RSS hash value calculated for the packet
8232 	 * based on the mode bits and key value in the VNIC.
8233 	 * When vee_cmpl_mode is set in VNIC context, this is the lower
8234 	 * 32b of the host address from the first BD used to place the packet.
8235 	 */
8236 	uint32_t	rss_hash;
8237 } rx_tpa_start_v3_cmpl_t, *prx_tpa_start_v3_cmpl_t;
8238 
8239 /*
8240  * Last 16 bytes of RX L2 TPA Start V3 Completion Record
8241  *
8242  * This TPA completion structure is used on devices where the
8243  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
8244  */
8245 /* rx_tpa_start_v3_cmpl_hi (size:128b/16B) */
8246 
8247 typedef struct rx_tpa_start_v3_cmpl_hi {
8248 	uint32_t	flags2;
8249 	/*
8250 	 * This indicates that the ip checksum was calculated for the inner
8251 	 * packet and that the ip_cs_error field indicates if there was an
8252 	 * error.
8253 	 */
8254 	#define RX_TPA_START_V3_CMPL_FLAGS2_IP_CS_CALC		UINT32_C(0x1)
8255 	/*
8256 	 * This indicates that the TCP, UDP or ICMP checksum was calculated
8257 	 * for the inner packet and that the l4_cs_error field indicates if
8258 	 * there was an error.
8259 	 */
8260 	#define RX_TPA_START_V3_CMPL_FLAGS2_L4_CS_CALC		UINT32_C(0x2)
8261 	/*
8262 	 * This indicates that the ip checksum was calculated for the tunnel
8263 	 * header and that the t_ip_cs_error field indicates if there was an
8264 	 * error.
8265 	 */
8266 	#define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_CS_CALC		UINT32_C(0x4)
8267 	/*
8268 	 * This indicates that the UDP checksum was calculated for the tunnel
8269 	 * packet and that the t_l4_cs_error field indicates if there was an
8270 	 * error.
8271 	 */
8272 	#define RX_TPA_START_V3_CMPL_FLAGS2_T_L4_CS_CALC		UINT32_C(0x8)
8273 	/* This value indicates what format the metadata field is. */
8274 	#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
8275 	#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_SFT		4
8276 	/* There is no metadata information. Values are zero. */
8277 		#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
8278 	/*
8279 	 * The {metadata1, metadata0} fields contain the vtag
8280 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
8281 	 * de, vid[11:0]} The metadata2 field contains the table scope
8282 	 * and action record pointer. - metadata2[25:0] contains the
8283 	 * action record pointer. - metadata2[31:26] contains the table
8284 	 * scope.
8285 	 */
8286 		#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_ACT_REC_PTR	(UINT32_C(0x1) << 4)
8287 	/*
8288 	 * The {metadata1, metadata0} fields contain the vtag
8289 	 * information:
8290 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
8291 	 * The metadata2 field contains the Tunnel ID
8292 	 * value, justified to LSB.
8293 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
8294 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
8295 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
8296 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
8297 	 * - IPv4 = 0 (not populated)
8298 	 * - IPv6 = Flow Label[19:0]
8299 	 * - PPPoE = sessionID[15:0]
8300 	 * - MPLs = Outer label[19:0]
8301 	 * - UPAR = Selected[31:0] with bit mask
8302 	 */
8303 		#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
8304 	/*
8305 	 * The {metadata1, metadata0} fields contain the vtag
8306 	 * information:
8307 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
8308 	 * The metadata2 field contains the 32b metadata from the prepended
8309 	 * header (chdr_data).
8310 	 */
8311 		#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
8312 	/*
8313 	 * The {metadata1, metadata0} fields contain the vtag
8314 	 * information:
8315 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
8316 	 * The metadata2 field contains the outer_l3_offset,
8317 	 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
8318 	 * - metadata2[8:0] contains the outer_l3_offset.
8319 	 * - metadata2[17:9] contains the inner_l2_offset.
8320 	 * - metadata2[26:18] contains the inner_l3_offset.
8321 	 * - metadata2[31:27] contains the inner_l4_size.
8322 	 */
8323 		#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
8324 		#define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_LAST		RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
8325 	/*
8326 	 * This field indicates the IP type for the inner-most IP header.
8327 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
8328 	 * This value is only valid if itype indicates a packet
8329 	 * with an IP header.
8330 	 */
8331 	#define RX_TPA_START_V3_CMPL_FLAGS2_IP_TYPE			UINT32_C(0x100)
8332 	/*
8333 	 * This indicates that the complete 1's complement checksum was
8334 	 * calculated for the packet.
8335 	 */
8336 	#define RX_TPA_START_V3_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
8337 	/*
8338 	 * This field indicates the status of IP and L4 CS calculations done
8339 	 * by the chip. The format of this field is indicated by the
8340 	 * cs_all_ok_mode bit.
8341 	 */
8342 	#define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE		UINT32_C(0x400)
8343 	/* Indicates that the Tunnel IP type was IPv4 */
8344 		#define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE_IPV4		(UINT32_C(0x0) << 10)
8345 	/* Indicates that the Tunnel IP type was IPv6 */
8346 		#define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE_IPV6		(UINT32_C(0x1) << 10)
8347 		#define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE_LAST		RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE_IPV6
8348 	/* This indicates that the aggregation was done using GRO rules. */
8349 	#define RX_TPA_START_V3_CMPL_FLAGS2_AGG_GRO			UINT32_C(0x800)
8350 	/*
8351 	 * This value is the complete 1's complement checksum calculated from
8352 	 * the start of the outer L3 header to the end of the packet (not
8353 	 * including the ethernet crc). It is valid when the
8354 	 * 'complete_checksum_calc' flag is set. For TPA Start completions,
8355 	 * the complete checksum is calculated for the first packet in the
8356 	 * aggregation only.
8357 	 */
8358 	#define RX_TPA_START_V3_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
8359 	#define RX_TPA_START_V3_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT	16
8360 	/*
8361 	 * This is data from the CFA block as indicated by the meta_format
8362 	 * field.
8363 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
8364 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
8365 	 *   act_rec_ptr[25:0]}
8366 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
8367 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
8368 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
8369 	 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
8370 	 * of the host address from the first BD used to place the packet.
8371 	 */
8372 	uint32_t	metadata2;
8373 	uint16_t	errors_v2;
8374 	/*
8375 	 * This value is written by the NIC such that it will be different
8376 	 * for each pass through the completion queue. The even passes
8377 	 * will write 1. The odd passes will write 0.
8378 	 */
8379 	#define RX_TPA_START_V3_CMPL_V2				UINT32_C(0x1)
8380 	#define RX_TPA_START_V3_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
8381 	#define RX_TPA_START_V3_CMPL_ERRORS_SFT			1
8382 	/*
8383 	 * This error indicates that there was some sort of problem with
8384 	 * the BDs for the packetThe packet should be treated as
8385 	 * invalid.
8386 	 */
8387 	#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
8388 	#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_SFT	1
8389 	/* No buffer error */
8390 		#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER	(UINT32_C(0x0) << 1)
8391 	/*
8392 	 * Did Not Fit:
8393 	 * Packet did not fit into packet buffer provided. This means
8394 	 * that the TPA Start packet was too big to be placed into the
8395 	 * per-packet maximum number of physical buffers configured for
8396 	 * the VNIC, or that it was too big to be placed into the
8397 	 * per-aggregation maximum number of physical buffers configured
8398 	 * for the VNIC. This error only occurs when the VNIC is
8399 	 * configured for variable size receive buffers.
8400 	 */
8401 		#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT   (UINT32_C(0x1) << 1)
8402 	/*
8403 	 * Bad Format:
8404 	 * BDs were not formatted correctly.
8405 	 */
8406 		#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT	(UINT32_C(0x3) << 1)
8407 	/*
8408 	 * Flush:
8409 	 * There was a bad_format error on the previous operation
8410 	 */
8411 		#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_FLUSH	(UINT32_C(0x5) << 1)
8412 		#define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_LAST	RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_FLUSH
8413 	/*
8414 	 * This is data from the CFA block as indicated by the meta_format
8415 	 * field.
8416 	 */
8417 	uint16_t	metadata0;
8418 	/* When meta_format != 0, this value is the VLAN VID. */
8419 	#define RX_TPA_START_V3_CMPL_METADATA0_VID_MASK UINT32_C(0xfff)
8420 	#define RX_TPA_START_V3_CMPL_METADATA0_VID_SFT 0
8421 	/* When meta_format != 0, this value is the VLAN DE. */
8422 	#define RX_TPA_START_V3_CMPL_METADATA0_DE	UINT32_C(0x1000)
8423 	/* When meta_format != 0, this value is the VLAN PRI. */
8424 	#define RX_TPA_START_V3_CMPL_METADATA0_PRI_MASK UINT32_C(0xe000)
8425 	#define RX_TPA_START_V3_CMPL_METADATA0_PRI_SFT 13
8426 	/*
8427 	 * This field contains the outer_l3_offset, inner_l2_offset,
8428 	 * inner_l3_offset, and inner_l4_size.
8429 	 *
8430 	 * hdr_offsets[8:0] contains the outer_l3_offset.
8431 	 * hdr_offsets[17:9] contains the inner_l2_offset.
8432 	 * hdr_offsets[26:18] contains the inner_l3_offset.
8433 	 * hdr_offsets[31:27] contains the inner_l4_size.
8434 	 */
8435 	uint32_t	hdr_offsets;
8436 } rx_tpa_start_v3_cmpl_hi_t, *prx_tpa_start_v3_cmpl_hi_t;
8437 
8438 /*
8439  * This TPA completion structure is used on devices where the
8440  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
8441  */
8442 /* rx_tpa_end_cmpl (size:128b/16B) */
8443 
8444 typedef struct rx_tpa_end_cmpl {
8445 	uint16_t	flags_type;
8446 	/*
8447 	 * This field indicates the exact type of the completion.
8448 	 * By convention, the LSB identifies the length of the
8449 	 * record in 16B units. Even values indicate 16B
8450 	 * records. Odd values indicate 32B
8451 	 * records.
8452 	 */
8453 	#define RX_TPA_END_CMPL_TYPE_MASK			UINT32_C(0x3f)
8454 	#define RX_TPA_END_CMPL_TYPE_SFT			0
8455 	/*
8456 	 * RX L2 TPA End Completion:
8457 	 * Completion at the end of a TPA operation.
8458 	 * Length = 32B
8459 	 */
8460 		#define RX_TPA_END_CMPL_TYPE_RX_TPA_END		UINT32_C(0x15)
8461 		#define RX_TPA_END_CMPL_TYPE_LAST			RX_TPA_END_CMPL_TYPE_RX_TPA_END
8462 	#define RX_TPA_END_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
8463 	#define RX_TPA_END_CMPL_FLAGS_SFT			6
8464 	/*
8465 	 * When this bit is '1', it indicates a packet that has an
8466 	 * error of some type. Type of error is indicated in
8467 	 * error_flags.
8468 	 */
8469 	#define RX_TPA_END_CMPL_FLAGS_ERROR			UINT32_C(0x40)
8470 	/* This field indicates how the packet was placed in the buffer. */
8471 	#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
8472 	#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT		7
8473 	/*
8474 	 * Jumbo:
8475 	 * TPA Packet was placed using jumbo algorithm. This means
8476 	 * that the first buffer will be filled with data before
8477 	 * moving to aggregation buffers. Each aggregation buffer
8478 	 * will be filled before moving to the next aggregation
8479 	 * buffer.
8480 	 */
8481 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
8482 	/*
8483 	 * Header/Data Separation:
8484 	 * Packet was placed using Header/Data separation algorithm.
8485 	 * The separation location is indicated by the itype field.
8486 	 */
8487 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
8488 	/*
8489 	 * IOC/Jumbo:
8490 	 * Packet will be placed using In-Order Completion/Jumbo where
8491 	 * the first packet of the aggregation is placed using Jumbo
8492 	 * Placement. Subsequent packets will be placed such that each
8493 	 * packet starts at the beginning of an aggregation buffer.
8494 	 */
8495 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_JUMBO	(UINT32_C(0x4) << 7)
8496 	/*
8497 	 * GRO/Jumbo:
8498 	 * Packet will be placed using GRO/Jumbo where the first
8499 	 * packet is filled with data. Subsequent packets will be
8500 	 * placed such that any one packet does not span two
8501 	 * aggregation buffers unless it starts at the beginning of
8502 	 * an aggregation buffer.
8503 	 */
8504 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO	(UINT32_C(0x5) << 7)
8505 	/*
8506 	 * GRO/Header-Data Separation:
8507 	 * Packet will be placed using GRO/HDS where the header
8508 	 * is in the first packet.
8509 	 * Payload of each packet will be
8510 	 * placed such that any one packet does not span two
8511 	 * aggregation buffers unless it starts at the beginning of
8512 	 * an aggregation buffer.
8513 	 */
8514 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
8515 	/*
8516 	 * IOC/Header-Data Separation:
8517 	 * Packet will be placed using In-Order Completion/HDS where
8518 	 * the header is in the first packet buffer. Payload of each
8519 	 * packet will be placed such that each packet starts at the
8520 	 * beginning of an aggregation buffer.
8521 	 */
8522 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS	(UINT32_C(0x7) << 7)
8523 		#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST		RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS
8524 	/* When set, this bit indicates that the timestamp field is valid. */
8525 	#define RX_TPA_END_CMPL_FLAGS_TIMESTAMP_VALID	UINT32_C(0x400)
8526 	/*
8527 	 * This bit is '1' if metadata has been added to the end of the
8528 	 * packet in host memory. Metadata starts at the first 32B boundary
8529 	 * after the end of the packet for regular and jumbo placement.
8530 	 * It starts at the first 32B boundary after the end of the header
8531 	 * for HDS placement. The length of the metadata is indicated in the
8532 	 * metadata itself.
8533 	 */
8534 	#define RX_TPA_END_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
8535 	/*
8536 	 * This value indicates what the inner packet determined for the
8537 	 * packet was.
8538 	 * - 2 TCP Packet
8539 	 *	Indicates that the packet was IP and TCP. This indicates
8540 	 *	that the ip_cs field is valid and that the tcp_udp_cs
8541 	 *	field is valid and contains the TCP checksum.
8542 	 *	This also indicates that the payload_offset field is valid.
8543 	 */
8544 	#define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
8545 	#define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT		12
8546 	/*
8547 	 * This value is zero for TPA End completions.
8548 	 * There is no data in the buffer that corresponds to the opaque
8549 	 * value in this completion.
8550 	 */
8551 	uint16_t	len;
8552 	/*
8553 	 * This is a copy of the opaque field from the RX BD this completion
8554 	 * corresponds to.
8555 	 */
8556 	uint32_t	opaque;
8557 	/*
8558 	 * This value is written by the NIC such that it will be different
8559 	 * for each pass through the completion queue. The even passes
8560 	 * will write 1. The odd passes will write 0.
8561 	 */
8562 	uint8_t	agg_bufs_v1;
8563 	/*
8564 	 * This value is written by the NIC such that it will be different
8565 	 * for each pass through the completion queue. The even passes
8566 	 * will write 1. The odd passes will write 0.
8567 	 */
8568 	#define RX_TPA_END_CMPL_V1	UINT32_C(0x1)
8569 	/*
8570 	 * This value is the number of aggregation buffers that follow this
8571 	 * entry in the completion ring that are a part of this aggregation
8572 	 * packet.
8573 	 * If the value is zero, then the packet is completely contained
8574 	 * in the buffer space provided in the aggregation start completion.
8575 	 */
8576 	#define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e)
8577 	#define RX_TPA_END_CMPL_AGG_BUFS_SFT 1
8578 	/* This value is the number of segments in the TPA operation. */
8579 	uint8_t	tpa_segs;
8580 	/*
8581 	 * This value indicates the offset in bytes from the beginning of the
8582 	 * packet where the inner payload starts. This value is valid for TCP,
8583 	 * UDP, FCoE, and RoCE packets.
8584 	 *
8585 	 * A value of zero indicates an offset of 256 bytes.
8586 	 */
8587 	uint8_t	payload_offset;
8588 	uint8_t	agg_id;
8589 	/* unused2 is 1 b */
8590 	#define RX_TPA_END_CMPL_UNUSED2	UINT32_C(0x1)
8591 	/*
8592 	 * This is the aggregation ID that the completion is associated
8593 	 * with. Use this number to correlate the TPA start completion
8594 	 * with the TPA end completion.
8595 	 */
8596 	#define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe)
8597 	#define RX_TPA_END_CMPL_AGG_ID_SFT  1
8598 	/*
8599 	 * For non-GRO packets, this value is the
8600 	 * timestamp delta between earliest and latest timestamp values for
8601 	 * TPA packet. If packets were not time stamped, then delta will be
8602 	 * zero.
8603 	 *
8604 	 * For GRO packets, this field is zero except for the following
8605 	 * sub-fields.
8606 	 * - tsdelta[31]
8607 	 *	Timestamp present indication. When '0', no Timestamp
8608 	 *	option is in the packet. When '1', then a Timestamp
8609 	 *	option is present in the packet.
8610 	 */
8611 	uint32_t	tsdelta;
8612 } rx_tpa_end_cmpl_t, *prx_tpa_end_cmpl_t;
8613 
8614 /*
8615  * Last 16 bytes of rx_tpa_end_cmpl.
8616  *
8617  * This TPA completion structure is used on devices where the
8618  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
8619  */
8620 /* rx_tpa_end_cmpl_hi (size:128b/16B) */
8621 
8622 typedef struct rx_tpa_end_cmpl_hi {
8623 	uint32_t	tpa_dup_acks;
8624 	/*
8625 	 * This value is the number of duplicate ACKs that have been
8626 	 * received as part of the TPA operation.
8627 	 */
8628 	#define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
8629 	#define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0
8630 	/*
8631 	 * This value is the valid when TPA completion is active. It
8632 	 * indicates the length of the longest segment of the TPA operation
8633 	 * for LRO mode and the length of the first segment in GRO mode.
8634 	 *
8635 	 * This value may be used by GRO software to re-construct the original
8636 	 * packet stream from the TPA packet. This is the length of all
8637 	 * but the last segment for GRO. In LRO mode this value may be used
8638 	 * to indicate MSS size to the stack.
8639 	 */
8640 	uint16_t	tpa_seg_len;
8641 	/*
8642 	 * The lower 16b of the timestamp of the last packet added to the
8643 	 * aggregation. Only valid when flags.timestamp_valid is set.
8644 	 */
8645 	uint16_t	timestamp_lower;
8646 	uint16_t	errors_v2;
8647 	/*
8648 	 * This value is written by the NIC such that it will be different
8649 	 * for each pass through the completion queue. The even passes
8650 	 * will write 1. The odd passes will write 0.
8651 	 */
8652 	#define RX_TPA_END_CMPL_V2				UINT32_C(0x1)
8653 	#define RX_TPA_END_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
8654 	#define RX_TPA_END_CMPL_ERRORS_SFT			1
8655 	/*
8656 	 * This error indicates that there was some sort of problem with
8657 	 * the BDs for the packet that was found after part of the
8658 	 * packet was already placed. The packet should be treated as
8659 	 * invalid.
8660 	 */
8661 	#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
8662 	#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT	1
8663 	/*
8664 	 * This error occurs when there is a fatal HW problem in
8665 	 * the chip only. It indicates that there were not
8666 	 * BDs on chip but that there was adequate reservation.
8667 	 * provided by the TPA block.
8668 	 */
8669 		#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP   (UINT32_C(0x2) << 1)
8670 	/*
8671 	 * This error occurs when TPA block was not configured to
8672 	 * reserve adequate BDs for TPA operations on this RX
8673 	 * ring. All data for the TPA operation was not placed.
8674 	 *
8675 	 * This error can also be generated when the number of
8676 	 * segments is not programmed correctly in TPA and the
8677 	 * 33 total aggregation buffers allowed for the TPA
8678 	 * operation has been exceeded.
8679 	 */
8680 		#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR	(UINT32_C(0x4) << 1)
8681 		#define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST	RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR
8682 	/*
8683 	 * The upper 16b of the timestamp of the last packet added to the
8684 	 * aggregation. Only valid when flags.timestamp_valid is set.
8685 	 */
8686 	uint16_t	timestamp_upper;
8687 	/*
8688 	 * This is the opaque value that was completed for the TPA start
8689 	 * completion that corresponds to this TPA end completion.
8690 	 */
8691 	uint32_t	start_opaque;
8692 } rx_tpa_end_cmpl_hi_t, *prx_tpa_end_cmpl_hi_t;
8693 
8694 /*
8695  * This TPA completion structure is used on devices where the
8696  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
8697  */
8698 /* rx_tpa_v2_start_cmpl (size:128b/16B) */
8699 
8700 typedef struct rx_tpa_v2_start_cmpl {
8701 	uint16_t	flags_type;
8702 	/*
8703 	 * This field indicates the exact type of the completion.
8704 	 * By convention, the LSB identifies the length of the
8705 	 * record in 16B units. Even values indicate 16B
8706 	 * records. Odd values indicate 32B
8707 	 * records.
8708 	 */
8709 	#define RX_TPA_V2_START_CMPL_TYPE_MASK			UINT32_C(0x3f)
8710 	#define RX_TPA_V2_START_CMPL_TYPE_SFT			0
8711 	/*
8712 	 * RX L2 TPA Start Completion:
8713 	 * Completion at the beginning of a TPA operation.
8714 	 * Length = 32B
8715 	 */
8716 		#define RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START		UINT32_C(0x13)
8717 		#define RX_TPA_V2_START_CMPL_TYPE_LAST			RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START
8718 	#define RX_TPA_V2_START_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
8719 	#define RX_TPA_V2_START_CMPL_FLAGS_SFT			6
8720 	/* This bit will always be '0' for TPA start completions. */
8721 	#define RX_TPA_V2_START_CMPL_FLAGS_ERROR			UINT32_C(0x40)
8722 	/* This field indicates how the packet was placed in the buffer. */
8723 	#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
8724 	#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_SFT		7
8725 	/*
8726 	 * Jumbo:
8727 	 * TPA Packet was placed using jumbo algorithm. This means
8728 	 * that the first buffer will be filled with data before
8729 	 * moving to aggregation buffers. Each aggregation buffer
8730 	 * will be filled before moving to the next aggregation
8731 	 * buffer.
8732 	 */
8733 		#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
8734 	/*
8735 	 * Header/Data Separation:
8736 	 * Packet was placed using Header/Data separation algorithm.
8737 	 * The separation location is indicated by the itype field.
8738 	 */
8739 		#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
8740 	/*
8741 	 * GRO/Jumbo:
8742 	 * Packet will be placed using GRO/Jumbo where the first
8743 	 * packet is filled with data. Subsequent packets will be
8744 	 * placed such that any one packet does not span two
8745 	 * aggregation buffers unless it starts at the beginning of
8746 	 * an aggregation buffer.
8747 	 */
8748 		#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO	(UINT32_C(0x5) << 7)
8749 	/*
8750 	 * GRO/Header-Data Separation:
8751 	 * Packet will be placed using GRO/HDS where the header
8752 	 * is in the first packet.
8753 	 * Payload of each packet will be
8754 	 * placed such that any one packet does not span two
8755 	 * aggregation buffers unless it starts at the beginning of
8756 	 * an aggregation buffer.
8757 	 */
8758 		#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
8759 		#define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_LAST		RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
8760 	/* This bit is '1' if the RSS field in this completion is valid. */
8761 	#define RX_TPA_V2_START_CMPL_FLAGS_RSS_VALID		UINT32_C(0x400)
8762 	/*
8763 	 * For devices that support timestamps, when this bit is cleared the
8764 	 * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
8765 	 * field contains the 32b timestamp for
8766 	 * the packet from the MAC. When this bit is set, the
8767 	 * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
8768 	 * field contains the outer_l3_offset, inner_l2_offset,
8769 	 * inner_l3_offset, and inner_l4_size.
8770 	 */
8771 	#define RX_TPA_V2_START_CMPL_FLAGS_TIMESTAMP_FLD_FORMAT	UINT32_C(0x800)
8772 	/*
8773 	 * This value indicates what the inner packet determined for the
8774 	 * packet was.
8775 	 */
8776 	#define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
8777 	#define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_SFT		12
8778 	/*
8779 	 * TCP Packet:
8780 	 * Indicates that the packet was IP and TCP.
8781 	 */
8782 		#define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 12)
8783 		#define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_LAST		RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP
8784 	/*
8785 	 * This value indicates the amount of packet data written to the
8786 	 * buffer the opaque field in this completion corresponds to.
8787 	 */
8788 	uint16_t	len;
8789 	/*
8790 	 * This is a copy of the opaque field from the RX BD this completion
8791 	 * corresponds to.
8792 	 */
8793 	uint32_t	opaque;
8794 	/*
8795 	 * This value is written by the NIC such that it will be different
8796 	 * for each pass through the completion queue. The even passes
8797 	 * will write 1. The odd passes will write 0.
8798 	 */
8799 	uint8_t	v1;
8800 	/*
8801 	 * This value is written by the NIC such that it will be different
8802 	 * for each pass through the completion queue. The even passes
8803 	 * will write 1. The odd passes will write 0.
8804 	 */
8805 	#define RX_TPA_V2_START_CMPL_V1 UINT32_C(0x1)
8806 	#define RX_TPA_V2_START_CMPL_LAST RX_TPA_V2_START_CMPL_V1
8807 	/*
8808 	 * This is the RSS hash type for the packet. The value is packed
8809 	 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
8810 	 *
8811 	 * The value of tuple_extrac_op provides the information about
8812 	 * what fields the hash was computed on.
8813 	 * * 0: The RSS hash was computed over source IP address,
8814 	 * destination IP address, source port, and destination port of inner
8815 	 * IP and TCP or UDP headers. Note: For non-tunneled packets,
8816 	 * the packet headers are considered inner packet headers for the RSS
8817 	 * hash computation purpose.
8818 	 * * 1: The RSS hash was computed over source IP address and destination
8819 	 * IP address of inner IP header. Note: For non-tunneled packets,
8820 	 * the packet headers are considered inner packet headers for the RSS
8821 	 * hash computation purpose.
8822 	 * * 2: The RSS hash was computed over source IP address,
8823 	 * destination IP address, source port, and destination port of
8824 	 * IP and TCP or UDP headers of outer tunnel headers.
8825 	 * Note: For non-tunneled packets, this value is not applicable.
8826 	 * * 3: The RSS hash was computed over source IP address and
8827 	 * destination IP address of IP header of outer tunnel headers.
8828 	 * Note: For non-tunneled packets, this value is not applicable.
8829 	 *
8830 	 * Note that 4-tuples values listed above are applicable
8831 	 * for layer 4 protocols supported and enabled for RSS in the hardware,
8832 	 * HWRM firmware, and drivers. For example, if RSS hash is supported and
8833 	 * enabled for TCP traffic only, then the values of tuple_extract_op
8834 	 * corresponding to 4-tuples are only valid for TCP traffic.
8835 	 */
8836 	uint8_t	rss_hash_type;
8837 	/*
8838 	 * This is the aggregation ID that the completion is associated
8839 	 * with. Use this number to correlate the TPA start completion
8840 	 * with the TPA end completion.
8841 	 */
8842 	uint16_t	agg_id;
8843 	/*
8844 	 * This value is the RSS hash value calculated for the packet
8845 	 * based on the mode bits and key value in the VNIC.
8846 	 */
8847 	uint32_t	rss_hash;
8848 } rx_tpa_v2_start_cmpl_t, *prx_tpa_v2_start_cmpl_t;
8849 
8850 /*
8851  * Last 16 bytes of rx_tpa_v2_start_cmpl.
8852  *
8853  * This TPA completion structure is used on devices where the
8854  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
8855  */
8856 /* rx_tpa_v2_start_cmpl_hi (size:128b/16B) */
8857 
8858 typedef struct rx_tpa_v2_start_cmpl_hi {
8859 	uint32_t	flags2;
8860 	/*
8861 	 * This indicates that the ip checksum was calculated for the
8862 	 * inner packet and that the sum passed for all segments
8863 	 * included in the aggregation.
8864 	 */
8865 	#define RX_TPA_V2_START_CMPL_FLAGS2_IP_CS_CALC		UINT32_C(0x1)
8866 	/*
8867 	 * This indicates that the TCP, UDP or ICMP checksum was
8868 	 * calculated for the inner packet and that the sum passed
8869 	 * for all segments included in the aggregation.
8870 	 */
8871 	#define RX_TPA_V2_START_CMPL_FLAGS2_L4_CS_CALC		UINT32_C(0x2)
8872 	/*
8873 	 * This indicates that the ip checksum was calculated for the
8874 	 * tunnel header and that the sum passed for all segments
8875 	 * included in the aggregation.
8876 	 */
8877 	#define RX_TPA_V2_START_CMPL_FLAGS2_T_IP_CS_CALC		UINT32_C(0x4)
8878 	/*
8879 	 * This indicates that the UDP checksum was
8880 	 * calculated for the tunnel packet and that the sum passed for
8881 	 * all segments included in the aggregation.
8882 	 */
8883 	#define RX_TPA_V2_START_CMPL_FLAGS2_T_L4_CS_CALC		UINT32_C(0x8)
8884 	/* This value indicates what format the metadata field is. */
8885 	#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
8886 	#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_SFT		4
8887 	/* No metadata information. Value is zero. */
8888 		#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
8889 	/*
8890 	 * The metadata field contains the VLAN tag and TPID value.
8891 	 * - metadata[11:0] contains the vlan VID value.
8892 	 * - metadata[12] contains the vlan DE value.
8893 	 * - metadata[15:13] contains the vlan PRI value.
8894 	 * - metadata[31:16] contains the vlan TPID value.
8895 	 */
8896 		#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_VLAN		(UINT32_C(0x1) << 4)
8897 	/*
8898 	 * If ext_meta_format is equal to 1, the metadata field
8899 	 * contains the lower 16b of the tunnel ID value, justified
8900 	 * to LSB
8901 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
8902 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
8903 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
8904 	 * - GRE = KEY[31:0] -> key field with bit mask. Zero if K = 0
8905 	 * - IPV4 = 0 (not populated)
8906 	 * - IPV6 = Flow Label[19:0]
8907 	 * - PPPoE = sessionID[15:0]
8908 	 * - MPLs = Outer label[19:0]
8909 	 * - UPAR = Selected[31:0] with bit mask
8910 	 */
8911 		#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
8912 	/*
8913 	 * if ext_meta_format is equal to 1, metadata field contains
8914 	 * 16b metadata from the prepended header (chdr_data).
8915 	 */
8916 		#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
8917 	/*
8918 	 * If ext_meta_format is equal to 1, the metadata field contains
8919 	 * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
8920 	 * inner_l4_size.
8921 	 * - metadata[8:0] contains the outer_l3_offset.
8922 	 * - metadata[17:9] contains the inner_l2_offset.
8923 	 * - metadata[26:18] contains the inner_l3_offset.
8924 	 * - metadata[31:27] contains the inner_l4_size.
8925 	 */
8926 		#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
8927 		#define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_LAST		RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
8928 	/*
8929 	 * This field indicates the IP type for the inner-most IP header.
8930 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
8931 	 */
8932 	#define RX_TPA_V2_START_CMPL_FLAGS2_IP_TYPE			UINT32_C(0x100)
8933 	/*
8934 	 * This indicates that the complete 1's complement checksum was
8935 	 * calculated for the packet.
8936 	 */
8937 	#define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
8938 	/*
8939 	 * The combination of this value and meta_format indicated what
8940 	 * format the metadata field is.
8941 	 */
8942 	#define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_MASK	UINT32_C(0xc00)
8943 	#define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_SFT	10
8944 	/*
8945 	 * This value is the complete 1's complement checksum calculated from
8946 	 * the start of the outer L3 header to the end of the packet (not
8947 	 * including the ethernet crc). It is valid when the
8948 	 * 'complete_checksum_calc' flag is set. For TPA Start completions,
8949 	 * the complete checksum is calculated for the first packet in the
8950 	 * aggregation only.
8951 	 */
8952 	#define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
8953 	#define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT	16
8954 	/*
8955 	 * This is data from the CFA block as indicated by the meta_format
8956 	 * field.
8957 	 */
8958 	uint32_t	metadata;
8959 	/* When {ext_meta_format,meta_format}=1, this value is the VLAN VID. */
8960 	#define RX_TPA_V2_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
8961 	#define RX_TPA_V2_START_CMPL_METADATA_VID_SFT  0
8962 	/* When {ext_meta_format,meta_format}=1, this value is the VLAN DE. */
8963 	#define RX_TPA_V2_START_CMPL_METADATA_DE	UINT32_C(0x1000)
8964 	/* When {ext_meta_format,meta_format}=1, this value is the VLAN PRI. */
8965 	#define RX_TPA_V2_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
8966 	#define RX_TPA_V2_START_CMPL_METADATA_PRI_SFT  13
8967 	/* When {ext_meta_format,meta_format}=1, this value is the VLAN TPID. */
8968 	#define RX_TPA_V2_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
8969 	#define RX_TPA_V2_START_CMPL_METADATA_TPID_SFT 16
8970 	uint16_t	errors_v2;
8971 	/*
8972 	 * This value is written by the NIC such that it will be different
8973 	 * for each pass through the completion queue. The even passes
8974 	 * will write 1. The odd passes will write 0.
8975 	 */
8976 	#define RX_TPA_V2_START_CMPL_V2				UINT32_C(0x1)
8977 	#define RX_TPA_V2_START_CMPL_ERRORS_MASK		UINT32_C(0xfffe)
8978 	#define RX_TPA_V2_START_CMPL_ERRORS_SFT			1
8979 	/*
8980 	 * This error indicates that there was some sort of problem with
8981 	 * the BDs for the packet that was found after part of the
8982 	 * packet was already placed. The packet should be treated as
8983 	 * invalid.
8984 	 */
8985 	#define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
8986 	#define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_SFT	1
8987 	/* No buffer error */
8988 		#define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER	(UINT32_C(0x0) << 1)
8989 	/*
8990 	 * Bad Format:
8991 	 * BDs were not formatted correctly.
8992 	 */
8993 		#define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT   (UINT32_C(0x3) << 1)
8994 	/*
8995 	 * Flush:
8996 	 * There was a bad_format error on the previous operation
8997 	 */
8998 		#define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH	(UINT32_C(0x5) << 1)
8999 		#define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_LAST	RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH
9000 	/*
9001 	 * This field identifies the CFA action rule that was used for this
9002 	 * packet.
9003 	 */
9004 	uint16_t	cfa_code;
9005 	/*
9006 	 * For devices that support timestamps this field is overridden
9007 	 * with the timestamp value. When `flags.timestamp_fld_format` is
9008 	 * cleared, this field contains the 32b timestamp for the packet from the
9009 	 * MAC.
9010 	 *
9011 	 * When `flags.timestamp_fld_format` is set, this field contains the
9012 	 * outer_l3_offset, inner_l2_offset, inner_l3_offset, and inner_l4_size
9013 	 * as defined below.
9014 	 */
9015 	uint32_t	inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
9016 	/*
9017 	 * This is the offset from the beginning of the packet in bytes for
9018 	 * the outer L3 header. If there is no outer L3 header, then this
9019 	 * value is zero.
9020 	 */
9021 	#define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
9022 	#define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_SFT 0
9023 	/*
9024 	 * This is the offset from the beginning of the packet in bytes for
9025 	 * the inner most L2 header.
9026 	 */
9027 	#define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
9028 	#define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_SFT 9
9029 	/*
9030 	 * This is the offset from the beginning of the packet in bytes for
9031 	 * the inner most L3 header.
9032 	 */
9033 	#define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
9034 	#define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_SFT 18
9035 	/*
9036 	 * This is the size in bytes of the inner most L4 header.
9037 	 * This can be subtracted from the payload_offset to determine
9038 	 * the start of the inner most L4 header.
9039 	 */
9040 	#define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
9041 	#define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_SFT   27
9042 } rx_tpa_v2_start_cmpl_hi_t, *prx_tpa_v2_start_cmpl_hi_t;
9043 
9044 /*
9045  * This TPA completion structure is used on devices where the
9046  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
9047  */
9048 /* rx_tpa_v2_end_cmpl (size:128b/16B) */
9049 
9050 typedef struct rx_tpa_v2_end_cmpl {
9051 	uint16_t	flags_type;
9052 	/*
9053 	 * This field indicates the exact type of the completion.
9054 	 * By convention, the LSB identifies the length of the
9055 	 * record in 16B units. Even values indicate 16B
9056 	 * records. Odd values indicate 32B
9057 	 * records.
9058 	 */
9059 	#define RX_TPA_V2_END_CMPL_TYPE_MASK			UINT32_C(0x3f)
9060 	#define RX_TPA_V2_END_CMPL_TYPE_SFT			0
9061 	/*
9062 	 * RX L2 TPA End Completion:
9063 	 * Completion at the end of a TPA operation.
9064 	 * Length = 32B
9065 	 */
9066 		#define RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END		UINT32_C(0x15)
9067 		#define RX_TPA_V2_END_CMPL_TYPE_LAST			RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END
9068 	#define RX_TPA_V2_END_CMPL_FLAGS_MASK			UINT32_C(0xffc0)
9069 	#define RX_TPA_V2_END_CMPL_FLAGS_SFT			6
9070 	/*
9071 	 * When this bit is '1', it indicates a packet that has an
9072 	 * error of some type. Type of error is indicated in
9073 	 * error_flags.
9074 	 */
9075 	#define RX_TPA_V2_END_CMPL_FLAGS_ERROR			UINT32_C(0x40)
9076 	/* This field indicates how the packet was placed in the buffer. */
9077 	#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_MASK		UINT32_C(0x380)
9078 	#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_SFT		7
9079 	/*
9080 	 * Jumbo:
9081 	 * TPA Packet was placed using jumbo algorithm. This means
9082 	 * that the first buffer will be filled with data before
9083 	 * moving to aggregation buffers. Each aggregation buffer
9084 	 * will be filled before moving to the next aggregation
9085 	 * buffer.
9086 	 */
9087 		#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_JUMBO		(UINT32_C(0x1) << 7)
9088 	/*
9089 	 * Header/Data Separation:
9090 	 * Packet was placed using Header/Data separation algorithm.
9091 	 * The separation location is indicated by the itype field.
9092 	 */
9093 		#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_HDS		(UINT32_C(0x2) << 7)
9094 	/*
9095 	 * GRO/Jumbo:
9096 	 * Packet will be placed using GRO/Jumbo where the first
9097 	 * packet is filled with data. Subsequent packets will be
9098 	 * placed such that any one packet does not span two
9099 	 * aggregation buffers unless it starts at the beginning of
9100 	 * an aggregation buffer.
9101 	 */
9102 		#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO	(UINT32_C(0x5) << 7)
9103 	/*
9104 	 * GRO/Header-Data Separation:
9105 	 * Packet will be placed using GRO/HDS where the header
9106 	 * is in the first packet.
9107 	 * Payload of each packet will be
9108 	 * placed such that any one packet does not span two
9109 	 * aggregation buffers unless it starts at the beginning of
9110 	 * an aggregation buffer.
9111 	 */
9112 		#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_HDS	(UINT32_C(0x6) << 7)
9113 	/*
9114 	 * IOC/Header-Data Separation:
9115 	 * Packet will be placed using In-Order Completion/HDS where
9116 	 * the header is in the first packet buffer. Payload of each
9117 	 * packet will be placed such that each packet starts at the
9118 	 * beginning of an aggregation buffer.
9119 	 */
9120 		#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_IOC_HDS	(UINT32_C(0x7) << 7)
9121 		#define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_LAST		RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_IOC_HDS
9122 	/* unused is 1 b */
9123 	#define RX_TPA_V2_END_CMPL_FLAGS_UNUSED			UINT32_C(0x400)
9124 	/*
9125 	 * This bit is '1' if metadata has been added to the end of the
9126 	 * packet in host memory. Metadata starts at the first 32B boundary
9127 	 * after the end of the packet for regular and jumbo placement.
9128 	 * It starts at the first 32B boundary after the end of the header
9129 	 * for HDS placement. The length of the metadata is indicated in the
9130 	 * metadata itself.
9131 	 */
9132 	#define RX_TPA_V2_END_CMPL_FLAGS_PKT_METADATA_PRESENT	UINT32_C(0x800)
9133 	/*
9134 	 * This value indicates what the inner packet determined for the
9135 	 * packet was.
9136 	 * - 2 TCP Packet
9137 	 *	Indicates that the packet was IP and TCP. This indicates
9138 	 *	that the ip_cs field is valid and that the tcp_udp_cs
9139 	 *	field is valid and contains the TCP checksum.
9140 	 *	This also indicates that the payload_offset field is valid.
9141 	 */
9142 	#define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_MASK		UINT32_C(0xf000)
9143 	#define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_SFT		12
9144 	/*
9145 	 * This value is zero for TPA End completions.
9146 	 * There is no data in the buffer that corresponds to the opaque
9147 	 * value in this completion.
9148 	 */
9149 	uint16_t	len;
9150 	/*
9151 	 * This is a copy of the opaque field from the RX BD this completion
9152 	 * corresponds to.
9153 	 */
9154 	uint32_t	opaque;
9155 	uint8_t	v1;
9156 	/*
9157 	 * This value is written by the NIC such that it will be different
9158 	 * for each pass through the completion queue. The even passes
9159 	 * will write 1. The odd passes will write 0.
9160 	 */
9161 	#define RX_TPA_V2_END_CMPL_V1	UINT32_C(0x1)
9162 	/* This value is the number of segments in the TPA operation. */
9163 	uint8_t	tpa_segs;
9164 	/*
9165 	 * This is the aggregation ID that the completion is associated
9166 	 * with. Use this number to correlate the TPA start completion
9167 	 * with the TPA end completion.
9168 	 */
9169 	uint16_t	agg_id;
9170 	/*
9171 	 * For non-GRO packets, this value is the
9172 	 * timestamp delta between earliest and latest timestamp values for
9173 	 * TPA packet. If packets were not time stamped, then delta will be
9174 	 * zero.
9175 	 *
9176 	 * For GRO packets, this field is zero except for the following
9177 	 * sub-fields.
9178 	 * - tsdelta[31]
9179 	 *	Timestamp present indication. When '0', no Timestamp
9180 	 *	option is in the packet. When '1', then a Timestamp
9181 	 *	option is present in the packet.
9182 	 */
9183 	uint32_t	tsdelta;
9184 } rx_tpa_v2_end_cmpl_t, *prx_tpa_v2_end_cmpl_t;
9185 
9186 /*
9187  * Last 16 bytes of rx_tpa_v2_end_cmpl.
9188  *
9189  * This TPA completion structure is used on devices where the
9190  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
9191  */
9192 /* rx_tpa_v2_end_cmpl_hi (size:128b/16B) */
9193 
9194 typedef struct rx_tpa_v2_end_cmpl_hi {
9195 	/*
9196 	 * This value is the number of duplicate ACKs that have been
9197 	 * received as part of the TPA operation.
9198 	 */
9199 	uint16_t	tpa_dup_acks;
9200 	/*
9201 	 * This value is the number of duplicate ACKs that have been
9202 	 * received as part of the TPA operation.
9203 	 */
9204 	#define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
9205 	#define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_SFT 0
9206 	/*
9207 	 * This value indicated the offset in bytes from the beginning of
9208 	 * the packet where the inner payload starts. This value is valid
9209 	 * for TCP, UDP, FCoE and RoCE packets
9210 	 */
9211 	uint8_t	payload_offset;
9212 	/*
9213 	 * The value is the total number of aggregation buffers that were
9214 	 * used in the TPA operation. All TPA aggregation buffer completions
9215 	 * precede the TPA End completion. If the value is zero, then the
9216 	 * aggregation is completely contained in the buffer space provided
9217 	 * in the aggregation start completion.
9218 	 * Note that the field is simply provided as a cross check.
9219 	 */
9220 	uint8_t	tpa_agg_bufs;
9221 	/*
9222 	 * This value is the valid when TPA completion is active. It
9223 	 * indicates the length of the longest segment of the TPA operation
9224 	 * for LRO mode and the length of the first segment in GRO mode.
9225 	 *
9226 	 * This value may be used by GRO software to re-construct the original
9227 	 * packet stream from the TPA packet. This is the length of all
9228 	 * but the last segment for GRO. In LRO mode this value may be used
9229 	 * to indicate MSS size to the stack.
9230 	 */
9231 	uint16_t	tpa_seg_len;
9232 	uint16_t	unused_1;
9233 	uint16_t	errors_v2;
9234 	/*
9235 	 * This value is written by the NIC such that it will be different
9236 	 * for each pass through the completion queue. The even passes
9237 	 * will write 1. The odd passes will write 0.
9238 	 */
9239 	#define RX_TPA_V2_END_CMPL_V2				UINT32_C(0x1)
9240 	#define RX_TPA_V2_END_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
9241 	#define RX_TPA_V2_END_CMPL_ERRORS_SFT			1
9242 	/*
9243 	 * This error indicates that there was some sort of problem with
9244 	 * the BDs for the packet that was found after part of the
9245 	 * packet was already placed. The packet should be treated as
9246 	 * invalid.
9247 	 */
9248 	#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
9249 	#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_SFT	1
9250 	/* No buffer error */
9251 		#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER	(UINT32_C(0x0) << 1)
9252 	/*
9253 	 * This error occurs when there is a fatal HW problem in
9254 	 * the chip only. It indicates that there were not
9255 	 * BDs on chip but that there was adequate reservation.
9256 	 * provided by the TPA block.
9257 	 */
9258 		#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP   (UINT32_C(0x2) << 1)
9259 	/*
9260 	 * Bad Format:
9261 	 * BDs were not formatted correctly.
9262 	 */
9263 		#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT	(UINT32_C(0x3) << 1)
9264 	/*
9265 	 * This error occurs when TPA block was not configured to
9266 	 * reserve adequate BDs for TPA operations on this RX
9267 	 * ring. All data for the TPA operation was not placed.
9268 	 *
9269 	 * This error can also be generated when the number of
9270 	 * segments is not programmed correctly in TPA and the
9271 	 * 33 total aggregation buffers allowed for the TPA
9272 	 * operation has been exceeded.
9273 	 */
9274 		#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR	(UINT32_C(0x4) << 1)
9275 	/*
9276 	 * Flush:
9277 	 * There was a bad_format error on the previous operation
9278 	 */
9279 		#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH	(UINT32_C(0x5) << 1)
9280 		#define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_LAST	RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH
9281 	uint16_t	unused_2;
9282 	/*
9283 	 * This is the opaque value that was completed for the TPA start
9284 	 * completion that corresponds to this TPA end completion.
9285 	 */
9286 	uint32_t	start_opaque;
9287 } rx_tpa_v2_end_cmpl_hi_t, *prx_tpa_v2_end_cmpl_hi_t;
9288 
9289 /*
9290  * This TPA completion structure is used on devices where the
9291  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
9292  */
9293 /* rx_tpa_v2_abuf_cmpl (size:128b/16B) */
9294 
9295 typedef struct rx_tpa_v2_abuf_cmpl {
9296 	uint16_t	type;
9297 	/*
9298 	 * This field indicates the exact type of the completion.
9299 	 * By convention, the LSB identifies the length of the
9300 	 * record in 16B units. Even values indicate 16B
9301 	 * records. Odd values indicate 32B
9302 	 * records.
9303 	 */
9304 	#define RX_TPA_V2_ABUF_CMPL_TYPE_MASK	UINT32_C(0x3f)
9305 	#define RX_TPA_V2_ABUF_CMPL_TYPE_SFT	0
9306 	/*
9307 	 * RX TPA Aggregation Buffer completion:
9308 	 * Completion of an L2 aggregation buffer in support of
9309 	 * TPA packet completion. Length = 16B
9310 	 */
9311 		#define RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG  UINT32_C(0x16)
9312 		#define RX_TPA_V2_ABUF_CMPL_TYPE_LAST	RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG
9313 	/*
9314 	 * This is the length of the data for the packet stored in this
9315 	 * aggregation buffer identified by the opaque value. This does not
9316 	 * include the length of any
9317 	 * data placed in other aggregation BDs or in the packet or buffer
9318 	 * BDs. This length does not include any space added due to
9319 	 * hdr_offset register during HDS placement mode.
9320 	 */
9321 	uint16_t	len;
9322 	/*
9323 	 * This is a copy of the opaque field from the RX BD this aggregation
9324 	 * buffer corresponds to.
9325 	 */
9326 	uint32_t	opaque;
9327 	uint16_t	v;
9328 	/*
9329 	 * This value is written by the NIC such that it will be different
9330 	 * for each pass through the completion queue. The even passes
9331 	 * will write 1. The odd passes will write 0.
9332 	 */
9333 	#define RX_TPA_V2_ABUF_CMPL_V	UINT32_C(0x1)
9334 	/*
9335 	 * This is the aggregation ID that the completion is associated with. Use
9336 	 * this number to correlate the TPA agg completion with the TPA start
9337 	 * completion and the TPA end completion.
9338 	 */
9339 	uint16_t	agg_id;
9340 	uint32_t	unused_1;
9341 } rx_tpa_v2_abuf_cmpl_t, *prx_tpa_v2_abuf_cmpl_t;
9342 
9343 /* rx_abuf_cmpl (size:128b/16B) */
9344 
9345 typedef struct rx_abuf_cmpl {
9346 	uint16_t	type;
9347 	/*
9348 	 * This field indicates the exact type of the completion.
9349 	 * By convention, the LSB identifies the length of the
9350 	 * record in 16B units. Even values indicate 16B
9351 	 * records. Odd values indicate 32B
9352 	 * records.
9353 	 */
9354 	#define RX_ABUF_CMPL_TYPE_MASK  UINT32_C(0x3f)
9355 	#define RX_ABUF_CMPL_TYPE_SFT   0
9356 	/*
9357 	 * RX Aggregation Buffer completion:
9358 	 * Completion of an L2 aggregation buffer in support of
9359 	 * TPA, HDS, or Jumbo packet completion. Length = 16B
9360 	 */
9361 		#define RX_ABUF_CMPL_TYPE_RX_AGG  UINT32_C(0x12)
9362 		#define RX_ABUF_CMPL_TYPE_LAST   RX_ABUF_CMPL_TYPE_RX_AGG
9363 	/*
9364 	 * This is the length of the data for the packet stored in this
9365 	 * aggregation buffer identified by the opaque value. This does not
9366 	 * include the length of any
9367 	 * data placed in other aggregation BDs or in the packet or buffer
9368 	 * BDs. This length does not include any space added due to
9369 	 * hdr_offset register during HDS placement mode.
9370 	 */
9371 	uint16_t	len;
9372 	/*
9373 	 * This is a copy of the opaque field from the RX BD this aggregation
9374 	 * buffer corresponds to.
9375 	 */
9376 	uint32_t	opaque;
9377 	uint32_t	v;
9378 	/*
9379 	 * This value is written by the NIC such that it will be different
9380 	 * for each pass through the completion queue. The even passes
9381 	 * will write 1. The odd passes will write 0.
9382 	 */
9383 	#define RX_ABUF_CMPL_V	UINT32_C(0x1)
9384 	/* unused3 is 32 b */
9385 	uint32_t	unused_2;
9386 } rx_abuf_cmpl_t, *prx_abuf_cmpl_t;
9387 
9388 /* VEE FLUSH Completion Record (16 bytes) */
9389 /* vee_flush (size:128b/16B) */
9390 
9391 typedef struct vee_flush {
9392 	uint32_t	downstream_path_type;
9393 	/*
9394 	 * This field indicates the exact type of the completion.
9395 	 * By convention, the LSB identifies the length of the
9396 	 * record in 16B units. Even values indicate 16B
9397 	 * records. Odd values indicate 32B
9398 	 * records.
9399 	 */
9400 	#define VEE_FLUSH_TYPE_MASK	UINT32_C(0x3f)
9401 	#define VEE_FLUSH_TYPE_SFT		0
9402 	/*
9403 	 * VEE Flush Completion:
9404 	 * This completion is inserted manually by the Primate and processed
9405 	 * by the VEE hardware to ensure that all completions on a VEE
9406 	 * function have been processed by the VEE hardware before FLR
9407 	 * process is completed.
9408 	 */
9409 		#define VEE_FLUSH_TYPE_VEE_FLUSH	UINT32_C(0x1c)
9410 		#define VEE_FLUSH_TYPE_LAST		VEE_FLUSH_TYPE_VEE_FLUSH
9411 	/* downstream_path is 1 b */
9412 	#define VEE_FLUSH_DOWNSTREAM_PATH	UINT32_C(0x40)
9413 	/* This completion is associated with VEE Transmit */
9414 		#define VEE_FLUSH_DOWNSTREAM_PATH_TX	(UINT32_C(0x0) << 6)
9415 	/* This completion is associated with VEE Receive */
9416 		#define VEE_FLUSH_DOWNSTREAM_PATH_RX	(UINT32_C(0x1) << 6)
9417 		#define VEE_FLUSH_DOWNSTREAM_PATH_LAST VEE_FLUSH_DOWNSTREAM_PATH_RX
9418 	/*
9419 	 * This is an opaque value that is passed through the completion
9420 	 * to the VEE handler SW and is used to indicate what VEE VQ or
9421 	 * function has completed FLR processing.
9422 	 */
9423 	uint32_t	opaque;
9424 	uint32_t	v;
9425 	/*
9426 	 * This value is written by the NIC such that it will be different
9427 	 * for each pass through the completion queue. The even passes will
9428 	 * write 1. The odd passes will write 0.
9429 	 */
9430 	#define VEE_FLUSH_V	UINT32_C(0x1)
9431 	/* unused3 is 32 b */
9432 	uint32_t	unused_3;
9433 } vee_flush_t, *pvee_flush_t;
9434 
9435 /* eject_cmpl (size:128b/16B) */
9436 
9437 typedef struct eject_cmpl {
9438 	uint16_t	type;
9439 	/*
9440 	 * This field indicates the exact type of the completion.
9441 	 * By convention, the LSB identifies the length of the
9442 	 * record in 16B units. Even values indicate 16B
9443 	 * records. Odd values indicate 32B
9444 	 * records.
9445 	 */
9446 	#define EJECT_CMPL_TYPE_MASK	UINT32_C(0x3f)
9447 	#define EJECT_CMPL_TYPE_SFT	0
9448 	/*
9449 	 * Statistics Ejection Completion:
9450 	 * Completion of statistics data ejection buffer.
9451 	 * Length = 16B
9452 	 */
9453 		#define EJECT_CMPL_TYPE_STAT_EJECT   UINT32_C(0x1a)
9454 		#define EJECT_CMPL_TYPE_LAST	EJECT_CMPL_TYPE_STAT_EJECT
9455 	#define EJECT_CMPL_FLAGS_MASK	UINT32_C(0xffc0)
9456 	#define EJECT_CMPL_FLAGS_SFT	6
9457 	/*
9458 	 * When this bit is '1', it indicates a packet that has an
9459 	 * error of some type. Type of error is indicated in
9460 	 * error_flags.
9461 	 */
9462 	#define EJECT_CMPL_FLAGS_ERROR	UINT32_C(0x40)
9463 	/*
9464 	 * This is the length of the statistics data stored in this
9465 	 * buffer.
9466 	 */
9467 	uint16_t	len;
9468 	/*
9469 	 * This is a copy of the opaque field from the RX BD this ejection
9470 	 * buffer corresponds to.
9471 	 */
9472 	uint32_t	opaque;
9473 	uint16_t	v;
9474 	/*
9475 	 * This value is written by the NIC such that it will be different
9476 	 * for each pass through the completion queue. The even passes
9477 	 * will write 1. The odd passes will write 0.
9478 	 */
9479 	#define EJECT_CMPL_V				UINT32_C(0x1)
9480 	#define EJECT_CMPL_ERRORS_MASK			UINT32_C(0xfffe)
9481 	#define EJECT_CMPL_ERRORS_SFT			1
9482 	/*
9483 	 * This error indicates that there was some sort of problem with
9484 	 * the BDs for statistics ejection. The statistics ejection should
9485 	 * be treated as invalid
9486 	 */
9487 	#define EJECT_CMPL_ERRORS_BUFFER_ERROR_MASK	UINT32_C(0xe)
9488 	#define EJECT_CMPL_ERRORS_BUFFER_ERROR_SFT	1
9489 	/* No buffer error */
9490 		#define EJECT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER	(UINT32_C(0x0) << 1)
9491 	/*
9492 	 * Did Not Fit:
9493 	 * Statistics did not fit into aggregation buffer provided.
9494 	 */
9495 		#define EJECT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT   (UINT32_C(0x1) << 1)
9496 	/*
9497 	 * Bad Format:
9498 	 * BDs were not formatted correctly.
9499 	 */
9500 		#define EJECT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT	(UINT32_C(0x3) << 1)
9501 	/*
9502 	 * Flush:
9503 	 * There was a bad_format error on the previous operation
9504 	 */
9505 		#define EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH	(UINT32_C(0x5) << 1)
9506 		#define EJECT_CMPL_ERRORS_BUFFER_ERROR_LAST	EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
9507 	/* reserved16 is 16 b */
9508 	uint16_t	reserved16;
9509 	/* unused3 is 32 b */
9510 	uint32_t	unused_2;
9511 } eject_cmpl_t, *peject_cmpl_t;
9512 
9513 /* hwrm_cmpl (size:128b/16B) */
9514 
9515 typedef struct hwrm_cmpl {
9516 	uint16_t	type;
9517 	/*
9518 	 * This field indicates the exact type of the completion.
9519 	 * By convention, the LSB identifies the length of the
9520 	 * record in 16B units. Even values indicate 16B
9521 	 * records. Odd values indicate 32B
9522 	 * records.
9523 	 */
9524 	#define HWRM_CMPL_TYPE_MASK	UINT32_C(0x3f)
9525 	#define HWRM_CMPL_TYPE_SFT	0
9526 	/*
9527 	 * HWRM Command Completion:
9528 	 * Completion of an HWRM command.
9529 	 */
9530 		#define HWRM_CMPL_TYPE_HWRM_DONE  UINT32_C(0x20)
9531 		#define HWRM_CMPL_TYPE_LAST	HWRM_CMPL_TYPE_HWRM_DONE
9532 	/* This is the sequence_id of the HWRM command that has completed. */
9533 	uint16_t	sequence_id;
9534 	/* unused2 is 32 b */
9535 	uint32_t	unused_1;
9536 	uint32_t	v;
9537 	/*
9538 	 * This value is written by the NIC such that it will be different
9539 	 * for each pass through the completion queue. The even passes
9540 	 * will write 1. The odd passes will write 0.
9541 	 */
9542 	#define HWRM_CMPL_V	UINT32_C(0x1)
9543 	/* unused4 is 32 b */
9544 	uint32_t	unused_3;
9545 } hwrm_cmpl_t, *phwrm_cmpl_t;
9546 
9547 /* hwrm_fwd_req_cmpl (size:128b/16B) */
9548 
9549 typedef struct hwrm_fwd_req_cmpl {
9550 	/*
9551 	 * This field indicates the exact type of the completion.
9552 	 * By convention, the LSB identifies the length of the
9553 	 * record in 16B units. Even values indicate 16B
9554 	 * records. Odd values indicate 32B
9555 	 * records.
9556 	 */
9557 	uint16_t	req_len_type;
9558 	/*
9559 	 * This field indicates the exact type of the completion.
9560 	 * By convention, the LSB identifies the length of the
9561 	 * record in 16B units. Even values indicate 16B
9562 	 * records. Odd values indicate 32B
9563 	 * records.
9564 	 */
9565 	#define HWRM_FWD_REQ_CMPL_TYPE_MASK	UINT32_C(0x3f)
9566 	#define HWRM_FWD_REQ_CMPL_TYPE_SFT	0
9567 	/* Forwarded HWRM Request */
9568 		#define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ  UINT32_C(0x22)
9569 		#define HWRM_FWD_REQ_CMPL_TYPE_LAST	HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ
9570 	/* Length of forwarded request in bytes. */
9571 	#define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK	UINT32_C(0xffc0)
9572 	#define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT	6
9573 	/*
9574 	 * Source ID of this request.
9575 	 * Typically used in forwarding requests and responses.
9576 	 * 0x0 - 0xFFF8 - Used for function ids
9577 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
9578 	 * 0xFFFF - HWRM
9579 	 */
9580 	uint16_t	source_id;
9581 	/* unused1 is 32 b */
9582 	uint32_t	unused0;
9583 	/* Address of forwarded request. */
9584 	uint64_t	req_buf_addr_v;
9585 	/*
9586 	 * This value is written by the NIC such that it will be different
9587 	 * for each pass through the completion queue. The even passes
9588 	 * will write 1. The odd passes will write 0.
9589 	 */
9590 	#define HWRM_FWD_REQ_CMPL_V		UINT32_C(0x1)
9591 	/* Address of forwarded request. */
9592 	#define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
9593 	#define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
9594 } hwrm_fwd_req_cmpl_t, *phwrm_fwd_req_cmpl_t;
9595 
9596 /* hwrm_fwd_resp_cmpl (size:128b/16B) */
9597 
9598 typedef struct hwrm_fwd_resp_cmpl {
9599 	uint16_t	type;
9600 	/*
9601 	 * This field indicates the exact type of the completion.
9602 	 * By convention, the LSB identifies the length of the
9603 	 * record in 16B units. Even values indicate 16B
9604 	 * records. Odd values indicate 32B
9605 	 * records.
9606 	 */
9607 	#define HWRM_FWD_RESP_CMPL_TYPE_MASK	UINT32_C(0x3f)
9608 	#define HWRM_FWD_RESP_CMPL_TYPE_SFT	0
9609 	/* Forwarded HWRM Response */
9610 		#define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP  UINT32_C(0x24)
9611 		#define HWRM_FWD_RESP_CMPL_TYPE_LAST	HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP
9612 	/*
9613 	 * Source ID of this response.
9614 	 * Typically used in forwarding requests and responses.
9615 	 * 0x0 - 0xFFF8 - Used for function ids
9616 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
9617 	 * 0xFFFF - HWRM
9618 	 */
9619 	uint16_t	source_id;
9620 	/* Length of forwarded response in bytes. */
9621 	uint16_t	resp_len;
9622 	/* unused2 is 16 b */
9623 	uint16_t	unused_1;
9624 	/* Address of forwarded request. */
9625 	uint64_t	resp_buf_addr_v;
9626 	/*
9627 	 * This value is written by the NIC such that it will be different
9628 	 * for each pass through the completion queue. The even passes
9629 	 * will write 1. The odd passes will write 0.
9630 	 */
9631 	#define HWRM_FWD_RESP_CMPL_V		UINT32_C(0x1)
9632 	/* Address of forwarded request. */
9633 	#define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK UINT32_C(0xfffffffe)
9634 	#define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT 1
9635 } hwrm_fwd_resp_cmpl_t, *phwrm_fwd_resp_cmpl_t;
9636 
9637 /* hwrm_async_event_cmpl (size:128b/16B) */
9638 
9639 typedef struct hwrm_async_event_cmpl {
9640 	uint16_t	type;
9641 	/*
9642 	 * This field indicates the exact type of the completion.
9643 	 * By convention, the LSB identifies the length of the
9644 	 * record in 16B units. Even values indicate 16B
9645 	 * records. Odd values indicate 32B
9646 	 * records.
9647 	 */
9648 	#define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK		UINT32_C(0x3f)
9649 	#define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT		0
9650 	/* HWRM Asynchronous Event Information */
9651 		#define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
9652 		#define HWRM_ASYNC_EVENT_CMPL_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT
9653 	/* Identifiers of events. */
9654 	uint16_t	event_id;
9655 	/* Link status changed */
9656 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE		UINT32_C(0x0)
9657 	/* Link MTU changed */
9658 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE		UINT32_C(0x1)
9659 	/* Link speed changed */
9660 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE		UINT32_C(0x2)
9661 	/* DCB Configuration changed */
9662 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE		UINT32_C(0x3)
9663 	/* Port connection not allowed */
9664 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED	UINT32_C(0x4)
9665 	/* Link speed configuration was not allowed */
9666 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED	UINT32_C(0x5)
9667 	/* Link speed configuration change */
9668 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE	UINT32_C(0x6)
9669 	/* Port PHY configuration change */
9670 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE		UINT32_C(0x7)
9671 	/* Reset notification to clients */
9672 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY			UINT32_C(0x8)
9673 	/* Master function selection event */
9674 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY		UINT32_C(0x9)
9675 	/*
9676 	 * An event signifying that a ring has been disabled by
9677 	 * hw due to error.
9678 	 */
9679 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RING_MONITOR_MSG		UINT32_C(0xa)
9680 	/* Function driver unloaded */
9681 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD		UINT32_C(0x10)
9682 	/* Function driver loaded */
9683 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD		UINT32_C(0x11)
9684 	/* Function FLR related processing has completed */
9685 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT		UINT32_C(0x12)
9686 	/* PF driver unloaded */
9687 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD		UINT32_C(0x20)
9688 	/* PF driver loaded */
9689 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD			UINT32_C(0x21)
9690 	/* VF Function Level Reset (FLR) */
9691 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR			UINT32_C(0x30)
9692 	/* VF MAC Address Change */
9693 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE		UINT32_C(0x31)
9694 	/* PF-VF communication channel status change. */
9695 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE	UINT32_C(0x32)
9696 	/* VF Configuration Change */
9697 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE		UINT32_C(0x33)
9698 	/* LLFC/PFC Configuration Change */
9699 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE		UINT32_C(0x34)
9700 	/* Default VNIC Configuration Change */
9701 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE		UINT32_C(0x35)
9702 	/* HW flow aged */
9703 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HW_FLOW_AGED			UINT32_C(0x36)
9704 	/*
9705 	 * A debug notification being posted to the driver. These
9706 	 * notifications are purely for diagnostic purpose and should not be
9707 	 * used for functional purpose. The driver is not supposed to act
9708 	 * on these messages except to log/record it.
9709 	 */
9710 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION		UINT32_C(0x37)
9711 	/*
9712 	 * An EEM flow cached memory flush for all flows request event being
9713 	 * posted to the PF driver.
9714 	 */
9715 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_REQ		UINT32_C(0x38)
9716 	/*
9717 	 * An EEM flow cache memory flush completion event being posted to the
9718 	 * firmware by the PF driver. This is indication that host EEM flush
9719 	 * has completed by the PF.
9720 	 */
9721 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_DONE		UINT32_C(0x39)
9722 	/*
9723 	 * A tcp flag action change event being posted to the PF or trusted VF
9724 	 * driver by the firmware. The PF or trusted VF driver should query
9725 	 * the firmware for the new TCP flag action update after receiving
9726 	 * this async event.
9727 	 */
9728 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TCP_FLAG_ACTION_CHANGE	UINT32_C(0x3a)
9729 	/*
9730 	 * An EEM flow active event being posted to the PF or trusted VF driver
9731 	 * by the firmware. The PF or trusted VF driver should update the
9732 	 * flow's aging timer after receiving this async event.
9733 	 */
9734 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_FLOW_ACTIVE		UINT32_C(0x3b)
9735 	/*
9736 	 * A eem cfg change event being posted to the trusted VF driver by the
9737 	 * firmware if the parent PF EEM configuration changed.
9738 	 */
9739 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CFG_CHANGE		UINT32_C(0x3c)
9740 	/*
9741 	 * Deprecated.
9742 	 * TFLIB unique default VNIC Configuration Change
9743 	 */
9744 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_DEFAULT_VNIC_CHANGE	UINT32_C(0x3d)
9745 	/*
9746 	 * Deprecated.
9747 	 * TFLIB unique link status changed
9748 	 */
9749 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_LINK_STATUS_CHANGE	UINT32_C(0x3e)
9750 	/*
9751 	 * An event signifying completion for HWRM_FW_STATE_QUIESCE
9752 	 * (completion, timeout, or error)
9753 	 */
9754 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_QUIESCE_DONE			UINT32_C(0x3f)
9755 	/*
9756 	 * An event signifying a HWRM command is in progress and its
9757 	 * response will be deferred. This event is used on crypto controllers
9758 	 * only.
9759 	 */
9760 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFERRED_RESPONSE		UINT32_C(0x40)
9761 	/*
9762 	 * An event signifying that a PFC WatchDog configuration
9763 	 * has changed on any port / cos.
9764 	 */
9765 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE	UINT32_C(0x41)
9766 	/*
9767 	 * An echo request from the firmware. An echo response is expected by
9768 	 * the firmware.
9769 	 */
9770 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ECHO_REQUEST			UINT32_C(0x42)
9771 	/*
9772 	 * An event from firmware indicating who has been selected as the
9773 	 * PHC Master or secondary. Also indicates the last time a failover
9774 	 * happens. Event will also be sent when PHC rolls over.
9775 	 */
9776 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PHC_UPDATE			UINT32_C(0x43)
9777 	/*
9778 	 * An event from firmware showing the last PPS timestamp that has been
9779 	 * latched.
9780 	 */
9781 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PPS_TIMESTAMP		UINT32_C(0x44)
9782 	/*
9783 	 * An event from firmware indicating that an error has occurred.
9784 	 * The driver should log the event so that an administrator can be
9785 	 * aware that a problem has occurred that may need attention.
9786 	 */
9787 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_REPORT			UINT32_C(0x45)
9788 	/*
9789 	 * An event from firmware indicating that the programmed pacing
9790 	 * threshold for the doorbell global FIFO has been crossed. The driver
9791 	 * needs to take appropriate action to pace the doorbells when this
9792 	 * event is received from the firmware.
9793 	 */
9794 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DOORBELL_PACING_THRESHOLD	UINT32_C(0x46)
9795 	/*
9796 	 * An event from firmware indicating that the RSS capabilities have
9797 	 * changed.
9798 	 */
9799 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RSS_CHANGE			UINT32_C(0x47)
9800 	/*
9801 	 * An event from firmware indicating that list of nq ids used for
9802 	 * doorbell pacing DBQ event notification has been updated. The driver
9803 	 * needs to take appropriate action and retrieve the new list when this
9804 	 * event is received from the firmware.
9805 	 */
9806 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DOORBELL_PACING_NQ_UPDATE	UINT32_C(0x48)
9807 	/*
9808 	 * An event from firmware indicating that hardware ran into an error
9809 	 * while trying to read the host based doorbell copy region. The driver
9810 	 * needs to take the appropriate action and maintain the corresponding
9811 	 * doorbell copy region.
9812 	 */
9813 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HW_DOORBELL_RECOVERY_READ_ERROR UINT32_C(0x49)
9814 	/*
9815 	 * An event from firmware indicating that the XID partition was not
9816 	 * allocated/freed by the FW successfully for the request that is
9817 	 * encapsulated in the HWRM_EXEC_FWD_RESP by the PF driver for VF.
9818 	 */
9819 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_CTX_ERROR			UINT32_C(0x4a)
9820 	/*
9821 	 * A UDCC session has been modified in the FW. The session_id can be
9822 	 * used by the driver to retrieve information related to the UDCC
9823 	 * session.
9824 	 */
9825 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_UDCC_SESSION_CHANGE		UINT32_C(0x4b)
9826 	/*
9827 	 * Used to notify the host that the firmware has DMA-ed additional
9828 	 * debug data to the host buffer. This is effectively a producer index
9829 	 * update. The host driver can utilize this information to determine
9830 	 * how much of its host buffer has been populated by the firmware.
9831 	 */
9832 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DBG_BUF_PRODUCER		UINT32_C(0x4c)
9833 	/*
9834 	 * Memory mapping between GPA and HPA has been configured for
9835 	 * a peer device. Inform driver to pick up the new mapping.
9836 	 */
9837 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PEER_MMAP_CHANGE		UINT32_C(0x4d)
9838 	/*
9839 	 * Used to notify representor endpoint in the driver about pair creation
9840 	 * in the firmware.
9841 	 */
9842 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_REPRESENTOR_PAIR_CHANGE	UINT32_C(0x4e)
9843 	/*
9844 	 * VF statistics context change. Informs PF driver that a VF
9845 	 * statistics context has either been allocated or freed.
9846 	 */
9847 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_STAT_CHANGE		UINT32_C(0x4f)
9848 	/*
9849 	 * coredump collection into host DMA address. Informs PF driver that
9850 	 * the coredump has been captured.
9851 	 */
9852 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HOST_COREDUMP		UINT32_C(0x50)
9853 	/* Maximum Registrable event id. */
9854 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_MAX_RGTR_EVENT_ID		UINT32_C(0x51)
9855 	/*
9856 	 * A trace log message. This contains firmware trace logs string
9857 	 * embedded in the asynchronous message. This is an experimental
9858 	 * event, not meant for production use at this time.
9859 	 */
9860 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FW_TRACE_MSG			UINT32_C(0xfe)
9861 	/* HWRM Error */
9862 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR			UINT32_C(0xff)
9863 	#define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LAST			HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR
9864 	/* Event specific data */
9865 	uint32_t	event_data2;
9866 	uint8_t	opaque_v;
9867 	/*
9868 	 * This value is written by the NIC such that it will be different
9869 	 * for each pass through the completion queue. The even passes
9870 	 * will write 1. The odd passes will write 0.
9871 	 */
9872 	#define HWRM_ASYNC_EVENT_CMPL_V	UINT32_C(0x1)
9873 	/* opaque is 7 b */
9874 	#define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
9875 	#define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
9876 	/* 8-lsb timestamp from POR (100-msec resolution) */
9877 	uint8_t	timestamp_lo;
9878 	/* 16-lsb timestamp from POR (100-msec resolution) */
9879 	uint16_t	timestamp_hi;
9880 	/* Event specific data */
9881 	uint32_t	event_data1;
9882 } hwrm_async_event_cmpl_t, *phwrm_async_event_cmpl_t;
9883 
9884 #define GET_EVENT_ID(x) \
9885 	(((x) < 0x80) ? \
9886 	((x) == 0x0 ? "LINK_STATUS_CHANGE": \
9887 	((x) == 0x1 ? "LINK_MTU_CHANGE": \
9888 	((x) == 0x2 ? "LINK_SPEED_CHANGE": \
9889 	((x) == 0x3 ? "DCB_CONFIG_CHANGE": \
9890 	((x) == 0x4 ? "PORT_CONN_NOT_ALLOWED": \
9891 	((x) == 0x5 ? "LINK_SPEED_CFG_NOT_ALLOWED": \
9892 	((x) == 0x6 ? "LINK_SPEED_CFG_CHANGE": \
9893 	((x) == 0x7 ? "PORT_PHY_CFG_CHANGE": \
9894 	((x) == 0x8 ? "RESET_NOTIFY": \
9895 	((x) == 0x9 ? "ERROR_RECOVERY": \
9896 	((x) == 0xa ? "RING_MONITOR_MSG": \
9897 	((x) == 0x10 ? "FUNC_DRVR_UNLOAD": \
9898 	((x) == 0x11 ? "FUNC_DRVR_LOAD": \
9899 	((x) == 0x12 ? "FUNC_FLR_PROC_CMPLT": \
9900 	((x) == 0x20 ? "PF_DRVR_UNLOAD": \
9901 	((x) == 0x21 ? "PF_DRVR_LOAD": \
9902 	((x) == 0x30 ? "VF_FLR": \
9903 	((x) == 0x31 ? "VF_MAC_ADDR_CHANGE": \
9904 	((x) == 0x32 ? "PF_VF_COMM_STATUS_CHANGE": \
9905 	((x) == 0x33 ? "VF_CFG_CHANGE": \
9906 	((x) == 0x34 ? "LLFC_PFC_CHANGE": \
9907 	((x) == 0x35 ? "DEFAULT_VNIC_CHANGE": \
9908 	((x) == 0x36 ? "HW_FLOW_AGED": \
9909 	((x) == 0x37 ? "DEBUG_NOTIFICATION": \
9910 	((x) == 0x38 ? "EEM_CACHE_FLUSH_REQ": \
9911 	((x) == 0x39 ? "EEM_CACHE_FLUSH_DONE": \
9912 	((x) == 0x3a ? "TCP_FLAG_ACTION_CHANGE": \
9913 	((x) == 0x3b ? "EEM_FLOW_ACTIVE": \
9914 	((x) == 0x3c ? "EEM_CFG_CHANGE": \
9915 	((x) == 0x3d ? "TFLIB_DEFAULT_VNIC_CHANGE": \
9916 	((x) == 0x3e ? "TFLIB_LINK_STATUS_CHANGE": \
9917 	((x) == 0x3f ? "QUIESCE_DONE": \
9918 	((x) == 0x40 ? "DEFERRED_RESPONSE": \
9919 	((x) == 0x41 ? "PFC_WATCHDOG_CFG_CHANGE": \
9920 	((x) == 0x42 ? "ECHO_REQUEST": \
9921 	((x) == 0x43 ? "PHC_UPDATE": \
9922 	((x) == 0x44 ? "PPS_TIMESTAMP": \
9923 	((x) == 0x45 ? "ERROR_REPORT": \
9924 	((x) == 0x46 ? "DOORBELL_PACING_THRESHOLD": \
9925 	((x) == 0x47 ? "RSS_CHANGE": \
9926 	((x) == 0x48 ? "DOORBELL_PACING_NQ_UPDATE": \
9927 	((x) == 0x49 ? "HW_DOORBELL_RECOVERY_READ_ERROR": \
9928 	((x) == 0x4a ? "CTX_ERROR": \
9929 	((x) == 0x4b ? "UDCC_SESSION_CHANGE": \
9930 	((x) == 0x4c ? "DBG_BUF_PRODUCER": \
9931 	((x) == 0x4d ? "PEER_MMAP_CHANGE": \
9932 	((x) == 0x4e ? "REPRESENTOR_PAIR_CHANGE": \
9933 	((x) == 0x4f ? "VF_STAT_CHANGE": \
9934 	((x) == 0x50 ? "HOST_COREDUMP": \
9935 	((x) == 0x51 ? "MAX_RGTR_EVENT_ID": \
9936 	"Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))) : \
9937 	(((x) < 0x100) ? \
9938 	((x) == 0xfe ? "FW_TRACE_MSG": \
9939 	((x) == 0xff ? "HWRM_ERROR": \
9940 	"Unknown decode" )) : \
9941 	"Unknown decode" ))
9942 
9943 
9944 /* hwrm_async_event_cmpl_link_status_change (size:128b/16B) */
9945 
9946 typedef struct hwrm_async_event_cmpl_link_status_change {
9947 	uint16_t	type;
9948 	/*
9949 	 * This field indicates the exact type of the completion.
9950 	 * By convention, the LSB identifies the length of the
9951 	 * record in 16B units. Even values indicate 16B
9952 	 * records. Odd values indicate 32B
9953 	 * records.
9954 	 */
9955 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK		UINT32_C(0x3f)
9956 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT		0
9957 	/* HWRM Asynchronous Event Information */
9958 		#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
9959 		#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
9960 	/* Identifiers of events. */
9961 	uint16_t	event_id;
9962 	/* Link status changed */
9963 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE UINT32_C(0x0)
9964 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE
9965 	/* Event specific data */
9966 	uint32_t	event_data2;
9967 	uint8_t	opaque_v;
9968 	/*
9969 	 * This value is written by the NIC such that it will be different
9970 	 * for each pass through the completion queue. The even passes
9971 	 * will write 1. The odd passes will write 0.
9972 	 */
9973 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V	UINT32_C(0x1)
9974 	/* opaque is 7 b */
9975 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
9976 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1
9977 	/* 8-lsb timestamp from POR (100-msec resolution) */
9978 	uint8_t	timestamp_lo;
9979 	/* 16-lsb timestamp from POR (100-msec resolution) */
9980 	uint16_t	timestamp_hi;
9981 	/* Event specific data */
9982 	uint32_t	event_data1;
9983 	/* Indicates link status change */
9984 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE	UINT32_C(0x1)
9985 	/*
9986 	 * If this bit set to 0, then it indicates that the link
9987 	 * was up and it went down.
9988 	 */
9989 		#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN  UINT32_C(0x0)
9990 	/*
9991 	 * If this bit is set to 1, then it indicates that the link
9992 	 * was down and it went up.
9993 	 */
9994 		#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP	UINT32_C(0x1)
9995 		#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_LAST HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP
9996 	/* Indicates the physical port this link status change occur */
9997 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK	UINT32_C(0xe)
9998 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT	1
9999 	/* PORT ID */
10000 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK	UINT32_C(0xffff0)
10001 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT	4
10002 	/* Indicates the physical function this event occurred on. */
10003 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_MASK	UINT32_C(0xff00000)
10004 	#define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_SFT	20
10005 } hwrm_async_event_cmpl_link_status_change_t, *phwrm_async_event_cmpl_link_status_change_t;
10006 
10007 /* hwrm_async_event_cmpl_link_mtu_change (size:128b/16B) */
10008 
10009 typedef struct hwrm_async_event_cmpl_link_mtu_change {
10010 	uint16_t	type;
10011 	/*
10012 	 * This field indicates the exact type of the completion.
10013 	 * By convention, the LSB identifies the length of the
10014 	 * record in 16B units. Even values indicate 16B
10015 	 * records. Odd values indicate 32B
10016 	 * records.
10017 	 */
10018 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10019 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_SFT		0
10020 	/* HWRM Asynchronous Event Information */
10021 		#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10022 		#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT
10023 	/* Identifiers of events. */
10024 	uint16_t	event_id;
10025 	/* Link MTU changed */
10026 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE UINT32_C(0x1)
10027 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE
10028 	/* Event specific data */
10029 	uint32_t	event_data2;
10030 	uint8_t	opaque_v;
10031 	/*
10032 	 * This value is written by the NIC such that it will be different
10033 	 * for each pass through the completion queue. The even passes
10034 	 * will write 1. The odd passes will write 0.
10035 	 */
10036 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_V	UINT32_C(0x1)
10037 	/* opaque is 7 b */
10038 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10039 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_SFT 1
10040 	/* 8-lsb timestamp from POR (100-msec resolution) */
10041 	uint8_t	timestamp_lo;
10042 	/* 16-lsb timestamp from POR (100-msec resolution) */
10043 	uint16_t	timestamp_hi;
10044 	/* Event specific data */
10045 	uint32_t	event_data1;
10046 	/* The new MTU of the link in bytes. */
10047 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK UINT32_C(0xffff)
10048 	#define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0
10049 } hwrm_async_event_cmpl_link_mtu_change_t, *phwrm_async_event_cmpl_link_mtu_change_t;
10050 
10051 /* hwrm_async_event_cmpl_link_speed_change (size:128b/16B) */
10052 
10053 typedef struct hwrm_async_event_cmpl_link_speed_change {
10054 	uint16_t	type;
10055 	/*
10056 	 * This field indicates the exact type of the completion.
10057 	 * By convention, the LSB identifies the length of the
10058 	 * record in 16B units. Even values indicate 16B
10059 	 * records. Odd values indicate 32B
10060 	 * records.
10061 	 */
10062 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10063 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_SFT		0
10064 	/* HWRM Asynchronous Event Information */
10065 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10066 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT
10067 	/* Identifiers of events. */
10068 	uint16_t	event_id;
10069 	/* Link speed changed */
10070 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE UINT32_C(0x2)
10071 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE
10072 	/* Event specific data */
10073 	uint32_t	event_data2;
10074 	uint8_t	opaque_v;
10075 	/*
10076 	 * This value is written by the NIC such that it will be different
10077 	 * for each pass through the completion queue. The even passes
10078 	 * will write 1. The odd passes will write 0.
10079 	 */
10080 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_V	UINT32_C(0x1)
10081 	/* opaque is 7 b */
10082 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10083 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_SFT 1
10084 	/* 8-lsb timestamp from POR (100-msec resolution) */
10085 	uint8_t	timestamp_lo;
10086 	/* 16-lsb timestamp from POR (100-msec resolution) */
10087 	uint16_t	timestamp_hi;
10088 	/* Event specific data */
10089 	uint32_t	event_data1;
10090 	/*
10091 	 * When this bit is '1', the link was forced to the
10092 	 * force_link_speed value.
10093 	 */
10094 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_FORCE			UINT32_C(0x1)
10095 	/* The new link speed in 100 Mbps units. */
10096 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_MASK UINT32_C(0xfffe)
10097 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_SFT  1
10098 	/* 100Mb link speed */
10099 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100MB  (UINT32_C(0x1) << 1)
10100 	/* 1Gb link speed */
10101 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_1GB	(UINT32_C(0xa) << 1)
10102 	/* 2Gb link speed */
10103 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2GB	(UINT32_C(0x14) << 1)
10104 	/* 25Gb link speed */
10105 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2_5GB  (UINT32_C(0x19) << 1)
10106 	/* 10Gb link speed */
10107 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10GB   (UINT32_C(0x64) << 1)
10108 	/* 20Mb link speed */
10109 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_20GB   (UINT32_C(0xc8) << 1)
10110 	/* 25Gb link speed */
10111 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_25GB   (UINT32_C(0xfa) << 1)
10112 	/* 40Gb link speed */
10113 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_40GB   (UINT32_C(0x190) << 1)
10114 	/* 50Gb link speed */
10115 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_50GB   (UINT32_C(0x1f4) << 1)
10116 	/* 100Gb link speed */
10117 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB  (UINT32_C(0x3e8) << 1)
10118 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_LAST  HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB
10119 	/* PORT ID */
10120 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_MASK		UINT32_C(0xffff0000)
10121 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT		16
10122 } hwrm_async_event_cmpl_link_speed_change_t, *phwrm_async_event_cmpl_link_speed_change_t;
10123 
10124 /* hwrm_async_event_cmpl_dcb_config_change (size:128b/16B) */
10125 
10126 typedef struct hwrm_async_event_cmpl_dcb_config_change {
10127 	uint16_t	type;
10128 	/*
10129 	 * This field indicates the exact type of the completion.
10130 	 * By convention, the LSB identifies the length of the
10131 	 * record in 16B units. Even values indicate 16B
10132 	 * records. Odd values indicate 32B
10133 	 * records.
10134 	 */
10135 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10136 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_SFT		0
10137 	/* HWRM Asynchronous Event Information */
10138 		#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10139 		#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT
10140 	/* Identifiers of events. */
10141 	uint16_t	event_id;
10142 	/* DCB Configuration changed */
10143 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE UINT32_C(0x3)
10144 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE
10145 	/* Event specific data */
10146 	uint32_t	event_data2;
10147 	/* ETS configuration change */
10148 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_ETS	UINT32_C(0x1)
10149 	/* PFC configuration change */
10150 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_PFC	UINT32_C(0x2)
10151 	/* APP configuration change */
10152 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_APP	UINT32_C(0x4)
10153 	/* DSCP configuration change */
10154 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_DSCP	UINT32_C(0x8)
10155 	uint8_t	opaque_v;
10156 	/*
10157 	 * This value is written by the NIC such that it will be different
10158 	 * for each pass through the completion queue. The even passes
10159 	 * will write 1. The odd passes will write 0.
10160 	 */
10161 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_V	UINT32_C(0x1)
10162 	/* opaque is 7 b */
10163 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10164 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_SFT 1
10165 	/* 8-lsb timestamp from POR (100-msec resolution) */
10166 	uint8_t	timestamp_lo;
10167 	/* 16-lsb timestamp from POR (100-msec resolution) */
10168 	uint16_t	timestamp_hi;
10169 	/* Event specific data */
10170 	uint32_t	event_data1;
10171 	/* PORT ID */
10172 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK		UINT32_C(0xffff)
10173 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT		0
10174 	/* Priority recommended for RoCE traffic */
10175 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_MASK UINT32_C(0xff0000)
10176 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_SFT 16
10177 	/* none is 255 */
10178 		#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE  (UINT32_C(0xff) << 16)
10179 		#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_LAST HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE
10180 	/* Priority recommended for L2 traffic */
10181 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_MASK  UINT32_C(0xff000000)
10182 	#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_SFT   24
10183 	/* none is 255 */
10184 		#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE	(UINT32_C(0xff) << 24)
10185 		#define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_LAST   HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE
10186 } hwrm_async_event_cmpl_dcb_config_change_t, *phwrm_async_event_cmpl_dcb_config_change_t;
10187 
10188 /* hwrm_async_event_cmpl_port_conn_not_allowed (size:128b/16B) */
10189 
10190 typedef struct hwrm_async_event_cmpl_port_conn_not_allowed {
10191 	uint16_t	type;
10192 	/*
10193 	 * This field indicates the exact type of the completion.
10194 	 * By convention, the LSB identifies the length of the
10195 	 * record in 16B units. Even values indicate 16B
10196 	 * records. Odd values indicate 32B
10197 	 * records.
10198 	 */
10199 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_MASK		UINT32_C(0x3f)
10200 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_SFT		0
10201 	/* HWRM Asynchronous Event Information */
10202 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10203 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
10204 	/* Identifiers of events. */
10205 	uint16_t	event_id;
10206 	/* Port connection not allowed */
10207 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED UINT32_C(0x4)
10208 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED
10209 	/* Event specific data */
10210 	uint32_t	event_data2;
10211 	uint8_t	opaque_v;
10212 	/*
10213 	 * This value is written by the NIC such that it will be different
10214 	 * for each pass through the completion queue. The even passes
10215 	 * will write 1. The odd passes will write 0.
10216 	 */
10217 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_V	UINT32_C(0x1)
10218 	/* opaque is 7 b */
10219 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_MASK UINT32_C(0xfe)
10220 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_SFT 1
10221 	/* 8-lsb timestamp from POR (100-msec resolution) */
10222 	uint8_t	timestamp_lo;
10223 	/* 16-lsb timestamp from POR (100-msec resolution) */
10224 	uint16_t	timestamp_hi;
10225 	/* Event specific data */
10226 	uint32_t	event_data1;
10227 	/* PORT ID */
10228 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK		UINT32_C(0xffff)
10229 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT		0
10230 	/*
10231 	 * This value indicates the current port level enforcement policy
10232 	 * for the optics module when there is an optical module mismatch
10233 	 * and port is not connected.
10234 	 */
10235 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK	UINT32_C(0xff0000)
10236 	#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT	16
10237 	/* No enforcement */
10238 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_NONE	(UINT32_C(0x0) << 16)
10239 	/* Disable Transmit side Laser. */
10240 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_DISABLETX   (UINT32_C(0x1) << 16)
10241 	/* Raise a warning message. */
10242 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_WARNINGMSG  (UINT32_C(0x2) << 16)
10243 	/* Power down the module. */
10244 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN	(UINT32_C(0x3) << 16)
10245 		#define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_LAST	HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN
10246 } hwrm_async_event_cmpl_port_conn_not_allowed_t, *phwrm_async_event_cmpl_port_conn_not_allowed_t;
10247 
10248 /* hwrm_async_event_cmpl_link_speed_cfg_not_allowed (size:128b/16B) */
10249 
10250 typedef struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed {
10251 	uint16_t	type;
10252 	/*
10253 	 * This field indicates the exact type of the completion.
10254 	 * By convention, the LSB identifies the length of the
10255 	 * record in 16B units. Even values indicate 16B
10256 	 * records. Odd values indicate 32B
10257 	 * records.
10258 	 */
10259 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_MASK		UINT32_C(0x3f)
10260 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_SFT		0
10261 	/* HWRM Asynchronous Event Information */
10262 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10263 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
10264 	/* Identifiers of events. */
10265 	uint16_t	event_id;
10266 	/* Link speed configuration was not allowed */
10267 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED UINT32_C(0x5)
10268 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LAST			HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED
10269 	/* Event specific data */
10270 	uint32_t	event_data2;
10271 	uint8_t	opaque_v;
10272 	/*
10273 	 * This value is written by the NIC such that it will be different
10274 	 * for each pass through the completion queue. The even passes
10275 	 * will write 1. The odd passes will write 0.
10276 	 */
10277 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_V	UINT32_C(0x1)
10278 	/* opaque is 7 b */
10279 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_MASK UINT32_C(0xfe)
10280 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_SFT 1
10281 	/* 8-lsb timestamp from POR (100-msec resolution) */
10282 	uint8_t	timestamp_lo;
10283 	/* 16-lsb timestamp from POR (100-msec resolution) */
10284 	uint16_t	timestamp_hi;
10285 	/* Event specific data */
10286 	uint32_t	event_data1;
10287 	/* PORT ID */
10288 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK UINT32_C(0xffff)
10289 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT 0
10290 } hwrm_async_event_cmpl_link_speed_cfg_not_allowed_t, *phwrm_async_event_cmpl_link_speed_cfg_not_allowed_t;
10291 
10292 /* hwrm_async_event_cmpl_link_speed_cfg_change (size:128b/16B) */
10293 
10294 typedef struct hwrm_async_event_cmpl_link_speed_cfg_change {
10295 	uint16_t	type;
10296 	/*
10297 	 * This field indicates the exact type of the completion.
10298 	 * By convention, the LSB identifies the length of the
10299 	 * record in 16B units. Even values indicate 16B
10300 	 * records. Odd values indicate 32B
10301 	 * records.
10302 	 */
10303 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10304 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_SFT		0
10305 	/* HWRM Asynchronous Event Information */
10306 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10307 		#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
10308 	/* Identifiers of events. */
10309 	uint16_t	event_id;
10310 	/* Link speed configuration change */
10311 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE UINT32_C(0x6)
10312 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE
10313 	/* Event specific data */
10314 	uint32_t	event_data2;
10315 	uint8_t	opaque_v;
10316 	/*
10317 	 * This value is written by the NIC such that it will be different
10318 	 * for each pass through the completion queue. The even passes
10319 	 * will write 1. The odd passes will write 0.
10320 	 */
10321 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_V	UINT32_C(0x1)
10322 	/* opaque is 7 b */
10323 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10324 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_SFT 1
10325 	/* 8-lsb timestamp from POR (100-msec resolution) */
10326 	uint8_t	timestamp_lo;
10327 	/* 16-lsb timestamp from POR (100-msec resolution) */
10328 	uint16_t	timestamp_hi;
10329 	/* Event specific data */
10330 	uint32_t	event_data1;
10331 	/* PORT ID */
10332 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK			UINT32_C(0xffff)
10333 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT			0
10334 	/*
10335 	 * If set to 1, it indicates that the supported link speeds
10336 	 * configuration on the port has changed.
10337 	 * If set to 0, then there is no change in supported link speeds
10338 	 * configuration.
10339 	 */
10340 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_SUPPORTED_LINK_SPEEDS_CHANGE	UINT32_C(0x10000)
10341 	/*
10342 	 * If set to 1, it indicates that the link speed configuration
10343 	 * on the port has become illegal or invalid.
10344 	 * If set to 0, then the link speed configuration on the port is
10345 	 * legal or valid.
10346 	 */
10347 	#define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_ILLEGAL_LINK_SPEED_CFG	UINT32_C(0x20000)
10348 } hwrm_async_event_cmpl_link_speed_cfg_change_t, *phwrm_async_event_cmpl_link_speed_cfg_change_t;
10349 
10350 /* hwrm_async_event_cmpl_port_phy_cfg_change (size:128b/16B) */
10351 
10352 typedef struct hwrm_async_event_cmpl_port_phy_cfg_change {
10353 	uint16_t	type;
10354 	/*
10355 	 * This field indicates the exact type of the completion.
10356 	 * By convention, the LSB identifies the length of the
10357 	 * record in 16B units. Even values indicate 16B
10358 	 * records. Odd values indicate 32B
10359 	 * records.
10360 	 */
10361 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10362 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_SFT		0
10363 	/* HWRM Asynchronous Event Information */
10364 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10365 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
10366 	/* Identifiers of events. */
10367 	uint16_t	event_id;
10368 	/* Port PHY configuration change */
10369 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE UINT32_C(0x7)
10370 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE
10371 	/* Event specific data */
10372 	uint32_t	event_data2;
10373 	/*
10374 	 * This value indicates the current status of the optics module on
10375 	 * this port. the same information can be found in the module_status
10376 	 * field of the HWRM_PORT_PHY_QCFG response
10377 	 */
10378 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA2_MODULE_STATUS_MASK	UINT32_C(0xff)
10379 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA2_MODULE_STATUS_SFT	0
10380 	/* Module is inserted and accepted */
10381 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA2_MODULE_STATUS_NONE	UINT32_C(0x0)
10382 	/* Module is rejected and transmit side Laser is disabled. */
10383 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA2_MODULE_STATUS_DISABLETX	UINT32_C(0x1)
10384 	/* Module mismatch warning. */
10385 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA2_MODULE_STATUS_MISMATCH	UINT32_C(0x2)
10386 	/* Module is rejected and powered down. */
10387 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA2_MODULE_STATUS_PWRDOWN	UINT32_C(0x3)
10388 	/* Module is not inserted. */
10389 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA2_MODULE_STATUS_NOTINSERTED	UINT32_C(0x4)
10390 	/* Module is powered down because of over current fault. */
10391 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA2_MODULE_STATUS_CURRENTFAULT   UINT32_C(0x5)
10392 	/* Module is overheated. */
10393 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA2_MODULE_STATUS_OVERHEATED	UINT32_C(0x6)
10394 	/* Module status is not applicable. */
10395 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA2_MODULE_STATUS_NOTAPPLICABLE  UINT32_C(0xff)
10396 		#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA2_MODULE_STATUS_LAST	HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA2_MODULE_STATUS_NOTAPPLICABLE
10397 	uint8_t	opaque_v;
10398 	/*
10399 	 * This value is written by the NIC such that it will be different
10400 	 * for each pass through the completion queue. The even passes
10401 	 * will write 1. The odd passes will write 0.
10402 	 */
10403 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_V	UINT32_C(0x1)
10404 	/* opaque is 7 b */
10405 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10406 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_SFT 1
10407 	/* 8-lsb timestamp from POR (100-msec resolution) */
10408 	uint8_t	timestamp_lo;
10409 	/* 16-lsb timestamp from POR (100-msec resolution) */
10410 	uint16_t	timestamp_hi;
10411 	/* Event specific data */
10412 	uint32_t	event_data1;
10413 	/* PORT ID */
10414 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK	UINT32_C(0xffff)
10415 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT	0
10416 	/*
10417 	 * If set to 1, it indicates that the FEC
10418 	 * configuration on the port has changed.
10419 	 * If set to 0, then there is no change in FEC configuration.
10420 	 */
10421 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_FEC_CFG_CHANGE	UINT32_C(0x10000)
10422 	/*
10423 	 * If set to 1, it indicates that the EEE configuration
10424 	 * on the port has changed.
10425 	 * If set to 0, then there is no change in EEE configuration
10426 	 * on the port.
10427 	 */
10428 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_EEE_CFG_CHANGE	UINT32_C(0x20000)
10429 	/*
10430 	 * If set to 1, it indicates that the pause configuration
10431 	 * on the PHY has changed.
10432 	 * If set to 0, then there is no change in the pause
10433 	 * configuration on the PHY.
10434 	 */
10435 	#define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PAUSE_CFG_CHANGE	UINT32_C(0x40000)
10436 } hwrm_async_event_cmpl_port_phy_cfg_change_t, *phwrm_async_event_cmpl_port_phy_cfg_change_t;
10437 
10438 /* hwrm_async_event_cmpl_reset_notify (size:128b/16B) */
10439 
10440 typedef struct hwrm_async_event_cmpl_reset_notify {
10441 	uint16_t	type;
10442 	/*
10443 	 * This field indicates the exact type of the completion.
10444 	 * By convention, the LSB identifies the length of the
10445 	 * record in 16B units. Even values indicate 16B
10446 	 * records. Odd values indicate 32B
10447 	 * records.
10448 	 */
10449 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_MASK		UINT32_C(0x3f)
10450 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_SFT		0
10451 	/* HWRM Asynchronous Event Information */
10452 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10453 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT
10454 	/* Identifiers of events. */
10455 	uint16_t	event_id;
10456 	/* Notify clients of imminent reset. */
10457 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY UINT32_C(0x8)
10458 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY
10459 	/* Event specific data. The data is for internal debug use only. */
10460 	uint32_t	event_data2;
10461 	/*
10462 	 * These bits indicate the status as being reported by the firmware.
10463 	 * This value is exactly the same as status code in fw_status register.
10464 	 * If the status code is equal to 0x8000, then the reset is initiated
10465 	 * by the Host using the FW_RESET command when the FW is in a healthy
10466 	 * state. If the status code is not equal to 0x8000, then the reset is
10467 	 * initiated by the FW to recover from the error or FATAL state.
10468 	 */
10469 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA2_FW_STATUS_CODE_MASK UINT32_C(0xffff)
10470 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA2_FW_STATUS_CODE_SFT 0
10471 	uint8_t	opaque_v;
10472 	/*
10473 	 * This value is written by the NIC such that it will be different
10474 	 * for each pass through the completion queue. The even passes
10475 	 * will write 1. The odd passes will write 0.
10476 	 */
10477 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_V	UINT32_C(0x1)
10478 	/* opaque is 7 b */
10479 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_MASK UINT32_C(0xfe)
10480 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_SFT 1
10481 	/*
10482 	 * 8-lsb timestamp (100-msec resolution)
10483 	 * The Minimum time required for the Firmware readiness after sending
10484 	 * this notification to the driver instances.
10485 	 */
10486 	uint8_t	timestamp_lo;
10487 	/*
10488 	 * 16-lsb timestamp (100-msec resolution)
10489 	 * The Maximum Firmware Reset bail out value in the order of 100
10490 	 * milliseconds. The driver instances will use this value to reinitiate
10491 	 * the registration process again if the core firmware didn't set the
10492 	 * state bit.
10493 	 */
10494 	uint16_t	timestamp_hi;
10495 	/* Event specific data */
10496 	uint32_t	event_data1;
10497 	/* Indicates driver action requested */
10498 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_MASK		UINT32_C(0xff)
10499 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_SFT		0
10500 	/*
10501 	 * If set to 1, it indicates that the l2 client should
10502 	 * stop sending in band traffic to Nitro.
10503 	 * if set to 0, there is no change in L2 client behavior.
10504 	 */
10505 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_STOP_TX_QUEUE	UINT32_C(0x1)
10506 	/*
10507 	 * If set to 1, it indicates that the L2 client should
10508 	 * bring down the interface.
10509 	 * If set to 0, then there is no change in L2 client behavior.
10510 	 */
10511 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN	UINT32_C(0x2)
10512 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_LAST		HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN
10513 	/* Indicates reason for reset. */
10514 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MASK			UINT32_C(0xff00)
10515 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_SFT			8
10516 	/* A management client has requested reset. */
10517 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MANAGEMENT_RESET_REQUEST  (UINT32_C(0x1) << 8)
10518 	/* A fatal firmware exception has occurred. */
10519 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_FATAL	(UINT32_C(0x2) << 8)
10520 	/* A non-fatal firmware exception has occurred. */
10521 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL	(UINT32_C(0x3) << 8)
10522 	/* Fast reset */
10523 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FAST_RESET		(UINT32_C(0x4) << 8)
10524 	/*
10525 	 * Reset was a result of a firmware activation. That is, the
10526 	 * fw_activation flag was set in a FW_RESET operation.
10527 	 */
10528 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_ACTIVATION		(UINT32_C(0x5) << 8)
10529 		#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_LAST			HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_ACTIVATION
10530 	/*
10531 	 * Minimum time before driver should attempt access - units 100ms
10532 	 * ticks.
10533 	 * Range 0-65535
10534 	 */
10535 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_MASK	UINT32_C(0xffff0000)
10536 	#define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_SFT		16
10537 } hwrm_async_event_cmpl_reset_notify_t, *phwrm_async_event_cmpl_reset_notify_t;
10538 
10539 /* hwrm_async_event_cmpl_error_recovery (size:128b/16B) */
10540 
10541 typedef struct hwrm_async_event_cmpl_error_recovery {
10542 	uint16_t	type;
10543 	/*
10544 	 * This field indicates the exact type of the completion.
10545 	 * By convention, the LSB identifies the length of the
10546 	 * record in 16B units. Even values indicate 16B
10547 	 * records. Odd values indicate 32B
10548 	 * records.
10549 	 */
10550 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_MASK		UINT32_C(0x3f)
10551 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_SFT		0
10552 	/* HWRM Asynchronous Event Information */
10553 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10554 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT
10555 	/* Identifiers of events. */
10556 	uint16_t	event_id;
10557 	/*
10558 	 * This async notification message can be used for selecting or
10559 	 * deselecting master function for error recovery,
10560 	 * and to communicate to all the functions whether error recovery
10561 	 * was enabled/disabled.
10562 	 */
10563 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY UINT32_C(0x9)
10564 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY
10565 	/* Event specific data */
10566 	uint32_t	event_data2;
10567 	uint8_t	opaque_v;
10568 	/*
10569 	 * This value is written by the NIC such that it will be different
10570 	 * for each pass through the completion queue. The even passes
10571 	 * will write 1. The odd passes will write 0.
10572 	 */
10573 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_V	UINT32_C(0x1)
10574 	/* opaque is 7 b */
10575 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_MASK UINT32_C(0xfe)
10576 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_SFT 1
10577 	/* 8-lsb timestamp (100-msec resolution) */
10578 	uint8_t	timestamp_lo;
10579 	/* 16-lsb timestamp (100-msec resolution) */
10580 	uint16_t	timestamp_hi;
10581 	/* Event specific data */
10582 	uint32_t	event_data1;
10583 	/* Indicates driver action requested */
10584 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASK		UINT32_C(0xff)
10585 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_SFT		0
10586 	/*
10587 	 * If set to 1, this function is selected as Master function.
10588 	 * This function has responsibility to do 'chip reset' when it
10589 	 * detects a fatal error. If set to 0, master function functionality
10590 	 * is disabled on this function.
10591 	 */
10592 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASTER_FUNC	UINT32_C(0x1)
10593 	/*
10594 	 * If set to 1, error recovery is enabled.
10595 	 * If set to 0, error recovery is disabled.
10596 	 */
10597 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_ENABLED	UINT32_C(0x2)
10598 } hwrm_async_event_cmpl_error_recovery_t, *phwrm_async_event_cmpl_error_recovery_t;
10599 
10600 /* hwrm_async_event_cmpl_ring_monitor_msg (size:128b/16B) */
10601 
10602 typedef struct hwrm_async_event_cmpl_ring_monitor_msg {
10603 	uint16_t	type;
10604 	/*
10605 	 * This field indicates the exact type of the completion.
10606 	 * By convention, the LSB identifies the length of the
10607 	 * record in 16B units. Even values indicate 16B
10608 	 * records. Odd values indicate 32B
10609 	 * records.
10610 	 */
10611 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_MASK		UINT32_C(0x3f)
10612 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_SFT		0
10613 	/* HWRM Asynchronous Event Information */
10614 		#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10615 		#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_HWRM_ASYNC_EVENT
10616 	/* Identifiers of events. */
10617 	uint16_t	event_id;
10618 	/* Ring Monitor Message. */
10619 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_RING_MONITOR_MSG UINT32_C(0xa)
10620 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_RING_MONITOR_MSG
10621 	/* Event specific data */
10622 	uint32_t	event_data2;
10623 	/* Type of Ring disabled. */
10624 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_MASK UINT32_C(0xff)
10625 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_SFT 0
10626 	/* tx ring disabled. */
10627 		#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_TX	UINT32_C(0x0)
10628 	/* rx ring disabled. */
10629 		#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_RX	UINT32_C(0x1)
10630 	/* cmpl ring disabled. */
10631 		#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_CMPL  UINT32_C(0x2)
10632 		#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_CMPL
10633 	uint8_t	opaque_v;
10634 	/*
10635 	 * This value is written by the NIC such that it will be different
10636 	 * for each pass through the completion queue. The even passes
10637 	 * will write 1. The odd passes will write 0.
10638 	 */
10639 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_V	UINT32_C(0x1)
10640 	/* opaque is 7 b */
10641 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_OPAQUE_MASK UINT32_C(0xfe)
10642 	#define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_OPAQUE_SFT 1
10643 	/* 8-lsb timestamp from POR (100-msec resolution) */
10644 	uint8_t	timestamp_lo;
10645 	/* 16-lsb timestamp from POR (100-msec resolution) */
10646 	uint16_t	timestamp_hi;
10647 	/*
10648 	 * Event specific data. If ring_type_disabled indicates a tx, rx or cmpl
10649 	 * then this field will indicate the ring id.
10650 	 */
10651 	uint32_t	event_data1;
10652 } hwrm_async_event_cmpl_ring_monitor_msg_t, *phwrm_async_event_cmpl_ring_monitor_msg_t;
10653 
10654 /* hwrm_async_event_cmpl_func_drvr_unload (size:128b/16B) */
10655 
10656 typedef struct hwrm_async_event_cmpl_func_drvr_unload {
10657 	uint16_t	type;
10658 	/*
10659 	 * This field indicates the exact type of the completion.
10660 	 * By convention, the LSB identifies the length of the
10661 	 * record in 16B units. Even values indicate 16B
10662 	 * records. Odd values indicate 32B
10663 	 * records.
10664 	 */
10665 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_MASK		UINT32_C(0x3f)
10666 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_SFT		0
10667 	/* HWRM Asynchronous Event Information */
10668 		#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10669 		#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
10670 	/* Identifiers of events. */
10671 	uint16_t	event_id;
10672 	/* Function driver unloaded */
10673 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD UINT32_C(0x10)
10674 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD
10675 	/* Event specific data */
10676 	uint32_t	event_data2;
10677 	uint8_t	opaque_v;
10678 	/*
10679 	 * This value is written by the NIC such that it will be different
10680 	 * for each pass through the completion queue. The even passes
10681 	 * will write 1. The odd passes will write 0.
10682 	 */
10683 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_V	UINT32_C(0x1)
10684 	/* opaque is 7 b */
10685 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe)
10686 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_SFT 1
10687 	/* 8-lsb timestamp from POR (100-msec resolution) */
10688 	uint8_t	timestamp_lo;
10689 	/* 16-lsb timestamp from POR (100-msec resolution) */
10690 	uint16_t	timestamp_hi;
10691 	/* Event specific data */
10692 	uint32_t	event_data1;
10693 	/* Function ID */
10694 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
10695 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
10696 } hwrm_async_event_cmpl_func_drvr_unload_t, *phwrm_async_event_cmpl_func_drvr_unload_t;
10697 
10698 /* hwrm_async_event_cmpl_func_drvr_load (size:128b/16B) */
10699 
10700 typedef struct hwrm_async_event_cmpl_func_drvr_load {
10701 	uint16_t	type;
10702 	/*
10703 	 * This field indicates the exact type of the completion.
10704 	 * By convention, the LSB identifies the length of the
10705 	 * record in 16B units. Even values indicate 16B
10706 	 * records. Odd values indicate 32B
10707 	 * records.
10708 	 */
10709 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_MASK		UINT32_C(0x3f)
10710 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_SFT		0
10711 	/* HWRM Asynchronous Event Information */
10712 		#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10713 		#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
10714 	/* Identifiers of events. */
10715 	uint16_t	event_id;
10716 	/* Function driver loaded */
10717 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD UINT32_C(0x11)
10718 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD
10719 	/* Event specific data */
10720 	uint32_t	event_data2;
10721 	uint8_t	opaque_v;
10722 	/*
10723 	 * This value is written by the NIC such that it will be different
10724 	 * for each pass through the completion queue. The even passes
10725 	 * will write 1. The odd passes will write 0.
10726 	 */
10727 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_V	UINT32_C(0x1)
10728 	/* opaque is 7 b */
10729 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
10730 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_SFT 1
10731 	/* 8-lsb timestamp from POR (100-msec resolution) */
10732 	uint8_t	timestamp_lo;
10733 	/* 16-lsb timestamp from POR (100-msec resolution) */
10734 	uint16_t	timestamp_hi;
10735 	/* Event specific data */
10736 	uint32_t	event_data1;
10737 	/* Function ID */
10738 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
10739 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
10740 } hwrm_async_event_cmpl_func_drvr_load_t, *phwrm_async_event_cmpl_func_drvr_load_t;
10741 
10742 /* hwrm_async_event_cmpl_func_flr_proc_cmplt (size:128b/16B) */
10743 
10744 typedef struct hwrm_async_event_cmpl_func_flr_proc_cmplt {
10745 	uint16_t	type;
10746 	/*
10747 	 * This field indicates the exact type of the completion.
10748 	 * By convention, the LSB identifies the length of the
10749 	 * record in 16B units. Even values indicate 16B
10750 	 * records. Odd values indicate 32B
10751 	 * records.
10752 	 */
10753 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_MASK		UINT32_C(0x3f)
10754 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_SFT		0
10755 	/* HWRM Asynchronous Event Information */
10756 		#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10757 		#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT
10758 	/* Identifiers of events. */
10759 	uint16_t	event_id;
10760 	/* Function FLR related processing has completed */
10761 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT UINT32_C(0x12)
10762 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT
10763 	/* Event specific data */
10764 	uint32_t	event_data2;
10765 	uint8_t	opaque_v;
10766 	/*
10767 	 * This value is written by the NIC such that it will be different
10768 	 * for each pass through the completion queue. The even passes
10769 	 * will write 1. The odd passes will write 0.
10770 	 */
10771 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_V	UINT32_C(0x1)
10772 	/* opaque is 7 b */
10773 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_MASK UINT32_C(0xfe)
10774 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_SFT 1
10775 	/* 8-lsb timestamp from POR (100-msec resolution) */
10776 	uint8_t	timestamp_lo;
10777 	/* 16-lsb timestamp from POR (100-msec resolution) */
10778 	uint16_t	timestamp_hi;
10779 	/* Event specific data */
10780 	uint32_t	event_data1;
10781 	/* Function ID */
10782 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
10783 	#define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_SFT 0
10784 } hwrm_async_event_cmpl_func_flr_proc_cmplt_t, *phwrm_async_event_cmpl_func_flr_proc_cmplt_t;
10785 
10786 /* hwrm_async_event_cmpl_pf_drvr_unload (size:128b/16B) */
10787 
10788 typedef struct hwrm_async_event_cmpl_pf_drvr_unload {
10789 	uint16_t	type;
10790 	/*
10791 	 * This field indicates the exact type of the completion.
10792 	 * By convention, the LSB identifies the length of the
10793 	 * record in 16B units. Even values indicate 16B
10794 	 * records. Odd values indicate 32B
10795 	 * records.
10796 	 */
10797 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_MASK		UINT32_C(0x3f)
10798 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_SFT		0
10799 	/* HWRM Asynchronous Event Information */
10800 		#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10801 		#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
10802 	/* Identifiers of events. */
10803 	uint16_t	event_id;
10804 	/* PF driver unloaded */
10805 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD UINT32_C(0x20)
10806 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD
10807 	/* Event specific data */
10808 	uint32_t	event_data2;
10809 	uint8_t	opaque_v;
10810 	/*
10811 	 * This value is written by the NIC such that it will be different
10812 	 * for each pass through the completion queue. The even passes
10813 	 * will write 1. The odd passes will write 0.
10814 	 */
10815 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_V	UINT32_C(0x1)
10816 	/* opaque is 7 b */
10817 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe)
10818 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_SFT 1
10819 	/* 8-lsb timestamp from POR (100-msec resolution) */
10820 	uint8_t	timestamp_lo;
10821 	/* 16-lsb timestamp from POR (100-msec resolution) */
10822 	uint16_t	timestamp_hi;
10823 	/* Event specific data */
10824 	uint32_t	event_data1;
10825 	/* PF ID */
10826 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
10827 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
10828 	/* Indicates the physical port this pf belongs to */
10829 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK   UINT32_C(0x70000)
10830 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT	16
10831 } hwrm_async_event_cmpl_pf_drvr_unload_t, *phwrm_async_event_cmpl_pf_drvr_unload_t;
10832 
10833 /* hwrm_async_event_cmpl_pf_drvr_load (size:128b/16B) */
10834 
10835 typedef struct hwrm_async_event_cmpl_pf_drvr_load {
10836 	uint16_t	type;
10837 	/*
10838 	 * This field indicates the exact type of the completion.
10839 	 * By convention, the LSB identifies the length of the
10840 	 * record in 16B units. Even values indicate 16B
10841 	 * records. Odd values indicate 32B
10842 	 * records.
10843 	 */
10844 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_MASK		UINT32_C(0x3f)
10845 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_SFT		0
10846 	/* HWRM Asynchronous Event Information */
10847 		#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10848 		#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
10849 	/* Identifiers of events. */
10850 	uint16_t	event_id;
10851 	/* PF driver loaded */
10852 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD UINT32_C(0x21)
10853 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD
10854 	/* Event specific data */
10855 	uint32_t	event_data2;
10856 	uint8_t	opaque_v;
10857 	/*
10858 	 * This value is written by the NIC such that it will be different
10859 	 * for each pass through the completion queue. The even passes
10860 	 * will write 1. The odd passes will write 0.
10861 	 */
10862 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_V	UINT32_C(0x1)
10863 	/* opaque is 7 b */
10864 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
10865 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_SFT 1
10866 	/* 8-lsb timestamp from POR (100-msec resolution) */
10867 	uint8_t	timestamp_lo;
10868 	/* 16-lsb timestamp from POR (100-msec resolution) */
10869 	uint16_t	timestamp_hi;
10870 	/* Event specific data */
10871 	uint32_t	event_data1;
10872 	/* PF ID */
10873 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK UINT32_C(0xffff)
10874 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
10875 	/* Indicates the physical port this pf belongs to */
10876 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK   UINT32_C(0x70000)
10877 	#define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT	16
10878 } hwrm_async_event_cmpl_pf_drvr_load_t, *phwrm_async_event_cmpl_pf_drvr_load_t;
10879 
10880 /* hwrm_async_event_cmpl_vf_flr (size:128b/16B) */
10881 
10882 typedef struct hwrm_async_event_cmpl_vf_flr {
10883 	uint16_t	type;
10884 	/*
10885 	 * This field indicates the exact type of the completion.
10886 	 * By convention, the LSB identifies the length of the
10887 	 * record in 16B units. Even values indicate 16B
10888 	 * records. Odd values indicate 32B
10889 	 * records.
10890 	 */
10891 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_MASK		UINT32_C(0x3f)
10892 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_SFT		0
10893 	/* HWRM Asynchronous Event Information */
10894 		#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10895 		#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT
10896 	/* Identifiers of events. */
10897 	uint16_t	event_id;
10898 	/* VF Function Level Reset (FLR) */
10899 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR UINT32_C(0x30)
10900 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_LAST  HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR
10901 	/* Event specific data */
10902 	uint32_t	event_data2;
10903 	uint8_t	opaque_v;
10904 	/*
10905 	 * This value is written by the NIC such that it will be different
10906 	 * for each pass through the completion queue. The even passes
10907 	 * will write 1. The odd passes will write 0.
10908 	 */
10909 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_V	UINT32_C(0x1)
10910 	/* opaque is 7 b */
10911 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_MASK UINT32_C(0xfe)
10912 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_SFT 1
10913 	/* 8-lsb timestamp from POR (100-msec resolution) */
10914 	uint8_t	timestamp_lo;
10915 	/* 16-lsb timestamp from POR (100-msec resolution) */
10916 	uint16_t	timestamp_hi;
10917 	/* Event specific data */
10918 	uint32_t	event_data1;
10919 	/* VF ID */
10920 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK UINT32_C(0xffff)
10921 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT 0
10922 	/* Indicates the physical function this event occurred on. */
10923 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_MASK UINT32_C(0xff0000)
10924 	#define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_SFT 16
10925 } hwrm_async_event_cmpl_vf_flr_t, *phwrm_async_event_cmpl_vf_flr_t;
10926 
10927 /* hwrm_async_event_cmpl_vf_mac_addr_change (size:128b/16B) */
10928 
10929 typedef struct hwrm_async_event_cmpl_vf_mac_addr_change {
10930 	uint16_t	type;
10931 	/*
10932 	 * This field indicates the exact type of the completion.
10933 	 * By convention, the LSB identifies the length of the
10934 	 * record in 16B units. Even values indicate 16B
10935 	 * records. Odd values indicate 32B
10936 	 * records.
10937 	 */
10938 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10939 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_SFT		0
10940 	/* HWRM Asynchronous Event Information */
10941 		#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10942 		#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT
10943 	/* Identifiers of events. */
10944 	uint16_t	event_id;
10945 	/* VF MAC Address Change */
10946 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE UINT32_C(0x31)
10947 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE
10948 	/* Event specific data */
10949 	uint32_t	event_data2;
10950 	uint8_t	opaque_v;
10951 	/*
10952 	 * This value is written by the NIC such that it will be different
10953 	 * for each pass through the completion queue. The even passes
10954 	 * will write 1. The odd passes will write 0.
10955 	 */
10956 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_V	UINT32_C(0x1)
10957 	/* opaque is 7 b */
10958 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10959 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_SFT 1
10960 	/* 8-lsb timestamp from POR (100-msec resolution) */
10961 	uint8_t	timestamp_lo;
10962 	/* 16-lsb timestamp from POR (100-msec resolution) */
10963 	uint16_t	timestamp_hi;
10964 	/* Event specific data */
10965 	uint32_t	event_data1;
10966 	/* VF ID */
10967 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_MASK UINT32_C(0xffff)
10968 	#define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT 0
10969 } hwrm_async_event_cmpl_vf_mac_addr_change_t, *phwrm_async_event_cmpl_vf_mac_addr_change_t;
10970 
10971 /* hwrm_async_event_cmpl_pf_vf_comm_status_change (size:128b/16B) */
10972 
10973 typedef struct hwrm_async_event_cmpl_pf_vf_comm_status_change {
10974 	uint16_t	type;
10975 	/*
10976 	 * This field indicates the exact type of the completion.
10977 	 * By convention, the LSB identifies the length of the
10978 	 * record in 16B units. Even values indicate 16B
10979 	 * records. Odd values indicate 32B
10980 	 * records.
10981 	 */
10982 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_MASK		UINT32_C(0x3f)
10983 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_SFT		0
10984 	/* HWRM Asynchronous Event Information */
10985 		#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
10986 		#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
10987 	/* Identifiers of events. */
10988 	uint16_t	event_id;
10989 	/* PF-VF communication channel status change. */
10990 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE UINT32_C(0x32)
10991 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_LAST			HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE
10992 	/* Event specific data */
10993 	uint32_t	event_data2;
10994 	uint8_t	opaque_v;
10995 	/*
10996 	 * This value is written by the NIC such that it will be different
10997 	 * for each pass through the completion queue. The even passes
10998 	 * will write 1. The odd passes will write 0.
10999 	 */
11000 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_V	UINT32_C(0x1)
11001 	/* opaque is 7 b */
11002 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
11003 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_SFT 1
11004 	/* 8-lsb timestamp from POR (100-msec resolution) */
11005 	uint8_t	timestamp_lo;
11006 	/* 16-lsb timestamp from POR (100-msec resolution) */
11007 	uint16_t	timestamp_hi;
11008 	/* Event specific data */
11009 	uint32_t	event_data1;
11010 	/*
11011 	 * If this bit is set to 1, then it indicates that the PF-VF
11012 	 * communication was lost and it is established.
11013 	 * If this bit set to 0, then it indicates that the PF-VF
11014 	 * communication was established and it is lost.
11015 	 */
11016 	#define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_DATA1_COMM_ESTABLISHED	UINT32_C(0x1)
11017 } hwrm_async_event_cmpl_pf_vf_comm_status_change_t, *phwrm_async_event_cmpl_pf_vf_comm_status_change_t;
11018 
11019 /* hwrm_async_event_cmpl_vf_cfg_change (size:128b/16B) */
11020 
11021 typedef struct hwrm_async_event_cmpl_vf_cfg_change {
11022 	uint16_t	type;
11023 	/*
11024 	 * This field indicates the exact type of the completion.
11025 	 * By convention, the LSB identifies the length of the
11026 	 * record in 16B units. Even values indicate 16B
11027 	 * records. Odd values indicate 32B
11028 	 * records.
11029 	 */
11030 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_MASK		UINT32_C(0x3f)
11031 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_SFT		0
11032 	/* HWRM Asynchronous Event Information */
11033 		#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11034 		#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
11035 	/* Identifiers of events. */
11036 	uint16_t	event_id;
11037 	/* VF Configuration Change */
11038 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE UINT32_C(0x33)
11039 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE
11040 	/* Event specific data */
11041 	uint32_t	event_data2;
11042 	/*
11043 	 * This value indicates the VF ID of the VF whose configuration
11044 	 * is changing if this async. event is sent to the parent PF.
11045 	 * The firmware supports sending this to the parent PF if the
11046 	 * `hwrm_func_qcaps.vf_cfg_async_for_pf_supported` value is 1.
11047 	 * This value is undefined when the async. event is sent to the
11048 	 * VF.
11049 	 */
11050 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA2_VF_ID_MASK UINT32_C(0xffff)
11051 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA2_VF_ID_SFT 0
11052 	uint8_t	opaque_v;
11053 	/*
11054 	 * This value is written by the NIC such that it will be different
11055 	 * for each pass through the completion queue. The even passes
11056 	 * will write 1. The odd passes will write 0.
11057 	 */
11058 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_V	UINT32_C(0x1)
11059 	/* opaque is 7 b */
11060 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
11061 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_SFT 1
11062 	/* 8-lsb timestamp from POR (100-msec resolution) */
11063 	uint8_t	timestamp_lo;
11064 	/* 16-lsb timestamp from POR (100-msec resolution) */
11065 	uint16_t	timestamp_hi;
11066 	/*
11067 	 * Each flag provided in this field indicates a specific VF
11068 	 * configuration change. At least one of these flags shall be set to 1
11069 	 * when an asynchronous event completion of this type is provided
11070 	 * by the HWRM.
11071 	 */
11072 	uint32_t	event_data1;
11073 	/*
11074 	 * If this bit is set to 1, then the value of MTU
11075 	 * was changed on this VF.
11076 	 * If set to 0, then this bit should be ignored.
11077 	 */
11078 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MTU_CHANGE		UINT32_C(0x1)
11079 	/*
11080 	 * If this bit is set to 1, then the value of MRU
11081 	 * was changed on this VF.
11082 	 * If set to 0, then this bit should be ignored.
11083 	 */
11084 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MRU_CHANGE		UINT32_C(0x2)
11085 	/*
11086 	 * If this bit is set to 1, then the value of default MAC
11087 	 * address was changed on this VF.
11088 	 * If set to 0, then this bit should be ignored.
11089 	 */
11090 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_MAC_ADDR_CHANGE	UINT32_C(0x4)
11091 	/*
11092 	 * If this bit is set to 1, then the value of default VLAN
11093 	 * was changed on this VF.
11094 	 * If set to 0, then this bit should be ignored.
11095 	 */
11096 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE	UINT32_C(0x8)
11097 	/*
11098 	 * If this bit is set to 1, then the value of trusted VF enable
11099 	 * was changed on this VF.
11100 	 * If set to 0, then this bit should be ignored.
11101 	 */
11102 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TRUSTED_VF_CFG_CHANGE	UINT32_C(0x10)
11103 	/*
11104 	 * If this bit is set to 1, then the control of VF was relinquished
11105 	 * back to the firmware flow manager following the function takeover
11106 	 * by TruFlow.
11107 	 * If set to 0, then this bit should be ignored.
11108 	 */
11109 	#define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TF_OWNERSHIP_RELEASE	UINT32_C(0x20)
11110 } hwrm_async_event_cmpl_vf_cfg_change_t, *phwrm_async_event_cmpl_vf_cfg_change_t;
11111 
11112 /* hwrm_async_event_cmpl_llfc_pfc_change (size:128b/16B) */
11113 
11114 typedef struct hwrm_async_event_cmpl_llfc_pfc_change {
11115 	uint16_t	type;
11116 	/*
11117 	 * This field indicates the exact type of the completion.
11118 	 * By convention, the LSB identifies the length of the
11119 	 * record in 16B units. Even values indicate 16B
11120 	 * records. Odd values indicate 32B
11121 	 * records.
11122 	 */
11123 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_MASK		UINT32_C(0x3f)
11124 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_SFT		0
11125 	/* HWRM Asynchronous Event Information */
11126 		#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11127 		#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT
11128 	/* unused1 is 10 b */
11129 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_MASK	UINT32_C(0xffc0)
11130 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_SFT	6
11131 	/* Identifiers of events. */
11132 	uint16_t	event_id;
11133 	/* LLFC/PFC Configuration Change */
11134 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE UINT32_C(0x34)
11135 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE
11136 	/* Event specific data */
11137 	uint32_t	event_data2;
11138 	uint8_t	opaque_v;
11139 	/*
11140 	 * This value is written by the NIC such that it will be different
11141 	 * for each pass through the completion queue. The even passes
11142 	 * will write 1. The odd passes will write 0.
11143 	 */
11144 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_V	UINT32_C(0x1)
11145 	/* opaque is 7 b */
11146 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
11147 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_SFT 1
11148 	/* 8-lsb timestamp from POR (100-msec resolution) */
11149 	uint8_t	timestamp_lo;
11150 	/* 16-lsb timestamp from POR (100-msec resolution) */
11151 	uint16_t	timestamp_hi;
11152 	/* Event specific data */
11153 	uint32_t	event_data1;
11154 	/* Indicates llfc pfc status change */
11155 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_MASK UINT32_C(0x3)
11156 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_SFT 0
11157 	/*
11158 	 * If this field set to 1, then it indicates that llfc is
11159 	 * enabled.
11160 	 */
11161 		#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LLFC  UINT32_C(0x1)
11162 	/*
11163 	 * If this field is set to 2, then it indicates that pfc
11164 	 * is enabled.
11165 	 */
11166 		#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC   UINT32_C(0x2)
11167 		#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LAST HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC
11168 	/* Indicates the physical port this llfc pfc change occur */
11169 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_MASK	UINT32_C(0x1c)
11170 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_SFT	2
11171 	/* PORT ID */
11172 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_MASK UINT32_C(0x1fffe0)
11173 	#define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_SFT  5
11174 } hwrm_async_event_cmpl_llfc_pfc_change_t, *phwrm_async_event_cmpl_llfc_pfc_change_t;
11175 
11176 /* hwrm_async_event_cmpl_default_vnic_change (size:128b/16B) */
11177 
11178 typedef struct hwrm_async_event_cmpl_default_vnic_change {
11179 	uint16_t	type;
11180 	/*
11181 	 * This field indicates the exact type of the completion.
11182 	 * By convention, the LSB identifies the length of the
11183 	 * record in 16B units. Even values indicate 16B
11184 	 * records. Odd values indicate 32B
11185 	 * records.
11186 	 */
11187 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_MASK		UINT32_C(0x3f)
11188 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_SFT		0
11189 	/* HWRM Asynchronous Event Information */
11190 		#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11191 		#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT
11192 	/* unused1 is 10 b */
11193 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_MASK	UINT32_C(0xffc0)
11194 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_SFT	6
11195 	/* Identifiers of events. */
11196 	uint16_t	event_id;
11197 	/* Notification of a default vnic allocation or free */
11198 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION UINT32_C(0x35)
11199 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION
11200 	/* Event specific data */
11201 	uint32_t	event_data2;
11202 	uint8_t	opaque_v;
11203 	/*
11204 	 * This value is written by the NIC such that it will be different
11205 	 * for each pass through the completion queue. The even passes
11206 	 * will write 1. The odd passes will write 0.
11207 	 */
11208 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_V	UINT32_C(0x1)
11209 	/* opaque is 7 b */
11210 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
11211 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_SFT 1
11212 	/* 8-lsb timestamp from POR (100-msec resolution) */
11213 	uint8_t	timestamp_lo;
11214 	/* 16-lsb timestamp from POR (100-msec resolution) */
11215 	uint16_t	timestamp_hi;
11216 	/* Event specific data */
11217 	uint32_t	event_data1;
11218 	/* Indicates default vnic configuration change */
11219 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_MASK	UINT32_C(0x3)
11220 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_SFT	0
11221 	/*
11222 	 * If this field is set to 1, then it indicates that
11223 	 * a default VNIC has been allocate.
11224 	 */
11225 		#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_ALLOC  UINT32_C(0x1)
11226 	/*
11227 	 * If this field is set to 2, then it indicates that
11228 	 * a default VNIC has been freed.
11229 	 */
11230 		#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE   UINT32_C(0x2)
11231 		#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_LAST	HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE
11232 	/* Indicates the physical function this event occurred on. */
11233 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_MASK		UINT32_C(0x3fc)
11234 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_SFT			2
11235 	/* Indicates the virtual function this event occurred on */
11236 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_MASK		UINT32_C(0x3fffc00)
11237 	#define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_SFT			10
11238 } hwrm_async_event_cmpl_default_vnic_change_t, *phwrm_async_event_cmpl_default_vnic_change_t;
11239 
11240 /* hwrm_async_event_cmpl_hw_flow_aged (size:128b/16B) */
11241 
11242 typedef struct hwrm_async_event_cmpl_hw_flow_aged {
11243 	uint16_t	type;
11244 	/*
11245 	 * This field indicates the exact type of the completion.
11246 	 * By convention, the LSB identifies the length of the
11247 	 * record in 16B units. Even values indicate 16B
11248 	 * records. Odd values indicate 32B
11249 	 * records.
11250 	 */
11251 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_MASK		UINT32_C(0x3f)
11252 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_SFT		0
11253 	/* HWRM Asynchronous Event Information */
11254 		#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11255 		#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT
11256 	/* Identifiers of events. */
11257 	uint16_t	event_id;
11258 	/* Notification of a hw flow aged */
11259 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED UINT32_C(0x36)
11260 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED
11261 	/* Event specific data */
11262 	uint32_t	event_data2;
11263 	uint8_t	opaque_v;
11264 	/*
11265 	 * This value is written by the NIC such that it will be different
11266 	 * for each pass through the completion queue. The even passes
11267 	 * will write 1. The odd passes will write 0.
11268 	 */
11269 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_V	UINT32_C(0x1)
11270 	/* opaque is 7 b */
11271 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_MASK UINT32_C(0xfe)
11272 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_SFT 1
11273 	/* 8-lsb timestamp from POR (100-msec resolution) */
11274 	uint8_t	timestamp_lo;
11275 	/* 16-lsb timestamp from POR (100-msec resolution) */
11276 	uint16_t	timestamp_hi;
11277 	/* Event specific data */
11278 	uint32_t	event_data1;
11279 	/* Indicates flow ID this event occurred on. */
11280 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_MASK	UINT32_C(0x7fffffff)
11281 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_SFT	0
11282 	/* Indicates flow direction this event occurred on. */
11283 	#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION	UINT32_C(0x80000000)
11284 	/*
11285 	 * If this bit set to 0, then it indicates that the aged
11286 	 * event was rx flow.
11287 	 */
11288 		#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_RX	(UINT32_C(0x0) << 31)
11289 	/*
11290 	 * If this bit is set to 1, then it indicates that the aged
11291 	 * event was tx flow.
11292 	 */
11293 		#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX	(UINT32_C(0x1) << 31)
11294 		#define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_LAST HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX
11295 } hwrm_async_event_cmpl_hw_flow_aged_t, *phwrm_async_event_cmpl_hw_flow_aged_t;
11296 
11297 /* hwrm_async_event_cmpl_eem_cache_flush_req (size:128b/16B) */
11298 
11299 typedef struct hwrm_async_event_cmpl_eem_cache_flush_req {
11300 	uint16_t	type;
11301 	/*
11302 	 * This field indicates the exact type of the completion.
11303 	 * By convention, the LSB identifies the length of the
11304 	 * record in 16B units. Even values indicate 16B
11305 	 * records. Odd values indicate 32B
11306 	 * records.
11307 	 */
11308 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_MASK		UINT32_C(0x3f)
11309 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_SFT		0
11310 	/* HWRM Asynchronous Event Information */
11311 		#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11312 		#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT
11313 	/* Identifiers of events. */
11314 	uint16_t	event_id;
11315 	/* Notification of a eem_cache_flush request */
11316 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ UINT32_C(0x38)
11317 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ
11318 	/* Event specific data */
11319 	uint32_t	event_data2;
11320 	uint8_t	opaque_v;
11321 	/*
11322 	 * This value is written by the NIC such that it will be different
11323 	 * for each pass through the completion queue. The even passes
11324 	 * will write 1. The odd passes will write 0.
11325 	 */
11326 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_V	UINT32_C(0x1)
11327 	/* opaque is 7 b */
11328 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_MASK UINT32_C(0xfe)
11329 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_SFT 1
11330 	/* 8-lsb timestamp from POR (100-msec resolution) */
11331 	uint8_t	timestamp_lo;
11332 	/* 16-lsb timestamp from POR (100-msec resolution) */
11333 	uint16_t	timestamp_hi;
11334 	/* Event specific data */
11335 	uint32_t	event_data1;
11336 } hwrm_async_event_cmpl_eem_cache_flush_req_t, *phwrm_async_event_cmpl_eem_cache_flush_req_t;
11337 
11338 /* hwrm_async_event_cmpl_eem_cache_flush_done (size:128b/16B) */
11339 
11340 typedef struct hwrm_async_event_cmpl_eem_cache_flush_done {
11341 	uint16_t	type;
11342 	/*
11343 	 * This field indicates the exact type of the completion.
11344 	 * By convention, the LSB identifies the length of the
11345 	 * record in 16B units. Even values indicate 16B
11346 	 * records. Odd values indicate 32B
11347 	 * records.
11348 	 */
11349 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_MASK		UINT32_C(0x3f)
11350 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_SFT		0
11351 	/* HWRM Asynchronous Event Information */
11352 		#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11353 		#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT
11354 	/* Identifiers of events. */
11355 	uint16_t	event_id;
11356 	/*
11357 	 * Notification of a host eem_cache_flush has completed. This event
11358 	 * is generated by the host driver.
11359 	 */
11360 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE UINT32_C(0x39)
11361 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE
11362 	/* Event specific data */
11363 	uint32_t	event_data2;
11364 	uint8_t	opaque_v;
11365 	/*
11366 	 * This value is written by the NIC such that it will be different
11367 	 * for each pass through the completion queue. The even passes
11368 	 * will write 1. The odd passes will write 0.
11369 	 */
11370 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_V	UINT32_C(0x1)
11371 	/* opaque is 7 b */
11372 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_MASK UINT32_C(0xfe)
11373 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_SFT 1
11374 	/* 8-lsb timestamp from POR (100-msec resolution) */
11375 	uint8_t	timestamp_lo;
11376 	/* 16-lsb timestamp from POR (100-msec resolution) */
11377 	uint16_t	timestamp_hi;
11378 	/* Event specific data */
11379 	uint32_t	event_data1;
11380 	/* Indicates function ID that this event occurred on. */
11381 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_MASK UINT32_C(0xffff)
11382 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_SFT 0
11383 } hwrm_async_event_cmpl_eem_cache_flush_done_t, *phwrm_async_event_cmpl_eem_cache_flush_done_t;
11384 
11385 /* hwrm_async_event_cmpl_tcp_flag_action_change (size:128b/16B) */
11386 
11387 typedef struct hwrm_async_event_cmpl_tcp_flag_action_change {
11388 	uint16_t	type;
11389 	/*
11390 	 * This field indicates the exact type of the completion.
11391 	 * By convention, the LSB identifies the length of the
11392 	 * record in 16B units. Even values indicate 16B
11393 	 * records. Odd values indicate 32B
11394 	 * records.
11395 	 */
11396 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_MASK		UINT32_C(0x3f)
11397 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_SFT		0
11398 	/* HWRM Asynchronous Event Information */
11399 		#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11400 		#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT
11401 	/* Identifiers of events. */
11402 	uint16_t	event_id;
11403 	/* Notification of tcp flag action change */
11404 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE UINT32_C(0x3a)
11405 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE
11406 	/* Event specific data */
11407 	uint32_t	event_data2;
11408 	uint8_t	opaque_v;
11409 	/*
11410 	 * This value is written by the NIC such that it will be different
11411 	 * for each pass through the completion queue. The even passes
11412 	 * will write 1. The odd passes will write 0.
11413 	 */
11414 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_V	UINT32_C(0x1)
11415 	/* opaque is 7 b */
11416 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
11417 	#define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_SFT 1
11418 	/* 8-lsb timestamp from POR (100-msec resolution) */
11419 	uint8_t	timestamp_lo;
11420 	/* 16-lsb timestamp from POR (100-msec resolution) */
11421 	uint16_t	timestamp_hi;
11422 	/* Event specific data */
11423 	uint32_t	event_data1;
11424 } hwrm_async_event_cmpl_tcp_flag_action_change_t, *phwrm_async_event_cmpl_tcp_flag_action_change_t;
11425 
11426 /* hwrm_async_event_cmpl_eem_flow_active (size:128b/16B) */
11427 
11428 typedef struct hwrm_async_event_cmpl_eem_flow_active {
11429 	uint16_t	type;
11430 	/*
11431 	 * This field indicates the exact type of the completion.
11432 	 * By convention, the LSB identifies the length of the
11433 	 * record in 16B units. Even values indicate 16B
11434 	 * records. Odd values indicate 32B
11435 	 * records.
11436 	 */
11437 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_MASK		UINT32_C(0x3f)
11438 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_SFT		0
11439 	/* HWRM Asynchronous Event Information */
11440 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11441 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT
11442 	/* Identifiers of events. */
11443 	uint16_t	event_id;
11444 	/* Notification of an active eem flow */
11445 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE UINT32_C(0x3b)
11446 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE
11447 	/* Event specific data */
11448 	uint32_t	event_data2;
11449 	/* Indicates the 2nd global id this event occurred on. */
11450 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_MASK   UINT32_C(0x3fffffff)
11451 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_SFT	0
11452 	/*
11453 	 * Indicates flow direction of the flow identified by
11454 	 * the global_id_2.
11455 	 */
11456 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION	UINT32_C(0x40000000)
11457 	/* If this bit is set to 0, then it indicates that this rx flow. */
11458 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_RX	(UINT32_C(0x0) << 30)
11459 	/* If this bit is set to 1, then it indicates that this tx flow. */
11460 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX	(UINT32_C(0x1) << 30)
11461 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_LAST HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX
11462 	uint8_t	opaque_v;
11463 	/*
11464 	 * This value is written by the NIC such that it will be different
11465 	 * for each pass through the completion queue. The even passes
11466 	 * will write 1. The odd passes will write 0.
11467 	 */
11468 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_V	UINT32_C(0x1)
11469 	/* opaque is 7 b */
11470 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_MASK UINT32_C(0xfe)
11471 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_SFT 1
11472 	/* 8-lsb timestamp from POR (100-msec resolution) */
11473 	uint8_t	timestamp_lo;
11474 	/* 16-lsb timestamp from POR (100-msec resolution) */
11475 	uint16_t	timestamp_hi;
11476 	/* Event specific data */
11477 	uint32_t	event_data1;
11478 	/* Indicates the 1st global id this event occurred on. */
11479 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_MASK   UINT32_C(0x3fffffff)
11480 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_SFT	0
11481 	/*
11482 	 * Indicates flow direction of the flow identified by the
11483 	 * global_id_1.
11484 	 */
11485 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION	UINT32_C(0x40000000)
11486 	/* If this bit is set to 0, then it indicates that this is rx flow. */
11487 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_RX	(UINT32_C(0x0) << 30)
11488 	/* If this bit is set to 1, then it indicates that this is tx flow. */
11489 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX	(UINT32_C(0x1) << 30)
11490 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_LAST HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX
11491 	/*
11492 	 * Indicates EEM flow aging mode this event occurred on. If
11493 	 * this bit is set to 0, the event_data1 is the EEM global
11494 	 * ID. If this bit is set to 1, the event_data1 is the number
11495 	 * of global ID in the context memory.
11496 	 */
11497 	#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE		UINT32_C(0x80000000)
11498 	/* EEM flow aging mode 0. */
11499 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_0		(UINT32_C(0x0) << 31)
11500 	/* EEM flow aging mode 1. */
11501 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1		(UINT32_C(0x1) << 31)
11502 		#define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_LAST	HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1
11503 } hwrm_async_event_cmpl_eem_flow_active_t, *phwrm_async_event_cmpl_eem_flow_active_t;
11504 
11505 /* hwrm_async_event_cmpl_eem_cfg_change (size:128b/16B) */
11506 
11507 typedef struct hwrm_async_event_cmpl_eem_cfg_change {
11508 	uint16_t	type;
11509 	/*
11510 	 * This field indicates the exact type of the completion.
11511 	 * By convention, the LSB identifies the length of the
11512 	 * record in 16B units. Even values indicate 16B
11513 	 * records. Odd values indicate 32B
11514 	 * records.
11515 	 */
11516 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_MASK		UINT32_C(0x3f)
11517 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_SFT		0
11518 	/* HWRM Asynchronous Event Information */
11519 		#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11520 		#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
11521 	/* Identifiers of events. */
11522 	uint16_t	event_id;
11523 	/* Notification of EEM configuration change */
11524 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE UINT32_C(0x3c)
11525 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE
11526 	/* Event specific data */
11527 	uint32_t	event_data2;
11528 	uint8_t	opaque_v;
11529 	/*
11530 	 * This value is written by the NIC such that it will be different
11531 	 * for each pass through the completion queue. The even passes
11532 	 * will write 1. The odd passes will write 0.
11533 	 */
11534 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_V	UINT32_C(0x1)
11535 	/* opaque is 7 b */
11536 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
11537 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_SFT 1
11538 	/* 8-lsb timestamp from POR (100-msec resolution) */
11539 	uint8_t	timestamp_lo;
11540 	/* 16-lsb timestamp from POR (100-msec resolution) */
11541 	uint16_t	timestamp_hi;
11542 	/* Event specific data */
11543 	uint32_t	event_data1;
11544 	/*
11545 	 * Value of 1 to indicate EEM TX configuration is enabled. Value of
11546 	 * 0 to indicate the EEM TX configuration is disabled.
11547 	 */
11548 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_TX_ENABLE	UINT32_C(0x1)
11549 	/*
11550 	 * Value of 1 to indicate EEM RX configuration is enabled. Value of 0
11551 	 * to indicate the EEM RX configuration is disabled.
11552 	 */
11553 	#define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_RX_ENABLE	UINT32_C(0x2)
11554 } hwrm_async_event_cmpl_eem_cfg_change_t, *phwrm_async_event_cmpl_eem_cfg_change_t;
11555 
11556 /* hwrm_async_event_cmpl_quiesce_done (size:128b/16B) */
11557 
11558 typedef struct hwrm_async_event_cmpl_quiesce_done {
11559 	uint16_t	type;
11560 	/*
11561 	 * This field indicates the exact type of the completion.
11562 	 * By convention, the LSB identifies the length of the
11563 	 * record in 16B units. Even values indicate 16B
11564 	 * records. Odd values indicate 32B
11565 	 * records.
11566 	 */
11567 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_MASK		UINT32_C(0x3f)
11568 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_SFT		0
11569 	/* HWRM Asynchronous Event Information */
11570 		#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11571 		#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_HWRM_ASYNC_EVENT
11572 	/* Identifiers of events. */
11573 	uint16_t	event_id;
11574 	/* An event signifying completion of HWRM_FW_STATE_QUIESCE */
11575 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_QUIESCE_DONE UINT32_C(0x3f)
11576 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_QUIESCE_DONE
11577 	/* Event specific data */
11578 	uint32_t	event_data2;
11579 	/* Status of HWRM_FW_STATE_QUIESCE completion */
11580 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_MASK		UINT32_C(0xff)
11581 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_SFT		0
11582 	/*
11583 	 * The quiesce operation started by HWRM_FW_STATE_QUIESCE
11584 	 * completed successfully.
11585 	 */
11586 		#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_SUCCESS		UINT32_C(0x0)
11587 	/*
11588 	 * The quiesce operation started by HWRM_FW_STATE_QUIESCE timed
11589 	 * out.
11590 	 */
11591 		#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_TIMEOUT		UINT32_C(0x1)
11592 	/*
11593 	 * The quiesce operation started by HWRM_FW_STATE_QUIESCE
11594 	 * encountered an error.
11595 	 */
11596 		#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_ERROR		UINT32_C(0x2)
11597 		#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_LAST		HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_ERROR
11598 	/* opaque is 8 b */
11599 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_OPAQUE_MASK			UINT32_C(0xff00)
11600 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_OPAQUE_SFT			8
11601 	/*
11602 	 * Additional information about internal hardware state related to
11603 	 * idle/quiesce state. QUIESCE may succeed per quiesce_status
11604 	 * regardless of idle_state_flags. If QUIESCE fails, the host may
11605 	 * inspect idle_state_flags to determine whether a retry is warranted.
11606 	 */
11607 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_MASK		UINT32_C(0xff0000)
11608 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_SFT		16
11609 	/*
11610 	 * Failure to quiesce is caused by host not updating the NQ consumer
11611 	 * index.
11612 	 */
11613 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_INCOMPLETE_NQ	UINT32_C(0x10000)
11614 	/* Flag 1 indicating partial non-idle state. */
11615 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_1	UINT32_C(0x20000)
11616 	/* Flag 2 indicating partial non-idle state. */
11617 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_2	UINT32_C(0x40000)
11618 	/* Flag 3 indicating partial non-idle state. */
11619 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_3	UINT32_C(0x80000)
11620 	uint8_t	opaque_v;
11621 	/*
11622 	 * This value is written by the NIC such that it will be different
11623 	 * for each pass through the completion queue. The even passes
11624 	 * will write 1. The odd passes will write 0.
11625 	 */
11626 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_V	UINT32_C(0x1)
11627 	/* opaque is 7 b */
11628 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_OPAQUE_MASK UINT32_C(0xfe)
11629 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_OPAQUE_SFT 1
11630 	/* 8-lsb timestamp from POR (100-msec resolution) */
11631 	uint8_t	timestamp_lo;
11632 	/* 16-lsb timestamp from POR (100-msec resolution) */
11633 	uint16_t	timestamp_hi;
11634 	/* Event specific data */
11635 	uint32_t	event_data1;
11636 	/* Time stamp for error event */
11637 	#define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA1_TIMESTAMP	UINT32_C(0x1)
11638 } hwrm_async_event_cmpl_quiesce_done_t, *phwrm_async_event_cmpl_quiesce_done_t;
11639 
11640 /* hwrm_async_event_cmpl_deferred_response (size:128b/16B) */
11641 
11642 typedef struct hwrm_async_event_cmpl_deferred_response {
11643 	uint16_t	type;
11644 	/*
11645 	 * This field indicates the exact type of the completion.
11646 	 * By convention, the LSB identifies the length of the
11647 	 * record in 16B units. Even values indicate 16B
11648 	 * records. Odd values indicate 32B
11649 	 * records.
11650 	 */
11651 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_MASK		UINT32_C(0x3f)
11652 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_SFT		0
11653 	/* HWRM Asynchronous Event Information */
11654 		#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11655 		#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_HWRM_ASYNC_EVENT
11656 	/* Identifiers of events. */
11657 	uint16_t	event_id;
11658 	/*
11659 	 * An event signifying a HWRM command is in progress and its
11660 	 * response will be deferred
11661 	 */
11662 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_DEFERRED_RESPONSE UINT32_C(0x40)
11663 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_DEFERRED_RESPONSE
11664 	/* Event specific data */
11665 	uint32_t	event_data2;
11666 	/*
11667 	 * The PF's mailbox is clear to issue another command.
11668 	 * A command with this seq_id is still in progress
11669 	 * and will return a regular HWRM completion when done.
11670 	 * 'event_data1' field, if non-zero, contains the estimated
11671 	 * execution time for the command.
11672 	 */
11673 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_DATA2_SEQ_ID_MASK UINT32_C(0xffff)
11674 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_DATA2_SEQ_ID_SFT 0
11675 	uint8_t	opaque_v;
11676 	/*
11677 	 * This value is written by the NIC such that it will be different
11678 	 * for each pass through the completion queue. The even passes
11679 	 * will write 1. The odd passes will write 0.
11680 	 */
11681 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_V	UINT32_C(0x1)
11682 	/* opaque is 7 b */
11683 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_OPAQUE_MASK UINT32_C(0xfe)
11684 	#define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_OPAQUE_SFT 1
11685 	/* 8-lsb timestamp from POR (100-msec resolution) */
11686 	uint8_t	timestamp_lo;
11687 	/* 16-lsb timestamp from POR (100-msec resolution) */
11688 	uint16_t	timestamp_hi;
11689 	/* Estimated remaining time of command execution in ms (if not zero) */
11690 	uint32_t	event_data1;
11691 } hwrm_async_event_cmpl_deferred_response_t, *phwrm_async_event_cmpl_deferred_response_t;
11692 
11693 /* hwrm_async_event_cmpl_pfc_watchdog_cfg_change (size:128b/16B) */
11694 
11695 typedef struct hwrm_async_event_cmpl_pfc_watchdog_cfg_change {
11696 	uint16_t	type;
11697 	/*
11698 	 * This field indicates the exact type of the completion.
11699 	 * By convention, the LSB identifies the length of the
11700 	 * record in 16B units. Even values indicate 16B
11701 	 * records. Odd values indicate 32B
11702 	 * records.
11703 	 */
11704 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_MASK		UINT32_C(0x3f)
11705 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_SFT		0
11706 	/* HWRM Asynchronous Event Information */
11707 		#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11708 		#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
11709 	/* Identifiers of events. */
11710 	uint16_t	event_id;
11711 	/* PFC watchdog configuration change for given port/cos */
11712 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE UINT32_C(0x41)
11713 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE
11714 	/* Event specific data */
11715 	uint32_t	event_data2;
11716 	uint8_t	opaque_v;
11717 	/*
11718 	 * This value is written by the NIC such that it will be different
11719 	 * for each pass through the completion queue. The even passes
11720 	 * will write 1. The odd passes will write 0.
11721 	 */
11722 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_V	UINT32_C(0x1)
11723 	/* opaque is 7 b */
11724 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
11725 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_OPAQUE_SFT 1
11726 	/* 8-lsb timestamp from POR (100-msec resolution) */
11727 	uint8_t	timestamp_lo;
11728 	/* 16-lsb timestamp from POR (100-msec resolution) */
11729 	uint16_t	timestamp_hi;
11730 	/* Event specific data */
11731 	uint32_t	event_data1;
11732 	/*
11733 	 * 1 in bit position X indicates PFC watchdog should
11734 	 * be on for COSX
11735 	 */
11736 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_MASK		UINT32_C(0xff)
11737 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_SFT		0
11738 	/* 1 means PFC WD for COS0 is on, 0 - off. */
11739 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS0	UINT32_C(0x1)
11740 	/* 1 means PFC WD for COS1 is on, 0 - off. */
11741 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS1	UINT32_C(0x2)
11742 	/* 1 means PFC WD for COS2 is on, 0 - off. */
11743 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS2	UINT32_C(0x4)
11744 	/* 1 means PFC WD for COS3 is on, 0 - off. */
11745 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS3	UINT32_C(0x8)
11746 	/* 1 means PFC WD for COS4 is on, 0 - off. */
11747 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS4	UINT32_C(0x10)
11748 	/* 1 means PFC WD for COS5 is on, 0 - off. */
11749 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS5	UINT32_C(0x20)
11750 	/* 1 means PFC WD for COS6 is on, 0 - off. */
11751 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS6	UINT32_C(0x40)
11752 	/* 1 means PFC WD for COS7 is on, 0 - off. */
11753 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS7	UINT32_C(0x80)
11754 	/* PORT ID */
11755 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK		UINT32_C(0xffff00)
11756 	#define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT		8
11757 } hwrm_async_event_cmpl_pfc_watchdog_cfg_change_t, *phwrm_async_event_cmpl_pfc_watchdog_cfg_change_t;
11758 
11759 /* hwrm_async_event_cmpl_echo_request (size:128b/16B) */
11760 
11761 typedef struct hwrm_async_event_cmpl_echo_request {
11762 	uint16_t	type;
11763 	/*
11764 	 * This field indicates the exact type of the completion.
11765 	 * By convention, the LSB identifies the length of the
11766 	 * record in 16B units. Even values indicate 16B
11767 	 * records. Odd values indicate 32B
11768 	 * records.
11769 	 */
11770 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_MASK		UINT32_C(0x3f)
11771 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_SFT		0
11772 	/* HWRM Asynchronous Event Information */
11773 		#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11774 		#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_HWRM_ASYNC_EVENT
11775 	/* Identifiers of events. */
11776 	uint16_t	event_id;
11777 	/*
11778 	 * An echo request from the firmware. An echo response is expected by
11779 	 * the firmware.
11780 	 */
11781 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_ECHO_REQUEST UINT32_C(0x42)
11782 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_ECHO_REQUEST
11783 	/* Event specific data that should be provided in the echo response */
11784 	uint32_t	event_data2;
11785 	uint8_t	opaque_v;
11786 	/*
11787 	 * This value is written by the NIC such that it will be different
11788 	 * for each pass through the completion queue. The even passes
11789 	 * will write 1. The odd passes will write 0.
11790 	 */
11791 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_V	UINT32_C(0x1)
11792 	/* opaque is 7 b */
11793 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_OPAQUE_MASK UINT32_C(0xfe)
11794 	#define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_OPAQUE_SFT 1
11795 	/* 8-lsb timestamp from POR (100-msec resolution) */
11796 	uint8_t	timestamp_lo;
11797 	/* 16-lsb timestamp from POR (100-msec resolution) */
11798 	uint16_t	timestamp_hi;
11799 	/* Event specific data that should be provided in the echo response */
11800 	uint32_t	event_data1;
11801 } hwrm_async_event_cmpl_echo_request_t, *phwrm_async_event_cmpl_echo_request_t;
11802 
11803 /* hwrm_async_event_cmpl_phc_update (size:128b/16B) */
11804 
11805 typedef struct hwrm_async_event_cmpl_phc_update {
11806 	uint16_t	type;
11807 	/*
11808 	 * This field indicates the exact type of the completion.
11809 	 * By convention, the LSB identifies the length of the
11810 	 * record in 16B units. Even values indicate 16B
11811 	 * records. Odd values indicate 32B
11812 	 * records.
11813 	 */
11814 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_MASK		UINT32_C(0x3f)
11815 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_SFT		0
11816 	/* HWRM Asynchronous Event Information */
11817 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11818 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_HWRM_ASYNC_EVENT
11819 	/* Identifiers of events. */
11820 	uint16_t	event_id;
11821 	/*
11822 	 * This async event is used to notify driver of changes
11823 	 * in PHC master. Only one master function can configure
11824 	 * PHC.
11825 	 */
11826 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_ID_PHC_UPDATE UINT32_C(0x43)
11827 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_ID_PHC_UPDATE
11828 	/* Event specific data */
11829 	uint32_t	event_data2;
11830 	/* This field provides the current master function. */
11831 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA2_PHC_MASTER_FID_MASK UINT32_C(0xffff)
11832 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA2_PHC_MASTER_FID_SFT 0
11833 	/* This field provides the current secondary function. */
11834 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA2_PHC_SEC_FID_MASK   UINT32_C(0xffff0000)
11835 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA2_PHC_SEC_FID_SFT	16
11836 	uint8_t	opaque_v;
11837 	/*
11838 	 * This value is written by the NIC such that it will be different
11839 	 * for each pass through the completion queue. The even passes
11840 	 * will write 1. The odd passes will write 0.
11841 	 */
11842 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_V	UINT32_C(0x1)
11843 	/* opaque is 7 b */
11844 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_OPAQUE_MASK UINT32_C(0xfe)
11845 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_OPAQUE_SFT 1
11846 	/* 8-lsb timestamp (100-msec resolution) */
11847 	uint8_t	timestamp_lo;
11848 	/* 16-lsb timestamp (100-msec resolution) */
11849 	uint16_t	timestamp_hi;
11850 	/* Event specific data */
11851 	uint32_t	event_data1;
11852 	/* Indicates to the driver the type of PHC event. */
11853 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_MASK	UINT32_C(0xf)
11854 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_SFT	0
11855 	/*
11856 	 * Indicates PHC Master selection event. The master fid is
11857 	 * specified in event_data2.phc_master_fid.
11858 	 */
11859 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_MASTER	UINT32_C(0x1)
11860 	/*
11861 	 * Indicates PHC Secondary selection event. The secondary fid is
11862 	 * specified in event_data2.phc_sec_fid.
11863 	 */
11864 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_SECONDARY   UINT32_C(0x2)
11865 	/*
11866 	 * Indicates PHC failover event. Failover happens from
11867 	 * event_data2.phc_master_fid to event_data2.phc_sec_fid.
11868 	 */
11869 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_FAILOVER	UINT32_C(0x3)
11870 	/*
11871 	 * Indicates that the 64bit Real time clock upper 16bits
11872 	 * have been updated due to PHC rollover. The updated
11873 	 * upper 16bits is in event_data1.phc_time_msb
11874 	 */
11875 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_RTC_UPDATE  UINT32_C(0x4)
11876 		#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_LAST	HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_RTC_UPDATE
11877 	/*
11878 	 * This field provides the upper 16bits of the 64bit real
11879 	 * time clock.
11880 	 */
11881 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_PHC_TIME_MSB_MASK   UINT32_C(0xffff0)
11882 	#define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_PHC_TIME_MSB_SFT	4
11883 } hwrm_async_event_cmpl_phc_update_t, *phwrm_async_event_cmpl_phc_update_t;
11884 
11885 /* hwrm_async_event_cmpl_pps_timestamp (size:128b/16B) */
11886 
11887 typedef struct hwrm_async_event_cmpl_pps_timestamp {
11888 	uint16_t	type;
11889 	/*
11890 	 * This field indicates the exact type of the completion.
11891 	 * By convention, the LSB identifies the length of the
11892 	 * record in 16B units. Even values indicate 16B
11893 	 * records. Odd values indicate 32B
11894 	 * records.
11895 	 */
11896 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_MASK		UINT32_C(0x3f)
11897 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_SFT		0
11898 	/* HWRM Asynchronous Event Information */
11899 		#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11900 		#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_HWRM_ASYNC_EVENT
11901 	/* Identifiers of events. */
11902 	uint16_t	event_id;
11903 	/*
11904 	 * This async notification message can be used to inform
11905 	 * driver of the latest PPS timestamp that has been latched.
11906 	 * When driver enables PPS event, Firmware will generate
11907 	 * PPS timestamps every second, Firmware informs driver
11908 	 * of this timestamp through the async event.
11909 	 */
11910 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_ID_PPS_TIMESTAMP UINT32_C(0x44)
11911 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_ID_PPS_TIMESTAMP
11912 	/* Event specific data */
11913 	uint32_t	event_data2;
11914 	/* Indicates the PPS event type */
11915 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE		UINT32_C(0x1)
11916 	/* This is an internal event. */
11917 		#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_INTERNAL	UINT32_C(0x0)
11918 	/* This is an external event. */
11919 		#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_EXTERNAL	UINT32_C(0x1)
11920 		#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_LAST	HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_EXTERNAL
11921 	/*
11922 	 * Indicates the pin number on which the event is
11923 	 * received.
11924 	 */
11925 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PIN_NUMBER_MASK	UINT32_C(0xe)
11926 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PIN_NUMBER_SFT	1
11927 	/*
11928 	 * Contains bits[47:32] of the upper PPS timestamp.
11929 	 * Lower 32 bits are in event_data1. Together they
11930 	 * provide the 48 bit PPS timestamp.
11931 	 */
11932 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PPS_TIMESTAMP_UPPER_MASK UINT32_C(0xffff0)
11933 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PPS_TIMESTAMP_UPPER_SFT 4
11934 	uint8_t	opaque_v;
11935 	/*
11936 	 * This value is written by the NIC such that it will be different
11937 	 * for each pass through the completion queue. The even passes
11938 	 * will write 1. The odd passes will write 0.
11939 	 */
11940 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_V	UINT32_C(0x1)
11941 	/* opaque is 7 b */
11942 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_OPAQUE_MASK UINT32_C(0xfe)
11943 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_OPAQUE_SFT 1
11944 	/* 8-lsb timestamp (100-msec resolution) */
11945 	uint8_t	timestamp_lo;
11946 	/* 16-lsb timestamp (100-msec resolution) */
11947 	uint16_t	timestamp_hi;
11948 	/* Contains the lower 32 bits of the PPS timestamp. */
11949 	uint32_t	event_data1;
11950 	/* Contains the lower 32 bit PPS timestamp */
11951 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA1_PPS_TIMESTAMP_LOWER_MASK UINT32_C(0xffffffff)
11952 	#define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA1_PPS_TIMESTAMP_LOWER_SFT 0
11953 } hwrm_async_event_cmpl_pps_timestamp_t, *phwrm_async_event_cmpl_pps_timestamp_t;
11954 
11955 /* hwrm_async_event_cmpl_error_report (size:128b/16B) */
11956 
11957 typedef struct hwrm_async_event_cmpl_error_report {
11958 	uint16_t	type;
11959 	/*
11960 	 * This field indicates the exact type of the completion.
11961 	 * By convention, the LSB identifies the length of the
11962 	 * record in 16B units. Even values indicate 16B
11963 	 * records. Odd values indicate 32B
11964 	 * records.
11965 	 */
11966 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_MASK		UINT32_C(0x3f)
11967 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_SFT		0
11968 	/* HWRM Asynchronous Event Information */
11969 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
11970 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_HWRM_ASYNC_EVENT
11971 	/* Identifiers of events. */
11972 	uint16_t	event_id;
11973 	/*
11974 	 * This async notification message is used to inform
11975 	 * the driver that an error has occurred which may need
11976 	 * the attention of the administrator.
11977 	 */
11978 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
11979 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_ID_ERROR_REPORT
11980 	/* Event specific data. */
11981 	uint32_t	event_data2;
11982 	uint8_t	opaque_v;
11983 	/*
11984 	 * This value is written by the NIC such that it will be different
11985 	 * for each pass through the completion queue. The even passes
11986 	 * will write 1. The odd passes will write 0.
11987 	 */
11988 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_V	UINT32_C(0x1)
11989 	/* opaque is 7 b */
11990 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_OPAQUE_MASK UINT32_C(0xfe)
11991 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_OPAQUE_SFT 1
11992 	/* 8-lsb timestamp (100-msec resolution) */
11993 	uint8_t	timestamp_lo;
11994 	/* 16-lsb timestamp (100-msec resolution) */
11995 	uint16_t	timestamp_hi;
11996 	/* Event specific data */
11997 	uint32_t	event_data1;
11998 	/*
11999 	 * Indicates the type of error being reported. See section on Error
12000 	 * Report event error_types for details on each error.
12001 	 */
12002 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_DATA1_ERROR_TYPE_MASK UINT32_C(0xff)
12003 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_DATA1_ERROR_TYPE_SFT 0
12004 } hwrm_async_event_cmpl_error_report_t, *phwrm_async_event_cmpl_error_report_t;
12005 
12006 /* hwrm_async_event_cmpl_doorbell_pacing_threshold (size:128b/16B) */
12007 
12008 typedef struct hwrm_async_event_cmpl_doorbell_pacing_threshold {
12009 	uint16_t	type;
12010 	/*
12011 	 * This field indicates the exact type of the completion.
12012 	 * By convention, the LSB identifies the length of the
12013 	 * record in 16B units. Even values indicate 16B
12014 	 * records. Odd values indicate 32B
12015 	 * records.
12016 	 */
12017 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_MASK		UINT32_C(0x3f)
12018 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_SFT		0
12019 	/* HWRM Asynchronous Event Information */
12020 		#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12021 		#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_HWRM_ASYNC_EVENT
12022 	/* Identifiers of events. */
12023 	uint16_t	event_id;
12024 	/*
12025 	 * This async notification message is used to inform the driver
12026 	 * that the programmable pacing threshold for the doorbell FIFO is
12027 	 * reached. The driver will take appropriate action to pace the
12028 	 * doorbells when this async event is received from the firmware.
12029 	 */
12030 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_EVENT_ID_DOORBELL_PACING_THRESHOLD UINT32_C(0x46)
12031 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_EVENT_ID_LAST			HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_EVENT_ID_DOORBELL_PACING_THRESHOLD
12032 	/* Event specific data. */
12033 	uint32_t	event_data2;
12034 	uint8_t	opaque_v;
12035 	/*
12036 	 * This value is written by the NIC such that it will be different
12037 	 * for each pass through the completion queue. The even passes
12038 	 * will write 1. The odd passes will write 0.
12039 	 */
12040 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_V	UINT32_C(0x1)
12041 	/* opaque is 7 b */
12042 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_OPAQUE_MASK UINT32_C(0xfe)
12043 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_OPAQUE_SFT 1
12044 	/* 8-lsb timestamp (100-msec resolution) */
12045 	uint8_t	timestamp_lo;
12046 	/* 16-lsb timestamp (100-msec resolution) */
12047 	uint16_t	timestamp_hi;
12048 	/* Event specific data */
12049 	uint32_t	event_data1;
12050 } hwrm_async_event_cmpl_doorbell_pacing_threshold_t, *phwrm_async_event_cmpl_doorbell_pacing_threshold_t;
12051 
12052 /* hwrm_async_event_cmpl_rss_change (size:128b/16B) */
12053 
12054 typedef struct hwrm_async_event_cmpl_rss_change {
12055 	uint16_t	type;
12056 	/*
12057 	 * This field indicates the exact type of the completion.
12058 	 * By convention, the LSB identifies the length of the
12059 	 * record in 16B units. Even values indicate 16B
12060 	 * records. Odd values indicate 32B
12061 	 * records.
12062 	 */
12063 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_TYPE_MASK		UINT32_C(0x3f)
12064 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_TYPE_SFT		0
12065 	/* HWRM Asynchronous Event Information */
12066 		#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12067 		#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_TYPE_HWRM_ASYNC_EVENT
12068 	/* Identifiers of events. */
12069 	uint16_t	event_id;
12070 	/*
12071 	 * This async notification message is used to inform the driver
12072 	 * that the RSS capabilities have changed. The driver will need
12073 	 * to query hwrm_vnic_qcaps.
12074 	 */
12075 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_EVENT_ID_RSS_CHANGE UINT32_C(0x47)
12076 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_EVENT_ID_RSS_CHANGE
12077 	/* Event specific data. */
12078 	uint32_t	event_data2;
12079 	uint8_t	opaque_v;
12080 	/*
12081 	 * This value is written by the NIC such that it will be different
12082 	 * for each pass through the completion queue. The even passes
12083 	 * will write 1. The odd passes will write 0.
12084 	 */
12085 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_V	UINT32_C(0x1)
12086 	/* opaque is 7 b */
12087 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
12088 	#define HWRM_ASYNC_EVENT_CMPL_RSS_CHANGE_OPAQUE_SFT 1
12089 	/* 8-lsb timestamp (100-msec resolution) */
12090 	uint8_t	timestamp_lo;
12091 	/* 16-lsb timestamp (100-msec resolution) */
12092 	uint16_t	timestamp_hi;
12093 	/* Event specific data */
12094 	uint32_t	event_data1;
12095 } hwrm_async_event_cmpl_rss_change_t, *phwrm_async_event_cmpl_rss_change_t;
12096 
12097 /* hwrm_async_event_cmpl_doorbell_pacing_nq_update (size:128b/16B) */
12098 
12099 typedef struct hwrm_async_event_cmpl_doorbell_pacing_nq_update {
12100 	uint16_t	type;
12101 	/*
12102 	 * This field indicates the exact type of the completion.
12103 	 * By convention, the LSB identifies the length of the
12104 	 * record in 16B units. Even values indicate 16B
12105 	 * records. Odd values indicate 32B
12106 	 * records.
12107 	 */
12108 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_TYPE_MASK		UINT32_C(0x3f)
12109 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_TYPE_SFT		0
12110 	/* HWRM Asynchronous Event Information */
12111 		#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12112 		#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_TYPE_HWRM_ASYNC_EVENT
12113 	/* Identifiers of events. */
12114 	uint16_t	event_id;
12115 	/*
12116 	 * An event from firmware indicating that list of nq ids used for
12117 	 * doorbell pacing DBQ event notification has been updated. The driver
12118 	 * needs to take appropriate action and retrieve the new list when this
12119 	 * event is received from the firmware.
12120 	 */
12121 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_EVENT_ID_DOORBELL_PACING_NQ_UPDATE UINT32_C(0x48)
12122 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_EVENT_ID_LAST			HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_EVENT_ID_DOORBELL_PACING_NQ_UPDATE
12123 	/* Event specific data. */
12124 	uint32_t	event_data2;
12125 	uint8_t	opaque_v;
12126 	/*
12127 	 * This value is written by the NIC such that it will be different
12128 	 * for each pass through the completion queue. The even passes
12129 	 * will write 1. The odd passes will write 0.
12130 	 */
12131 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_V	UINT32_C(0x1)
12132 	/* opaque is 7 b */
12133 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_OPAQUE_MASK UINT32_C(0xfe)
12134 	#define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_NQ_UPDATE_OPAQUE_SFT 1
12135 	/* 8-lsb timestamp (100-msec resolution) */
12136 	uint8_t	timestamp_lo;
12137 	/* 16-lsb timestamp (100-msec resolution) */
12138 	uint16_t	timestamp_hi;
12139 	/* Event specific data */
12140 	uint32_t	event_data1;
12141 } hwrm_async_event_cmpl_doorbell_pacing_nq_update_t, *phwrm_async_event_cmpl_doorbell_pacing_nq_update_t;
12142 
12143 /* hwrm_async_event_cmpl_hw_doorbell_recovery_read_error (size:128b/16B) */
12144 
12145 typedef struct hwrm_async_event_cmpl_hw_doorbell_recovery_read_error {
12146 	uint16_t	type;
12147 	/*
12148 	 * This field indicates the exact type of the completion.
12149 	 * By convention, the LSB identifies the length of the
12150 	 * record in 16B units. Even values indicate 16B
12151 	 * records. Odd values indicate 32B
12152 	 * records.
12153 	 */
12154 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_TYPE_MASK		UINT32_C(0x3f)
12155 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_TYPE_SFT		0
12156 	/* HWRM Asynchronous Event Information */
12157 		#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12158 		#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_TYPE_HWRM_ASYNC_EVENT
12159 	/* Identifiers of events. */
12160 	uint16_t	event_id;
12161 	/*
12162 	 * This async notification message is used to inform the driver
12163 	 * that hardware ran into an error while trying to read the host
12164 	 * based doorbell copy region. The driver will take the appropriate
12165 	 * action to maintain the corresponding functions doorbell copy
12166 	 * region in the correct format.
12167 	 */
12168 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_ID_HW_DOORBELL_RECOVERY_READ_ERROR UINT32_C(0x49)
12169 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_ID_LAST			HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_ID_HW_DOORBELL_RECOVERY_READ_ERROR
12170 	/* Event specific data. */
12171 	uint32_t	event_data2;
12172 	uint8_t	opaque_v;
12173 	/*
12174 	 * This value is written by the NIC such that it will be different
12175 	 * for each pass through the completion queue. The even passes
12176 	 * will write 1. The odd passes will write 0.
12177 	 */
12178 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_V	UINT32_C(0x1)
12179 	/* opaque is 7 b */
12180 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_OPAQUE_MASK UINT32_C(0xfe)
12181 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_OPAQUE_SFT 1
12182 	/* 8-lsb timestamp (100-msec resolution) */
12183 	uint8_t	timestamp_lo;
12184 	/* 16-lsb timestamp (100-msec resolution) */
12185 	uint16_t	timestamp_hi;
12186 	/* Event specific data */
12187 	uint32_t	event_data1;
12188 	/*
12189 	 * Indicates that there is an error while reading the doorbell copy
12190 	 * regions.
12191 	 */
12192 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_DATA1_READ_ERROR_FLAGS_MASK	UINT32_C(0xf)
12193 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_DATA1_READ_ERROR_FLAGS_SFT	0
12194 	/*
12195 	 * If set to 1, indicates that there is an error while reading the
12196 	 * SQ doorbell copy region for this function.
12197 	 */
12198 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_DATA1_READ_ERROR_FLAGS_SQ_ERR	UINT32_C(0x1)
12199 	/*
12200 	 * If set to 1, indicates that there is an error while reading the
12201 	 * RQ doorbell copy region for this function.
12202 	 */
12203 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_DATA1_READ_ERROR_FLAGS_RQ_ERR	UINT32_C(0x2)
12204 	/*
12205 	 * If set to 1, indicates that there is an error while reading the
12206 	 * SRQ doorbell copy region for this function.
12207 	 */
12208 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_DATA1_READ_ERROR_FLAGS_SRQ_ERR	UINT32_C(0x4)
12209 	/*
12210 	 * If set to 1, indicates that there is an error while reading the
12211 	 * CQ doorbell copy region for this function.
12212 	 */
12213 	#define HWRM_ASYNC_EVENT_CMPL_HW_DOORBELL_RECOVERY_READ_ERROR_EVENT_DATA1_READ_ERROR_FLAGS_CQ_ERR	UINT32_C(0x8)
12214 } hwrm_async_event_cmpl_hw_doorbell_recovery_read_error_t, *phwrm_async_event_cmpl_hw_doorbell_recovery_read_error_t;
12215 
12216 /* hwrm_async_event_cmpl_ctx_error (size:128b/16B) */
12217 
12218 typedef struct hwrm_async_event_cmpl_ctx_error {
12219 	uint16_t	type;
12220 	/*
12221 	 * This field indicates the exact type of the completion.
12222 	 * By convention, the LSB identifies the length of the
12223 	 * record in 16B units. Even values indicate 16B
12224 	 * records. Odd values indicate 32B
12225 	 * records.
12226 	 */
12227 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_TYPE_MASK		UINT32_C(0x3f)
12228 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_TYPE_SFT		0
12229 	/* HWRM Asynchronous Event Information */
12230 		#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12231 		#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_TYPE_HWRM_ASYNC_EVENT
12232 	/* Identifiers of events. */
12233 	uint16_t	event_id;
12234 	/*
12235 	 * This async notification message is used to inform the PF driver
12236 	 * that firmware fails to allocate/free the contexts requested. This
12237 	 * message is only valid in the XID partition scheme. Given the start
12238 	 * xid and the number of contexts in error, the PF driver will figure
12239 	 * out the corresponding XID partition(s) in error.
12240 	 */
12241 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_ID_CTX_ERROR UINT32_C(0x4a)
12242 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_ID_CTX_ERROR
12243 	/* Event specific data */
12244 	uint32_t	event_data2;
12245 	/* Context operation code */
12246 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_DATA2_CTX_OP_CODE	UINT32_C(0x1)
12247 	/* Context alloc failure */
12248 		#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_DATA2_CTX_OP_CODE_ALLOC  UINT32_C(0x0)
12249 	/* Context free failure */
12250 		#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_DATA2_CTX_OP_CODE_FREE   UINT32_C(0x1)
12251 		#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_DATA2_CTX_OP_CODE_LAST  HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_DATA2_CTX_OP_CODE_FREE
12252 	/* Number of contexts in error */
12253 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_DATA2_NUM_CTXS_MASK	UINT32_C(0xfffe)
12254 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_DATA2_NUM_CTXS_SFT	1
12255 	/* Function ID which the XID partitions are associated with */
12256 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_DATA2_FID_MASK	UINT32_C(0xffff0000)
12257 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_DATA2_FID_SFT	16
12258 	uint8_t	opaque_v;
12259 	/*
12260 	 * This value is written by the NIC such that it will be different
12261 	 * for each pass through the completion queue. The even passes
12262 	 * will write 1. The odd passes will write 0.
12263 	 */
12264 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_V	UINT32_C(0x1)
12265 	/* opaque is 7 b */
12266 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_OPAQUE_MASK UINT32_C(0xfe)
12267 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_OPAQUE_SFT 1
12268 	/* 8-lsb timestamp (100-msec resolution) */
12269 	uint8_t	timestamp_lo;
12270 	/* 16-lsb timestamp (100-msec resolution) */
12271 	uint16_t	timestamp_hi;
12272 	/* Event specific data */
12273 	uint32_t	event_data1;
12274 	/* Starting XID that has error */
12275 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_DATA1_START_XID_MASK UINT32_C(0xffffffff)
12276 	#define HWRM_ASYNC_EVENT_CMPL_CTX_ERROR_EVENT_DATA1_START_XID_SFT 0
12277 } hwrm_async_event_cmpl_ctx_error_t, *phwrm_async_event_cmpl_ctx_error_t;
12278 
12279 /* hwrm_async_event_udcc_session_change (size:128b/16B) */
12280 
12281 typedef struct hwrm_async_event_udcc_session_change {
12282 	uint16_t	type;
12283 	/*
12284 	 * This field indicates the exact type of the completion.
12285 	 * By convention, the LSB identifies the length of the
12286 	 * record in 16B units. Even values indicate 16B
12287 	 * records. Odd values indicate 32B
12288 	 * records.
12289 	 */
12290 	#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_TYPE_MASK		UINT32_C(0x3f)
12291 	#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_TYPE_SFT		0
12292 	/* HWRM Asynchronous Event Information */
12293 		#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12294 		#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_TYPE_HWRM_ASYNC_EVENT
12295 	/* Identifiers of events. */
12296 	uint16_t	event_id;
12297 	/*
12298 	 * This async notification message is used to inform the PF driver
12299 	 * that firmware has modified a UDCC session.
12300 	 */
12301 	#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_EVENT_ID_UDCC_SESSION_CHANGE UINT32_C(0x4b)
12302 	#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_EVENT_ID_UDCC_SESSION_CHANGE
12303 	/* Event specific data */
12304 	uint32_t	event_data2;
12305 	/* UDCC Session id operation code */
12306 	#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_EVENT_DATA2_SESSION_ID_OP_CODE_MASK   UINT32_C(0xff)
12307 	#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_EVENT_DATA2_SESSION_ID_OP_CODE_SFT	0
12308 	/* session_id has been created */
12309 		#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_EVENT_DATA2_SESSION_ID_OP_CODE_CREATED  UINT32_C(0x0)
12310 	/* session_id has been freed */
12311 		#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_EVENT_DATA2_SESSION_ID_OP_CODE_FREED	UINT32_C(0x1)
12312 		#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_EVENT_DATA2_SESSION_ID_OP_CODE_LAST	HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_EVENT_DATA2_SESSION_ID_OP_CODE_FREED
12313 	uint8_t	opaque_v;
12314 	/*
12315 	 * This value is written by the NIC such that it will be different
12316 	 * for each pass through the completion queue. The even passes
12317 	 * will write 1. The odd passes will write 0.
12318 	 */
12319 	#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_V	UINT32_C(0x1)
12320 	/* opaque is 7 b */
12321 	#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
12322 	#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_OPAQUE_SFT 1
12323 	/* 8-lsb timestamp (100-msec resolution) */
12324 	uint8_t	timestamp_lo;
12325 	/* 16-lsb timestamp (100-msec resolution) */
12326 	uint16_t	timestamp_hi;
12327 	/* Event specific data */
12328 	uint32_t	event_data1;
12329 	/* UDCC session id which was modified */
12330 	#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_EVENT_DATA1_UDCC_SESSION_ID_MASK UINT32_C(0xffff)
12331 	#define HWRM_ASYNC_EVENT_UDCC_SESSION_CHANGE_EVENT_DATA1_UDCC_SESSION_ID_SFT 0
12332 } hwrm_async_event_udcc_session_change_t, *phwrm_async_event_udcc_session_change_t;
12333 
12334 /* hwrm_async_event_representor_pair_change (size:128b/16B) */
12335 
12336 typedef struct hwrm_async_event_representor_pair_change {
12337 	uint16_t	type;
12338 	/*
12339 	 * This field indicates the exact type of the completion.
12340 	 * By convention, the LSB identifies the length of the
12341 	 * record in 16B units. Even values indicate 16B
12342 	 * records. Odd values indicate 32B
12343 	 * records.
12344 	 */
12345 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_TYPE_MASK		UINT32_C(0x3f)
12346 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_TYPE_SFT		0
12347 	/* HWRM Asynchronous Event Information */
12348 		#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12349 		#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_TYPE_HWRM_ASYNC_EVENT
12350 	/* Identifiers of events. */
12351 	uint16_t	event_id;
12352 	/*
12353 	 * This async notification message is used to inform the driver
12354 	 * that firmware has modified a representor pair.
12355 	 */
12356 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_ID_REPRESENTOR_PAIR_CHANGE UINT32_C(0x4e)
12357 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_ID_REPRESENTOR_PAIR_CHANGE
12358 	/* Event specific data */
12359 	uint32_t	event_data2;
12360 	/* Representor pair operation code */
12361 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA2_PAIR_OP_CODE_MASK   UINT32_C(0xff)
12362 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA2_PAIR_OP_CODE_SFT	0
12363 	/* pair has been created */
12364 		#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA2_PAIR_OP_CODE_CREATED  UINT32_C(0x0)
12365 	/* pair has been deleted */
12366 		#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA2_PAIR_OP_CODE_DELETED  UINT32_C(0x1)
12367 		#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA2_PAIR_OP_CODE_LAST	HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA2_PAIR_OP_CODE_DELETED
12368 	/* DSCP insert operation code */
12369 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA2_DSCP_OP_CODE_MASK   UINT32_C(0xff00)
12370 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA2_DSCP_OP_CODE_SFT	8
12371 	/* allow dscp modification */
12372 		#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA2_DSCP_OP_CODE_MODIFY   (UINT32_C(0x0) << 8)
12373 	/* skip dscp modification */
12374 		#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA2_DSCP_OP_CODE_IGNORE   (UINT32_C(0x1) << 8)
12375 		#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA2_DSCP_OP_CODE_LAST	HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA2_DSCP_OP_CODE_IGNORE
12376 	uint8_t	opaque_v;
12377 	/*
12378 	 * This value is written by the NIC such that it will be different
12379 	 * for each pass through the completion queue. The even passes
12380 	 * will write 1. The odd passes will write 0.
12381 	 */
12382 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_V	UINT32_C(0x1)
12383 	/* opaque is 7 b */
12384 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
12385 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_OPAQUE_SFT 1
12386 	/* 8-lsb timestamp (100-msec resolution) */
12387 	uint8_t	timestamp_lo;
12388 	/* 16-lsb timestamp (100-msec resolution) */
12389 	uint16_t	timestamp_hi;
12390 	/* Event specific data */
12391 	uint32_t	event_data1;
12392 	/* Representor endpoint fid which was modified */
12393 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA1_PAIR_EP_FID_MASK UINT32_C(0xffff)
12394 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA1_PAIR_EP_FID_SFT  0
12395 	/* Representor uplink fid which was modified */
12396 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA1_PAIR_REP_FID_MASK UINT32_C(0xffff0000)
12397 	#define HWRM_ASYNC_EVENT_REPRESENTOR_PAIR_CHANGE_EVENT_DATA1_PAIR_REP_FID_SFT 16
12398 } hwrm_async_event_representor_pair_change_t, *phwrm_async_event_representor_pair_change_t;
12399 
12400 /* hwrm_async_event_cmpl_dbg_buf_producer (size:128b/16B) */
12401 
12402 typedef struct hwrm_async_event_cmpl_dbg_buf_producer {
12403 	uint16_t	type;
12404 	/*
12405 	 * This field indicates the exact type of the completion.
12406 	 * By convention, the LSB identifies the length of the
12407 	 * record in 16B units. Even values indicate 16B
12408 	 * records. Odd values indicate 32B
12409 	 * records.
12410 	 */
12411 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_TYPE_MASK		UINT32_C(0x3f)
12412 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_TYPE_SFT		0
12413 	/* HWRM Asynchronous Event Information */
12414 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12415 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_TYPE_HWRM_ASYNC_EVENT
12416 	/* Identifiers of events. */
12417 	uint16_t	event_id;
12418 	/*
12419 	 * Used to notify the host that the firmware has DMA-ed additional
12420 	 * debug data to the host buffer. This is effectively a producer index
12421 	 * update. The host driver can utilize this information to determine
12422 	 * how much of its host buffer has been populated by the firmware.
12423 	 */
12424 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_ID_DBG_BUF_PRODUCER UINT32_C(0x4c)
12425 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_ID_DBG_BUF_PRODUCER
12426 	/* Event specific data */
12427 	uint32_t	event_data2;
12428 	/*
12429 	 * Specifies the current host buffer offset. Data up to this offset
12430 	 * has been populated by the firmware. For example, if the firmware
12431 	 * has DMA-ed 8192 bytes to the host buffer, then this field has a
12432 	 * value of 8192. This field rolls over to zero once the firmware
12433 	 * writes the last page of the host buffer
12434 	 */
12435 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA2_CURRENT_BUFFER_OFFSET_MASK UINT32_C(0xffffffff)
12436 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA2_CURRENT_BUFFER_OFFSET_SFT 0
12437 	uint8_t	opaque_v;
12438 	/*
12439 	 * This value is written by the NIC such that it will be different
12440 	 * for each pass through the completion queue. The even passes
12441 	 * will write 1. The odd passes will write 0.
12442 	 */
12443 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_V	UINT32_C(0x1)
12444 	/* opaque is 7 b */
12445 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_OPAQUE_MASK UINT32_C(0xfe)
12446 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_OPAQUE_SFT 1
12447 	/* 8-lsb timestamp from POR (100-msec resolution) */
12448 	uint8_t	timestamp_lo;
12449 	/* 16-lsb timestamp from POR (100-msec resolution) */
12450 	uint16_t	timestamp_hi;
12451 	/* Event specific data */
12452 	uint32_t	event_data1;
12453 	/* Type of trace buffer that has been updated. */
12454 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_MASK	UINT32_C(0xffff)
12455 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_SFT		0
12456 	/* SRT trace. */
12457 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_SRT_TRACE	UINT32_C(0x0)
12458 	/* SRT2 trace. */
12459 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_SRT2_TRACE	UINT32_C(0x1)
12460 	/* CRT trace. */
12461 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CRT_TRACE	UINT32_C(0x2)
12462 	/* CRT2 trace. */
12463 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CRT2_TRACE	UINT32_C(0x3)
12464 	/* RIGP0 trace. */
12465 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_RIGP0_TRACE	UINT32_C(0x4)
12466 	/* L2 HWRM trace. */
12467 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_L2_HWRM_TRACE	UINT32_C(0x5)
12468 	/* RoCE HWRM trace. */
12469 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_ROCE_HWRM_TRACE  UINT32_C(0x6)
12470 	/* Context Accelerator CPU 0 trace. */
12471 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CA0_TRACE	UINT32_C(0x7)
12472 	/* Context Accelerator CPU 1 trace. */
12473 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CA1_TRACE	UINT32_C(0x8)
12474 	/* Context Accelerator CPU 2 trace. */
12475 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CA2_TRACE	UINT32_C(0x9)
12476 	/* RIGP1 trace. */
12477 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_RIGP1_TRACE	UINT32_C(0xa)
12478 		#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_RIGP1_TRACE
12479 } hwrm_async_event_cmpl_dbg_buf_producer_t, *phwrm_async_event_cmpl_dbg_buf_producer_t;
12480 
12481 /* hwrm_async_event_cmpl_peer_mmap_change (size:128b/16B) */
12482 
12483 typedef struct hwrm_async_event_cmpl_peer_mmap_change {
12484 	uint16_t	type;
12485 	/*
12486 	 * This field indicates the exact type of the completion.
12487 	 * By convention, the LSB identifies the length of the
12488 	 * record in 16B units. Even values indicate 16B
12489 	 * records. Odd values indicate 32B
12490 	 * records.
12491 	 */
12492 	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_TYPE_MASK		UINT32_C(0x3f)
12493 	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_TYPE_SFT		0
12494 	/* HWRM Asynchronous Event Information */
12495 		#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12496 		#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_TYPE_HWRM_ASYNC_EVENT
12497 	/* Identifiers of events. */
12498 	uint16_t	event_id;
12499 	/*
12500 	 * This async notification message is used to inform the driver
12501 	 * that the memory mapping for a peer device is set. The driver
12502 	 * will need to query using get_structured_data.
12503 	 */
12504 	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_EVENT_ID_PEER_MMAP_CHANGE UINT32_C(0x4d)
12505 	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_EVENT_ID_LAST		HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_EVENT_ID_PEER_MMAP_CHANGE
12506 	/* Event specific data. */
12507 	uint32_t	event_data2;
12508 	uint8_t	opaque_v;
12509 	/*
12510 	 * This value is written by the NIC such that it will be different
12511 	 * for each pass through the completion queue. The even passes
12512 	 * will write 1. The odd passes will write 0.
12513 	 */
12514 	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_V	UINT32_C(0x1)
12515 	/* opaque is 7 b */
12516 	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
12517 	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_OPAQUE_SFT 1
12518 	/* 8-lsb timestamp (100-msec resolution) */
12519 	uint8_t	timestamp_lo;
12520 	/* 16-lsb timestamp (100-msec resolution) */
12521 	uint16_t	timestamp_hi;
12522 	/* Event specific data */
12523 	uint32_t	event_data1;
12524 } hwrm_async_event_cmpl_peer_mmap_change_t, *phwrm_async_event_cmpl_peer_mmap_change_t;
12525 
12526 /* hwrm_async_event_cmpl_fw_trace_msg (size:128b/16B) */
12527 
12528 typedef struct hwrm_async_event_cmpl_fw_trace_msg {
12529 	uint16_t	type;
12530 	/*
12531 	 * This field indicates the exact type of the completion.
12532 	 * By convention, the LSB identifies the length of the
12533 	 * record in 16B units. Even values indicate 16B
12534 	 * records. Odd values indicate 32B
12535 	 * records.
12536 	 */
12537 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_MASK		UINT32_C(0x3f)
12538 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_SFT		0
12539 	/* HWRM Asynchronous Event Information */
12540 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12541 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT
12542 	/* Identifiers of events. */
12543 	uint16_t	event_id;
12544 	/* Firmware trace log message */
12545 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG UINT32_C(0xfe)
12546 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG
12547 	/* Trace byte 0 to 3 */
12548 	uint32_t	event_data2;
12549 	/* Trace byte0 */
12550 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_MASK UINT32_C(0xff)
12551 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_SFT 0
12552 	/* Trace byte1 */
12553 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_MASK UINT32_C(0xff00)
12554 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_SFT 8
12555 	/* Trace byte2 */
12556 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_MASK UINT32_C(0xff0000)
12557 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_SFT 16
12558 	/* Trace byte3 */
12559 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_MASK UINT32_C(0xff000000)
12560 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_SFT 24
12561 	uint8_t	opaque_v;
12562 	/*
12563 	 * This value is written by the NIC such that it will be different
12564 	 * for each pass through the completion queue. The even passes
12565 	 * will write 1. The odd passes will write 0.
12566 	 */
12567 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_V	UINT32_C(0x1)
12568 	/* opaque is 7 b */
12569 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_MASK UINT32_C(0xfe)
12570 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_SFT 1
12571 	/* Trace flags */
12572 	uint8_t	timestamp_lo;
12573 	/* Indicates if the string is partial or complete. */
12574 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING		UINT32_C(0x1)
12575 	/* Complete string */
12576 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_COMPLETE	UINT32_C(0x0)
12577 	/* Partial string */
12578 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL	UINT32_C(0x1)
12579 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_LAST	HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL
12580 	/* Indicates the firmware that sent the trace message. */
12581 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE	UINT32_C(0x2)
12582 	/* Primary firmware */
12583 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_PRIMARY	(UINT32_C(0x0) << 1)
12584 	/* Secondary firmware */
12585 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY  (UINT32_C(0x1) << 1)
12586 		#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_LAST	HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY
12587 	/* Trace byte 4 to 5 */
12588 	uint16_t	timestamp_hi;
12589 	/* Trace byte4 */
12590 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_MASK UINT32_C(0xff)
12591 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_SFT 0
12592 	/* Trace byte5 */
12593 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_MASK UINT32_C(0xff00)
12594 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_SFT 8
12595 	/* Trace byte 6 to 9 */
12596 	uint32_t	event_data1;
12597 	/* Trace byte6 */
12598 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_MASK UINT32_C(0xff)
12599 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_SFT 0
12600 	/* Trace byte7 */
12601 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_MASK UINT32_C(0xff00)
12602 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_SFT 8
12603 	/* Trace byte8 */
12604 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_MASK UINT32_C(0xff0000)
12605 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_SFT 16
12606 	/* Trace byte9 */
12607 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_MASK UINT32_C(0xff000000)
12608 	#define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_SFT 24
12609 } hwrm_async_event_cmpl_fw_trace_msg_t, *phwrm_async_event_cmpl_fw_trace_msg_t;
12610 
12611 /* hwrm_async_event_cmpl_hwrm_error (size:128b/16B) */
12612 
12613 typedef struct hwrm_async_event_cmpl_hwrm_error {
12614 	uint16_t	type;
12615 	/*
12616 	 * This field indicates the exact type of the completion.
12617 	 * By convention, the LSB identifies the length of the
12618 	 * record in 16B units. Even values indicate 16B
12619 	 * records. Odd values indicate 32B
12620 	 * records.
12621 	 */
12622 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_MASK		UINT32_C(0x3f)
12623 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_SFT		0
12624 	/* HWRM Asynchronous Event Information */
12625 		#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12626 		#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT
12627 	/* Identifiers of events. */
12628 	uint16_t	event_id;
12629 	/* HWRM Error */
12630 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR UINT32_C(0xff)
12631 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR
12632 	/* Event specific data */
12633 	uint32_t	event_data2;
12634 	/* Severity of HWRM Error */
12635 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_MASK	UINT32_C(0xff)
12636 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_SFT	0
12637 	/* Warning */
12638 		#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_WARNING   UINT32_C(0x0)
12639 	/* Non-fatal Error */
12640 		#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_NONFATAL  UINT32_C(0x1)
12641 	/* Fatal Error */
12642 		#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL	UINT32_C(0x2)
12643 		#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_LAST	HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL
12644 	uint8_t	opaque_v;
12645 	/*
12646 	 * This value is written by the NIC such that it will be different
12647 	 * for each pass through the completion queue. The even passes
12648 	 * will write 1. The odd passes will write 0.
12649 	 */
12650 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_V	UINT32_C(0x1)
12651 	/* opaque is 7 b */
12652 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_MASK UINT32_C(0xfe)
12653 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_SFT 1
12654 	/* 8-lsb timestamp from POR (100-msec resolution) */
12655 	uint8_t	timestamp_lo;
12656 	/* 16-lsb timestamp from POR (100-msec resolution) */
12657 	uint16_t	timestamp_hi;
12658 	/* Event specific data */
12659 	uint32_t	event_data1;
12660 	/* Time stamp for error event */
12661 	#define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP	UINT32_C(0x1)
12662 } hwrm_async_event_cmpl_hwrm_error_t, *phwrm_async_event_cmpl_hwrm_error_t;
12663 
12664 /* hwrm_async_event_cmpl_error_report_base (size:128b/16B) */
12665 
12666 typedef struct hwrm_async_event_cmpl_error_report_base {
12667 	uint16_t	type;
12668 	/*
12669 	 * This field indicates the exact type of the completion.
12670 	 * By convention, the LSB identifies the length of the
12671 	 * record in 16B units. Even values indicate 16B
12672 	 * records. Odd values indicate 32B
12673 	 * records.
12674 	 */
12675 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_MASK		UINT32_C(0x3f)
12676 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_SFT		0
12677 	/* HWRM Asynchronous Event Information */
12678 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12679 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_HWRM_ASYNC_EVENT
12680 	/* Identifiers of events. */
12681 	uint16_t	event_id;
12682 	/*
12683 	 * This async notification message is used to inform
12684 	 * the driver that an error has occurred which may need
12685 	 * the attention of the administrator.
12686 	 */
12687 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
12688 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_ID_ERROR_REPORT
12689 	/* Event specific data. */
12690 	uint32_t	event_data2;
12691 	uint8_t	opaque_v;
12692 	/*
12693 	 * This value is written by the NIC such that it will be different
12694 	 * for each pass through the completion queue. The even passes
12695 	 * will write 1. The odd passes will write 0.
12696 	 */
12697 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_V	UINT32_C(0x1)
12698 	/* opaque is 7 b */
12699 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_OPAQUE_MASK UINT32_C(0xfe)
12700 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_OPAQUE_SFT 1
12701 	/* 8-lsb timestamp (100-msec resolution) */
12702 	uint8_t	timestamp_lo;
12703 	/* 16-lsb timestamp (100-msec resolution) */
12704 	uint16_t	timestamp_hi;
12705 	/* Event specific data */
12706 	uint32_t	event_data1;
12707 	/* Indicates the type of error being reported. */
12708 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_MASK			UINT32_C(0xff)
12709 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_SFT			0
12710 	/* Reserved */
12711 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_RESERVED			UINT32_C(0x0)
12712 	/*
12713 	 * The NIC was subjected to an extended pause storm which caused it
12714 	 * to disable flow control in order to avoid stalling the Tx path.
12715 	 */
12716 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_PAUSE_STORM		UINT32_C(0x1)
12717 	/*
12718 	 * The NIC received an interrupt storm on a TSIO pin being used as
12719 	 * PPS_IN which caused it to disable the interrupt. The signal
12720 	 * should be fixed to be a proper 1 PPS signal before re-enabling
12721 	 * it. The pin number on which this signal was received is stored
12722 	 * in event_data2 as pin_id.
12723 	 */
12724 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_INVALID_SIGNAL		UINT32_C(0x2)
12725 	/*
12726 	 * There was a low level error with an NVM write or erase.
12727 	 * See nvm_err_type for more details.
12728 	 */
12729 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_NVM			UINT32_C(0x3)
12730 	/*
12731 	 * This indicates doorbell drop threshold was hit. When this
12732 	 * threshold is crossed, it indicates one or more doorbells for
12733 	 * the function were dropped by hardware.
12734 	 */
12735 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD	UINT32_C(0x4)
12736 	/*
12737 	 * Indicates the NIC's temperature has crossed one of the thermal
12738 	 * thresholds.
12739 	 */
12740 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD		UINT32_C(0x5)
12741 	/*
12742 	 * Speed change not supported with dual rate transceivers
12743 	 * on this board.
12744 	 */
12745 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED  UINT32_C(0x6)
12746 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_LAST			HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED
12747 } hwrm_async_event_cmpl_error_report_base_t, *phwrm_async_event_cmpl_error_report_base_t;
12748 
12749 #define GET_ERROR_REPORT_TYPE(x) \
12750 	(((x) < 0x80) ? \
12751 	((x) == 0x0 ? "RESERVED": \
12752 	((x) == 0x1 ? "PAUSE_STORM": \
12753 	((x) == 0x2 ? "INVALID_SIGNAL": \
12754 	((x) == 0x3 ? "NVM": \
12755 	((x) == 0x4 ? "DOORBELL_DROP_THRESHOLD": \
12756 	((x) == 0x5 ? "THERMAL_THRESHOLD": \
12757 	((x) == 0x6 ? "DUAL_DATA_RATE_NOT_SUPPORTED": \
12758 	"Unknown decode" ))))))) : \
12759 	"Unknown decode" )
12760 
12761 
12762 /* hwrm_async_event_cmpl_error_report_pause_storm (size:128b/16B) */
12763 
12764 typedef struct hwrm_async_event_cmpl_error_report_pause_storm {
12765 	uint16_t	type;
12766 	/*
12767 	 * This field indicates the exact type of the completion.
12768 	 * By convention, the LSB identifies the length of the
12769 	 * record in 16B units. Even values indicate 16B
12770 	 * records. Odd values indicate 32B
12771 	 * records.
12772 	 */
12773 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_MASK		UINT32_C(0x3f)
12774 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_SFT		0
12775 	/* HWRM Asynchronous Event Information */
12776 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12777 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_HWRM_ASYNC_EVENT
12778 	/* Identifiers of events. */
12779 	uint16_t	event_id;
12780 	/*
12781 	 * This async notification message is used to inform
12782 	 * the driver that an error has occurred which may need
12783 	 * the attention of the administrator.
12784 	 */
12785 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
12786 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_ID_ERROR_REPORT
12787 	/* Event specific data. */
12788 	uint32_t	event_data2;
12789 	uint8_t	opaque_v;
12790 	/*
12791 	 * This value is written by the NIC such that it will be different
12792 	 * for each pass through the completion queue. The even passes
12793 	 * will write 1. The odd passes will write 0.
12794 	 */
12795 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_V	UINT32_C(0x1)
12796 	/* opaque is 7 b */
12797 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_OPAQUE_MASK UINT32_C(0xfe)
12798 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_OPAQUE_SFT 1
12799 	/* 8-lsb timestamp (100-msec resolution) */
12800 	uint8_t	timestamp_lo;
12801 	/* 16-lsb timestamp (100-msec resolution) */
12802 	uint16_t	timestamp_hi;
12803 	/* Event specific data */
12804 	uint32_t	event_data1;
12805 	/* Indicates the type of error being reported. */
12806 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_MASK	UINT32_C(0xff)
12807 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_SFT	0
12808 	/*
12809 	 * The NIC was subjected to an extended pause storm which caused it
12810 	 * to disable flow control in order to avoid stalling the Tx path.
12811 	 */
12812 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_PAUSE_STORM  UINT32_C(0x1)
12813 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_PAUSE_STORM
12814 } hwrm_async_event_cmpl_error_report_pause_storm_t, *phwrm_async_event_cmpl_error_report_pause_storm_t;
12815 
12816 /* hwrm_async_event_cmpl_error_report_invalid_signal (size:128b/16B) */
12817 
12818 typedef struct hwrm_async_event_cmpl_error_report_invalid_signal {
12819 	uint16_t	type;
12820 	/*
12821 	 * This field indicates the exact type of the completion.
12822 	 * By convention, the LSB identifies the length of the
12823 	 * record in 16B units. Even values indicate 16B
12824 	 * records. Odd values indicate 32B
12825 	 * records.
12826 	 */
12827 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_MASK		UINT32_C(0x3f)
12828 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_SFT		0
12829 	/* HWRM Asynchronous Event Information */
12830 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12831 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_HWRM_ASYNC_EVENT
12832 	/* Identifiers of events. */
12833 	uint16_t	event_id;
12834 	/*
12835 	 * This async notification message is used to inform
12836 	 * the driver that an error has occurred which may need
12837 	 * the attention of the administrator.
12838 	 */
12839 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
12840 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_ID_ERROR_REPORT
12841 	/* Event specific data. */
12842 	uint32_t	event_data2;
12843 	/* Indicates the TSIO pin on which invalid signal is detected. */
12844 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA2_PIN_ID_MASK UINT32_C(0xff)
12845 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA2_PIN_ID_SFT 0
12846 	uint8_t	opaque_v;
12847 	/*
12848 	 * This value is written by the NIC such that it will be different
12849 	 * for each pass through the completion queue. The even passes
12850 	 * will write 1. The odd passes will write 0.
12851 	 */
12852 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_V	UINT32_C(0x1)
12853 	/* opaque is 7 b */
12854 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_OPAQUE_MASK UINT32_C(0xfe)
12855 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_OPAQUE_SFT 1
12856 	/* 8-lsb timestamp (100-msec resolution) */
12857 	uint8_t	timestamp_lo;
12858 	/* 16-lsb timestamp (100-msec resolution) */
12859 	uint16_t	timestamp_hi;
12860 	/* Event specific data */
12861 	uint32_t	event_data1;
12862 	/* Indicates the type of error being reported. */
12863 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_MASK	UINT32_C(0xff)
12864 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_SFT	0
12865 	/*
12866 	 * The NIC received an interrupt storm on a TSIO pin being used as
12867 	 * PPS_IN which caused it to disable the interrupt. The signal
12868 	 * should be fixed to be a proper 1 PPS signal before re-enabling
12869 	 * it. The pin number on which this signal was received is stored
12870 	 * in event_data2 as pin_id.
12871 	 */
12872 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_INVALID_SIGNAL  UINT32_C(0x2)
12873 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_INVALID_SIGNAL
12874 } hwrm_async_event_cmpl_error_report_invalid_signal_t, *phwrm_async_event_cmpl_error_report_invalid_signal_t;
12875 
12876 /* hwrm_async_event_cmpl_error_report_nvm (size:128b/16B) */
12877 
12878 typedef struct hwrm_async_event_cmpl_error_report_nvm {
12879 	uint16_t	type;
12880 	/*
12881 	 * This field indicates the exact type of the completion.
12882 	 * By convention, the LSB identifies the length of the
12883 	 * record in 16B units. Even values indicate 16B
12884 	 * records. Odd values indicate 32B
12885 	 * records.
12886 	 */
12887 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_MASK		UINT32_C(0x3f)
12888 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_SFT		0
12889 	/* HWRM Asynchronous Event Information */
12890 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12891 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_HWRM_ASYNC_EVENT
12892 	/* Identifiers of events. */
12893 	uint16_t	event_id;
12894 	/*
12895 	 * This async notification message is used to inform
12896 	 * the driver that an error has occurred which may need
12897 	 * the attention of the administrator.
12898 	 */
12899 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
12900 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_ID_ERROR_REPORT
12901 	/* Event specific data. */
12902 	uint32_t	event_data2;
12903 	/* Indicates the address where error was detected */
12904 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA2_ERR_ADDR_MASK UINT32_C(0xffffffff)
12905 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA2_ERR_ADDR_SFT 0
12906 	uint8_t	opaque_v;
12907 	/*
12908 	 * This value is written by the NIC such that it will be different
12909 	 * for each pass through the completion queue. The even passes
12910 	 * will write 1. The odd passes will write 0.
12911 	 */
12912 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_V	UINT32_C(0x1)
12913 	/* opaque is 7 b */
12914 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_OPAQUE_MASK UINT32_C(0xfe)
12915 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_OPAQUE_SFT 1
12916 	/* 8-lsb timestamp (100-msec resolution) */
12917 	uint8_t	timestamp_lo;
12918 	/* 16-lsb timestamp (100-msec resolution) */
12919 	uint16_t	timestamp_hi;
12920 	/* Event specific data */
12921 	uint32_t	event_data1;
12922 	/* Indicates the type of error being reported. */
12923 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_MASK	UINT32_C(0xff)
12924 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_SFT	0
12925 	/*
12926 	 * There was a low level error with an NVM operation.
12927 	 * See nvm_err_type for more details.
12928 	 */
12929 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_NVM_ERROR  UINT32_C(0x3)
12930 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_NVM_ERROR
12931 	/* The specific type of NVM error */
12932 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_MASK   UINT32_C(0xff00)
12933 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_SFT	8
12934 	/*
12935 	 * There was a low level error with an NVM write operation.
12936 	 * Verification of written data did not match.
12937 	 * event_data2 will be the failing address.
12938 	 */
12939 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_WRITE	(UINT32_C(0x1) << 8)
12940 	/*
12941 	 * There was a low level error with an NVM erase operation.
12942 	 * All the bits were not erased.
12943 	 * event_data2 will be the failing address.
12944 	 */
12945 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_ERASE	(UINT32_C(0x2) << 8)
12946 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_ERASE
12947 } hwrm_async_event_cmpl_error_report_nvm_t, *phwrm_async_event_cmpl_error_report_nvm_t;
12948 
12949 /* hwrm_async_event_cmpl_error_report_doorbell_drop_threshold (size:128b/16B) */
12950 
12951 typedef struct hwrm_async_event_cmpl_error_report_doorbell_drop_threshold {
12952 	uint16_t	type;
12953 	/*
12954 	 * This field indicates the exact type of the completion.
12955 	 * By convention, the LSB identifies the length of the
12956 	 * record in 16B units. Even values indicate 16B
12957 	 * records. Odd values indicate 32B
12958 	 * records.
12959 	 */
12960 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_MASK		UINT32_C(0x3f)
12961 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_SFT		0
12962 	/* HWRM Asynchronous Event Information */
12963 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
12964 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_HWRM_ASYNC_EVENT
12965 	/* Identifiers of events. */
12966 	uint16_t	event_id;
12967 	/*
12968 	 * This async notification message is used to inform
12969 	 * the driver that an error has occurred which may need
12970 	 * the attention of the administrator.
12971 	 */
12972 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
12973 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_ID_ERROR_REPORT
12974 	/* Event specific data. */
12975 	uint32_t	event_data2;
12976 	uint8_t	opaque_v;
12977 	/*
12978 	 * This value is written by the NIC such that it will be different
12979 	 * for each pass through the completion queue. The even passes
12980 	 * will write 1. The odd passes will write 0.
12981 	 */
12982 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_V	UINT32_C(0x1)
12983 	/* opaque is 7 b */
12984 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_OPAQUE_MASK UINT32_C(0xfe)
12985 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_OPAQUE_SFT 1
12986 	/* 8-lsb timestamp (100-msec resolution) */
12987 	uint8_t	timestamp_lo;
12988 	/* 16-lsb timestamp (100-msec resolution) */
12989 	uint16_t	timestamp_hi;
12990 	/* Event specific data */
12991 	uint32_t	event_data1;
12992 	/* Indicates the type of error being reported. */
12993 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_MASK		UINT32_C(0xff)
12994 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_SFT			0
12995 	/*
12996 	 * This indicates doorbell drop threshold was hit. When this
12997 	 * threshold is crossed, it indicates one or more doorbells for
12998 	 * the function were dropped by hardware.
12999 	 */
13000 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD  UINT32_C(0x4)
13001 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_LAST			HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD
13002 	/*
13003 	 * The epoch value to be sent from firmware to the driver to track
13004 	 * a doorbell recovery cycle.
13005 	 */
13006 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_EPOCH_MASK			UINT32_C(0xffffff00)
13007 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_EPOCH_SFT			8
13008 } hwrm_async_event_cmpl_error_report_doorbell_drop_threshold_t, *phwrm_async_event_cmpl_error_report_doorbell_drop_threshold_t;
13009 
13010 /* hwrm_async_event_cmpl_error_report_thermal (size:128b/16B) */
13011 
13012 typedef struct hwrm_async_event_cmpl_error_report_thermal {
13013 	uint16_t	type;
13014 	/*
13015 	 * This field indicates the exact type of the completion.
13016 	 * By convention, the LSB identifies the length of the
13017 	 * record in 16B units. Even values indicate 16B
13018 	 * records. Odd values indicate 32B
13019 	 * records.
13020 	 */
13021 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_MASK		UINT32_C(0x3f)
13022 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_SFT		0
13023 	/* HWRM Asynchronous Event Information */
13024 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
13025 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_HWRM_ASYNC_EVENT
13026 	/* Identifiers of events. */
13027 	uint16_t	event_id;
13028 	/*
13029 	 * This async notification message is used to inform
13030 	 * the driver that an error has occurred which may need
13031 	 * the attention of the administrator.
13032 	 */
13033 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
13034 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_ID_ERROR_REPORT
13035 	/* Event specific data. */
13036 	uint32_t	event_data2;
13037 	/* Current temperature. In Celsius */
13038 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_CURRENT_TEMP_MASK  UINT32_C(0xff)
13039 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_CURRENT_TEMP_SFT   0
13040 	/*
13041 	 * The temperature setting of the threshold that was just crossed.
13042 	 * In Celsius
13043 	 */
13044 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_MASK UINT32_C(0xff00)
13045 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_SFT 8
13046 	uint8_t	opaque_v;
13047 	/*
13048 	 * This value is written by the NIC such that it will be different
13049 	 * for each pass through the completion queue. The even passes
13050 	 * will write 1. The odd passes will write 0.
13051 	 */
13052 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_V	UINT32_C(0x1)
13053 	/* opaque is 7 b */
13054 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_OPAQUE_MASK UINT32_C(0xfe)
13055 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_OPAQUE_SFT 1
13056 	/* 8-lsb timestamp (100-msec resolution) */
13057 	uint8_t	timestamp_lo;
13058 	/* 16-lsb timestamp (100-msec resolution) */
13059 	uint16_t	timestamp_hi;
13060 	/* Event specific data */
13061 	uint32_t	event_data1;
13062 	/* Indicates the type of error being reported. */
13063 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_MASK	UINT32_C(0xff)
13064 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_SFT	0
13065 	/*
13066 	 * There was thermal event. The type will be specified in the
13067 	 * field threshold_type. event_data2 will contain the current
13068 	 * temperature and the configured value for the threshold that
13069 	 * was just crossed. The threshold values are lower thresholds,
13070 	 * so the event will trigger with an active flag when the
13071 	 * temperature is on an increasing trajectory.
13072 	 */
13073 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_THERMAL_EVENT   UINT32_C(0x5)
13074 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_THERMAL_EVENT
13075 	/* The specific type of thermal threshold error */
13076 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_MASK	UINT32_C(0x700)
13077 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SFT	8
13078 	/* Warning thermal threshold was crossed */
13079 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_WARN	(UINT32_C(0x0) << 8)
13080 	/* Critical thermal threshold was crossed */
13081 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_CRITICAL	(UINT32_C(0x1) << 8)
13082 	/* Fatal thermal threshold was crossed */
13083 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_FATAL	(UINT32_C(0x2) << 8)
13084 	/*
13085 	 * Thermal shutdown threshold was crossed and a shutdown is
13086 	 * imminent. This event will not occur if self shutdown
13087 	 * is disabled.
13088 	 */
13089 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SHUTDOWN	(UINT32_C(0x3) << 8)
13090 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SHUTDOWN
13091 	/*
13092 	 * Indicates if the thermal crossing occurs while the temperature is
13093 	 * increasing or decreasing.
13094 	 */
13095 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR	UINT32_C(0x800)
13096 	/* Threshold is crossed while the temperature is falling. */
13097 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_DECREASING  (UINT32_C(0x0) << 11)
13098 	/* Threshold is crossed while the temperature is rising. */
13099 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_INCREASING  (UINT32_C(0x1) << 11)
13100 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_INCREASING
13101 } hwrm_async_event_cmpl_error_report_thermal_t, *phwrm_async_event_cmpl_error_report_thermal_t;
13102 
13103 /* hwrm_async_event_cmpl_error_report_dual_data_rate_not_supported (size:128b/16B) */
13104 
13105 typedef struct hwrm_async_event_cmpl_error_report_dual_data_rate_not_supported {
13106 	uint16_t	type;
13107 	/*
13108 	 * This field indicates the exact type of the completion.
13109 	 * By convention, the LSB identifies the length of the
13110 	 * record in 16B units. Even values indicate 16B
13111 	 * records. Odd values indicate 32B
13112 	 * records.
13113 	 */
13114 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_TYPE_MASK		UINT32_C(0x3f)
13115 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_TYPE_SFT		0
13116 	/* HWRM Asynchronous Event Information */
13117 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
13118 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_TYPE_HWRM_ASYNC_EVENT
13119 	/* Identifiers of events. */
13120 	uint16_t	event_id;
13121 	/*
13122 	 * This async notification message is used to inform
13123 	 * the driver that an error has occurred which may need
13124 	 * the attention of the administrator.
13125 	 */
13126 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_ID_ERROR_REPORT UINT32_C(0x45)
13127 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_ID_ERROR_REPORT
13128 	/* Event specific data. */
13129 	uint32_t	event_data2;
13130 	uint8_t	opaque_v;
13131 	/*
13132 	 * This value is written by the NIC such that it will be different
13133 	 * for each pass through the completion queue. The even passes
13134 	 * will write 1. The odd passes will write 0.
13135 	 */
13136 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_V	UINT32_C(0x1)
13137 	/* opaque is 7 b */
13138 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_OPAQUE_MASK UINT32_C(0xfe)
13139 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_OPAQUE_SFT 1
13140 	/* 8-lsb timestamp (100-msec resolution) */
13141 	uint8_t	timestamp_lo;
13142 	/* 16-lsb timestamp (100-msec resolution) */
13143 	uint16_t	timestamp_hi;
13144 	/* Event specific data */
13145 	uint32_t	event_data1;
13146 	/* Indicates the type of error being reported. */
13147 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_DATA1_ERROR_TYPE_MASK			UINT32_C(0xff)
13148 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_DATA1_ERROR_TYPE_SFT			0
13149 	/*
13150 	 * Speed change not supported with dual rate transceivers
13151 	 * on this board.
13152 	 */
13153 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED  UINT32_C(0x6)
13154 		#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_DATA1_ERROR_TYPE_LAST			HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED
13155 } hwrm_async_event_cmpl_error_report_dual_data_rate_not_supported_t, *phwrm_async_event_cmpl_error_report_dual_data_rate_not_supported_t;
13156 
13157 /* hwrm_async_event_cmpl_vf_stat_change (size:128b/16B) */
13158 
13159 typedef struct hwrm_async_event_cmpl_vf_stat_change {
13160 	uint16_t	type;
13161 	/*
13162 	 * This field indicates the exact type of the completion.
13163 	 * By convention, the LSB identifies the length of the
13164 	 * record in 16B units. Even values indicate 16B
13165 	 * records. Odd values indicate 32B
13166 	 * records.
13167 	 */
13168 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_TYPE_MASK		UINT32_C(0x3f)
13169 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_TYPE_SFT		0
13170 	/* HWRM Asynchronous Event Information */
13171 		#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
13172 		#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_TYPE_HWRM_ASYNC_EVENT
13173 	/* Identifiers of events. */
13174 	uint16_t	event_id;
13175 	/*
13176 	 * VF statistics context change. Informs PF driver that a VF
13177 	 * statistics context has either been allocated or freed.
13178 	 */
13179 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_EVENT_ID_VF_STAT_CHANGE UINT32_C(0x4f)
13180 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_EVENT_ID_VF_STAT_CHANGE
13181 	/* Event specific data */
13182 	uint32_t	event_data2;
13183 	/*
13184 	 * VF ID that allocated the stats context. This is zero-based and
13185 	 * relative to each PF.
13186 	 */
13187 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_EVENT_DATA2_VF_ID_MASK		UINT32_C(0xffff)
13188 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_EVENT_DATA2_VF_ID_SFT		0
13189 	/*
13190 	 * A value of zero signals to the PF driver that it can free the host
13191 	 * buffer associated with the statistics context.
13192 	 * A non-zero values signals to the PF driver that it should allocate
13193 	 * a host buffer for the statistics context and inform the firmware
13194 	 * via HWRM_STAT_CTX_ALLOC. The PF driver must provide the sequence id
13195 	 * in the corresponding HWRM_STAT_CTX_ALLOC request so that firmware
13196 	 * can correlate it to the VF statistics context.
13197 	 */
13198 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_EVENT_DATA2_ACTION_SEQUENCE_ID_MASK UINT32_C(0xffff0000)
13199 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_EVENT_DATA2_ACTION_SEQUENCE_ID_SFT 16
13200 	uint8_t	opaque_v;
13201 	/*
13202 	 * This value is written by the NIC such that it will be different
13203 	 * for each pass through the completion queue. The even passes
13204 	 * will write 1. The odd passes will write 0.
13205 	 */
13206 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_V	UINT32_C(0x1)
13207 	/* opaque is 7 b */
13208 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
13209 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_OPAQUE_SFT 1
13210 	/* 8-lsb timestamp (100-msec resolution) */
13211 	uint8_t	timestamp_lo;
13212 	/* 16-lsb timestamp (100-msec resolution) */
13213 	uint16_t	timestamp_hi;
13214 	/* Event specific data */
13215 	uint32_t	event_data1;
13216 	/* VF statistics context identifier */
13217 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_EVENT_DATA1_STAT_CTX_ID_MASK UINT32_C(0xffffffff)
13218 	#define HWRM_ASYNC_EVENT_CMPL_VF_STAT_CHANGE_EVENT_DATA1_STAT_CTX_ID_SFT 0
13219 } hwrm_async_event_cmpl_vf_stat_change_t, *phwrm_async_event_cmpl_vf_stat_change_t;
13220 
13221 /* hwrm_async_event_cmpl_host_coredump (size:128b/16B) */
13222 
13223 typedef struct hwrm_async_event_cmpl_host_coredump {
13224 	uint16_t	type;
13225 	/*
13226 	 * This field indicates the exact type of the completion.
13227 	 * By convention, the LSB identifies the length of the
13228 	 * record in 16B units. Even values indicate 16B
13229 	 * records. Odd values indicate 32B
13230 	 * records.
13231 	 */
13232 	#define HWRM_ASYNC_EVENT_CMPL_HOST_COREDUMP_TYPE_MASK		UINT32_C(0x3f)
13233 	#define HWRM_ASYNC_EVENT_CMPL_HOST_COREDUMP_TYPE_SFT		0
13234 	/* HWRM Asynchronous Event Information */
13235 		#define HWRM_ASYNC_EVENT_CMPL_HOST_COREDUMP_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
13236 		#define HWRM_ASYNC_EVENT_CMPL_HOST_COREDUMP_TYPE_LAST		HWRM_ASYNC_EVENT_CMPL_HOST_COREDUMP_TYPE_HWRM_ASYNC_EVENT
13237 	/* Identifiers of events. */
13238 	uint16_t	event_id;
13239 	/*
13240 	 * coredump collection into host DMA address. Informs PF driver that
13241 	 * the coredump has been captured.
13242 	 */
13243 	#define HWRM_ASYNC_EVENT_CMPL_HOST_COREDUMP_EVENT_ID_HOST_COREDUMP UINT32_C(0x50)
13244 	#define HWRM_ASYNC_EVENT_CMPL_HOST_COREDUMP_EVENT_ID_LAST	HWRM_ASYNC_EVENT_CMPL_HOST_COREDUMP_EVENT_ID_HOST_COREDUMP
13245 	/* Event specific data */
13246 	uint32_t	event_data2;
13247 	uint8_t	opaque_v;
13248 	/*
13249 	 * This value is written by the NIC such that it will be different
13250 	 * for each pass through the completion queue. The even passes
13251 	 * will write 1. The odd passes will write 0.
13252 	 */
13253 	#define HWRM_ASYNC_EVENT_CMPL_HOST_COREDUMP_V	UINT32_C(0x1)
13254 	/* opaque is 7 b */
13255 	#define HWRM_ASYNC_EVENT_CMPL_HOST_COREDUMP_OPAQUE_MASK UINT32_C(0xfe)
13256 	#define HWRM_ASYNC_EVENT_CMPL_HOST_COREDUMP_OPAQUE_SFT 1
13257 	/* 8-lsb timestamp (100-msec resolution) */
13258 	uint8_t	timestamp_lo;
13259 	/* 16-lsb timestamp (100-msec resolution) */
13260 	uint16_t	timestamp_hi;
13261 	/* Event specific data */
13262 	uint32_t	event_data1;
13263 } hwrm_async_event_cmpl_host_coredump_t, *phwrm_async_event_cmpl_host_coredump_t;
13264 
13265 /* metadata_base_msg (size:64b/8B) */
13266 
13267 typedef struct metadata_base_msg {
13268 	uint16_t	md_type_link;
13269 	/* This field classifies the data present in the meta-data. */
13270 	#define METADATA_BASE_MSG_MD_TYPE_MASK	UINT32_C(0x1f)
13271 	#define METADATA_BASE_MSG_MD_TYPE_SFT	0
13272 	/* Meta data fields are not valid */
13273 		#define METADATA_BASE_MSG_MD_TYPE_NONE	UINT32_C(0x0)
13274 	/*
13275 	 * This setting is used when packets are coming in-order. Depending on
13276 	 * the state of the receive context, the meta-data will carry
13277 	 * different information.
13278 	 */
13279 		#define METADATA_BASE_MSG_MD_TYPE_TLS_INSYNC  UINT32_C(0x1)
13280 	/*
13281 	 * With this setting HW passes the TCP sequence number of the TLS
13282 	 * record that it is requesting a resync on in the meta data.
13283 	 */
13284 		#define METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC  UINT32_C(0x2)
13285 	/* This setting is used for QUIC packets. */
13286 		#define METADATA_BASE_MSG_MD_TYPE_QUIC	UINT32_C(0x3)
13287 	/*
13288 	 * This setting is used for crypto packets with an unsupported
13289 	 * protocol.
13290 	 */
13291 		#define METADATA_BASE_MSG_MD_TYPE_ILLEGAL	UINT32_C(0x1f)
13292 		#define METADATA_BASE_MSG_MD_TYPE_LAST	METADATA_BASE_MSG_MD_TYPE_ILLEGAL
13293 	/*
13294 	 * This field indicates where the next metadata block starts, relative
13295 	 * to the current metadata block. It is the offset to the next metadata
13296 	 * header, counted in 16B units. A value of zero indicates that there is
13297 	 * no additional metadata, and that the current metadata block is the
13298 	 * last one.
13299 	 */
13300 	#define METADATA_BASE_MSG_LINK_MASK	UINT32_C(0x1e0)
13301 	#define METADATA_BASE_MSG_LINK_SFT	5
13302 	uint16_t	unused0;
13303 	uint32_t	unused1;
13304 } metadata_base_msg_t, *pmetadata_base_msg_t;
13305 
13306 /* tls_metadata_base_msg (size:64b/8B) */
13307 
13308 typedef struct tls_metadata_base_msg {
13309 	uint32_t	md_type_link_flags_kid_lo;
13310 	/* This field classifies the data present in the meta-data. */
13311 	#define TLS_METADATA_BASE_MSG_MD_TYPE_MASK				UINT32_C(0x1f)
13312 	#define TLS_METADATA_BASE_MSG_MD_TYPE_SFT				0
13313 	/*
13314 	 * This setting is used when packets are coming in-order. Depending
13315 	 * on the state of the receive context, the meta-data will carry
13316 	 * different information.
13317 	 */
13318 		#define TLS_METADATA_BASE_MSG_MD_TYPE_TLS_INSYNC				UINT32_C(0x1)
13319 	/*
13320 	 * With this setting HW passes the TCP sequence number of the TLS
13321 	 * record that it is requesting a resync on in the meta data.
13322 	 */
13323 		#define TLS_METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC				UINT32_C(0x2)
13324 		#define TLS_METADATA_BASE_MSG_MD_TYPE_LAST				TLS_METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC
13325 	/*
13326 	 * This field indicates where the next metadata block starts. It is
13327 	 * counted in 16B units. A value of zero indicates that there is no
13328 	 * metadata.
13329 	 */
13330 	#define TLS_METADATA_BASE_MSG_LINK_MASK					UINT32_C(0x1e0)
13331 	#define TLS_METADATA_BASE_MSG_LINK_SFT					5
13332 	/* These are flags present in the metadata. */
13333 	#define TLS_METADATA_BASE_MSG_FLAGS_MASK				UINT32_C(0x1fffe00)
13334 	#define TLS_METADATA_BASE_MSG_FLAGS_SFT					9
13335 	/*
13336 	 * A value of 1 implies that the packet was decrypted by HW. Otherwise
13337 	 * the packet is passed on as it came in on the wire.
13338 	 */
13339 	#define TLS_METADATA_BASE_MSG_FLAGS_DECRYPTED				UINT32_C(0x200)
13340 	/*
13341 	 * This field indicates the state of the ghash field passed in the
13342 	 * meta-data.
13343 	 */
13344 	#define TLS_METADATA_BASE_MSG_FLAGS_GHASH_MASK				UINT32_C(0xc00)
13345 	#define TLS_METADATA_BASE_MSG_FLAGS_GHASH_SFT				10
13346 	/*
13347 	 * This enumeration states that the ghash is not valid in the
13348 	 * meta-data.
13349 	 */
13350 		#define TLS_METADATA_BASE_MSG_FLAGS_GHASH_NOT_VALID			(UINT32_C(0x0) << 10)
13351 	/*
13352 	 * This enumeration indicates that this pkt contains the record's
13353 	 * tag and this pkt was received ooo, the partial_ghash field
13354 	 * contains the ghash.
13355 	 */
13356 		#define TLS_METADATA_BASE_MSG_FLAGS_GHASH_CUR_REC				(UINT32_C(0x1) << 10)
13357 	/*
13358 	 * This enumeration indicates that the current record's tag wasn't
13359 	 * seen and the chip is moving on to the next record, the
13360 	 * partial_ghash field contains the ghash.
13361 	 */
13362 		#define TLS_METADATA_BASE_MSG_FLAGS_GHASH_PRIOR_REC			(UINT32_C(0x2) << 10)
13363 		#define TLS_METADATA_BASE_MSG_FLAGS_GHASH_LAST				TLS_METADATA_BASE_MSG_FLAGS_GHASH_PRIOR_REC
13364 	/* This field indicates the status of tag authentication. */
13365 	#define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_MASK			UINT32_C(0x3000)
13366 	#define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_SFT			12
13367 	/*
13368 	 * This enumeration is set when HW was not able to authenticate a
13369 	 * TAG.
13370 	 */
13371 		#define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_NOT_CHECKED		(UINT32_C(0x0) << 12)
13372 	/*
13373 	 * This enumeration states that there is at least one tag in the
13374 	 * packet and every tag is valid.
13375 	 */
13376 		#define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_SUCCESS		(UINT32_C(0x1) << 12)
13377 	/*
13378 	 * This enumeration states that there is at least one tag in the
13379 	 * packet and at least one of the tag is invalid. The entire packet
13380 	 * is sent decrypted to the host.
13381 	 */
13382 		#define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE		(UINT32_C(0x2) << 12)
13383 		#define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_LAST			TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE
13384 	/*
13385 	 * A value of 1 indicates that this packet contains a record that
13386 	 * starts in the packet and extends beyond the packet.
13387 	 */
13388 	#define TLS_METADATA_BASE_MSG_FLAGS_HEADER_FLDS_VALID			UINT32_C(0x4000)
13389 	/*
13390 	 * A value of 1 indicates that the packet experienced a context load
13391 	 * error. In this case, the packet is sent to the host without the
13392 	 * header or payload decrypted and the context is not updated.
13393 	 */
13394 	#define TLS_METADATA_BASE_MSG_FLAGS_CTX_LOAD_ERR				UINT32_C(0x8000)
13395 	/* This field indicates the packet operation state. */
13396 	#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_MASK		UINT32_C(0x70000)
13397 	#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_SFT		16
13398 	/* Packet is in order. */
13399 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_IN_ORDER		(UINT32_C(0x0) << 16)
13400 	/* Packet is out of order, no header loss. */
13401 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_OUT_OF_ORDER	(UINT32_C(0x1) << 16)
13402 	/* Packet is header search (out of order with header loss). */
13403 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_HEADER_SEARCH	(UINT32_C(0x2) << 16)
13404 	/* Packet is resync (resync record ongoing). */
13405 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC		(UINT32_C(0x3) << 16)
13406 	/*
13407 	 * Packet is resync wait (resync record completes, waiting for
13408 	 * result).
13409 	 */
13410 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_WAIT	(UINT32_C(0x4) << 16)
13411 	/*
13412 	 * Packet is resync wait for partial tag (waiting for resync record
13413 	 * tag).
13414 	 */
13415 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_WAIT_PARTIAL   (UINT32_C(0x5) << 16)
13416 	/* Packet is resync success (got resync record success). */
13417 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS	(UINT32_C(0x6) << 16)
13418 	/*
13419 	 * Packet is resync success wait (got midpath ACK, waiting for
13420 	 * resync record success).
13421 	 */
13422 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS_WAIT   (UINT32_C(0x7) << 16)
13423 		#define TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_LAST		TLS_METADATA_BASE_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS_WAIT
13424 	/*
13425 	 * This value indicates the lower 7-bit of the Crypto Key ID
13426 	 * associated with this operation.
13427 	 */
13428 	#define TLS_METADATA_BASE_MSG_KID_LO_MASK				UINT32_C(0xfe000000)
13429 	#define TLS_METADATA_BASE_MSG_KID_LO_SFT				25
13430 	uint16_t	kid_hi;
13431 	/*
13432 	 * This value indicates the upper 13-bit of the Crypto Key ID
13433 	 * associated with this operation.
13434 	 */
13435 	#define TLS_METADATA_BASE_MSG_KID_HI_MASK UINT32_C(0x1fff)
13436 	#define TLS_METADATA_BASE_MSG_KID_HI_SFT 0
13437 	uint16_t	unused0;
13438 } tls_metadata_base_msg_t, *ptls_metadata_base_msg_t;
13439 
13440 /* tls_metadata_insync_msg (size:192b/24B) */
13441 
13442 typedef struct tls_metadata_insync_msg {
13443 	uint32_t	md_type_link_flags_kid_lo;
13444 	/* This field classifies the data present in the meta-data. */
13445 	#define TLS_METADATA_INSYNC_MSG_MD_TYPE_MASK				UINT32_C(0x1f)
13446 	#define TLS_METADATA_INSYNC_MSG_MD_TYPE_SFT				0
13447 	/*
13448 	 * This setting is used when packets are coming in-order. Depending on
13449 	 * the state of the receive context, the meta-data will carry
13450 	 * different information.
13451 	 */
13452 		#define TLS_METADATA_INSYNC_MSG_MD_TYPE_TLS_INSYNC				UINT32_C(0x1)
13453 		#define TLS_METADATA_INSYNC_MSG_MD_TYPE_LAST				TLS_METADATA_INSYNC_MSG_MD_TYPE_TLS_INSYNC
13454 	/*
13455 	 * This field indicates where the next metadata block starts. It is
13456 	 * counted in 16B units. A value of zero indicates that there is no
13457 	 * metadata.
13458 	 */
13459 	#define TLS_METADATA_INSYNC_MSG_LINK_MASK					UINT32_C(0x1e0)
13460 	#define TLS_METADATA_INSYNC_MSG_LINK_SFT					5
13461 	/* These are flags present in the metadata. */
13462 	#define TLS_METADATA_INSYNC_MSG_FLAGS_MASK				UINT32_C(0x1fffe00)
13463 	#define TLS_METADATA_INSYNC_MSG_FLAGS_SFT					9
13464 	/*
13465 	 * A value of 1 implies that the packet was decrypted by HW. Otherwise
13466 	 * the packet is passed on as it came in on the wire.
13467 	 */
13468 	#define TLS_METADATA_INSYNC_MSG_FLAGS_DECRYPTED				UINT32_C(0x200)
13469 	/*
13470 	 * This field indicates the state of the ghash field passed in the
13471 	 * meta-data.
13472 	 */
13473 	#define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_MASK				UINT32_C(0xc00)
13474 	#define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_SFT				10
13475 	/*
13476 	 * This enumeration states that the ghash is not valid in the
13477 	 * meta-data.
13478 	 */
13479 		#define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_NOT_VALID			(UINT32_C(0x0) << 10)
13480 	/*
13481 	 * This enumeration indicates that this pkt contains the record's
13482 	 * tag and this pkt was received ooo, the partial_ghash field
13483 	 * contains the ghash.
13484 	 */
13485 		#define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_CUR_REC				(UINT32_C(0x1) << 10)
13486 	/*
13487 	 * This enumeration indicates that the current record's tag wasn't
13488 	 * seen and the chip is moving on to the next record, the
13489 	 * partial_ghash field contains the ghash.
13490 	 */
13491 		#define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_PRIOR_REC			(UINT32_C(0x2) << 10)
13492 		#define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_LAST				TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_PRIOR_REC
13493 	/* This field indicates the status of tag authentication. */
13494 	#define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_MASK			UINT32_C(0x3000)
13495 	#define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_SFT			12
13496 	/*
13497 	 * This enumeration is set when HW was not able to authenticate a
13498 	 * TAG.
13499 	 */
13500 		#define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_NOT_CHECKED		(UINT32_C(0x0) << 12)
13501 	/*
13502 	 * This enumeration states that there is at least one tag in the
13503 	 * packet and every tag is valid.
13504 	 */
13505 		#define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_SUCCESS		(UINT32_C(0x1) << 12)
13506 	/*
13507 	 * This enumeration states that there is at least one tag in the
13508 	 * packet and at least one of the tag is invalid. The entire packet
13509 	 * is sent decrypted to the host.
13510 	 */
13511 		#define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE		(UINT32_C(0x2) << 12)
13512 		#define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_LAST			TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE
13513 	/*
13514 	 * A value of 1 indicates that this packet contains a record that
13515 	 * starts in the packet and extends beyond the packet.
13516 	 */
13517 	#define TLS_METADATA_INSYNC_MSG_FLAGS_HEADER_FLDS_VALID			UINT32_C(0x4000)
13518 	/*
13519 	 * A value of 1 indicates that the packet experienced a context load
13520 	 * error. In this case, the packet is sent to the host without the
13521 	 * header or payload decrypted and the context is not updated.
13522 	 */
13523 	#define TLS_METADATA_INSYNC_MSG_FLAGS_CTX_LOAD_ERR				UINT32_C(0x8000)
13524 	/* This field indicates the packet operation state. */
13525 	#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_MASK		UINT32_C(0x70000)
13526 	#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_SFT		16
13527 	/* Packet is in order. */
13528 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_IN_ORDER		(UINT32_C(0x0) << 16)
13529 	/* Packet is out of order, no header loss. */
13530 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_OUT_OF_ORDER	(UINT32_C(0x1) << 16)
13531 	/* Packet is header search (out of order with header loss). */
13532 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_HEADER_SEARCH	(UINT32_C(0x2) << 16)
13533 	/* Packet is resync (resync record ongoing). */
13534 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC		(UINT32_C(0x3) << 16)
13535 	/*
13536 	 * Packet is resync wait (resync record completes, waiting for
13537 	 * result).
13538 	 */
13539 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_WAIT	(UINT32_C(0x4) << 16)
13540 	/*
13541 	 * Packet is resync wait for partial tag (waiting for resync record
13542 	 * tag).
13543 	 */
13544 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_WAIT_PARTIAL   (UINT32_C(0x5) << 16)
13545 	/* Packet is resync success (got resync record success). */
13546 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS	(UINT32_C(0x6) << 16)
13547 	/*
13548 	 * Packet is resync success wait (got midpath ACK, waiting for
13549 	 * resync record success).
13550 	 */
13551 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS_WAIT   (UINT32_C(0x7) << 16)
13552 		#define TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_LAST		TLS_METADATA_INSYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS_WAIT
13553 	/*
13554 	 * This value indicates the lower 7-bit of the Crypto Key ID
13555 	 * associated with this operation.
13556 	 */
13557 	#define TLS_METADATA_INSYNC_MSG_KID_LO_MASK				UINT32_C(0xfe000000)
13558 	#define TLS_METADATA_INSYNC_MSG_KID_LO_SFT				25
13559 	uint16_t	kid_hi;
13560 	/*
13561 	 * This value indicates the upper 13-bit of the Crypto Key ID
13562 	 * associated with this operation.
13563 	 */
13564 	#define TLS_METADATA_INSYNC_MSG_KID_HI_MASK UINT32_C(0x1fff)
13565 	#define TLS_METADATA_INSYNC_MSG_KID_HI_SFT 0
13566 	/*
13567 	 * This field is only valid when md_type is set to tls_insync. This
13568 	 * field indicates the offset within the current TCP packet where the
13569 	 * TLS header starts. If there are multiple TLS headers in the packet,
13570 	 * this provides the offset of the last TLS header.
13571 	 *
13572 	 * The field is calculated by subtracting TCP sequence number of the
13573 	 * first byte of the TCP payload of the packet from the TCP sequence
13574 	 * number of the last TLS header in the packet.
13575 	 */
13576 	uint16_t	tls_header_offset;
13577 	/*
13578 	 * This is the sequence Number of the record that was processed by the HW.
13579 	 * If there are multiple records in a packet, this would be the sequence
13580 	 * number of the last record.
13581 	 */
13582 	uint64_t	record_seq_num;
13583 	/*
13584 	 * This field contains cumulative partial GHASH value of all the packets
13585 	 * decrypted by the HW associated with a TLS record. This field is valid
13586 	 * on when packets belonging to have arrived out-of-order and HW could
13587 	 * not decrypt every packet and authenticate the record. Partial GHASH is
13588 	 * only sent out with packet having the TAG field.
13589 	 */
13590 	uint8_t	partial_ghash[8];
13591 } tls_metadata_insync_msg_t, *ptls_metadata_insync_msg_t;
13592 
13593 /* tls_metadata_resync_msg (size:256b/32B) */
13594 
13595 typedef struct tls_metadata_resync_msg {
13596 	uint32_t	md_type_link_flags_kid_lo;
13597 	/* This field classifies the data present in the meta-data. */
13598 	#define TLS_METADATA_RESYNC_MSG_MD_TYPE_MASK				UINT32_C(0x1f)
13599 	#define TLS_METADATA_RESYNC_MSG_MD_TYPE_SFT				0
13600 	/*
13601 	 * With this setting HW passes the TCP sequence number of the TLS
13602 	 * record that it is requesting a resync on in the meta data.
13603 	 */
13604 		#define TLS_METADATA_RESYNC_MSG_MD_TYPE_TLS_RESYNC				UINT32_C(0x2)
13605 		#define TLS_METADATA_RESYNC_MSG_MD_TYPE_LAST				TLS_METADATA_RESYNC_MSG_MD_TYPE_TLS_RESYNC
13606 	/*
13607 	 * This field indicates where the next metadata block starts. It is
13608 	 * counted in 16B units. A value of zero indicates that there is no
13609 	 * metadata.
13610 	 */
13611 	#define TLS_METADATA_RESYNC_MSG_LINK_MASK					UINT32_C(0x1e0)
13612 	#define TLS_METADATA_RESYNC_MSG_LINK_SFT					5
13613 	/* These are flags present in the metadata. */
13614 	#define TLS_METADATA_RESYNC_MSG_FLAGS_MASK				UINT32_C(0x1fffe00)
13615 	#define TLS_METADATA_RESYNC_MSG_FLAGS_SFT					9
13616 	/*
13617 	 * A value of 1 implies that the packet was decrypted by HW. Otherwise
13618 	 * the packet is passed on as it came in on the wire.
13619 	 */
13620 	#define TLS_METADATA_RESYNC_MSG_FLAGS_DECRYPTED				UINT32_C(0x200)
13621 	/*
13622 	 * This field indicates the state of the ghash field passed in the
13623 	 * meta-data.
13624 	 */
13625 	#define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_MASK				UINT32_C(0xc00)
13626 	#define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_SFT				10
13627 	/*
13628 	 * This enumeration states that the ghash is not valid in the
13629 	 * meta-data.
13630 	 */
13631 		#define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_NOT_VALID			(UINT32_C(0x0) << 10)
13632 		#define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_LAST				TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_NOT_VALID
13633 	/* This field indicates the status of tag authentication. */
13634 	#define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_MASK			UINT32_C(0x3000)
13635 	#define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_SFT			12
13636 	/*
13637 	 * This enumeration is set when HW was not able to authenticate a
13638 	 * TAG.
13639 	 */
13640 		#define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_NOT_CHECKED		(UINT32_C(0x0) << 12)
13641 		#define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_LAST			TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_NOT_CHECKED
13642 	/*
13643 	 * A value of 1 indicates that this packet contains a record that
13644 	 * starts in the packet and extends beyond the packet.
13645 	 */
13646 	#define TLS_METADATA_RESYNC_MSG_FLAGS_HEADER_FLDS_VALID			UINT32_C(0x4000)
13647 	/*
13648 	 * A value of 1 indicates that the packet experienced a context load
13649 	 * error. In this case, the packet is sent to the host without the
13650 	 * header or payload decrypted and the context is not updated.
13651 	 */
13652 	#define TLS_METADATA_RESYNC_MSG_FLAGS_CTX_LOAD_ERR				UINT32_C(0x8000)
13653 	/* This field indicates the packet operation state. */
13654 	#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_MASK		UINT32_C(0x70000)
13655 	#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_SFT		16
13656 	/* Packet is in order. */
13657 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_IN_ORDER		(UINT32_C(0x0) << 16)
13658 	/* Packet is out of order, no header loss. */
13659 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_OUT_OF_ORDER	(UINT32_C(0x1) << 16)
13660 	/* Packet is header search (out of order with header loss). */
13661 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_HEADER_SEARCH	(UINT32_C(0x2) << 16)
13662 	/* Packet is resync (resync record ongoing). */
13663 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC		(UINT32_C(0x3) << 16)
13664 	/*
13665 	 * Packet is resync wait (resync record completes, waiting for
13666 	 * result).
13667 	 */
13668 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_WAIT	(UINT32_C(0x4) << 16)
13669 	/*
13670 	 * Packet is resync wait for partial tag (waiting for resync record
13671 	 * tag).
13672 	 */
13673 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_WAIT_PARTIAL   (UINT32_C(0x5) << 16)
13674 	/* Packet is resync success (got resync record success). */
13675 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS	(UINT32_C(0x6) << 16)
13676 	/*
13677 	 * Packet is resync success wait (got midpath ACK, waiting for
13678 	 * resync record success).
13679 	 */
13680 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS_WAIT   (UINT32_C(0x7) << 16)
13681 		#define TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_LAST		TLS_METADATA_RESYNC_MSG_FLAGS_PKT_OPERATION_STATE_RESYNC_SUCCESS_WAIT
13682 	/*
13683 	 * This value indicates the lower 7-bit of the Crypto Key ID
13684 	 * associated with this operation.
13685 	 */
13686 	#define TLS_METADATA_RESYNC_MSG_KID_LO_MASK				UINT32_C(0xfe000000)
13687 	#define TLS_METADATA_RESYNC_MSG_KID_LO_SFT				25
13688 	uint16_t	kid_hi;
13689 	/*
13690 	 * This value indicates the upper 13-bit of the Crypto Key ID
13691 	 * associated with this operation.
13692 	 */
13693 	#define TLS_METADATA_RESYNC_MSG_KID_HI_MASK UINT32_C(0x1fff)
13694 	#define TLS_METADATA_RESYNC_MSG_KID_HI_SFT 0
13695 	/* This field is unused in this context. */
13696 	uint16_t	metadata_0;
13697 	/*
13698 	 * This field indicates the TCP sequence number of the TLS record that HW
13699 	 * is requesting a resync on from the Driver. HW will keep a count of the
13700 	 * TLS records it found after this record (delta_records). Driver will
13701 	 * provide the TLS Record Sequence Number associated with the record. HW
13702 	 * will add the delta_records to the Record Sequence Number provided by
13703 	 * the driver and get back on sync.
13704 	 */
13705 	uint32_t	resync_record_tcp_seq_num;
13706 	uint32_t	unused0;
13707 	/* This field is unused in this context. */
13708 	uint64_t	metadata_2;
13709 	/* This field is unused in this context. */
13710 	uint64_t	metadata_3;
13711 } tls_metadata_resync_msg_t, *ptls_metadata_resync_msg_t;
13712 
13713 /* tx_doorbell (size:32b/4B) */
13714 
13715 typedef struct tx_doorbell {
13716 	uint32_t	key_idx;
13717 	/*
13718 	 * BD Index of next BD that will be used to transmit data
13719 	 * on the TX ring mapped to this door bell. NIC may
13720 	 * read and process all BDs up to, but not including this
13721 	 * index.
13722 	 */
13723 	#define TX_DOORBELL_IDX_MASK UINT32_C(0xffffff)
13724 	#define TX_DOORBELL_IDX_SFT 0
13725 	/*
13726 	 * This value indicates the type of door bell operation
13727 	 * that is begin requested. This value is '0' for TX
13728 	 * door bell operations.
13729 	 */
13730 	#define TX_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
13731 	#define TX_DOORBELL_KEY_SFT 28
13732 	/* TX Operation */
13733 		#define TX_DOORBELL_KEY_TX	(UINT32_C(0x0) << 28)
13734 		#define TX_DOORBELL_KEY_LAST TX_DOORBELL_KEY_TX
13735 } tx_doorbell_t, *ptx_doorbell_t;
13736 
13737 /* rx_doorbell (size:32b/4B) */
13738 
13739 typedef struct rx_doorbell {
13740 	uint32_t	key_idx;
13741 	/*
13742 	 * BD Index of next BD that will be used for an empty receive
13743 	 * buffer on the RX ring mapped to this door bell. NIC may
13744 	 * read and process all BDs up to, but not including this
13745 	 * index.
13746 	 */
13747 	#define RX_DOORBELL_IDX_MASK UINT32_C(0xffffff)
13748 	#define RX_DOORBELL_IDX_SFT 0
13749 	/*
13750 	 * This value indicates the type of door bell operation
13751 	 * that is begin requested. This value is '1' for RX
13752 	 * door bell operations.
13753 	 */
13754 	#define RX_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
13755 	#define RX_DOORBELL_KEY_SFT 28
13756 	/* RX Operation */
13757 		#define RX_DOORBELL_KEY_RX	(UINT32_C(0x1) << 28)
13758 		#define RX_DOORBELL_KEY_LAST RX_DOORBELL_KEY_RX
13759 } rx_doorbell_t, *prx_doorbell_t;
13760 
13761 /* cmpl_doorbell (size:32b/4B) */
13762 
13763 typedef struct cmpl_doorbell {
13764 	uint32_t	key_mask_valid_idx;
13765 	/*
13766 	 * BD Index of the most recently handed completion record
13767 	 * on the completion ring mapped to this door bell.
13768 	 * NIC may
13769 	 * write this location again with a new completion.
13770 	 */
13771 	#define CMPL_DOORBELL_IDX_MASK	UINT32_C(0xffffff)
13772 	#define CMPL_DOORBELL_IDX_SFT	0
13773 	/*
13774 	 * This indicates if the BDIDX value is valid for this
13775 	 * update when it is '1'. When it is '0', the BDIDX
13776 	 * value should be ignored.
13777 	 */
13778 	#define CMPL_DOORBELL_IDX_VALID	UINT32_C(0x4000000)
13779 	/*
13780 	 * This bit indicates the new interrupt mask state for the
13781 	 * interrupt associated with the BDIDX. A '1', means the
13782 	 * interrupt is to be masked. A '0' indicates the interrupt
13783 	 * is to be unmasked.
13784 	 */
13785 	#define CMPL_DOORBELL_MASK	UINT32_C(0x8000000)
13786 	/*
13787 	 * This value indicates the type of door bell operation
13788 	 * that is begin requested. This value is '2' for CMP
13789 	 * door bell operations.
13790 	 */
13791 	#define CMPL_DOORBELL_KEY_MASK	UINT32_C(0xf0000000)
13792 	#define CMPL_DOORBELL_KEY_SFT	28
13793 	/* Completion Operation */
13794 		#define CMPL_DOORBELL_KEY_CMPL	(UINT32_C(0x2) << 28)
13795 		#define CMPL_DOORBELL_KEY_LAST	CMPL_DOORBELL_KEY_CMPL
13796 } cmpl_doorbell_t, *pcmpl_doorbell_t;
13797 
13798 /* status_doorbell (size:32b/4B) */
13799 
13800 typedef struct status_doorbell {
13801 	uint32_t	key_idx;
13802 	/*
13803 	 * BD Index of the status record for which space is now
13804 	 * available to the NIC.
13805 	 */
13806 	/*
13807 	 * While there is no actual BD associated with the index,
13808 	 * the similar scheme is being used to communicate to
13809 	 * the NIC that space is available for status completions.
13810 	 */
13811 	#define STATUS_DOORBELL_IDX_MASK UINT32_C(0xffffff)
13812 	#define STATUS_DOORBELL_IDX_SFT 0
13813 	/*
13814 	 * This value indicates the type of door bell operation
13815 	 * that is begin requested. This value is '3' for Status
13816 	 * door bell operations.
13817 	 */
13818 	#define STATUS_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
13819 	#define STATUS_DOORBELL_KEY_SFT 28
13820 	/* Status Operation */
13821 		#define STATUS_DOORBELL_KEY_STAT  (UINT32_C(0x3) << 28)
13822 		#define STATUS_DOORBELL_KEY_LAST STATUS_DOORBELL_KEY_STAT
13823 } status_doorbell_t, *pstatus_doorbell_t;
13824 
13825 /* push32_doorbell (size:1024b/128B) */
13826 
13827 typedef struct push32_doorbell {
13828 	uint32_t	key_sz_idx;
13829 	/*
13830 	 * This is the BD Index of last BD of the push packet
13831 	 * that will be used to transmit data on the TX ring mapped
13832 	 * to this door bell.
13833 	 */
13834 	#define PUSH32_DOORBELL_IDX_MASK UINT32_C(0xffffff)
13835 	#define PUSH32_DOORBELL_IDX_SFT 0
13836 	/*
13837 	 * This is the number of 16B BDs spaces consumed in the TX
13838 	 * Ring by the "backup" version of the packet being pushed.
13839 	 * A value of 1 is invalid since backup must start with a
13840 	 * long 32B BE.
13841 	 * A value of 2 indicates just the first 32B BE.
13842 	 * A value of 3 indicates 32B+16B BD. etc.
13843 	 * A value of 0 indicates 16x16B BD spaces are consumed.
13844 	 */
13845 	#define PUSH32_DOORBELL_SZ_MASK UINT32_C(0xf000000)
13846 	#define PUSH32_DOORBELL_SZ_SFT  24
13847 	/*
13848 	 * This value indicates the type of door bell operation
13849 	 * that is begin requested. This value is 4 for push
13850 	 * door bell operations.
13851 	 */
13852 	#define PUSH32_DOORBELL_KEY_MASK UINT32_C(0xf0000000)
13853 	#define PUSH32_DOORBELL_KEY_SFT 28
13854 	/* Push Operation */
13855 		#define PUSH32_DOORBELL_KEY_PUSH  (UINT32_C(0x4) << 28)
13856 		#define PUSH32_DOORBELL_KEY_LAST PUSH32_DOORBELL_KEY_PUSH
13857 	uint16_t	flags_type;
13858 	/* This value identifies the type of buffer descriptor. */
13859 	#define PUSH32_DOORBELL_TYPE_MASK		UINT32_C(0x3f)
13860 	#define PUSH32_DOORBELL_TYPE_SFT		0
13861 	/*
13862 	 * Indicates that this BD is 32B long and is used for
13863 	 * normal L2 packet transmission.
13864 	 */
13865 		#define PUSH32_DOORBELL_TYPE_TX_BD_LONG	UINT32_C(0x10)
13866 		#define PUSH32_DOORBELL_TYPE_LAST		PUSH32_DOORBELL_TYPE_TX_BD_LONG
13867 	/*
13868 	 * All bits in this field must be valid on the first BD of a packet.
13869 	 * Only the packet_end bit must be valid for the remaining BDs
13870 	 * of a packet.
13871 	 */
13872 	#define PUSH32_DOORBELL_FLAGS_MASK	UINT32_C(0xffc0)
13873 	#define PUSH32_DOORBELL_FLAGS_SFT		6
13874 	/*
13875 	 * If set to 1, the packet ends with the data in the buffer
13876 	 * pointed to by this descriptor. This flag must be
13877 	 * valid on every BD.
13878 	 *
13879 	 *	This bit must be set on all push doorbells.
13880 	 */
13881 	#define PUSH32_DOORBELL_FLAGS_PACKET_END	UINT32_C(0x40)
13882 	/*
13883 	 * If set to 1, the device will not generate a completion for
13884 	 * this transmit packet unless there is an error in it's
13885 	 * processing.
13886 	 * If this bit
13887 	 * is set to 0, then the packet will be completed normally.
13888 	 *
13889 	 * This bit must be valid only on the first BD of a packet.
13890 	 */
13891 	#define PUSH32_DOORBELL_FLAGS_NO_CMPL	UINT32_C(0x80)
13892 	/*
13893 	 * This value must match the sz field in the first
13894 	 * 32b of the push operation except that if
13895 	 * 16x16B BD locations
13896 	 * are consumed in the ring by this packet, then
13897 	 * this value must be 16 (not zero).
13898 	 */
13899 	#define PUSH32_DOORBELL_FLAGS_BD_CNT_MASK	UINT32_C(0x1f00)
13900 	#define PUSH32_DOORBELL_FLAGS_BD_CNT_SFT	8
13901 	/*
13902 	 * This value is a hint for the length of the entire packet.
13903 	 * It is used by the chip to optimize internal processing.
13904 	 *
13905 	 * The packet will be dropped if the hint is too short.
13906 	 *
13907 	 * This field is valid only on the first BD of a packet.
13908 	 */
13909 	#define PUSH32_DOORBELL_FLAGS_LHINT_MASK	UINT32_C(0x6000)
13910 	#define PUSH32_DOORBELL_FLAGS_LHINT_SFT	13
13911 	/* indicates packet length < 512B */
13912 		#define PUSH32_DOORBELL_FLAGS_LHINT_LT512	(UINT32_C(0x0) << 13)
13913 	/* indicates 512 <= packet length < 1KB */
13914 		#define PUSH32_DOORBELL_FLAGS_LHINT_LT1K	(UINT32_C(0x1) << 13)
13915 	/* indicates 1KB <= packet length < 2KB */
13916 		#define PUSH32_DOORBELL_FLAGS_LHINT_LT2K	(UINT32_C(0x2) << 13)
13917 	/* indicates packet length >= 2KB */
13918 		#define PUSH32_DOORBELL_FLAGS_LHINT_GTE2K	(UINT32_C(0x3) << 13)
13919 		#define PUSH32_DOORBELL_FLAGS_LHINT_LAST	PUSH32_DOORBELL_FLAGS_LHINT_GTE2K
13920 	/*
13921 	 * If set to 1, the device immediately updates the Send Consumer
13922 	 * Index after the buffer associated with this descriptor has
13923 	 * been transferred via DMA to NIC memory from host memory. An
13924 	 * interrupt may or may not be generated according to the state
13925 	 * of the interrupt avoidance mechanisms. If this bit
13926 	 * is set to 0, then the Consumer Index is only updated as soon
13927 	 * as one of the host interrupt coalescing conditions has been met.
13928 	 *
13929 	 * This bit must be valid on the first BD of a packet.
13930 	 */
13931 	#define PUSH32_DOORBELL_FLAGS_COAL_NOW	UINT32_C(0x8000)
13932 	/*
13933 	 * This is the length of the host physical buffer this BD describes
13934 	 * in bytes.
13935 	 *
13936 	 * This field must be valid on all BDs of a packet.
13937 	 */
13938 	uint16_t	len;
13939 	/*
13940 	 * The opaque data field is pass through to the completion and can be
13941 	 * used for any data that the driver wants to associate with the
13942 	 * transmit BD.
13943 	 *
13944 	 * This field must be valid on the first BD of a packet.
13945 	 */
13946 	uint32_t	opaque;
13947 	/*
13948 	 * All bits in this field must be valid on the first BD of a packet.
13949 	 * Their value on other BDs of the packet will be ignored.
13950 	 */
13951 	uint16_t	lflags;
13952 	/*
13953 	 * If set to 1, the controller replaces the TCP/UPD checksum
13954 	 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
13955 	 * checksum field of the encapsulated TCP/UDP packets with the
13956 	 * hardware calculated TCP/UDP checksum for the packet associated
13957 	 * with this descriptor. The flag is ignored if the LSO flag is set.
13958 	 *
13959 	 * This bit must be valid on the first BD of a packet.
13960 	 */
13961 	#define PUSH32_DOORBELL_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
13962 	/*
13963 	 * If set to 1, the controller replaces the IP checksum of the
13964 	 * normal packets, or the inner IP checksum of the encapsulated
13965 	 * packets with the hardware calculated IP checksum for the
13966 	 * packet associated with this descriptor.
13967 	 *
13968 	 * This bit must be valid on the first BD of a packet.
13969 	 */
13970 	#define PUSH32_DOORBELL_LFLAGS_IP_CHKSUM	UINT32_C(0x2)
13971 	/*
13972 	 * If set to 1, the controller will not append an Ethernet CRC
13973 	 * to the end of the frame.
13974 	 *
13975 	 * This bit must be valid on the first BD of a packet.
13976 	 *
13977 	 * Packet must be 64B or longer when this flag is set. It is not
13978 	 * useful to use this bit with any form of TX offload such as
13979 	 * CSO or LSO. The intent is that the packet from the host already
13980 	 * has a valid Ethernet CRC on the packet.
13981 	 */
13982 	#define PUSH32_DOORBELL_LFLAGS_NOCRC		UINT32_C(0x4)
13983 	/*
13984 	 * If set to 1, the device will record the time at which the packet
13985 	 * was actually transmitted at the TX MAC.
13986 	 *
13987 	 * This bit must be valid on the first BD of a packet.
13988 	 */
13989 	#define PUSH32_DOORBELL_LFLAGS_STAMP		UINT32_C(0x8)
13990 	/*
13991 	 * If set to 1, The controller replaces the tunnel IP checksum
13992 	 * field with hardware calculated IP checksum for the IP header
13993 	 * of the packet associated with this descriptor.
13994 	 *
13995 	 * For outer UDP checksum, global outer UDP checksum TE_NIC register
13996 	 * needs to be enabled. If the global outer UDP checksum TE_NIC
13997 	 * register bit is set, outer UDP checksum will be calculated for the
13998 	 * following cases:
13999 	 * 1. Packets with tcp_udp_chksum flag set to offload checksum for
14000 	 * inner packet AND the inner packet is TCP/UDP. If the inner packet is
14001 	 * ICMP for example (non-TCP/UDP), even if the tcp_udp_chksum is set,
14002 	 * the outer UDP checksum will not be calculated.
14003 	 * 2. Packets with lso flag set which implies inner TCP checksum
14004 	 * calculation as part of LSO operation.
14005 	 */
14006 	#define PUSH32_DOORBELL_LFLAGS_T_IP_CHKSUM	UINT32_C(0x10)
14007 	/*
14008 	 * If set to 1, the device will treat this packet with LSO(Large
14009 	 * Send Offload) processing for both normal or encapsulated
14010 	 * packets, which is a form of TCP segmentation. When this bit
14011 	 * is 1, the hdr_size and mss fields must be valid. The driver
14012 	 * doesn't need to set t_ip_chksum, ip_chksum, and tcp_udp_chksum
14013 	 * flags since the controller will replace the appropriate
14014 	 * checksum fields for segmented packets.
14015 	 *
14016 	 * When this bit is 1, the hdr_size and mss fields must be valid.
14017 	 */
14018 	#define PUSH32_DOORBELL_LFLAGS_LSO		UINT32_C(0x20)
14019 	/*
14020 	 * If set to zero when LSO is '1', then the IPID will be treated
14021 	 * as a 16b number and will be wrapped if it exceeds a value of
14022 	 * 0xffff.
14023 	 *
14024 	 * If set to one when LSO is '1', then the IPID will be treated
14025 	 * as a 15b number and will be wrapped if it exceeds a value of
14026 	 * 0x7fff.
14027 	 */
14028 	#define PUSH32_DOORBELL_LFLAGS_IPID_FMT	UINT32_C(0x40)
14029 	/*
14030 	 * If set to zero when LSO is '1', then the IPID of the tunnel
14031 	 * IP header will not be modified during LSO operations.
14032 	 *
14033 	 * If set to one when LSO is '1', then the IPID of the tunnel
14034 	 * IP header will be incremented for each subsequent segment of an
14035 	 * LSO operation.
14036 	 *
14037 	 * The flag is ignored if the LSO packet is a normal (non-tunneled)
14038 	 * TCP packet.
14039 	 */
14040 	#define PUSH32_DOORBELL_LFLAGS_T_IPID		UINT32_C(0x80)
14041 	/*
14042 	 * If set to '1', then the RoCE ICRC will be appended to the
14043 	 * packet. Packet must be a valid RoCE format packet.
14044 	 */
14045 	#define PUSH32_DOORBELL_LFLAGS_ROCE_CRC	UINT32_C(0x100)
14046 	/*
14047 	 * If set to '1', then the FCoE CRC will be appended to the
14048 	 * packet. Packet must be a valid FCoE format packet.
14049 	 */
14050 	#define PUSH32_DOORBELL_LFLAGS_FCOE_CRC	UINT32_C(0x200)
14051 	uint16_t	hdr_size;
14052 	/*
14053 	 * When LSO is '1', this field must contain the offset of the
14054 	 * TCP payload from the beginning of the packet in as
14055 	 * 16b words. In case of encapsulated/tunneling packet, this field
14056 	 * contains the offset of the inner TCP payload from beginning of the
14057 	 * packet as 16-bit words.
14058 	 *
14059 	 * This value must be valid on the first BD of a packet.
14060 	 */
14061 	#define PUSH32_DOORBELL_HDR_SIZE_MASK UINT32_C(0x1ff)
14062 	#define PUSH32_DOORBELL_HDR_SIZE_SFT 0
14063 	uint32_t	mss;
14064 	/*
14065 	 * This is the MSS value that will be used to do the LSO processing.
14066 	 * The value is the length in bytes of the TCP payload for each
14067 	 * segment generated by the LSO operation.
14068 	 *
14069 	 * This value must be valid on the first BD of a packet.
14070 	 */
14071 	#define PUSH32_DOORBELL_MSS_MASK UINT32_C(0x7fff)
14072 	#define PUSH32_DOORBELL_MSS_SFT 0
14073 	uint16_t	unused_2;
14074 	/*
14075 	 * This value selects a CFA action to perform on the packet.
14076 	 * Set this value to zero if no CFA action is desired.
14077 	 *
14078 	 * This value must be valid on the first BD of a packet.
14079 	 */
14080 	uint16_t	cfa_action;
14081 	/*
14082 	 * This value is action meta-data that defines CFA edit operations
14083 	 * that are done in addition to any action editing.
14084 	 */
14085 	uint32_t	cfa_meta;
14086 	/* When key=1, This is the VLAN tag VID value. */
14087 	#define PUSH32_DOORBELL_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
14088 	#define PUSH32_DOORBELL_CFA_META_VLAN_VID_SFT	0
14089 	/* When key=1, This is the VLAN tag DE value. */
14090 	#define PUSH32_DOORBELL_CFA_META_VLAN_DE	UINT32_C(0x1000)
14091 	/* When key=1, This is the VLAN tag PRI value. */
14092 	#define PUSH32_DOORBELL_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
14093 	#define PUSH32_DOORBELL_CFA_META_VLAN_PRI_SFT	13
14094 	/* When key=1, This is the VLAN tag TPID select value. */
14095 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
14096 	#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_SFT	16
14097 	/* 0x88a8 */
14098 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID88A8  (UINT32_C(0x0) << 16)
14099 	/* 0x8100 */
14100 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID8100  (UINT32_C(0x1) << 16)
14101 	/* 0x9100 */
14102 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID9100  (UINT32_C(0x2) << 16)
14103 	/* 0x9200 */
14104 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID9200  (UINT32_C(0x3) << 16)
14105 	/* 0x9300 */
14106 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPID9300  (UINT32_C(0x4) << 16)
14107 	/* Value programmed in CFA VLANTPID register. */
14108 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPIDCFG   (UINT32_C(0x5) << 16)
14109 		#define PUSH32_DOORBELL_CFA_META_VLAN_TPID_LAST	PUSH32_DOORBELL_CFA_META_VLAN_TPID_TPIDCFG
14110 	/* When key=1, This is the VLAN tag TPID select value. */
14111 	#define PUSH32_DOORBELL_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
14112 	#define PUSH32_DOORBELL_CFA_META_VLAN_RESERVED_SFT 19
14113 	/*
14114 	 * This field identifies the type of edit to be performed
14115 	 * on the packet.
14116 	 *
14117 	 * This value must be valid on the first BD of a packet.
14118 	 */
14119 	#define PUSH32_DOORBELL_CFA_META_KEY_MASK	UINT32_C(0xf0000000)
14120 	#define PUSH32_DOORBELL_CFA_META_KEY_SFT	28
14121 	/* No editing */
14122 		#define PUSH32_DOORBELL_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
14123 	/*
14124 	 * - meta[17:16] - TPID select value (0 = 0x8100).
14125 	 * - meta[15:12] - PRI/DE value.
14126 	 * - meta[11:0] - VID value.
14127 	 */
14128 		#define PUSH32_DOORBELL_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
14129 		#define PUSH32_DOORBELL_CFA_META_KEY_LAST	PUSH32_DOORBELL_CFA_META_KEY_VLAN_TAG
14130 	/*
14131 	 * This is the data for the push packet. If the packet
14132 	 * data does not fit in the first pass, data writing
14133 	 * can continue at offset 4 of the doorbell for up to 4 additional
14134 	 * passes for a total data size of 512B maximum.
14135 	 */
14136 	uint32_t	data[25];
14137 } push32_doorbell_t, *ppush32_doorbell_t;
14138 
14139 /*******************
14140  * hwrm_func_reset *
14141  *******************/
14142 
14143 
14144 /* hwrm_func_reset_input (size:192b/24B) */
14145 
14146 typedef struct hwrm_func_reset_input {
14147 	/* The HWRM command request type. */
14148 	uint16_t	req_type;
14149 	/*
14150 	 * The completion ring to send the completion event on. This should
14151 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
14152 	 */
14153 	uint16_t	cmpl_ring;
14154 	/*
14155 	 * The sequence ID is used by the driver for tracking multiple
14156 	 * commands. This ID is treated as opaque data by the firmware and
14157 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
14158 	 */
14159 	uint16_t	seq_id;
14160 	/*
14161 	 * The target ID of the command:
14162 	 * * 0x0-0xFFF8 - The function ID
14163 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14164 	 * * 0xFFFD - Reserved for user-space HWRM interface
14165 	 * * 0xFFFF - HWRM
14166 	 */
14167 	uint16_t	target_id;
14168 	/*
14169 	 * A physical address pointer pointing to a host buffer that the
14170 	 * command's response data will be written. This can be either a host
14171 	 * physical address (HPA) or a guest physical address (GPA) and must
14172 	 * point to a physically contiguous block of memory.
14173 	 */
14174 	uint64_t	resp_addr;
14175 	uint32_t	enables;
14176 	/*
14177 	 * This bit must be '1' for the vf_id_valid field to be
14178 	 * configured.
14179 	 */
14180 	#define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID	UINT32_C(0x1)
14181 	/*
14182 	 * The ID of the VF that this PF is trying to reset.
14183 	 * Only the parent PF shall be allowed to reset a child VF.
14184 	 *
14185 	 * A parent PF driver shall use this field only when a specific child
14186 	 * VF is requested to be reset.
14187 	 */
14188 	uint16_t	vf_id;
14189 	/* This value indicates the level of a function reset. */
14190 	uint8_t	func_reset_level;
14191 	/*
14192 	 * Reset the caller function and its children VFs (if any). If no
14193 	 * children functions exist, then reset the caller function only.
14194 	 */
14195 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL	UINT32_C(0x0)
14196 	/* Reset the caller function only */
14197 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME	UINT32_C(0x1)
14198 	/*
14199 	 * Reset all children VFs of the caller function driver if the
14200 	 * caller is a PF driver.
14201 	 * It is an error to specify this level by a VF driver.
14202 	 * It is an error to specify this level by a PF driver with
14203 	 * no children VFs.
14204 	 */
14205 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN UINT32_C(0x2)
14206 	/*
14207 	 * Reset a specific VF of the caller function driver if the caller
14208 	 * is the parent PF driver.
14209 	 * It is an error to specify this level by a VF driver.
14210 	 * It is an error to specify this level by a PF driver that is not
14211 	 * the parent of the VF that is being requested to reset.
14212 	 */
14213 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF	UINT32_C(0x3)
14214 	#define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_LAST	HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF
14215 	uint8_t	unused_0;
14216 } hwrm_func_reset_input_t, *phwrm_func_reset_input_t;
14217 
14218 /* hwrm_func_reset_output (size:128b/16B) */
14219 
14220 typedef struct hwrm_func_reset_output {
14221 	/* The specific error status for the command. */
14222 	uint16_t	error_code;
14223 	/* The HWRM command request type. */
14224 	uint16_t	req_type;
14225 	/* The sequence ID from the original command. */
14226 	uint16_t	seq_id;
14227 	/* The length of the response data in number of bytes. */
14228 	uint16_t	resp_len;
14229 	uint8_t	unused_0[7];
14230 	/*
14231 	 * This field is used in Output records to indicate that the output
14232 	 * is completely written to RAM. This field should be read as '1'
14233 	 * to indicate that the output has been completely written. When
14234 	 * writing a command completion or response to an internal processor,
14235 	 * the order of writes has to be such that this field is written last.
14236 	 */
14237 	uint8_t	valid;
14238 } hwrm_func_reset_output_t, *phwrm_func_reset_output_t;
14239 
14240 /********************
14241  * hwrm_func_getfid *
14242  ********************/
14243 
14244 
14245 /* hwrm_func_getfid_input (size:192b/24B) */
14246 
14247 typedef struct hwrm_func_getfid_input {
14248 	/* The HWRM command request type. */
14249 	uint16_t	req_type;
14250 	/*
14251 	 * The completion ring to send the completion event on. This should
14252 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
14253 	 */
14254 	uint16_t	cmpl_ring;
14255 	/*
14256 	 * The sequence ID is used by the driver for tracking multiple
14257 	 * commands. This ID is treated as opaque data by the firmware and
14258 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
14259 	 */
14260 	uint16_t	seq_id;
14261 	/*
14262 	 * The target ID of the command:
14263 	 * * 0x0-0xFFF8 - The function ID
14264 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14265 	 * * 0xFFFD - Reserved for user-space HWRM interface
14266 	 * * 0xFFFF - HWRM
14267 	 */
14268 	uint16_t	target_id;
14269 	/*
14270 	 * A physical address pointer pointing to a host buffer that the
14271 	 * command's response data will be written. This can be either a host
14272 	 * physical address (HPA) or a guest physical address (GPA) and must
14273 	 * point to a physically contiguous block of memory.
14274 	 */
14275 	uint64_t	resp_addr;
14276 	uint32_t	enables;
14277 	/*
14278 	 * This bit must be '1' for the pci_id field to be
14279 	 * configured.
14280 	 */
14281 	#define HWRM_FUNC_GETFID_INPUT_ENABLES_PCI_ID	UINT32_C(0x1)
14282 	/*
14283 	 * This value is the PCI ID of the queried function.
14284 	 * If ARI is enabled, then it is
14285 	 * Bus Number (8b):Function Number(8b). Otherwise, it is
14286 	 * Bus Number (8b):Device Number (5b):Function Number(3b).
14287 	 */
14288 	uint16_t	pci_id;
14289 	uint8_t	unused_0[2];
14290 } hwrm_func_getfid_input_t, *phwrm_func_getfid_input_t;
14291 
14292 /* hwrm_func_getfid_output (size:128b/16B) */
14293 
14294 typedef struct hwrm_func_getfid_output {
14295 	/* The specific error status for the command. */
14296 	uint16_t	error_code;
14297 	/* The HWRM command request type. */
14298 	uint16_t	req_type;
14299 	/* The sequence ID from the original command. */
14300 	uint16_t	seq_id;
14301 	/* The length of the response data in number of bytes. */
14302 	uint16_t	resp_len;
14303 	/*
14304 	 * FID value. This value is used to identify operations on the PCI
14305 	 * bus as belonging to a particular PCI function.
14306 	 */
14307 	uint16_t	fid;
14308 	uint8_t	unused_0[5];
14309 	/*
14310 	 * This field is used in Output records to indicate that the output
14311 	 * is completely written to RAM. This field should be read as '1'
14312 	 * to indicate that the output has been completely written. When
14313 	 * writing a command completion or response to an internal processor,
14314 	 * the order of writes has to be such that this field is written last.
14315 	 */
14316 	uint8_t	valid;
14317 } hwrm_func_getfid_output_t, *phwrm_func_getfid_output_t;
14318 
14319 /**********************
14320  * hwrm_func_vf_alloc *
14321  **********************/
14322 
14323 
14324 /* hwrm_func_vf_alloc_input (size:192b/24B) */
14325 
14326 typedef struct hwrm_func_vf_alloc_input {
14327 	/* The HWRM command request type. */
14328 	uint16_t	req_type;
14329 	/*
14330 	 * The completion ring to send the completion event on. This should
14331 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
14332 	 */
14333 	uint16_t	cmpl_ring;
14334 	/*
14335 	 * The sequence ID is used by the driver for tracking multiple
14336 	 * commands. This ID is treated as opaque data by the firmware and
14337 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
14338 	 */
14339 	uint16_t	seq_id;
14340 	/*
14341 	 * The target ID of the command:
14342 	 * * 0x0-0xFFF8 - The function ID
14343 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14344 	 * * 0xFFFD - Reserved for user-space HWRM interface
14345 	 * * 0xFFFF - HWRM
14346 	 */
14347 	uint16_t	target_id;
14348 	/*
14349 	 * A physical address pointer pointing to a host buffer that the
14350 	 * command's response data will be written. This can be either a host
14351 	 * physical address (HPA) or a guest physical address (GPA) and must
14352 	 * point to a physically contiguous block of memory.
14353 	 */
14354 	uint64_t	resp_addr;
14355 	uint32_t	enables;
14356 	/*
14357 	 * This bit must be '1' for the first_vf_id field to be
14358 	 * configured.
14359 	 */
14360 	#define HWRM_FUNC_VF_ALLOC_INPUT_ENABLES_FIRST_VF_ID	UINT32_C(0x1)
14361 	/*
14362 	 * This value is used to identify a Virtual Function (VF).
14363 	 * The scope of VF ID is local within a PF.
14364 	 */
14365 	uint16_t	first_vf_id;
14366 	/* The number of virtual functions requested. */
14367 	uint16_t	num_vfs;
14368 } hwrm_func_vf_alloc_input_t, *phwrm_func_vf_alloc_input_t;
14369 
14370 /* hwrm_func_vf_alloc_output (size:128b/16B) */
14371 
14372 typedef struct hwrm_func_vf_alloc_output {
14373 	/* The specific error status for the command. */
14374 	uint16_t	error_code;
14375 	/* The HWRM command request type. */
14376 	uint16_t	req_type;
14377 	/* The sequence ID from the original command. */
14378 	uint16_t	seq_id;
14379 	/* The length of the response data in number of bytes. */
14380 	uint16_t	resp_len;
14381 	/* The ID of the first VF allocated. */
14382 	uint16_t	first_vf_id;
14383 	uint8_t	unused_0[5];
14384 	/*
14385 	 * This field is used in Output records to indicate that the output
14386 	 * is completely written to RAM. This field should be read as '1'
14387 	 * to indicate that the output has been completely written. When
14388 	 * writing a command completion or response to an internal processor,
14389 	 * the order of writes has to be such that this field is written last.
14390 	 */
14391 	uint8_t	valid;
14392 } hwrm_func_vf_alloc_output_t, *phwrm_func_vf_alloc_output_t;
14393 
14394 /*********************
14395  * hwrm_func_vf_free *
14396  *********************/
14397 
14398 
14399 /* hwrm_func_vf_free_input (size:192b/24B) */
14400 
14401 typedef struct hwrm_func_vf_free_input {
14402 	/* The HWRM command request type. */
14403 	uint16_t	req_type;
14404 	/*
14405 	 * The completion ring to send the completion event on. This should
14406 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
14407 	 */
14408 	uint16_t	cmpl_ring;
14409 	/*
14410 	 * The sequence ID is used by the driver for tracking multiple
14411 	 * commands. This ID is treated as opaque data by the firmware and
14412 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
14413 	 */
14414 	uint16_t	seq_id;
14415 	/*
14416 	 * The target ID of the command:
14417 	 * * 0x0-0xFFF8 - The function ID
14418 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14419 	 * * 0xFFFD - Reserved for user-space HWRM interface
14420 	 * * 0xFFFF - HWRM
14421 	 */
14422 	uint16_t	target_id;
14423 	/*
14424 	 * A physical address pointer pointing to a host buffer that the
14425 	 * command's response data will be written. This can be either a host
14426 	 * physical address (HPA) or a guest physical address (GPA) and must
14427 	 * point to a physically contiguous block of memory.
14428 	 */
14429 	uint64_t	resp_addr;
14430 	uint32_t	enables;
14431 	/*
14432 	 * This bit must be '1' for the first_vf_id field to be
14433 	 * configured.
14434 	 */
14435 	#define HWRM_FUNC_VF_FREE_INPUT_ENABLES_FIRST_VF_ID	UINT32_C(0x1)
14436 	/*
14437 	 * This value is used to identify a Virtual Function (VF).
14438 	 * The scope of VF ID is local within a PF.
14439 	 */
14440 	uint16_t	first_vf_id;
14441 	/*
14442 	 * The number of virtual functions requested.
14443 	 * 0xFFFF - Cleanup all children of this PF.
14444 	 */
14445 	uint16_t	num_vfs;
14446 } hwrm_func_vf_free_input_t, *phwrm_func_vf_free_input_t;
14447 
14448 /* hwrm_func_vf_free_output (size:128b/16B) */
14449 
14450 typedef struct hwrm_func_vf_free_output {
14451 	/* The specific error status for the command. */
14452 	uint16_t	error_code;
14453 	/* The HWRM command request type. */
14454 	uint16_t	req_type;
14455 	/* The sequence ID from the original command. */
14456 	uint16_t	seq_id;
14457 	/* The length of the response data in number of bytes. */
14458 	uint16_t	resp_len;
14459 	uint8_t	unused_0[7];
14460 	/*
14461 	 * This field is used in Output records to indicate that the output
14462 	 * is completely written to RAM. This field should be read as '1'
14463 	 * to indicate that the output has been completely written. When
14464 	 * writing a command completion or response to an internal processor,
14465 	 * the order of writes has to be such that this field is written last.
14466 	 */
14467 	uint8_t	valid;
14468 } hwrm_func_vf_free_output_t, *phwrm_func_vf_free_output_t;
14469 
14470 /********************
14471  * hwrm_func_vf_cfg *
14472  ********************/
14473 
14474 
14475 /* hwrm_func_vf_cfg_input (size:576b/72B) */
14476 
14477 typedef struct hwrm_func_vf_cfg_input {
14478 	/* The HWRM command request type. */
14479 	uint16_t	req_type;
14480 	/*
14481 	 * The completion ring to send the completion event on. This should
14482 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
14483 	 */
14484 	uint16_t	cmpl_ring;
14485 	/*
14486 	 * The sequence ID is used by the driver for tracking multiple
14487 	 * commands. This ID is treated as opaque data by the firmware and
14488 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
14489 	 */
14490 	uint16_t	seq_id;
14491 	/*
14492 	 * The target ID of the command:
14493 	 * * 0x0-0xFFF8 - The function ID
14494 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14495 	 * * 0xFFFD - Reserved for user-space HWRM interface
14496 	 * * 0xFFFF - HWRM
14497 	 */
14498 	uint16_t	target_id;
14499 	/*
14500 	 * A physical address pointer pointing to a host buffer that the
14501 	 * command's response data will be written. This can be either a host
14502 	 * physical address (HPA) or a guest physical address (GPA) and must
14503 	 * point to a physically contiguous block of memory.
14504 	 */
14505 	uint64_t	resp_addr;
14506 	uint32_t	enables;
14507 	/*
14508 	 * This bit must be '1' for the mtu field to be
14509 	 * configured.
14510 	 */
14511 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU			UINT32_C(0x1)
14512 	/*
14513 	 * This bit must be '1' for the guest_vlan field to be
14514 	 * configured.
14515 	 */
14516 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN		UINT32_C(0x2)
14517 	/*
14518 	 * This bit must be '1' for the async_event_cr field to be
14519 	 * configured.
14520 	 */
14521 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR	UINT32_C(0x4)
14522 	/*
14523 	 * This bit must be '1' for the dflt_mac_addr field to be
14524 	 * configured.
14525 	 */
14526 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR		UINT32_C(0x8)
14527 	/*
14528 	 * This bit must be '1' for the num_rsscos_ctxs field to be
14529 	 * configured.
14530 	 */
14531 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS	UINT32_C(0x10)
14532 	/*
14533 	 * This bit must be '1' for the num_cmpl_rings field to be
14534 	 * configured.
14535 	 */
14536 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_CMPL_RINGS	UINT32_C(0x20)
14537 	/*
14538 	 * This bit must be '1' for the num_tx_rings field to be
14539 	 * configured.
14540 	 */
14541 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_RINGS		UINT32_C(0x40)
14542 	/*
14543 	 * This bit must be '1' for the num_rx_rings field to be
14544 	 * configured.
14545 	 */
14546 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_RINGS		UINT32_C(0x80)
14547 	/*
14548 	 * This bit must be '1' for the num_l2_ctxs field to be
14549 	 * configured.
14550 	 */
14551 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_L2_CTXS		UINT32_C(0x100)
14552 	/*
14553 	 * This bit must be '1' for the num_vnics field to be
14554 	 * configured.
14555 	 */
14556 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_VNICS		UINT32_C(0x200)
14557 	/*
14558 	 * This bit must be '1' for the num_stat_ctxs field to be
14559 	 * configured.
14560 	 */
14561 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_STAT_CTXS		UINT32_C(0x400)
14562 	/*
14563 	 * This bit must be '1' for the num_hw_ring_grps field to be
14564 	 * configured.
14565 	 */
14566 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS	UINT32_C(0x800)
14567 	/*
14568 	 * This bit must be '1' for the num_ktls_tx_key_ctxs field to
14569 	 * be configured.
14570 	 */
14571 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_KTLS_TX_KEY_CTXS	UINT32_C(0x1000)
14572 	/*
14573 	 * This bit must be '1' for the num_ktls_rx_key_ctxs field to
14574 	 * be configured.
14575 	 */
14576 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_KTLS_RX_KEY_CTXS	UINT32_C(0x2000)
14577 	/*
14578 	 * This bit must be '1' for the num_quic_tx_key_ctxs field to
14579 	 * be configured.
14580 	 */
14581 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_QUIC_TX_KEY_CTXS	UINT32_C(0x4000)
14582 	/*
14583 	 * This bit must be '1' for the num_quic_rx_key_ctxs field to
14584 	 * be configured.
14585 	 */
14586 	#define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_QUIC_RX_KEY_CTXS	UINT32_C(0x8000)
14587 	/*
14588 	 * The maximum transmission unit requested on the function.
14589 	 * The HWRM should make sure that the mtu of
14590 	 * the function does not exceed the mtu of the physical
14591 	 * port that this function is associated with.
14592 	 *
14593 	 * In addition to requesting mtu per function, it is
14594 	 * possible to configure mtu per transmit ring.
14595 	 * By default, the mtu of each transmit ring associated
14596 	 * with a function is equal to the mtu of the function.
14597 	 * The HWRM should make sure that the mtu of each transmit
14598 	 * ring that is assigned to a function has a valid mtu.
14599 	 */
14600 	uint16_t	mtu;
14601 	/*
14602 	 * The guest VLAN for the function being configured.
14603 	 * This field's format is same as 802.1Q Tag's
14604 	 * Tag Control Information (TCI) format that includes both
14605 	 * Priority Code Point (PCP) and VLAN Identifier (VID).
14606 	 */
14607 	uint16_t	guest_vlan;
14608 	/*
14609 	 * ID of the target completion ring for receiving asynchronous
14610 	 * event completions. If this field is not valid, then the
14611 	 * HWRM shall use the default completion ring of the function
14612 	 * that is being configured as the target completion ring for
14613 	 * providing any asynchronous event completions for that
14614 	 * function.
14615 	 * If this field is valid, then the HWRM shall use the
14616 	 * completion ring identified by this ID as the target
14617 	 * completion ring for providing any asynchronous event
14618 	 * completions for the function that is being configured.
14619 	 */
14620 	uint16_t	async_event_cr;
14621 	/*
14622 	 * This value is the current MAC address requested by the VF
14623 	 * driver to be configured on this VF. A value of
14624 	 * 00-00-00-00-00-00 indicates no MAC address configuration
14625 	 * is requested by the VF driver.
14626 	 * The parent PF driver may reject or overwrite this
14627 	 * MAC address.
14628 	 */
14629 	uint8_t	dflt_mac_addr[6];
14630 	uint32_t	flags;
14631 	/*
14632 	 * This bit requests that the firmware test to see if all the assets
14633 	 * requested in this command (i.e. number of TX rings) are available.
14634 	 * The firmware will return an error if the requested assets are
14635 	 * not available. The firmware will NOT reserve the assets if they
14636 	 * are available.
14637 	 */
14638 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_TX_ASSETS_TEST		UINT32_C(0x1)
14639 	/*
14640 	 * This bit requests that the firmware test to see if all the assets
14641 	 * requested in this command (i.e. number of RX rings) are available.
14642 	 * The firmware will return an error if the requested assets are
14643 	 * not available. The firmware will NOT reserve the assets if they
14644 	 * are available.
14645 	 */
14646 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RX_ASSETS_TEST		UINT32_C(0x2)
14647 	/*
14648 	 * This bit requests that the firmware test to see if all the assets
14649 	 * requested in this command (i.e. number of CMPL rings) are
14650 	 * available. The firmware will return an error if the requested
14651 	 * assets are not available. The firmware will NOT reserve the assets
14652 	 * if they are available.
14653 	 */
14654 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST	UINT32_C(0x4)
14655 	/*
14656 	 * This bit requests that the firmware test to see if all the assets
14657 	 * requested in this command (i.e. number of RSS ctx) are available.
14658 	 * The firmware will return an error if the requested assets are
14659 	 * not available. The firmware will NOT reserve the assets if they
14660 	 * are available.
14661 	 */
14662 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST	UINT32_C(0x8)
14663 	/*
14664 	 * This bit requests that the firmware test to see if all the assets
14665 	 * requested in this command (i.e. number of ring groups) are
14666 	 * available. The firmware will return an error if the requested
14667 	 * assets are not available. The firmware will NOT reserve the assets
14668 	 * if they are available.
14669 	 */
14670 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST	UINT32_C(0x10)
14671 	/*
14672 	 * This bit requests that the firmware test to see if all the assets
14673 	 * requested in this command (i.e. number of stat ctx) are available.
14674 	 * The firmware will return an error if the requested assets are
14675 	 * not available. The firmware will NOT reserve the assets if they
14676 	 * are available.
14677 	 */
14678 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST	UINT32_C(0x20)
14679 	/*
14680 	 * This bit requests that the firmware test to see if all the assets
14681 	 * requested in this command (i.e. number of VNICs) are available.
14682 	 * The firmware will return an error if the requested assets are
14683 	 * not available. The firmware will NOT reserve the assets if they
14684 	 * are available.
14685 	 */
14686 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST	UINT32_C(0x40)
14687 	/*
14688 	 * This bit requests that the firmware test to see if all the assets
14689 	 * requested in this command (i.e. number of L2 ctx) are available.
14690 	 * The firmware will return an error if the requested assets are
14691 	 * not available. The firmware will NOT reserve the assets if they
14692 	 * are available.
14693 	 */
14694 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST	UINT32_C(0x80)
14695 	/*
14696 	 * If this bit is set to 1, the VF driver is requesting FW to enable
14697 	 * PPP TX PUSH feature on all the TX rings specified in the
14698 	 * num_tx_rings field. By default, the PPP TX push feature is
14699 	 * disabled for all the TX rings of the VF. This flag is ignored if
14700 	 * the num_tx_rings field is not specified or the VF doesn't support
14701 	 * PPP tx push feature.
14702 	 */
14703 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_PPP_PUSH_MODE_ENABLE	UINT32_C(0x100)
14704 	/*
14705 	 * If this bit is set to 1, the VF driver is requesting FW to disable
14706 	 * PPP TX PUSH feature on all the TX rings of the VF. This flag is
14707 	 * ignored if the VF doesn't support PPP tx push feature.
14708 	 */
14709 	#define HWRM_FUNC_VF_CFG_INPUT_FLAGS_PPP_PUSH_MODE_DISABLE	UINT32_C(0x200)
14710 	/* The number of RSS/COS contexts requested for the VF. */
14711 	uint16_t	num_rsscos_ctxs;
14712 	/* The number of completion rings requested for the VF. */
14713 	uint16_t	num_cmpl_rings;
14714 	/* The number of transmit rings requested for the VF. */
14715 	uint16_t	num_tx_rings;
14716 	/* The number of receive rings requested for the VF. */
14717 	uint16_t	num_rx_rings;
14718 	/* The number of L2 contexts requested for the VF. */
14719 	uint16_t	num_l2_ctxs;
14720 	/* The number of vnics requested for the VF. */
14721 	uint16_t	num_vnics;
14722 	/* The number of statistic contexts requested for the VF. */
14723 	uint16_t	num_stat_ctxs;
14724 	/* The number of HW ring groups requested for the VF. */
14725 	uint16_t	num_hw_ring_grps;
14726 	/* Number of KTLS Tx Key Contexts requested. */
14727 	uint32_t	num_ktls_tx_key_ctxs;
14728 	/* Number of KTLS Rx Key Contexts requested. */
14729 	uint32_t	num_ktls_rx_key_ctxs;
14730 	/* The number of MSI-X vectors requested for the VF. */
14731 	uint16_t	num_msix;
14732 	uint8_t	unused[2];
14733 	/* Number of QUIC Tx Key Contexts requested. */
14734 	uint32_t	num_quic_tx_key_ctxs;
14735 	/* Number of QUIC Rx Key Contexts requested. */
14736 	uint32_t	num_quic_rx_key_ctxs;
14737 } hwrm_func_vf_cfg_input_t, *phwrm_func_vf_cfg_input_t;
14738 
14739 /* hwrm_func_vf_cfg_output (size:128b/16B) */
14740 
14741 typedef struct hwrm_func_vf_cfg_output {
14742 	/* The specific error status for the command. */
14743 	uint16_t	error_code;
14744 	/* The HWRM command request type. */
14745 	uint16_t	req_type;
14746 	/* The sequence ID from the original command. */
14747 	uint16_t	seq_id;
14748 	/* The length of the response data in number of bytes. */
14749 	uint16_t	resp_len;
14750 	uint8_t	unused_0[7];
14751 	/*
14752 	 * This field is used in Output records to indicate that the output
14753 	 * is completely written to RAM. This field should be read as '1'
14754 	 * to indicate that the output has been completely written. When
14755 	 * writing a command completion or response to an internal processor,
14756 	 * the order of writes has to be such that this field is written last.
14757 	 */
14758 	uint8_t	valid;
14759 } hwrm_func_vf_cfg_output_t, *phwrm_func_vf_cfg_output_t;
14760 
14761 /*******************
14762  * hwrm_func_qcaps *
14763  *******************/
14764 
14765 
14766 /* hwrm_func_qcaps_input (size:192b/24B) */
14767 
14768 typedef struct hwrm_func_qcaps_input {
14769 	/* The HWRM command request type. */
14770 	uint16_t	req_type;
14771 	/*
14772 	 * The completion ring to send the completion event on. This should
14773 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
14774 	 */
14775 	uint16_t	cmpl_ring;
14776 	/*
14777 	 * The sequence ID is used by the driver for tracking multiple
14778 	 * commands. This ID is treated as opaque data by the firmware and
14779 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
14780 	 */
14781 	uint16_t	seq_id;
14782 	/*
14783 	 * The target ID of the command:
14784 	 * * 0x0-0xFFF8 - The function ID
14785 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14786 	 * * 0xFFFD - Reserved for user-space HWRM interface
14787 	 * * 0xFFFF - HWRM
14788 	 */
14789 	uint16_t	target_id;
14790 	/*
14791 	 * A physical address pointer pointing to a host buffer that the
14792 	 * command's response data will be written. This can be either a host
14793 	 * physical address (HPA) or a guest physical address (GPA) and must
14794 	 * point to a physically contiguous block of memory.
14795 	 */
14796 	uint64_t	resp_addr;
14797 	/*
14798 	 * Function ID of the function that is being queried.
14799 	 * 0xFF... (All Fs) if the query is for the requesting
14800 	 * function.
14801 	 * 0xFFFE (REQUESTING_PARENT_FID) This is a special FID
14802 	 * to be used by a trusted VF to query its parent PF.
14803 	 */
14804 	uint16_t	fid;
14805 	uint8_t	unused_0[6];
14806 } hwrm_func_qcaps_input_t, *phwrm_func_qcaps_input_t;
14807 
14808 /* hwrm_func_qcaps_output (size:1152b/144B) */
14809 
14810 typedef struct hwrm_func_qcaps_output {
14811 	/* The specific error status for the command. */
14812 	uint16_t	error_code;
14813 	/* The HWRM command request type. */
14814 	uint16_t	req_type;
14815 	/* The sequence ID from the original command. */
14816 	uint16_t	seq_id;
14817 	/* The length of the response data in number of bytes. */
14818 	uint16_t	resp_len;
14819 	/*
14820 	 * FID value. This value is used to identify operations on the PCI
14821 	 * bus as belonging to a particular PCI function.
14822 	 */
14823 	uint16_t	fid;
14824 	/*
14825 	 * Port ID of port that this function is associated with.
14826 	 * Valid only for the PF.
14827 	 * 0xFF... (All Fs) if this function is not associated with
14828 	 * any port.
14829 	 * 0xFF... (All Fs) if this function is called from a VF.
14830 	 */
14831 	uint16_t	port_id;
14832 	uint32_t	flags;
14833 	/* If 1, then Push mode is supported on this function. */
14834 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED		UINT32_C(0x1)
14835 	/*
14836 	 * If 1, then the global MSI-X auto-masking is enabled for the
14837 	 * device.
14838 	 */
14839 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING		UINT32_C(0x2)
14840 	/*
14841 	 * If 1, then the Precision Time Protocol (PTP) processing
14842 	 * is supported on this function.
14843 	 * The HWRM should enable PTP on only a single Physical
14844 	 * Function (PF) per port.
14845 	 */
14846 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED			UINT32_C(0x4)
14847 	/*
14848 	 * If 1, then RDMA over Converged Ethernet (RoCE) v1
14849 	 * is supported on this function.
14850 	 */
14851 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED			UINT32_C(0x8)
14852 	/*
14853 	 * If 1, then RDMA over Converged Ethernet (RoCE) v2
14854 	 * is supported on this function.
14855 	 */
14856 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED			UINT32_C(0x10)
14857 	/*
14858 	 * If 1, then control and configuration of WoL magic packet
14859 	 * are supported on this function.
14860 	 */
14861 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED		UINT32_C(0x20)
14862 	/*
14863 	 * If 1, then control and configuration of bitmap pattern
14864 	 * packet are supported on this function.
14865 	 */
14866 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED			UINT32_C(0x40)
14867 	/*
14868 	 * If set to 1, then the control and configuration of rate limit
14869 	 * of an allocated TX ring on the queried function is supported.
14870 	 */
14871 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED		UINT32_C(0x80)
14872 	/*
14873 	 * If 1, then control and configuration of minimum and
14874 	 * maximum bandwidths are supported on the queried function.
14875 	 */
14876 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED		UINT32_C(0x100)
14877 	/*
14878 	 * If the query is for a VF, then this flag shall be ignored.
14879 	 * If this query is for a PF and this flag is set to 1,
14880 	 * then the PF has the capability to set the rate limits
14881 	 * on the TX rings of its children VFs.
14882 	 * If this query is for a PF and this flag is set to 0, then
14883 	 * the PF does not have the capability to set the rate limits
14884 	 * on the TX rings of its children VFs.
14885 	 */
14886 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED		UINT32_C(0x200)
14887 	/*
14888 	 * If the query is for a VF, then this flag shall be ignored.
14889 	 * If this query is for a PF and this flag is set to 1,
14890 	 * then the PF has the capability to set the minimum and/or
14891 	 * maximum bandwidths for its children VFs.
14892 	 * If this query is for a PF and this flag is set to 0, then
14893 	 * the PF does not have the capability to set the minimum or
14894 	 * maximum bandwidths for its children VFs.
14895 	 */
14896 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED		UINT32_C(0x400)
14897 	/*
14898 	 * Standard TX Ring mode is used for the allocation of TX ring
14899 	 * and underlying scheduling resources that allow bandwidth
14900 	 * reservation and limit settings on the queried function.
14901 	 * If set to 1, then standard TX ring mode is supported
14902 	 * on the queried function.
14903 	 * If set to 0, then standard TX ring mode is not available
14904 	 * on the queried function.
14905 	 */
14906 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED		UINT32_C(0x800)
14907 	/*
14908 	 * If the query is for a VF, then this flag shall be ignored,
14909 	 * If this query is for a PF and this flag is set to 1,
14910 	 * then the PF has the capability to detect GENEVE tunnel
14911 	 * flags.
14912 	 */
14913 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GENEVE_TUN_FLAGS_SUPPORTED		UINT32_C(0x1000)
14914 	/*
14915 	 * If the query is for a VF, then this flag shall be ignored,
14916 	 * If this query is for a PF and this flag is set to 1,
14917 	 * then the PF has the capability to detect NVGRE tunnel
14918 	 * flags.
14919 	 */
14920 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NVGRE_TUN_FLAGS_SUPPORTED		UINT32_C(0x2000)
14921 	/*
14922 	 * If the query is for a VF, then this flag shall be ignored,
14923 	 * If this query is for a PF and this flag is set to 1,
14924 	 * then the PF has the capability to detect GRE tunnel
14925 	 * flags.
14926 	 */
14927 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GRE_TUN_FLAGS_SUPPORTED		UINT32_C(0x4000)
14928 	/*
14929 	 * If the query is for a VF, then this flag shall be ignored,
14930 	 * If this query is for a PF and this flag is set to 1,
14931 	 * then the PF has the capability to detect MPLS tunnel
14932 	 * flags.
14933 	 */
14934 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_MPLS_TUN_FLAGS_SUPPORTED		UINT32_C(0x8000)
14935 	/*
14936 	 * If the query is for a VF, then this flag shall be ignored,
14937 	 * If this query is for a PF and this flag is set to 1,
14938 	 * then the PF has the capability to support pcie stats.
14939 	 */
14940 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PCIE_STATS_SUPPORTED		UINT32_C(0x10000)
14941 	/*
14942 	 * If the query is for a VF, then this flag shall be ignored,
14943 	 * If this query is for a PF and this flag is set to 1,
14944 	 * then the PF has the capability to adopt the VF's belonging
14945 	 * to another PF.
14946 	 */
14947 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADOPTED_PF_SUPPORTED		UINT32_C(0x20000)
14948 	/*
14949 	 * If the query is for a VF, then this flag shall be ignored,
14950 	 * If this query is for a PF and this flag is set to 1,
14951 	 * then the PF has the administrative privilege to configure another
14952 	 * PF.
14953 	 */
14954 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADMIN_PF_SUPPORTED			UINT32_C(0x40000)
14955 	/*
14956 	 * If the query is for a VF, then this flag shall be ignored.
14957 	 * If this query is for a PF and this flag is set to 1, then
14958 	 * the PF will know that the firmware has the capability to track
14959 	 * the virtual link status.
14960 	 */
14961 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_LINK_ADMIN_STATUS_SUPPORTED	UINT32_C(0x80000)
14962 	/*
14963 	 * If 1, then this function supports the push mode that uses
14964 	 * write combine buffers and the long inline tx buffer descriptor.
14965 	 */
14966 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WCB_PUSH_MODE			UINT32_C(0x100000)
14967 	/*
14968 	 * If 1, then FW has capability to allocate TX rings dynamically
14969 	 * in ring alloc even if PF reserved pool is zero.
14970 	 * This bit will be used only for PFs.
14971 	 */
14972 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DYNAMIC_TX_RING_ALLOC		UINT32_C(0x200000)
14973 	/*
14974 	 * When this bit is '1', it indicates that core firmware is
14975 	 * capable of Hot Reset.
14976 	 */
14977 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE			UINT32_C(0x400000)
14978 	/*
14979 	 * This flag will be set to 1 by the FW if FW supports adapter error
14980 	 * recovery.
14981 	 */
14982 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERROR_RECOVERY_CAPABLE		UINT32_C(0x800000)
14983 	/*
14984 	 * If the query is for a VF, then this flag shall be ignored.
14985 	 * If this query is for a PF and this flag is set to 1, then
14986 	 * the PF has the capability to support extended stats.
14987 	 */
14988 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED		UINT32_C(0x1000000)
14989 	/*
14990 	 * If the query is for a VF, then this flag shall be ignored.
14991 	 * If this query is for a PF and this flag is set to 1, then host
14992 	 * must initiate reset or reload (or fastboot) the firmware image
14993 	 * upon detection of device shutdown state.
14994 	 */
14995 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERR_RECOVER_RELOAD			UINT32_C(0x2000000)
14996 	/*
14997 	 * If the query is for a VF, then this flag (always set to 0) shall
14998 	 * be ignored. If this query is for a PF and this flag is set to 1,
14999 	 * host, when registered for the default vnic change async event,
15000 	 * receives async notification whenever a default vnic state is
15001 	 * changed for any of child or adopted VFs.
15002 	 */
15003 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NOTIFY_VF_DEF_VNIC_CHNG_SUPPORTED	UINT32_C(0x4000000)
15004 	/* If set to 1, then the vlan acceleration for TX is disabled. */
15005 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VLAN_ACCELERATION_TX_DISABLED	UINT32_C(0x8000000)
15006 	/*
15007 	 * When this bit is '1', it indicates that core firmware supports
15008 	 * DBG_COREDUMP_XXX commands.
15009 	 */
15010 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_COREDUMP_CMD_SUPPORTED		UINT32_C(0x10000000)
15011 	/*
15012 	 * When this bit is '1', it indicates that core firmware supports
15013 	 * DBG_CRASHDUMP_XXX commands.
15014 	 */
15015 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_CRASHDUMP_CMD_SUPPORTED		UINT32_C(0x20000000)
15016 	/*
15017 	 * If the query is for a VF, then this flag should be ignored.
15018 	 * If the query is for a PF and this flag is set to 1, then
15019 	 * the PF has the capability to support retrieval of
15020 	 * rx_port_stats_ext_pfc_wd statistics (supported by the PFC
15021 	 * WatchDog feature) via the hwrm_port_qstats_ext_pfc_wd command.
15022 	 * If this flag is set to 1, only that (supported) command should
15023 	 * be used for retrieval of PFC related statistics (rather than
15024 	 * hwrm_port_qstats_ext command, which could previously be used).
15025 	 */
15026 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PFC_WD_STATS_SUPPORTED		UINT32_C(0x40000000)
15027 	/*
15028 	 * When this bit is '1', it indicates that core firmware supports
15029 	 * DBG_QCAPS command
15030 	 */
15031 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DBG_QCAPS_CMD_SUPPORTED		UINT32_C(0x80000000)
15032 	/*
15033 	 * This value is current MAC address configured for this
15034 	 * function. A value of 00-00-00-00-00-00 indicates no
15035 	 * MAC address is currently configured.
15036 	 */
15037 	uint8_t	mac_address[6];
15038 	/*
15039 	 * The maximum number of RSS/COS contexts that can be
15040 	 * allocated to the function.
15041 	 */
15042 	uint16_t	max_rsscos_ctx;
15043 	/*
15044 	 * The maximum number of completion rings that can be
15045 	 * allocated to the function.
15046 	 */
15047 	uint16_t	max_cmpl_rings;
15048 	/*
15049 	 * The maximum number of transmit rings that can be
15050 	 * allocated to the function.
15051 	 */
15052 	uint16_t	max_tx_rings;
15053 	/*
15054 	 * The maximum number of receive rings that can be
15055 	 * allocated to the function.
15056 	 */
15057 	uint16_t	max_rx_rings;
15058 	/*
15059 	 * The maximum number of L2 contexts that can be
15060 	 * allocated to the function.
15061 	 */
15062 	uint16_t	max_l2_ctxs;
15063 	/*
15064 	 * The maximum number of VNICs that can be
15065 	 * allocated to the function.
15066 	 */
15067 	uint16_t	max_vnics;
15068 	/*
15069 	 * The identifier for the first VF enabled on a PF. This
15070 	 * is valid only on the PF with SR-IOV enabled.
15071 	 * 0xFF... (All Fs) if this command is called on a PF with
15072 	 * SR-IOV disabled or on a VF.
15073 	 */
15074 	uint16_t	first_vf_id;
15075 	/*
15076 	 * The maximum number of VFs that can be
15077 	 * allocated to the function. This is valid only on the
15078 	 * PF with SR-IOV enabled. 0xFF... (All Fs) if this
15079 	 * command is called on a PF with SR-IOV disabled or
15080 	 * on a VF.
15081 	 */
15082 	uint16_t	max_vfs;
15083 	/*
15084 	 * The maximum number of statistic contexts that can be
15085 	 * allocated to the function.
15086 	 */
15087 	uint16_t	max_stat_ctx;
15088 	/*
15089 	 * The maximum number of Encapsulation records that can be
15090 	 * offloaded by this function.
15091 	 */
15092 	uint32_t	max_encap_records;
15093 	/*
15094 	 * The maximum number of decapsulation records that can
15095 	 * be offloaded by this function.
15096 	 */
15097 	uint32_t	max_decap_records;
15098 	/*
15099 	 * The maximum number of Exact Match (EM) flows that can be
15100 	 * offloaded by this function on the TX side.
15101 	 */
15102 	uint32_t	max_tx_em_flows;
15103 	/*
15104 	 * The maximum number of Wildcard Match (WM) flows that can
15105 	 * be offloaded by this function on the TX side.
15106 	 */
15107 	uint32_t	max_tx_wm_flows;
15108 	/*
15109 	 * The maximum number of Exact Match (EM) flows that can be
15110 	 * offloaded by this function on the RX side.
15111 	 */
15112 	uint32_t	max_rx_em_flows;
15113 	/*
15114 	 * The maximum number of Wildcard Match (WM) flows that can
15115 	 * be offloaded by this function on the RX side.
15116 	 */
15117 	uint32_t	max_rx_wm_flows;
15118 	/*
15119 	 * The maximum number of multicast filters that can
15120 	 * be supported by this function on the RX side.
15121 	 */
15122 	uint32_t	max_mcast_filters;
15123 	/*
15124 	 * The maximum value of flow_id that can be supported
15125 	 * in completion records.
15126 	 */
15127 	uint32_t	max_flow_id;
15128 	/*
15129 	 * The maximum number of HW ring groups that can be
15130 	 * supported on this function.
15131 	 */
15132 	uint32_t	max_hw_ring_grps;
15133 	/*
15134 	 * The maximum number of strict priority transmit rings
15135 	 * that can be allocated to the function.
15136 	 * This number indicates the maximum number of TX rings
15137 	 * that can be assigned strict priorities out of the
15138 	 * maximum number of TX rings that can be allocated
15139 	 * (max_tx_rings) to the function.
15140 	 */
15141 	uint16_t	max_sp_tx_rings;
15142 	/*
15143 	 * The maximum number of MSI-X vectors that may be allocated across
15144 	 * all VFs for the function. This is valid only on the PF with SR-IOV
15145 	 * enabled. Returns zero if this command is called on a PF with
15146 	 * SR-IOV disabled or on a VF.
15147 	 */
15148 	uint16_t	max_msix_vfs;
15149 	uint32_t	flags_ext;
15150 	/*
15151 	 * If 1, the device can be configured to set the ECN bits in the
15152 	 * IP header of received packets if the receive queue length
15153 	 * exceeds a given threshold.
15154 	 */
15155 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_MARK_SUPPORTED			UINT32_C(0x1)
15156 	/*
15157 	 * If 1, the device can report the number of received packets
15158 	 * that it marked as having experienced congestion.
15159 	 */
15160 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_STATS_SUPPORTED			UINT32_C(0x2)
15161 	/*
15162 	 * If 1, the device can report extended hw statistics (including
15163 	 * additional tpa statistics).
15164 	 */
15165 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EXT_HW_STATS_SUPPORTED			UINT32_C(0x4)
15166 	/*
15167 	 * If set to 1, then the core firmware has support to enable/
15168 	 * disable hot reset support for interface dynamically through
15169 	 * HWRM_FUNC_CFG.
15170 	 */
15171 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_HOT_RESET_IF_SUPPORT			UINT32_C(0x8)
15172 	/* If 1, the proxy mode is supported on this function */
15173 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PROXY_MODE_SUPPORT			UINT32_C(0x10)
15174 	/*
15175 	 * If 1, the tx rings source interface override feature is supported
15176 	 * on this function.
15177 	 */
15178 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_PROXY_SRC_INTF_OVERRIDE_SUPPORT	UINT32_C(0x20)
15179 	/*
15180 	 * If 1, the device supports scheduler queues. SCHQs can be managed
15181 	 * using RING_SCHQ_ALLOC/CFG/FREE commands.
15182 	 */
15183 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_SCHQ_SUPPORTED				UINT32_C(0x40)
15184 	/*
15185 	 * If set to 1, then this function supports the TX push mode that
15186 	 * uses ping-pong buffers from the push pages.
15187 	 */
15188 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PPP_PUSH_MODE_SUPPORTED			UINT32_C(0x80)
15189 	/*
15190 	 * If set to 1, then this function doesn't have the privilege to
15191 	 * configure the EVB mode of the port it uses.
15192 	 */
15193 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EVB_MODE_CFG_NOT_SUPPORTED		UINT32_C(0x100)
15194 	/*
15195 	 * If set to 1, then the HW and FW support the SoC packet DMA
15196 	 * datapath between SoC and NIC. This function can act as the
15197 	 * HWRM communication transport agent on behalf of the SoC SPD
15198 	 * software module. This capability is only advertised to the
15199 	 * SoC PFs.
15200 	 */
15201 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_SOC_SPD_SUPPORTED			UINT32_C(0x200)
15202 	/*
15203 	 * If set to 1, then this function supports FW_LIVEPATCH for
15204 	 * firmware livepatch commands.
15205 	 */
15206 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_FW_LIVEPATCH_SUPPORTED			UINT32_C(0x400)
15207 	/*
15208 	 * When this bit is '1', it indicates that core firmware is
15209 	 * capable of fast Reset.
15210 	 */
15211 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_FAST_RESET_CAPABLE			UINT32_C(0x800)
15212 	/*
15213 	 * When this bit is '1', it indicates that firmware and hardware
15214 	 * are capable of updating tx_metadata via hwrm_ring_cfg command.
15215 	 */
15216 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_METADATA_CFG_CAPABLE			UINT32_C(0x1000)
15217 	/*
15218 	 * If set to 1, then the device can report the action
15219 	 * needed to activate set nvm options.
15220 	 */
15221 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_NVM_OPTION_ACTION_SUPPORTED		UINT32_C(0x2000)
15222 	/*
15223 	 * When this bit is '1', it indicates that the BD metadata feature
15224 	 * is supported for this function.
15225 	 */
15226 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_BD_METADATA_SUPPORTED			UINT32_C(0x4000)
15227 	/*
15228 	 * When this bit is '1', it indicates that the echo request feature
15229 	 * is supported for this function. If the driver registers for the
15230 	 * echo request asynchronous event, then the firmware can send an
15231 	 * unsolicited echo request to the driver and expect an echo
15232 	 * response.
15233 	 */
15234 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECHO_REQUEST_SUPPORTED			UINT32_C(0x8000)
15235 	/*
15236 	 * When this bit is '1', it indicates that core firmware supports
15237 	 * NPAR 1.2 on this function.
15238 	 */
15239 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_NPAR_1_2_SUPPORTED			UINT32_C(0x10000)
15240 	/* When this bit is '1', it indicates that PTM feature is supported. */
15241 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PTP_PTM_SUPPORTED			UINT32_C(0x20000)
15242 	/* When this bit is '1', it indicates that PPS feature is supported. */
15243 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PTP_PPS_SUPPORTED			UINT32_C(0x40000)
15244 	/*
15245 	 * When this bit is '1', it indicates that VF config. change
15246 	 * async event is supported on the parent PF if the async.
15247 	 * event is registered by the PF.
15248 	 */
15249 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_VF_CFG_ASYNC_FOR_PF_SUPPORTED		UINT32_C(0x80000)
15250 	/*
15251 	 * When this bit is '1', the NIC supports configuration of
15252 	 * partition_min_bw and partition_max_bw. Configuration of a
15253 	 * minimum guaranteed bandwidth is only supported if the
15254 	 * min_bw_supported flag is also set.
15255 	 */
15256 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PARTITION_BW_SUPPORTED			UINT32_C(0x100000)
15257 	/*
15258 	 * When this bit is '1', the FW supports configuration of
15259 	 * PCP and TPID values of the default VLAN.
15260 	 */
15261 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_DFLT_VLAN_TPID_PCP_SUPPORTED		UINT32_C(0x200000)
15262 	/* When this bit is '1', it indicates that HW and FW support KTLS. */
15263 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_KTLS_SUPPORTED				UINT32_C(0x400000)
15264 	/*
15265 	 * When this bit is '1', the firmware supports HWRM_PORT_EP_TX_CFG
15266 	 * and HWRM_PORT_EP_TX_QCFG for endpoint rate control, and additions
15267 	 * to HWRM_QUEUE_GLOBAL_CFG and HWRM_QUEUE_GLOBAL_QCFG for receive
15268 	 * rate control. Configuration of a minimum guaranteed bandwidth
15269 	 * is only supported if the min_bw_supported flag is also set.
15270 	 */
15271 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EP_RATE_CONTROL				UINT32_C(0x800000)
15272 	/*
15273 	 * When this bit is '1', the firmware supports enforcement of
15274 	 * minimum guaranteed bandwidth. A minimum guaranteed bandwidth
15275 	 * could be configured for a partition or for an endpoint. Firmware
15276 	 * only sets this flag if one or both of the ep_rate_control and
15277 	 * partition_bw_supported flags are set.
15278 	 */
15279 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_MIN_BW_SUPPORTED				UINT32_C(0x1000000)
15280 	/*
15281 	 * When this bit is '1', HW supports TX coalesced completion
15282 	 * records.
15283 	 */
15284 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_COAL_CMPL_CAP				UINT32_C(0x2000000)
15285 	/*
15286 	 * When this bit is '1', it indicates the FW has full support
15287 	 * for all backing store types with the BACKING_STORE_CFG/QCFG
15288 	 * V2 APIs.
15289 	 */
15290 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_BS_V2_SUPPORTED				UINT32_C(0x4000000)
15291 	/*
15292 	 * When this bit is '1', it indicates the FW forces to use the
15293 	 * BACKING_STORE_CFG/QCFG V2 APIs.
15294 	 */
15295 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_BS_V2_REQUIRED				UINT32_C(0x8000000)
15296 	/*
15297 	 * When this bit is '1', it indicates that FW will support a single
15298 	 * 64bit real time clock for PTP.
15299 	 */
15300 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PTP_64BIT_RTC_SUPPORTED			UINT32_C(0x10000000)
15301 	/*
15302 	 * When this bit is '1', it indicates the FW is capable of
15303 	 * supporting Doorbell Pacing.
15304 	 */
15305 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_DBR_PACING_SUPPORTED			UINT32_C(0x20000000)
15306 	/*
15307 	 * When this bit is '1', it indicates the FW is capable of
15308 	 * supporting HW based doorbell drop recovery.
15309 	 */
15310 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_HW_DBR_DROP_RECOV_SUPPORTED		UINT32_C(0x40000000)
15311 	/*
15312 	 * When this bit is '1', it indicates the driver can disable the CQ
15313 	 * overflow detection and can also skip the index updates for CQ.
15314 	 */
15315 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_DISABLE_CQ_OVERFLOW_DETECTION_SUPPORTED	UINT32_C(0x80000000)
15316 	/* The maximum number of SCHQs supported by this device. */
15317 	uint8_t	max_schqs;
15318 	uint8_t	mpc_chnls_cap;
15319 	/*
15320 	 * When this bit is '1', it indicates that HW and firmware
15321 	 * supports the use of a MPC channel with destination set
15322 	 * to the TX crypto engine block.
15323 	 */
15324 	#define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_TCE	UINT32_C(0x1)
15325 	/*
15326 	 * When this bit is '1', it indicates that HW and firmware
15327 	 * supports the use of a MPC channel with destination set
15328 	 * to the RX crypto engine block.
15329 	 */
15330 	#define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_RCE	UINT32_C(0x2)
15331 	/*
15332 	 * When this bit is '1', it indicates that HW and firmware
15333 	 * supports the use of a MPC channel with destination set
15334 	 * to the TX configurable flow processing block.
15335 	 */
15336 	#define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_TE_CFA	UINT32_C(0x4)
15337 	/*
15338 	 * When this bit is '1', it indicates that HW and firmware
15339 	 * supports the use of a MPC channel with destination set
15340 	 * to the RX configurable flow processing block.
15341 	 */
15342 	#define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_RE_CFA	UINT32_C(0x8)
15343 	/*
15344 	 * When this bit is '1', it indicates that HW and firmware
15345 	 * supports the use of a MPC channel with destination set
15346 	 * to the primate processor block.
15347 	 */
15348 	#define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_PRIMATE	UINT32_C(0x10)
15349 	/*
15350 	 * Maximum number of Key Contexts supported per HWRM
15351 	 * function call for allocating Key Contexts.
15352 	 */
15353 	uint16_t	max_key_ctxs_alloc;
15354 	uint32_t	flags_ext2;
15355 	/*
15356 	 * When this bit is '1', it indicates that FW will support
15357 	 * timestamping on all RX packets, not just PTP type packets.
15358 	 */
15359 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_RX_ALL_PKTS_TIMESTAMPS_SUPPORTED	UINT32_C(0x1)
15360 	/* When this bit is '1', it indicates that HW and FW support QUIC. */
15361 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_QUIC_SUPPORTED			UINT32_C(0x2)
15362 	/*
15363 	 * When this bit is '1', it indicates that KDNet mode is
15364 	 * supported on the port for this function. This bit is
15365 	 * never set for a VF.
15366 	 */
15367 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_KDNET_SUPPORTED			UINT32_C(0x4)
15368 	/*
15369 	 * When this bit is '1', it indicates the FW is capable of
15370 	 * supporting Enhanced Doorbell Pacing.
15371 	 */
15372 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_DBR_PACING_EXT_SUPPORTED		UINT32_C(0x8)
15373 	/*
15374 	 * When this bit is '1', it indicates that FW is capable of
15375 	 * supporting software based doorbell drop recovery.
15376 	 */
15377 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_SW_DBR_DROP_RECOVERY_SUPPORTED	UINT32_C(0x10)
15378 	/*
15379 	 * When this bit is '1', it indicates the FW supports collection
15380 	 * and query of the generic statistics.
15381 	 */
15382 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_GENERIC_STATS_SUPPORTED		UINT32_C(0x20)
15383 	/*
15384 	 * When this bit is '1', it indicates that the HW is capable of
15385 	 * supporting UDP GSO on the function.
15386 	 */
15387 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_UDP_GSO_SUPPORTED			UINT32_C(0x40)
15388 	/*
15389 	 * When this bit is '1', it indicates that SyncE feature is
15390 	 * supported.
15391 	 */
15392 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_SYNCE_SUPPORTED			UINT32_C(0x80)
15393 	/*
15394 	 * When this bit is '1', it indicates the FW is capable of
15395 	 * supporting doorbell pacing version 0. As doorbell pacing
15396 	 * notification from hardware for Thor2 is completely different
15397 	 * from Thor1, this flag is used to differentiate the doorbell
15398 	 * pacing notification between Thor1 and Thor2. Thor1 uses
15399 	 * dbr_pacing_supported and dbr_pacing_ext_supported flags for
15400 	 * doorbell pacing whereas Thor2 uses dbr_pacing_v0_supported flag.
15401 	 * These flags will never be set at the same time for Thor2.
15402 	 * Based on this flag, host drivers assume doorbell pacing is needed
15403 	 * for Thor2.
15404 	 */
15405 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_DBR_PACING_V0_SUPPORTED		UINT32_C(0x100)
15406 	/*
15407 	 * When this bit is '1', it indicates that the HW supports
15408 	 * two-completion TX packet timestamp feature, a second completion
15409 	 * carrying packet TX timestamp in addition to the standard
15410 	 * completion returned for packets. Host driver should not use
15411 	 * HWRM port timestamp query (HWRM_PORT_TS_QUERY) command for
15412 	 * TX timestamp read when two-completion timestamp feature is
15413 	 * supported.
15414 	 */
15415 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_TX_PKT_TS_CMPL_SUPPORTED		UINT32_C(0x200)
15416 	/*
15417 	 * When this bit is '1', it indicates that the hardware based
15418 	 * link aggregation group (L2 and RoCE) feature is supported.
15419 	 * This LAG feature is only supported on the THOR2 or newer NIC
15420 	 * with multiple ports.
15421 	 */
15422 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_HW_LAG_SUPPORTED			UINT32_C(0x400)
15423 	/*
15424 	 * When this bit is '1', it indicates all contexts can be stored
15425 	 * on chip instead of using host based backing store memory.
15426 	 */
15427 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_ON_CHIP_CTX_SUPPORTED		UINT32_C(0x800)
15428 	/*
15429 	 * When this bit is '1', it indicates that the HW supports
15430 	 * using a steering tag in the memory transactions targeting
15431 	 * L2 or RoCE ring resources.
15432 	 * Steering Tags are system-specific values that must follow the
15433 	 * encoding requirements of the hardware platform. On devices that
15434 	 * support steering to multiple address domains, a value of 0 in
15435 	 * bit 0 of the steering tag specifies the address is associated
15436 	 * with the SOC address space, and a value of 1 indicates the
15437 	 * address is associated with the host address space.
15438 	 */
15439 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_STEERING_TAG_SUPPORTED		UINT32_C(0x1000)
15440 	/*
15441 	 * When this bit is '1', it indicates that driver can enable
15442 	 * support for an enhanced VF scale.
15443 	 */
15444 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_ENHANCED_VF_SCALE_SUPPORTED	UINT32_C(0x2000)
15445 	/*
15446 	 * When this bit is '1', it indicates that FW is capable of
15447 	 * supporting partition based XID management for KTLS/QUIC
15448 	 * Tx/Rx Key Context types.
15449 	 */
15450 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_KEY_XID_PARTITION_SUPPORTED	UINT32_C(0x4000)
15451 	/*
15452 	 * This bit is only valid on the condition that both
15453 	 * 'ktls_supported' and 'quic_supported' flags are set. When this
15454 	 * bit is valid, it conveys information below:
15455 	 * 1. If it is set to '1', it indicates that the firmware allows the
15456 	 *	driver to run KTLS and QUIC concurrently;
15457 	 * 2. If it is cleared to '0', it indicates that the driver has to
15458 	 *	make sure all crypto connections on all functions are of the
15459 	 *	same type, i.e., either KTLS or QUIC.
15460 	 */
15461 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_CONCURRENT_KTLS_QUIC_SUPPORTED	UINT32_C(0x8000)
15462 	/*
15463 	 * When this bit is '1', it indicates that the device supports
15464 	 * setting a cross TC cap on a scheduler queue.
15465 	 */
15466 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_SCHQ_CROSS_TC_CAP_SUPPORTED	UINT32_C(0x10000)
15467 	/*
15468 	 * When this bit is '1', it indicates that the device supports
15469 	 * setting a per TC cap on a scheduler queue.
15470 	 */
15471 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_SCHQ_PER_TC_CAP_SUPPORTED		UINT32_C(0x20000)
15472 	/*
15473 	 * When this bit is '1', it indicates that the device supports
15474 	 * setting a per TC reservation on a scheduler queues.
15475 	 */
15476 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_SCHQ_PER_TC_RESERVATION_SUPPORTED	UINT32_C(0x40000)
15477 	/*
15478 	 * When this bit is '1', it indicates that firmware supports query
15479 	 * for statistics related to invalid doorbell errors and drops.
15480 	 */
15481 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_DB_ERROR_STATS_SUPPORTED		UINT32_C(0x80000)
15482 	/*
15483 	 * When this bit is '1', it indicates that the device supports
15484 	 * VF RoCE resource management.
15485 	 */
15486 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_ROCE_VF_RESOURCE_MGMT_SUPPORTED	UINT32_C(0x100000)
15487 	/*
15488 	 * When this bit is '1', it indicates that the device supports
15489 	 * UDCC management.
15490 	 */
15491 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_UDCC_SUPPORTED			UINT32_C(0x200000)
15492 	/*
15493 	 * When this bit is '1', it indicates that the device supports Timed
15494 	 * Transmit TxTime scheduling; this is applicable to L2 flows only.
15495 	 * It is expected that host software assigns each packet a transmit
15496 	 * time and posts packets for transmit in time order. NIC hardware
15497 	 * transmits the packet at time assigned by software.
15498 	 */
15499 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_TIMED_TX_SO_TXTIME_SUPPORTED	UINT32_C(0x400000)
15500 	/*
15501 	 * This bit indicates the method used for the advertisement of the
15502 	 * max resource limit for the PF and its VFs.
15503 	 * When this bit is '1', it indicates that the maximum resource
15504 	 * limits for both RoCE and L2 are software defined. These limits
15505 	 * are queried using the HWRM backing store qcaps v1
15506 	 * and v2(max_num_entries). For RoCE, the resource limits are
15507 	 * derived from nvm options. For L2, the resources will continue
15508 	 * to use FW enforced SW limits based on chip config and per PF
15509 	 * function NVM resource parameters.
15510 	 * If this bit is '0', the FW will use to legacy behavior.
15511 	 * For RoCE, the maximum resource values supported by the chip will
15512 	 * be returned. For L2, the maximum resource values returned will
15513 	 * be the FW enforced SW limits based on chip config and per PF
15514 	 * function NVM resource parameters.
15515 	 */
15516 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_SW_MAX_RESOURCE_LIMITS_SUPPORTED	UINT32_C(0x800000)
15517 	/*
15518 	 * When this bit is '1', it indicates that the device supports
15519 	 * migrating ingress NIC flows to Truflow.
15520 	 */
15521 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_TF_INGRESS_NIC_FLOW_SUPPORTED	UINT32_C(0x1000000)
15522 	/*
15523 	 * When this bit is '1', it indicates that the Firmware supports
15524 	 * query and clear of the port loopback statistics.
15525 	 */
15526 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_LPBK_STATS_SUPPORTED		UINT32_C(0x2000000)
15527 	/*
15528 	 * When this bit is '1', it indicates that the device supports
15529 	 * migrating egress NIC flows to Truflow.
15530 	 */
15531 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_TF_EGRESS_NIC_FLOW_SUPPORTED	UINT32_C(0x4000000)
15532 	/*
15533 	 * When this bit is '1', it indicates that the device supports
15534 	 * multiple lossless CoS queues.
15535 	 */
15536 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_MULTI_LOSSLESS_QUEUES_SUPPORTED	UINT32_C(0x8000000)
15537 	/*
15538 	 * When this bit is '1', it indicates that the firmware supports
15539 	 * peer memory map storing feature.
15540 	 */
15541 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_PEER_MMAP_SUPPORTED		UINT32_C(0x10000000)
15542 	/*
15543 	 * When this bit is '1', it indicates that the device supports Timed
15544 	 * Transmit packet pacing; this is applicable to L2 flows only.
15545 	 * Host software passes the transmit rate of an L2 flow to the
15546 	 * hardware and hardware uses this rate to derive the transmit time
15547 	 * for scheduling packet transmission of the flow.
15548 	 */
15549 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_TIMED_TX_PACING_SUPPORTED		UINT32_C(0x20000000)
15550 	/*
15551 	 * When this bit is '1', it indicates that the device supports VF
15552 	 * statistics ejection. Firmware is capable of copying VF statistics
15553 	 * to two host buffers - one buffer allocated by VF driver and
15554 	 * another buffer allocated by the parent PF driver. This bit is
15555 	 * only set on a PF.
15556 	 */
15557 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_VF_STAT_EJECTION_SUPPORTED		UINT32_C(0x40000000)
15558 	/*
15559 	 * When this bit is '1', it indicates that the parent PF allocated
15560 	 * the Host DMA buffer to capture the coredump. So that any VF
15561 	 * driver instance can issue HWRM_DBG_COREDUMP_CAPTURE command
15562 	 */
15563 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_HOST_COREDUMP_SUPPORTED		UINT32_C(0x80000000)
15564 	uint16_t	tunnel_disable_flag;
15565 	/*
15566 	 * When this bit is '1', it indicates that the VXLAN parsing
15567 	 * is disabled in hardware
15568 	 */
15569 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_VXLAN	UINT32_C(0x1)
15570 	/*
15571 	 * When this bit is '1', it indicates that the NGE parsing
15572 	 * is disabled in hardware
15573 	 */
15574 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_NGE	UINT32_C(0x2)
15575 	/*
15576 	 * When this bit is '1', it indicates that the NVGRE parsing
15577 	 * is disabled in hardware
15578 	 */
15579 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_NVGRE	UINT32_C(0x4)
15580 	/*
15581 	 * When this bit is '1', it indicates that the L2GRE parsing
15582 	 * is disabled in hardware
15583 	 */
15584 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_L2GRE	UINT32_C(0x8)
15585 	/*
15586 	 * When this bit is '1', it indicates that the GRE parsing
15587 	 * is disabled in hardware
15588 	 */
15589 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_GRE	UINT32_C(0x10)
15590 	/*
15591 	 * When this bit is '1', it indicates that the IPINIP parsing
15592 	 * is disabled in hardware
15593 	 */
15594 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_IPINIP	UINT32_C(0x20)
15595 	/*
15596 	 * When this bit is '1', it indicates that the MPLS parsing
15597 	 * is disabled in hardware
15598 	 */
15599 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_MPLS	UINT32_C(0x40)
15600 	/*
15601 	 * When this bit is '1', it indicates that the PPPOE parsing
15602 	 * is disabled in hardware
15603 	 */
15604 	#define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_PPPOE	UINT32_C(0x80)
15605 	uint16_t	xid_partition_cap;
15606 	/*
15607 	 * When this bit is '1', it indicates that FW is capable of
15608 	 * supporting partition based XID management for Tx crypto
15609 	 * key contexts.
15610 	 */
15611 	#define HWRM_FUNC_QCAPS_OUTPUT_XID_PARTITION_CAP_TX_CK	UINT32_C(0x1)
15612 	/*
15613 	 * When this bit is '1', it indicates that FW is capable of
15614 	 * supporting partition based XID management for Rx crypto
15615 	 * key contexts.
15616 	 */
15617 	#define HWRM_FUNC_QCAPS_OUTPUT_XID_PARTITION_CAP_RX_CK	UINT32_C(0x2)
15618 	/*
15619 	 * This value uniquely identifies the hardware NIC used by the
15620 	 * function. The value returned will be the same for all functions.
15621 	 * A value of 00-00-00-00-00-00-00-00 indicates no device serial number
15622 	 * is currently configured. This is the same value that is returned by
15623 	 * PCIe Capability Device Serial Number.
15624 	 */
15625 	uint8_t	device_serial_number[8];
15626 	/*
15627 	 * This field is only valid in the XID partition mode. It indicates
15628 	 * the number contexts per partition.
15629 	 */
15630 	uint16_t	ctxs_per_partition;
15631 	/*
15632 	 * The maximum number of tso segments that NIC can handle during the
15633 	 * large segmentation offload.
15634 	 * If this field is zero, that means there is no limit on the TSO
15635 	 * segment limit.
15636 	 * Note that this field will be zero for older firmware that
15637 	 * doesn't report the max TSO segment limit.
15638 	 */
15639 	uint16_t	max_tso_segs;
15640 	/*
15641 	 * The maximum number of address vectors that may be allocated across
15642 	 * all VFs for the function. This is valid only on the PF with VF RoCE
15643 	 * (SR-IOV) enabled. Returns zero if this command is called on a PF
15644 	 * with VF RoCE (SR-IOV) disabled or on a VF.
15645 	 */
15646 	uint32_t	roce_vf_max_av;
15647 	/*
15648 	 * The maximum number of completion queues that may be allocated across
15649 	 * all VFs for the function. This is valid only on the PF with VF RoCE
15650 	 * (SR-IOV) enabled. Returns zero if this command is called on a PF
15651 	 * with VF RoCE (SR-IOV) disabled or on a VF.
15652 	 */
15653 	uint32_t	roce_vf_max_cq;
15654 	/*
15655 	 * The maximum number of memory regions plus memory windows that may be
15656 	 * allocated across all VFs for the function. This is valid only on the
15657 	 * PF with VF RoCE (SR-IOV) enabled. Returns zero if this command is
15658 	 * called on a PF with VF RoCE (SR-IOV) disabled or on a VF.
15659 	 */
15660 	uint32_t	roce_vf_max_mrw;
15661 	/*
15662 	 * The maximum number of queue pairs that may be allocated across
15663 	 * all VFs for the function. This is valid only on the PF with VF RoCE
15664 	 * (SR-IOV) enabled. Returns zero if this command is called on a PF
15665 	 * with VF RoCE (SR-IOV) disabled or on a VF.
15666 	 */
15667 	uint32_t	roce_vf_max_qp;
15668 	/*
15669 	 * The maximum number of shared receive queues that may be allocated
15670 	 * across all VFs for the function. This is valid only on the PF with
15671 	 * VF RoCE (SR-IOV) enabled. Returns zero if this command is called on
15672 	 * a PF with VF RoCE (SR-IOV) disabled or on a VF.
15673 	 */
15674 	uint32_t	roce_vf_max_srq;
15675 	/*
15676 	 * The maximum number of GIDs that may be allocated across all VFs for
15677 	 * the function. This is valid only on the PF with VF RoCE (SR-IOV)
15678 	 * enabled. Returns zero if this command is called on a PF with VF RoCE
15679 	 * (SR-IOV) disabled or on a VF.
15680 	 */
15681 	uint32_t	roce_vf_max_gid;
15682 	uint32_t	flags_ext3;
15683 	/*
15684 	 * When this bit is '1', firmware supports the driver using
15685 	 * FUNC_CFG (or FUNC_VF_CFG) to decrease resource reservations
15686 	 * while some resources are still allocated. An error is returned
15687 	 * if the driver tries to set the reservation to be less than the
15688 	 * number of allocated resources.
15689 	 */
15690 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_RM_RSV_WHILE_ALLOC_CAP	UINT32_C(0x1)
15691 	uint8_t	unused_3[7];
15692 	/*
15693 	 * This field is used in Output records to indicate that the output
15694 	 * is completely written to RAM. This field should be read as '1'
15695 	 * to indicate that the output has been completely written.
15696 	 * When writing a command completion or response to an internal
15697 	 * processor, the order of writes has to be such that this field is
15698 	 * written last.
15699 	 */
15700 	uint8_t	valid;
15701 } hwrm_func_qcaps_output_t, *phwrm_func_qcaps_output_t;
15702 
15703 /******************
15704  * hwrm_func_qcfg *
15705  ******************/
15706 
15707 
15708 /* hwrm_func_qcfg_input (size:192b/24B) */
15709 
15710 typedef struct hwrm_func_qcfg_input {
15711 	/* The HWRM command request type. */
15712 	uint16_t	req_type;
15713 	/*
15714 	 * The completion ring to send the completion event on. This should
15715 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
15716 	 */
15717 	uint16_t	cmpl_ring;
15718 	/*
15719 	 * The sequence ID is used by the driver for tracking multiple
15720 	 * commands. This ID is treated as opaque data by the firmware and
15721 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
15722 	 */
15723 	uint16_t	seq_id;
15724 	/*
15725 	 * The target ID of the command:
15726 	 * * 0x0-0xFFF8 - The function ID
15727 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15728 	 * * 0xFFFD - Reserved for user-space HWRM interface
15729 	 * * 0xFFFF - HWRM
15730 	 */
15731 	uint16_t	target_id;
15732 	/*
15733 	 * A physical address pointer pointing to a host buffer that the
15734 	 * command's response data will be written. This can be either a host
15735 	 * physical address (HPA) or a guest physical address (GPA) and must
15736 	 * point to a physically contiguous block of memory.
15737 	 */
15738 	uint64_t	resp_addr;
15739 	/*
15740 	 * Function ID of the function that is being queried.
15741 	 * 0xFF... (All Fs) if the query is for the requesting
15742 	 * function.
15743 	 * 0xFFFE (REQUESTING_PARENT_FID) This is a special FID
15744 	 * to be used by a trusted VF to query its parent PF.
15745 	 */
15746 	uint16_t	fid;
15747 	uint8_t	unused_0[6];
15748 } hwrm_func_qcfg_input_t, *phwrm_func_qcfg_input_t;
15749 
15750 /* hwrm_func_qcfg_output (size:1280b/160B) */
15751 
15752 typedef struct hwrm_func_qcfg_output {
15753 	/* The specific error status for the command. */
15754 	uint16_t	error_code;
15755 	/* The HWRM command request type. */
15756 	uint16_t	req_type;
15757 	/* The sequence ID from the original command. */
15758 	uint16_t	seq_id;
15759 	/* The length of the response data in number of bytes. */
15760 	uint16_t	resp_len;
15761 	/*
15762 	 * FID value. This value is used to identify operations on the PCI
15763 	 * bus as belonging to a particular PCI function.
15764 	 */
15765 	uint16_t	fid;
15766 	/*
15767 	 * Port ID of port that this function is associated with.
15768 	 * 0xFF... (All Fs) if this function is not associated with
15769 	 * any port.
15770 	 */
15771 	uint16_t	port_id;
15772 	/*
15773 	 * This value is the current VLAN setting for this
15774 	 * function. The value of 0 for this field indicates
15775 	 * no priority tagging or VLAN is used.
15776 	 * This field's format is same as 802.1Q Tag's
15777 	 * Tag Control Information (TCI) format that includes both
15778 	 * Priority Code Point (PCP) and VLAN Identifier (VID).
15779 	 */
15780 	uint16_t	vlan;
15781 	uint16_t	flags;
15782 	/*
15783 	 * If 1, then magic packet based Out-Of-Box WoL is enabled on
15784 	 * the port associated with this function.
15785 	 */
15786 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED	UINT32_C(0x1)
15787 	/*
15788 	 * If 1, then bitmap pattern based Out-Of-Box WoL packet is enabled
15789 	 * on the port associated with this function.
15790 	 */
15791 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED	UINT32_C(0x2)
15792 	/*
15793 	 * If set to 1, then FW based DCBX agent is enabled and running on
15794 	 * the port associated with this function.
15795 	 * If set to 0, then DCBX agent is not running in the firmware.
15796 	 */
15797 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED	UINT32_C(0x4)
15798 	/*
15799 	 * Standard TX Ring mode is used for the allocation of TX ring
15800 	 * and underlying scheduling resources that allow bandwidth
15801 	 * reservation and limit settings on the queried function.
15802 	 * If set to 1, then standard TX ring mode is enabled
15803 	 * on the queried function.
15804 	 * If set to 0, then the standard TX ring mode is disabled
15805 	 * on the queried function. In this extended TX ring resource
15806 	 * mode, the minimum and maximum bandwidth settings are not
15807 	 * supported to allow the allocation of TX rings to span multiple
15808 	 * scheduler nodes.
15809 	 */
15810 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED	UINT32_C(0x8)
15811 	/*
15812 	 * If set to 1 then FW based LLDP agent is enabled and running on
15813 	 * the port associated with this function.
15814 	 * If set to 0 then the LLDP agent is not running in the firmware.
15815 	 */
15816 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED	UINT32_C(0x10)
15817 	/*
15818 	 * If set to 1, then multi-host mode is active for this function.
15819 	 * The NIC is attached to two or more independent host systems
15820 	 * through two or more PCIe endpoints.
15821 	 * If set to 0, then multi-host mode is inactive for this function
15822 	 * or not applicable for this device.
15823 	 */
15824 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST		UINT32_C(0x20)
15825 	/*
15826 	 * If the function that is being queried is a PF, then the HWRM shall
15827 	 * set this field to 0 and the HWRM client shall ignore this field.
15828 	 * If the function that is being queried is a VF, then the HWRM shall
15829 	 * set this field to 1 if the queried VF is trusted, otherwise the
15830 	 * HWRM shall set this field to 0.
15831 	 */
15832 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF		UINT32_C(0x40)
15833 	/*
15834 	 * If set to 1, then secure mode is enabled for this function or
15835 	 * device. If set to 0, then secure mode is disabled (or normal mode)
15836 	 * for this function or device.
15837 	 */
15838 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_SECURE_MODE_ENABLED	UINT32_C(0x80)
15839 	/*
15840 	 * If set to 1, then this PF is enabled with a preboot driver that
15841 	 * requires access to the legacy L2 ring model and legacy 32b
15842 	 * doorbells. If set to 0, then this PF is not allowed to use
15843 	 * the legacy L2 rings. This feature is not allowed on VFs and
15844 	 * is only relevant for devices that require a context backing
15845 	 * store.
15846 	 */
15847 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS	UINT32_C(0x100)
15848 	/*
15849 	 * If set to 1, then the firmware and all currently registered driver
15850 	 * instances support hot reset. The hot reset support will be updated
15851 	 * dynamically based on the driver interface advertisement.
15852 	 * If set to 0, then the adapter is not currently able to initiate
15853 	 * hot reset.
15854 	 */
15855 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_HOT_RESET_ALLOWED		UINT32_C(0x200)
15856 	/*
15857 	 * If set to 1, then the PPP tx push mode is enabled for all the
15858 	 * reserved TX rings of this function. If set to 0, then PPP tx push
15859 	 * mode is disabled for all the reserved TX rings of this function.
15860 	 */
15861 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PPP_PUSH_MODE_ENABLED	UINT32_C(0x400)
15862 	/*
15863 	 * If set to 1, then the firmware will notify driver using async
15864 	 * event when a ring is disabled due to a Hardware error.
15865 	 */
15866 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_RING_MONITOR_ENABLED	UINT32_C(0x800)
15867 	/*
15868 	 * If set to 1, then the firmware and all currently registered driver
15869 	 * instances support fast reset. The fast reset support will be
15870 	 * updated dynamically based on the driver interface advertisement.
15871 	 * If set to 0, then the adapter is not currently able to initiate
15872 	 * fast reset.
15873 	 */
15874 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FAST_RESET_ALLOWED	UINT32_C(0x1000)
15875 	/*
15876 	 * If set to 1, then multi-root mode is active for this function.
15877 	 * The NIC is attached to a single host with a single operating
15878 	 * system, but through two or more PCIe endpoints.
15879 	 * If set to 0, then multi-root mode is inactive for this function
15880 	 * or not applicable for this device.
15881 	 */
15882 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_ROOT		UINT32_C(0x2000)
15883 	/*
15884 	 * This flag indicates RDMA support for child VFS of
15885 	 * a physical function.
15886 	 * If set to 1, RoCE is supported on all child VFs.
15887 	 * If set to 0, RoCE is disabled on all child VFs.
15888 	 */
15889 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_ENABLE_RDMA_SRIOV		UINT32_C(0x4000)
15890 	/*
15891 	 * When set to 1, indicates the field roce_vnic_id in the structure
15892 	 * is valid. If this bit is 0, the driver should not use the
15893 	 * 'roce_vnic_id' field.
15894 	 */
15895 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_ROCE_VNIC_ID_VALID	UINT32_C(0x8000)
15896 	/*
15897 	 * This value is current MAC address configured for this
15898 	 * function. A value of 00-00-00-00-00-00 indicates no
15899 	 * MAC address is currently configured.
15900 	 */
15901 	uint8_t	mac_address[6];
15902 	/*
15903 	 * This value is current PCI ID of this
15904 	 * function. If ARI is enabled, then it is
15905 	 * Bus Number (8b):Function Number(8b). Otherwise, it is
15906 	 * Bus Number (8b):Device Number (4b):Function Number(4b).
15907 	 * If multi-host mode is active, the 4 lsb will indicate
15908 	 * the PF index for this function.
15909 	 */
15910 	uint16_t	pci_id;
15911 	/*
15912 	 * The number of RSS/COS contexts currently
15913 	 * allocated to the function.
15914 	 */
15915 	uint16_t	alloc_rsscos_ctx;
15916 	/*
15917 	 * The number of completion rings currently allocated to
15918 	 * the function. This does not include the rings allocated
15919 	 * to any children functions if any.
15920 	 */
15921 	uint16_t	alloc_cmpl_rings;
15922 	/*
15923 	 * The number of transmit rings currently allocated to
15924 	 * the function. This does not include the rings allocated
15925 	 * to any children functions if any.
15926 	 */
15927 	uint16_t	alloc_tx_rings;
15928 	/*
15929 	 * The number of receive rings currently allocated to
15930 	 * the function. This does not include the rings allocated
15931 	 * to any children functions if any.
15932 	 */
15933 	uint16_t	alloc_rx_rings;
15934 	/* The allocated number of L2 contexts to the function. */
15935 	uint16_t	alloc_l2_ctx;
15936 	/* The allocated number of vnics to the function. */
15937 	uint16_t	alloc_vnics;
15938 	/*
15939 	 * The maximum transmission unit of the function
15940 	 * configured by the admin pf.
15941 	 * If the reported mtu value is non-zero then it will be used for the
15942 	 * rings allocated on this function, otherwise the default
15943 	 * value is used if ring MTU is not specified.
15944 	 * The driver cannot use any MTU bigger than this value
15945 	 * if it is non-zero.
15946 	 */
15947 	uint16_t	admin_mtu;
15948 	/*
15949 	 * The maximum receive unit of the function.
15950 	 * For vnics allocated on this function, this default
15951 	 * value is used if vnic MRU is not specified.
15952 	 */
15953 	uint16_t	mru;
15954 	/* The statistics context assigned to a function. */
15955 	uint16_t	stat_ctx_id;
15956 	/*
15957 	 * The HWRM shall return Unknown value for this field
15958 	 * when this command is used to query VF's configuration.
15959 	 */
15960 	uint8_t	port_partition_type;
15961 	/* Single physical function */
15962 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF	UINT32_C(0x0)
15963 	/* Multiple physical functions */
15964 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS	UINT32_C(0x1)
15965 	/* Network Partitioning 1.0 */
15966 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
15967 	/* Network Partitioning 1.5 */
15968 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
15969 	/* Network Partitioning 2.0 */
15970 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
15971 	/* Network Partitioning 1.2 */
15972 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_2 UINT32_C(0x5)
15973 	/* Unknown */
15974 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN UINT32_C(0xff)
15975 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_LAST   HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN
15976 	/*
15977 	 * This field will indicate number of physical functions on this
15978 	 * port_partition. HWRM shall return unavail (i.e. value of 0) for this
15979 	 * field when this command is used to query VF's configuration or from
15980 	 * older firmware that doesn't support this field.
15981 	 */
15982 	uint8_t	port_pf_cnt;
15983 	/* number of PFs is not available */
15984 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
15985 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_LAST   HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL
15986 	/*
15987 	 * The default VNIC ID assigned to a function that is
15988 	 * being queried.
15989 	 */
15990 	uint16_t	dflt_vnic_id;
15991 	uint16_t	max_mtu_configured;
15992 	/*
15993 	 * Minimum guaranteed transmit bandwidth for this function. When
15994 	 * specified for a PF, does not affect traffic from the PF's child VFs.
15995 	 * A value of 0 indicates the minimum bandwidth is not configured.
15996 	 */
15997 	uint32_t	min_bw;
15998 	/* The bandwidth value. */
15999 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
16000 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT		0
16001 	/* The granularity of the value (bits or bytes). */
16002 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE			UINT32_C(0x10000000)
16003 	/* Value is in bits. */
16004 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
16005 	/* Value is in bytes. */
16006 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
16007 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST		HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
16008 	/* bw_value_unit is 3 b */
16009 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
16010 	#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT	29
16011 	/* Value is in Mb or MB (base 10). */
16012 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
16013 	/* Value is in Kb or KB (base 10). */
16014 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
16015 	/* Value is in bits or bytes. */
16016 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
16017 	/* Value is in Gb or GB (base 10). */
16018 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
16019 	/* Value is in 1/100th of a percentage of link bandwidth. */
16020 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
16021 	/* Invalid unit */
16022 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
16023 		#define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
16024 	/*
16025 	 * Maximum transmit rate for this function. When specified for a PF,
16026 	 * does not affect traffic from the PF's child VFs.
16027 	 * A value of 0 indicates that the maximum bandwidth is not configured.
16028 	 */
16029 	uint32_t	max_bw;
16030 	/* The bandwidth value. */
16031 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
16032 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT		0
16033 	/* The granularity of the value (bits or bytes). */
16034 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE			UINT32_C(0x10000000)
16035 	/* Value is in bits. */
16036 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
16037 	/* Value is in bytes. */
16038 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
16039 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST		HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
16040 	/* bw_value_unit is 3 b */
16041 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
16042 	#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT	29
16043 	/* Value is in Mb or MB (base 10). */
16044 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
16045 	/* Value is in Kb or KB (base 10). */
16046 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
16047 	/* Value is in bits or bytes. */
16048 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
16049 	/* Value is in Gb or GB (base 10). */
16050 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
16051 	/* Value is in 1/100th of a percentage of link bandwidth. */
16052 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
16053 	/* Invalid unit */
16054 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
16055 		#define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
16056 	/*
16057 	 * This value indicates the Edge virtual bridge mode for the
16058 	 * domain that this function belongs to.
16059 	 */
16060 	uint8_t	evb_mode;
16061 	/* No Edge Virtual Bridging (EVB) */
16062 	#define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
16063 	/* Virtual Ethernet Bridge (VEB) */
16064 	#define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB	UINT32_C(0x1)
16065 	/* Virtual Ethernet Port Aggregator (VEPA) */
16066 	#define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA   UINT32_C(0x2)
16067 	#define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_LAST  HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA
16068 	uint8_t	options;
16069 	/*
16070 	 * This value indicates the PCIE device cache line size.
16071 	 * The cache line size allows the DMA writes to terminate and
16072 	 * start at the cache boundary.
16073 	 */
16074 	#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_MASK	UINT32_C(0x3)
16075 	#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SFT	0
16076 	/* Cache Line Size 64 bytes */
16077 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_64	UINT32_C(0x0)
16078 	/* Cache Line Size 128 bytes */
16079 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128	UINT32_C(0x1)
16080 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_LAST	HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
16081 	/* This value is the virtual link admin state setting. */
16082 	#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_MASK	UINT32_C(0xc)
16083 	#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_SFT	2
16084 	/* Admin link state is in forced down mode. */
16085 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN  (UINT32_C(0x0) << 2)
16086 	/* Admin link state is in forced up mode. */
16087 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP	(UINT32_C(0x1) << 2)
16088 	/*
16089 	 * Admin link state is in auto mode - follows the physical link
16090 	 * state.
16091 	 */
16092 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO	(UINT32_C(0x2) << 2)
16093 		#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_LAST	HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
16094 	/* Reserved for future. */
16095 	#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_MASK		UINT32_C(0xf0)
16096 	#define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_SFT			4
16097 	/*
16098 	 * The number of VFs that are allocated to the function.
16099 	 * This is valid only on the PF with SR-IOV enabled.
16100 	 * 0xFF... (All Fs) if this command is called on a PF with
16101 	 * SR-IOV disabled or on a VF.
16102 	 */
16103 	uint16_t	alloc_vfs;
16104 	/*
16105 	 * The number of allocated multicast filters for this
16106 	 * function on the RX side.
16107 	 */
16108 	uint32_t	alloc_mcast_filters;
16109 	/*
16110 	 * The number of allocated HW ring groups for this
16111 	 * function.
16112 	 */
16113 	uint32_t	alloc_hw_ring_grps;
16114 	/*
16115 	 * The number of strict priority transmit rings out of
16116 	 * currently allocated TX rings to the function
16117 	 * (alloc_tx_rings).
16118 	 */
16119 	uint16_t	alloc_sp_tx_rings;
16120 	/*
16121 	 * The number of statistics contexts
16122 	 * currently reserved for the function.
16123 	 */
16124 	uint16_t	alloc_stat_ctx;
16125 	/*
16126 	 * This field specifies how many NQs are reserved for the PF.
16127 	 * Remaining NQs that belong to the PF are available for VFs.
16128 	 * Once a PF has created VFs, it cannot change how many NQs are
16129 	 * reserved for itself (since the NQs must be contiguous in HW).
16130 	 */
16131 	uint16_t	alloc_msix;
16132 	/*
16133 	 * The number of registered VF's associated with the PF. This field
16134 	 * should be ignored when the request received on the VF interface.
16135 	 * This field will be updated on the PF interface to initiate
16136 	 * the unregister request on PF in the HOT Reset Process.
16137 	 */
16138 	uint16_t	registered_vfs;
16139 	/*
16140 	 * The size of the doorbell BAR in KBytes reserved for L2 including
16141 	 * any area that is shared between L2 and RoCE. The L2 driver
16142 	 * should only map the L2 portion of the doorbell BAR. Any rounding
16143 	 * of the BAR size to the native CPU page size should be performed
16144 	 * by the driver. If the value is zero, no special partitioning
16145 	 * of the doorbell BAR between L2 and RoCE is required.
16146 	 */
16147 	uint16_t	l2_doorbell_bar_size_kb;
16148 	/*
16149 	 * A bitmask indicating the active endpoints. Each bit represents a
16150 	 * specific endpoint, with bit 0 indicating EP 0 and bit 3 indicating
16151 	 * EP 3. For example:
16152 	 * - a single root system would return 0x1
16153 	 * - a 2x8 system (where EPs 0 and 2 are active) would return 0x5
16154 	 * - a 4x4 system (where EPs 0-3 are active) would return 0xF
16155 	 */
16156 	uint8_t	active_endpoints;
16157 	/*
16158 	 * For backward compatibility this field must be set to 1.
16159 	 * Older drivers might look for this field to be 1 before
16160 	 * processing the message.
16161 	 */
16162 	uint8_t	always_1;
16163 	/*
16164 	 * This GRC address location is used by the Host driver interfaces to
16165 	 * poll the adapter ready state to re-initiate the registration process
16166 	 * again after receiving the RESET Notify event.
16167 	 */
16168 	uint32_t	reset_addr_poll;
16169 	/*
16170 	 * This field specifies legacy L2 doorbell size in KBytes. Drivers
16171 	 * should use this value to find out the doorbell page offset from the
16172 	 * BAR.
16173 	 */
16174 	uint16_t	legacy_l2_db_size_kb;
16175 	uint16_t	svif_info;
16176 	/*
16177 	 * This field specifies the source virtual interface of the function
16178 	 * being queried. Drivers can use this to program svif field in the
16179 	 * L2 context table
16180 	 */
16181 	#define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_MASK	UINT32_C(0x7fff)
16182 	#define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_SFT	0
16183 	/* This field specifies whether svif is valid or not */
16184 	#define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_VALID	UINT32_C(0x8000)
16185 	uint8_t	mpc_chnls;
16186 	/*
16187 	 * When this bit is '1', it indicates that a MPC channel with
16188 	 * destination set to the TX crypto engine block is enabled.
16189 	 */
16190 	#define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_TCE_ENABLED	UINT32_C(0x1)
16191 	/*
16192 	 * When this bit is '1', it indicates that a MPC channel with
16193 	 * destination set to the RX crypto engine block is enabled.
16194 	 */
16195 	#define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_RCE_ENABLED	UINT32_C(0x2)
16196 	/*
16197 	 * When this bit is '1', it indicates that a MPC channel with
16198 	 * destination set to the TX configurable flow processing block is
16199 	 * enabled.
16200 	 */
16201 	#define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_TE_CFA_ENABLED	UINT32_C(0x4)
16202 	/*
16203 	 * When this bit is '1', it indicates that a MPC channel with
16204 	 * destination set to the RX configurable flow processing block is
16205 	 * enabled.
16206 	 */
16207 	#define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_RE_CFA_ENABLED	UINT32_C(0x8)
16208 	/*
16209 	 * When this bit is '1', it indicates that a MPC channel with
16210 	 * destination set to the primate processor block is enabled.
16211 	 */
16212 	#define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_PRIMATE_ENABLED	UINT32_C(0x10)
16213 	/*
16214 	 * Configured doorbell page size for this function.
16215 	 * This field is valid for PF only.
16216 	 */
16217 	uint8_t	db_page_size;
16218 	/* DB page size is 4KB. */
16219 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_4KB   UINT32_C(0x0)
16220 	/* DB page size is 8KB. */
16221 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_8KB   UINT32_C(0x1)
16222 	/* DB page size is 16KB. */
16223 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_16KB  UINT32_C(0x2)
16224 	/* DB page size is 32KB. */
16225 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_32KB  UINT32_C(0x3)
16226 	/* DB page size is 64KB. */
16227 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_64KB  UINT32_C(0x4)
16228 	/* DB page size is 128KB. */
16229 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_128KB UINT32_C(0x5)
16230 	/* DB page size is 256KB. */
16231 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_256KB UINT32_C(0x6)
16232 	/* DB page size is 512KB. */
16233 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_512KB UINT32_C(0x7)
16234 	/* DB page size is 1MB. */
16235 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_1MB   UINT32_C(0x8)
16236 	/* DB page size is 2MB. */
16237 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_2MB   UINT32_C(0x9)
16238 	/* DB page size is 4MB. */
16239 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_4MB   UINT32_C(0xa)
16240 	#define HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_LAST HWRM_FUNC_QCFG_OUTPUT_DB_PAGE_SIZE_4MB
16241 	/*
16242 	 * RoCE VNIC ID for the function. If the function does not have a valid
16243 	 * RoCE vnic id, then the roce_vnic_id_valid bit in flags is set to 0.
16244 	 */
16245 	uint16_t	roce_vnic_id;
16246 	/*
16247 	 * Minimum guaranteed bandwidth for the network partition made up
16248 	 * of the caller physical function and all its child virtual
16249 	 * functions. The rate is specified as a percentage of the bandwidth
16250 	 * of the link the partition is associated with. A value of 0
16251 	 * indicates that no minimum bandwidth is configured.
16252 	 * The format of this field is defined to match min_bw, even though
16253 	 * the partition minimum rate is always specified as a percentage.
16254 	 */
16255 	uint32_t	partition_min_bw;
16256 	/* The bandwidth value. */
16257 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
16258 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_SFT		0
16259 	/*
16260 	 * The granularity of the value (bits or bytes). Firmware never sets
16261 	 * this field.
16262 	 */
16263 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE			UINT32_C(0x10000000)
16264 	/* Value is in bits. */
16265 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
16266 	/* Value is in bytes. */
16267 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
16268 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_LAST		HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_BYTES
16269 	/* Always percentage of link bandwidth. */
16270 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
16271 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_SFT	29
16272 	/* Bandwidth value is in hundredths of a percent of link bandwidth. */
16273 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
16274 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100
16275 	/*
16276 	 * The maximum bandwidth that may be used by the network partition
16277 	 * made up of the caller physical function and all its child virtual
16278 	 * functions. The rate is specified as a percentage of the bandwidth
16279 	 * of the link the partition is associated with. A value of 0
16280 	 * indicates that no maximum bandwidth is configured.
16281 	 * The format of this field is defined to match max_bw, even though
16282 	 * the partition bandwidth must be specified as a percentage.
16283 	 */
16284 	uint32_t	partition_max_bw;
16285 	/* The bandwidth value. */
16286 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
16287 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_SFT		0
16288 	/*
16289 	 * The granularity of the value (bits or bytes). Firmware never sets
16290 	 * this field.
16291 	 */
16292 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE			UINT32_C(0x10000000)
16293 	/* Value is in bits. */
16294 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
16295 	/* Value is in bytes. */
16296 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
16297 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_LAST		HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_BYTES
16298 	/* Always a percentage of link bandwidth. */
16299 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
16300 	#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_SFT	29
16301 	/* Value is in hundredths of a percent of link bandwidth. */
16302 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
16303 		#define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100
16304 	/*
16305 	 * The maximum transmission unit of the function
16306 	 * configured by the host pf/vf.
16307 	 * If the reported mtu value is non-zero then it will be used for the
16308 	 * rings allocated on this function, otherwise the default
16309 	 * value is used if ring MTU is not specified.
16310 	 */
16311 	uint16_t	host_mtu;
16312 	uint16_t	flags2;
16313 	/*
16314 	 * If set to 1, then VF drivers are requested to insert a DSCP
16315 	 * value into all outgoing L2 packets such that DSCP=VF ID modulo 64
16316 	 */
16317 	#define HWRM_FUNC_QCFG_OUTPUT_FLAGS2_SRIOV_DSCP_INSERT_ENABLED	UINT32_C(0x1)
16318 	uint8_t	unused_4[2];
16319 	/*
16320 	 * KDNet mode for the port for this function. If a VF, KDNet
16321 	 * mode is always disabled.
16322 	 */
16323 	uint8_t	port_kdnet_mode;
16324 	/* KDNet mode is not enabled on the port for this function. */
16325 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_KDNET_MODE_DISABLED UINT32_C(0x0)
16326 	/* KDNet mode is enabled on the port for this function. */
16327 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_KDNET_MODE_ENABLED  UINT32_C(0x1)
16328 	#define HWRM_FUNC_QCFG_OUTPUT_PORT_KDNET_MODE_LAST	HWRM_FUNC_QCFG_OUTPUT_PORT_KDNET_MODE_ENABLED
16329 	/*
16330 	 * If KDNet mode is enabled, the PCI function number of the
16331 	 * KDNet partition.
16332 	 */
16333 	uint8_t	kdnet_pcie_function;
16334 	/*
16335 	 * Function ID of the KDNET function on this port. If the
16336 	 * KDNET partition does not exist and the FW supports this
16337 	 * feature, 0xffff will be returned.
16338 	 */
16339 	uint16_t	port_kdnet_fid;
16340 	uint8_t	unused_5[2];
16341 	/* Number of KTLS Tx Key Contexts allocated. */
16342 	uint32_t	num_ktls_tx_key_ctxs;
16343 	/* Number of KTLS Rx Key Contexts allocated. */
16344 	uint32_t	num_ktls_rx_key_ctxs;
16345 	/*
16346 	 * The LAG idx of this function. The lag_id is per port and the
16347 	 * valid lag_id is from 0 to 7, if there is no valid lag_id,
16348 	 * 0xff will be returned.
16349 	 * This HW lag id is used for Truflow programming only.
16350 	 */
16351 	uint8_t	lag_id;
16352 	/* Partition interface for this function. */
16353 	uint8_t	parif;
16354 	/*
16355 	 * The LAG ID of a hardware link aggregation group (LAG) whose
16356 	 * member ports include the port of this function. The LAG was
16357 	 * previously created using HWRM_FUNC_LAG_CREATE. If the port of this
16358 	 * function is not a member of any LAG, the fw_lag_id will be 0xff.
16359 	 */
16360 	uint8_t	fw_lag_id;
16361 	uint8_t	unused_6;
16362 	/* Number of QUIC Tx Key Contexts allocated. */
16363 	uint32_t	num_quic_tx_key_ctxs;
16364 	/* Number of QUIC Rx Key Contexts allocated. */
16365 	uint32_t	num_quic_rx_key_ctxs;
16366 	/*
16367 	 * Number of AVs per VF. Only valid for PF. This field is ignored
16368 	 * when the flag, l2_vf_resource_mgmt, is not set in RoCE
16369 	 * initialize_fw.
16370 	 */
16371 	uint32_t	roce_max_av_per_vf;
16372 	/*
16373 	 * Number of CQs per VF. Only valid for PF. This field is ignored when
16374 	 * the flag, l2_vf_resource_mgmt, is not set in RoCE initialize_fw.
16375 	 */
16376 	uint32_t	roce_max_cq_per_vf;
16377 	/*
16378 	 * Number of MR/MWs per VF. Only valid for PF. This field is ignored
16379 	 * when the flag, l2_vf_resource_mgmt, is not set in RoCE
16380 	 * initialize_fw.
16381 	 */
16382 	uint32_t	roce_max_mrw_per_vf;
16383 	/*
16384 	 * Number of QPs per VF. Only valid for PF. This field is ignored when
16385 	 * the flag, l2_vf_resource_mgmt, is not set in RoCE initialize_fw.
16386 	 */
16387 	uint32_t	roce_max_qp_per_vf;
16388 	/*
16389 	 * Number of SRQs per VF. Only valid for PF. This field is ignored
16390 	 * when the flag, l2_vf_resource_mgmt, is not set in RoCE
16391 	 * initialize_fw.
16392 	 */
16393 	uint32_t	roce_max_srq_per_vf;
16394 	/*
16395 	 * Number of GIDs per VF. Only valid for PF. This field is ignored
16396 	 * when the flag, l2_vf_resource_mgmt, is not set in RoCE
16397 	 * initialize_fw.
16398 	 */
16399 	uint32_t	roce_max_gid_per_vf;
16400 	/*
16401 	 * Bitmap of context types that have XID partition enabled.
16402 	 * Only valid for PF.
16403 	 */
16404 	uint16_t	xid_partition_cfg;
16405 	/*
16406 	 * When this bit is '1', it indicates that driver enables XID
16407 	 * partition on Tx crypto key contexts.
16408 	 */
16409 	#define HWRM_FUNC_QCFG_OUTPUT_XID_PARTITION_CFG_TX_CK	UINT32_C(0x1)
16410 	/*
16411 	 * When this bit is '1', it indicates that driver enables XID
16412 	 * partition on Rx crypto key contexts.
16413 	 */
16414 	#define HWRM_FUNC_QCFG_OUTPUT_XID_PARTITION_CFG_RX_CK	UINT32_C(0x2)
16415 	uint8_t	unused_7;
16416 	/*
16417 	 * This field is used in Output records to indicate that the output
16418 	 * is completely written to RAM. This field should be read as '1'
16419 	 * to indicate that the output has been completely written. When
16420 	 * writing a command completion or response to an internal processor,
16421 	 * the order of writes has to be such that this field is written last.
16422 	 */
16423 	uint8_t	valid;
16424 } hwrm_func_qcfg_output_t, *phwrm_func_qcfg_output_t;
16425 
16426 /*****************
16427  * hwrm_func_cfg *
16428  *****************/
16429 
16430 
16431 /* hwrm_func_cfg_input (size:1280b/160B) */
16432 
16433 typedef struct hwrm_func_cfg_input {
16434 	/* The HWRM command request type. */
16435 	uint16_t	req_type;
16436 	/*
16437 	 * The completion ring to send the completion event on. This should
16438 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
16439 	 */
16440 	uint16_t	cmpl_ring;
16441 	/*
16442 	 * The sequence ID is used by the driver for tracking multiple
16443 	 * commands. This ID is treated as opaque data by the firmware and
16444 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
16445 	 */
16446 	uint16_t	seq_id;
16447 	/*
16448 	 * The target ID of the command:
16449 	 * * 0x0-0xFFF8 - The function ID
16450 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16451 	 * * 0xFFFD - Reserved for user-space HWRM interface
16452 	 * * 0xFFFF - HWRM
16453 	 */
16454 	uint16_t	target_id;
16455 	/*
16456 	 * A physical address pointer pointing to a host buffer that the
16457 	 * command's response data will be written. This can be either a host
16458 	 * physical address (HPA) or a guest physical address (GPA) and must
16459 	 * point to a physically contiguous block of memory.
16460 	 */
16461 	uint64_t	resp_addr;
16462 	/*
16463 	 * Function ID of the function that is being
16464 	 * configured.
16465 	 * If set to 0xFF... (All Fs), then the configuration is
16466 	 * for the requesting function.
16467 	 */
16468 	uint16_t	fid;
16469 	/*
16470 	 * This field specifies how many NQs will be reserved for the PF.
16471 	 * Remaining NQs that belong to the PF become available for VFs.
16472 	 * Once a PF has created VFs, it cannot change how many NQs are
16473 	 * reserved for itself (since the NQs must be contiguous in HW).
16474 	 */
16475 	uint16_t	num_msix;
16476 	uint32_t	flags;
16477 	/*
16478 	 * When this bit is '1', the function is disabled with
16479 	 * source MAC address check.
16480 	 * This is an anti-spoofing check. If this flag is set,
16481 	 * then the function shall be configured to disallow
16482 	 * transmission of frames with the source MAC address that
16483 	 * is configured for this function.
16484 	 */
16485 	#define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE	UINT32_C(0x1)
16486 	/*
16487 	 * When this bit is '1', the function is enabled with
16488 	 * source MAC address check.
16489 	 * This is an anti-spoofing check. If this flag is set,
16490 	 * then the function shall be configured to allow
16491 	 * transmission of frames with the source MAC address that
16492 	 * is configured for this function.
16493 	 */
16494 	#define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE	UINT32_C(0x2)
16495 	/* reserved. */
16496 	#define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK			UINT32_C(0x1fc)
16497 	#define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT			2
16498 	/*
16499 	 * Standard TX Ring mode is used for the allocation of TX ring
16500 	 * and underlying scheduling resources that allow bandwidth
16501 	 * reservation and limit settings on the queried function.
16502 	 * If set to 1, then standard TX ring mode is requested to be
16503 	 * enabled on the function being configured.
16504 	 */
16505 	#define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE	UINT32_C(0x200)
16506 	/*
16507 	 * Standard TX Ring mode is used for the allocation of TX ring
16508 	 * and underlying scheduling resources that allow bandwidth
16509 	 * reservation and limit settings on the queried function.
16510 	 * If set to 1, then the standard TX ring mode is requested to
16511 	 * be disabled on the function being configured. In this extended
16512 	 * TX ring resource mode, the minimum and maximum bandwidth settings
16513 	 * are not supported to allow the allocation of TX rings to
16514 	 * span multiple scheduler nodes.
16515 	 */
16516 	#define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE	UINT32_C(0x400)
16517 	/*
16518 	 * If this bit is set, virtual mac address configured
16519 	 * in this command will be persistent over warm boot.
16520 	 */
16521 	#define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST		UINT32_C(0x800)
16522 	/*
16523 	 * This bit only applies to the VF. If this bit is set, the statistic
16524 	 * context counters will not be cleared when the statistic context is
16525 	 * freed or a function reset is called on VF. This bit will be
16526 	 * cleared when the PF is unloaded or a function reset is called on
16527 	 * the PF.
16528 	 */
16529 	#define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC	UINT32_C(0x1000)
16530 	/*
16531 	 * This bit requests that the firmware test to see if all the assets
16532 	 * requested in this command (i.e. number of TX rings) are available.
16533 	 * The firmware will return an error if the requested assets are
16534 	 * not available. The firmware will NOT reserve the assets if they
16535 	 * are available.
16536 	 */
16537 	#define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST		UINT32_C(0x2000)
16538 	/*
16539 	 * This bit requests that the firmware test to see if all the assets
16540 	 * requested in this command (i.e. number of RX rings) are available.
16541 	 * The firmware will return an error if the requested assets are
16542 	 * not available. The firmware will NOT reserve the assets if they
16543 	 * are available.
16544 	 */
16545 	#define HWRM_FUNC_CFG_INPUT_FLAGS_RX_ASSETS_TEST		UINT32_C(0x4000)
16546 	/*
16547 	 * This bit requests that the firmware test to see if all the assets
16548 	 * requested in this command (i.e. number of CMPL rings) are
16549 	 * available. The firmware will return an error if the requested
16550 	 * assets are not available. The firmware will NOT reserve the assets
16551 	 * if they are available.
16552 	 */
16553 	#define HWRM_FUNC_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST		UINT32_C(0x8000)
16554 	/*
16555 	 * This bit requests that the firmware test to see if all the assets
16556 	 * requested in this command (i.e. number of RSS ctx) are available.
16557 	 * The firmware will return an error if the requested assets are
16558 	 * not available. The firmware will NOT reserve the assets if they
16559 	 * are available.
16560 	 */
16561 	#define HWRM_FUNC_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST	UINT32_C(0x10000)
16562 	/*
16563 	 * This bit requests that the firmware test to see if all the assets
16564 	 * requested in this command (i.e. number of ring groups) are
16565 	 * available. The firmware will return an error if the requested
16566 	 * assets are not available. The firmware will NOT reserve the assets
16567 	 * if they are available.
16568 	 */
16569 	#define HWRM_FUNC_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST	UINT32_C(0x20000)
16570 	/*
16571 	 * This bit requests that the firmware test to see if all the assets
16572 	 * requested in this command (i.e. number of stat ctx) are available.
16573 	 * The firmware will return an error if the requested assets are
16574 	 * not available. The firmware will NOT reserve the assets if they
16575 	 * are available.
16576 	 */
16577 	#define HWRM_FUNC_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST	UINT32_C(0x40000)
16578 	/*
16579 	 * This bit requests that the firmware test to see if all the assets
16580 	 * requested in this command (i.e. number of VNICs) are available.
16581 	 * The firmware will return an error if the requested assets are
16582 	 * not available. The firmware will NOT reserve the assets if they
16583 	 * are available.
16584 	 */
16585 	#define HWRM_FUNC_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST		UINT32_C(0x80000)
16586 	/*
16587 	 * This bit requests that the firmware test to see if all the assets
16588 	 * requested in this command (i.e. number of L2 ctx) are available.
16589 	 * The firmware will return an error if the requested assets are
16590 	 * not available. The firmware will NOT reserve the assets if they
16591 	 * are available.
16592 	 */
16593 	#define HWRM_FUNC_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST		UINT32_C(0x100000)
16594 	/*
16595 	 * This configuration change can be initiated by a PF driver. This
16596 	 * configuration request shall be targeted to a VF. From local host
16597 	 * resident HWRM clients, only the parent PF driver shall be allowed
16598 	 * to initiate this change on one of its children VFs. If this bit is
16599 	 * set to 1, then the VF that is being configured is requested to be
16600 	 * trusted.
16601 	 */
16602 	#define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_ENABLE		UINT32_C(0x200000)
16603 	/*
16604 	 * When this bit it set, even if PF reserved pool size is zero,
16605 	 * FW will allow driver to create TX rings in ring alloc,
16606 	 * by reserving TX ring, S3 node dynamically.
16607 	 */
16608 	#define HWRM_FUNC_CFG_INPUT_FLAGS_DYNAMIC_TX_RING_ALLOC	UINT32_C(0x400000)
16609 	/*
16610 	 * This bit requests that the firmware test to see if all the assets
16611 	 * requested in this command (i.e. number of NQ rings) are available.
16612 	 * The firmware will return an error if the requested assets are
16613 	 * not available. The firmware will NOT reserve the assets if they
16614 	 * are available.
16615 	 */
16616 	#define HWRM_FUNC_CFG_INPUT_FLAGS_NQ_ASSETS_TEST		UINT32_C(0x800000)
16617 	/*
16618 	 * This configuration change can be initiated by a PF driver. This
16619 	 * configuration request shall be targeted to a VF. From local host
16620 	 * resident HWRM clients, only the parent PF driver shall be allowed
16621 	 * to initiate this change on one of its children VFs. If this bit is
16622 	 * set to 1, then the VF that is being configured is requested to be
16623 	 * untrusted.
16624 	 */
16625 	#define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_DISABLE		UINT32_C(0x1000000)
16626 	/*
16627 	 * This bit is used by preboot drivers on a PF that require access
16628 	 * to the legacy L2 ring model and legacy 32b doorbells. This
16629 	 * feature is not allowed on VFs and is only relevant for devices
16630 	 * that require a context backing store.
16631 	 */
16632 	#define HWRM_FUNC_CFG_INPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS	UINT32_C(0x2000000)
16633 	/*
16634 	 * If this bit is set to 0, then the interface does not support hot
16635 	 * reset capability which it advertised with the hot_reset_support
16636 	 * flag in HWRM_FUNC_DRV_RGTR. If any of the function has set this
16637 	 * flag to 0, adapter cannot do the hot reset. In this state, if the
16638 	 * firmware receives a hot reset request, firmware must fail the
16639 	 * request. If this bit is set to 1, then interface is renabling the
16640 	 * hot reset capability.
16641 	 */
16642 	#define HWRM_FUNC_CFG_INPUT_FLAGS_HOT_RESET_IF_EN_DIS		UINT32_C(0x4000000)
16643 	/*
16644 	 * If this bit is set to 1, the PF driver is requesting FW
16645 	 * to enable PPP TX PUSH feature on all the TX rings specified in
16646 	 * the num_tx_rings field. By default, the PPP TX push feature is
16647 	 * disabled for all the TX rings of the function. This flag is
16648 	 * ignored if num_tx_rings field is not specified or the function
16649 	 * doesn't support PPP tx push feature.
16650 	 */
16651 	#define HWRM_FUNC_CFG_INPUT_FLAGS_PPP_PUSH_MODE_ENABLE	UINT32_C(0x8000000)
16652 	/*
16653 	 * If this bit is set to 1, the PF driver is requesting FW
16654 	 * to disable PPP TX PUSH feature on all the TX rings specified in
16655 	 * the num_tx_rings field. This flag is ignored if num_tx_rings
16656 	 * field is not specified or the function doesn't support PPP tx
16657 	 * push feature.
16658 	 */
16659 	#define HWRM_FUNC_CFG_INPUT_FLAGS_PPP_PUSH_MODE_DISABLE	UINT32_C(0x10000000)
16660 	/*
16661 	 * If this bit is set to 1, the driver is requesting FW to enable
16662 	 * the BD_METADATA feature for this function. The FW returns error
16663 	 * on this request if the TX_METADATA is enabled for this function.
16664 	 */
16665 	#define HWRM_FUNC_CFG_INPUT_FLAGS_BD_METADATA_ENABLE		UINT32_C(0x20000000)
16666 	/*
16667 	 * If this bit is set to 1, the driver is requesting FW to disable
16668 	 * the BD_METADATA feature for this function. The FW returns error
16669 	 * on this request if the TX_METADATA is enabled for this function.
16670 	 */
16671 	#define HWRM_FUNC_CFG_INPUT_FLAGS_BD_METADATA_DISABLE		UINT32_C(0x40000000)
16672 	uint32_t	enables;
16673 	/*
16674 	 * This bit must be '1' for the admin_mtu field to be
16675 	 * configured.
16676 	 */
16677 	#define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_MTU		UINT32_C(0x1)
16678 	/*
16679 	 * This bit must be '1' for the mru field to be
16680 	 * configured.
16681 	 */
16682 	#define HWRM_FUNC_CFG_INPUT_ENABLES_MRU			UINT32_C(0x2)
16683 	/*
16684 	 * This bit must be '1' for the num_rsscos_ctxs field to be
16685 	 * configured.
16686 	 */
16687 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS	UINT32_C(0x4)
16688 	/*
16689 	 * This bit must be '1' for the num_cmpl_rings field to be
16690 	 * configured.
16691 	 */
16692 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS	UINT32_C(0x8)
16693 	/*
16694 	 * This bit must be '1' for the num_tx_rings field to be
16695 	 * configured.
16696 	 */
16697 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS		UINT32_C(0x10)
16698 	/*
16699 	 * This bit must be '1' for the num_rx_rings field to be
16700 	 * configured.
16701 	 */
16702 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS		UINT32_C(0x20)
16703 	/*
16704 	 * This bit must be '1' for the num_l2_ctxs field to be
16705 	 * configured.
16706 	 */
16707 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS		UINT32_C(0x40)
16708 	/*
16709 	 * This bit must be '1' for the num_vnics field to be
16710 	 * configured.
16711 	 */
16712 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS		UINT32_C(0x80)
16713 	/*
16714 	 * This bit must be '1' for the num_stat_ctxs field to be
16715 	 * configured.
16716 	 */
16717 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS		UINT32_C(0x100)
16718 	/*
16719 	 * This bit must be '1' for the dflt_mac_addr field to be
16720 	 * configured.
16721 	 */
16722 	#define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR		UINT32_C(0x200)
16723 	/*
16724 	 * This bit must be '1' for the dflt_vlan field to be
16725 	 * configured.
16726 	 */
16727 	#define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN		UINT32_C(0x400)
16728 	/*
16729 	 * This bit must be '1' for the dflt_ip_addr field to be
16730 	 * configured.
16731 	 */
16732 	#define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR		UINT32_C(0x800)
16733 	/*
16734 	 * This bit must be '1' for the min_bw field to be
16735 	 * configured.
16736 	 */
16737 	#define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW		UINT32_C(0x1000)
16738 	/*
16739 	 * This bit must be '1' for the max_bw field to be
16740 	 * configured.
16741 	 */
16742 	#define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW		UINT32_C(0x2000)
16743 	/*
16744 	 * This bit must be '1' for the async_event_cr field to be
16745 	 * configured.
16746 	 */
16747 	#define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR	UINT32_C(0x4000)
16748 	/*
16749 	 * This bit must be '1' for the vlan_antispoof_mode field to be
16750 	 * configured.
16751 	 */
16752 	#define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE	UINT32_C(0x8000)
16753 	/*
16754 	 * This bit must be '1' for the allowed_vlan_pris field to be
16755 	 * configured.
16756 	 */
16757 	#define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS	UINT32_C(0x10000)
16758 	/*
16759 	 * This bit must be '1' for the evb_mode field to be
16760 	 * configured.
16761 	 */
16762 	#define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE		UINT32_C(0x20000)
16763 	/*
16764 	 * This bit must be '1' for the num_mcast_filters field to be
16765 	 * configured.
16766 	 */
16767 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS	UINT32_C(0x40000)
16768 	/*
16769 	 * This bit must be '1' for the num_hw_ring_grps field to be
16770 	 * configured.
16771 	 */
16772 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS	UINT32_C(0x80000)
16773 	/*
16774 	 * This bit must be '1' for the cache_linesize field to be
16775 	 * configured.
16776 	 */
16777 	#define HWRM_FUNC_CFG_INPUT_ENABLES_CACHE_LINESIZE	UINT32_C(0x100000)
16778 	/*
16779 	 * This bit must be '1' for the num_msix field to be
16780 	 * configured.
16781 	 */
16782 	#define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX		UINT32_C(0x200000)
16783 	/*
16784 	 * This bit must be '1' for the link admin state field to be
16785 	 * configured.
16786 	 */
16787 	#define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_LINK_STATE	UINT32_C(0x400000)
16788 	/*
16789 	 * This bit must be '1' for the hot_reset_if_en_dis field to be
16790 	 * configured.
16791 	 */
16792 	#define HWRM_FUNC_CFG_INPUT_ENABLES_HOT_RESET_IF_SUPPORT	UINT32_C(0x800000)
16793 	/*
16794 	 * This bit must be '1' for the schq_id field to be
16795 	 * configured.
16796 	 */
16797 	#define HWRM_FUNC_CFG_INPUT_ENABLES_SCHQ_ID		UINT32_C(0x1000000)
16798 	/*
16799 	 * This bit must be '1' for the mpc_chnls field to be
16800 	 * configured.
16801 	 */
16802 	#define HWRM_FUNC_CFG_INPUT_ENABLES_MPC_CHNLS		UINT32_C(0x2000000)
16803 	/*
16804 	 * This bit must be '1' for the partition_min_bw field to be
16805 	 * configured.
16806 	 */
16807 	#define HWRM_FUNC_CFG_INPUT_ENABLES_PARTITION_MIN_BW	UINT32_C(0x4000000)
16808 	/*
16809 	 * This bit must be '1' for the partition_max_bw field to be
16810 	 * configured.
16811 	 */
16812 	#define HWRM_FUNC_CFG_INPUT_ENABLES_PARTITION_MAX_BW	UINT32_C(0x8000000)
16813 	/*
16814 	 * This bit must be '1' for the tpid field to be
16815 	 * configured. This bit is only valid when dflt_vlan enable
16816 	 * bit is set.
16817 	 */
16818 	#define HWRM_FUNC_CFG_INPUT_ENABLES_TPID			UINT32_C(0x10000000)
16819 	/*
16820 	 * This bit must be '1' for the host_mtu field to be
16821 	 * configured.
16822 	 */
16823 	#define HWRM_FUNC_CFG_INPUT_ENABLES_HOST_MTU		UINT32_C(0x20000000)
16824 	/*
16825 	 * This bit must be '1' for the num_ktls_tx_key_ctxs field to be
16826 	 * configured.
16827 	 */
16828 	#define HWRM_FUNC_CFG_INPUT_ENABLES_KTLS_TX_KEY_CTXS	UINT32_C(0x40000000)
16829 	/*
16830 	 * This bit must be '1' for the num_ktls_rx_key_ctxs field to be
16831 	 * configured.
16832 	 */
16833 	#define HWRM_FUNC_CFG_INPUT_ENABLES_KTLS_RX_KEY_CTXS	UINT32_C(0x80000000)
16834 	/*
16835 	 * This field can be used by the admin PF to configure
16836 	 * mtu of foster PFs.
16837 	 * The maximum transmission unit of the function.
16838 	 * The HWRM should make sure that the mtu of
16839 	 * the function does not exceed the mtu of the physical
16840 	 * port that this function is associated with.
16841 	 *
16842 	 * In addition to configuring mtu per function, it is
16843 	 * possible to configure mtu per transmit ring.
16844 	 * By default, the mtu of each transmit ring associated
16845 	 * with a function is equal to the mtu of the function.
16846 	 * The HWRM should make sure that the mtu of each transmit
16847 	 * ring that is assigned to a function has a valid mtu.
16848 	 */
16849 	uint16_t	admin_mtu;
16850 	/*
16851 	 * The maximum receive unit of the function.
16852 	 * The HWRM should make sure that the mru of
16853 	 * the function does not exceed the mru of the physical
16854 	 * port that this function is associated with.
16855 	 *
16856 	 * In addition to configuring mru per function, it is
16857 	 * possible to configure mru per vnic.
16858 	 * By default, the mru of each vnic associated
16859 	 * with a function is equal to the mru of the function.
16860 	 * The HWRM should make sure that the mru of each vnic
16861 	 * that is assigned to a function has a valid mru.
16862 	 */
16863 	uint16_t	mru;
16864 	/*
16865 	 * The number of RSS/COS contexts requested for the
16866 	 * function.
16867 	 */
16868 	uint16_t	num_rsscos_ctxs;
16869 	/*
16870 	 * The number of completion rings requested for the
16871 	 * function. This does not include the rings allocated
16872 	 * to any children functions if any.
16873 	 */
16874 	uint16_t	num_cmpl_rings;
16875 	/*
16876 	 * The number of transmit rings requested for the function.
16877 	 * This does not include the rings allocated to any
16878 	 * children functions if any.
16879 	 */
16880 	uint16_t	num_tx_rings;
16881 	/*
16882 	 * The number of receive rings requested for the function.
16883 	 * This does not include the rings allocated
16884 	 * to any children functions if any.
16885 	 */
16886 	uint16_t	num_rx_rings;
16887 	/* The requested number of L2 contexts for the function. */
16888 	uint16_t	num_l2_ctxs;
16889 	/* The requested number of vnics for the function. */
16890 	uint16_t	num_vnics;
16891 	/* The requested number of statistic contexts for the function. */
16892 	uint16_t	num_stat_ctxs;
16893 	/*
16894 	 * The number of HW ring groups that should
16895 	 * be reserved for this function.
16896 	 */
16897 	uint16_t	num_hw_ring_grps;
16898 	/* The default MAC address for the function being configured. */
16899 	uint8_t	dflt_mac_addr[6];
16900 	/*
16901 	 * The default VLAN for the function being configured.
16902 	 * This field's format is same as 802.1Q Tag's
16903 	 * Tag Control Information (TCI) format that includes both
16904 	 * Priority Code Point (PCP) and VLAN Identifier (VID).
16905 	 */
16906 	uint16_t	dflt_vlan;
16907 	/*
16908 	 * The default IP address for the function being configured.
16909 	 * This address is only used in enabling source property check.
16910 	 */
16911 	uint32_t	dflt_ip_addr[4];
16912 	/*
16913 	 * Minimum guaranteed transmit bandwidth for this function. When
16914 	 * specified for a PF, does not affect traffic from the PF's child VFs.
16915 	 * A value of 0 indicates the minimum bandwidth is not configured.
16916 	 */
16917 	uint32_t	min_bw;
16918 	/* The bandwidth value. */
16919 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
16920 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT		0
16921 	/* The granularity of the value (bits or bytes). */
16922 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE			UINT32_C(0x10000000)
16923 	/* Value is in bits. */
16924 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
16925 	/* Value is in bytes. */
16926 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
16927 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST		HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
16928 	/* bw_value_unit is 3 b */
16929 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
16930 	#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT	29
16931 	/* Value is in Mb or MB (base 10). */
16932 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
16933 	/* Value is in Kb or KB (base 10). */
16934 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
16935 	/* Value is in bits or bytes. */
16936 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
16937 	/* Value is in Gb or GB (base 10). */
16938 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
16939 	/* Value is in 1/100th of a percentage of total bandwidth. */
16940 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
16941 	/* Invalid unit */
16942 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
16943 		#define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
16944 	/*
16945 	 * Maximum transmit rate for this function. When specified for a PF,
16946 	 * does not affect traffic from the PF's child VFs.
16947 	 * A value of 0 indicates that the maximum bandwidth is not configured.
16948 	 */
16949 	uint32_t	max_bw;
16950 	/* The bandwidth value. */
16951 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
16952 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT		0
16953 	/* The granularity of the value (bits or bytes). */
16954 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE			UINT32_C(0x10000000)
16955 	/* Value is in bits. */
16956 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
16957 	/* Value is in bytes. */
16958 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
16959 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST		HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
16960 	/* bw_value_unit is 3 b */
16961 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
16962 	#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT	29
16963 	/* Value is in Mb or MB (base 10). */
16964 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
16965 	/* Value is in Kb or KB (base 10). */
16966 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
16967 	/* Value is in bits or bytes. */
16968 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
16969 	/* Value is in Gb or GB (base 10). */
16970 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
16971 	/* Value is in 1/100th of a percentage of total bandwidth. */
16972 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
16973 	/* Invalid unit */
16974 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
16975 		#define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
16976 	/*
16977 	 * ID of the target completion ring for receiving asynchronous
16978 	 * event completions. If this field is not valid, then the
16979 	 * HWRM shall use the default completion ring of the function
16980 	 * that is being configured as the target completion ring for
16981 	 * providing any asynchronous event completions for that
16982 	 * function.
16983 	 * If this field is valid, then the HWRM shall use the
16984 	 * completion ring identified by this ID as the target
16985 	 * completion ring for providing any asynchronous event
16986 	 * completions for the function that is being configured.
16987 	 */
16988 	uint16_t	async_event_cr;
16989 	/* VLAN Anti-spoofing mode. */
16990 	uint8_t	vlan_antispoof_mode;
16991 	/* No VLAN anti-spoofing checks are enabled */
16992 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK		UINT32_C(0x0)
16993 	/* Validate VLAN against the configured VLAN(s) */
16994 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN	UINT32_C(0x1)
16995 	/* Insert VLAN if it does not exist, otherwise discard */
16996 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE	UINT32_C(0x2)
16997 	/* Insert VLAN if it does not exist, override VLAN if it exists */
16998 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN UINT32_C(0x3)
16999 	#define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_LAST		HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN
17000 	/*
17001 	 * This bit field defines VLAN PRIs that are allowed on
17002 	 * this function.
17003 	 * If nth bit is set, then VLAN PRI n is allowed on this
17004 	 * function.
17005 	 */
17006 	uint8_t	allowed_vlan_pris;
17007 	/*
17008 	 * The evb_mode is configured on a per port basis. The default evb_mode
17009 	 * is configured based on the NVM EVB mode setting upon firmware
17010 	 * initialization. The HWRM allows a PF driver to change EVB mode for a
17011 	 * port used by the PF only when one of the following conditions is
17012 	 * satisfied.
17013 	 * 1. The current operating mode is single function mode.
17014 	 *	(ie. one PF per port)
17015 	 * 2. For SmartNIC, any one of the PAXC PFs is permitted to change the
17016 	 *	EVB mode of the port used by the PAXC PF. None of the X86 PFs
17017 	 *	should have privileges.
17018 	 * The HWRM doesn't permit any PFs to change the underlying EVB mode
17019 	 * when running as MHB or NPAR mode in performance NIC configuration.
17020 	 * The HWRM doesn't permit a VF driver to change the EVB mode.
17021 	 * Once the HWRM determines a function doesn't meet the conditions
17022 	 * to configure the EVB mode, it sets the evb_mode_cfg_not_supported
17023 	 * flag in HWRM_FUNC_QCAPS command response for the function.
17024 	 * The HWRM takes into account the switching of EVB mode from one to
17025 	 * another and reconfigure hardware resources as required. The
17026 	 * switching from VEB to VEPA mode requires the disabling of the
17027 	 * loopback traffic. Additionally, source knockouts are handled
17028 	 * differently in VEB and VEPA modes.
17029 	 */
17030 	uint8_t	evb_mode;
17031 	/* No Edge Virtual Bridging (EVB) */
17032 	#define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
17033 	/* Virtual Ethernet Bridge (VEB) */
17034 	#define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB	UINT32_C(0x1)
17035 	/* Virtual Ethernet Port Aggregator (VEPA) */
17036 	#define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA   UINT32_C(0x2)
17037 	#define HWRM_FUNC_CFG_INPUT_EVB_MODE_LAST  HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA
17038 	uint8_t	options;
17039 	/*
17040 	 * This value indicates the PCIE device cache line size.
17041 	 * The cache line size allows the DMA writes to terminate and
17042 	 * start at the cache boundary.
17043 	 */
17044 	#define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_MASK	UINT32_C(0x3)
17045 	#define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SFT	0
17046 	/* Cache Line Size 64 bytes */
17047 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_64	UINT32_C(0x0)
17048 	/* Cache Line Size 128 bytes */
17049 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128	UINT32_C(0x1)
17050 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_LAST	HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
17051 	/* This value is the virtual link admin state setting. */
17052 	#define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_MASK	UINT32_C(0xc)
17053 	#define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_SFT	2
17054 	/* Admin state is forced down. */
17055 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN  (UINT32_C(0x0) << 2)
17056 	/* Admin state is forced up. */
17057 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP	(UINT32_C(0x1) << 2)
17058 	/*
17059 	 * Admin state is in auto mode - is to follow the physical link
17060 	 * state.
17061 	 */
17062 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO	(UINT32_C(0x2) << 2)
17063 		#define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_LAST	HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
17064 	/* Reserved for future. */
17065 	#define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_MASK		UINT32_C(0xf0)
17066 	#define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_SFT			4
17067 	/*
17068 	 * The number of multicast filters that should
17069 	 * be reserved for this function on the RX side.
17070 	 */
17071 	uint16_t	num_mcast_filters;
17072 	/* Used by a PF driver to associate a SCHQ with a VF. */
17073 	uint16_t	schq_id;
17074 	uint16_t	mpc_chnls;
17075 	/*
17076 	 * When this bit is '1', the caller requests to enable a MPC
17077 	 * channel with destination to the TX crypto engine block.
17078 	 * When this bit is '0', this flag has no effect.
17079 	 */
17080 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TCE_ENABLE	UINT32_C(0x1)
17081 	/*
17082 	 * When this bit is '1', the caller requests to disable a MPC
17083 	 * channel with destination to the TX crypto engine block.
17084 	 * When this bit is '0', this flag has no effect.
17085 	 */
17086 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TCE_DISABLE	UINT32_C(0x2)
17087 	/*
17088 	 * When this bit is '1', the caller requests to enable a MPC
17089 	 * channel with destination to the RX crypto engine block.
17090 	 * When this bit is '0', this flag has no effect.
17091 	 */
17092 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RCE_ENABLE	UINT32_C(0x4)
17093 	/*
17094 	 * When this bit is '1', the caller requests to disable a MPC
17095 	 * channel with destination to the RX crypto engine block.
17096 	 * When this bit is '0', this flag has no effect.
17097 	 */
17098 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RCE_DISABLE	UINT32_C(0x8)
17099 	/*
17100 	 * When this bit is '1', the caller requests to enable a MPC
17101 	 * channel with destination to the TX configurable flow processing
17102 	 * block. When this bit is '0', this flag has no effect.
17103 	 */
17104 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TE_CFA_ENABLE	UINT32_C(0x10)
17105 	/*
17106 	 * When this bit is '1', the caller requests to disable a MPC
17107 	 * channel with destination to the TX configurable flow processing
17108 	 * block. When this bit is '0', this flag has no effect.
17109 	 */
17110 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TE_CFA_DISABLE	UINT32_C(0x20)
17111 	/*
17112 	 * When this bit is '1', the caller requests to enable a MPC
17113 	 * channel with destination to the RX configurable flow processing
17114 	 * block. When this bit is '0', this flag has no effect.
17115 	 */
17116 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RE_CFA_ENABLE	UINT32_C(0x40)
17117 	/*
17118 	 * When this bit is '1', the caller requests to disable a MPC
17119 	 * channel with destination to the RX configurable flow processing
17120 	 * block. When this bit is '0', this flag has no effect.
17121 	 */
17122 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RE_CFA_DISABLE	UINT32_C(0x80)
17123 	/*
17124 	 * When this bit is '1', the caller requests to enable a MPC
17125 	 * channel with destination to the primate processor block.
17126 	 * When this bit is '0', this flag has no effect.
17127 	 */
17128 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_PRIMATE_ENABLE	UINT32_C(0x100)
17129 	/*
17130 	 * When this bit is '1', the caller requests to disable a MPC
17131 	 * channel with destination to the primate processor block.
17132 	 * When this bit is '0', this flag has no effect.
17133 	 */
17134 	#define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_PRIMATE_DISABLE	UINT32_C(0x200)
17135 	/*
17136 	 * Minimum guaranteed bandwidth for the network partition made up
17137 	 * of the caller physical function and all its child virtual
17138 	 * functions. The rate is specified as a percentage of the bandwidth
17139 	 * of the link the partition is associated with. A value of 0
17140 	 * indicates that no minimum bandwidth is configured. The sum of the
17141 	 * minimum bandwidths for all partitions on a link must not exceed
17142 	 * 100%.
17143 	 * The format of this field is defined to match min_bw, even though
17144 	 * it does not allow all the options for min_bw at this time.
17145 	 */
17146 	uint32_t	partition_min_bw;
17147 	/* The bandwidth value. */
17148 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
17149 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_SFT		0
17150 	/*
17151 	 * The granularity of the value (bits or bytes). Firmware ignores
17152 	 * this field.
17153 	 */
17154 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE			UINT32_C(0x10000000)
17155 	/* Value is in bits. */
17156 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
17157 	/* Value is in bytes. */
17158 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
17159 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_LAST		HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_BYTES
17160 	/* Bandwidth units. Must be set to percent1_100. */
17161 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
17162 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_SFT	29
17163 	/* Value is in hundredths of a percent of link bandwidth. */
17164 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
17165 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100
17166 	/*
17167 	 * The maximum bandwidth that may be used by the network partition
17168 	 * made up of the caller physical function and all its child virtual
17169 	 * functions. The rate is specified as a percentage of the bandwidth
17170 	 * of the link the partition is associated with. A value of 0
17171 	 * indicates that no maximum bandwidth is configured.
17172 	 * The format of this field is defined to match max_bw, even though it
17173 	 * does not allow all the options for max_bw at this time.
17174 	 */
17175 	uint32_t	partition_max_bw;
17176 	/* The bandwidth value. */
17177 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
17178 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_SFT		0
17179 	/*
17180 	 * The granularity of the value (bits or bytes). Firmware ignores
17181 	 * this field.
17182 	 */
17183 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE			UINT32_C(0x10000000)
17184 	/* Value is in bits. */
17185 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
17186 	/* Value is in bytes. */
17187 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
17188 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_LAST		HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_BYTES
17189 	/* Bandwidth units. Must be set to percent1_100. */
17190 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
17191 	#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_SFT	29
17192 	/* Value is in hundredths of a percent of link bandwidth. */
17193 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
17194 		#define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100
17195 	/*
17196 	 * The TPID for the function for which default VLAN
17197 	 * is configured. If the dflt_vlan is not specified
17198 	 * with the TPID, FW returns error. If the TPID is
17199 	 * not specified with dflt_vlan, the default TPID of
17200 	 * 0x8100 will be used. This field is specified in
17201 	 * network byte order.
17202 	 */
17203 	uint16_t	tpid;
17204 	/*
17205 	 * This field can be used by the host PF to configure
17206 	 * mtu value.
17207 	 * The maximum transmission unit of the function.
17208 	 * The HWRM should make sure that the mtu of
17209 	 * the function does not exceed the mtu of the physical
17210 	 * port that this function is associated with.
17211 	 *
17212 	 * In addition to configuring mtu per function, it is
17213 	 * possible to configure mtu per transmit ring.
17214 	 * By default, the mtu of each transmit ring associated
17215 	 * with a function is equal to the mtu of the function.
17216 	 * The HWRM should make sure that the mtu of each transmit
17217 	 * ring that is assigned to a function has a valid mtu.
17218 	 */
17219 	uint16_t	host_mtu;
17220 	uint32_t	flags2;
17221 	/*
17222 	 * If this bit is set to 1, the driver is requesting the firmware
17223 	 * to see if the assets (i.e., the number of KTLS key contexts)
17224 	 * requested in this command are available. The firmware will return
17225 	 * an error if the requested assets are not available. The firmware
17226 	 * will NOT reserve the assets if they are available.
17227 	 */
17228 	#define HWRM_FUNC_CFG_INPUT_FLAGS2_KTLS_KEY_CTX_ASSETS_TEST	UINT32_C(0x1)
17229 	/*
17230 	 * If this bit is set to 1, the driver is requesting the firmware
17231 	 * to see if the assets (i.e., the number of QUIC key contexts)
17232 	 * requested in this command are available. The firmware will return
17233 	 * an error if the requested assets are not available. The firmware
17234 	 * will NOT reserve the assets if they are available.
17235 	 */
17236 	#define HWRM_FUNC_CFG_INPUT_FLAGS2_QUIC_KEY_CTX_ASSETS_TEST	UINT32_C(0x2)
17237 	uint32_t	enables2;
17238 	/*
17239 	 * This bit must be '1' for the kdnet_mode field to be
17240 	 * configured.
17241 	 */
17242 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_KDNET		UINT32_C(0x1)
17243 	/*
17244 	 * This bit must be '1' for the db_page_size field to be
17245 	 * configured. Legacy controller core FW may silently ignore
17246 	 * the db_page_size programming request through this command.
17247 	 */
17248 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_DB_PAGE_SIZE		UINT32_C(0x2)
17249 	/*
17250 	 * This bit must be '1' for the num_quic_tx_key_ctxs field to be
17251 	 * configured.
17252 	 */
17253 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_QUIC_TX_KEY_CTXS	UINT32_C(0x4)
17254 	/*
17255 	 * This bit must be '1' for the num_quic_rx_key_ctxs field to be
17256 	 * configured.
17257 	 */
17258 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_QUIC_RX_KEY_CTXS	UINT32_C(0x8)
17259 	/*
17260 	 * This bit must be '1' for the roce_max_av_per_vf field to be
17261 	 * configured.
17262 	 */
17263 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_ROCE_MAX_AV_PER_VF	UINT32_C(0x10)
17264 	/*
17265 	 * This bit must be '1' for the roce_max_cq_per_vf field to be
17266 	 * configured. Only valid for PF.
17267 	 */
17268 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_ROCE_MAX_CQ_PER_VF	UINT32_C(0x20)
17269 	/*
17270 	 * This bit must be '1' for the roce_max_mrw_per_vf field to be
17271 	 * configured. Only valid for PF.
17272 	 */
17273 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_ROCE_MAX_MRW_PER_VF	UINT32_C(0x40)
17274 	/*
17275 	 * This bit must be '1' for the roce_max_qp_per_vf field to be
17276 	 * configured.
17277 	 */
17278 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_ROCE_MAX_QP_PER_VF	UINT32_C(0x80)
17279 	/*
17280 	 * This bit must be '1' for the roce_max_srq_per_vf field to be
17281 	 * configured. Only valid for PF.
17282 	 */
17283 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_ROCE_MAX_SRQ_PER_VF	UINT32_C(0x100)
17284 	/*
17285 	 * This bit must be '1' for the roce_max_gid_per_vf field to be
17286 	 * configured. Only valid for PF.
17287 	 */
17288 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_ROCE_MAX_GID_PER_VF	UINT32_C(0x200)
17289 	/*
17290 	 * This bit must be '1' for the xid_partition_cfg field to be
17291 	 * configured. Only valid for PF.
17292 	 */
17293 	#define HWRM_FUNC_CFG_INPUT_ENABLES2_XID_PARTITION_CFG	UINT32_C(0x400)
17294 	/*
17295 	 * KDNet mode for the port for this function. If NPAR is
17296 	 * also configured on this port, it takes precedence. KDNet
17297 	 * mode is ignored for a VF.
17298 	 */
17299 	uint8_t	port_kdnet_mode;
17300 	/* KDNet mode is not enabled. */
17301 	#define HWRM_FUNC_CFG_INPUT_PORT_KDNET_MODE_DISABLED UINT32_C(0x0)
17302 	/* KDNet mode enabled. */
17303 	#define HWRM_FUNC_CFG_INPUT_PORT_KDNET_MODE_ENABLED  UINT32_C(0x1)
17304 	#define HWRM_FUNC_CFG_INPUT_PORT_KDNET_MODE_LAST	HWRM_FUNC_CFG_INPUT_PORT_KDNET_MODE_ENABLED
17305 	/*
17306 	 * This field can be used by the PF driver to configure the doorbell
17307 	 * page size. L2 driver can use different pages to ring the doorbell
17308 	 * for L2 push operation. The doorbell page size should be configured
17309 	 * to match the native CPU page size for proper RoCE and L2 doorbell
17310 	 * operations. This value supersedes the older method of configuring
17311 	 * the doorbell page size by the RoCE driver using the command queue
17312 	 * method. The default is 4K.
17313 	 */
17314 	uint8_t	db_page_size;
17315 	/* DB page size is 4KB. */
17316 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_4KB   UINT32_C(0x0)
17317 	/* DB page size is 8KB. */
17318 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_8KB   UINT32_C(0x1)
17319 	/* DB page size is 16KB. */
17320 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_16KB  UINT32_C(0x2)
17321 	/* DB page size is 32KB. */
17322 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_32KB  UINT32_C(0x3)
17323 	/* DB page size is 64KB. */
17324 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_64KB  UINT32_C(0x4)
17325 	/* DB page size is 128KB. */
17326 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_128KB UINT32_C(0x5)
17327 	/* DB page size is 256KB. */
17328 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_256KB UINT32_C(0x6)
17329 	/* DB page size is 512KB. */
17330 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_512KB UINT32_C(0x7)
17331 	/* DB page size is 1MB. */
17332 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_1MB   UINT32_C(0x8)
17333 	/* DB page size is 2MB. */
17334 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_2MB   UINT32_C(0x9)
17335 	/* DB page size is 4MB. */
17336 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_4MB   UINT32_C(0xa)
17337 	#define HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_LAST HWRM_FUNC_CFG_INPUT_DB_PAGE_SIZE_4MB
17338 	uint8_t	unused_1[2];
17339 	/* Number of KTLS Tx Key Contexts requested. */
17340 	uint32_t	num_ktls_tx_key_ctxs;
17341 	/* Number of KTLS Rx Key Contexts requested. */
17342 	uint32_t	num_ktls_rx_key_ctxs;
17343 	/* Number of QUIC Tx Key Contexts requested. */
17344 	uint32_t	num_quic_tx_key_ctxs;
17345 	/* Number of QUIC Rx Key Contexts requested. */
17346 	uint32_t	num_quic_rx_key_ctxs;
17347 	/* Number of AVs per VF. Only valid for PF. */
17348 	uint32_t	roce_max_av_per_vf;
17349 	/* Number of CQs per VF. Only valid for PF. */
17350 	uint32_t	roce_max_cq_per_vf;
17351 	/* Number of MR/MWs per VF. Only valid for PF. */
17352 	uint32_t	roce_max_mrw_per_vf;
17353 	/* Number of QPs per VF. Only valid for PF. */
17354 	uint32_t	roce_max_qp_per_vf;
17355 	/* Number of SRQs per VF. Only valid for PF. */
17356 	uint32_t	roce_max_srq_per_vf;
17357 	/* Number of GIDs per VF. Only valid for PF. */
17358 	uint32_t	roce_max_gid_per_vf;
17359 	/*
17360 	 * Bitmap of context types that have XID partition enabled.
17361 	 * Only valid for PF.
17362 	 */
17363 	uint16_t	xid_partition_cfg;
17364 	/*
17365 	 * When this bit is '1', it indicates that driver enables XID
17366 	 * partition on Tx crypto key contexts.
17367 	 */
17368 	#define HWRM_FUNC_CFG_INPUT_XID_PARTITION_CFG_TX_CK	UINT32_C(0x1)
17369 	/*
17370 	 * When this bit is '1', it indicates that driver enables XID
17371 	 * partition on Rx crypto key contexts.
17372 	 */
17373 	#define HWRM_FUNC_CFG_INPUT_XID_PARTITION_CFG_RX_CK	UINT32_C(0x2)
17374 	uint16_t	unused_2;
17375 } hwrm_func_cfg_input_t, *phwrm_func_cfg_input_t;
17376 
17377 /* hwrm_func_cfg_output (size:128b/16B) */
17378 
17379 typedef struct hwrm_func_cfg_output {
17380 	/* The specific error status for the command. */
17381 	uint16_t	error_code;
17382 	/* The HWRM command request type. */
17383 	uint16_t	req_type;
17384 	/* The sequence ID from the original command. */
17385 	uint16_t	seq_id;
17386 	/* The length of the response data in number of bytes. */
17387 	uint16_t	resp_len;
17388 	uint8_t	unused_0[7];
17389 	/*
17390 	 * This field is used in Output records to indicate that the output
17391 	 * is completely written to RAM. This field should be read as '1'
17392 	 * to indicate that the output has been completely written. When
17393 	 * writing a command completion or response to an internal processor,
17394 	 * the order of writes has to be such that this field is written last.
17395 	 */
17396 	uint8_t	valid;
17397 } hwrm_func_cfg_output_t, *phwrm_func_cfg_output_t;
17398 
17399 /* hwrm_func_cfg_cmd_err (size:64b/8B) */
17400 
17401 typedef struct hwrm_func_cfg_cmd_err {
17402 	/* command specific error codes for the cmd_err field in hwrm_err_output */
17403 	uint8_t	code;
17404 	/* Unknown error. */
17405 	#define HWRM_FUNC_CFG_CMD_ERR_CODE_UNKNOWN			UINT32_C(0x0)
17406 	/* The partition minimum bandwidth is out of range. */
17407 	#define HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_MIN_BW_RANGE	UINT32_C(0x1)
17408 	/* The minimum bandwidth is more than the maximum bandwidth. */
17409 	#define HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_MIN_MORE_THAN_MAX  UINT32_C(0x2)
17410 	/*
17411 	 * The NIC does not support enforcement of a minimum guaranteed
17412 	 * bandwidth for a partition.
17413 	 */
17414 	#define HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_MIN_BW_UNSUPPORTED UINT32_C(0x3)
17415 	/* Partition bandwidths must be specified as a percentage. */
17416 	#define HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_BW_PERCENT	UINT32_C(0x4)
17417 	#define HWRM_FUNC_CFG_CMD_ERR_CODE_LAST			HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_BW_PERCENT
17418 	uint8_t	unused_0[7];
17419 } hwrm_func_cfg_cmd_err_t, *phwrm_func_cfg_cmd_err_t;
17420 
17421 /********************
17422  * hwrm_func_qstats *
17423  ********************/
17424 
17425 
17426 /* hwrm_func_qstats_input (size:192b/24B) */
17427 
17428 typedef struct hwrm_func_qstats_input {
17429 	/* The HWRM command request type. */
17430 	uint16_t	req_type;
17431 	/*
17432 	 * The completion ring to send the completion event on. This should
17433 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
17434 	 */
17435 	uint16_t	cmpl_ring;
17436 	/*
17437 	 * The sequence ID is used by the driver for tracking multiple
17438 	 * commands. This ID is treated as opaque data by the firmware and
17439 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
17440 	 */
17441 	uint16_t	seq_id;
17442 	/*
17443 	 * The target ID of the command:
17444 	 * * 0x0-0xFFF8 - The function ID
17445 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17446 	 * * 0xFFFD - Reserved for user-space HWRM interface
17447 	 * * 0xFFFF - HWRM
17448 	 */
17449 	uint16_t	target_id;
17450 	/*
17451 	 * A physical address pointer pointing to a host buffer that the
17452 	 * command's response data will be written. This can be either a host
17453 	 * physical address (HPA) or a guest physical address (GPA) and must
17454 	 * point to a physically contiguous block of memory.
17455 	 */
17456 	uint64_t	resp_addr;
17457 	/*
17458 	 * Function ID of the function that is being queried.
17459 	 * 0xFF... (All Fs) if the query is for the requesting
17460 	 * function.
17461 	 * A privileged PF can query for other function's statistics.
17462 	 */
17463 	uint16_t	fid;
17464 	uint8_t	flags;
17465 	/*
17466 	 * This bit should be set to 1 when request is for only RoCE
17467 	 * statistics. This will be honored only if the caller_fid is
17468 	 * a privileged PF. In all other cases FID and caller_fid should
17469 	 * be the same.
17470 	 */
17471 	#define HWRM_FUNC_QSTATS_INPUT_FLAGS_ROCE_ONLY	UINT32_C(0x1)
17472 	/*
17473 	 * This bit should be set to 1 when request is for the counter mask,
17474 	 * representing the width of each of the stats counters, rather
17475 	 * than counters themselves.
17476 	 */
17477 	#define HWRM_FUNC_QSTATS_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x2)
17478 	/*
17479 	 * This bit should be set to 1 when request is for only L2
17480 	 * statistics. This will be honored only if the caller_fid is
17481 	 * a privileged PF. In all other cases FID and caller_fid should
17482 	 * be the same.
17483 	 */
17484 	#define HWRM_FUNC_QSTATS_INPUT_FLAGS_L2_ONLY	UINT32_C(0x4)
17485 	uint8_t	unused_0[5];
17486 } hwrm_func_qstats_input_t, *phwrm_func_qstats_input_t;
17487 
17488 /* hwrm_func_qstats_output (size:1408b/176B) */
17489 
17490 typedef struct hwrm_func_qstats_output {
17491 	/* The specific error status for the command. */
17492 	uint16_t	error_code;
17493 	/* The HWRM command request type. */
17494 	uint16_t	req_type;
17495 	/* The sequence ID from the original command. */
17496 	uint16_t	seq_id;
17497 	/* The length of the response data in number of bytes. */
17498 	uint16_t	resp_len;
17499 	/* Number of transmitted unicast packets on the function. */
17500 	uint64_t	tx_ucast_pkts;
17501 	/* Number of transmitted multicast packets on the function. */
17502 	uint64_t	tx_mcast_pkts;
17503 	/* Number of transmitted broadcast packets on the function. */
17504 	uint64_t	tx_bcast_pkts;
17505 	/*
17506 	 * Number of transmitted packets that were discarded due to
17507 	 * internal NIC resource problems. For transmit, this
17508 	 * can only happen if TMP is configured to allow dropping
17509 	 * in HOL blocking conditions, which is not a normal
17510 	 * configuration.
17511 	 */
17512 	uint64_t	tx_discard_pkts;
17513 	/*
17514 	 * Number of dropped packets on transmit path on the function.
17515 	 * These are packets that have been marked for drop by
17516 	 * the TE CFA block or are packets that exceeded the
17517 	 * transmit MTU limit for the function.
17518 	 */
17519 	uint64_t	tx_drop_pkts;
17520 	/* Number of transmitted bytes for unicast traffic on the function. */
17521 	uint64_t	tx_ucast_bytes;
17522 	/* Number of transmitted bytes for multicast traffic on the function. */
17523 	uint64_t	tx_mcast_bytes;
17524 	/* Number of transmitted bytes for broadcast traffic on the function. */
17525 	uint64_t	tx_bcast_bytes;
17526 	/* Number of received unicast packets on the function. */
17527 	uint64_t	rx_ucast_pkts;
17528 	/* Number of received multicast packets on the function. */
17529 	uint64_t	rx_mcast_pkts;
17530 	/* Number of received broadcast packets on the function. */
17531 	uint64_t	rx_bcast_pkts;
17532 	/*
17533 	 * Number of received packets that were discarded on the function
17534 	 * due to resource limitations. This can happen for 3 reasons.
17535 	 * # The BD used for the packet has a bad format.
17536 	 * # There were no BDs available in the ring for the packet.
17537 	 * # There were no BDs available on-chip for the packet.
17538 	 */
17539 	uint64_t	rx_discard_pkts;
17540 	/*
17541 	 * Number of dropped packets on received path on the function.
17542 	 * These are packets that have been marked for drop by the
17543 	 * RE CFA.
17544 	 */
17545 	uint64_t	rx_drop_pkts;
17546 	/* Number of received bytes for unicast traffic on the function. */
17547 	uint64_t	rx_ucast_bytes;
17548 	/* Number of received bytes for multicast traffic on the function. */
17549 	uint64_t	rx_mcast_bytes;
17550 	/* Number of received bytes for broadcast traffic on the function. */
17551 	uint64_t	rx_bcast_bytes;
17552 	/* Number of aggregated unicast packets on the function. */
17553 	uint64_t	rx_agg_pkts;
17554 	/* Number of aggregated unicast bytes on the function. */
17555 	uint64_t	rx_agg_bytes;
17556 	/* Number of aggregation events on the function. */
17557 	uint64_t	rx_agg_events;
17558 	/* Number of aborted aggregations on the function. */
17559 	uint64_t	rx_agg_aborts;
17560 	/*
17561 	 * This field is the sequence of the statistics of a function being
17562 	 * cleared. Firmware starts the sequence from zero. It increments
17563 	 * the sequence number every time the statistics of the function
17564 	 * are cleared, which can be triggered by a clear statistics request
17565 	 * or by freeing all statistics contexts of the function. If a user
17566 	 * is interested in knowing if the statistics have been cleared
17567 	 * since the last query, it can keep track of this sequence number
17568 	 * between queries.
17569 	 */
17570 	uint8_t	clear_seq;
17571 	uint8_t	unused_0[6];
17572 	/*
17573 	 * This field is used in Output records to indicate that the output
17574 	 * is completely written to RAM. This field should be read as '1'
17575 	 * to indicate that the output has been completely written. When
17576 	 * writing a command completion or response to an internal processor,
17577 	 * the order of writes has to be such that this field is written last.
17578 	 */
17579 	uint8_t	valid;
17580 } hwrm_func_qstats_output_t, *phwrm_func_qstats_output_t;
17581 
17582 /************************
17583  * hwrm_func_qstats_ext *
17584  ************************/
17585 
17586 
17587 /* hwrm_func_qstats_ext_input (size:256b/32B) */
17588 
17589 typedef struct hwrm_func_qstats_ext_input {
17590 	/* The HWRM command request type. */
17591 	uint16_t	req_type;
17592 	/*
17593 	 * The completion ring to send the completion event on. This should
17594 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
17595 	 */
17596 	uint16_t	cmpl_ring;
17597 	/*
17598 	 * The sequence ID is used by the driver for tracking multiple
17599 	 * commands. This ID is treated as opaque data by the firmware and
17600 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
17601 	 */
17602 	uint16_t	seq_id;
17603 	/*
17604 	 * The target ID of the command:
17605 	 * * 0x0-0xFFF8 - The function ID
17606 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17607 	 * * 0xFFFD - Reserved for user-space HWRM interface
17608 	 * * 0xFFFF - HWRM
17609 	 */
17610 	uint16_t	target_id;
17611 	/*
17612 	 * A physical address pointer pointing to a host buffer that the
17613 	 * command's response data will be written. This can be either a host
17614 	 * physical address (HPA) or a guest physical address (GPA) and must
17615 	 * point to a physically contiguous block of memory.
17616 	 */
17617 	uint64_t	resp_addr;
17618 	/*
17619 	 * Function ID of the function that is being queried.
17620 	 * 0xFF... (All Fs) if the query is for the requesting
17621 	 * function.
17622 	 * A privileged PF can query for other function's statistics.
17623 	 */
17624 	uint16_t	fid;
17625 	uint8_t	flags;
17626 	/*
17627 	 * This bit should be set to 1 when request is for only RoCE
17628 	 * statistics. This will be honored only if the caller_fid is
17629 	 * a privileged PF. In all other cases FID and caller_fid should
17630 	 * be the same.
17631 	 */
17632 	#define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_ROCE_ONLY	UINT32_C(0x1)
17633 	/*
17634 	 * This bit should be set to 1 when request is for the counter mask
17635 	 * representing the width of each of the stats counters, rather
17636 	 * than counters themselves.
17637 	 */
17638 	#define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x2)
17639 	uint8_t	unused_0[1];
17640 	uint32_t	enables;
17641 	/*
17642 	 * This bit must be '1' for the schq_id and traffic_class fields to
17643 	 * be configured.
17644 	 */
17645 	#define HWRM_FUNC_QSTATS_EXT_INPUT_ENABLES_SCHQ_ID	UINT32_C(0x1)
17646 	/* Specifies the SCHQ for which to gather statistics */
17647 	uint16_t	schq_id;
17648 	/*
17649 	 * Specifies the traffic class for which to gather statistics. Valid
17650 	 * values are 0 through (max_configurable_queues - 1), where
17651 	 * max_configurable_queues is in the response of HWRM_QUEUE_QPORTCFG
17652 	 */
17653 	uint16_t	traffic_class;
17654 	uint8_t	unused_1[4];
17655 } hwrm_func_qstats_ext_input_t, *phwrm_func_qstats_ext_input_t;
17656 
17657 /* hwrm_func_qstats_ext_output (size:1536b/192B) */
17658 
17659 typedef struct hwrm_func_qstats_ext_output {
17660 	/* The specific error status for the command. */
17661 	uint16_t	error_code;
17662 	/* The HWRM command request type. */
17663 	uint16_t	req_type;
17664 	/* The sequence ID from the original command. */
17665 	uint16_t	seq_id;
17666 	/* The length of the response data in number of bytes. */
17667 	uint16_t	resp_len;
17668 	/* Number of received unicast packets */
17669 	uint64_t	rx_ucast_pkts;
17670 	/* Number of received multicast packets */
17671 	uint64_t	rx_mcast_pkts;
17672 	/* Number of received broadcast packets */
17673 	uint64_t	rx_bcast_pkts;
17674 	/* Number of discarded packets on received path */
17675 	uint64_t	rx_discard_pkts;
17676 	/* Number of packets on receive path with error */
17677 	uint64_t	rx_error_pkts;
17678 	/* Number of received bytes for unicast traffic */
17679 	uint64_t	rx_ucast_bytes;
17680 	/* Number of received bytes for multicast traffic */
17681 	uint64_t	rx_mcast_bytes;
17682 	/* Number of received bytes for broadcast traffic */
17683 	uint64_t	rx_bcast_bytes;
17684 	/* Number of transmitted unicast packets */
17685 	uint64_t	tx_ucast_pkts;
17686 	/* Number of transmitted multicast packets */
17687 	uint64_t	tx_mcast_pkts;
17688 	/* Number of transmitted broadcast packets */
17689 	uint64_t	tx_bcast_pkts;
17690 	/* Number of packets on transmit path with error */
17691 	uint64_t	tx_error_pkts;
17692 	/* Number of discarded packets on transmit path */
17693 	uint64_t	tx_discard_pkts;
17694 	/* Number of transmitted bytes for unicast traffic */
17695 	uint64_t	tx_ucast_bytes;
17696 	/* Number of transmitted bytes for multicast traffic */
17697 	uint64_t	tx_mcast_bytes;
17698 	/* Number of transmitted bytes for broadcast traffic */
17699 	uint64_t	tx_bcast_bytes;
17700 	/* Number of TPA eligible packets */
17701 	uint64_t	rx_tpa_eligible_pkt;
17702 	/* Number of TPA eligible bytes */
17703 	uint64_t	rx_tpa_eligible_bytes;
17704 	/* Number of TPA packets */
17705 	uint64_t	rx_tpa_pkt;
17706 	/* Number of TPA bytes */
17707 	uint64_t	rx_tpa_bytes;
17708 	/* Number of TPA errors */
17709 	uint64_t	rx_tpa_errors;
17710 	/* Number of TPA errors */
17711 	uint64_t	rx_tpa_events;
17712 	uint8_t	unused_0[7];
17713 	/*
17714 	 * This field is used in Output records to indicate that the output
17715 	 * is completely written to RAM. This field should be read as '1'
17716 	 * to indicate that the output has been completely written. When
17717 	 * writing a command completion or response to an internal processor,
17718 	 * the order of writes has to be such that this field is written last.
17719 	 */
17720 	uint8_t	valid;
17721 } hwrm_func_qstats_ext_output_t, *phwrm_func_qstats_ext_output_t;
17722 
17723 /***********************
17724  * hwrm_func_clr_stats *
17725  ***********************/
17726 
17727 
17728 /* hwrm_func_clr_stats_input (size:192b/24B) */
17729 
17730 typedef struct hwrm_func_clr_stats_input {
17731 	/* The HWRM command request type. */
17732 	uint16_t	req_type;
17733 	/*
17734 	 * The completion ring to send the completion event on. This should
17735 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
17736 	 */
17737 	uint16_t	cmpl_ring;
17738 	/*
17739 	 * The sequence ID is used by the driver for tracking multiple
17740 	 * commands. This ID is treated as opaque data by the firmware and
17741 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
17742 	 */
17743 	uint16_t	seq_id;
17744 	/*
17745 	 * The target ID of the command:
17746 	 * * 0x0-0xFFF8 - The function ID
17747 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17748 	 * * 0xFFFD - Reserved for user-space HWRM interface
17749 	 * * 0xFFFF - HWRM
17750 	 */
17751 	uint16_t	target_id;
17752 	/*
17753 	 * A physical address pointer pointing to a host buffer that the
17754 	 * command's response data will be written. This can be either a host
17755 	 * physical address (HPA) or a guest physical address (GPA) and must
17756 	 * point to a physically contiguous block of memory.
17757 	 */
17758 	uint64_t	resp_addr;
17759 	/*
17760 	 * Function ID of the function.
17761 	 * 0xFF... (All Fs) if the query is for the requesting
17762 	 * function.
17763 	 */
17764 	uint16_t	fid;
17765 	uint8_t	unused_0[6];
17766 } hwrm_func_clr_stats_input_t, *phwrm_func_clr_stats_input_t;
17767 
17768 /* hwrm_func_clr_stats_output (size:128b/16B) */
17769 
17770 typedef struct hwrm_func_clr_stats_output {
17771 	/* The specific error status for the command. */
17772 	uint16_t	error_code;
17773 	/* The HWRM command request type. */
17774 	uint16_t	req_type;
17775 	/* The sequence ID from the original command. */
17776 	uint16_t	seq_id;
17777 	/* The length of the response data in number of bytes. */
17778 	uint16_t	resp_len;
17779 	uint8_t	unused_0[7];
17780 	/*
17781 	 * This field is used in Output records to indicate that the output
17782 	 * is completely written to RAM. This field should be read as '1'
17783 	 * to indicate that the output has been completely written. When
17784 	 * writing a command completion or response to an internal processor,
17785 	 * the order of writes has to be such that this field is written last.
17786 	 */
17787 	uint8_t	valid;
17788 } hwrm_func_clr_stats_output_t, *phwrm_func_clr_stats_output_t;
17789 
17790 /**************************
17791  * hwrm_func_vf_resc_free *
17792  **************************/
17793 
17794 
17795 /* hwrm_func_vf_resc_free_input (size:192b/24B) */
17796 
17797 typedef struct hwrm_func_vf_resc_free_input {
17798 	/* The HWRM command request type. */
17799 	uint16_t	req_type;
17800 	/*
17801 	 * The completion ring to send the completion event on. This should
17802 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
17803 	 */
17804 	uint16_t	cmpl_ring;
17805 	/*
17806 	 * The sequence ID is used by the driver for tracking multiple
17807 	 * commands. This ID is treated as opaque data by the firmware and
17808 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
17809 	 */
17810 	uint16_t	seq_id;
17811 	/*
17812 	 * The target ID of the command:
17813 	 * * 0x0-0xFFF8 - The function ID
17814 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17815 	 * * 0xFFFD - Reserved for user-space HWRM interface
17816 	 * * 0xFFFF - HWRM
17817 	 */
17818 	uint16_t	target_id;
17819 	/*
17820 	 * A physical address pointer pointing to a host buffer that the
17821 	 * command's response data will be written. This can be either a host
17822 	 * physical address (HPA) or a guest physical address (GPA) and must
17823 	 * point to a physically contiguous block of memory.
17824 	 */
17825 	uint64_t	resp_addr;
17826 	/*
17827 	 * This value is used to identify a Virtual Function (VF).
17828 	 * The scope of VF ID is local within a PF.
17829 	 */
17830 	uint16_t	vf_id;
17831 	uint8_t	unused_0[6];
17832 } hwrm_func_vf_resc_free_input_t, *phwrm_func_vf_resc_free_input_t;
17833 
17834 /* hwrm_func_vf_resc_free_output (size:128b/16B) */
17835 
17836 typedef struct hwrm_func_vf_resc_free_output {
17837 	/* The specific error status for the command. */
17838 	uint16_t	error_code;
17839 	/* The HWRM command request type. */
17840 	uint16_t	req_type;
17841 	/* The sequence ID from the original command. */
17842 	uint16_t	seq_id;
17843 	/* The length of the response data in number of bytes. */
17844 	uint16_t	resp_len;
17845 	uint8_t	unused_0[7];
17846 	/*
17847 	 * This field is used in Output records to indicate that the output
17848 	 * is completely written to RAM. This field should be read as '1'
17849 	 * to indicate that the output has been completely written. When
17850 	 * writing a command completion or response to an internal processor,
17851 	 * the order of writes has to be such that this field is written last.
17852 	 */
17853 	uint8_t	valid;
17854 } hwrm_func_vf_resc_free_output_t, *phwrm_func_vf_resc_free_output_t;
17855 
17856 /**********************
17857  * hwrm_func_drv_rgtr *
17858  **********************/
17859 
17860 
17861 /* hwrm_func_drv_rgtr_input (size:896b/112B) */
17862 
17863 typedef struct hwrm_func_drv_rgtr_input {
17864 	/* The HWRM command request type. */
17865 	uint16_t	req_type;
17866 	/*
17867 	 * The completion ring to send the completion event on. This should
17868 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
17869 	 */
17870 	uint16_t	cmpl_ring;
17871 	/*
17872 	 * The sequence ID is used by the driver for tracking multiple
17873 	 * commands. This ID is treated as opaque data by the firmware and
17874 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
17875 	 */
17876 	uint16_t	seq_id;
17877 	/*
17878 	 * The target ID of the command:
17879 	 * * 0x0-0xFFF8 - The function ID
17880 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17881 	 * * 0xFFFD - Reserved for user-space HWRM interface
17882 	 * * 0xFFFF - HWRM
17883 	 */
17884 	uint16_t	target_id;
17885 	/*
17886 	 * A physical address pointer pointing to a host buffer that the
17887 	 * command's response data will be written. This can be either a host
17888 	 * physical address (HPA) or a guest physical address (GPA) and must
17889 	 * point to a physically contiguous block of memory.
17890 	 */
17891 	uint64_t	resp_addr;
17892 	uint32_t	flags;
17893 	/*
17894 	 * When this bit is '1', the function driver is requesting
17895 	 * all requests from its children VF drivers to be
17896 	 * forwarded to itself.
17897 	 * This flag can only be set by the PF driver.
17898 	 * If a VF driver sets this flag, it should be ignored
17899 	 * by the HWRM.
17900 	 */
17901 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE			UINT32_C(0x1)
17902 	/*
17903 	 * When this bit is '1', the function is requesting none of
17904 	 * the requests from its children VF drivers to be
17905 	 * forwarded to itself.
17906 	 * This flag can only be set by the PF driver.
17907 	 * If a VF driver sets this flag, it should be ignored
17908 	 * by the HWRM.
17909 	 */
17910 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE			UINT32_C(0x2)
17911 	/*
17912 	 * When this bit is '1', then ver_maj_8b, ver_min_8b, ver_upd_8b
17913 	 * fields shall be ignored and ver_maj, ver_min, ver_upd
17914 	 * and ver_patch shall be used for the driver version information.
17915 	 * When this bit is '0', then ver_maj_8b, ver_min_8b, ver_upd_8b
17916 	 * fields shall be used for the driver version information and
17917 	 * ver_maj, ver_min, ver_upd and ver_patch shall be ignored.
17918 	 */
17919 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_16BIT_VER_MODE		UINT32_C(0x4)
17920 	/*
17921 	 * When this bit is '1', the function is indicating support of
17922 	 * 64bit flow handle. The firmware that only supports 64bit flow
17923 	 * handle should check this bit before allowing processing of
17924 	 * HWRM_CFA_FLOW_XXX commands from the requesting function as
17925 	 * firmware with 64bit flow handle support can only be compatible
17926 	 * with drivers that support 64bit flow handle. The legacy drivers
17927 	 * that don't support 64bit flow handle won't be able to use
17928 	 * HWRM_CFA_FLOW_XXX commands when running with new firmware that
17929 	 * only supports 64bit flow handle. The new firmware support 64bit
17930 	 * flow handle returns HWRM_ERR_CODE_CMD_NOT_SUPPORTED
17931 	 * status to the legacy driver when encounters these commands.
17932 	 */
17933 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FLOW_HANDLE_64BIT_MODE	UINT32_C(0x8)
17934 	/*
17935 	 * When this bit is '1', the function is indicating support of
17936 	 * Hot Reset. The driver interface will destroy the resources,
17937 	 * unregister the function and register again up on receiving
17938 	 * the RESET_NOTIFY Async notification from the core firmware.
17939 	 * The core firmware will this use flag and trigger the Hot Reset
17940 	 * process only if all the registered driver instances are capable
17941 	 * of this support.
17942 	 */
17943 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT		UINT32_C(0x10)
17944 	/*
17945 	 * When this bit is 1, the function is indicating the support of the
17946 	 * error recovery capability. Error recovery support will be used by
17947 	 * firmware only if all the driver instances support error recovery
17948 	 * process. By setting this bit, driver is indicating support for
17949 	 * corresponding async event completion message. These will be
17950 	 * delivered to the driver even if they did not register for it.
17951 	 * If supported, after receiving reset notify async event with fatal
17952 	 * flag set in event data1, then all the drivers have to tear down
17953 	 * their resources without sending any HWRM commands to FW.
17954 	 */
17955 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ERROR_RECOVERY_SUPPORT	UINT32_C(0x20)
17956 	/*
17957 	 * When this bit is 1, the function is indicating the support of the
17958 	 * Master capability. The Firmware will use this capability to select
17959 	 * the Master function. The master function will be used to initiate
17960 	 * designated functionality like error recovery etc. If none of the
17961 	 * registered PF's or trusted VF's indicate this support, then
17962 	 * firmware will select the 1st registered PF as Master capable
17963 	 * instance.
17964 	 */
17965 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_MASTER_SUPPORT		UINT32_C(0x40)
17966 	/*
17967 	 * When this bit is 1, the function is indicating the support of the
17968 	 * fast reset capability. Fast reset support will be used by
17969 	 * firmware only if all the driver instances support fast reset
17970 	 * process. By setting this bit, driver is indicating support for
17971 	 * corresponding async event completion message. These will be
17972 	 * delivered to the driver even if they did not register for it.
17973 	 * If supported, after receiving reset notify async event with fast
17974 	 * reset flag set in event data1, then all the drivers have to tear
17975 	 * down their resources without sending any HWRM commands to FW.
17976 	 */
17977 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FAST_RESET_SUPPORT		UINT32_C(0x80)
17978 	/*
17979 	 * When this bit is 1, the function's driver is indicating the
17980 	 * support of handling the vnic_rss_cfg's INVALID_PARAM error
17981 	 * returned by firmware. Firmware returns error, if host driver
17982 	 * configures the invalid hash_types bit combination for a given
17983 	 * IP version.
17984 	 */
17985 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_RSS_STRICT_HASH_TYPE_SUPPORT	UINT32_C(0x100)
17986 	/*
17987 	 * When this bit is 1, the function's driver is indicating the
17988 	 * support of handling the NPAR 1.2 feature where the s-tag may be
17989 	 * a value other than 0x8100 or 0x88a8.
17990 	 */
17991 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_NPAR_1_2_SUPPORT		UINT32_C(0x200)
17992 	/*
17993 	 * When this bit is 1, the function's driver is indicating the
17994 	 * support for asymmetric queue configuration, such that queue
17995 	 * ids and service profiles on TX side are not the same as the
17996 	 * corresponding queue configuration on the RX side
17997 	 */
17998 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ASYM_QUEUE_CFG_SUPPORT	UINT32_C(0x400)
17999 	/*
18000 	 * When this bit is 1, the function's driver is indicating to the
18001 	 * firmware that the Ingress NIC flows will be programmed by the
18002 	 * TruFlow application and the firmware flow manager should reject
18003 	 * flow-create commands that programs ingress lookup flows for this
18004 	 * function.
18005 	 */
18006 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_TF_INGRESS_NIC_FLOW_MODE	UINT32_C(0x800)
18007 	/*
18008 	 * When this bit is 1, the function's driver is indicating to the
18009 	 * firmware that the Egress NIC flows will be programmed by the
18010 	 * TruFlow application and the firmware flow manager should reject
18011 	 * flow-create commands that programs Egress lookup flows for this
18012 	 * function.
18013 	 */
18014 	#define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_TF_EGRESS_NIC_FLOW_MODE	UINT32_C(0x1000)
18015 	uint32_t	enables;
18016 	/*
18017 	 * This bit must be '1' for the os_type field to be
18018 	 * configured.
18019 	 */
18020 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE		UINT32_C(0x1)
18021 	/*
18022 	 * This bit must be '1' for the ver field to be
18023 	 * configured.
18024 	 */
18025 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER		UINT32_C(0x2)
18026 	/*
18027 	 * This bit must be '1' for the timestamp field to be
18028 	 * configured.
18029 	 */
18030 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP	UINT32_C(0x4)
18031 	/*
18032 	 * This bit must be '1' for the vf_req_fwd field to be
18033 	 * configured.
18034 	 */
18035 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD	UINT32_C(0x8)
18036 	/*
18037 	 * This bit must be '1' for the async_event_fwd field to be
18038 	 * configured.
18039 	 */
18040 	#define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD	UINT32_C(0x10)
18041 	/*
18042 	 * This value indicates the type of OS. The values are based on
18043 	 * CIM_OperatingSystem.mof file as published by the DMTF.
18044 	 */
18045 	uint16_t	os_type;
18046 	/* Unknown */
18047 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
18048 	/* Other OS not listed below. */
18049 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER	UINT32_C(0x1)
18050 	/* MSDOS OS. */
18051 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS	UINT32_C(0xe)
18052 	/* Windows OS. */
18053 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
18054 	/* Solaris OS. */
18055 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
18056 	/* Linux OS. */
18057 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX	UINT32_C(0x24)
18058 	/* FreeBSD OS. */
18059 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
18060 	/* VMware ESXi OS. */
18061 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI	UINT32_C(0x68)
18062 	/* Microsoft Windows 8 64-bit OS. */
18063 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864	UINT32_C(0x73)
18064 	/* Microsoft Windows Server 2012 R2 OS. */
18065 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
18066 	/* UEFI driver. */
18067 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI	UINT32_C(0x8000)
18068 	#define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LAST	HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI
18069 	/* This is the 8bit major version of the driver. */
18070 	uint8_t	ver_maj_8b;
18071 	/* This is the 8bit minor version of the driver. */
18072 	uint8_t	ver_min_8b;
18073 	/* This is the 8bit update version of the driver. */
18074 	uint8_t	ver_upd_8b;
18075 	uint8_t	unused_0[3];
18076 	/*
18077 	 * This is a 32-bit timestamp provided by the driver for
18078 	 * keep alive.
18079 	 * The timestamp is in multiples of 1ms.
18080 	 */
18081 	uint32_t	timestamp;
18082 	uint8_t	unused_1[4];
18083 	/*
18084 	 * This is a 256-bit bit mask provided by the PF driver for
18085 	 * letting the HWRM know what commands issued by the VF driver
18086 	 * to the HWRM should be forwarded to the PF driver.
18087 	 * Nth bit refers to the Nth req_type.
18088 	 *
18089 	 * Setting Nth bit to 1 indicates that requests from the
18090 	 * VF driver with req_type equal to N shall be forwarded to
18091 	 * the parent PF driver.
18092 	 *
18093 	 * This field is not valid for the VF driver.
18094 	 */
18095 	uint32_t	vf_req_fwd[8];
18096 	/*
18097 	 * This is a 256-bit bit mask provided by the function driver
18098 	 * (PF or VF driver) to indicate the list of asynchronous event
18099 	 * completions to be forwarded.
18100 	 *
18101 	 * Nth bit refers to the Nth event_id.
18102 	 *
18103 	 * Setting Nth bit to 1 by the function driver shall result in
18104 	 * the HWRM forwarding asynchronous event completion with
18105 	 * event_id equal to N.
18106 	 *
18107 	 * If all bits are set to 0 (value of 0), then the HWRM shall
18108 	 * not forward any asynchronous event completion to this
18109 	 * function driver.
18110 	 */
18111 	uint32_t	async_event_fwd[8];
18112 	/* This is the 16bit major version of the driver. */
18113 	uint16_t	ver_maj;
18114 	/* This is the 16bit minor version of the driver. */
18115 	uint16_t	ver_min;
18116 	/* This is the 16bit update version of the driver. */
18117 	uint16_t	ver_upd;
18118 	/* This is the 16bit patch version of the driver. */
18119 	uint16_t	ver_patch;
18120 } hwrm_func_drv_rgtr_input_t, *phwrm_func_drv_rgtr_input_t;
18121 
18122 /* hwrm_func_drv_rgtr_output (size:128b/16B) */
18123 
18124 typedef struct hwrm_func_drv_rgtr_output {
18125 	/* The specific error status for the command. */
18126 	uint16_t	error_code;
18127 	/* The HWRM command request type. */
18128 	uint16_t	req_type;
18129 	/* The sequence ID from the original command. */
18130 	uint16_t	seq_id;
18131 	/* The length of the response data in number of bytes. */
18132 	uint16_t	resp_len;
18133 	uint32_t	flags;
18134 	/*
18135 	 * When this bit is '1', it indicates that the
18136 	 * HWRM_FUNC_DRV_IF_CHANGE call is supported.
18137 	 */
18138 	#define HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED	UINT32_C(0x1)
18139 	uint8_t	unused_0[3];
18140 	/*
18141 	 * This field is used in Output records to indicate that the output
18142 	 * is completely written to RAM. This field should be read as '1'
18143 	 * to indicate that the output has been completely written. When
18144 	 * writing a command completion or response to an internal processor,
18145 	 * the order of writes has to be such that this field is written last.
18146 	 */
18147 	uint8_t	valid;
18148 } hwrm_func_drv_rgtr_output_t, *phwrm_func_drv_rgtr_output_t;
18149 
18150 /************************
18151  * hwrm_func_drv_unrgtr *
18152  ************************/
18153 
18154 
18155 /* hwrm_func_drv_unrgtr_input (size:192b/24B) */
18156 
18157 typedef struct hwrm_func_drv_unrgtr_input {
18158 	/* The HWRM command request type. */
18159 	uint16_t	req_type;
18160 	/*
18161 	 * The completion ring to send the completion event on. This should
18162 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
18163 	 */
18164 	uint16_t	cmpl_ring;
18165 	/*
18166 	 * The sequence ID is used by the driver for tracking multiple
18167 	 * commands. This ID is treated as opaque data by the firmware and
18168 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
18169 	 */
18170 	uint16_t	seq_id;
18171 	/*
18172 	 * The target ID of the command:
18173 	 * * 0x0-0xFFF8 - The function ID
18174 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18175 	 * * 0xFFFD - Reserved for user-space HWRM interface
18176 	 * * 0xFFFF - HWRM
18177 	 */
18178 	uint16_t	target_id;
18179 	/*
18180 	 * A physical address pointer pointing to a host buffer that the
18181 	 * command's response data will be written. This can be either a host
18182 	 * physical address (HPA) or a guest physical address (GPA) and must
18183 	 * point to a physically contiguous block of memory.
18184 	 */
18185 	uint64_t	resp_addr;
18186 	uint32_t	flags;
18187 	/*
18188 	 * When this bit is '1', the function driver is notifying
18189 	 * the HWRM to prepare for the shutdown.
18190 	 */
18191 	#define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN	UINT32_C(0x1)
18192 	uint8_t	unused_0[4];
18193 } hwrm_func_drv_unrgtr_input_t, *phwrm_func_drv_unrgtr_input_t;
18194 
18195 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */
18196 
18197 typedef struct hwrm_func_drv_unrgtr_output {
18198 	/* The specific error status for the command. */
18199 	uint16_t	error_code;
18200 	/* The HWRM command request type. */
18201 	uint16_t	req_type;
18202 	/* The sequence ID from the original command. */
18203 	uint16_t	seq_id;
18204 	/* The length of the response data in number of bytes. */
18205 	uint16_t	resp_len;
18206 	uint8_t	unused_0[7];
18207 	/*
18208 	 * This field is used in Output records to indicate that the output
18209 	 * is completely written to RAM. This field should be read as '1'
18210 	 * to indicate that the output has been completely written. When
18211 	 * writing a command completion or response to an internal processor,
18212 	 * the order of writes has to be such that this field is written last.
18213 	 */
18214 	uint8_t	valid;
18215 } hwrm_func_drv_unrgtr_output_t, *phwrm_func_drv_unrgtr_output_t;
18216 
18217 /**********************
18218  * hwrm_func_buf_rgtr *
18219  **********************/
18220 
18221 
18222 /* hwrm_func_buf_rgtr_input (size:1024b/128B) */
18223 
18224 typedef struct hwrm_func_buf_rgtr_input {
18225 	/* The HWRM command request type. */
18226 	uint16_t	req_type;
18227 	/*
18228 	 * The completion ring to send the completion event on. This should
18229 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
18230 	 */
18231 	uint16_t	cmpl_ring;
18232 	/*
18233 	 * The sequence ID is used by the driver for tracking multiple
18234 	 * commands. This ID is treated as opaque data by the firmware and
18235 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
18236 	 */
18237 	uint16_t	seq_id;
18238 	/*
18239 	 * The target ID of the command:
18240 	 * * 0x0-0xFFF8 - The function ID
18241 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18242 	 * * 0xFFFD - Reserved for user-space HWRM interface
18243 	 * * 0xFFFF - HWRM
18244 	 */
18245 	uint16_t	target_id;
18246 	/*
18247 	 * A physical address pointer pointing to a host buffer that the
18248 	 * command's response data will be written. This can be either a host
18249 	 * physical address (HPA) or a guest physical address (GPA) and must
18250 	 * point to a physically contiguous block of memory.
18251 	 */
18252 	uint64_t	resp_addr;
18253 	uint32_t	enables;
18254 	/*
18255 	 * This bit must be '1' for the vf_id field to be
18256 	 * configured.
18257 	 */
18258 	#define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID		UINT32_C(0x1)
18259 	/*
18260 	 * This bit must be '1' for the err_buf_addr field to be
18261 	 * configured.
18262 	 */
18263 	#define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR	UINT32_C(0x2)
18264 	/*
18265 	 * This value is used to identify a Virtual Function (VF).
18266 	 * The scope of VF ID is local within a PF.
18267 	 */
18268 	uint16_t	vf_id;
18269 	/*
18270 	 * This field represents the number of pages used for request
18271 	 * buffer(s).
18272 	 */
18273 	uint16_t	req_buf_num_pages;
18274 	/*
18275 	 * This field represents the page size used for request
18276 	 * buffer(s).
18277 	 */
18278 	uint16_t	req_buf_page_size;
18279 	/* 16 bytes */
18280 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B UINT32_C(0x4)
18281 	/* 4 Kbytes */
18282 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K  UINT32_C(0xc)
18283 	/* 8 Kbytes */
18284 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K  UINT32_C(0xd)
18285 	/* 64 Kbytes */
18286 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K UINT32_C(0x10)
18287 	/* 2 Mbytes */
18288 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M  UINT32_C(0x15)
18289 	/* 4 Mbytes */
18290 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M  UINT32_C(0x16)
18291 	/* 1 Gbytes */
18292 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G  UINT32_C(0x1e)
18293 	#define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_LAST HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G
18294 	/* The length of the request buffer per VF in bytes. */
18295 	uint16_t	req_buf_len;
18296 	/* The length of the response buffer in bytes. */
18297 	uint16_t	resp_buf_len;
18298 	uint8_t	unused_0[2];
18299 	/* This field represents the page address of page #0. */
18300 	uint64_t	req_buf_page_addr0;
18301 	/* This field represents the page address of page #1. */
18302 	uint64_t	req_buf_page_addr1;
18303 	/* This field represents the page address of page #2. */
18304 	uint64_t	req_buf_page_addr2;
18305 	/* This field represents the page address of page #3. */
18306 	uint64_t	req_buf_page_addr3;
18307 	/* This field represents the page address of page #4. */
18308 	uint64_t	req_buf_page_addr4;
18309 	/* This field represents the page address of page #5. */
18310 	uint64_t	req_buf_page_addr5;
18311 	/* This field represents the page address of page #6. */
18312 	uint64_t	req_buf_page_addr6;
18313 	/* This field represents the page address of page #7. */
18314 	uint64_t	req_buf_page_addr7;
18315 	/* This field represents the page address of page #8. */
18316 	uint64_t	req_buf_page_addr8;
18317 	/* This field represents the page address of page #9. */
18318 	uint64_t	req_buf_page_addr9;
18319 	/*
18320 	 * This field is used to receive the error reporting from
18321 	 * the chipset. Only applicable for PFs.
18322 	 */
18323 	uint64_t	error_buf_addr;
18324 	/*
18325 	 * This field is used to receive the response forwarded by the
18326 	 * HWRM.
18327 	 */
18328 	uint64_t	resp_buf_addr;
18329 } hwrm_func_buf_rgtr_input_t, *phwrm_func_buf_rgtr_input_t;
18330 
18331 /* hwrm_func_buf_rgtr_output (size:128b/16B) */
18332 
18333 typedef struct hwrm_func_buf_rgtr_output {
18334 	/* The specific error status for the command. */
18335 	uint16_t	error_code;
18336 	/* The HWRM command request type. */
18337 	uint16_t	req_type;
18338 	/* The sequence ID from the original command. */
18339 	uint16_t	seq_id;
18340 	/* The length of the response data in number of bytes. */
18341 	uint16_t	resp_len;
18342 	uint8_t	unused_0[7];
18343 	/*
18344 	 * This field is used in Output records to indicate that the output
18345 	 * is completely written to RAM. This field should be read as '1'
18346 	 * to indicate that the output has been completely written. When
18347 	 * writing a command completion or response to an internal processor,
18348 	 * the order of writes has to be such that this field is written last.
18349 	 */
18350 	uint8_t	valid;
18351 } hwrm_func_buf_rgtr_output_t, *phwrm_func_buf_rgtr_output_t;
18352 
18353 /************************
18354  * hwrm_func_buf_unrgtr *
18355  ************************/
18356 
18357 
18358 /* hwrm_func_buf_unrgtr_input (size:192b/24B) */
18359 
18360 typedef struct hwrm_func_buf_unrgtr_input {
18361 	/* The HWRM command request type. */
18362 	uint16_t	req_type;
18363 	/*
18364 	 * The completion ring to send the completion event on. This should
18365 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
18366 	 */
18367 	uint16_t	cmpl_ring;
18368 	/*
18369 	 * The sequence ID is used by the driver for tracking multiple
18370 	 * commands. This ID is treated as opaque data by the firmware and
18371 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
18372 	 */
18373 	uint16_t	seq_id;
18374 	/*
18375 	 * The target ID of the command:
18376 	 * * 0x0-0xFFF8 - The function ID
18377 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18378 	 * * 0xFFFD - Reserved for user-space HWRM interface
18379 	 * * 0xFFFF - HWRM
18380 	 */
18381 	uint16_t	target_id;
18382 	/*
18383 	 * A physical address pointer pointing to a host buffer that the
18384 	 * command's response data will be written. This can be either a host
18385 	 * physical address (HPA) or a guest physical address (GPA) and must
18386 	 * point to a physically contiguous block of memory.
18387 	 */
18388 	uint64_t	resp_addr;
18389 	uint32_t	enables;
18390 	/*
18391 	 * This bit must be '1' for the vf_id field to be
18392 	 * configured.
18393 	 */
18394 	#define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID	UINT32_C(0x1)
18395 	/*
18396 	 * This value is used to identify a Virtual Function (VF).
18397 	 * The scope of VF ID is local within a PF.
18398 	 */
18399 	uint16_t	vf_id;
18400 	uint8_t	unused_0[2];
18401 } hwrm_func_buf_unrgtr_input_t, *phwrm_func_buf_unrgtr_input_t;
18402 
18403 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */
18404 
18405 typedef struct hwrm_func_buf_unrgtr_output {
18406 	/* The specific error status for the command. */
18407 	uint16_t	error_code;
18408 	/* The HWRM command request type. */
18409 	uint16_t	req_type;
18410 	/* The sequence ID from the original command. */
18411 	uint16_t	seq_id;
18412 	/* The length of the response data in number of bytes. */
18413 	uint16_t	resp_len;
18414 	uint8_t	unused_0[7];
18415 	/*
18416 	 * This field is used in Output records to indicate that the output
18417 	 * is completely written to RAM. This field should be read as '1'
18418 	 * to indicate that the output has been completely written. When
18419 	 * writing a command completion or response to an internal processor,
18420 	 * the order of writes has to be such that this field is written last.
18421 	 */
18422 	uint8_t	valid;
18423 } hwrm_func_buf_unrgtr_output_t, *phwrm_func_buf_unrgtr_output_t;
18424 
18425 /**********************
18426  * hwrm_func_drv_qver *
18427  **********************/
18428 
18429 
18430 /* hwrm_func_drv_qver_input (size:192b/24B) */
18431 
18432 typedef struct hwrm_func_drv_qver_input {
18433 	/* The HWRM command request type. */
18434 	uint16_t	req_type;
18435 	/*
18436 	 * The completion ring to send the completion event on. This should
18437 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
18438 	 */
18439 	uint16_t	cmpl_ring;
18440 	/*
18441 	 * The sequence ID is used by the driver for tracking multiple
18442 	 * commands. This ID is treated as opaque data by the firmware and
18443 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
18444 	 */
18445 	uint16_t	seq_id;
18446 	/*
18447 	 * The target ID of the command:
18448 	 * * 0x0-0xFFF8 - The function ID
18449 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18450 	 * * 0xFFFD - Reserved for user-space HWRM interface
18451 	 * * 0xFFFF - HWRM
18452 	 */
18453 	uint16_t	target_id;
18454 	/*
18455 	 * A physical address pointer pointing to a host buffer that the
18456 	 * command's response data will be written. This can be either a host
18457 	 * physical address (HPA) or a guest physical address (GPA) and must
18458 	 * point to a physically contiguous block of memory.
18459 	 */
18460 	uint64_t	resp_addr;
18461 	/* Reserved for future use. */
18462 	uint32_t	reserved;
18463 	/*
18464 	 * Function ID of the function that is being queried.
18465 	 * 0xFF... (All Fs) if the query is for the requesting
18466 	 * function.
18467 	 */
18468 	uint16_t	fid;
18469 	/*
18470 	 * This field is used to indicate the driver type.
18471 	 * L2 or RoCE
18472 	 */
18473 	uint8_t	driver_type;
18474 	/* L2 driver version */
18475 	#define HWRM_FUNC_DRV_QVER_INPUT_DRIVER_TYPE_L2   UINT32_C(0x0)
18476 	/* RoCE driver version */
18477 	#define HWRM_FUNC_DRV_QVER_INPUT_DRIVER_TYPE_ROCE UINT32_C(0x1)
18478 	#define HWRM_FUNC_DRV_QVER_INPUT_DRIVER_TYPE_LAST HWRM_FUNC_DRV_QVER_INPUT_DRIVER_TYPE_ROCE
18479 	uint8_t	unused_0;
18480 } hwrm_func_drv_qver_input_t, *phwrm_func_drv_qver_input_t;
18481 
18482 /* hwrm_func_drv_qver_output (size:256b/32B) */
18483 
18484 typedef struct hwrm_func_drv_qver_output {
18485 	/* The specific error status for the command. */
18486 	uint16_t	error_code;
18487 	/* The HWRM command request type. */
18488 	uint16_t	req_type;
18489 	/* The sequence ID from the original command. */
18490 	uint16_t	seq_id;
18491 	/* The length of the response data in number of bytes. */
18492 	uint16_t	resp_len;
18493 	/*
18494 	 * This value indicates the type of OS. The values are based on
18495 	 * CIM_OperatingSystem.mof file as published by the DMTF.
18496 	 */
18497 	uint16_t	os_type;
18498 	/* Unknown */
18499 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
18500 	/* Other OS not listed below. */
18501 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER	UINT32_C(0x1)
18502 	/* MSDOS OS. */
18503 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS	UINT32_C(0xe)
18504 	/* Windows OS. */
18505 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
18506 	/* Solaris OS. */
18507 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
18508 	/* Linux OS. */
18509 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX	UINT32_C(0x24)
18510 	/* FreeBSD OS. */
18511 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
18512 	/* VMware ESXi OS. */
18513 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI	UINT32_C(0x68)
18514 	/* Microsoft Windows 8 64-bit OS. */
18515 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864	UINT32_C(0x73)
18516 	/* Microsoft Windows Server 2012 R2 OS. */
18517 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
18518 	/* UEFI driver. */
18519 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI	UINT32_C(0x8000)
18520 	#define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LAST	HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI
18521 	/* This is the 8bit major version of the driver. */
18522 	uint8_t	ver_maj_8b;
18523 	/* This is the 8bit minor version of the driver. */
18524 	uint8_t	ver_min_8b;
18525 	/* This is the 8bit update version of the driver. */
18526 	uint8_t	ver_upd_8b;
18527 	uint8_t	unused_0[3];
18528 	/* This is the 16bit major version of the driver. */
18529 	uint16_t	ver_maj;
18530 	/* This is the 16bit minor version of the driver. */
18531 	uint16_t	ver_min;
18532 	/* This is the 16bit update version of the driver. */
18533 	uint16_t	ver_upd;
18534 	/* This is the 16bit patch version of the driver. */
18535 	uint16_t	ver_patch;
18536 	uint8_t	unused_1[7];
18537 	/*
18538 	 * This field is used in Output records to indicate that the output
18539 	 * is completely written to RAM. This field should be read as '1'
18540 	 * to indicate that the output has been completely written. When
18541 	 * writing a command completion or response to an internal processor,
18542 	 * the order of writes has to be such that this field is written last.
18543 	 */
18544 	uint8_t	valid;
18545 } hwrm_func_drv_qver_output_t, *phwrm_func_drv_qver_output_t;
18546 
18547 /****************************
18548  * hwrm_func_resource_qcaps *
18549  ****************************/
18550 
18551 
18552 /* hwrm_func_resource_qcaps_input (size:192b/24B) */
18553 
18554 typedef struct hwrm_func_resource_qcaps_input {
18555 	/* The HWRM command request type. */
18556 	uint16_t	req_type;
18557 	/*
18558 	 * The completion ring to send the completion event on. This should
18559 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
18560 	 */
18561 	uint16_t	cmpl_ring;
18562 	/*
18563 	 * The sequence ID is used by the driver for tracking multiple
18564 	 * commands. This ID is treated as opaque data by the firmware and
18565 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
18566 	 */
18567 	uint16_t	seq_id;
18568 	/*
18569 	 * The target ID of the command:
18570 	 * * 0x0-0xFFF8 - The function ID
18571 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18572 	 * * 0xFFFD - Reserved for user-space HWRM interface
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 	/*
18584 	 * Function ID of the function that is being queried.
18585 	 * 0xFF... (All Fs) if the query is for the requesting
18586 	 * function.
18587 	 */
18588 	uint16_t	fid;
18589 	uint8_t	unused_0[6];
18590 } hwrm_func_resource_qcaps_input_t, *phwrm_func_resource_qcaps_input_t;
18591 
18592 /* hwrm_func_resource_qcaps_output (size:704b/88B) */
18593 
18594 typedef struct hwrm_func_resource_qcaps_output {
18595 	/* The specific error status for the command. */
18596 	uint16_t	error_code;
18597 	/* The HWRM command request type. */
18598 	uint16_t	req_type;
18599 	/* The sequence ID from the original command. */
18600 	uint16_t	seq_id;
18601 	/* The length of the response data in number of bytes. */
18602 	uint16_t	resp_len;
18603 	/*
18604 	 * Maximum guaranteed number of VFs supported by PF. Not applicable for
18605 	 * VFs.
18606 	 */
18607 	uint16_t	max_vfs;
18608 	/* Maximum guaranteed number of MSI-X vectors supported by function. */
18609 	uint16_t	max_msix;
18610 	/*
18611 	 * Hint of strategy to be used by PF driver to reserve resources for
18612 	 * its VF.
18613 	 */
18614 	uint16_t	vf_reservation_strategy;
18615 	/*
18616 	 * The PF driver should evenly divide its remaining resources among
18617 	 * all VFs.
18618 	 */
18619 	#define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL	UINT32_C(0x0)
18620 	/* The PF driver should only reserve minimal resources for each VF. */
18621 	#define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL	UINT32_C(0x1)
18622 	/*
18623 	 * The PF driver should not reserve any resources for each VF until
18624 	 * the VF interface is brought up.
18625 	 */
18626 	#define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC UINT32_C(0x2)
18627 	#define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_LAST	HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC
18628 	/* Minimum guaranteed number of RSS/COS contexts. */
18629 	uint16_t	min_rsscos_ctx;
18630 	/* Maximum non-guaranteed number of RSS/COS contexts */
18631 	uint16_t	max_rsscos_ctx;
18632 	/* Minimum guaranteed number of completion rings */
18633 	uint16_t	min_cmpl_rings;
18634 	/* Maximum non-guaranteed number of completion rings */
18635 	uint16_t	max_cmpl_rings;
18636 	/* Minimum guaranteed number of transmit rings */
18637 	uint16_t	min_tx_rings;
18638 	/* Maximum non-guaranteed number of transmit rings */
18639 	uint16_t	max_tx_rings;
18640 	/* Minimum guaranteed number of receive rings */
18641 	uint16_t	min_rx_rings;
18642 	/* Maximum non-guaranteed number of receive rings */
18643 	uint16_t	max_rx_rings;
18644 	/* Minimum guaranteed number of L2 contexts */
18645 	uint16_t	min_l2_ctxs;
18646 	/* Maximum non-guaranteed number of L2 contexts */
18647 	uint16_t	max_l2_ctxs;
18648 	/* Minimum guaranteed number of VNICs */
18649 	uint16_t	min_vnics;
18650 	/* Maximum non-guaranteed number of VNICs */
18651 	uint16_t	max_vnics;
18652 	/* Minimum guaranteed number of statistic contexts */
18653 	uint16_t	min_stat_ctx;
18654 	/* Maximum non-guaranteed number of statistic contexts */
18655 	uint16_t	max_stat_ctx;
18656 	/* Minimum guaranteed number of ring groups */
18657 	uint16_t	min_hw_ring_grps;
18658 	/* Maximum non-guaranteed number of ring groups */
18659 	uint16_t	max_hw_ring_grps;
18660 	/*
18661 	 * Maximum number of inputs into the transmit scheduler for this
18662 	 * function. The number of TX rings assigned to the function cannot
18663 	 * exceed this value.
18664 	 */
18665 	uint16_t	max_tx_scheduler_inputs;
18666 	uint16_t	flags;
18667 	/*
18668 	 * When this bit is '1', it indicates that VF_RESOURCE_CFG supports
18669 	 * feature to reserve all minimum resources when minimum >= 1,
18670 	 * otherwise returns an error.
18671 	 */
18672 	#define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_FLAGS_MIN_GUARANTEED	UINT32_C(0x1)
18673 	/* Minimum guaranteed number of MSI-X vectors supported by function */
18674 	uint16_t	min_msix;
18675 	/* Minimum guaranteed number of KTLS Tx Key Contexts */
18676 	uint32_t	min_ktls_tx_key_ctxs;
18677 	/* Maximum non-guaranteed number of KTLS Tx Key Contexts */
18678 	uint32_t	max_ktls_tx_key_ctxs;
18679 	/* Minimum guaranteed number of KTLS Rx Key Contexts */
18680 	uint32_t	min_ktls_rx_key_ctxs;
18681 	/* Maximum non-guaranteed number of KTLS Rx Key Contexts */
18682 	uint32_t	max_ktls_rx_key_ctxs;
18683 	/* Minimum guaranteed number of QUIC Tx Key Contexts */
18684 	uint32_t	min_quic_tx_key_ctxs;
18685 	/* Maximum non-guaranteed number of QUIC Tx Key Contexts */
18686 	uint32_t	max_quic_tx_key_ctxs;
18687 	/* Minimum guaranteed number of QUIC Rx Key Contexts */
18688 	uint32_t	min_quic_rx_key_ctxs;
18689 	/* Maximum non-guaranteed number of QUIC Rx Key Contexts */
18690 	uint32_t	max_quic_rx_key_ctxs;
18691 	uint8_t	unused_0[3];
18692 	/*
18693 	 * This field is used in Output records to indicate that the output
18694 	 * is completely written to RAM. This field should be read as '1'
18695 	 * to indicate that the output has been completely written. When
18696 	 * writing a command completion or response to an internal processor,
18697 	 * the order of writes has to be such that this field is written last.
18698 	 */
18699 	uint8_t	valid;
18700 } hwrm_func_resource_qcaps_output_t, *phwrm_func_resource_qcaps_output_t;
18701 
18702 /*****************************
18703  * hwrm_func_vf_resource_cfg *
18704  *****************************/
18705 
18706 
18707 /* hwrm_func_vf_resource_cfg_input (size:704b/88B) */
18708 
18709 typedef struct hwrm_func_vf_resource_cfg_input {
18710 	/* The HWRM command request type. */
18711 	uint16_t	req_type;
18712 	/*
18713 	 * The completion ring to send the completion event on. This should
18714 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
18715 	 */
18716 	uint16_t	cmpl_ring;
18717 	/*
18718 	 * The sequence ID is used by the driver for tracking multiple
18719 	 * commands. This ID is treated as opaque data by the firmware and
18720 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
18721 	 */
18722 	uint16_t	seq_id;
18723 	/*
18724 	 * The target ID of the command:
18725 	 * * 0x0-0xFFF8 - The function ID
18726 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18727 	 * * 0xFFFD - Reserved for user-space HWRM interface
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 	/* VF ID that is being configured by PF */
18739 	uint16_t	vf_id;
18740 	/* Maximum guaranteed number of MSI-X vectors for the function */
18741 	uint16_t	max_msix;
18742 	/* Minimum guaranteed number of RSS/COS contexts */
18743 	uint16_t	min_rsscos_ctx;
18744 	/* Maximum non-guaranteed number of RSS/COS contexts */
18745 	uint16_t	max_rsscos_ctx;
18746 	/* Minimum guaranteed number of completion rings */
18747 	uint16_t	min_cmpl_rings;
18748 	/* Maximum non-guaranteed number of completion rings */
18749 	uint16_t	max_cmpl_rings;
18750 	/* Minimum guaranteed number of transmit rings */
18751 	uint16_t	min_tx_rings;
18752 	/* Maximum non-guaranteed number of transmit rings */
18753 	uint16_t	max_tx_rings;
18754 	/* Minimum guaranteed number of receive rings */
18755 	uint16_t	min_rx_rings;
18756 	/* Maximum non-guaranteed number of receive rings */
18757 	uint16_t	max_rx_rings;
18758 	/* Minimum guaranteed number of L2 contexts */
18759 	uint16_t	min_l2_ctxs;
18760 	/* Maximum non-guaranteed number of L2 contexts */
18761 	uint16_t	max_l2_ctxs;
18762 	/* Minimum guaranteed number of VNICs */
18763 	uint16_t	min_vnics;
18764 	/* Maximum non-guaranteed number of VNICs */
18765 	uint16_t	max_vnics;
18766 	/* Minimum guaranteed number of statistic contexts */
18767 	uint16_t	min_stat_ctx;
18768 	/* Maximum non-guaranteed number of statistic contexts */
18769 	uint16_t	max_stat_ctx;
18770 	/* Minimum guaranteed number of ring groups */
18771 	uint16_t	min_hw_ring_grps;
18772 	/* Maximum non-guaranteed number of ring groups */
18773 	uint16_t	max_hw_ring_grps;
18774 	uint16_t	flags;
18775 	/*
18776 	 * If this bit is set, all minimum resources requested should be
18777 	 * reserved if minimum >= 1, otherwise return error. In case of
18778 	 * error, keep all existing reservations before the call.
18779 	 */
18780 	#define HWRM_FUNC_VF_RESOURCE_CFG_INPUT_FLAGS_MIN_GUARANTEED	UINT32_C(0x1)
18781 	/* Minimum guaranteed number of MSI-X vectors for the function */
18782 	uint16_t	min_msix;
18783 	/* Minimum guaranteed number of KTLS Tx Key Contexts */
18784 	uint32_t	min_ktls_tx_key_ctxs;
18785 	/* Maximum non-guaranteed number of KTLS Tx Key Contexts */
18786 	uint32_t	max_ktls_tx_key_ctxs;
18787 	/* Minimum guaranteed number of KTLS Rx Key Contexts */
18788 	uint32_t	min_ktls_rx_key_ctxs;
18789 	/* Maximum non-guaranteed number of KTLS Rx Key Contexts */
18790 	uint32_t	max_ktls_rx_key_ctxs;
18791 	/* Minimum guaranteed number of QUIC Tx Key Contexts */
18792 	uint32_t	min_quic_tx_key_ctxs;
18793 	/* Maximum non-guaranteed number of QUIC Tx Key Contexts */
18794 	uint32_t	max_quic_tx_key_ctxs;
18795 	/* Minimum guaranteed number of QUIC Rx Key Contexts */
18796 	uint32_t	min_quic_rx_key_ctxs;
18797 	/* Maximum non-guaranteed number of QUIC Rx Key Contexts */
18798 	uint32_t	max_quic_rx_key_ctxs;
18799 } hwrm_func_vf_resource_cfg_input_t, *phwrm_func_vf_resource_cfg_input_t;
18800 
18801 /* hwrm_func_vf_resource_cfg_output (size:384b/48B) */
18802 
18803 typedef struct hwrm_func_vf_resource_cfg_output {
18804 	/* The specific error status for the command. */
18805 	uint16_t	error_code;
18806 	/* The HWRM command request type. */
18807 	uint16_t	req_type;
18808 	/* The sequence ID from the original command. */
18809 	uint16_t	seq_id;
18810 	/* The length of the response data in number of bytes. */
18811 	uint16_t	resp_len;
18812 	/* Reserved number of RSS/COS contexts */
18813 	uint16_t	reserved_rsscos_ctx;
18814 	/* Reserved number of completion rings */
18815 	uint16_t	reserved_cmpl_rings;
18816 	/* Reserved number of transmit rings */
18817 	uint16_t	reserved_tx_rings;
18818 	/* Reserved number of receive rings */
18819 	uint16_t	reserved_rx_rings;
18820 	/* Reserved number of L2 contexts */
18821 	uint16_t	reserved_l2_ctxs;
18822 	/* Reserved number of VNICs */
18823 	uint16_t	reserved_vnics;
18824 	/* Reserved number of statistic contexts */
18825 	uint16_t	reserved_stat_ctx;
18826 	/* Reserved number of ring groups */
18827 	uint16_t	reserved_hw_ring_grps;
18828 	/* Actual number of KTLS Tx Key Contexts reserved */
18829 	uint32_t	reserved_ktls_tx_key_ctxs;
18830 	/* Actual number of KTLS Rx Key Contexts reserved */
18831 	uint32_t	reserved_ktls_rx_key_ctxs;
18832 	/* Actual number of QUIC Tx Key Contexts reserved */
18833 	uint32_t	reserved_quic_tx_key_ctxs;
18834 	/* Actual number of QUIC Rx Key Contexts reserved */
18835 	uint32_t	reserved_quic_rx_key_ctxs;
18836 	uint8_t	unused_0[7];
18837 	/*
18838 	 * This field is used in Output records to indicate that the output
18839 	 * is completely written to RAM. This field should be read as '1'
18840 	 * to indicate that the output has been completely written. When
18841 	 * writing a command completion or response to an internal processor,
18842 	 * the order of writes has to be such that this field is written last.
18843 	 */
18844 	uint8_t	valid;
18845 } hwrm_func_vf_resource_cfg_output_t, *phwrm_func_vf_resource_cfg_output_t;
18846 
18847 /*********************************
18848  * hwrm_func_backing_store_qcaps *
18849  *********************************/
18850 
18851 
18852 /* hwrm_func_backing_store_qcaps_input (size:128b/16B) */
18853 
18854 typedef struct hwrm_func_backing_store_qcaps_input {
18855 	/* The HWRM command request type. */
18856 	uint16_t	req_type;
18857 	/*
18858 	 * The completion ring to send the completion event on. This should
18859 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
18860 	 */
18861 	uint16_t	cmpl_ring;
18862 	/*
18863 	 * The sequence ID is used by the driver for tracking multiple
18864 	 * commands. This ID is treated as opaque data by the firmware and
18865 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
18866 	 */
18867 	uint16_t	seq_id;
18868 	/*
18869 	 * The target ID of the command:
18870 	 * * 0x0-0xFFF8 - The function ID
18871 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18872 	 * * 0xFFFD - Reserved for user-space HWRM interface
18873 	 * * 0xFFFF - HWRM
18874 	 */
18875 	uint16_t	target_id;
18876 	/*
18877 	 * A physical address pointer pointing to a host buffer that the
18878 	 * command's response data will be written. This can be either a host
18879 	 * physical address (HPA) or a guest physical address (GPA) and must
18880 	 * point to a physically contiguous block of memory.
18881 	 */
18882 	uint64_t	resp_addr;
18883 } hwrm_func_backing_store_qcaps_input_t, *phwrm_func_backing_store_qcaps_input_t;
18884 
18885 /* hwrm_func_backing_store_qcaps_output (size:832b/104B) */
18886 
18887 typedef struct hwrm_func_backing_store_qcaps_output {
18888 	/* The specific error status for the command. */
18889 	uint16_t	error_code;
18890 	/* The HWRM command request type. */
18891 	uint16_t	req_type;
18892 	/* The sequence ID from the original command. */
18893 	uint16_t	seq_id;
18894 	/* The length of the response data in number of bytes. */
18895 	uint16_t	resp_len;
18896 	/* Maximum number of QP context entries supported for this function. */
18897 	uint32_t	qp_max_entries;
18898 	/*
18899 	 * Minimum number of QP context entries that are needed to be reserved
18900 	 * for QP1 for the PF and its VFs. PF drivers must allocate at least
18901 	 * this many QP context entries, even if RoCE will not be used.
18902 	 */
18903 	uint16_t	qp_min_qp1_entries;
18904 	/*
18905 	 * Maximum number of QP context entries that can be used for L2 and
18906 	 * mid-path.
18907 	 */
18908 	uint16_t	qp_max_l2_entries;
18909 	/* Number of bytes that must be allocated for each context entry. */
18910 	uint16_t	qp_entry_size;
18911 	/* Maximum number of SRQ context entries that can be used for L2. */
18912 	uint16_t	srq_max_l2_entries;
18913 	/* Maximum number of SRQ context entries supported for this function. */
18914 	uint32_t	srq_max_entries;
18915 	/* Number of bytes that must be allocated for each context entry. */
18916 	uint16_t	srq_entry_size;
18917 	/* Maximum number of CQ context entries that can be used for L2. */
18918 	uint16_t	cq_max_l2_entries;
18919 	/* Maximum number of CQ context entries supported for this function. */
18920 	uint32_t	cq_max_entries;
18921 	/* Number of bytes that must be allocated for each context entry. */
18922 	uint16_t	cq_entry_size;
18923 	/* Maximum number of VNIC context entries supported for this function. */
18924 	uint16_t	vnic_max_vnic_entries;
18925 	/*
18926 	 * Maximum number of Ring table context entries supported for this
18927 	 * function.
18928 	 */
18929 	uint16_t	vnic_max_ring_table_entries;
18930 	/* Number of bytes that must be allocated for each context entry. */
18931 	uint16_t	vnic_entry_size;
18932 	/*
18933 	 * Maximum number of statistic context entries supported for this
18934 	 * function.
18935 	 */
18936 	uint32_t	stat_max_entries;
18937 	/* Number of bytes that must be allocated for each context entry. */
18938 	uint16_t	stat_entry_size;
18939 	/* Number of bytes that must be allocated for each context entry. */
18940 	uint16_t	tqm_entry_size;
18941 	/* Minimum number of TQM context entries required per ring. */
18942 	uint32_t	tqm_min_entries_per_ring;
18943 	/*
18944 	 * Maximum number of TQM context entries supported per ring. This is
18945 	 * actually a recommended TQM queue size based on worst case usage of
18946 	 * the TQM queue.
18947 	 *
18948 	 * TQM fastpath rings should be sized large enough to accommodate the
18949 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
18950 	 * that can be enqueued to the TQM ring.
18951 	 *
18952 	 * TQM slowpath rings should be sized as follows:
18953 	 *
18954 	 * num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size
18955 	 *
18956 	 * Where:
18957 	 *   num_vnics is the number of VNICs allocated in the VNIC backing
18958 	 *   store
18959 	 *   num_l2_tx_rings is the number of L2 rings in the QP backing store
18960 	 *   num_roce_qps is the number of RoCE QPs in the QP backing store
18961 	 *   tqm_min_size is tqm_min_entries_per_ring reported by
18962 	 *	HWRM_FUNC_BACKING_STORE_QCAPS
18963 	 *
18964 	 * Note that TQM ring sizes cannot be extended while the system is
18965 	 * operational. If a PF driver needs to extend a TQM ring, it needs
18966 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18967 	 * the backing store.
18968 	 */
18969 	uint32_t	tqm_max_entries_per_ring;
18970 	/*
18971 	 * Maximum number of MR plus AV context entries supported for this
18972 	 * function.
18973 	 */
18974 	uint32_t	mrav_max_entries;
18975 	/* Number of bytes that must be allocated for each context entry. */
18976 	uint16_t	mrav_entry_size;
18977 	/* Number of bytes that must be allocated for each context entry. */
18978 	uint16_t	tim_entry_size;
18979 	/* Maximum number of Timer context entries supported for this function. */
18980 	uint32_t	tim_max_entries;
18981 	/*
18982 	 * When this field is zero, the 32b `mrav_num_entries` field in the
18983 	 * `backing_store_cfg` and `backing_store_qcfg` commands represents
18984 	 * the total number of MR plus AV entries allowed in the MR/AV backing
18985 	 * store PBL.
18986 	 *
18987 	 * When this field is non-zero, the 32b `mrav_num_entries` field in
18988 	 * the `backing_store_cfg` and `backing_store_qcfg` commands is
18989 	 * logically divided into two 16b fields. Bits `[31:16]` represents
18990 	 * the `mr_num_entries` and bits `[15:0]` represents `av_num_entries`.
18991 	 * Both of these values are represented in a unit granularity
18992 	 * specified by this field. For example, if this field is 16 and
18993 	 * `mrav_num_entries` is `0x02000100`, then the number of MR entries
18994 	 * is 8192 and the number of AV entries is 4096.
18995 	 */
18996 	uint16_t	mrav_num_entries_units;
18997 	/*
18998 	 * The number of entries specified for any TQM ring must be a
18999 	 * multiple of this value to prevent any resource allocation
19000 	 * limitations.
19001 	 */
19002 	uint8_t	tqm_entries_multiple;
19003 	/*
19004 	 * Initializer to be used by drivers
19005 	 * to initialize context memory to ensure
19006 	 * context subsystem flags an error for an attack
19007 	 * before the first time context load.
19008 	 */
19009 	uint8_t	ctx_kind_initializer;
19010 	/*
19011 	 * Specifies which context kinds need to be initialized with the
19012 	 * ctx_kind_initializer.
19013 	 */
19014 	uint16_t	ctx_init_mask;
19015 	/*
19016 	 * If this bit is '1' then this context type should be initialized
19017 	 * with the ctx_kind_initializer at the specified offset.
19018 	 */
19019 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_QP	UINT32_C(0x1)
19020 	/*
19021 	 * If this bit is '1' then this context type should be initialized
19022 	 * with the ctx_kind_initializer at the specified offset.
19023 	 */
19024 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_SRQ	UINT32_C(0x2)
19025 	/*
19026 	 * If this bit is '1' then this context type should be initialized
19027 	 * with the ctx_kind_initializer at the specified offset.
19028 	 */
19029 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_CQ	UINT32_C(0x4)
19030 	/*
19031 	 * If this bit is '1' then this context type should be initialized
19032 	 * with the ctx_kind_initializer at the specified offset.
19033 	 */
19034 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_VNIC	UINT32_C(0x8)
19035 	/*
19036 	 * If this bit is '1' then this context type should be initialized
19037 	 * with the ctx_kind_initializer at the specified offset.
19038 	 */
19039 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_STAT	UINT32_C(0x10)
19040 	/*
19041 	 * If this bit is '1' then this context type should be initialized
19042 	 * with the ctx_kind_initializer at the specified offset.
19043 	 */
19044 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_MRAV	UINT32_C(0x20)
19045 	/*
19046 	 * If this bit is '1' then the Tx KTLS context type should be
19047 	 * initialized with the ctx_kind_initializer at the specified offset.
19048 	 */
19049 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_TKC	UINT32_C(0x40)
19050 	/*
19051 	 * If this bit is '1' then the Rx KTLS context type should be
19052 	 * initialized with the ctx_kind_initializer at the specified offset.
19053 	 */
19054 	#define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_RKC	UINT32_C(0x80)
19055 	/*
19056 	 * Specifies the doubleword offset of ctx_kind_initializer for this
19057 	 * context type.
19058 	 */
19059 	uint8_t	qp_init_offset;
19060 	/*
19061 	 * Specifies the doubleword offset of ctx_kind_initializer for this
19062 	 * context type.
19063 	 */
19064 	uint8_t	srq_init_offset;
19065 	/*
19066 	 * Specifies the doubleword offset of ctx_kind_initializer for this
19067 	 * context type.
19068 	 */
19069 	uint8_t	cq_init_offset;
19070 	/*
19071 	 * Specifies the doubleword offset of ctx_kind_initializer for this
19072 	 * context type.
19073 	 */
19074 	uint8_t	vnic_init_offset;
19075 	/*
19076 	 * Count of TQM fastpath rings to be used for allocating backing store.
19077 	 * Backing store configuration must be specified for each TQM ring from
19078 	 * this count in `backing_store_cfg`.
19079 	 * Only first 8 TQM FP rings will be advertised with this field.
19080 	 */
19081 	uint8_t	tqm_fp_rings_count;
19082 	/*
19083 	 * Specifies the doubleword offset of ctx_kind_initializer for this
19084 	 * context type.
19085 	 */
19086 	uint8_t	stat_init_offset;
19087 	/*
19088 	 * Specifies the doubleword offset of ctx_kind_initializer for this
19089 	 * context type.
19090 	 */
19091 	uint8_t	mrav_init_offset;
19092 	/*
19093 	 * Count of TQM extended fastpath rings to be used for allocating
19094 	 * backing store beyond 8 rings(rings 9,10,11)
19095 	 * Backing store configuration must be specified for each TQM ring from
19096 	 * this count in `backing_store_cfg`.
19097 	 */
19098 	uint8_t	tqm_fp_rings_count_ext;
19099 	/*
19100 	 * Specifies the doubleword offset of ctx_kind_initializer for Tx
19101 	 * KTLS context type.
19102 	 */
19103 	uint8_t	tkc_init_offset;
19104 	/*
19105 	 * Specifies the doubleword offset of ctx_kind_initializer for Rx
19106 	 * KTLS context type.
19107 	 */
19108 	uint8_t	rkc_init_offset;
19109 	/* Tx KTLS context entry size in bytes. */
19110 	uint16_t	tkc_entry_size;
19111 	/* Rx KTLS context entry size in bytes. */
19112 	uint16_t	rkc_entry_size;
19113 	/*
19114 	 * Maximum number of Tx KTLS context entries supported for this
19115 	 * function.
19116 	 */
19117 	uint32_t	tkc_max_entries;
19118 	/*
19119 	 * Maximum number of Rx KTLS context entries supported for this
19120 	 * function.
19121 	 */
19122 	uint32_t	rkc_max_entries;
19123 	/*
19124 	 * Additional number of RoCE QP context entries required for this
19125 	 * function to support fast QP destroy feature.
19126 	 */
19127 	uint16_t	fast_qpmd_qp_num_entries;
19128 	/* Reserved for future. */
19129 	uint8_t	rsvd1[5];
19130 	/*
19131 	 * This field is used in Output records to indicate that the output
19132 	 * is completely written to RAM. This field should be read as '1'
19133 	 * to indicate that the output has been completely written. When
19134 	 * writing a command completion or response to an internal processor,
19135 	 * the order of writes has to be such that this field is written last.
19136 	 */
19137 	uint8_t	valid;
19138 } hwrm_func_backing_store_qcaps_output_t, *phwrm_func_backing_store_qcaps_output_t;
19139 
19140 /* tqm_fp_ring_cfg (size:128b/16B) */
19141 
19142 typedef struct tqm_fp_ring_cfg {
19143 	/* TQM ring page size and level. */
19144 	uint8_t	tqm_ring_pg_size_tqm_ring_lvl;
19145 	/* TQM ring PBL indirect levels. */
19146 	#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_MASK	UINT32_C(0xf)
19147 	#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_SFT	0
19148 	/* PBL pointer is physical start address. */
19149 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
19150 	/* PBL pointer points to PTE table. */
19151 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
19152 	/*
19153 	 * PBL pointer points to PDE table with each entry pointing to
19154 	 * PTE tables.
19155 	 */
19156 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
19157 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LAST	TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_2
19158 	/* TQM ring page size. */
19159 	#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
19160 	#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_SFT   4
19161 	/* 4KB. */
19162 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19163 	/* 8KB. */
19164 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19165 	/* 64KB. */
19166 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19167 	/* 2MB. */
19168 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19169 	/* 8MB. */
19170 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19171 	/* 1GB. */
19172 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19173 		#define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_LAST   TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_1G
19174 	uint8_t	unused[3];
19175 	/* Number of TQM ring entries. */
19176 	uint32_t	tqm_ring_num_entries;
19177 	/* TQM ring page directory. */
19178 	uint64_t	tqm_ring_page_dir;
19179 } tqm_fp_ring_cfg_t, *ptqm_fp_ring_cfg_t;
19180 
19181 /*******************************
19182  * hwrm_func_backing_store_cfg *
19183  *******************************/
19184 
19185 
19186 /* hwrm_func_backing_store_cfg_input (size:2688b/336B) */
19187 
19188 typedef struct hwrm_func_backing_store_cfg_input {
19189 	/* The HWRM command request type. */
19190 	uint16_t	req_type;
19191 	/*
19192 	 * The completion ring to send the completion event on. This should
19193 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
19194 	 */
19195 	uint16_t	cmpl_ring;
19196 	/*
19197 	 * The sequence ID is used by the driver for tracking multiple
19198 	 * commands. This ID is treated as opaque data by the firmware and
19199 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
19200 	 */
19201 	uint16_t	seq_id;
19202 	/*
19203 	 * The target ID of the command:
19204 	 * * 0x0-0xFFF8 - The function ID
19205 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19206 	 * * 0xFFFD - Reserved for user-space HWRM interface
19207 	 * * 0xFFFF - HWRM
19208 	 */
19209 	uint16_t	target_id;
19210 	/*
19211 	 * A physical address pointer pointing to a host buffer that the
19212 	 * command's response data will be written. This can be either a host
19213 	 * physical address (HPA) or a guest physical address (GPA) and must
19214 	 * point to a physically contiguous block of memory.
19215 	 */
19216 	uint64_t	resp_addr;
19217 	uint32_t	flags;
19218 	/*
19219 	 * When set, the firmware only uses on-chip resources and does not
19220 	 * expect any backing store to be provided by the host driver. This
19221 	 * mode provides minimal L2 functionality (e.g. limited L2 resources,
19222 	 * no RoCE).
19223 	 */
19224 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_PREBOOT_MODE		UINT32_C(0x1)
19225 	/*
19226 	 * When set, the 32b `mrav_num_entries` field is logically divided
19227 	 * into two 16b fields, `mr_num_entries` and `av_num_entries`.
19228 	 */
19229 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_MRAV_RESERVATION_SPLIT	UINT32_C(0x2)
19230 	uint32_t	enables;
19231 	/*
19232 	 * This bit must be '1' for the qp fields to be
19233 	 * configured.
19234 	 */
19235 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP		UINT32_C(0x1)
19236 	/*
19237 	 * This bit must be '1' for the srq fields to be
19238 	 * configured.
19239 	 */
19240 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ		UINT32_C(0x2)
19241 	/*
19242 	 * This bit must be '1' for the cq fields to be
19243 	 * configured.
19244 	 */
19245 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ		UINT32_C(0x4)
19246 	/*
19247 	 * This bit must be '1' for the vnic fields to be
19248 	 * configured.
19249 	 */
19250 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC		UINT32_C(0x8)
19251 	/*
19252 	 * This bit must be '1' for the stat fields to be
19253 	 * configured.
19254 	 */
19255 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT		UINT32_C(0x10)
19256 	/*
19257 	 * This bit must be '1' for the tqm_sp fields to be
19258 	 * configured.
19259 	 */
19260 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP	UINT32_C(0x20)
19261 	/*
19262 	 * This bit must be '1' for the tqm_ring0 fields to be
19263 	 * configured.
19264 	 */
19265 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING0	UINT32_C(0x40)
19266 	/*
19267 	 * This bit must be '1' for the tqm_ring1 fields to be
19268 	 * configured.
19269 	 */
19270 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING1	UINT32_C(0x80)
19271 	/*
19272 	 * This bit must be '1' for the tqm_ring2 fields to be
19273 	 * configured.
19274 	 */
19275 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING2	UINT32_C(0x100)
19276 	/*
19277 	 * This bit must be '1' for the tqm_ring3 fields to be
19278 	 * configured.
19279 	 */
19280 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING3	UINT32_C(0x200)
19281 	/*
19282 	 * This bit must be '1' for the tqm_ring4 fields to be
19283 	 * configured.
19284 	 */
19285 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING4	UINT32_C(0x400)
19286 	/*
19287 	 * This bit must be '1' for the tqm_ring5 fields to be
19288 	 * configured.
19289 	 */
19290 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING5	UINT32_C(0x800)
19291 	/*
19292 	 * This bit must be '1' for the tqm_ring6 fields to be
19293 	 * configured.
19294 	 */
19295 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING6	UINT32_C(0x1000)
19296 	/*
19297 	 * This bit must be '1' for the tqm_ring7 fields to be
19298 	 * configured.
19299 	 */
19300 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING7	UINT32_C(0x2000)
19301 	/*
19302 	 * This bit must be '1' for the mrav fields to be
19303 	 * configured.
19304 	 */
19305 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV		UINT32_C(0x4000)
19306 	/*
19307 	 * This bit must be '1' for the tim fields to be
19308 	 * configured.
19309 	 */
19310 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM		UINT32_C(0x8000)
19311 	/*
19312 	 * This bit must be '1' for the tqm_ring8 fields to be
19313 	 * configured.
19314 	 */
19315 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING8	UINT32_C(0x10000)
19316 	/*
19317 	 * This bit must be '1' for the tqm_ring9 fields to be
19318 	 * configured.
19319 	 */
19320 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING9	UINT32_C(0x20000)
19321 	/*
19322 	 * This bit must be '1' for the tqm_ring10 fields to be
19323 	 * configured.
19324 	 */
19325 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING10	UINT32_C(0x40000)
19326 	/*
19327 	 * This bit must be '1' for the Tx KTLS context
19328 	 * fields to be configured.
19329 	 */
19330 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TKC		UINT32_C(0x80000)
19331 	/*
19332 	 * This bit must be '1' for the Rx KTLS context
19333 	 * fields to be configured.
19334 	 */
19335 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_RKC		UINT32_C(0x100000)
19336 	/*
19337 	 * This bit must be '1' for the number of QPs reserved for fast
19338 	 * qp modify destroy feature to be configured.
19339 	 */
19340 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP_FAST_QPMD	UINT32_C(0x200000)
19341 	/* QPC page size and level. */
19342 	uint8_t	qpc_pg_size_qpc_lvl;
19343 	/* QPC PBL indirect levels. */
19344 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_MASK	UINT32_C(0xf)
19345 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_SFT	0
19346 	/* PBL pointer is physical start address. */
19347 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_0	UINT32_C(0x0)
19348 	/* PBL pointer points to PTE table. */
19349 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1	UINT32_C(0x1)
19350 	/*
19351 	 * PBL pointer points to PDE table with each entry pointing to PTE
19352 	 * tables.
19353 	 */
19354 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2	UINT32_C(0x2)
19355 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2
19356 	/* QPC page size. */
19357 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_MASK  UINT32_C(0xf0)
19358 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_SFT   4
19359 	/* 4KB. */
19360 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19361 	/* 8KB. */
19362 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19363 	/* 64KB. */
19364 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19365 	/* 2MB. */
19366 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19367 	/* 8MB. */
19368 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19369 	/* 1GB. */
19370 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19371 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G
19372 	/* SRQ page size and level. */
19373 	uint8_t	srq_pg_size_srq_lvl;
19374 	/* SRQ PBL indirect levels. */
19375 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_MASK	UINT32_C(0xf)
19376 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_SFT	0
19377 	/* PBL pointer is physical start address. */
19378 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_0	UINT32_C(0x0)
19379 	/* PBL pointer points to PTE table. */
19380 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_1	UINT32_C(0x1)
19381 	/*
19382 	 * PBL pointer points to PDE table with each entry pointing to PTE
19383 	 * tables.
19384 	 */
19385 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2	UINT32_C(0x2)
19386 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2
19387 	/* SRQ page size. */
19388 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_MASK  UINT32_C(0xf0)
19389 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_SFT   4
19390 	/* 4KB. */
19391 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19392 	/* 8KB. */
19393 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19394 	/* 64KB. */
19395 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19396 	/* 2MB. */
19397 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19398 	/* 8MB. */
19399 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19400 	/* 1GB. */
19401 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19402 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G
19403 	/* CQ page size and level. */
19404 	uint8_t	cq_pg_size_cq_lvl;
19405 	/* CQ PBL indirect levels. */
19406 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_MASK	UINT32_C(0xf)
19407 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_SFT	0
19408 	/* PBL pointer is physical start address. */
19409 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_0	UINT32_C(0x0)
19410 	/* PBL pointer points to PTE table. */
19411 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_1	UINT32_C(0x1)
19412 	/*
19413 	 * PBL pointer points to PDE table with each entry pointing to PTE
19414 	 * tables.
19415 	 */
19416 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2	UINT32_C(0x2)
19417 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2
19418 	/* CQ page size. */
19419 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_MASK  UINT32_C(0xf0)
19420 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_SFT   4
19421 	/* 4KB. */
19422 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19423 	/* 8KB. */
19424 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19425 	/* 64KB. */
19426 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19427 	/* 2MB. */
19428 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19429 	/* 8MB. */
19430 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19431 	/* 1GB. */
19432 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19433 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G
19434 	/* VNIC page size and level. */
19435 	uint8_t	vnic_pg_size_vnic_lvl;
19436 	/* VNIC PBL indirect levels. */
19437 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_MASK	UINT32_C(0xf)
19438 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_SFT	0
19439 	/* PBL pointer is physical start address. */
19440 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_0	UINT32_C(0x0)
19441 	/* PBL pointer points to PTE table. */
19442 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_1	UINT32_C(0x1)
19443 	/*
19444 	 * PBL pointer points to PDE table with each entry pointing to PTE
19445 	 * tables.
19446 	 */
19447 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2	UINT32_C(0x2)
19448 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2
19449 	/* VNIC page size. */
19450 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_MASK  UINT32_C(0xf0)
19451 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_SFT   4
19452 	/* 4KB. */
19453 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19454 	/* 8KB. */
19455 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19456 	/* 64KB. */
19457 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19458 	/* 2MB. */
19459 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19460 	/* 8MB. */
19461 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19462 	/* 1GB. */
19463 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19464 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G
19465 	/* Stat page size and level. */
19466 	uint8_t	stat_pg_size_stat_lvl;
19467 	/* Stat PBL indirect levels. */
19468 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_MASK	UINT32_C(0xf)
19469 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_SFT	0
19470 	/* PBL pointer is physical start address. */
19471 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_0	UINT32_C(0x0)
19472 	/* PBL pointer points to PTE table. */
19473 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_1	UINT32_C(0x1)
19474 	/*
19475 	 * PBL pointer points to PDE table with each entry pointing to PTE
19476 	 * tables.
19477 	 */
19478 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2	UINT32_C(0x2)
19479 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2
19480 	/* Stat page size. */
19481 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_MASK  UINT32_C(0xf0)
19482 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_SFT   4
19483 	/* 4KB. */
19484 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19485 	/* 8KB. */
19486 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19487 	/* 64KB. */
19488 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19489 	/* 2MB. */
19490 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19491 	/* 8MB. */
19492 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19493 	/* 1GB. */
19494 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19495 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G
19496 	/* TQM slow path page size and level. */
19497 	uint8_t	tqm_sp_pg_size_tqm_sp_lvl;
19498 	/* TQM slow path PBL indirect levels. */
19499 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_MASK	UINT32_C(0xf)
19500 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_SFT	0
19501 	/* PBL pointer is physical start address. */
19502 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_0	UINT32_C(0x0)
19503 	/* PBL pointer points to PTE table. */
19504 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_1	UINT32_C(0x1)
19505 	/*
19506 	 * PBL pointer points to PDE table with each entry pointing to PTE
19507 	 * tables.
19508 	 */
19509 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2	UINT32_C(0x2)
19510 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2
19511 	/* TQM slow path page size. */
19512 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_MASK  UINT32_C(0xf0)
19513 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_SFT   4
19514 	/* 4KB. */
19515 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19516 	/* 8KB. */
19517 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19518 	/* 64KB. */
19519 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19520 	/* 2MB. */
19521 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19522 	/* 8MB. */
19523 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19524 	/* 1GB. */
19525 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19526 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G
19527 	/* TQM ring 0 page size and level. */
19528 	uint8_t	tqm_ring0_pg_size_tqm_ring0_lvl;
19529 	/* TQM ring 0 PBL indirect levels. */
19530 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_MASK	UINT32_C(0xf)
19531 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_SFT	0
19532 	/* PBL pointer is physical start address. */
19533 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_0	UINT32_C(0x0)
19534 	/* PBL pointer points to PTE table. */
19535 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_1	UINT32_C(0x1)
19536 	/*
19537 	 * PBL pointer points to PDE table with each entry pointing to PTE
19538 	 * tables.
19539 	 */
19540 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2	UINT32_C(0x2)
19541 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2
19542 	/* TQM ring 0 page size. */
19543 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_MASK  UINT32_C(0xf0)
19544 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_SFT   4
19545 	/* 4KB. */
19546 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19547 	/* 8KB. */
19548 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19549 	/* 64KB. */
19550 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19551 	/* 2MB. */
19552 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19553 	/* 8MB. */
19554 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19555 	/* 1GB. */
19556 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19557 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G
19558 	/* TQM ring 1 page size and level. */
19559 	uint8_t	tqm_ring1_pg_size_tqm_ring1_lvl;
19560 	/* TQM ring 1 PBL indirect levels. */
19561 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_MASK	UINT32_C(0xf)
19562 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_SFT	0
19563 	/* PBL pointer is physical start address. */
19564 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_0	UINT32_C(0x0)
19565 	/* PBL pointer points to PTE table. */
19566 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_1	UINT32_C(0x1)
19567 	/*
19568 	 * PBL pointer points to PDE table with each entry pointing to PTE
19569 	 * tables.
19570 	 */
19571 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2	UINT32_C(0x2)
19572 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2
19573 	/* TQM ring 1 page size. */
19574 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_MASK  UINT32_C(0xf0)
19575 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_SFT   4
19576 	/* 4KB. */
19577 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19578 	/* 8KB. */
19579 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19580 	/* 64KB. */
19581 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19582 	/* 2MB. */
19583 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19584 	/* 8MB. */
19585 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19586 	/* 1GB. */
19587 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19588 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G
19589 	/* TQM ring 2 page size and level. */
19590 	uint8_t	tqm_ring2_pg_size_tqm_ring2_lvl;
19591 	/* TQM ring 2 PBL indirect levels. */
19592 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_MASK	UINT32_C(0xf)
19593 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_SFT	0
19594 	/* PBL pointer is physical start address. */
19595 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_0	UINT32_C(0x0)
19596 	/* PBL pointer points to PTE table. */
19597 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_1	UINT32_C(0x1)
19598 	/*
19599 	 * PBL pointer points to PDE table with each entry pointing to PTE
19600 	 * tables.
19601 	 */
19602 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2	UINT32_C(0x2)
19603 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2
19604 	/* TQM ring 2 page size. */
19605 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_MASK  UINT32_C(0xf0)
19606 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_SFT   4
19607 	/* 4KB. */
19608 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19609 	/* 8KB. */
19610 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19611 	/* 64KB. */
19612 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19613 	/* 2MB. */
19614 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19615 	/* 8MB. */
19616 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19617 	/* 1GB. */
19618 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19619 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G
19620 	/* TQM ring 3 page size and level. */
19621 	uint8_t	tqm_ring3_pg_size_tqm_ring3_lvl;
19622 	/* TQM ring 3 PBL indirect levels. */
19623 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_MASK	UINT32_C(0xf)
19624 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_SFT	0
19625 	/* PBL pointer is physical start address. */
19626 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_0	UINT32_C(0x0)
19627 	/* PBL pointer points to PTE table. */
19628 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_1	UINT32_C(0x1)
19629 	/*
19630 	 * PBL pointer points to PDE table with each entry pointing to PTE
19631 	 * tables.
19632 	 */
19633 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2	UINT32_C(0x2)
19634 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2
19635 	/* TQM ring 3 page size. */
19636 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_MASK  UINT32_C(0xf0)
19637 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_SFT   4
19638 	/* 4KB. */
19639 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19640 	/* 8KB. */
19641 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19642 	/* 64KB. */
19643 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19644 	/* 2MB. */
19645 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19646 	/* 8MB. */
19647 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19648 	/* 1GB. */
19649 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19650 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G
19651 	/* TQM ring 4 page size and level. */
19652 	uint8_t	tqm_ring4_pg_size_tqm_ring4_lvl;
19653 	/* TQM ring 4 PBL indirect levels. */
19654 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_MASK	UINT32_C(0xf)
19655 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_SFT	0
19656 	/* PBL pointer is physical start address. */
19657 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_0	UINT32_C(0x0)
19658 	/* PBL pointer points to PTE table. */
19659 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_1	UINT32_C(0x1)
19660 	/*
19661 	 * PBL pointer points to PDE table with each entry pointing to PTE
19662 	 * tables.
19663 	 */
19664 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2	UINT32_C(0x2)
19665 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2
19666 	/* TQM ring 4 page size. */
19667 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_MASK  UINT32_C(0xf0)
19668 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_SFT   4
19669 	/* 4KB. */
19670 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19671 	/* 8KB. */
19672 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19673 	/* 64KB. */
19674 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19675 	/* 2MB. */
19676 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19677 	/* 8MB. */
19678 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19679 	/* 1GB. */
19680 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19681 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G
19682 	/* TQM ring 5 page size and level. */
19683 	uint8_t	tqm_ring5_pg_size_tqm_ring5_lvl;
19684 	/* TQM ring 5 PBL indirect levels. */
19685 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_MASK	UINT32_C(0xf)
19686 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_SFT	0
19687 	/* PBL pointer is physical start address. */
19688 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_0	UINT32_C(0x0)
19689 	/* PBL pointer points to PTE table. */
19690 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_1	UINT32_C(0x1)
19691 	/*
19692 	 * PBL pointer points to PDE table with each entry pointing to PTE
19693 	 * tables.
19694 	 */
19695 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2	UINT32_C(0x2)
19696 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2
19697 	/* TQM ring 5 page size. */
19698 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_MASK  UINT32_C(0xf0)
19699 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_SFT   4
19700 	/* 4KB. */
19701 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19702 	/* 8KB. */
19703 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19704 	/* 64KB. */
19705 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19706 	/* 2MB. */
19707 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19708 	/* 8MB. */
19709 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19710 	/* 1GB. */
19711 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19712 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G
19713 	/* TQM ring 6 page size and level. */
19714 	uint8_t	tqm_ring6_pg_size_tqm_ring6_lvl;
19715 	/* TQM ring 6 PBL indirect levels. */
19716 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_MASK	UINT32_C(0xf)
19717 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_SFT	0
19718 	/* PBL pointer is physical start address. */
19719 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_0	UINT32_C(0x0)
19720 	/* PBL pointer points to PTE table. */
19721 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_1	UINT32_C(0x1)
19722 	/*
19723 	 * PBL pointer points to PDE table with each entry pointing to PTE
19724 	 * tables.
19725 	 */
19726 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2	UINT32_C(0x2)
19727 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2
19728 	/* TQM ring 6 page size. */
19729 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_MASK  UINT32_C(0xf0)
19730 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_SFT   4
19731 	/* 4KB. */
19732 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19733 	/* 8KB. */
19734 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19735 	/* 64KB. */
19736 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19737 	/* 2MB. */
19738 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19739 	/* 8MB. */
19740 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19741 	/* 1GB. */
19742 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19743 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G
19744 	/* TQM ring 7 page size and level. */
19745 	uint8_t	tqm_ring7_pg_size_tqm_ring7_lvl;
19746 	/* TQM ring 7 PBL indirect levels. */
19747 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_MASK	UINT32_C(0xf)
19748 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_SFT	0
19749 	/* PBL pointer is physical start address. */
19750 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_0	UINT32_C(0x0)
19751 	/* PBL pointer points to PTE table. */
19752 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_1	UINT32_C(0x1)
19753 	/*
19754 	 * PBL pointer points to PDE table with each entry pointing to PTE
19755 	 * tables.
19756 	 */
19757 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2	UINT32_C(0x2)
19758 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2
19759 	/* TQM ring 7 page size. */
19760 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_MASK  UINT32_C(0xf0)
19761 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_SFT   4
19762 	/* 4KB. */
19763 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19764 	/* 8KB. */
19765 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19766 	/* 64KB. */
19767 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19768 	/* 2MB. */
19769 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19770 	/* 8MB. */
19771 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19772 	/* 1GB. */
19773 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19774 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G
19775 	/* MR/AV page size and level. */
19776 	uint8_t	mrav_pg_size_mrav_lvl;
19777 	/* MR/AV PBL indirect levels. */
19778 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_MASK	UINT32_C(0xf)
19779 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_SFT	0
19780 	/* PBL pointer is physical start address. */
19781 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_0	UINT32_C(0x0)
19782 	/* PBL pointer points to PTE table. */
19783 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_1	UINT32_C(0x1)
19784 	/*
19785 	 * PBL pointer points to PDE table with each entry pointing to PTE
19786 	 * tables.
19787 	 */
19788 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2	UINT32_C(0x2)
19789 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2
19790 	/* MR/AV page size. */
19791 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_MASK  UINT32_C(0xf0)
19792 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_SFT   4
19793 	/* 4KB. */
19794 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19795 	/* 8KB. */
19796 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19797 	/* 64KB. */
19798 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19799 	/* 2MB. */
19800 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19801 	/* 8MB. */
19802 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19803 	/* 1GB. */
19804 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19805 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G
19806 	/* Timer page size and level. */
19807 	uint8_t	tim_pg_size_tim_lvl;
19808 	/* Timer PBL indirect levels. */
19809 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_MASK	UINT32_C(0xf)
19810 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_SFT	0
19811 	/* PBL pointer is physical start address. */
19812 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_0	UINT32_C(0x0)
19813 	/* PBL pointer points to PTE table. */
19814 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_1	UINT32_C(0x1)
19815 	/*
19816 	 * PBL pointer points to PDE table with each entry pointing to PTE
19817 	 * tables.
19818 	 */
19819 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2	UINT32_C(0x2)
19820 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2
19821 	/* Timer page size. */
19822 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_MASK  UINT32_C(0xf0)
19823 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_SFT   4
19824 	/* 4KB. */
19825 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
19826 	/* 8KB. */
19827 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
19828 	/* 64KB. */
19829 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
19830 	/* 2MB. */
19831 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
19832 	/* 8MB. */
19833 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
19834 	/* 1GB. */
19835 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
19836 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G
19837 	/* QP page directory. */
19838 	uint64_t	qpc_page_dir;
19839 	/* SRQ page directory. */
19840 	uint64_t	srq_page_dir;
19841 	/* CQ page directory. */
19842 	uint64_t	cq_page_dir;
19843 	/* VNIC page directory. */
19844 	uint64_t	vnic_page_dir;
19845 	/* Stat page directory. */
19846 	uint64_t	stat_page_dir;
19847 	/* TQM slowpath page directory. */
19848 	uint64_t	tqm_sp_page_dir;
19849 	/* TQM ring 0 page directory. */
19850 	uint64_t	tqm_ring0_page_dir;
19851 	/* TQM ring 1 page directory. */
19852 	uint64_t	tqm_ring1_page_dir;
19853 	/* TQM ring 2 page directory. */
19854 	uint64_t	tqm_ring2_page_dir;
19855 	/* TQM ring 3 page directory. */
19856 	uint64_t	tqm_ring3_page_dir;
19857 	/* TQM ring 4 page directory. */
19858 	uint64_t	tqm_ring4_page_dir;
19859 	/* TQM ring 5 page directory. */
19860 	uint64_t	tqm_ring5_page_dir;
19861 	/* TQM ring 6 page directory. */
19862 	uint64_t	tqm_ring6_page_dir;
19863 	/* TQM ring 7 page directory. */
19864 	uint64_t	tqm_ring7_page_dir;
19865 	/* MR/AV page directory. */
19866 	uint64_t	mrav_page_dir;
19867 	/* Timer page directory. */
19868 	uint64_t	tim_page_dir;
19869 	/* Number of QPs. */
19870 	uint32_t	qp_num_entries;
19871 	/* Number of SRQs. */
19872 	uint32_t	srq_num_entries;
19873 	/* Number of CQs. */
19874 	uint32_t	cq_num_entries;
19875 	/* Number of Stats. */
19876 	uint32_t	stat_num_entries;
19877 	/*
19878 	 * Number of TQM slowpath entries.
19879 	 *
19880 	 * TQM slowpath rings should be sized as follows:
19881 	 *
19882 	 * num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size
19883 	 *
19884 	 * Where:
19885 	 *   num_vnics is the number of VNICs allocated in the VNIC backing
19886 	 *   store num_l2_tx_rings is the number of L2 rings in the QP backing
19887 	 *   store num_roce_qps is the number of RoCE QPs in the QP backing
19888 	 *   store tqm_min_size is tqm_min_entries_per_ring reported by
19889 	 *   HWRM_FUNC_BACKING_STORE_QCAPS
19890 	 *
19891 	 * Note that TQM ring sizes cannot be extended while the system is
19892 	 * operational. If a PF driver needs to extend a TQM ring, it needs
19893 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
19894 	 * the backing store.
19895 	 */
19896 	uint32_t	tqm_sp_num_entries;
19897 	/*
19898 	 * Number of TQM ring 0 entries.
19899 	 *
19900 	 * TQM fastpath rings should be sized large enough to accommodate the
19901 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
19902 	 * that can be enqueued to the TQM ring.
19903 	 *
19904 	 * Note that TQM ring sizes cannot be extended while the system is
19905 	 * operational. If a PF driver needs to extend a TQM ring, it needs
19906 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
19907 	 * the backing store.
19908 	 */
19909 	uint32_t	tqm_ring0_num_entries;
19910 	/*
19911 	 * Number of TQM ring 1 entries.
19912 	 *
19913 	 * TQM fastpath rings should be sized large enough to accommodate the
19914 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
19915 	 * that can be enqueued to the TQM ring.
19916 	 *
19917 	 * Note that TQM ring sizes cannot be extended while the system is
19918 	 * operational. If a PF driver needs to extend a TQM ring, it needs
19919 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
19920 	 * the backing store.
19921 	 */
19922 	uint32_t	tqm_ring1_num_entries;
19923 	/*
19924 	 * Number of TQM ring 2 entries.
19925 	 *
19926 	 * TQM fastpath rings should be sized large enough to accommodate the
19927 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
19928 	 * that can be enqueued to the TQM ring.
19929 	 *
19930 	 * Note that TQM ring sizes cannot be extended while the system is
19931 	 * operational. If a PF driver needs to extend a TQM ring, it needs
19932 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
19933 	 * the backing store.
19934 	 */
19935 	uint32_t	tqm_ring2_num_entries;
19936 	/*
19937 	 * Number of TQM ring 3 entries.
19938 	 *
19939 	 * TQM fastpath rings should be sized large enough to accommodate the
19940 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
19941 	 * that can be enqueued to the TQM ring.
19942 	 *
19943 	 * Note that TQM ring sizes cannot be extended while the system is
19944 	 * operational. If a PF driver needs to extend a TQM ring, it needs
19945 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
19946 	 * the backing store.
19947 	 */
19948 	uint32_t	tqm_ring3_num_entries;
19949 	/*
19950 	 * Number of TQM ring 4 entries.
19951 	 *
19952 	 * TQM fastpath rings should be sized large enough to accommodate the
19953 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
19954 	 * that can be enqueued to the TQM ring.
19955 	 *
19956 	 * Note that TQM ring sizes cannot be extended while the system is
19957 	 * operational. If a PF driver needs to extend a TQM ring, it needs
19958 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
19959 	 * the backing store.
19960 	 */
19961 	uint32_t	tqm_ring4_num_entries;
19962 	/*
19963 	 * Number of TQM ring 5 entries.
19964 	 *
19965 	 * TQM fastpath rings should be sized large enough to accommodate the
19966 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
19967 	 * that can be enqueued to the TQM ring.
19968 	 *
19969 	 * Note that TQM ring sizes cannot be extended while the system is
19970 	 * operational. If a PF driver needs to extend a TQM ring, it needs
19971 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
19972 	 * the backing store.
19973 	 */
19974 	uint32_t	tqm_ring5_num_entries;
19975 	/*
19976 	 * Number of TQM ring 6 entries.
19977 	 *
19978 	 * TQM fastpath rings should be sized large enough to accommodate the
19979 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
19980 	 * that can be enqueued to the TQM ring.
19981 	 *
19982 	 * Note that TQM ring sizes cannot be extended while the system is
19983 	 * operational. If a PF driver needs to extend a TQM ring, it needs
19984 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
19985 	 * the backing store.
19986 	 */
19987 	uint32_t	tqm_ring6_num_entries;
19988 	/*
19989 	 * Number of TQM ring 7 entries.
19990 	 *
19991 	 * TQM fastpath rings should be sized large enough to accommodate the
19992 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
19993 	 * that can be enqueued to the TQM ring.
19994 	 *
19995 	 * Note that TQM ring sizes cannot be extended while the system is
19996 	 * operational. If a PF driver needs to extend a TQM ring, it needs
19997 	 * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
19998 	 * the backing store.
19999 	 */
20000 	uint32_t	tqm_ring7_num_entries;
20001 	/*
20002 	 * If the MR/AV split reservation flag is not set, then this field
20003 	 * represents the total number of MR plus AV entries. For versions
20004 	 * of firmware that support the split reservation, when it is not
20005 	 * specified half of the entries will be reserved for MRs and the
20006 	 * other half for AVs.
20007 	 *
20008 	 * If the MR/AV split reservation flag is set, then this
20009 	 * field is logically divided into two 16b fields. Bits `[31:16]`
20010 	 * represents the `mr_num_entries` and bits `[15:0]` represents
20011 	 * `av_num_entries`. The granularity of these values is defined by
20012 	 * the `mrav_num_entries_unit` field returned by the
20013 	 * `backing_store_qcaps` command.
20014 	 */
20015 	uint32_t	mrav_num_entries;
20016 	/* Number of Timer entries. */
20017 	uint32_t	tim_num_entries;
20018 	/* Number of entries to reserve for QP1 */
20019 	uint16_t	qp_num_qp1_entries;
20020 	/* Number of entries to reserve for L2 */
20021 	uint16_t	qp_num_l2_entries;
20022 	/* Number of bytes that have been allocated for each context entry. */
20023 	uint16_t	qp_entry_size;
20024 	/* Number of entries to reserve for L2 */
20025 	uint16_t	srq_num_l2_entries;
20026 	/* Number of bytes that have been allocated for each context entry. */
20027 	uint16_t	srq_entry_size;
20028 	/* Number of entries to reserve for L2 */
20029 	uint16_t	cq_num_l2_entries;
20030 	/* Number of bytes that have been allocated for each context entry. */
20031 	uint16_t	cq_entry_size;
20032 	/* Number of entries to reserve for VNIC entries */
20033 	uint16_t	vnic_num_vnic_entries;
20034 	/* Number of entries to reserve for Ring table entries */
20035 	uint16_t	vnic_num_ring_table_entries;
20036 	/* Number of bytes that have been allocated for each context entry. */
20037 	uint16_t	vnic_entry_size;
20038 	/* Number of bytes that have been allocated for each context entry. */
20039 	uint16_t	stat_entry_size;
20040 	/* Number of bytes that have been allocated for each context entry. */
20041 	uint16_t	tqm_entry_size;
20042 	/* Number of bytes that have been allocated for each context entry. */
20043 	uint16_t	mrav_entry_size;
20044 	/* Number of bytes that have been allocated for each context entry. */
20045 	uint16_t	tim_entry_size;
20046 	/* TQM ring page size and level. */
20047 	uint8_t	tqm_ring8_pg_size_tqm_ring_lvl;
20048 	/* TQM ring PBL indirect levels. */
20049 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_MASK	UINT32_C(0xf)
20050 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_SFT	0
20051 	/* PBL pointer is physical start address. */
20052 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
20053 	/* PBL pointer points to PTE table. */
20054 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
20055 	/*
20056 	 * PBL pointer points to PDE table with each entry pointing to
20057 	 * PTE tables.
20058 	 */
20059 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
20060 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_2
20061 	/* TQM ring page size. */
20062 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
20063 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_SFT   4
20064 	/* 4KB. */
20065 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20066 	/* 8KB. */
20067 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20068 	/* 64KB. */
20069 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20070 	/* 2MB. */
20071 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20072 	/* 8MB. */
20073 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20074 	/* 1GB. */
20075 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20076 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_1G
20077 	uint8_t	ring8_unused[3];
20078 	/* Number of TQM ring entries. */
20079 	uint32_t	tqm_ring8_num_entries;
20080 	/* TQM ring page directory. */
20081 	uint64_t	tqm_ring8_page_dir;
20082 	/* TQM ring page size and level. */
20083 	uint8_t	tqm_ring9_pg_size_tqm_ring_lvl;
20084 	/* TQM ring PBL indirect levels. */
20085 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_MASK	UINT32_C(0xf)
20086 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_SFT	0
20087 	/* PBL pointer is physical start address. */
20088 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
20089 	/* PBL pointer points to PTE table. */
20090 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
20091 	/*
20092 	 * PBL pointer points to PDE table with each entry pointing to
20093 	 * PTE tables.
20094 	 */
20095 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
20096 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_2
20097 	/* TQM ring page size. */
20098 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
20099 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_SFT   4
20100 	/* 4KB. */
20101 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20102 	/* 8KB. */
20103 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20104 	/* 64KB. */
20105 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20106 	/* 2MB. */
20107 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20108 	/* 8MB. */
20109 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20110 	/* 1GB. */
20111 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20112 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_1G
20113 	uint8_t	ring9_unused[3];
20114 	/* Number of TQM ring entries. */
20115 	uint32_t	tqm_ring9_num_entries;
20116 	/* TQM ring page directory. */
20117 	uint64_t	tqm_ring9_page_dir;
20118 	/* TQM ring page size and level. */
20119 	uint8_t	tqm_ring10_pg_size_tqm_ring_lvl;
20120 	/* TQM ring PBL indirect levels. */
20121 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_MASK	UINT32_C(0xf)
20122 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_SFT	0
20123 	/* PBL pointer is physical start address. */
20124 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
20125 	/* PBL pointer points to PTE table. */
20126 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
20127 	/*
20128 	 * PBL pointer points to PDE table with each entry pointing to
20129 	 * PTE tables.
20130 	 */
20131 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
20132 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_2
20133 	/* TQM ring page size. */
20134 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
20135 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_SFT   4
20136 	/* 4KB. */
20137 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20138 	/* 8KB. */
20139 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20140 	/* 64KB. */
20141 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20142 	/* 2MB. */
20143 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20144 	/* 8MB. */
20145 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20146 	/* 1GB. */
20147 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20148 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_1G
20149 	uint8_t	ring10_unused[3];
20150 	/* Number of TQM ring entries. */
20151 	uint32_t	tqm_ring10_num_entries;
20152 	/* TQM ring page directory. */
20153 	uint64_t	tqm_ring10_page_dir;
20154 	/* Number of Tx KTLS context entries allocated. */
20155 	uint32_t	tkc_num_entries;
20156 	/* Number of Rx KTLS context entries allocated. */
20157 	uint32_t	rkc_num_entries;
20158 	/* Tx KTLS context page directory. */
20159 	uint64_t	tkc_page_dir;
20160 	/* Rx KTLS context page directory. */
20161 	uint64_t	rkc_page_dir;
20162 	/* Number of bytes allocated for each Tx KTLS context entry. */
20163 	uint16_t	tkc_entry_size;
20164 	/* Number of bytes allocated for each Rx KTLS context entry. */
20165 	uint16_t	rkc_entry_size;
20166 	/* Tx KTLS context page size and level. */
20167 	uint8_t	tkc_pg_size_tkc_lvl;
20168 	/* Tx KTLS context PBL indirect levels. */
20169 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_MASK	UINT32_C(0xf)
20170 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_SFT	0
20171 	/* PBL pointer is physical start address. */
20172 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_0	UINT32_C(0x0)
20173 	/* PBL pointer points to PTE table. */
20174 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_1	UINT32_C(0x1)
20175 	/*
20176 	 * PBL pointer points to PDE table with each entry pointing to PTE
20177 	 * tables.
20178 	 */
20179 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_2	UINT32_C(0x2)
20180 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_2
20181 	/* Tx KTLS context page size. */
20182 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_MASK  UINT32_C(0xf0)
20183 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_SFT   4
20184 	/* 4KB. */
20185 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20186 	/* 8KB. */
20187 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20188 	/* 64KB. */
20189 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20190 	/* 2MB. */
20191 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20192 	/* 8MB. */
20193 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20194 	/* 1GB. */
20195 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20196 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_1G
20197 	/* Rx KTLS context page size and level. */
20198 	uint8_t	rkc_pg_size_rkc_lvl;
20199 	/* Rx KTLS context PBL indirect levels. */
20200 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_MASK	UINT32_C(0xf)
20201 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_SFT	0
20202 	/* PBL pointer is physical start address. */
20203 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_0	UINT32_C(0x0)
20204 	/* PBL pointer points to PTE table. */
20205 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_1	UINT32_C(0x1)
20206 	/*
20207 	 * PBL pointer points to PDE table with each entry pointing to
20208 	 * PTE tables.
20209 	 */
20210 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_2	UINT32_C(0x2)
20211 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LAST	HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_2
20212 	/* Rx KTLS context page size. */
20213 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_MASK  UINT32_C(0xf0)
20214 	#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_SFT   4
20215 	/* 4KB. */
20216 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20217 	/* 8KB. */
20218 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20219 	/* 64KB. */
20220 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20221 	/* 2MB. */
20222 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20223 	/* 8MB. */
20224 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20225 	/* 1GB. */
20226 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20227 		#define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_1G
20228 	/*
20229 	 * Number of RoCE QP context entries reserved for this
20230 	 * function to support fast QP modify destroy feature.
20231 	 */
20232 	uint16_t	qp_num_fast_qpmd_entries;
20233 } hwrm_func_backing_store_cfg_input_t, *phwrm_func_backing_store_cfg_input_t;
20234 
20235 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */
20236 
20237 typedef struct hwrm_func_backing_store_cfg_output {
20238 	/* The specific error status for the command. */
20239 	uint16_t	error_code;
20240 	/* The HWRM command request type. */
20241 	uint16_t	req_type;
20242 	/* The sequence ID from the original command. */
20243 	uint16_t	seq_id;
20244 	/* The length of the response data in number of bytes. */
20245 	uint16_t	resp_len;
20246 	uint8_t	unused_0[7];
20247 	/*
20248 	 * This field is used in Output records to indicate that the output
20249 	 * is completely written to RAM. This field should be read as '1'
20250 	 * to indicate that the output has been completely written. When
20251 	 * writing a command completion or response to an internal processor,
20252 	 * the order of writes has to be such that this field is written last.
20253 	 */
20254 	uint8_t	valid;
20255 } hwrm_func_backing_store_cfg_output_t, *phwrm_func_backing_store_cfg_output_t;
20256 
20257 /********************************
20258  * hwrm_func_backing_store_qcfg *
20259  ********************************/
20260 
20261 
20262 /* hwrm_func_backing_store_qcfg_input (size:128b/16B) */
20263 
20264 typedef struct hwrm_func_backing_store_qcfg_input {
20265 	/* The HWRM command request type. */
20266 	uint16_t	req_type;
20267 	/*
20268 	 * The completion ring to send the completion event on. This should
20269 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
20270 	 */
20271 	uint16_t	cmpl_ring;
20272 	/*
20273 	 * The sequence ID is used by the driver for tracking multiple
20274 	 * commands. This ID is treated as opaque data by the firmware and
20275 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
20276 	 */
20277 	uint16_t	seq_id;
20278 	/*
20279 	 * The target ID of the command:
20280 	 * * 0x0-0xFFF8 - The function ID
20281 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20282 	 * * 0xFFFD - Reserved for user-space HWRM interface
20283 	 * * 0xFFFF - HWRM
20284 	 */
20285 	uint16_t	target_id;
20286 	/*
20287 	 * A physical address pointer pointing to a host buffer that the
20288 	 * command's response data will be written. This can be either a host
20289 	 * physical address (HPA) or a guest physical address (GPA) and must
20290 	 * point to a physically contiguous block of memory.
20291 	 */
20292 	uint64_t	resp_addr;
20293 } hwrm_func_backing_store_qcfg_input_t, *phwrm_func_backing_store_qcfg_input_t;
20294 
20295 /* hwrm_func_backing_store_qcfg_output (size:2496b/312B) */
20296 
20297 typedef struct hwrm_func_backing_store_qcfg_output {
20298 	/* The specific error status for the command. */
20299 	uint16_t	error_code;
20300 	/* The HWRM command request type. */
20301 	uint16_t	req_type;
20302 	/* The sequence ID from the original command. */
20303 	uint16_t	seq_id;
20304 	/* The length of the response data in number of bytes. */
20305 	uint16_t	resp_len;
20306 	uint32_t	flags;
20307 	/*
20308 	 * When set, the firmware only uses on-chip resources and does not
20309 	 * expect any backing store to be provided by the host driver. This
20310 	 * mode provides minimal L2 functionality (e.g. limited L2 resources,
20311 	 * no RoCE).
20312 	 */
20313 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_PREBOOT_MODE		UINT32_C(0x1)
20314 	/*
20315 	 * When set, the 32b `mrav_num_entries` field is logically divided
20316 	 * into two 16b fields, `mr_num_entries` and `av_num_entries`.
20317 	 */
20318 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_MRAV_RESERVATION_SPLIT	UINT32_C(0x2)
20319 	uint32_t	enables;
20320 	/*
20321 	 * This bit must be '1' for the qp fields to be
20322 	 * configured.
20323 	 */
20324 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_QP		UINT32_C(0x1)
20325 	/*
20326 	 * This bit must be '1' for the srq fields to be
20327 	 * configured.
20328 	 */
20329 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_SRQ		UINT32_C(0x2)
20330 	/*
20331 	 * This bit must be '1' for the cq fields to be
20332 	 * configured.
20333 	 */
20334 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_CQ		UINT32_C(0x4)
20335 	/*
20336 	 * This bit must be '1' for the vnic fields to be
20337 	 * configured.
20338 	 */
20339 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_VNIC		UINT32_C(0x8)
20340 	/*
20341 	 * This bit must be '1' for the stat fields to be
20342 	 * configured.
20343 	 */
20344 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_STAT		UINT32_C(0x10)
20345 	/*
20346 	 * This bit must be '1' for the tqm_sp fields to be
20347 	 * configured.
20348 	 */
20349 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_SP	UINT32_C(0x20)
20350 	/*
20351 	 * This bit must be '1' for the tqm_ring0 fields to be
20352 	 * configured.
20353 	 */
20354 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING0	UINT32_C(0x40)
20355 	/*
20356 	 * This bit must be '1' for the tqm_ring1 fields to be
20357 	 * configured.
20358 	 */
20359 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING1	UINT32_C(0x80)
20360 	/*
20361 	 * This bit must be '1' for the tqm_ring2 fields to be
20362 	 * configured.
20363 	 */
20364 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING2	UINT32_C(0x100)
20365 	/*
20366 	 * This bit must be '1' for the tqm_ring3 fields to be
20367 	 * configured.
20368 	 */
20369 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING3	UINT32_C(0x200)
20370 	/*
20371 	 * This bit must be '1' for the tqm_ring4 fields to be
20372 	 * configured.
20373 	 */
20374 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING4	UINT32_C(0x400)
20375 	/*
20376 	 * This bit must be '1' for the tqm_ring5 fields to be
20377 	 * configured.
20378 	 */
20379 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING5	UINT32_C(0x800)
20380 	/*
20381 	 * This bit must be '1' for the tqm_ring6 fields to be
20382 	 * configured.
20383 	 */
20384 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING6	UINT32_C(0x1000)
20385 	/*
20386 	 * This bit must be '1' for the tqm_ring7 fields to be
20387 	 * configured.
20388 	 */
20389 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING7	UINT32_C(0x2000)
20390 	/*
20391 	 * This bit must be '1' for the mrav fields to be
20392 	 * configured.
20393 	 */
20394 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_MRAV		UINT32_C(0x4000)
20395 	/*
20396 	 * This bit must be '1' for the tim fields to be
20397 	 * configured.
20398 	 */
20399 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TIM		UINT32_C(0x8000)
20400 	/*
20401 	 * This bit must be '1' for the tqm_ring8 fields to be
20402 	 * configured.
20403 	 */
20404 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING8	UINT32_C(0x10000)
20405 	/*
20406 	 * This bit must be '1' for the tqm_ring9 fields to be
20407 	 * configured.
20408 	 */
20409 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING9	UINT32_C(0x20000)
20410 	/*
20411 	 * This bit must be '1' for the tqm_ring10 fields to be
20412 	 * configured.
20413 	 */
20414 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING10	UINT32_C(0x40000)
20415 	/*
20416 	 * This bit must be '1' for the Tx KTLS context
20417 	 * fields to be configured.
20418 	 */
20419 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TKC		UINT32_C(0x80000)
20420 	/*
20421 	 * This bit must be '1' for the Rx KTLS context
20422 	 * fields to be configured.
20423 	 */
20424 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_RKC		UINT32_C(0x100000)
20425 	/*
20426 	 * This bit must be '1' for the number of QPs reserved for fast
20427 	 * qp modify destroy feature to be configured.
20428 	 */
20429 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_QP_FAST_QPMD	UINT32_C(0x200000)
20430 	/* QPC page size and level. */
20431 	uint8_t	qpc_pg_size_qpc_lvl;
20432 	/* QPC PBL indirect levels. */
20433 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_MASK	UINT32_C(0xf)
20434 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_SFT	0
20435 	/* PBL pointer is physical start address. */
20436 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_0	UINT32_C(0x0)
20437 	/* PBL pointer points to PTE table. */
20438 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_1	UINT32_C(0x1)
20439 	/*
20440 	 * PBL pointer points to PDE table with each entry pointing to PTE
20441 	 * tables.
20442 	 */
20443 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2	UINT32_C(0x2)
20444 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2
20445 	/* QPC page size. */
20446 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_MASK  UINT32_C(0xf0)
20447 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_SFT   4
20448 	/* 4KB. */
20449 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20450 	/* 8KB. */
20451 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20452 	/* 64KB. */
20453 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20454 	/* 2MB. */
20455 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20456 	/* 8MB. */
20457 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20458 	/* 1GB. */
20459 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20460 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G
20461 	/* SRQ page size and level. */
20462 	uint8_t	srq_pg_size_srq_lvl;
20463 	/* SRQ PBL indirect levels. */
20464 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_MASK	UINT32_C(0xf)
20465 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_SFT	0
20466 	/* PBL pointer is physical start address. */
20467 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_0	UINT32_C(0x0)
20468 	/* PBL pointer points to PTE table. */
20469 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_1	UINT32_C(0x1)
20470 	/*
20471 	 * PBL pointer points to PDE table with each entry pointing to PTE
20472 	 * tables.
20473 	 */
20474 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2	UINT32_C(0x2)
20475 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2
20476 	/* SRQ page size. */
20477 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_MASK  UINT32_C(0xf0)
20478 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_SFT   4
20479 	/* 4KB. */
20480 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20481 	/* 8KB. */
20482 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20483 	/* 64KB. */
20484 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20485 	/* 2MB. */
20486 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20487 	/* 8MB. */
20488 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20489 	/* 1GB. */
20490 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20491 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G
20492 	/* CQ page size and level. */
20493 	uint8_t	cq_pg_size_cq_lvl;
20494 	/* CQ PBL indirect levels. */
20495 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_MASK	UINT32_C(0xf)
20496 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_SFT	0
20497 	/* PBL pointer is physical start address. */
20498 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_0	UINT32_C(0x0)
20499 	/* PBL pointer points to PTE table. */
20500 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_1	UINT32_C(0x1)
20501 	/*
20502 	 * PBL pointer points to PDE table with each entry pointing to PTE
20503 	 * tables.
20504 	 */
20505 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2	UINT32_C(0x2)
20506 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2
20507 	/* CQ page size. */
20508 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_MASK  UINT32_C(0xf0)
20509 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_SFT   4
20510 	/* 4KB. */
20511 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20512 	/* 8KB. */
20513 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20514 	/* 64KB. */
20515 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20516 	/* 2MB. */
20517 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20518 	/* 8MB. */
20519 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20520 	/* 1GB. */
20521 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20522 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G
20523 	/* VNIC page size and level. */
20524 	uint8_t	vnic_pg_size_vnic_lvl;
20525 	/* VNIC PBL indirect levels. */
20526 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_MASK	UINT32_C(0xf)
20527 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_SFT	0
20528 	/* PBL pointer is physical start address. */
20529 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_0	UINT32_C(0x0)
20530 	/* PBL pointer points to PTE table. */
20531 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_1	UINT32_C(0x1)
20532 	/*
20533 	 * PBL pointer points to PDE table with each entry pointing to PTE
20534 	 * tables.
20535 	 */
20536 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2	UINT32_C(0x2)
20537 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2
20538 	/* VNIC page size. */
20539 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_MASK  UINT32_C(0xf0)
20540 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_SFT   4
20541 	/* 4KB. */
20542 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20543 	/* 8KB. */
20544 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20545 	/* 64KB. */
20546 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20547 	/* 2MB. */
20548 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20549 	/* 8MB. */
20550 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20551 	/* 1GB. */
20552 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20553 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G
20554 	/* Stat page size and level. */
20555 	uint8_t	stat_pg_size_stat_lvl;
20556 	/* Stat PBL indirect levels. */
20557 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_MASK	UINT32_C(0xf)
20558 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_SFT	0
20559 	/* PBL pointer is physical start address. */
20560 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_0	UINT32_C(0x0)
20561 	/* PBL pointer points to PTE table. */
20562 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_1	UINT32_C(0x1)
20563 	/*
20564 	 * PBL pointer points to PDE table with each entry pointing to PTE
20565 	 * tables.
20566 	 */
20567 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2	UINT32_C(0x2)
20568 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2
20569 	/* Stat page size. */
20570 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_MASK  UINT32_C(0xf0)
20571 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_SFT   4
20572 	/* 4KB. */
20573 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20574 	/* 8KB. */
20575 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20576 	/* 64KB. */
20577 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20578 	/* 2MB. */
20579 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20580 	/* 8MB. */
20581 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20582 	/* 1GB. */
20583 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20584 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G
20585 	/* TQM slow path page size and level. */
20586 	uint8_t	tqm_sp_pg_size_tqm_sp_lvl;
20587 	/* TQM slow path PBL indirect levels. */
20588 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_MASK	UINT32_C(0xf)
20589 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_SFT	0
20590 	/* PBL pointer is physical start address. */
20591 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_0	UINT32_C(0x0)
20592 	/* PBL pointer points to PTE table. */
20593 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_1	UINT32_C(0x1)
20594 	/*
20595 	 * PBL pointer points to PDE table with each entry pointing to PTE
20596 	 * tables.
20597 	 */
20598 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2	UINT32_C(0x2)
20599 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2
20600 	/* TQM slow path page size. */
20601 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_MASK  UINT32_C(0xf0)
20602 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_SFT   4
20603 	/* 4KB. */
20604 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20605 	/* 8KB. */
20606 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20607 	/* 64KB. */
20608 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20609 	/* 2MB. */
20610 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20611 	/* 8MB. */
20612 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20613 	/* 1GB. */
20614 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20615 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G
20616 	/* TQM ring 0 page size and level. */
20617 	uint8_t	tqm_ring0_pg_size_tqm_ring0_lvl;
20618 	/* TQM ring 0 PBL indirect levels. */
20619 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_MASK	UINT32_C(0xf)
20620 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_SFT	0
20621 	/* PBL pointer is physical start address. */
20622 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_0	UINT32_C(0x0)
20623 	/* PBL pointer points to PTE table. */
20624 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_1	UINT32_C(0x1)
20625 	/*
20626 	 * PBL pointer points to PDE table with each entry pointing to PTE
20627 	 * tables.
20628 	 */
20629 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2	UINT32_C(0x2)
20630 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2
20631 	/* TQM ring 0 page size. */
20632 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_MASK  UINT32_C(0xf0)
20633 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_SFT   4
20634 	/* 4KB. */
20635 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20636 	/* 8KB. */
20637 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20638 	/* 64KB. */
20639 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20640 	/* 2MB. */
20641 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20642 	/* 8MB. */
20643 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20644 	/* 1GB. */
20645 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20646 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G
20647 	/* TQM ring 1 page size and level. */
20648 	uint8_t	tqm_ring1_pg_size_tqm_ring1_lvl;
20649 	/* TQM ring 1 PBL indirect levels. */
20650 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_MASK	UINT32_C(0xf)
20651 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_SFT	0
20652 	/* PBL pointer is physical start address. */
20653 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_0	UINT32_C(0x0)
20654 	/* PBL pointer points to PTE table. */
20655 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_1	UINT32_C(0x1)
20656 	/*
20657 	 * PBL pointer points to PDE table with each entry pointing to PTE
20658 	 * tables.
20659 	 */
20660 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2	UINT32_C(0x2)
20661 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2
20662 	/* TQM ring 1 page size. */
20663 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_MASK  UINT32_C(0xf0)
20664 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_SFT   4
20665 	/* 4KB. */
20666 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20667 	/* 8KB. */
20668 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20669 	/* 64KB. */
20670 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20671 	/* 2MB. */
20672 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20673 	/* 8MB. */
20674 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20675 	/* 1GB. */
20676 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20677 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G
20678 	/* TQM ring 2 page size and level. */
20679 	uint8_t	tqm_ring2_pg_size_tqm_ring2_lvl;
20680 	/* TQM ring 2 PBL indirect levels. */
20681 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_MASK	UINT32_C(0xf)
20682 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_SFT	0
20683 	/* PBL pointer is physical start address. */
20684 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_0	UINT32_C(0x0)
20685 	/* PBL pointer points to PTE table. */
20686 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_1	UINT32_C(0x1)
20687 	/*
20688 	 * PBL pointer points to PDE table with each entry pointing to PTE
20689 	 * tables.
20690 	 */
20691 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2	UINT32_C(0x2)
20692 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2
20693 	/* TQM ring 2 page size. */
20694 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_MASK  UINT32_C(0xf0)
20695 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_SFT   4
20696 	/* 4KB. */
20697 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20698 	/* 8KB. */
20699 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20700 	/* 64KB. */
20701 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20702 	/* 2MB. */
20703 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20704 	/* 8MB. */
20705 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20706 	/* 1GB. */
20707 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20708 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G
20709 	/* TQM ring 3 page size and level. */
20710 	uint8_t	tqm_ring3_pg_size_tqm_ring3_lvl;
20711 	/* TQM ring 3 PBL indirect levels. */
20712 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_MASK	UINT32_C(0xf)
20713 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_SFT	0
20714 	/* PBL pointer is physical start address. */
20715 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_0	UINT32_C(0x0)
20716 	/* PBL pointer points to PTE table. */
20717 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_1	UINT32_C(0x1)
20718 	/*
20719 	 * PBL pointer points to PDE table with each entry pointing to PTE
20720 	 * tables.
20721 	 */
20722 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2	UINT32_C(0x2)
20723 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2
20724 	/* TQM ring 3 page size. */
20725 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_MASK  UINT32_C(0xf0)
20726 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_SFT   4
20727 	/* 4KB. */
20728 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20729 	/* 8KB. */
20730 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20731 	/* 64KB. */
20732 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20733 	/* 2MB. */
20734 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20735 	/* 8MB. */
20736 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20737 	/* 1GB. */
20738 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20739 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G
20740 	/* TQM ring 4 page size and level. */
20741 	uint8_t	tqm_ring4_pg_size_tqm_ring4_lvl;
20742 	/* TQM ring 4 PBL indirect levels. */
20743 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_MASK	UINT32_C(0xf)
20744 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_SFT	0
20745 	/* PBL pointer is physical start address. */
20746 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_0	UINT32_C(0x0)
20747 	/* PBL pointer points to PTE table. */
20748 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_1	UINT32_C(0x1)
20749 	/*
20750 	 * PBL pointer points to PDE table with each entry pointing to PTE
20751 	 * tables.
20752 	 */
20753 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2	UINT32_C(0x2)
20754 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2
20755 	/* TQM ring 4 page size. */
20756 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_MASK  UINT32_C(0xf0)
20757 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_SFT   4
20758 	/* 4KB. */
20759 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20760 	/* 8KB. */
20761 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20762 	/* 64KB. */
20763 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20764 	/* 2MB. */
20765 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20766 	/* 8MB. */
20767 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20768 	/* 1GB. */
20769 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20770 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G
20771 	/* TQM ring 5 page size and level. */
20772 	uint8_t	tqm_ring5_pg_size_tqm_ring5_lvl;
20773 	/* TQM ring 5 PBL indirect levels. */
20774 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_MASK	UINT32_C(0xf)
20775 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_SFT	0
20776 	/* PBL pointer is physical start address. */
20777 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_0	UINT32_C(0x0)
20778 	/* PBL pointer points to PTE table. */
20779 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_1	UINT32_C(0x1)
20780 	/*
20781 	 * PBL pointer points to PDE table with each entry pointing to PTE
20782 	 * tables.
20783 	 */
20784 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2	UINT32_C(0x2)
20785 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2
20786 	/* TQM ring 5 page size. */
20787 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_MASK  UINT32_C(0xf0)
20788 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_SFT   4
20789 	/* 4KB. */
20790 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20791 	/* 8KB. */
20792 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20793 	/* 64KB. */
20794 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20795 	/* 2MB. */
20796 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20797 	/* 8MB. */
20798 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20799 	/* 1GB. */
20800 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20801 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G
20802 	/* TQM ring 6 page size and level. */
20803 	uint8_t	tqm_ring6_pg_size_tqm_ring6_lvl;
20804 	/* TQM ring 6 PBL indirect levels. */
20805 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_MASK	UINT32_C(0xf)
20806 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_SFT	0
20807 	/* PBL pointer is physical start address. */
20808 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_0	UINT32_C(0x0)
20809 	/* PBL pointer points to PTE table. */
20810 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_1	UINT32_C(0x1)
20811 	/*
20812 	 * PBL pointer points to PDE table with each entry pointing to PTE
20813 	 * tables.
20814 	 */
20815 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2	UINT32_C(0x2)
20816 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2
20817 	/* TQM ring 6 page size. */
20818 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_MASK  UINT32_C(0xf0)
20819 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_SFT   4
20820 	/* 4KB. */
20821 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20822 	/* 8KB. */
20823 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20824 	/* 64KB. */
20825 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20826 	/* 2MB. */
20827 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20828 	/* 8MB. */
20829 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20830 	/* 1GB. */
20831 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20832 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G
20833 	/* TQM ring 7 page size and level. */
20834 	uint8_t	tqm_ring7_pg_size_tqm_ring7_lvl;
20835 	/* TQM ring 7 PBL indirect levels. */
20836 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_MASK	UINT32_C(0xf)
20837 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_SFT	0
20838 	/* PBL pointer is physical start address. */
20839 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_0	UINT32_C(0x0)
20840 	/* PBL pointer points to PTE table. */
20841 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_1	UINT32_C(0x1)
20842 	/*
20843 	 * PBL pointer points to PDE table with each entry pointing to PTE
20844 	 * tables.
20845 	 */
20846 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2	UINT32_C(0x2)
20847 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2
20848 	/* TQM ring 7 page size. */
20849 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_MASK  UINT32_C(0xf0)
20850 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_SFT   4
20851 	/* 4KB. */
20852 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20853 	/* 8KB. */
20854 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20855 	/* 64KB. */
20856 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20857 	/* 2MB. */
20858 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20859 	/* 8MB. */
20860 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20861 	/* 1GB. */
20862 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20863 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G
20864 	/* MR/AV page size and level. */
20865 	uint8_t	mrav_pg_size_mrav_lvl;
20866 	/* MR/AV PBL indirect levels. */
20867 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_MASK	UINT32_C(0xf)
20868 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_SFT	0
20869 	/* PBL pointer is physical start address. */
20870 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_0	UINT32_C(0x0)
20871 	/* PBL pointer points to PTE table. */
20872 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_1	UINT32_C(0x1)
20873 	/*
20874 	 * PBL pointer points to PDE table with each entry pointing to PTE
20875 	 * tables.
20876 	 */
20877 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2	UINT32_C(0x2)
20878 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2
20879 	/* MR/AV page size. */
20880 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_MASK  UINT32_C(0xf0)
20881 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_SFT   4
20882 	/* 4KB. */
20883 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20884 	/* 8KB. */
20885 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20886 	/* 64KB. */
20887 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20888 	/* 2MB. */
20889 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20890 	/* 8MB. */
20891 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20892 	/* 1GB. */
20893 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20894 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G
20895 	/* Timer page size and level. */
20896 	uint8_t	tim_pg_size_tim_lvl;
20897 	/* Timer PBL indirect levels. */
20898 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_MASK	UINT32_C(0xf)
20899 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_SFT	0
20900 	/* PBL pointer is physical start address. */
20901 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_0	UINT32_C(0x0)
20902 	/* PBL pointer points to PTE table. */
20903 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_1	UINT32_C(0x1)
20904 	/*
20905 	 * PBL pointer points to PDE table with each entry pointing to PTE
20906 	 * tables.
20907 	 */
20908 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2	UINT32_C(0x2)
20909 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2
20910 	/* Timer page size. */
20911 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_MASK  UINT32_C(0xf0)
20912 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_SFT   4
20913 	/* 4KB. */
20914 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
20915 	/* 8KB. */
20916 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
20917 	/* 64KB. */
20918 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
20919 	/* 2MB. */
20920 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
20921 	/* 8MB. */
20922 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
20923 	/* 1GB. */
20924 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
20925 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G
20926 	/* QP page directory. */
20927 	uint64_t	qpc_page_dir;
20928 	/* SRQ page directory. */
20929 	uint64_t	srq_page_dir;
20930 	/* CQ page directory. */
20931 	uint64_t	cq_page_dir;
20932 	/* VNIC page directory. */
20933 	uint64_t	vnic_page_dir;
20934 	/* Stat page directory. */
20935 	uint64_t	stat_page_dir;
20936 	/* TQM slowpath page directory. */
20937 	uint64_t	tqm_sp_page_dir;
20938 	/* TQM ring 0 page directory. */
20939 	uint64_t	tqm_ring0_page_dir;
20940 	/* TQM ring 1 page directory. */
20941 	uint64_t	tqm_ring1_page_dir;
20942 	/* TQM ring 2 page directory. */
20943 	uint64_t	tqm_ring2_page_dir;
20944 	/* TQM ring 3 page directory. */
20945 	uint64_t	tqm_ring3_page_dir;
20946 	/* TQM ring 4 page directory. */
20947 	uint64_t	tqm_ring4_page_dir;
20948 	/* TQM ring 5 page directory. */
20949 	uint64_t	tqm_ring5_page_dir;
20950 	/* TQM ring 6 page directory. */
20951 	uint64_t	tqm_ring6_page_dir;
20952 	/* TQM ring 7 page directory. */
20953 	uint64_t	tqm_ring7_page_dir;
20954 	/* MR/AV page directory. */
20955 	uint64_t	mrav_page_dir;
20956 	/* Timer page directory. */
20957 	uint64_t	tim_page_dir;
20958 	/* Number of entries to reserve for QP1 */
20959 	uint16_t	qp_num_qp1_entries;
20960 	/* Number of entries to reserve for L2 */
20961 	uint16_t	qp_num_l2_entries;
20962 	/* Number of QPs. */
20963 	uint32_t	qp_num_entries;
20964 	/* Number of SRQs. */
20965 	uint32_t	srq_num_entries;
20966 	/* Number of entries to reserve for L2 */
20967 	uint16_t	srq_num_l2_entries;
20968 	/* Number of entries to reserve for L2 */
20969 	uint16_t	cq_num_l2_entries;
20970 	/* Number of CQs. */
20971 	uint32_t	cq_num_entries;
20972 	/* Number of entries to reserve for VNIC entries */
20973 	uint16_t	vnic_num_vnic_entries;
20974 	/* Number of entries to reserve for Ring table entries */
20975 	uint16_t	vnic_num_ring_table_entries;
20976 	/* Number of Stats. */
20977 	uint32_t	stat_num_entries;
20978 	/* Number of TQM slowpath entries. */
20979 	uint32_t	tqm_sp_num_entries;
20980 	/* Number of TQM ring 0 entries. */
20981 	uint32_t	tqm_ring0_num_entries;
20982 	/* Number of TQM ring 1 entries. */
20983 	uint32_t	tqm_ring1_num_entries;
20984 	/* Number of TQM ring 2 entries. */
20985 	uint32_t	tqm_ring2_num_entries;
20986 	/* Number of TQM ring 3 entries. */
20987 	uint32_t	tqm_ring3_num_entries;
20988 	/* Number of TQM ring 4 entries. */
20989 	uint32_t	tqm_ring4_num_entries;
20990 	/* Number of TQM ring 5 entries. */
20991 	uint32_t	tqm_ring5_num_entries;
20992 	/* Number of TQM ring 6 entries. */
20993 	uint32_t	tqm_ring6_num_entries;
20994 	/* Number of TQM ring 7 entries. */
20995 	uint32_t	tqm_ring7_num_entries;
20996 	/*
20997 	 * If the MR/AV split reservation flag is not set, then this field
20998 	 * represents the total number of MR plus AV entries. For versions
20999 	 * of firmware that support the split reservation, when it is not
21000 	 * specified half of the entries will be reserved for MRs and the
21001 	 * other half for AVs.
21002 	 *
21003 	 * If the MR/AV split reservation flag is set, then this
21004 	 * field is logically divided into two 16b fields. Bits `[31:16]`
21005 	 * represents the `mr_num_entries` and bits `[15:0]` represents
21006 	 * `av_num_entries`. The granularity of these values is defined by
21007 	 * the `mrav_num_entries_unit` field returned by the
21008 	 * `backing_store_qcaps` command.
21009 	 */
21010 	uint32_t	mrav_num_entries;
21011 	/* Number of Timer entries. */
21012 	uint32_t	tim_num_entries;
21013 	/* TQM ring page size and level. */
21014 	uint8_t	tqm_ring8_pg_size_tqm_ring_lvl;
21015 	/* TQM ring PBL indirect levels. */
21016 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_MASK	UINT32_C(0xf)
21017 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_SFT	0
21018 	/* PBL pointer is physical start address. */
21019 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
21020 	/* PBL pointer points to PTE table. */
21021 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
21022 	/*
21023 	 * PBL pointer points to PDE table with each entry pointing to
21024 	 * PTE tables.
21025 	 */
21026 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
21027 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_2
21028 	/* TQM ring page size. */
21029 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
21030 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_SFT   4
21031 	/* 4KB. */
21032 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
21033 	/* 8KB. */
21034 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
21035 	/* 64KB. */
21036 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
21037 	/* 2MB. */
21038 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
21039 	/* 8MB. */
21040 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
21041 	/* 1GB. */
21042 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
21043 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_1G
21044 	uint8_t	ring8_unused[3];
21045 	/* Number of TQM ring entries. */
21046 	uint32_t	tqm_ring8_num_entries;
21047 	/* TQM ring page directory. */
21048 	uint64_t	tqm_ring8_page_dir;
21049 	/* TQM ring page size and level. */
21050 	uint8_t	tqm_ring9_pg_size_tqm_ring_lvl;
21051 	/* TQM ring PBL indirect levels. */
21052 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_MASK	UINT32_C(0xf)
21053 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_SFT	0
21054 	/* PBL pointer is physical start address. */
21055 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
21056 	/* PBL pointer points to PTE table. */
21057 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
21058 	/*
21059 	 * PBL pointer points to PDE table with each entry pointing to
21060 	 * PTE tables.
21061 	 */
21062 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
21063 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_2
21064 	/* TQM ring page size. */
21065 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
21066 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_SFT   4
21067 	/* 4KB. */
21068 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
21069 	/* 8KB. */
21070 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
21071 	/* 64KB. */
21072 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
21073 	/* 2MB. */
21074 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
21075 	/* 8MB. */
21076 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
21077 	/* 1GB. */
21078 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
21079 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_1G
21080 	uint8_t	ring9_unused[3];
21081 	/* Number of TQM ring entries. */
21082 	uint32_t	tqm_ring9_num_entries;
21083 	/* TQM ring page directory. */
21084 	uint64_t	tqm_ring9_page_dir;
21085 	/* TQM ring page size and level. */
21086 	uint8_t	tqm_ring10_pg_size_tqm_ring_lvl;
21087 	/* TQM ring PBL indirect levels. */
21088 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_MASK	UINT32_C(0xf)
21089 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_SFT	0
21090 	/* PBL pointer is physical start address. */
21091 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_0	UINT32_C(0x0)
21092 	/* PBL pointer points to PTE table. */
21093 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_1	UINT32_C(0x1)
21094 	/*
21095 	 * PBL pointer points to PDE table with each entry pointing to
21096 	 * PTE tables.
21097 	 */
21098 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_2	UINT32_C(0x2)
21099 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_2
21100 	/* TQM ring page size. */
21101 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_MASK  UINT32_C(0xf0)
21102 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_SFT   4
21103 	/* 4KB. */
21104 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
21105 	/* 8KB. */
21106 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
21107 	/* 64KB. */
21108 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
21109 	/* 2MB. */
21110 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
21111 	/* 8MB. */
21112 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
21113 	/* 1GB. */
21114 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
21115 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_1G
21116 	uint8_t	ring10_unused[3];
21117 	/* Number of TQM ring entries. */
21118 	uint32_t	tqm_ring10_num_entries;
21119 	/* TQM ring page directory. */
21120 	uint64_t	tqm_ring10_page_dir;
21121 	/* Number of Tx KTLS context entries. */
21122 	uint32_t	tkc_num_entries;
21123 	/* Number of Rx KTLS context entries. */
21124 	uint32_t	rkc_num_entries;
21125 	/* Tx KTLS context page directory. */
21126 	uint64_t	tkc_page_dir;
21127 	/* Rx KTLS context page directory. */
21128 	uint64_t	rkc_page_dir;
21129 	/* Tx KTLS context page size and level. */
21130 	uint8_t	tkc_pg_size_tkc_lvl;
21131 	/* Tx KTLS context PBL indirect levels. */
21132 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_MASK	UINT32_C(0xf)
21133 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_SFT	0
21134 	/* PBL pointer is physical start address. */
21135 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_0	UINT32_C(0x0)
21136 	/* PBL pointer points to PTE table. */
21137 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_1	UINT32_C(0x1)
21138 	/*
21139 	 * PBL pointer points to PDE table with each entry pointing to
21140 	 * PTE tables.
21141 	 */
21142 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_2	UINT32_C(0x2)
21143 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_2
21144 	/* Tx KTLS context page size. */
21145 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_MASK  UINT32_C(0xf0)
21146 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_SFT   4
21147 	/* 4KB. */
21148 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
21149 	/* 8KB. */
21150 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
21151 	/* 64KB. */
21152 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
21153 	/* 2MB. */
21154 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
21155 	/* 8MB. */
21156 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
21157 	/* 1GB. */
21158 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
21159 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_1G
21160 	/* Rx KTLS context page size and level. */
21161 	uint8_t	rkc_pg_size_rkc_lvl;
21162 	/* Rx KTLS context PBL indirect levels. */
21163 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_MASK	UINT32_C(0xf)
21164 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_SFT	0
21165 	/* PBL pointer is physical start address. */
21166 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_0	UINT32_C(0x0)
21167 	/* PBL pointer points to PTE table. */
21168 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_1	UINT32_C(0x1)
21169 	/*
21170 	 * PBL pointer points to PDE table with each entry pointing to
21171 	 * PTE tables.
21172 	 */
21173 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_2	UINT32_C(0x2)
21174 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LAST	HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_2
21175 	/* Rx KTLS context page size. */
21176 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_MASK  UINT32_C(0xf0)
21177 	#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_SFT   4
21178 	/* 4KB. */
21179 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
21180 	/* 8KB. */
21181 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
21182 	/* 64KB. */
21183 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
21184 	/* 2MB. */
21185 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
21186 	/* 8MB. */
21187 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
21188 	/* 1GB. */
21189 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
21190 		#define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_1G
21191 	/*
21192 	 * Number of RoCE QP context entries required for this
21193 	 * function to support fast QP modify destroy feature.
21194 	 */
21195 	uint16_t	qp_num_fast_qpmd_entries;
21196 	uint8_t	unused_1[3];
21197 	/*
21198 	 * This field is used in Output records to indicate that the output
21199 	 * is completely written to RAM. This field should be read as 1
21200 	 * to indicate that the output has been completely written.
21201 	 * When writing a command completion or response to an internal
21202 	 * processor, the order of writes has to be such that this field
21203 	 * is written last.
21204 	 */
21205 	uint8_t	valid;
21206 } hwrm_func_backing_store_qcfg_output_t, *phwrm_func_backing_store_qcfg_output_t;
21207 
21208 /****************************
21209  * hwrm_error_recovery_qcfg *
21210  ****************************/
21211 
21212 
21213 /* hwrm_error_recovery_qcfg_input (size:192b/24B) */
21214 
21215 typedef struct hwrm_error_recovery_qcfg_input {
21216 	/* The HWRM command request type. */
21217 	uint16_t	req_type;
21218 	/*
21219 	 * The completion ring to send the completion event on. This should
21220 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
21221 	 */
21222 	uint16_t	cmpl_ring;
21223 	/*
21224 	 * The sequence ID is used by the driver for tracking multiple
21225 	 * commands. This ID is treated as opaque data by the firmware and
21226 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
21227 	 */
21228 	uint16_t	seq_id;
21229 	/*
21230 	 * The target ID of the command:
21231 	 * * 0x0-0xFFF8 - The function ID
21232 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21233 	 * * 0xFFFD - Reserved for user-space HWRM interface
21234 	 * * 0xFFFF - HWRM
21235 	 */
21236 	uint16_t	target_id;
21237 	/*
21238 	 * A physical address pointer pointing to a host buffer that the
21239 	 * command's response data will be written. This can be either a host
21240 	 * physical address (HPA) or a guest physical address (GPA) and must
21241 	 * point to a physically contiguous block of memory.
21242 	 */
21243 	uint64_t	resp_addr;
21244 	uint8_t	unused_0[8];
21245 } hwrm_error_recovery_qcfg_input_t, *phwrm_error_recovery_qcfg_input_t;
21246 
21247 /* hwrm_error_recovery_qcfg_output (size:1664b/208B) */
21248 
21249 typedef struct hwrm_error_recovery_qcfg_output {
21250 	/* The specific error status for the command. */
21251 	uint16_t	error_code;
21252 	/* The HWRM command request type. */
21253 	uint16_t	req_type;
21254 	/* The sequence ID from the original command. */
21255 	uint16_t	seq_id;
21256 	/* The length of the response data in number of bytes. */
21257 	uint16_t	resp_len;
21258 	uint32_t	flags;
21259 	/*
21260 	 * When this flag is set to 1, error recovery will be initiated
21261 	 * through master function driver.
21262 	 */
21263 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_HOST	UINT32_C(0x1)
21264 	/*
21265 	 * When this flag is set to 1, error recovery will be performed
21266 	 * through Co processor.
21267 	 */
21268 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU	UINT32_C(0x2)
21269 	/*
21270 	 * Driver Polling frequency. This value is in units of 100msec.
21271 	 * Typical value would be 10 to indicate 1sec.
21272 	 * Drivers can poll FW health status, Heartbeat, reset_counter with
21273 	 * this frequency.
21274 	 */
21275 	uint32_t	driver_polling_freq;
21276 	/*
21277 	 * This value is in units of 100msec.
21278 	 * Typical value would be 30 to indicate 3sec.
21279 	 * Master function wait period from detecting a fatal error to
21280 	 * initiating reset. In this time period Master PF expects every
21281 	 * active driver will detect fatal error.
21282 	 */
21283 	uint32_t	master_func_wait_period;
21284 	/*
21285 	 * This value is in units of 100msec.
21286 	 * Typical value would be 50 to indicate 5sec.
21287 	 * Normal function wait period from fatal error detection to
21288 	 * polling FW health status. In this time period, drivers should not
21289 	 * do any PCIe MMIO transaction and should not send any HWRM commands.
21290 	 */
21291 	uint32_t	normal_func_wait_period;
21292 	/*
21293 	 * This value is in units of 100msec.
21294 	 * Typical value would be 20 to indicate 2sec.
21295 	 * This field indicates that, master function wait period after chip
21296 	 * reset. After this time, master function should reinitialize with
21297 	 * FW.
21298 	 */
21299 	uint32_t	master_func_wait_period_after_reset;
21300 	/*
21301 	 * This value is in units of 100msec.
21302 	 * Typical value would be 60 to indicate 6sec.
21303 	 * This field is applicable to both master and normal functions.
21304 	 * Even after chip reset, if FW status not changed to ready,
21305 	 * then all the functions can poll for this much time and bailout.
21306 	 */
21307 	uint32_t	max_bailout_time_after_reset;
21308 	/*
21309 	 * FW health status register.
21310 	 * Lower 2 bits indicates address space location and upper 30 bits
21311 	 * indicates upper 30bits of the register address.
21312 	 * A value of 0xFFFF-FFFF indicates this register does not exist.
21313 	 */
21314 	uint32_t	fw_health_status_reg;
21315 	/* Lower 2 bits indicates address space location. */
21316 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
21317 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_SFT	0
21318 	/*
21319 	 * If value is 0, this register is located in PCIe config space.
21320 	 * Drivers have to map appropriate window to access this
21321 	 * register.
21322 	 */
21323 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
21324 	/*
21325 	 * If value is 1, this register is located in GRC address space.
21326 	 * Drivers have to map appropriate window to access this
21327 	 * register.
21328 	 */
21329 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
21330 	/*
21331 	 * If value is 2, this register is located in first BAR address
21332 	 * space. Drivers have to map appropriate window to access this
21333 	 * register.
21334 	 */
21335 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
21336 	/*
21337 	 * If value is 3, this register is located in second BAR address
21338 	 * space. Drivers have to map appropriate window to access this
21339 	 * Drivers have to map appropriate window to access this
21340 	 * register.
21341 	 */
21342 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
21343 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_LAST	HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1
21344 	/* Upper 30bits of the register address. */
21345 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_MASK	UINT32_C(0xfffffffc)
21346 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SFT	2
21347 	/*
21348 	 * FW HeartBeat register.
21349 	 * Lower 2 bits indicates address space location and upper 30 bits
21350 	 * indicates actual address.
21351 	 * A value of 0xFFFF-FFFF indicates this register does not exist.
21352 	 */
21353 	uint32_t	fw_heartbeat_reg;
21354 	/* Lower 2 bits indicates address space location. */
21355 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
21356 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_SFT	0
21357 	/*
21358 	 * If value is 0, this register is located in PCIe config space.
21359 	 * Drivers have to map appropriate window to access this
21360 	 * register.
21361 	 */
21362 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
21363 	/*
21364 	 * If value is 1, this register is located in GRC address space.
21365 	 * Drivers have to map appropriate window to access this
21366 	 * register.
21367 	 */
21368 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
21369 	/*
21370 	 * If value is 2, this register is located in first BAR address
21371 	 * space. Drivers have to map appropriate window to access this
21372 	 * register.
21373 	 */
21374 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
21375 	/*
21376 	 * If value is 3, this register is located in second BAR address
21377 	 * space. Drivers have to map appropriate window to access this
21378 	 * register.
21379 	 */
21380 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
21381 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_LAST	HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1
21382 	/* Upper 30bits of the register address. */
21383 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_MASK	UINT32_C(0xfffffffc)
21384 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SFT	2
21385 	/*
21386 	 * FW reset counter.
21387 	 * Lower 2 bits indicates address space location and upper 30 bits
21388 	 * indicates actual address.
21389 	 * A value of 0xFFFF-FFFF indicates this register does not exist.
21390 	 */
21391 	uint32_t	fw_reset_cnt_reg;
21392 	/* Lower 2 bits indicates address space location. */
21393 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
21394 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_SFT	0
21395 	/*
21396 	 * If value is 0, this register is located in PCIe config space.
21397 	 * Drivers have to map appropriate window to access this
21398 	 * register.
21399 	 */
21400 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
21401 	/*
21402 	 * If value is 1, this register is located in GRC address space.
21403 	 * Drivers have to map appropriate window to access this
21404 	 * register.
21405 	 */
21406 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
21407 	/*
21408 	 * If value is 2, this register is located in first BAR address
21409 	 * space. Drivers have to map appropriate window to access this
21410 	 * register.
21411 	 */
21412 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
21413 	/*
21414 	 * If value is 3, this register is located in second BAR address
21415 	 * space. Drivers have to map appropriate window to access this
21416 	 * register.
21417 	 */
21418 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
21419 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_LAST	HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1
21420 	/* Upper 30bits of the register address. */
21421 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_MASK	UINT32_C(0xfffffffc)
21422 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SFT	2
21423 	/*
21424 	 * Reset Inprogress Register address for PFs.
21425 	 * Lower 2 bits indicates address space location and upper 30 bits
21426 	 * indicates actual address.
21427 	 * A value of 0xFFFF-FFFF indicates this register does not exist.
21428 	 */
21429 	uint32_t	reset_inprogress_reg;
21430 	/* Lower 2 bits indicates address space location. */
21431 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
21432 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_SFT	0
21433 	/*
21434 	 * If value is 0, this register is located in PCIe config space.
21435 	 * Drivers have to map appropriate window to access this
21436 	 * register.
21437 	 */
21438 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
21439 	/*
21440 	 * If value is 1, this register is located in GRC address space.
21441 	 * Drivers have to map appropriate window to access this
21442 	 * register.
21443 	 */
21444 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
21445 	/*
21446 	 * If value is 2, this register is located in first BAR address
21447 	 * space. Drivers have to map appropriate window to access this
21448 	 * register.
21449 	 */
21450 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
21451 	/*
21452 	 * If value is 3, this register is located in second BAR address
21453 	 * space. Drivers have to map appropriate window to access this
21454 	 * register.
21455 	 */
21456 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
21457 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_LAST	HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1
21458 	/* Upper 30bits of the register address. */
21459 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_MASK	UINT32_C(0xfffffffc)
21460 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SFT	2
21461 	/* This field indicates the mask value for reset_inprogress_reg. */
21462 	uint32_t	reset_inprogress_reg_mask;
21463 	uint8_t	unused_0[3];
21464 	/*
21465 	 * Array of registers and value count to reset the Chip
21466 	 * Each array count has reset_reg, reset_reg_val, delay_after_reset
21467 	 * in TLV format. Depending upon Chip type, number of reset registers
21468 	 * will vary. Drivers have to write reset_reg_val in the reset_reg
21469 	 * location in the same sequence in order to recover from a fatal
21470 	 * error.
21471 	 */
21472 	uint8_t	reg_array_cnt;
21473 	/*
21474 	 * Reset register.
21475 	 * Lower 2 bits indicates address space location and upper 30 bits
21476 	 * indicates actual address.
21477 	 * A value of 0xFFFF-FFFF indicates this register does not exist.
21478 	 */
21479 	uint32_t	reset_reg[16];
21480 	/* Lower 2 bits indicates address space location. */
21481 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
21482 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_SFT	0
21483 	/*
21484 	 * If value is 0, this register is located in PCIe config space.
21485 	 * Drivers have to map appropriate window to access this
21486 	 * register.
21487 	 */
21488 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
21489 	/*
21490 	 * If value is 1, this register is located in GRC address space.
21491 	 * Drivers have to map appropriate window to access this
21492 	 * register.
21493 	 */
21494 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
21495 	/*
21496 	 * If value is 2, this register is located in first BAR address
21497 	 * space. Drivers have to map appropriate window to access this
21498 	 * register.
21499 	 */
21500 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
21501 	/*
21502 	 * If value is 3, this register is located in second BAR address
21503 	 * space. Drivers have to map appropriate window to access this
21504 	 * register.
21505 	 */
21506 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
21507 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_LAST	HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1
21508 	/* Upper 30bits of the register address. */
21509 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_MASK	UINT32_C(0xfffffffc)
21510 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SFT	2
21511 	/* Value to be written in reset_reg to reset the controller. */
21512 	uint32_t	reset_reg_val[16];
21513 	/*
21514 	 * This value is in units of 1msec.
21515 	 * Typical value would be 10 to indicate 10msec.
21516 	 * Some of the operations like Core reset require delay before
21517 	 * accessing PCIE MMIO register space.
21518 	 * If this value is non-zero, drivers have to wait for
21519 	 * this much time after writing reset_reg_val in reset_reg.
21520 	 */
21521 	uint8_t	delay_after_reset[16];
21522 	/*
21523 	 * Error recovery counter.
21524 	 * Lower 2 bits indicates address space location and upper 30 bits
21525 	 * indicates actual address.
21526 	 * A value of 0xFFFF-FFFF indicates this register does not exist.
21527 	 */
21528 	uint32_t	err_recovery_cnt_reg;
21529 	/* Lower 2 bits indicates address space location. */
21530 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
21531 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_SFT	0
21532 	/*
21533 	 * If value is 0, this register is located in PCIe config space.
21534 	 * Drivers have to map appropriate window to access this
21535 	 * register.
21536 	 */
21537 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
21538 	/*
21539 	 * If value is 1, this register is located in GRC address space.
21540 	 * Drivers have to map appropriate window to access this
21541 	 * register.
21542 	 */
21543 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
21544 	/*
21545 	 * If value is 2, this register is located in first BAR address
21546 	 * space. Drivers have to map appropriate window to access this
21547 	 * register.
21548 	 */
21549 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
21550 	/*
21551 	 * If value is 3, this register is located in second BAR address
21552 	 * space. Drivers have to map appropriate window to access this
21553 	 * register.
21554 	 */
21555 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
21556 		#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_LAST	HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR1
21557 	/* Upper 30bits of the register address. */
21558 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_MASK	UINT32_C(0xfffffffc)
21559 	#define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SFT	2
21560 	uint8_t	unused_1[3];
21561 	/*
21562 	 * This field is used in Output records to indicate that the output
21563 	 * is completely written to RAM. This field should be read as '1'
21564 	 * to indicate that the output has been completely written.
21565 	 * When writing a command completion or response to an internal
21566 	 * processor, the order of writes has to be such that this field
21567 	 * is written last.
21568 	 */
21569 	uint8_t	valid;
21570 } hwrm_error_recovery_qcfg_output_t, *phwrm_error_recovery_qcfg_output_t;
21571 
21572 /***************************
21573  * hwrm_func_echo_response *
21574  ***************************/
21575 
21576 
21577 /* hwrm_func_echo_response_input (size:192b/24B) */
21578 
21579 typedef struct hwrm_func_echo_response_input {
21580 	/* The HWRM command request type. */
21581 	uint16_t	req_type;
21582 	/*
21583 	 * The completion ring to send the completion event on. This should
21584 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
21585 	 */
21586 	uint16_t	cmpl_ring;
21587 	/*
21588 	 * The sequence ID is used by the driver for tracking multiple
21589 	 * commands. This ID is treated as opaque data by the firmware and
21590 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
21591 	 */
21592 	uint16_t	seq_id;
21593 	/*
21594 	 * The target ID of the command:
21595 	 * * 0x0-0xFFF8 - The function ID
21596 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21597 	 * * 0xFFFD - Reserved for user-space HWRM interface
21598 	 * * 0xFFFF - HWRM
21599 	 */
21600 	uint16_t	target_id;
21601 	/*
21602 	 * A physical address pointer pointing to a host buffer that the
21603 	 * command's response data will be written. This can be either a host
21604 	 * physical address (HPA) or a guest physical address (GPA) and must
21605 	 * point to a physically contiguous block of memory.
21606 	 */
21607 	uint64_t	resp_addr;
21608 	uint32_t	event_data1;
21609 	uint32_t	event_data2;
21610 } hwrm_func_echo_response_input_t, *phwrm_func_echo_response_input_t;
21611 
21612 /* hwrm_func_echo_response_output (size:128b/16B) */
21613 
21614 typedef struct hwrm_func_echo_response_output {
21615 	/* The specific error status for the command. */
21616 	uint16_t	error_code;
21617 	/* The HWRM command request type. */
21618 	uint16_t	req_type;
21619 	/* The sequence ID from the original command. */
21620 	uint16_t	seq_id;
21621 	/* The length of the response data in number of bytes. */
21622 	uint16_t	resp_len;
21623 	uint8_t	unused_0[7];
21624 	/*
21625 	 * This field is used in Output records to indicate that the output
21626 	 * is completely written to RAM. This field should be read as '1'
21627 	 * to indicate that the output has been completely written. When
21628 	 * writing a command completion or response to an internal processor,
21629 	 * the order of writes has to be such that this field is written last.
21630 	 */
21631 	uint8_t	valid;
21632 } hwrm_func_echo_response_output_t, *phwrm_func_echo_response_output_t;
21633 
21634 /**************************
21635  * hwrm_func_ptp_pin_qcfg *
21636  **************************/
21637 
21638 
21639 /* hwrm_func_ptp_pin_qcfg_input (size:192b/24B) */
21640 
21641 typedef struct hwrm_func_ptp_pin_qcfg_input {
21642 	/* The HWRM command request type. */
21643 	uint16_t	req_type;
21644 	/*
21645 	 * The completion ring to send the completion event on. This should
21646 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
21647 	 */
21648 	uint16_t	cmpl_ring;
21649 	/*
21650 	 * The sequence ID is used by the driver for tracking multiple
21651 	 * commands. This ID is treated as opaque data by the firmware and
21652 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
21653 	 */
21654 	uint16_t	seq_id;
21655 	/*
21656 	 * The target ID of the command:
21657 	 * * 0x0-0xFFF8 - The function ID
21658 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21659 	 * * 0xFFFD - Reserved for user-space HWRM interface
21660 	 * * 0xFFFF - HWRM
21661 	 */
21662 	uint16_t	target_id;
21663 	/*
21664 	 * A physical address pointer pointing to a host buffer that the
21665 	 * command's response data will be written. This can be either a host
21666 	 * physical address (HPA) or a guest physical address (GPA) and must
21667 	 * point to a physically contiguous block of memory.
21668 	 */
21669 	uint64_t	resp_addr;
21670 	uint8_t	unused_0[8];
21671 } hwrm_func_ptp_pin_qcfg_input_t, *phwrm_func_ptp_pin_qcfg_input_t;
21672 
21673 /* hwrm_func_ptp_pin_qcfg_output (size:128b/16B) */
21674 
21675 typedef struct hwrm_func_ptp_pin_qcfg_output {
21676 	/* The specific error status for the command. */
21677 	uint16_t	error_code;
21678 	/* The HWRM command request type. */
21679 	uint16_t	req_type;
21680 	/* The sequence ID from the original command. */
21681 	uint16_t	seq_id;
21682 	/* The length of the response data in number of bytes. */
21683 	uint16_t	resp_len;
21684 	/*
21685 	 * The number of TSIO pins that are configured on this board
21686 	 * Up to 4 pins can be returned in the response.
21687 	 */
21688 	uint8_t	num_pins;
21689 	/* Pin state */
21690 	uint8_t	state;
21691 	/*
21692 	 * When this bit is '1', TSIO pin 0 is enabled.
21693 	 * When this bit is '0', TSIO pin 0 is disabled.
21694 	 */
21695 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN0_ENABLED	UINT32_C(0x1)
21696 	/*
21697 	 * When this bit is '1', TSIO pin 1 is enabled.
21698 	 * When this bit is '0', TSIO pin 1 is disabled.
21699 	 */
21700 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN1_ENABLED	UINT32_C(0x2)
21701 	/*
21702 	 * When this bit is '1', TSIO pin 2 is enabled.
21703 	 * When this bit is '0', TSIO pin 2 is disabled.
21704 	 */
21705 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN2_ENABLED	UINT32_C(0x4)
21706 	/*
21707 	 * When this bit is '1', TSIO pin 3 is enabled.
21708 	 * When this bit is '0', TSIO pin 3 is disabled.
21709 	 */
21710 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN3_ENABLED	UINT32_C(0x8)
21711 	/* Type of function for Pin #0. */
21712 	uint8_t	pin0_usage;
21713 	/* No function is configured. */
21714 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_NONE	UINT32_C(0x0)
21715 	/* PPS IN is configured. */
21716 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_PPS_IN   UINT32_C(0x1)
21717 	/* PPS OUT is configured. */
21718 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_PPS_OUT  UINT32_C(0x2)
21719 	/* SYNC IN is configured. */
21720 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_SYNC_IN  UINT32_C(0x3)
21721 	/* SYNC OUT is configured. */
21722 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_SYNC_OUT UINT32_C(0x4)
21723 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_LAST	HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_SYNC_OUT
21724 	/* Type of function for Pin #1. */
21725 	uint8_t	pin1_usage;
21726 	/* No function is configured. */
21727 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_NONE	UINT32_C(0x0)
21728 	/* PPS IN is configured. */
21729 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_PPS_IN   UINT32_C(0x1)
21730 	/* PPS OUT is configured. */
21731 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_PPS_OUT  UINT32_C(0x2)
21732 	/* SYNC IN is configured. */
21733 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_SYNC_IN  UINT32_C(0x3)
21734 	/* SYNC OUT is configured. */
21735 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_SYNC_OUT UINT32_C(0x4)
21736 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_LAST	HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_SYNC_OUT
21737 	/* Type of function for Pin #2. */
21738 	uint8_t	pin2_usage;
21739 	/* No function is configured. */
21740 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_NONE			UINT32_C(0x0)
21741 	/* PPS IN is configured. */
21742 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_PPS_IN			UINT32_C(0x1)
21743 	/* PPS OUT is configured. */
21744 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_PPS_OUT		UINT32_C(0x2)
21745 	/* SYNC IN is configured. */
21746 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNC_IN		UINT32_C(0x3)
21747 	/* SYNC OUT is configured. */
21748 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNC_OUT		UINT32_C(0x4)
21749 	/* SYNCE primary clock OUT is configured. */
21750 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNCE_PRIMARY_CLOCK_OUT   UINT32_C(0x5)
21751 	/* SYNCE secondary clock OUT is configured. */
21752 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNCE_SECONDARY_CLOCK_OUT UINT32_C(0x6)
21753 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_LAST			HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNCE_SECONDARY_CLOCK_OUT
21754 	/* Type of function for Pin #3. */
21755 	uint8_t	pin3_usage;
21756 	/* No function is configured. */
21757 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_NONE			UINT32_C(0x0)
21758 	/* PPS IN is configured. */
21759 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_PPS_IN			UINT32_C(0x1)
21760 	/* PPS OUT is configured. */
21761 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_PPS_OUT		UINT32_C(0x2)
21762 	/* SYNC IN is configured. */
21763 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNC_IN		UINT32_C(0x3)
21764 	/* SYNC OUT is configured. */
21765 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNC_OUT		UINT32_C(0x4)
21766 	/* SYNCE primary clock OUT is configured. */
21767 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNCE_PRIMARY_CLOCK_OUT   UINT32_C(0x5)
21768 	/* SYNCE secondary OUT is configured. */
21769 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNCE_SECONDARY_CLOCK_OUT UINT32_C(0x6)
21770 	#define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_LAST			HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNCE_SECONDARY_CLOCK_OUT
21771 	uint8_t	unused_0;
21772 	/*
21773 	 * This field is used in Output records to indicate that the output
21774 	 * is completely written to RAM. This field should be read as '1'
21775 	 * to indicate that the output has been completely written. When
21776 	 * writing a command completion or response to an internal processor,
21777 	 * the order of writes has to be such that this field is written last.
21778 	 */
21779 	uint8_t	valid;
21780 } hwrm_func_ptp_pin_qcfg_output_t, *phwrm_func_ptp_pin_qcfg_output_t;
21781 
21782 /*************************
21783  * hwrm_func_ptp_pin_cfg *
21784  *************************/
21785 
21786 
21787 /* hwrm_func_ptp_pin_cfg_input (size:256b/32B) */
21788 
21789 typedef struct hwrm_func_ptp_pin_cfg_input {
21790 	/* The HWRM command request type. */
21791 	uint16_t	req_type;
21792 	/*
21793 	 * The completion ring to send the completion event on. This should
21794 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
21795 	 */
21796 	uint16_t	cmpl_ring;
21797 	/*
21798 	 * The sequence ID is used by the driver for tracking multiple
21799 	 * commands. This ID is treated as opaque data by the firmware and
21800 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
21801 	 */
21802 	uint16_t	seq_id;
21803 	/*
21804 	 * The target ID of the command:
21805 	 * * 0x0-0xFFF8 - The function ID
21806 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21807 	 * * 0xFFFD - Reserved for user-space HWRM interface
21808 	 * * 0xFFFF - HWRM
21809 	 */
21810 	uint16_t	target_id;
21811 	/*
21812 	 * A physical address pointer pointing to a host buffer that the
21813 	 * command's response data will be written. This can be either a host
21814 	 * physical address (HPA) or a guest physical address (GPA) and must
21815 	 * point to a physically contiguous block of memory.
21816 	 */
21817 	uint64_t	resp_addr;
21818 	uint32_t	enables;
21819 	/*
21820 	 * This bit must be '1' for the pin0_state field to be
21821 	 * configured.
21822 	 */
21823 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN0_STATE	UINT32_C(0x1)
21824 	/*
21825 	 * This bit must be '1' for the pin0_usage field to be
21826 	 * configured.
21827 	 */
21828 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN0_USAGE	UINT32_C(0x2)
21829 	/*
21830 	 * This bit must be '1' for the pin1_state field to be
21831 	 * configured.
21832 	 */
21833 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN1_STATE	UINT32_C(0x4)
21834 	/*
21835 	 * This bit must be '1' for the pin1_usage field to be
21836 	 * configured.
21837 	 */
21838 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN1_USAGE	UINT32_C(0x8)
21839 	/*
21840 	 * This bit must be '1' for the pin2_state field to be
21841 	 * configured.
21842 	 */
21843 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN2_STATE	UINT32_C(0x10)
21844 	/*
21845 	 * This bit must be '1' for the pin2_usage field to be
21846 	 * configured.
21847 	 */
21848 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN2_USAGE	UINT32_C(0x20)
21849 	/*
21850 	 * This bit must be '1' for the pin3_state field to be
21851 	 * configured.
21852 	 */
21853 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN3_STATE	UINT32_C(0x40)
21854 	/*
21855 	 * This bit must be '1' for the pin3_usage field to be
21856 	 * configured.
21857 	 */
21858 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN3_USAGE	UINT32_C(0x80)
21859 	/* Enable or disable functionality of Pin #0. */
21860 	uint8_t	pin0_state;
21861 	/* Disabled */
21862 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_DISABLED UINT32_C(0x0)
21863 	/* Enabled */
21864 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_ENABLED  UINT32_C(0x1)
21865 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_LAST	HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_ENABLED
21866 	/* Configure function for TSIO pin#0. */
21867 	uint8_t	pin0_usage;
21868 	/* No function is configured. */
21869 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_NONE	UINT32_C(0x0)
21870 	/* PPS IN is configured. */
21871 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_PPS_IN   UINT32_C(0x1)
21872 	/* PPS OUT is configured. */
21873 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_PPS_OUT  UINT32_C(0x2)
21874 	/* SYNC IN is configured. */
21875 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_SYNC_IN  UINT32_C(0x3)
21876 	/* SYNC OUT is configured. */
21877 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_SYNC_OUT UINT32_C(0x4)
21878 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_LAST	HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_SYNC_OUT
21879 	/* Enable or disable functionality of Pin #1. */
21880 	uint8_t	pin1_state;
21881 	/* Disabled */
21882 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_DISABLED UINT32_C(0x0)
21883 	/* Enabled */
21884 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_ENABLED  UINT32_C(0x1)
21885 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_LAST	HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_ENABLED
21886 	/* Configure function for TSIO pin#1. */
21887 	uint8_t	pin1_usage;
21888 	/* No function is configured. */
21889 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_NONE	UINT32_C(0x0)
21890 	/* PPS IN is configured. */
21891 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_PPS_IN   UINT32_C(0x1)
21892 	/* PPS OUT is configured. */
21893 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_PPS_OUT  UINT32_C(0x2)
21894 	/* SYNC IN is configured. */
21895 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_SYNC_IN  UINT32_C(0x3)
21896 	/* SYNC OUT is configured. */
21897 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_SYNC_OUT UINT32_C(0x4)
21898 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_LAST	HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_SYNC_OUT
21899 	/* Enable or disable functionality of Pin #2. */
21900 	uint8_t	pin2_state;
21901 	/* Disabled */
21902 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_DISABLED UINT32_C(0x0)
21903 	/* Enabled */
21904 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_ENABLED  UINT32_C(0x1)
21905 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_LAST	HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_ENABLED
21906 	/* Configure function for TSIO pin#2. */
21907 	uint8_t	pin2_usage;
21908 	/* No function is configured. */
21909 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_NONE			UINT32_C(0x0)
21910 	/* PPS IN is configured. */
21911 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_PPS_IN			UINT32_C(0x1)
21912 	/* PPS OUT is configured. */
21913 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_PPS_OUT		UINT32_C(0x2)
21914 	/* SYNC IN is configured. */
21915 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNC_IN		UINT32_C(0x3)
21916 	/* SYNC OUT is configured. */
21917 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNC_OUT		UINT32_C(0x4)
21918 	/* SYNCE primary clock OUT is configured. */
21919 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNCE_PRIMARY_CLOCK_OUT   UINT32_C(0x5)
21920 	/* SYNCE secondary clock OUT is configured. */
21921 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNCE_SECONDARY_CLOCK_OUT UINT32_C(0x6)
21922 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_LAST			HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNCE_SECONDARY_CLOCK_OUT
21923 	/* Enable or disable functionality of Pin #3. */
21924 	uint8_t	pin3_state;
21925 	/* Disabled */
21926 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_DISABLED UINT32_C(0x0)
21927 	/* Enabled */
21928 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_ENABLED  UINT32_C(0x1)
21929 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_LAST	HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_ENABLED
21930 	/* Configure function for TSIO pin#3. */
21931 	uint8_t	pin3_usage;
21932 	/* No function is configured. */
21933 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_NONE			UINT32_C(0x0)
21934 	/* PPS IN is configured. */
21935 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_PPS_IN			UINT32_C(0x1)
21936 	/* PPS OUT is configured. */
21937 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_PPS_OUT		UINT32_C(0x2)
21938 	/* SYNC IN is configured. */
21939 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNC_IN		UINT32_C(0x3)
21940 	/* SYNC OUT is configured. */
21941 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNC_OUT		UINT32_C(0x4)
21942 	/* SYNCE primary clock OUT is configured. */
21943 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNCE_PRIMARY_CLOCK_OUT   UINT32_C(0x5)
21944 	/* SYNCE secondary clock OUT is configured. */
21945 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNCE_SECONDARY_CLOCK_OUT UINT32_C(0x6)
21946 	#define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_LAST			HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNCE_SECONDARY_CLOCK_OUT
21947 	uint8_t	unused_0[4];
21948 } hwrm_func_ptp_pin_cfg_input_t, *phwrm_func_ptp_pin_cfg_input_t;
21949 
21950 /* hwrm_func_ptp_pin_cfg_output (size:128b/16B) */
21951 
21952 typedef struct hwrm_func_ptp_pin_cfg_output {
21953 	/* The specific error status for the command. */
21954 	uint16_t	error_code;
21955 	/* The HWRM command request type. */
21956 	uint16_t	req_type;
21957 	/* The sequence ID from the original command. */
21958 	uint16_t	seq_id;
21959 	/* The length of the response data in number of bytes. */
21960 	uint16_t	resp_len;
21961 	uint8_t	unused_0[7];
21962 	/*
21963 	 * This field is used in Output records to indicate that the output
21964 	 * is completely written to RAM. This field should be read as '1'
21965 	 * to indicate that the output has been completely written. When
21966 	 * writing a command completion or response to an internal processor,
21967 	 * the order of writes has to be such that this field is written last.
21968 	 */
21969 	uint8_t	valid;
21970 } hwrm_func_ptp_pin_cfg_output_t, *phwrm_func_ptp_pin_cfg_output_t;
21971 
21972 /*********************
21973  * hwrm_func_ptp_cfg *
21974  *********************/
21975 
21976 
21977 /* hwrm_func_ptp_cfg_input (size:384b/48B) */
21978 
21979 typedef struct hwrm_func_ptp_cfg_input {
21980 	/* The HWRM command request type. */
21981 	uint16_t	req_type;
21982 	/*
21983 	 * The completion ring to send the completion event on. This should
21984 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
21985 	 */
21986 	uint16_t	cmpl_ring;
21987 	/*
21988 	 * The sequence ID is used by the driver for tracking multiple
21989 	 * commands. This ID is treated as opaque data by the firmware and
21990 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
21991 	 */
21992 	uint16_t	seq_id;
21993 	/*
21994 	 * The target ID of the command:
21995 	 * * 0x0-0xFFF8 - The function ID
21996 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21997 	 * * 0xFFFD - Reserved for user-space HWRM interface
21998 	 * * 0xFFFF - HWRM
21999 	 */
22000 	uint16_t	target_id;
22001 	/*
22002 	 * A physical address pointer pointing to a host buffer that the
22003 	 * command's response data will be written. This can be either a host
22004 	 * physical address (HPA) or a guest physical address (GPA) and must
22005 	 * point to a physically contiguous block of memory.
22006 	 */
22007 	uint64_t	resp_addr;
22008 	uint16_t	enables;
22009 	/*
22010 	 * This bit must be '1' for the ptp_pps_event field to be
22011 	 * configured.
22012 	 */
22013 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_PPS_EVENT		UINT32_C(0x1)
22014 	/*
22015 	 * This bit must be '1' for the ptp_freq_adj_dll_source field to be
22016 	 * configured.
22017 	 */
22018 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_DLL_SOURCE	UINT32_C(0x2)
22019 	/*
22020 	 * This bit must be '1' for the ptp_freq_adj_dll_phase field to be
22021 	 * configured.
22022 	 */
22023 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_DLL_PHASE	UINT32_C(0x4)
22024 	/*
22025 	 * This bit must be '1' for the ptp_freq_adj_ext_period field to be
22026 	 * configured.
22027 	 */
22028 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_EXT_PERIOD	UINT32_C(0x8)
22029 	/*
22030 	 * This bit must be '1' for the ptp_freq_adj_ext_up field to be
22031 	 * configured.
22032 	 */
22033 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_EXT_UP	UINT32_C(0x10)
22034 	/*
22035 	 * This bit must be '1' for the ptp_freq_adj_ext_phase field to be
22036 	 * configured.
22037 	 */
22038 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_EXT_PHASE	UINT32_C(0x20)
22039 	/* This bit must be '1' for ptp_set_time field to be configured. */
22040 	#define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_SET_TIME		UINT32_C(0x40)
22041 	/* This field is used to enable interrupt for a specific PPS event. */
22042 	uint8_t	ptp_pps_event;
22043 	/*
22044 	 * When this bit is set to '1', interrupt is enabled for internal
22045 	 * PPS event. Latches timestamp on PPS_OUT TSIO Pin. If user does
22046 	 * not configure PPS_OUT on a TSIO pin, then firmware will allocate
22047 	 * PPS_OUT to an unallocated pin.
22048 	 */
22049 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_PPS_EVENT_INTERNAL	UINT32_C(0x1)
22050 	/*
22051 	 * When this bit is set to '1', interrupt is enabled for external
22052 	 * PPS event. Latches timestamp on PPS_IN TSIO pin.
22053 	 */
22054 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_PPS_EVENT_EXTERNAL	UINT32_C(0x2)
22055 	/*
22056 	 * This field is used to set the source signal used to discipline
22057 	 * PHC (PTP Hardware Clock)
22058 	 */
22059 	uint8_t	ptp_freq_adj_dll_source;
22060 	/* No source is selected. Use servo to discipline PHC */
22061 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_NONE	UINT32_C(0x0)
22062 	/* TSIO Pin #0 is selected as source signal. */
22063 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_0  UINT32_C(0x1)
22064 	/* TSIO Pin #1 is selected as source signal. */
22065 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_1  UINT32_C(0x2)
22066 	/* TSIO Pin #2 is selected as source signal. */
22067 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_2  UINT32_C(0x3)
22068 	/* TSIO Pin #3 is selected as source signal. */
22069 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_3  UINT32_C(0x4)
22070 	/* Port #0 is selected as source signal. */
22071 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_0  UINT32_C(0x5)
22072 	/* Port #1 is selected as source signal. */
22073 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_1  UINT32_C(0x6)
22074 	/* Port #2 is selected as source signal. */
22075 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_2  UINT32_C(0x7)
22076 	/* Port #3 is selected as source signal. */
22077 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_3  UINT32_C(0x8)
22078 	/* Invalid signal. */
22079 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_INVALID UINT32_C(0xff)
22080 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_LAST   HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_INVALID
22081 	/*
22082 	 * This field is used to provide phase adjustment for DLL
22083 	 * used to discipline PHC (PTP Hardware clock)
22084 	 */
22085 	uint8_t	ptp_freq_adj_dll_phase;
22086 	/* No Phase adjustment. */
22087 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_NONE UINT32_C(0x0)
22088 	/* 4Khz sync in frequency. */
22089 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_4K   UINT32_C(0x1)
22090 	/* 8Khz sync in frequency. */
22091 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_8K   UINT32_C(0x2)
22092 	/* 10Mhz sync in frequency. */
22093 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_10M  UINT32_C(0x3)
22094 	/* 25Mhz sync in frequency. */
22095 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_25M  UINT32_C(0x4)
22096 	#define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_LAST HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_25M
22097 	uint8_t	unused_0[3];
22098 	/*
22099 	 * Period in nanoseconds (ns) for external signal
22100 	 * input.
22101 	 */
22102 	uint32_t	ptp_freq_adj_ext_period;
22103 	/*
22104 	 * Up time in nanoseconds (ns) of the duty cycle
22105 	 * of the external signal. This value should be
22106 	 * less than ptp_freq_adj_ext_period.
22107 	 */
22108 	uint32_t	ptp_freq_adj_ext_up;
22109 	/*
22110 	 * Phase value is provided. This field provides the
22111 	 * least significant 32 bits of the phase input. The
22112 	 * most significant 16 bits come from
22113 	 * ptp_freq_adj_ext_phase_upper field. Setting this
22114 	 * field requires setting ptp_freq_adj_ext_period
22115 	 * field as well to identify the external signal
22116 	 * pin.
22117 	 */
22118 	uint32_t	ptp_freq_adj_ext_phase_lower;
22119 	/*
22120 	 * Phase value is provided. The lower 16 bits of this field is used
22121 	 * with the 32 bit value from ptp_freq_adj_ext_phase_lower
22122 	 * to provide a 48 bit value input for Phase.
22123 	 */
22124 	uint32_t	ptp_freq_adj_ext_phase_upper;
22125 	/*
22126 	 * Allows driver to set the full 64bit time in FW. The upper 16 bits
22127 	 * will be stored in FW and the lower 48bits will be programmed in
22128 	 * PHC. Firmware will send a broadcast async event to all functions
22129 	 * to indicate the programmed upper 16 bits.
22130 	 */
22131 	uint64_t	ptp_set_time;
22132 } hwrm_func_ptp_cfg_input_t, *phwrm_func_ptp_cfg_input_t;
22133 
22134 /* hwrm_func_ptp_cfg_output (size:128b/16B) */
22135 
22136 typedef struct hwrm_func_ptp_cfg_output {
22137 	/* The specific error status for the command. */
22138 	uint16_t	error_code;
22139 	/* The HWRM command request type. */
22140 	uint16_t	req_type;
22141 	/* The sequence ID from the original command. */
22142 	uint16_t	seq_id;
22143 	/* The length of the response data in number of bytes. */
22144 	uint16_t	resp_len;
22145 	uint8_t	unused_0[7];
22146 	/*
22147 	 * This field is used in Output records to indicate that the output
22148 	 * is completely written to RAM. This field should be read as '1'
22149 	 * to indicate that the output has been completely written. When
22150 	 * writing a command completion or response to an internal processor,
22151 	 * the order of writes has to be such that this field is written last.
22152 	 */
22153 	uint8_t	valid;
22154 } hwrm_func_ptp_cfg_output_t, *phwrm_func_ptp_cfg_output_t;
22155 
22156 /**************************
22157  * hwrm_func_ptp_ts_query *
22158  **************************/
22159 
22160 
22161 /* hwrm_func_ptp_ts_query_input (size:192b/24B) */
22162 
22163 typedef struct hwrm_func_ptp_ts_query_input {
22164 	/* The HWRM command request type. */
22165 	uint16_t	req_type;
22166 	/*
22167 	 * The completion ring to send the completion event on. This should
22168 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22169 	 */
22170 	uint16_t	cmpl_ring;
22171 	/*
22172 	 * The sequence ID is used by the driver for tracking multiple
22173 	 * commands. This ID is treated as opaque data by the firmware and
22174 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22175 	 */
22176 	uint16_t	seq_id;
22177 	/*
22178 	 * The target ID of the command:
22179 	 * * 0x0-0xFFF8 - The function ID
22180 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22181 	 * * 0xFFFD - Reserved for user-space HWRM interface
22182 	 * * 0xFFFF - HWRM
22183 	 */
22184 	uint16_t	target_id;
22185 	/*
22186 	 * A physical address pointer pointing to a host buffer that the
22187 	 * command's response data will be written. This can be either a host
22188 	 * physical address (HPA) or a guest physical address (GPA) and must
22189 	 * point to a physically contiguous block of memory.
22190 	 */
22191 	uint64_t	resp_addr;
22192 	uint32_t	flags;
22193 	/* If set, the response includes PPS event timestamps */
22194 	#define HWRM_FUNC_PTP_TS_QUERY_INPUT_FLAGS_PPS_TIME	UINT32_C(0x1)
22195 	/* If set, the response includes PTM timestamps */
22196 	#define HWRM_FUNC_PTP_TS_QUERY_INPUT_FLAGS_PTM_TIME	UINT32_C(0x2)
22197 	uint8_t	unused_0[4];
22198 } hwrm_func_ptp_ts_query_input_t, *phwrm_func_ptp_ts_query_input_t;
22199 
22200 /* hwrm_func_ptp_ts_query_output (size:320b/40B) */
22201 
22202 typedef struct hwrm_func_ptp_ts_query_output {
22203 	/* The specific error status for the command. */
22204 	uint16_t	error_code;
22205 	/* The HWRM command request type. */
22206 	uint16_t	req_type;
22207 	/* The sequence ID from the original command. */
22208 	uint16_t	seq_id;
22209 	/* The length of the response data in number of bytes. */
22210 	uint16_t	resp_len;
22211 	/* Timestamp value of last PPS event latched. */
22212 	uint64_t	pps_event_ts;
22213 	/*
22214 	 * PHC timestamp value when PTM responseD request is received
22215 	 * at downstream port (t4'). This is a 48 bit timestamp in nanoseconds.
22216 	 */
22217 	uint64_t	ptm_local_ts;
22218 	/*
22219 	 * PTM System timestamp value corresponding to t4' at
22220 	 * root complex (T4'). Together with ptm_local_ts, these
22221 	 * two timestamps provide the cross-trigger timestamps.
22222 	 * Driver can directly use these values for cross-trigger.
22223 	 * This is a 48 bit timestamp in nanoseconds.
22224 	 */
22225 	uint64_t	ptm_system_ts;
22226 	/*
22227 	 * PTM Link delay. This is the time taken at root complex (RC)
22228 	 * between receiving PTM request and sending PTM response to
22229 	 * downstream port. This is a 32 bit value in nanoseconds.
22230 	 */
22231 	uint32_t	ptm_link_delay;
22232 	uint8_t	unused_0[3];
22233 	/*
22234 	 * This field is used in Output records to indicate that the output
22235 	 * is completely written to RAM. This field should be read as '1'
22236 	 * to indicate that the output has been completely written. When
22237 	 * writing a command completion or response to an internal processor,
22238 	 * the order of writes has to be such that this field is written last.
22239 	 */
22240 	uint8_t	valid;
22241 } hwrm_func_ptp_ts_query_output_t, *phwrm_func_ptp_ts_query_output_t;
22242 
22243 /*************************
22244  * hwrm_func_ptp_ext_cfg *
22245  *************************/
22246 
22247 
22248 /* hwrm_func_ptp_ext_cfg_input (size:256b/32B) */
22249 
22250 typedef struct hwrm_func_ptp_ext_cfg_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-0xFFFC, 0xFFFE - Reserved for internal processors
22268 	 * * 0xFFFD - Reserved for user-space HWRM interface
22269 	 * * 0xFFFF - HWRM
22270 	 */
22271 	uint16_t	target_id;
22272 	/*
22273 	 * A physical address pointer pointing to a host buffer that the
22274 	 * command's response data will be written. This can be either a host
22275 	 * physical address (HPA) or a guest physical address (GPA) and must
22276 	 * point to a physically contiguous block of memory.
22277 	 */
22278 	uint64_t	resp_addr;
22279 	uint16_t	enables;
22280 	/*
22281 	 * This bit must be '1' for the phc_master_fid field to be
22282 	 * configured.
22283 	 */
22284 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_ENABLES_PHC_MASTER_FID	UINT32_C(0x1)
22285 	/*
22286 	 * This bit must be '1' for the phc_sec_fid field to be
22287 	 * configured.
22288 	 */
22289 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_ENABLES_PHC_SEC_FID	UINT32_C(0x2)
22290 	/*
22291 	 * This bit must be '1' for the phc_sec_mode field to be
22292 	 * configured.
22293 	 */
22294 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_ENABLES_PHC_SEC_MODE	UINT32_C(0x4)
22295 	/*
22296 	 * This bit must be '1' for the failover_timer field to be
22297 	 * configured.
22298 	 */
22299 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_ENABLES_FAILOVER_TIMER	UINT32_C(0x8)
22300 	/*
22301 	 * This field is used to configure the Master function. Only this
22302 	 * function can modify or condition the PHC. Only driver calls from
22303 	 * this function are allowed to adjust frequency of PHC or configure
22304 	 * PPS functionality.
22305 	 * If driver does not specify this FID, then firmware will auto select
22306 	 * the first function that makes the call to modify PHC as the Master.
22307 	 */
22308 	uint16_t	phc_master_fid;
22309 	/*
22310 	 * This field is used to configure the secondary function. This
22311 	 * function becomes the Master function in case of failover from
22312 	 * Master function.
22313 	 * If driver does not specify this FID, firmware will auto select
22314 	 * the last non-master function to make a call to condition PHC as
22315 	 * secondary.
22316 	 */
22317 	uint16_t	phc_sec_fid;
22318 	/*
22319 	 * This field is used to configure conditions under which a function
22320 	 * can become a secondary function.
22321 	 */
22322 	uint8_t	phc_sec_mode;
22323 	/*
22324 	 * Immediately failover to the current secondary function. If there
22325 	 * is no secondary function available, failover does not happen.
22326 	 */
22327 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_SWITCH  UINT32_C(0x0)
22328 	/*
22329 	 * All functions (PF and VF) can be used during auto selection
22330 	 * of a secondary function. This is not used in case of admin
22331 	 * configured secondary function.
22332 	 */
22333 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_ALL	UINT32_C(0x1)
22334 	/*
22335 	 * Only PF's can be selected as a secondary function during auto
22336 	 * selection. This is not used in case of admin configured secondary
22337 	 * function.
22338 	 */
22339 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_PF_ONLY UINT32_C(0x2)
22340 	#define HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_LAST   HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_PF_ONLY
22341 	uint8_t	unused_0;
22342 	/*
22343 	 * This field indicates the failover time is milliseconds. If the
22344 	 * timeout expires, firmware will failover PTP configurability from
22345 	 * current master to secondary fid.
22346 	 * 0 - Failover timer is automatically selected based on the last
22347 	 * adjFreq() call. If adjFreq() is not called for 3 * (last interval)
22348 	 * the failover kicks in. For example, if last interval between
22349 	 * adjFreq() calls was 2 seconds and the next adjFreq() is not made for
22350 	 * at least 6 seconds, then secondary takes over as master to condition
22351 	 * PHC. Firmware rounds up the failover timer to be a multiple of 250
22352 	 * ms. Firmware checks every 250 ms to see if timer expired.
22353 	 * 0xFFFFFFFF - If driver specifies this value, then failover never
22354 	 * happens. Admin or auto selected Master will always be used for
22355 	 * conditioning PHC.
22356 	 * X - If driver specifies any other value, this is admin indicated
22357 	 * failover timeout. If no adjFreq() call is made within this timeout
22358 	 * value, then failover happens. This value should be a multiple of
22359 	 * 250 ms. Firmware checks every 250 ms to see if timer expired.
22360 	 */
22361 	uint32_t	failover_timer;
22362 	uint8_t	unused_1[4];
22363 } hwrm_func_ptp_ext_cfg_input_t, *phwrm_func_ptp_ext_cfg_input_t;
22364 
22365 /* hwrm_func_ptp_ext_cfg_output (size:128b/16B) */
22366 
22367 typedef struct hwrm_func_ptp_ext_cfg_output {
22368 	/* The specific error status for the command. */
22369 	uint16_t	error_code;
22370 	/* The HWRM command request type. */
22371 	uint16_t	req_type;
22372 	/* The sequence ID from the original command. */
22373 	uint16_t	seq_id;
22374 	/* The length of the response data in number of bytes. */
22375 	uint16_t	resp_len;
22376 	uint8_t	unused_0[7];
22377 	/*
22378 	 * This field is used in Output records to indicate that the output
22379 	 * is completely written to RAM. This field should be read as '1'
22380 	 * to indicate that the output has been completely written. When
22381 	 * writing a command completion or response to an internal processor,
22382 	 * the order of writes has to be such that this field is written last.
22383 	 */
22384 	uint8_t	valid;
22385 } hwrm_func_ptp_ext_cfg_output_t, *phwrm_func_ptp_ext_cfg_output_t;
22386 
22387 /**************************
22388  * hwrm_func_ptp_ext_qcfg *
22389  **************************/
22390 
22391 
22392 /* hwrm_func_ptp_ext_qcfg_input (size:192b/24B) */
22393 
22394 typedef struct hwrm_func_ptp_ext_qcfg_input {
22395 	/* The HWRM command request type. */
22396 	uint16_t	req_type;
22397 	/*
22398 	 * The completion ring to send the completion event on. This should
22399 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22400 	 */
22401 	uint16_t	cmpl_ring;
22402 	/*
22403 	 * The sequence ID is used by the driver for tracking multiple
22404 	 * commands. This ID is treated as opaque data by the firmware and
22405 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22406 	 */
22407 	uint16_t	seq_id;
22408 	/*
22409 	 * The target ID of the command:
22410 	 * * 0x0-0xFFF8 - The function ID
22411 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22412 	 * * 0xFFFD - Reserved for user-space HWRM interface
22413 	 * * 0xFFFF - HWRM
22414 	 */
22415 	uint16_t	target_id;
22416 	/*
22417 	 * A physical address pointer pointing to a host buffer that the
22418 	 * command's response data will be written. This can be either a host
22419 	 * physical address (HPA) or a guest physical address (GPA) and must
22420 	 * point to a physically contiguous block of memory.
22421 	 */
22422 	uint64_t	resp_addr;
22423 	uint8_t	unused_0[8];
22424 } hwrm_func_ptp_ext_qcfg_input_t, *phwrm_func_ptp_ext_qcfg_input_t;
22425 
22426 /* hwrm_func_ptp_ext_qcfg_output (size:256b/32B) */
22427 
22428 typedef struct hwrm_func_ptp_ext_qcfg_output {
22429 	/* The specific error status for the command. */
22430 	uint16_t	error_code;
22431 	/* The HWRM command request type. */
22432 	uint16_t	req_type;
22433 	/* The sequence ID from the original command. */
22434 	uint16_t	seq_id;
22435 	/* The length of the response data in number of bytes. */
22436 	uint16_t	resp_len;
22437 	/*
22438 	 * Firmware returns the current PHC master function. This function
22439 	 * could either be admin selected or auto selected.
22440 	 */
22441 	uint16_t	phc_master_fid;
22442 	/*
22443 	 * Firmware returns the current PHC secondary function. This function
22444 	 * could either be admin selected or auto selected.
22445 	 */
22446 	uint16_t	phc_sec_fid;
22447 	/*
22448 	 * Firmware returns the last non-master/non-secondary function to
22449 	 * make a call to condition PHC.
22450 	 */
22451 	uint16_t	phc_active_fid0;
22452 	/*
22453 	 * Firmware returns the second last non-master/non-secondary function
22454 	 * to make a call to condition PHC.
22455 	 */
22456 	uint16_t	phc_active_fid1;
22457 	/*
22458 	 * Timestamp indicating the last time a failover happened. The master
22459 	 * and secondary functions in the failover event is indicated in the
22460 	 * next two fields.
22461 	 */
22462 	uint32_t	last_failover_event;
22463 	/*
22464 	 * Last failover happened from this function. This was the master
22465 	 * function at the time of failover.
22466 	 */
22467 	uint16_t	from_fid;
22468 	/*
22469 	 * Last failover happened to this function. This was the secondary
22470 	 * function at the time of failover.
22471 	 */
22472 	uint16_t	to_fid;
22473 	uint8_t	unused_0[7];
22474 	/*
22475 	 * This field is used in Output records to indicate that the output
22476 	 * is completely written to RAM. This field should be read as '1'
22477 	 * to indicate that the output has been completely written. When
22478 	 * writing a command completion or response to an internal processor,
22479 	 * the order of writes has to be such that this field is written last.
22480 	 */
22481 	uint8_t	valid;
22482 } hwrm_func_ptp_ext_qcfg_output_t, *phwrm_func_ptp_ext_qcfg_output_t;
22483 
22484 /*************************************
22485  * hwrm_func_timedtx_pacing_rate_add *
22486  *************************************/
22487 
22488 
22489 /* hwrm_func_timedtx_pacing_rate_add_input (size:192b/24B) */
22490 
22491 typedef struct hwrm_func_timedtx_pacing_rate_add_input {
22492 	/* The HWRM command request type. */
22493 	uint16_t	req_type;
22494 	/*
22495 	 * The completion ring to send the completion event on. This should
22496 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22497 	 */
22498 	uint16_t	cmpl_ring;
22499 	/*
22500 	 * The sequence ID is used by the driver for tracking multiple
22501 	 * commands. This ID is treated as opaque data by the firmware and
22502 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22503 	 */
22504 	uint16_t	seq_id;
22505 	/*
22506 	 * The target ID of the command:
22507 	 * * 0x0-0xFFF8 - The function ID
22508 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22509 	 * * 0xFFFD - Reserved for user-space HWRM interface
22510 	 * * 0xFFFF - HWRM
22511 	 */
22512 	uint16_t	target_id;
22513 	/*
22514 	 * A physical address pointer pointing to a host buffer that the
22515 	 * command's response data will be written. This can be either a host
22516 	 * physical address (HPA) or a guest physical address (GPA) and must
22517 	 * point to a physically contiguous block of memory.
22518 	 */
22519 	uint64_t	resp_addr;
22520 	/*
22521 	 * This field indicates TimedTx pacing rate in kbps.
22522 	 * The driver needs to add the rate into the hardware rate table
22523 	 * before requesting the pacing rate for a flow in TimedTX BD and
22524 	 * this addition should be done for each function rather than for
22525 	 * each flow/QP within the function.
22526 	 */
22527 	uint32_t	rate;
22528 	uint8_t	unused_0[4];
22529 } hwrm_func_timedtx_pacing_rate_add_input_t, *phwrm_func_timedtx_pacing_rate_add_input_t;
22530 
22531 /* hwrm_func_timedtx_pacing_rate_add_output (size:128b/16B) */
22532 
22533 typedef struct hwrm_func_timedtx_pacing_rate_add_output {
22534 	/* The specific error status for the command. */
22535 	uint16_t	error_code;
22536 	/* The HWRM command request type. */
22537 	uint16_t	req_type;
22538 	/* The sequence ID from the original command. */
22539 	uint16_t	seq_id;
22540 	/* The length of the response data in number of bytes. */
22541 	uint16_t	resp_len;
22542 	/*
22543 	 * This field indicates the logical rate ID that is assigned to the
22544 	 * rate in the rate table. The driver should use this ID for future
22545 	 * reference to this rate.
22546 	 */
22547 	uint16_t	rate_id;
22548 	uint8_t	unused_0[5];
22549 	/*
22550 	 * This field is used in Output records to indicate that the output
22551 	 * is completely written to RAM. This field should be read as '1'
22552 	 * to indicate that the output has been completely written. When
22553 	 * writing a command completion or response to an internal processor,
22554 	 * the order of writes has to be such that this field is written last.
22555 	 */
22556 	uint8_t	valid;
22557 } hwrm_func_timedtx_pacing_rate_add_output_t, *phwrm_func_timedtx_pacing_rate_add_output_t;
22558 
22559 /****************************************
22560  * hwrm_func_timedtx_pacing_rate_delete *
22561  ****************************************/
22562 
22563 
22564 /* hwrm_func_timedtx_pacing_rate_delete_input (size:192b/24B) */
22565 
22566 typedef struct hwrm_func_timedtx_pacing_rate_delete_input {
22567 	/* The HWRM command request type. */
22568 	uint16_t	req_type;
22569 	/*
22570 	 * The completion ring to send the completion event on. This should
22571 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22572 	 */
22573 	uint16_t	cmpl_ring;
22574 	/*
22575 	 * The sequence ID is used by the driver for tracking multiple
22576 	 * commands. This ID is treated as opaque data by the firmware and
22577 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22578 	 */
22579 	uint16_t	seq_id;
22580 	/*
22581 	 * The target ID of the command:
22582 	 * * 0x0-0xFFF8 - The function ID
22583 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22584 	 * * 0xFFFD - Reserved for user-space HWRM interface
22585 	 * * 0xFFFF - HWRM
22586 	 */
22587 	uint16_t	target_id;
22588 	/*
22589 	 * A physical address pointer pointing to a host buffer that the
22590 	 * command's response data will be written. This can be either a host
22591 	 * physical address (HPA) or a guest physical address (GPA) and must
22592 	 * point to a physically contiguous block of memory.
22593 	 */
22594 	uint64_t	resp_addr;
22595 	/*
22596 	 * The logical rate ID that is returned in the TimedTX pacing rate
22597 	 * add operation.
22598 	 */
22599 	uint16_t	rate_id;
22600 	uint8_t	unused_0[6];
22601 } hwrm_func_timedtx_pacing_rate_delete_input_t, *phwrm_func_timedtx_pacing_rate_delete_input_t;
22602 
22603 /* hwrm_func_timedtx_pacing_rate_delete_output (size:128b/16B) */
22604 
22605 typedef struct hwrm_func_timedtx_pacing_rate_delete_output {
22606 	/* The specific error status for the command. */
22607 	uint16_t	error_code;
22608 	/* The HWRM command request type. */
22609 	uint16_t	req_type;
22610 	/* The sequence ID from the original command. */
22611 	uint16_t	seq_id;
22612 	/* The length of the response data in number of bytes. */
22613 	uint16_t	resp_len;
22614 	uint8_t	unused_0[7];
22615 	/*
22616 	 * This field is used in Output records to indicate that the output
22617 	 * is completely written to RAM. This field should be read as '1'
22618 	 * to indicate that the output has been completely written. When
22619 	 * writing a command completion or response to an internal processor,
22620 	 * the order of writes has to be such that this field is written last.
22621 	 */
22622 	uint8_t	valid;
22623 } hwrm_func_timedtx_pacing_rate_delete_output_t, *phwrm_func_timedtx_pacing_rate_delete_output_t;
22624 
22625 /***************************************
22626  * hwrm_func_timedtx_pacing_rate_query *
22627  ***************************************/
22628 
22629 
22630 /* hwrm_func_timedtx_pacing_rate_query_input (size:192b/24B) */
22631 
22632 typedef struct hwrm_func_timedtx_pacing_rate_query_input {
22633 	/* The HWRM command request type. */
22634 	uint16_t	req_type;
22635 	/*
22636 	 * The completion ring to send the completion event on. This should
22637 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22638 	 */
22639 	uint16_t	cmpl_ring;
22640 	/*
22641 	 * The sequence ID is used by the driver for tracking multiple
22642 	 * commands. This ID is treated as opaque data by the firmware and
22643 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22644 	 */
22645 	uint16_t	seq_id;
22646 	/*
22647 	 * The target ID of the command:
22648 	 * * 0x0-0xFFF8 - The function ID
22649 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22650 	 * * 0xFFFD - Reserved for user-space HWRM interface
22651 	 * * 0xFFFF - HWRM
22652 	 */
22653 	uint16_t	target_id;
22654 	/*
22655 	 * A physical address pointer pointing to a host buffer that the
22656 	 * command's response data will be written. This can be either a host
22657 	 * physical address (HPA) or a guest physical address (GPA) and must
22658 	 * point to a physically contiguous block of memory.
22659 	 */
22660 	uint64_t	resp_addr;
22661 	uint8_t	unused_0[8];
22662 } hwrm_func_timedtx_pacing_rate_query_input_t, *phwrm_func_timedtx_pacing_rate_query_input_t;
22663 
22664 /* hwrm_func_timedtx_pacing_rate_query_output (size:4224b/528B) */
22665 
22666 typedef struct hwrm_func_timedtx_pacing_rate_query_output {
22667 	/* The specific error status for the command. */
22668 	uint16_t	error_code;
22669 	/* The HWRM command request type. */
22670 	uint16_t	req_type;
22671 	/* The sequence ID from the original command. */
22672 	uint16_t	seq_id;
22673 	/* The length of the response data in number of bytes. */
22674 	uint16_t	resp_len;
22675 	/*
22676 	 * This field indicates the rates that the function has added into
22677 	 * the hardware rate table. This is an array of 128 entries. Starting
22678 	 * with index 0, registered rates are populated in the initial entries
22679 	 * of the array, remaining entries are filled up with 0.
22680 	 */
22681 	uint32_t	rates[128];
22682 	uint8_t	unused_0[7];
22683 	/*
22684 	 * This field is used in Output records to indicate that the output
22685 	 * is completely written to RAM. This field should be read as '1'
22686 	 * to indicate that the output has been completely written. When
22687 	 * writing a command completion or response to an internal processor,
22688 	 * the order of writes has to be such that this field is written last.
22689 	 */
22690 	uint8_t	valid;
22691 } hwrm_func_timedtx_pacing_rate_query_output_t, *phwrm_func_timedtx_pacing_rate_query_output_t;
22692 
22693 /***************************
22694  * hwrm_func_key_ctx_alloc *
22695  ***************************/
22696 
22697 
22698 /* hwrm_func_key_ctx_alloc_input (size:384b/48B) */
22699 
22700 typedef struct hwrm_func_key_ctx_alloc_input {
22701 	/* The HWRM command request type. */
22702 	uint16_t	req_type;
22703 	/*
22704 	 * The completion ring to send the completion event on. This should
22705 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22706 	 */
22707 	uint16_t	cmpl_ring;
22708 	/*
22709 	 * The sequence ID is used by the driver for tracking multiple
22710 	 * commands. This ID is treated as opaque data by the firmware and
22711 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22712 	 */
22713 	uint16_t	seq_id;
22714 	/*
22715 	 * The target ID of the command:
22716 	 * * 0x0-0xFFF8 - The function ID
22717 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22718 	 * * 0xFFFD - Reserved for user-space HWRM interface
22719 	 * * 0xFFFF - HWRM
22720 	 */
22721 	uint16_t	target_id;
22722 	/*
22723 	 * A physical address pointer pointing to a host buffer that the
22724 	 * command's response data will be written. This can be either a host
22725 	 * physical address (HPA) or a guest physical address (GPA) and must
22726 	 * point to a physically contiguous block of memory.
22727 	 */
22728 	uint64_t	resp_addr;
22729 	/* Function ID. */
22730 	uint16_t	fid;
22731 	/*
22732 	 * Number of Key Contexts to be allocated.
22733 	 * When running in the XID partition mode, if the call is made by
22734 	 * a VF driver, this field specifies the number of XIDs requested
22735 	 * by the VF driver. The XID partitions are managed by the PF
22736 	 * driver in XID partition mode and the VF command will be
22737 	 * redirected to the PF driver. The PF driver may reduce this
22738 	 * number if it cannot allocate a big enough block of XID
22739 	 * partitions to satisfy the request.
22740 	 * This field must not exceed the maximum batch size specified in
22741 	 * the max_key_ctxs_alloc field of the HWRM_FUNC_QCAPS response,
22742 	 * must not be zero, and must be integer multiples of the
22743 	 * partition size specified in the ctxs_per_partition field of
22744 	 * the HWRM_FUNC_QCAPS response.
22745 	 */
22746 	uint16_t	num_key_ctxs;
22747 	/*
22748 	 * DMA buffer size in bytes. This field in invalid in the XID
22749 	 * partition mode.
22750 	 */
22751 	uint32_t	dma_bufr_size_bytes;
22752 	/* Key Context type. */
22753 	uint8_t	key_ctx_type;
22754 	/* KTLS Tx Key Context type. */
22755 	#define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_TX	UINT32_C(0x0)
22756 	/* KTLS Rx Key Context type. */
22757 	#define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_RX	UINT32_C(0x1)
22758 	/* QUIC Tx Key Context type. */
22759 	#define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_QUIC_TX UINT32_C(0x2)
22760 	/* QUIC Rx Key Context type. */
22761 	#define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_QUIC_RX UINT32_C(0x3)
22762 	#define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_LAST   HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_QUIC_RX
22763 	uint8_t	unused_0[7];
22764 	/*
22765 	 * Host DMA address to send back KTLS context IDs. This field is
22766 	 * invalid in the XID partition mode.
22767 	 */
22768 	uint64_t	host_dma_addr;
22769 	/*
22770 	 * This field is only used by the PF driver that manages the XID
22771 	 * partitions. This field specifies the starting XID of one or
22772 	 * more contiguous XID partitions allocated by the PF driver.
22773 	 * This field is not used by the VF driver.
22774 	 * If the call is successful, this starting XID value will be
22775 	 * returned in the partition_start_xid field of the response.
22776 	 */
22777 	uint32_t	partition_start_xid;
22778 	uint8_t	unused_1[4];
22779 } hwrm_func_key_ctx_alloc_input_t, *phwrm_func_key_ctx_alloc_input_t;
22780 
22781 /* hwrm_func_key_ctx_alloc_output (size:192b/24B) */
22782 
22783 typedef struct hwrm_func_key_ctx_alloc_output {
22784 	/* The specific error status for the command. */
22785 	uint16_t	error_code;
22786 	/* The HWRM command request type. */
22787 	uint16_t	req_type;
22788 	/* The sequence ID from the original command. */
22789 	uint16_t	seq_id;
22790 	/* The length of the response data in number of bytes. */
22791 	uint16_t	resp_len;
22792 	/* Number of Key Contexts that have been allocated. */
22793 	uint16_t	num_key_ctxs_allocated;
22794 	/* Control flags. */
22795 	uint8_t	flags;
22796 	/*
22797 	 * When set, it indicates that all key contexts allocated by this
22798 	 * command are contiguous. As a result, the driver has to read the
22799 	 * start context ID from the first entry of the DMA data buffer
22800 	 * and figures out the end context ID by 'start context ID +
22801 	 * num_key_ctxs_allocated - 1'. In XID partition mode,
22802 	 * this bit should always be set.
22803 	 */
22804 	#define HWRM_FUNC_KEY_CTX_ALLOC_OUTPUT_FLAGS_KEY_CTXS_CONTIGUOUS	UINT32_C(0x1)
22805 	uint8_t	unused_0;
22806 	/*
22807 	 * This field is only valid in the XID partition mode. It indicates
22808 	 * the starting XID that has been allocated.
22809 	 */
22810 	uint32_t	partition_start_xid;
22811 	uint8_t	unused_1[7];
22812 	/*
22813 	 * This field is used in Output records to indicate that the output
22814 	 * is completely written to RAM. This field should be read as '1'
22815 	 * to indicate that the output has been completely written. When
22816 	 * writing a command completion or response to an internal processor,
22817 	 * the order of writes has to be such that this field is written last.
22818 	 */
22819 	uint8_t	valid;
22820 } hwrm_func_key_ctx_alloc_output_t, *phwrm_func_key_ctx_alloc_output_t;
22821 
22822 /**************************
22823  * hwrm_func_key_ctx_free *
22824  **************************/
22825 
22826 
22827 /* hwrm_func_key_ctx_free_input (size:256b/32B) */
22828 
22829 typedef struct hwrm_func_key_ctx_free_input {
22830 	/* The HWRM command request type. */
22831 	uint16_t	req_type;
22832 	/*
22833 	 * The completion ring to send the completion event on. This should
22834 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22835 	 */
22836 	uint16_t	cmpl_ring;
22837 	/*
22838 	 * The sequence ID is used by the driver for tracking multiple
22839 	 * commands. This ID is treated as opaque data by the firmware and
22840 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22841 	 */
22842 	uint16_t	seq_id;
22843 	/*
22844 	 * The target ID of the command:
22845 	 * * 0x0-0xFFF8 - The function ID
22846 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22847 	 * * 0xFFFD - Reserved for user-space HWRM interface
22848 	 * * 0xFFFF - HWRM
22849 	 */
22850 	uint16_t	target_id;
22851 	/*
22852 	 * A physical address pointer pointing to a host buffer that the
22853 	 * command's response data will be written. This can be either a host
22854 	 * physical address (HPA) or a guest physical address (GPA) and must
22855 	 * point to a physically contiguous block of memory.
22856 	 */
22857 	uint64_t	resp_addr;
22858 	/* Function ID. */
22859 	uint16_t	fid;
22860 	/* Key Context type. */
22861 	uint8_t	key_ctx_type;
22862 	/* KTLS Tx Key Context type. */
22863 	#define HWRM_FUNC_KEY_CTX_FREE_INPUT_KEY_CTX_TYPE_TX	UINT32_C(0x0)
22864 	/* KTLS Rx Key Context type. */
22865 	#define HWRM_FUNC_KEY_CTX_FREE_INPUT_KEY_CTX_TYPE_RX	UINT32_C(0x1)
22866 	/* QUIC Tx Key Context type. */
22867 	#define HWRM_FUNC_KEY_CTX_FREE_INPUT_KEY_CTX_TYPE_QUIC_TX UINT32_C(0x2)
22868 	/* QUIC Rx Key Context type. */
22869 	#define HWRM_FUNC_KEY_CTX_FREE_INPUT_KEY_CTX_TYPE_QUIC_RX UINT32_C(0x3)
22870 	#define HWRM_FUNC_KEY_CTX_FREE_INPUT_KEY_CTX_TYPE_LAST   HWRM_FUNC_KEY_CTX_FREE_INPUT_KEY_CTX_TYPE_QUIC_RX
22871 	uint8_t	unused_0;
22872 	/* Starting XID of the partition that needs to be freed. */
22873 	uint32_t	partition_start_xid;
22874 	/*
22875 	 * Number of entries to be freed.
22876 	 * When running in the XID partition mode, this field is only
22877 	 * used by the PF driver that manages the XID partitions.
22878 	 * The PF driver specifies the number of XIDs to be freed and
22879 	 * this number is always equal to the number of XIDs previously
22880 	 * allocated successfully using HWRM_FUNC_KEY_CTX_ALLOC.
22881 	 * This field is not used by the VF driver.
22882 	 */
22883 	uint16_t	num_entries;
22884 	uint8_t	unused_1[6];
22885 } hwrm_func_key_ctx_free_input_t, *phwrm_func_key_ctx_free_input_t;
22886 
22887 /* hwrm_func_key_ctx_free_output (size:128b/16B) */
22888 
22889 typedef struct hwrm_func_key_ctx_free_output {
22890 	/* The specific error status for the command. */
22891 	uint16_t	error_code;
22892 	/* The HWRM command request type. */
22893 	uint16_t	req_type;
22894 	/* The sequence ID from the original command. */
22895 	uint16_t	seq_id;
22896 	/* The length of the response data in number of bytes. */
22897 	uint16_t	resp_len;
22898 	uint8_t	rsvd0[7];
22899 	/*
22900 	 * This field is used in Output records to indicate that the
22901 	 * output is completely written to RAM. This field should be
22902 	 * read as '1' to indicate that the output has been completely
22903 	 * written. When writing a command completion or response to
22904 	 * an internal processor, the order of writes has to be such
22905 	 * that this field is written last.
22906 	 */
22907 	uint8_t	valid;
22908 } hwrm_func_key_ctx_free_output_t, *phwrm_func_key_ctx_free_output_t;
22909 
22910 /**********************************
22911  * hwrm_func_backing_store_cfg_v2 *
22912  **********************************/
22913 
22914 
22915 /* hwrm_func_backing_store_cfg_v2_input (size:448b/56B) */
22916 
22917 typedef struct hwrm_func_backing_store_cfg_v2_input {
22918 	/* The HWRM command request type. */
22919 	uint16_t	req_type;
22920 	/*
22921 	 * The completion ring to send the completion event on. This should
22922 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
22923 	 */
22924 	uint16_t	cmpl_ring;
22925 	/*
22926 	 * The sequence ID is used by the driver for tracking multiple
22927 	 * commands. This ID is treated as opaque data by the firmware and
22928 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
22929 	 */
22930 	uint16_t	seq_id;
22931 	/*
22932 	 * The target ID of the command:
22933 	 * * 0x0-0xFFF8 - The function ID
22934 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22935 	 * * 0xFFFD - Reserved for user-space HWRM interface
22936 	 * * 0xFFFF - HWRM
22937 	 */
22938 	uint16_t	target_id;
22939 	/*
22940 	 * A physical address pointer pointing to a host buffer that the
22941 	 * command's response data will be written. This can be either a host
22942 	 * physical address (HPA) or a guest physical address (GPA) and must
22943 	 * point to a physically contiguous block of memory.
22944 	 */
22945 	uint64_t	resp_addr;
22946 	/* Type of backing store to be configured. */
22947 	uint16_t	type;
22948 	/* Queue pair. */
22949 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_QP		UINT32_C(0x0)
22950 	/* Shared receive queue. */
22951 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SRQ		UINT32_C(0x1)
22952 	/* Completion queue. */
22953 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CQ		UINT32_C(0x2)
22954 	/* Virtual NIC. */
22955 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_VNIC		UINT32_C(0x3)
22956 	/* Statistic context. */
22957 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_STAT		UINT32_C(0x4)
22958 	/* Slow-path TQM ring. */
22959 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SP_TQM_RING	UINT32_C(0x5)
22960 	/* Fast-path TQM ring. */
22961 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_FP_TQM_RING	UINT32_C(0x6)
22962 	/* Memory Region and Memory Address Vector Context. */
22963 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_MRAV		UINT32_C(0xe)
22964 	/* TIM. */
22965 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_TIM		UINT32_C(0xf)
22966 	/* Tx crypto key. */
22967 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_TX_CK		UINT32_C(0x13)
22968 	/* Rx crypto key. */
22969 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_RX_CK		UINT32_C(0x14)
22970 	/* Mid-path TQM ring. */
22971 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_MP_TQM_RING	UINT32_C(0x15)
22972 	/* SQ Doorbell shadow region. */
22973 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SQ_DB_SHADOW	UINT32_C(0x16)
22974 	/* RQ Doorbell shadow region. */
22975 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_RQ_DB_SHADOW	UINT32_C(0x17)
22976 	/* SRQ Doorbell shadow region. */
22977 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SRQ_DB_SHADOW	UINT32_C(0x18)
22978 	/* CQ Doorbell shadow region. */
22979 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CQ_DB_SHADOW	UINT32_C(0x19)
22980 	/* CFA table scope context. */
22981 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_TBL_SCOPE	UINT32_C(0x1c)
22982 	/* XID partition context. */
22983 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_XID_PARTITION	UINT32_C(0x1d)
22984 	/* SRT trace. */
22985 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SRT_TRACE	UINT32_C(0x1e)
22986 	/* SRT2 trace. */
22987 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SRT2_TRACE	UINT32_C(0x1f)
22988 	/* CRT trace. */
22989 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CRT_TRACE	UINT32_C(0x20)
22990 	/* CRT2 trace. */
22991 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CRT2_TRACE	UINT32_C(0x21)
22992 	/* RIGP0 trace. */
22993 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_RIGP0_TRACE	UINT32_C(0x22)
22994 	/* L2 HWRM trace. */
22995 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_L2_HWRM_TRACE	UINT32_C(0x23)
22996 	/* RoCE HWRM trace. */
22997 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_ROCE_HWRM_TRACE	UINT32_C(0x24)
22998 	/* TimedTx pacing TQM ring. */
22999 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_TTX_PACING_TQM_RING UINT32_C(0x25)
23000 	/* Context Accelerator CPU 0 trace. */
23001 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CA0_TRACE	UINT32_C(0x26)
23002 	/* Context Accelerator CPU 1 trace. */
23003 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CA1_TRACE	UINT32_C(0x27)
23004 	/* Context Accelerator CPU 2 trace. */
23005 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CA2_TRACE	UINT32_C(0x28)
23006 	/* RIGP1 trace. */
23007 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_RIGP1_TRACE	UINT32_C(0x29)
23008 	/* Invalid type. */
23009 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_INVALID		UINT32_C(0xffff)
23010 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_LAST		HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_INVALID
23011 	/*
23012 	 * Instance of the backing store type. It is zero-based,
23013 	 * which means "0" indicates the first instance. For backing
23014 	 * stores with single instance only, leave this field to 0.
23015 	 * 1. If the backing store type is MPC TQM ring, use the following
23016 	 *	instance value to map to MPC clients:
23017 	 *	TCE (0), RCE (1), TE_CFA(2), RE_CFA (3), PRIMATE(4)
23018 	 * 2. If the backing store type is TBL_SCOPE, use the following
23019 	 *	instance value to map to table scope regions:
23020 	 *	RE_CFA_LKUP (0), RE_CFA_ACT (1), TE_CFA_LKUP(2), TE_CFA_ACT (3)
23021 	 * 3. If the backing store type is XID partition, use the following
23022 	 *	instance value to map to context types:
23023 	 *	TX_CK (0), RX_CK (1)
23024 	 */
23025 	uint16_t	instance;
23026 	/* Control flags. */
23027 	uint32_t	flags;
23028 	/*
23029 	 * When set, the firmware only uses on-chip resources and
23030 	 * does not expect any backing store to be provided by the
23031 	 * host driver. This mode provides minimal L2 functionality
23032 	 * (e.g. limited L2 resources, no RoCE).
23033 	 */
23034 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_FLAGS_PREBOOT_MODE	UINT32_C(0x1)
23035 	/*
23036 	 * When set, the driver indicates that the backing store type
23037 	 * to be configured in this command is the last one to do for
23038 	 * the associated PF. That means all backing store type
23039 	 * configurations are done for the corresponding PF after this
23040 	 * command. As a result, the firmware has to do the necessary
23041 	 * post configurations.
23042 	 */
23043 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_FLAGS_BS_CFG_ALL_DONE	UINT32_C(0x2)
23044 	/*
23045 	 * When set, the driver indicates extending the size of the specific
23046 	 * backing store type instead of configuring the corresponding PBLs.
23047 	 * The size specified in the command will be the new size to be
23048 	 * configured. The operation is only valid when the specific backing
23049 	 * store has been configured before. Otherwise, the firmware will
23050 	 * return an error. The driver needs to zero out the 'entry_size',
23051 	 * 'flags', 'page_dir', and 'page_size_pbl_level' fields, and the
23052 	 * firmware will ignore these inputs. Further, the firmware expects
23053 	 * the 'num_entries' and any valid split entries to be no less than
23054 	 * the initial value that has been configured. If not, it will
23055 	 * return an error code.
23056 	 */
23057 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_FLAGS_BS_EXTEND	UINT32_C(0x4)
23058 	/* Page directory. */
23059 	uint64_t	page_dir;
23060 	/* Number of entries */
23061 	uint32_t	num_entries;
23062 	/* Number of bytes allocated for each entry */
23063 	uint16_t	entry_size;
23064 	/* Page size and pbl level. */
23065 	uint8_t	page_size_pbl_level;
23066 	/* PBL indirect levels. */
23067 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_MASK  UINT32_C(0xf)
23068 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_SFT   0
23069 	/* PBL pointer is physical start address. */
23070 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LVL_0   UINT32_C(0x0)
23071 	/* PBL pointer points to PTE table. */
23072 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LVL_1   UINT32_C(0x1)
23073 	/*
23074 	 * PBL pointer points to PDE table with each entry pointing to
23075 	 * PTE tables.
23076 	 */
23077 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LVL_2   UINT32_C(0x2)
23078 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LAST   HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LVL_2
23079 	/* Page size. */
23080 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_MASK  UINT32_C(0xf0)
23081 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_SFT   4
23082 	/* 4KB. */
23083 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_4K   (UINT32_C(0x0) << 4)
23084 	/* 8KB. */
23085 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_8K   (UINT32_C(0x1) << 4)
23086 	/* 64KB. */
23087 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_64K  (UINT32_C(0x2) << 4)
23088 	/* 2MB. */
23089 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_2M   (UINT32_C(0x3) << 4)
23090 	/* 8MB. */
23091 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_8M   (UINT32_C(0x4) << 4)
23092 	/* 1GB. */
23093 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_1G   (UINT32_C(0x5) << 4)
23094 		#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_LAST   HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_1G
23095 	/*
23096 	 * This field counts how many split entries contain valid data.
23097 	 * Below is the table that maps the count value:
23098 	 * | Count |			Indication			|
23099 	 * | ----- | -------------------------------------------------- |
23100 	 * |   0   | None of the split entries has valid data.	|
23101 	 * |   1   | Only "split_entry_0" contains valid data.	|
23102 	 * |   2   | Only "split_entry_0" and "1" have valid data.	|
23103 	 * |   3   | Only "split_entry_0", "1" and "2" have valid data. |
23104 	 * |   4   | All four split entries have valid data.		|
23105 	 */
23106 	uint8_t	subtype_valid_cnt;
23107 	/*
23108 	 * Split entry #0. Note that the four split entries (as a group)
23109 	 * must be cast to a type-specific data structure first before
23110 	 * accessing it! Below is the table that maps a backing store
23111 	 * type to the associated split entry casting data structure.
23112 	 * | Type |	Split Entry Casting Data Structure	|
23113 	 * | ---- | -------------------------------------------------- |
23114 	 * | QPC  |		qpc_split_entries			|
23115 	 * | SRQ  |		srq_split_entries			|
23116 	 * | CQ   |		cq_split_entries			|
23117 	 * | VINC |		vnic_split_entries			|
23118 	 * | MRAV |		mrav_split_entries			|
23119 	 * | TS   |		ts_split_entries			|
23120 	 * | CK   |		ck_split_entries			|
23121 	 */
23122 	uint32_t	split_entry_0;
23123 	/* Split entry #1. */
23124 	uint32_t	split_entry_1;
23125 	/* Split entry #2. */
23126 	uint32_t	split_entry_2;
23127 	/* Split entry #3. */
23128 	uint32_t	split_entry_3;
23129 	uint32_t        enables;
23130        /*
23131         * This bit must be '1' for the next_bs_offset field to be
23132         * configured.
23133         */
23134        #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_ENABLES_NEXT_BS_OFFSET     UINT32_C(0x1)
23135        /*
23136         * This field specifies the next byte offset of the backing store
23137         * for the firmware to use. The driver can use this field to
23138         * direct the firmware to resume the logging-to-host from
23139         * the host buffer where the firmware was lastly written
23140         * before it restarts, e.g. due to an error recovery.
23141         */
23142         uint32_t        next_bs_offset;
23143 } hwrm_func_backing_store_cfg_v2_input_t, *phwrm_func_backing_store_cfg_v2_input_t;
23144 
23145 /* hwrm_func_backing_store_cfg_v2_output (size:128b/16B) */
23146 
23147 typedef struct hwrm_func_backing_store_cfg_v2_output {
23148 	/* The specific error status for the command. */
23149 	uint16_t	error_code;
23150 	/* The HWRM command request type. */
23151 	uint16_t	req_type;
23152 	/* The sequence ID from the original command. */
23153 	uint16_t	seq_id;
23154 	/* The length of the response data in number of bytes. */
23155 	uint16_t	resp_len;
23156 	uint8_t	rsvd0[7];
23157 	/*
23158 	 * This field is used in Output records to indicate that the
23159 	 * output is completely written to RAM. This field should be
23160 	 * read as '1' to indicate that the output has been completely
23161 	 * written. When writing a command completion or response to
23162 	 * an internal processor, the order of writes has to be such
23163 	 * that this field is written last.
23164 	 */
23165 	uint8_t	valid;
23166 } hwrm_func_backing_store_cfg_v2_output_t, *phwrm_func_backing_store_cfg_v2_output_t;
23167 
23168 /***********************************
23169  * hwrm_func_backing_store_qcfg_v2 *
23170  ***********************************/
23171 
23172 
23173 /* hwrm_func_backing_store_qcfg_v2_input (size:192b/24B) */
23174 
23175 typedef struct hwrm_func_backing_store_qcfg_v2_input {
23176 	/* The HWRM command request type. */
23177 	uint16_t	req_type;
23178 	/*
23179 	 * The completion ring to send the completion event on. This should
23180 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
23181 	 */
23182 	uint16_t	cmpl_ring;
23183 	/*
23184 	 * The sequence ID is used by the driver for tracking multiple
23185 	 * commands. This ID is treated as opaque data by the firmware and
23186 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
23187 	 */
23188 	uint16_t	seq_id;
23189 	/*
23190 	 * The target ID of the command:
23191 	 * * 0x0-0xFFF8 - The function ID
23192 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23193 	 * * 0xFFFD - Reserved for user-space HWRM interface
23194 	 * * 0xFFFF - HWRM
23195 	 */
23196 	uint16_t	target_id;
23197 	/*
23198 	 * A physical address pointer pointing to a host buffer that the
23199 	 * command's response data will be written. This can be either a host
23200 	 * physical address (HPA) or a guest physical address (GPA) and must
23201 	 * point to a physically contiguous block of memory.
23202 	 */
23203 	uint64_t	resp_addr;
23204 	/* Type of backing store to be configured. */
23205 	uint16_t	type;
23206 	/* Queue pair. */
23207 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_QP		UINT32_C(0x0)
23208 	/* Shared receive queue. */
23209 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SRQ		UINT32_C(0x1)
23210 	/* Completion queue. */
23211 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CQ		UINT32_C(0x2)
23212 	/* Virtual NIC. */
23213 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_VNIC		UINT32_C(0x3)
23214 	/* Statistic context. */
23215 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_STAT		UINT32_C(0x4)
23216 	/* Slow-path TQM ring. */
23217 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SP_TQM_RING	UINT32_C(0x5)
23218 	/* Fast-path TQM ring. */
23219 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_FP_TQM_RING	UINT32_C(0x6)
23220 	/* Memory Region and Memory Address Vector Context. */
23221 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_MRAV		UINT32_C(0xe)
23222 	/* TIM. */
23223 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_TIM		UINT32_C(0xf)
23224 	/* Tx crypto key. */
23225 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_TX_CK		UINT32_C(0x13)
23226 	/* Rx crypto key. */
23227 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_RX_CK		UINT32_C(0x14)
23228 	/* Mid-path TQM ring. */
23229 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_MP_TQM_RING	UINT32_C(0x15)
23230 	/* SQ Doorbell shadow region. */
23231 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SQ_DB_SHADOW	UINT32_C(0x16)
23232 	/* RQ Doorbell shadow region. */
23233 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_RQ_DB_SHADOW	UINT32_C(0x17)
23234 	/* SRQ Doorbell shadow region. */
23235 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SRQ_DB_SHADOW	UINT32_C(0x18)
23236 	/* CQ Doorbell shadow region. */
23237 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CQ_DB_SHADOW	UINT32_C(0x19)
23238 	/* CFA table scope context. */
23239 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_TBL_SCOPE	UINT32_C(0x1c)
23240 	/* VF XID partition in-use table. */
23241 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_XID_PARTITION_TABLE UINT32_C(0x1d)
23242 	/* SRT trace. */
23243 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SRT_TRACE	UINT32_C(0x1e)
23244 	/* SRT2 trace. */
23245 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SRT2_TRACE	UINT32_C(0x1f)
23246 	/* CRT trace. */
23247 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CRT_TRACE	UINT32_C(0x20)
23248 	/* CRT2 trace. */
23249 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CRT2_TRACE	UINT32_C(0x21)
23250 	/* RIGP0 trace. */
23251 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_RIGP0_TRACE	UINT32_C(0x22)
23252 	/* L2 HWRM trace. */
23253 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_L2_HWRM_TRACE	UINT32_C(0x23)
23254 	/* RoCE HWRM trace. */
23255 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_ROCE_HWRM_TRACE	UINT32_C(0x24)
23256 	/* TimedTx pacing TQM ring. */
23257 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_TTX_PACING_TQM_RING UINT32_C(0x25)
23258 	/* Context Accelerator CPU 0 trace. */
23259 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CA0_TRACE	UINT32_C(0x26)
23260 	/* Context Accelerator CPU 1 trace. */
23261 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CA1_TRACE	UINT32_C(0x27)
23262 	/* Context Accelerator CPU 2 trace. */
23263 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CA2_TRACE	UINT32_C(0x28)
23264 	/* RIGP1 trace. */
23265 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_RIGP1_TRACE	UINT32_C(0x29)
23266 	/* Invalid type. */
23267 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_INVALID		UINT32_C(0xffff)
23268 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_LAST		HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_INVALID
23269 	/*
23270 	 * Instance of the backing store type. It is zero-based,
23271 	 * which means "0" indicates the first instance. For backing
23272 	 * stores with single instance only, leave this field to 0.
23273 	 * 1. If the backing store type is MPC TQM ring, use the following
23274 	 *	instance value to map to MPC clients:
23275 	 *	TCE (0), RCE (1), TE_CFA(2), RE_CFA (3), PRIMATE(4)
23276 	 * 2. If the backing store type is TBL_SCOPE, use the following
23277 	 *	instance value to map to table scope regions:
23278 	 *	RE_CFA_LKUP (0), RE_CFA_ACT (1), TE_CFA_LKUP(2), TE_CFA_ACT (3)
23279 	 * 3. If the backing store type is XID partition, use the following
23280 	 *	instance value to map to context types:
23281 	 *	TX_CK (0), RX_CK (1)
23282 	 */
23283 	uint16_t	instance;
23284 	uint8_t	rsvd[4];
23285 } hwrm_func_backing_store_qcfg_v2_input_t, *phwrm_func_backing_store_qcfg_v2_input_t;
23286 
23287 /* hwrm_func_backing_store_qcfg_v2_output (size:448b/56B) */
23288 
23289 typedef struct hwrm_func_backing_store_qcfg_v2_output {
23290 	/* The specific error status for the command. */
23291 	uint16_t	error_code;
23292 	/* The HWRM command request type. */
23293 	uint16_t	req_type;
23294 	/* The sequence ID from the original command. */
23295 	uint16_t	seq_id;
23296 	/* The length of the response data in number of bytes. */
23297 	uint16_t	resp_len;
23298 	/* Type of backing store to be configured. */
23299 	uint16_t	type;
23300 	/* Queue pair. */
23301 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_QP		UINT32_C(0x0)
23302 	/* Shared receive queue. */
23303 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_SRQ		UINT32_C(0x1)
23304 	/* Completion queue. */
23305 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_CQ		UINT32_C(0x2)
23306 	/* Virtual NIC. */
23307 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_VNIC		UINT32_C(0x3)
23308 	/* Statistic context. */
23309 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_STAT		UINT32_C(0x4)
23310 	/* Slow-path TQM ring. */
23311 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_SP_TQM_RING	UINT32_C(0x5)
23312 	/* Fast-path TQM ring. */
23313 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_FP_TQM_RING	UINT32_C(0x6)
23314 	/* Memory Region and Memory Address Vector Context. */
23315 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_MRAV		UINT32_C(0xe)
23316 	/* TIM. */
23317 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_TIM		UINT32_C(0xf)
23318 	/* Tx crypto key. */
23319 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_TX_CK		UINT32_C(0x13)
23320 	/* Rx crypto key. */
23321 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_RX_CK		UINT32_C(0x14)
23322 	/* Mid-path TQM ring. */
23323 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_MP_TQM_RING	UINT32_C(0x15)
23324 	/* CFA table scope context. */
23325 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_TBL_SCOPE	UINT32_C(0x1c)
23326 	/* XID partition context. */
23327 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_XID_PARTITION	UINT32_C(0x1d)
23328 	/* SRT trace. */
23329 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_SRT_TRACE	UINT32_C(0x1e)
23330 	/* SRT2 trace. */
23331 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_SRT2_TRACE	UINT32_C(0x1f)
23332 	/* CRT trace. */
23333 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_CRT_TRACE	UINT32_C(0x20)
23334 	/* CRT2 trace. */
23335 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_CRT2_TRACE	UINT32_C(0x21)
23336 	/* RIGP0 trace. */
23337 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_RIGP0_TRACE	UINT32_C(0x22)
23338 	/* L2 HWRM trace. */
23339 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_L2_HWRM_TRACE	UINT32_C(0x23)
23340 	/* RoCE HWRM trace. */
23341 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_ROCE_HWRM_TRACE	UINT32_C(0x24)
23342 	/* TimedTx pacing TQM ring. */
23343 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_TTX_PACING_TQM_RING UINT32_C(0x25)
23344 	/* Context Accelerator CPU 0 trace. */
23345 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_CA0_TRACE	UINT32_C(0x26)
23346 	/* Context Accelerator CPU 1 trace. */
23347 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_CA1_TRACE	UINT32_C(0x27)
23348 	/* Context Accelerator CPU 2 trace. */
23349 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_CA2_TRACE	UINT32_C(0x28)
23350 	/* RIGP1 trace. */
23351 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_RIGP1_TRACE	UINT32_C(0x29)
23352 	/* Invalid type. */
23353 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_INVALID		UINT32_C(0xffff)
23354 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_LAST		HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_INVALID
23355 	/*
23356 	 * Instance of the backing store type. It is zero-based,
23357 	 * which means "0" indicates the first instance. For backing
23358 	 * stores with single instance only, leave this field to 0.
23359 	 * 1. If the backing store type is MPC TQM ring, use the following
23360 	 *	instance value to map to MPC clients:
23361 	 *	TCE (0), RCE (1), TE_CFA(2), RE_CFA (3), PRIMATE(4)
23362 	 * 2. If the backing store type is TBL_SCOPE, use the following
23363 	 *	instance value to map to table scope regions:
23364 	 *	RE_CFA_LKUP (0), RE_CFA_ACT (1), TE_CFA_LKUP(2), TE_CFA_ACT (3)
23365 	 * 3. If the backing store type is XID partition, use the following
23366 	 *	instance value to map to context types:
23367 	 *	TX_CK (0), RX_CK (1)
23368 	 */
23369 	uint16_t	instance;
23370 	/* Control flags. */
23371 	uint32_t	flags;
23372 	/* Page directory. */
23373 	uint64_t	page_dir;
23374 	/* Number of entries */
23375 	uint32_t	num_entries;
23376 	/* Page size and pbl level. */
23377 	uint8_t	page_size_pbl_level;
23378 	/* PBL indirect levels. */
23379 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_MASK  UINT32_C(0xf)
23380 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_SFT   0
23381 	/* PBL pointer is physical start address. */
23382 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LVL_0   UINT32_C(0x0)
23383 	/* PBL pointer points to PTE table. */
23384 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LVL_1   UINT32_C(0x1)
23385 	/*
23386 	 * PBL pointer points to PDE table with each entry pointing to
23387 	 * PTE tables.
23388 	 */
23389 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LVL_2   UINT32_C(0x2)
23390 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LAST   HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LVL_2
23391 	/* Page size. */
23392 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_MASK  UINT32_C(0xf0)
23393 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_SFT   4
23394 	/* 4KB. */
23395 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_4K   (UINT32_C(0x0) << 4)
23396 	/* 8KB. */
23397 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_8K   (UINT32_C(0x1) << 4)
23398 	/* 64KB. */
23399 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_64K  (UINT32_C(0x2) << 4)
23400 	/* 2MB. */
23401 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_2M   (UINT32_C(0x3) << 4)
23402 	/* 8MB. */
23403 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_8M   (UINT32_C(0x4) << 4)
23404 	/* 1GB. */
23405 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_1G   (UINT32_C(0x5) << 4)
23406 		#define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_LAST   HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_1G
23407 	/*
23408 	 * This field counts how many split entries contain valid data.
23409 	 * Below is the table that maps the count value:
23410 	 * | count |			Indication			|
23411 	 * | ----- | -------------------------------------------------- |
23412 	 * |   0   | None of the split entries has valid data.	|
23413 	 * |   1   | Only "split_entry_0" contains valid data.	|
23414 	 * |   2   | Only "split_entry_0" and "1" have valid data.	|
23415 	 * |   3   | Only "split_entry_0", "1" and "2" have valid data. |
23416 	 * |   4   | All four split entries have valid data.		|
23417 	 */
23418 	uint8_t	subtype_valid_cnt;
23419 	uint8_t	rsvd[2];
23420 	/*
23421 	 * Split entry #0. Note that the four split entries (as a group)
23422 	 * must be cast to a type-specific data structure first before
23423 	 * accessing it! Below is the table that maps a backing store
23424 	 * type to the associated split entry casting data structure.
23425 	 * | Type |	Split Entry Casting Data Structure	|
23426 	 * | ---- | -------------------------------------------------- |
23427 	 * | QPC  |		qpc_split_entries			|
23428 	 * | SRQ  |		srq_split_entries			|
23429 	 * | CQ   |		cq_split_entries			|
23430 	 * | VINC |		vnic_split_entries			|
23431 	 * | MRAV |		mrav_split_entries			|
23432 	 * | TS   |		ts_split_entries			|
23433 	 * | CK   |		ck_split_entries			|
23434 	 */
23435 	uint32_t	split_entry_0;
23436 	/* Split entry #1. */
23437 	uint32_t	split_entry_1;
23438 	/* Split entry #2. */
23439 	uint32_t	split_entry_2;
23440 	/* Split entry #3. */
23441 	uint32_t	split_entry_3;
23442 	uint8_t	rsvd2[7];
23443 	/*
23444 	 * This field is used in Output records to indicate that the
23445 	 * output is completely written to RAM. This field should be
23446 	 * read as '1' to indicate that the output has been completely
23447 	 * written. When writing a command completion or response to
23448 	 * an internal processor, the order of writes has to be such
23449 	 * that this field is written last.
23450 	 */
23451 	uint8_t	valid;
23452 } hwrm_func_backing_store_qcfg_v2_output_t, *phwrm_func_backing_store_qcfg_v2_output_t;
23453 
23454 /* Common structure to cast QPC split entries. This casting is required in the following HWRM command inputs/outputs if the backing store type is QPC. 1. hwrm_func_backing_store_cfg_v2_input 2. hwrm_func_backing_store_qcfg_v2_output 3. hwrm_func_backing_store_qcaps_v2_output */
23455 /* qpc_split_entries (size:128b/16B) */
23456 
23457 typedef struct qpc_split_entries {
23458 	/* Number of L2 QP backing store entries. */
23459 	uint32_t	qp_num_l2_entries;
23460 	/* Number of QP1 entries. */
23461 	uint32_t	qp_num_qp1_entries;
23462 	/*
23463 	 * Number of RoCE QP context entries required for this
23464 	 * function to support fast QP modify destroy feature.
23465 	 */
23466 	uint32_t	qp_num_fast_qpmd_entries;
23467 	uint32_t	rsvd;
23468 } qpc_split_entries_t, *pqpc_split_entries_t;
23469 
23470 /* Common structure to cast SRQ split entries. This casting is required in the following HWRM command inputs/outputs if the backing store type is SRQ. 1. hwrm_func_backing_store_cfg_v2_input 2. hwrm_func_backing_store_qcfg_v2_output 3. hwrm_func_backing_store_qcaps_v2_output */
23471 /* srq_split_entries (size:128b/16B) */
23472 
23473 typedef struct srq_split_entries {
23474 	/* Number of L2 SRQ backing store entries. */
23475 	uint32_t	srq_num_l2_entries;
23476 	uint32_t	rsvd;
23477 	uint64_t	rsvd2;
23478 } srq_split_entries_t, *psrq_split_entries_t;
23479 
23480 /* Common structure to cast CQ split entries. This casting is required in the following HWRM command inputs/outputs if the backing store type is CQ. 1. hwrm_func_backing_store_cfg_v2_input 2. hwrm_func_backing_store_qcfg_v2_output 3. hwrm_func_backing_store_qcaps_v2_output */
23481 /* cq_split_entries (size:128b/16B) */
23482 
23483 typedef struct cq_split_entries {
23484 	/* Number of L2 CQ backing store entries. */
23485 	uint32_t	cq_num_l2_entries;
23486 	uint32_t	rsvd;
23487 	uint64_t	rsvd2;
23488 } cq_split_entries_t, *pcq_split_entries_t;
23489 
23490 /* Common structure to cast VNIC split entries. This casting is required in the following HWRM command inputs/outputs if the backing store type is VNIC. 1. hwrm_func_backing_store_cfg_v2_input 2. hwrm_func_backing_store_qcfg_v2_output 3. hwrm_func_backing_store_qcaps_v2_output */
23491 /* vnic_split_entries (size:128b/16B) */
23492 
23493 typedef struct vnic_split_entries {
23494 	/* Number of VNIC backing store entries. */
23495 	uint32_t	vnic_num_vnic_entries;
23496 	uint32_t	rsvd;
23497 	uint64_t	rsvd2;
23498 } vnic_split_entries_t, *pvnic_split_entries_t;
23499 
23500 /* Common structure to cast MRAV split entries. This casting is required in the following HWRM command inputs/outputs if the backing store type is MRAV. 1. hwrm_func_backing_store_cfg_v2_input 2. hwrm_func_backing_store_qcfg_v2_output 3. hwrm_func_backing_store_qcaps_v2_output */
23501 /* mrav_split_entries (size:128b/16B) */
23502 
23503 typedef struct mrav_split_entries {
23504 	/* Number of AV backing store entries. */
23505 	uint32_t	mrav_num_av_entries;
23506 	uint32_t	rsvd;
23507 	uint64_t	rsvd2;
23508 } mrav_split_entries_t, *pmrav_split_entries_t;
23509 
23510 /* Common structure to cast TBL_SCOPE split entries. This casting is required in the following HWRM command inputs/outputs if the backing store type is TBL_SCOPE. 1. hwrm_func_backing_store_cfg_v2_input 2. hwrm_func_backing_store_qcfg_v2_output 3. hwrm_func_backing_store_qcaps_v2_output */
23511 /* ts_split_entries (size:128b/16B) */
23512 
23513 typedef struct ts_split_entries {
23514 	/* Max number of TBL_SCOPE region entries (QCAPS). */
23515 	uint32_t	region_num_entries;
23516 	/* tsid to configure (CFG). */
23517 	uint8_t	tsid;
23518 	/*
23519 	 * Lkup static bucket count (power of 2).
23520 	 * Array is indexed by enum cfa_dir
23521 	 */
23522 	uint8_t	lkup_static_bkt_cnt_exp[2];
23523 	uint8_t	rsvd;
23524 	uint64_t	rsvd2;
23525 } ts_split_entries_t, *pts_split_entries_t;
23526 
23527 /* Common structure to cast crypto key split entries. This casting is required in the following HWRM command inputs/outputs if the backing store type is TX_CK or RX_CK. 1. hwrm_func_backing_store_cfg_v2_input 2. hwrm_func_backing_store_qcfg_v2_output 3. hwrm_func_backing_store_qcaps_v2_output */
23528 /* ck_split_entries (size:128b/16B) */
23529 
23530 typedef struct ck_split_entries {
23531 	/*
23532 	 * Number of QUIC backing store entries. That means the number of KTLS
23533 	 * backing store entries is the difference between this number and the
23534 	 * total number of crypto key entries.
23535 	 */
23536 	uint32_t	num_quic_entries;
23537 	uint32_t	rsvd;
23538 	uint64_t	rsvd2;
23539 } ck_split_entries_t, *pck_split_entries_t;
23540 
23541 /************************************
23542  * hwrm_func_backing_store_qcaps_v2 *
23543  ************************************/
23544 
23545 
23546 /* hwrm_func_backing_store_qcaps_v2_input (size:192b/24B) */
23547 
23548 typedef struct hwrm_func_backing_store_qcaps_v2_input {
23549 	/* The HWRM command request type. */
23550 	uint16_t	req_type;
23551 	/*
23552 	 * The completion ring to send the completion event on. This should
23553 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
23554 	 */
23555 	uint16_t	cmpl_ring;
23556 	/*
23557 	 * The sequence ID is used by the driver for tracking multiple
23558 	 * commands. This ID is treated as opaque data by the firmware and
23559 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
23560 	 */
23561 	uint16_t	seq_id;
23562 	/*
23563 	 * The target ID of the command:
23564 	 * * 0x0-0xFFF8 - The function ID
23565 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23566 	 * * 0xFFFD - Reserved for user-space HWRM interface
23567 	 * * 0xFFFF - HWRM
23568 	 */
23569 	uint16_t	target_id;
23570 	/*
23571 	 * A physical address pointer pointing to a host buffer that the
23572 	 * command's response data will be written. This can be either a host
23573 	 * physical address (HPA) or a guest physical address (GPA) and must
23574 	 * point to a physically contiguous block of memory.
23575 	 */
23576 	uint64_t	resp_addr;
23577 	/* Type of backing store to be queried. */
23578 	uint16_t	type;
23579 	/* Queue pair. */
23580 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_QP		UINT32_C(0x0)
23581 	/* Shared receive queue. */
23582 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SRQ		UINT32_C(0x1)
23583 	/* Completion queue. */
23584 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CQ		UINT32_C(0x2)
23585 	/* Virtual NIC. */
23586 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_VNIC		UINT32_C(0x3)
23587 	/* Statistic context. */
23588 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_STAT		UINT32_C(0x4)
23589 	/* Slow-path TQM ring. */
23590 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SP_TQM_RING	UINT32_C(0x5)
23591 	/* Fast-path TQM ring. */
23592 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_FP_TQM_RING	UINT32_C(0x6)
23593 	/* Memory Region and Memory Address Vector Context. */
23594 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_MRAV		UINT32_C(0xe)
23595 	/* TIM. */
23596 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_TIM		UINT32_C(0xf)
23597 	/* Tx crypto key. */
23598 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_TX_CK		UINT32_C(0x13)
23599 	/* Rx crypto key. */
23600 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_RX_CK		UINT32_C(0x14)
23601 	/* Mid-path TQM ring. */
23602 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_MP_TQM_RING	UINT32_C(0x15)
23603 	/* SQ Doorbell shadow region. */
23604 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SQ_DB_SHADOW	UINT32_C(0x16)
23605 	/* RQ Doorbell shadow region. */
23606 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_RQ_DB_SHADOW	UINT32_C(0x17)
23607 	/* SRQ Doorbell shadow region. */
23608 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SRQ_DB_SHADOW	UINT32_C(0x18)
23609 	/* CQ Doorbell shadow region. */
23610 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CQ_DB_SHADOW	UINT32_C(0x19)
23611 	/* CFA table scope context. */
23612 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_TBL_SCOPE	UINT32_C(0x1c)
23613 	/* XID partition context. */
23614 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_XID_PARTITION	UINT32_C(0x1d)
23615 	/* SRT trace. */
23616 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SRT_TRACE	UINT32_C(0x1e)
23617 	/* SRT2 trace. */
23618 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SRT2_TRACE	UINT32_C(0x1f)
23619 	/* CRT trace. */
23620 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CRT_TRACE	UINT32_C(0x20)
23621 	/* CRT2 trace. */
23622 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CRT2_TRACE	UINT32_C(0x21)
23623 	/* RIGP0 trace. */
23624 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_RIGP0_TRACE	UINT32_C(0x22)
23625 	/* L2 HWRM trace. */
23626 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_L2_HWRM_TRACE	UINT32_C(0x23)
23627 	/* RoCE HWRM trace. */
23628 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_ROCE_HWRM_TRACE	UINT32_C(0x24)
23629 	/* TimedTx pacing TQM ring. */
23630 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_TTX_PACING_TQM_RING UINT32_C(0x25)
23631 	/* Context Accelerator CPU 0 trace. */
23632 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CA0_TRACE	UINT32_C(0x26)
23633 	/* Context Accelerator CPU 1 trace. */
23634 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CA1_TRACE	UINT32_C(0x27)
23635 	/* Context Accelerator CPU 2 trace. */
23636 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CA2_TRACE	UINT32_C(0x28)
23637 	/* RIGP1 trace. */
23638 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_RIGP1_TRACE	UINT32_C(0x29)
23639 	/* Invalid type. */
23640 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_INVALID		UINT32_C(0xffff)
23641 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_LAST		HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_INVALID
23642 	uint8_t	rsvd[6];
23643 } hwrm_func_backing_store_qcaps_v2_input_t, *phwrm_func_backing_store_qcaps_v2_input_t;
23644 
23645 /* hwrm_func_backing_store_qcaps_v2_output (size:448b/56B) */
23646 
23647 typedef struct hwrm_func_backing_store_qcaps_v2_output {
23648 	/* The specific error status for the command. */
23649 	uint16_t	error_code;
23650 	/* The HWRM command request type. */
23651 	uint16_t	req_type;
23652 	/* The sequence ID from the original command. */
23653 	uint16_t	seq_id;
23654 	/* The length of the response data in number of bytes. */
23655 	uint16_t	resp_len;
23656 	/* Type of backing store to be queried. */
23657 	uint16_t	type;
23658 	/* Queue pair. */
23659 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_QP		UINT32_C(0x0)
23660 	/* Shared receive queue. */
23661 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SRQ		UINT32_C(0x1)
23662 	/* Completion queue. */
23663 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CQ		UINT32_C(0x2)
23664 	/* Virtual NIC. */
23665 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_VNIC		UINT32_C(0x3)
23666 	/* Statistic context. */
23667 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_STAT		UINT32_C(0x4)
23668 	/* Slow-path TQM ring. */
23669 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SP_TQM_RING	UINT32_C(0x5)
23670 	/* Fast-path TQM ring. */
23671 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_FP_TQM_RING	UINT32_C(0x6)
23672 	/* Memory Region and Memory Address Vector Context. */
23673 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_MRAV		UINT32_C(0xe)
23674 	/* TIM. */
23675 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_TIM		UINT32_C(0xf)
23676 	/* Tx crypto key. */
23677 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_TX_CK		UINT32_C(0x13)
23678 	/* Rx crypto key. */
23679 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_RX_CK		UINT32_C(0x14)
23680 	/* Mid-path TQM ring. */
23681 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_MP_TQM_RING	UINT32_C(0x15)
23682 	/* SQ Doorbell shadow region. */
23683 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SQ_DB_SHADOW	UINT32_C(0x16)
23684 	/* RQ Doorbell shadow region. */
23685 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_RQ_DB_SHADOW	UINT32_C(0x17)
23686 	/* SRQ Doorbell shadow region. */
23687 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SRQ_DB_SHADOW	UINT32_C(0x18)
23688 	/* CQ Doorbell shadow region. */
23689 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CQ_DB_SHADOW	UINT32_C(0x19)
23690 	/* CFA table scope context. */
23691 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_TBL_SCOPE	UINT32_C(0x1c)
23692 	/* XID partition context. */
23693 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_XID_PARTITION	UINT32_C(0x1d)
23694 	/* SRT trace. */
23695 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SRT_TRACE	UINT32_C(0x1e)
23696 	/* SRT2 trace. */
23697 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SRT2_TRACE	UINT32_C(0x1f)
23698 	/* CRT trace. */
23699 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CRT_TRACE	UINT32_C(0x20)
23700 	/* CRT2 trace. */
23701 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CRT2_TRACE	UINT32_C(0x21)
23702 	/* RIGP0 trace. */
23703 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_RIGP0_TRACE	UINT32_C(0x22)
23704 	/* L2 HWRM trace. */
23705 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_L2_HWRM_TRACE	UINT32_C(0x23)
23706 	/* RoCE HWRM trace. */
23707 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_ROCE_HWRM_TRACE	UINT32_C(0x24)
23708 	/* TimedTx pacing TQM ring. */
23709 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_TTX_PACING_TQM_RING UINT32_C(0x25)
23710 	/* Context Accelerator CPU 0 trace. */
23711 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CA0_TRACE	UINT32_C(0x26)
23712 	/* Context Accelerator CPU 1 trace. */
23713 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CA1_TRACE	UINT32_C(0x27)
23714 	/* Context Accelerator CPU 2 trace. */
23715 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CA2_TRACE	UINT32_C(0x28)
23716 	/* RIGP1 trace. */
23717 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_RIGP1_TRACE	UINT32_C(0x29)
23718 	/* Invalid type. */
23719 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_INVALID		UINT32_C(0xffff)
23720 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_LAST		HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_INVALID
23721 	/* Number of bytes per backing store entry. */
23722 	uint16_t	entry_size;
23723 	/* Control flags. */
23724 	uint32_t	flags;
23725 	/*
23726 	 * When set, it indicates the context type should be initialized
23727 	 * with the 'ctx_init_value' at the specified offset.
23728 	 */
23729 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_ENABLE_CTX_KIND_INIT		UINT32_C(0x1)
23730 	/* When set, it indicates the context type is valid. */
23731 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_TYPE_VALID			UINT32_C(0x2)
23732 	/*
23733 	 * When set, it indicates the region for this type is not a regular
23734 	 * context memory but a driver managed memory that is created,
23735 	 * initialized and managed by the driver.
23736 	 */
23737 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_DRIVER_MANAGED_MEMORY	UINT32_C(0x4)
23738 	/*
23739 	 * When set, it indicates the support of the following capability
23740 	 * that is specific to the QP type:
23741 	 * - For 2-port adapters, the ability to extend the RoCE QP
23742 	 *   entries configured on a PF, during some network events such as
23743 	 *   Link Down. These additional entries count is included in the
23744 	 *   advertised 'max_num_entries'.
23745 	 * - The count of RoCE QP entries, derived from 'max_num_entries'
23746 	 *   (max_num_entries - qp_num_qp1_entries - qp_num_l2_entries -
23747 	 *   qp_num_fast_qpmd_entries, note qp_num_fast_qpmd_entries is
23748 	 *   always zero when QPs are pseudo-statically allocated), includes
23749 	 *   the count of QPs that can be migrated from the other PF (e.g.,
23750 	 *   during network link down). Therefore, during normal operation
23751 	 *   when both PFs are active, the supported number of RoCE QPs for
23752 	 *   each of the PF is half of the advertised value.
23753 	 */
23754 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_ROCE_QP_PSEUDO_STATIC_ALLOC	UINT32_C(0x8)
23755 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_FW_DBG_TRACE                      UINT32_C(0x10)
23756 
23757 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_FW_BIN_DBG_TRACE          UINT32_C(0x20)
23758 
23759 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_NEXT_BS_OFFSET            UINT32_C(0x40)
23760 	/*
23761 	 * Bit map of the valid instances associated with the
23762 	 * backing store type.
23763 	 * 1. If the backing store type is MPC TQM ring, use the following
23764 	 *	bits to map to MPC clients:
23765 	 *	TCE (0), RCE (1), TE_CFA(2), RE_CFA (3), PRIMATE(4)
23766 	 * 2. If the backing store type is TBL_SCOPE, use the following
23767 	 *	bits to map to table scope regions:
23768 	 *	RE_CFA_LKUP (0), RE_CFA_ACT (1), TE_CFA_LKUP(2), TE_CFA_ACT (3)
23769 	 * 3. If the backing store type is VF XID partition in-use table, use
23770 	 *	the following bits to map to context types:
23771 	 *	TX_CK (0), RX_CK (1)
23772 	 */
23773 	uint32_t	instance_bit_map;
23774 	/*
23775 	 * Initializer to be used by drivers to initialize context memory
23776 	 * to ensure context subsystem flags an error for an attack before
23777 	 * the first time context load.
23778 	 */
23779 	uint8_t	ctx_init_value;
23780 	/*
23781 	 * Specifies the doubleword offset of ctx_init_value for this
23782 	 * context type.
23783 	 */
23784 	uint8_t	ctx_init_offset;
23785 	/*
23786 	 * Some backing store types, e.g., TQM rings, require the number
23787 	 * of entries to be a multiple of this value to prevent any
23788 	 * resource allocation limitations. If not applicable, leave
23789 	 * this field with "0".
23790 	 */
23791 	uint8_t	entry_multiple;
23792 	uint8_t	rsvd;
23793 	/* Maximum number of backing store entries supported for this type. */
23794 	uint32_t	max_num_entries;
23795 	/*
23796 	 * Minimum number of backing store entries required for this type.
23797 	 * This field is only valid for some backing store types, e.g.,
23798 	 * TQM rings. If not applicable, leave this field with "0".
23799 	 */
23800 	uint32_t	min_num_entries;
23801 	/*
23802 	 * Next valid backing store type. If current type queried is already
23803 	 * the last valid type, firmware must set this field to invalid type.
23804 	 */
23805 	uint16_t	next_valid_type;
23806 	/*
23807 	 * This field counts how many split entries contain valid data.
23808 	 * Below is the table that maps the count value:
23809 	 * | count |			Indication			|
23810 	 * | ----- | -------------------------------------------------- |
23811 	 * |   0   | None of the split entries has valid data.	|
23812 	 * |   1   | Only "split_entry_0" contains valid data.	|
23813 	 * |   2   | Only "split_entry_0" and "1" have valid data.	|
23814 	 * |   3   | Only "split_entry_0", "1" and "2" have valid data. |
23815 	 * |   4   | All four split entries have valid data.		|
23816 	 */
23817 	uint8_t	subtype_valid_cnt;
23818 	/*
23819 	 * Bitmap that indicates if each of the 'split_entry' denotes an
23820 	 * exact count (i.e., min = max). When the exact count bit is set,
23821 	 * it indicates the exact number of entries as advertised has to be
23822 	 * configured. The 'split_entry' to be set to contain exact count by
23823 	 * this bitmap needs to be a valid split entry specified by
23824 	 * 'subtype_valid_cnt'.
23825 	 */
23826 	uint8_t	exact_cnt_bit_map;
23827 	/*
23828 	 * When this bit is '1', it indicates 'split_entry_0' contains
23829 	 * an exact count.
23830 	 */
23831 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_EXACT_CNT_BIT_MAP_SPLIT_ENTRY_0_EXACT	UINT32_C(0x1)
23832 	/*
23833 	 * When this bit is '1', it indicates 'split_entry_1' contains
23834 	 * an exact count.
23835 	 */
23836 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_EXACT_CNT_BIT_MAP_SPLIT_ENTRY_1_EXACT	UINT32_C(0x2)
23837 	/*
23838 	 * When this bit is '1', it indicates 'split_entry_2' contains
23839 	 * an exact count.
23840 	 */
23841 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_EXACT_CNT_BIT_MAP_SPLIT_ENTRY_2_EXACT	UINT32_C(0x4)
23842 	/*
23843 	 * When this bit is '1', it indicates 'split_entry_3' contains
23844 	 * an exact count.
23845 	 */
23846 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_EXACT_CNT_BIT_MAP_SPLIT_ENTRY_3_EXACT	UINT32_C(0x8)
23847 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_EXACT_CNT_BIT_MAP_UNUSED_MASK		UINT32_C(0xf0)
23848 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_EXACT_CNT_BIT_MAP_UNUSED_SFT		4
23849 	/*
23850 	 * Split entry #0. Note that the four split entries (as a group)
23851 	 * must be cast to a type-specific data structure first before
23852 	 * accessing it! Below is the table that maps a backing store
23853 	 * type to the associated split entry casting data structure.
23854 	 * | Type |	Split Entry Casting Data Structure	|
23855 	 * | ---- | -------------------------------------------------- |
23856 	 * | QPC  |		qpc_split_entries			|
23857 	 * | SRQ  |		srq_split_entries			|
23858 	 * | CQ   |		cq_split_entries			|
23859 	 * | VINC |		vnic_split_entries			|
23860 	 * | MRAV |		mrav_split_entries			|
23861 	 * | TS   |		ts_split_entries			|
23862 	 */
23863 	uint32_t	split_entry_0;
23864 	/* Split entry #1. */
23865 	uint32_t	split_entry_1;
23866 	/* Split entry #2. */
23867 	uint32_t	split_entry_2;
23868 	/* Split entry #3. */
23869 	uint32_t	split_entry_3;
23870 	uint8_t	rsvd3[3];
23871 	/*
23872 	 * This field is used in Output records to indicate that the
23873 	 * output is completely written to RAM. This field should be
23874 	 * read as '1' to indicate that the output has been completely
23875 	 * written. When writing a command completion or response to
23876 	 * an internal processor, the order of writes has to be such
23877 	 * that this field is written last.
23878 	 */
23879 	uint8_t	valid;
23880 } hwrm_func_backing_store_qcaps_v2_output_t, *phwrm_func_backing_store_qcaps_v2_output_t;
23881 
23882 /****************************
23883  * hwrm_func_dbr_pacing_cfg *
23884  ****************************/
23885 
23886 
23887 /* hwrm_func_dbr_pacing_cfg_input (size:320b/40B) */
23888 
23889 typedef struct hwrm_func_dbr_pacing_cfg_input {
23890 	/* The HWRM command request type. */
23891 	uint16_t	req_type;
23892 	/*
23893 	 * The completion ring to send the completion event on. This should
23894 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
23895 	 */
23896 	uint16_t	cmpl_ring;
23897 	/*
23898 	 * The sequence ID is used by the driver for tracking multiple
23899 	 * commands. This ID is treated as opaque data by the firmware and
23900 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
23901 	 */
23902 	uint16_t	seq_id;
23903 	/*
23904 	 * The target ID of the command:
23905 	 * * 0x0-0xFFF8 - The function ID
23906 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23907 	 * * 0xFFFD - Reserved for user-space HWRM interface
23908 	 * * 0xFFFF - HWRM
23909 	 */
23910 	uint16_t	target_id;
23911 	/*
23912 	 * A physical address pointer pointing to a host buffer that the
23913 	 * command's response data will be written. This can be either a host
23914 	 * physical address (HPA) or a guest physical address (GPA) and must
23915 	 * point to a physically contiguous block of memory.
23916 	 */
23917 	uint64_t	resp_addr;
23918 	uint8_t	flags;
23919 	/*
23920 	 * This bit must be '1' to enable DBR NQ events. The NQ ID to
23921 	 * receive the events must be specified in the primary_nq_id
23922 	 * field.
23923 	 */
23924 	#define HWRM_FUNC_DBR_PACING_CFG_INPUT_FLAGS_DBR_NQ_EVENT_ENABLE	UINT32_C(0x1)
23925 	/* This bit must be '1' to disable DBR NQ events. */
23926 	#define HWRM_FUNC_DBR_PACING_CFG_INPUT_FLAGS_DBR_NQ_EVENT_DISABLE	UINT32_C(0x2)
23927 	uint8_t	unused_0[7];
23928 	uint32_t	enables;
23929 	/*
23930 	 * This bit must be '1' for the primary_nq_id field to be
23931 	 * configured.
23932 	 */
23933 	#define HWRM_FUNC_DBR_PACING_CFG_INPUT_ENABLES_PRIMARY_NQ_ID_VALID	UINT32_C(0x1)
23934 	/*
23935 	 * This bit must be '1' for the pacing_threshold field to be
23936 	 * configured.
23937 	 */
23938 	#define HWRM_FUNC_DBR_PACING_CFG_INPUT_ENABLES_PACING_THRESHOLD_VALID	UINT32_C(0x2)
23939 	/*
23940 	 * Specify primary function's NQ ID to receive the doorbell pacing
23941 	 * threshold crossing events.
23942 	 */
23943 	uint32_t	primary_nq_id;
23944 	/*
23945 	 * Specify pacing threshold value, as a percentage of the max
23946 	 * doorbell FIFO depth. The range is 1 to 36.
23947 	 */
23948 	uint32_t	pacing_threshold;
23949 	uint8_t	unused_1[4];
23950 } hwrm_func_dbr_pacing_cfg_input_t, *phwrm_func_dbr_pacing_cfg_input_t;
23951 
23952 /* hwrm_func_dbr_pacing_cfg_output (size:128b/16B) */
23953 
23954 typedef struct hwrm_func_dbr_pacing_cfg_output {
23955 	/* The specific error status for the command. */
23956 	uint16_t	error_code;
23957 	/* The HWRM command request type. */
23958 	uint16_t	req_type;
23959 	/* The sequence ID from the original command. */
23960 	uint16_t	seq_id;
23961 	/* The length of the response data in number of bytes. */
23962 	uint16_t	resp_len;
23963 	uint8_t	unused_0[7];
23964 	/*
23965 	 * This field is used in Output records to indicate that the output
23966 	 * is completely written to RAM. This field should be read as '1'
23967 	 * to indicate that the output has been completely written.
23968 	 * When writing a command completion or response to an internal
23969 	 * processor, the order of writes has to be such that this field is
23970 	 * written last.
23971 	 */
23972 	uint8_t	valid;
23973 } hwrm_func_dbr_pacing_cfg_output_t, *phwrm_func_dbr_pacing_cfg_output_t;
23974 
23975 /*****************************
23976  * hwrm_func_dbr_pacing_qcfg *
23977  *****************************/
23978 
23979 
23980 /* hwrm_func_dbr_pacing_qcfg_input (size:128b/16B) */
23981 
23982 typedef struct hwrm_func_dbr_pacing_qcfg_input {
23983 	/* The HWRM command request type. */
23984 	uint16_t	req_type;
23985 	/*
23986 	 * The completion ring to send the completion event on. This should
23987 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
23988 	 */
23989 	uint16_t	cmpl_ring;
23990 	/*
23991 	 * The sequence ID is used by the driver for tracking multiple
23992 	 * commands. This ID is treated as opaque data by the firmware and
23993 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
23994 	 */
23995 	uint16_t	seq_id;
23996 	/*
23997 	 * The target ID of the command:
23998 	 * * 0x0-0xFFF8 - The function ID
23999 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24000 	 * * 0xFFFD - Reserved for user-space HWRM interface
24001 	 * * 0xFFFF - HWRM
24002 	 */
24003 	uint16_t	target_id;
24004 	/*
24005 	 * A physical address pointer pointing to a host buffer that the
24006 	 * command's response data will be written. This can be either a host
24007 	 * physical address (HPA) or a guest physical address (GPA) and must
24008 	 * point to a physically contiguous block of memory.
24009 	 */
24010 	uint64_t	resp_addr;
24011 } hwrm_func_dbr_pacing_qcfg_input_t, *phwrm_func_dbr_pacing_qcfg_input_t;
24012 
24013 /* hwrm_func_dbr_pacing_qcfg_output (size:512b/64B) */
24014 
24015 typedef struct hwrm_func_dbr_pacing_qcfg_output {
24016 	/* The specific error status for the command. */
24017 	uint16_t	error_code;
24018 	/* The HWRM command request type. */
24019 	uint16_t	req_type;
24020 	/* The sequence ID from the original command. */
24021 	uint16_t	seq_id;
24022 	/* The length of the response data in number of bytes. */
24023 	uint16_t	resp_len;
24024 	uint8_t	flags;
24025 	/* When this bit is '1', it indicates DBR NQ events are enabled. */
24026 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_FLAGS_DBR_NQ_EVENT_ENABLED	UINT32_C(0x1)
24027 	uint8_t	unused_0[7];
24028 	/*
24029 	 * The Doorbell global FIFO occupancy register. This field should be
24030 	 * used by the driver and user library in the doorbell pacing
24031 	 * algorithm. Lower 2 bits indicates address space location and upper
24032 	 * 30 bits indicates upper 30bits of the register address. A value of
24033 	 * 0xFFFF-FFFF indicates this register does not exist.
24034 	 */
24035 	uint32_t	dbr_stat_db_fifo_reg;
24036 	/* Lower 2 bits indicates address space location. */
24037 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
24038 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_SFT	0
24039 	/*
24040 	 * If value is 0, this register is located in PCIe config space.
24041 	 * Drivers have to map appropriate window to access this
24042 	 * register.
24043 	 */
24044 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
24045 	/*
24046 	 * If value is 1, this register is located in GRC address space.
24047 	 * Drivers have to map appropriate window to access this
24048 	 * register.
24049 	 */
24050 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
24051 	/*
24052 	 * If value is 2, this register is located in first BAR address
24053 	 * space. Drivers have to map appropriate window to access this
24054 	 * register.
24055 	 */
24056 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
24057 	/*
24058 	 * If value is 3, this register is located in second BAR address
24059 	 * space. Drivers have to map appropriate window to access this
24060 	 * Drivers have to map appropriate window to access this
24061 	 * register.
24062 	 */
24063 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
24064 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_LAST	HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_BAR1
24065 	/* Upper 30bits of the register address. */
24066 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_MASK	UINT32_C(0xfffffffc)
24067 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SFT	2
24068 	/*
24069 	 * This field indicates the mask value for dbr_stat_db_fifo_reg
24070 	 * to get the high watermark for doorbell FIFO.
24071 	 */
24072 	uint32_t	dbr_stat_db_fifo_reg_watermark_mask;
24073 	/*
24074 	 * This field indicates the shift value for dbr_stat_db_fifo_reg
24075 	 * to get the high watermark for doorbell FIFO.
24076 	 */
24077 	uint8_t	dbr_stat_db_fifo_reg_watermark_shift;
24078 	uint8_t	unused_1[3];
24079 	/*
24080 	 * This field indicates the mask value for dbr_stat_db_fifo_reg
24081 	 * to get the amount of room left for doorbell FIFO.
24082 	 */
24083 	uint32_t	dbr_stat_db_fifo_reg_fifo_room_mask;
24084 	/*
24085 	 * This field indicates the shift value for dbr_stat_db_fifo_reg
24086 	 * to get the amount of room left for doorbell FIFO.
24087 	 */
24088 	uint8_t	dbr_stat_db_fifo_reg_fifo_room_shift;
24089 	uint8_t	unused_2[3];
24090 	/*
24091 	 * DBR_REG_AEQ_ARM register. This field should be used by the driver
24092 	 * to rearm the interrupt for regeneration of a notification to the
24093 	 * host from the hardware when the global doorbell occupancy threshold
24094 	 * is above the threshold value. Lower 2 bits indicates address space
24095 	 * location and upper 30 bits indicates upper 30bits of the register
24096 	 * address. A value of 0xFFFF-FFFF indicates this register does not
24097 	 * exist.
24098 	 */
24099 	uint32_t	dbr_throttling_aeq_arm_reg;
24100 	/* Lower 2 bits indicates address space location. */
24101 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_MASK	UINT32_C(0x3)
24102 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_SFT	0
24103 	/*
24104 	 * If value is 0, this register is located in PCIe config space.
24105 	 * Drivers have to map appropriate window to access this
24106 	 * register.
24107 	 */
24108 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
24109 	/*
24110 	 * If value is 1, this register is located in GRC address space.
24111 	 * Drivers have to map appropriate window to access this
24112 	 * register.
24113 	 */
24114 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_GRC	UINT32_C(0x1)
24115 	/*
24116 	 * If value is 2, this register is located in first BAR address
24117 	 * space. Drivers have to map appropriate window to access this
24118 	 * register.
24119 	 */
24120 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_BAR0	UINT32_C(0x2)
24121 	/*
24122 	 * If value is 3, this register is located in second BAR address
24123 	 * space. Drivers have to map appropriate window to access this
24124 	 * Drivers have to map appropriate window to access this
24125 	 * register.
24126 	 */
24127 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_BAR1	UINT32_C(0x3)
24128 		#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_LAST	HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_BAR1
24129 	/* Upper 30bits of the register address. */
24130 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_MASK	UINT32_C(0xfffffffc)
24131 	#define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SFT	2
24132 	/*
24133 	 * This field indicates the value to be written for
24134 	 * dbr_throttling_aeq_arm_reg register.
24135 	 */
24136 	uint8_t	dbr_throttling_aeq_arm_reg_val;
24137 	uint8_t	unused_3[3];
24138 	/* This field indicates the maximum depth of the doorbell FIFO. */
24139 	uint32_t	dbr_stat_db_max_fifo_depth;
24140 	/*
24141 	 * Specifies primary function's NQ ID.
24142 	 * A value of 0xFFFF FFFF indicates NQ ID is invalid.
24143 	 */
24144 	uint32_t	primary_nq_id;
24145 	/*
24146 	 * Specifies the pacing threshold value, as a percentage of the
24147 	 * max doorbell FIFO depth. The range is 1 to 100.
24148 	 */
24149 	uint32_t	pacing_threshold;
24150 	uint8_t	unused_4[7];
24151 	/*
24152 	 * This field is used in Output records to indicate that the output
24153 	 * is completely written to RAM. This field should be read as '1'
24154 	 * to indicate that the output has been completely written.
24155 	 * When writing a command completion or response to an internal
24156 	 * processor, the order of writes has to be such that this field is
24157 	 * written last.
24158 	 */
24159 	uint8_t	valid;
24160 } hwrm_func_dbr_pacing_qcfg_output_t, *phwrm_func_dbr_pacing_qcfg_output_t;
24161 
24162 /****************************************
24163  * hwrm_func_dbr_pacing_broadcast_event *
24164  ****************************************/
24165 
24166 
24167 /* hwrm_func_dbr_pacing_broadcast_event_input (size:128b/16B) */
24168 
24169 typedef struct hwrm_func_dbr_pacing_broadcast_event_input {
24170 	/* The HWRM command request type. */
24171 	uint16_t	req_type;
24172 	/*
24173 	 * The completion ring to send the completion event on. This should
24174 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
24175 	 */
24176 	uint16_t	cmpl_ring;
24177 	/*
24178 	 * The sequence ID is used by the driver for tracking multiple
24179 	 * commands. This ID is treated as opaque data by the firmware and
24180 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
24181 	 */
24182 	uint16_t	seq_id;
24183 	/*
24184 	 * The target ID of the command:
24185 	 * * 0x0-0xFFF8 - The function ID
24186 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24187 	 * * 0xFFFD - Reserved for user-space HWRM interface
24188 	 * * 0xFFFF - HWRM
24189 	 */
24190 	uint16_t	target_id;
24191 	/*
24192 	 * A physical address pointer pointing to a host buffer that the
24193 	 * command's response data will be written. This can be either a host
24194 	 * physical address (HPA) or a guest physical address (GPA) and must
24195 	 * point to a physically contiguous block of memory.
24196 	 */
24197 	uint64_t	resp_addr;
24198 } hwrm_func_dbr_pacing_broadcast_event_input_t, *phwrm_func_dbr_pacing_broadcast_event_input_t;
24199 
24200 /* hwrm_func_dbr_pacing_broadcast_event_output (size:128b/16B) */
24201 
24202 typedef struct hwrm_func_dbr_pacing_broadcast_event_output {
24203 	/* The specific error status for the command. */
24204 	uint16_t	error_code;
24205 	/* The HWRM command request type. */
24206 	uint16_t	req_type;
24207 	/* The sequence ID from the original command. */
24208 	uint16_t	seq_id;
24209 	/* The length of the response data in number of bytes. */
24210 	uint16_t	resp_len;
24211 	uint8_t	unused_0[7];
24212 	/*
24213 	 * This field is used in Output records to indicate that the output
24214 	 * is completely written to RAM. This field should be read as '1'
24215 	 * to indicate that the output has been completely written.
24216 	 * When writing a command completion or response to an internal
24217 	 * processor, the order of writes has to be such that this field is
24218 	 * written last.
24219 	 */
24220 	uint8_t	valid;
24221 } hwrm_func_dbr_pacing_broadcast_event_output_t, *phwrm_func_dbr_pacing_broadcast_event_output_t;
24222 
24223 /*************************************
24224  * hwrm_func_dbr_pacing_nqlist_query *
24225  *************************************/
24226 
24227 
24228 /* hwrm_func_dbr_pacing_nqlist_query_input (size:128b/16B) */
24229 
24230 typedef struct hwrm_func_dbr_pacing_nqlist_query_input {
24231 	/* The HWRM command request type. */
24232 	uint16_t	req_type;
24233 	/*
24234 	 * The completion ring to send the completion event on. This should
24235 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
24236 	 */
24237 	uint16_t	cmpl_ring;
24238 	/*
24239 	 * The sequence ID is used by the driver for tracking multiple
24240 	 * commands. This ID is treated as opaque data by the firmware and
24241 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
24242 	 */
24243 	uint16_t	seq_id;
24244 	/*
24245 	 * The target ID of the command:
24246 	 * * 0x0-0xFFF8 - The function ID
24247 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24248 	 * * 0xFFFD - Reserved for user-space HWRM interface
24249 	 * * 0xFFFF - HWRM
24250 	 */
24251 	uint16_t	target_id;
24252 	/*
24253 	 * A physical address pointer pointing to a host buffer that the
24254 	 * command's response data will be written. This can be either a host
24255 	 * physical address (HPA) or a guest physical address (GPA) and must
24256 	 * point to a physically contiguous block of memory.
24257 	 */
24258 	uint64_t	resp_addr;
24259 } hwrm_func_dbr_pacing_nqlist_query_input_t, *phwrm_func_dbr_pacing_nqlist_query_input_t;
24260 
24261 /* hwrm_func_dbr_pacing_nqlist_query_output (size:384b/48B) */
24262 
24263 typedef struct hwrm_func_dbr_pacing_nqlist_query_output {
24264 	/* The specific error status for the command. */
24265 	uint16_t	error_code;
24266 	/* The HWRM command request type. */
24267 	uint16_t	req_type;
24268 	/* The sequence ID from the original command. */
24269 	uint16_t	seq_id;
24270 	/* The length of the response data in number of bytes. */
24271 	uint16_t	resp_len;
24272 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24273 	uint16_t	nq_ring_id0;
24274 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24275 	uint16_t	nq_ring_id1;
24276 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24277 	uint16_t	nq_ring_id2;
24278 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24279 	uint16_t	nq_ring_id3;
24280 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24281 	uint16_t	nq_ring_id4;
24282 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24283 	uint16_t	nq_ring_id5;
24284 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24285 	uint16_t	nq_ring_id6;
24286 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24287 	uint16_t	nq_ring_id7;
24288 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24289 	uint16_t	nq_ring_id8;
24290 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24291 	uint16_t	nq_ring_id9;
24292 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24293 	uint16_t	nq_ring_id10;
24294 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24295 	uint16_t	nq_ring_id11;
24296 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24297 	uint16_t	nq_ring_id12;
24298 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24299 	uint16_t	nq_ring_id13;
24300 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24301 	uint16_t	nq_ring_id14;
24302 	/* ID of an NQ ring allocated for DBR pacing notifications. */
24303 	uint16_t	nq_ring_id15;
24304 	/* Number of consecutive NQ ring IDs populated in the response. */
24305 	uint32_t	num_nqs;
24306 	uint8_t	unused_0[3];
24307 	/*
24308 	 * This field is used in Output records to indicate that the output
24309 	 * is completely written to RAM. This field should be read as '1'
24310 	 * to indicate that the output has been completely written. When
24311 	 * writing a command completion or response to an internal processor,
24312 	 * the order of writes has to be such that this field is written last.
24313 	 */
24314 	uint8_t	valid;
24315 } hwrm_func_dbr_pacing_nqlist_query_output_t, *phwrm_func_dbr_pacing_nqlist_query_output_t;
24316 
24317 /************************************
24318  * hwrm_func_dbr_recovery_completed *
24319  ************************************/
24320 
24321 
24322 /* hwrm_func_dbr_recovery_completed_input (size:192b/24B) */
24323 
24324 typedef struct hwrm_func_dbr_recovery_completed_input {
24325 	/* The HWRM command request type. */
24326 	uint16_t	req_type;
24327 	/*
24328 	 * The completion ring to send the completion event on. This should
24329 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
24330 	 */
24331 	uint16_t	cmpl_ring;
24332 	/*
24333 	 * The sequence ID is used by the driver for tracking multiple
24334 	 * commands. This ID is treated as opaque data by the firmware and
24335 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
24336 	 */
24337 	uint16_t	seq_id;
24338 	/*
24339 	 * The target ID of the command:
24340 	 * * 0x0-0xFFF8 - The function ID
24341 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24342 	 * * 0xFFFD - Reserved for user-space HWRM interface
24343 	 * * 0xFFFF - HWRM
24344 	 */
24345 	uint16_t	target_id;
24346 	/*
24347 	 * A physical address pointer pointing to a host buffer that the
24348 	 * command's response data will be written. This can be either a host
24349 	 * physical address (HPA) or a guest physical address (GPA) and must
24350 	 * point to a physically contiguous block of memory.
24351 	 */
24352 	uint64_t	resp_addr;
24353 	/*
24354 	 * Specifies the epoch value with the one that was specified by the
24355 	 * firmware in the error_report_doorbell_drop_threshold async event
24356 	 * corresponding to the specific recovery cycle.
24357 	 */
24358 	uint32_t	epoch;
24359 	/* The epoch value. */
24360 	#define HWRM_FUNC_DBR_RECOVERY_COMPLETED_INPUT_EPOCH_VALUE_MASK UINT32_C(0xffffff)
24361 	#define HWRM_FUNC_DBR_RECOVERY_COMPLETED_INPUT_EPOCH_VALUE_SFT 0
24362 	uint8_t	unused_0[4];
24363 } hwrm_func_dbr_recovery_completed_input_t, *phwrm_func_dbr_recovery_completed_input_t;
24364 
24365 /* hwrm_func_dbr_recovery_completed_output (size:128b/16B) */
24366 
24367 typedef struct hwrm_func_dbr_recovery_completed_output {
24368 	/* The specific error status for the command. */
24369 	uint16_t	error_code;
24370 	/* The HWRM command request type. */
24371 	uint16_t	req_type;
24372 	/* The sequence ID from the original command. */
24373 	uint16_t	seq_id;
24374 	/* The length of the response data in number of bytes. */
24375 	uint16_t	resp_len;
24376 	uint8_t	unused_0[7];
24377 	/*
24378 	 * This field is used in Output records to indicate that the output
24379 	 * is completely written to RAM. This field should be read as '1'
24380 	 * to indicate that the output has been completely written.
24381 	 * When writing a command completion or response to an internal
24382 	 * processor, the order of writes has to be such that this field is
24383 	 * written last.
24384 	 */
24385 	uint8_t	valid;
24386 } hwrm_func_dbr_recovery_completed_output_t, *phwrm_func_dbr_recovery_completed_output_t;
24387 
24388 /***********************
24389  * hwrm_func_synce_cfg *
24390  ***********************/
24391 
24392 
24393 /* hwrm_func_synce_cfg_input (size:192b/24B) */
24394 
24395 typedef struct hwrm_func_synce_cfg_input {
24396 	/* The HWRM command request type. */
24397 	uint16_t	req_type;
24398 	/*
24399 	 * The completion ring to send the completion event on. This should
24400 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
24401 	 */
24402 	uint16_t	cmpl_ring;
24403 	/*
24404 	 * The sequence ID is used by the driver for tracking multiple
24405 	 * commands. This ID is treated as opaque data by the firmware and
24406 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
24407 	 */
24408 	uint16_t	seq_id;
24409 	/*
24410 	 * The target ID of the command:
24411 	 * * 0x0-0xFFF8 - The function ID
24412 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24413 	 * * 0xFFFD - Reserved for user-space HWRM interface
24414 	 * * 0xFFFF - HWRM
24415 	 */
24416 	uint16_t	target_id;
24417 	/*
24418 	 * A physical address pointer pointing to a host buffer that the
24419 	 * command's response data will be written. This can be either a host
24420 	 * physical address (HPA) or a guest physical address (GPA) and must
24421 	 * point to a physically contiguous block of memory.
24422 	 */
24423 	uint64_t	resp_addr;
24424 	uint8_t	enables;
24425 	/*
24426 	 * This bit must be '1' for the freq_profile field to be
24427 	 * configured.
24428 	 */
24429 	#define HWRM_FUNC_SYNCE_CFG_INPUT_ENABLES_FREQ_PROFILE	UINT32_C(0x1)
24430 	/*
24431 	 * This bit must be '1' for the primary_clock_state field to be
24432 	 * configured.
24433 	 */
24434 	#define HWRM_FUNC_SYNCE_CFG_INPUT_ENABLES_PRIMARY_CLOCK	UINT32_C(0x2)
24435 	/*
24436 	 * This bit must be '1' for the secondary_clock_state field to be
24437 	 * configured.
24438 	 */
24439 	#define HWRM_FUNC_SYNCE_CFG_INPUT_ENABLES_SECONDARY_CLOCK	UINT32_C(0x4)
24440 	/* Frequency profile for SyncE recovered clock. */
24441 	uint8_t	freq_profile;
24442 	/* Invalid frequency profile */
24443 	#define HWRM_FUNC_SYNCE_CFG_INPUT_FREQ_PROFILE_INVALID UINT32_C(0x0)
24444 	/* 25MHz SyncE clock profile */
24445 	#define HWRM_FUNC_SYNCE_CFG_INPUT_FREQ_PROFILE_25MHZ   UINT32_C(0x1)
24446 	#define HWRM_FUNC_SYNCE_CFG_INPUT_FREQ_PROFILE_LAST   HWRM_FUNC_SYNCE_CFG_INPUT_FREQ_PROFILE_25MHZ
24447 	/*
24448 	 * Enable or disable primary clock for PF/port, overriding previous
24449 	 * primary clock setting.
24450 	 */
24451 	uint8_t	primary_clock_state;
24452 	/* Disable clock */
24453 	#define HWRM_FUNC_SYNCE_CFG_INPUT_PRIMARY_CLOCK_STATE_DISABLE UINT32_C(0x0)
24454 	/* Enable clock */
24455 	#define HWRM_FUNC_SYNCE_CFG_INPUT_PRIMARY_CLOCK_STATE_ENABLE  UINT32_C(0x1)
24456 	#define HWRM_FUNC_SYNCE_CFG_INPUT_PRIMARY_CLOCK_STATE_LAST   HWRM_FUNC_SYNCE_CFG_INPUT_PRIMARY_CLOCK_STATE_ENABLE
24457 	/*
24458 	 * Enable or disable secondary clock for PF/port, overriding previous
24459 	 * secondary clock setting.
24460 	 */
24461 	uint8_t	secondary_clock_state;
24462 	/* Clock disabled */
24463 	#define HWRM_FUNC_SYNCE_CFG_INPUT_SECONDARY_CLOCK_STATE_DISABLE UINT32_C(0x0)
24464 	/* Clock enabled */
24465 	#define HWRM_FUNC_SYNCE_CFG_INPUT_SECONDARY_CLOCK_STATE_ENABLE  UINT32_C(0x1)
24466 	#define HWRM_FUNC_SYNCE_CFG_INPUT_SECONDARY_CLOCK_STATE_LAST   HWRM_FUNC_SYNCE_CFG_INPUT_SECONDARY_CLOCK_STATE_ENABLE
24467 	uint8_t	unused_0[4];
24468 } hwrm_func_synce_cfg_input_t, *phwrm_func_synce_cfg_input_t;
24469 
24470 /* hwrm_func_synce_cfg_output (size:128b/16B) */
24471 
24472 typedef struct hwrm_func_synce_cfg_output {
24473 	/* The specific error status for the command. */
24474 	uint16_t	error_code;
24475 	/* The HWRM command request type. */
24476 	uint16_t	req_type;
24477 	/* The sequence ID from the original command. */
24478 	uint16_t	seq_id;
24479 	/* The length of the response data in number of bytes. */
24480 	uint16_t	resp_len;
24481 	uint8_t	unused_0[7];
24482 	/*
24483 	 * This field is used in Output records to indicate that the output
24484 	 * is completely written to RAM. This field should be read as '1'
24485 	 * to indicate that the output has been completely written. When
24486 	 * writing a command completion or response to an internal processor,
24487 	 * the order of writes has to be such that this field is written last.
24488 	 */
24489 	uint8_t	valid;
24490 } hwrm_func_synce_cfg_output_t, *phwrm_func_synce_cfg_output_t;
24491 
24492 /************************
24493  * hwrm_func_synce_qcfg *
24494  ************************/
24495 
24496 
24497 /* hwrm_func_synce_qcfg_input (size:192b/24B) */
24498 
24499 typedef struct hwrm_func_synce_qcfg_input {
24500 	/* The HWRM command request type. */
24501 	uint16_t	req_type;
24502 	/*
24503 	 * The completion ring to send the completion event on. This should
24504 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
24505 	 */
24506 	uint16_t	cmpl_ring;
24507 	/*
24508 	 * The sequence ID is used by the driver for tracking multiple
24509 	 * commands. This ID is treated as opaque data by the firmware and
24510 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
24511 	 */
24512 	uint16_t	seq_id;
24513 	/*
24514 	 * The target ID of the command:
24515 	 * * 0x0-0xFFF8 - The function ID
24516 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24517 	 * * 0xFFFD - Reserved for user-space HWRM interface
24518 	 * * 0xFFFF - HWRM
24519 	 */
24520 	uint16_t	target_id;
24521 	/*
24522 	 * A physical address pointer pointing to a host buffer that the
24523 	 * command's response data will be written. This can be either a host
24524 	 * physical address (HPA) or a guest physical address (GPA) and must
24525 	 * point to a physically contiguous block of memory.
24526 	 */
24527 	uint64_t	resp_addr;
24528 	uint8_t	unused_0[8];
24529 } hwrm_func_synce_qcfg_input_t, *phwrm_func_synce_qcfg_input_t;
24530 
24531 /* hwrm_func_synce_qcfg_output (size:128b/16B) */
24532 
24533 typedef struct hwrm_func_synce_qcfg_output {
24534 	/* The specific error status for the command. */
24535 	uint16_t	error_code;
24536 	/* The HWRM command request type. */
24537 	uint16_t	req_type;
24538 	/* The sequence ID from the original command. */
24539 	uint16_t	seq_id;
24540 	/* The length of the response data in number of bytes. */
24541 	uint16_t	resp_len;
24542 	/* Frequency profile for SyncE recovered clock. */
24543 	uint8_t	freq_profile;
24544 	/* Invalid frequency profile */
24545 	#define HWRM_FUNC_SYNCE_QCFG_OUTPUT_FREQ_PROFILE_INVALID UINT32_C(0x0)
24546 	/* 25MHz SyncE clock profile */
24547 	#define HWRM_FUNC_SYNCE_QCFG_OUTPUT_FREQ_PROFILE_25MHZ   UINT32_C(0x1)
24548 	#define HWRM_FUNC_SYNCE_QCFG_OUTPUT_FREQ_PROFILE_LAST   HWRM_FUNC_SYNCE_QCFG_OUTPUT_FREQ_PROFILE_25MHZ
24549 	/* SyncE recovered clock state */
24550 	uint8_t	state;
24551 	/*
24552 	 * When this bit is '1', primary clock is enabled for this PF/port.
24553 	 * When this bit is '0', primary clock is disabled for this PF/port.
24554 	 */
24555 	#define HWRM_FUNC_SYNCE_QCFG_OUTPUT_STATE_PRIMARY_CLOCK_ENABLED	UINT32_C(0x1)
24556 	/*
24557 	 * When this bit is '1', secondary clock is enabled for this
24558 	 * PF/port.
24559 	 * When this bit is '0', secondary clock is disabled for this
24560 	 * PF/port.
24561 	 */
24562 	#define HWRM_FUNC_SYNCE_QCFG_OUTPUT_STATE_SECONDARY_CLOCK_ENABLED	UINT32_C(0x2)
24563 	uint8_t	unused_0[5];
24564 	/*
24565 	 * This field is used in Output records to indicate that the output
24566 	 * is completely written to RAM. This field should be read as '1'
24567 	 * to indicate that the output has been completely written. When
24568 	 * writing a command completion or response to an internal processor,
24569 	 * the order of writes has to be such that this field is written last.
24570 	 */
24571 	uint8_t	valid;
24572 } hwrm_func_synce_qcfg_output_t, *phwrm_func_synce_qcfg_output_t;
24573 
24574 /************************
24575  * hwrm_func_lag_create *
24576  ************************/
24577 
24578 
24579 /* hwrm_func_lag_create_input (size:192b/24B) */
24580 
24581 typedef struct hwrm_func_lag_create_input {
24582 	/* The HWRM command request type. */
24583 	uint16_t	req_type;
24584 	/*
24585 	 * The completion ring to send the completion event on. This should
24586 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
24587 	 */
24588 	uint16_t	cmpl_ring;
24589 	/*
24590 	 * The sequence ID is used by the driver for tracking multiple
24591 	 * commands. This ID is treated as opaque data by the firmware and
24592 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
24593 	 */
24594 	uint16_t	seq_id;
24595 	/*
24596 	 * The target ID of the command:
24597 	 * * 0x0-0xFFF8 - The function ID
24598 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24599 	 * * 0xFFFD - Reserved for user-space HWRM interface
24600 	 * * 0xFFFF - HWRM
24601 	 */
24602 	uint16_t	target_id;
24603 	/*
24604 	 * A physical address pointer pointing to a host buffer that the
24605 	 * command's response data will be written. This can be either a host
24606 	 * physical address (HPA) or a guest physical address (GPA) and must
24607 	 * point to a physically contiguous block of memory.
24608 	 */
24609 	uint64_t	resp_addr;
24610 	uint8_t	enables;
24611 	/*
24612 	 * This bit must be '1' for the active_port_map field to be
24613 	 * configured.
24614 	 */
24615 	#define HWRM_FUNC_LAG_CREATE_INPUT_ENABLES_ACTIVE_PORT_MAP	UINT32_C(0x1)
24616 	/*
24617 	 * This bit must be '1' for the member_port_map field to be
24618 	 * configured.
24619 	 */
24620 	#define HWRM_FUNC_LAG_CREATE_INPUT_ENABLES_MEMBER_PORT_MAP	UINT32_C(0x2)
24621 	/* This bit must be '1' for the aggr_mode field to be configured. */
24622 	#define HWRM_FUNC_LAG_CREATE_INPUT_ENABLES_AGGR_MODE	UINT32_C(0x4)
24623 	/* rsvd1 is 5 b */
24624 	#define HWRM_FUNC_LAG_CREATE_INPUT_ENABLES_RSVD1_MASK	UINT32_C(0xf8)
24625 	#define HWRM_FUNC_LAG_CREATE_INPUT_ENABLES_RSVD1_SFT	3
24626 	/*
24627 	 * This is the bitmap of all active ports in the LAG. Each bit
24628 	 * represents a front panel port of the device. Ports are numbered
24629 	 * from 0 to n - 1 on a device with n ports. The number of front panel
24630 	 * ports is specified in the port_cnt field of the HWRM_PORT_PHY_QCAPS
24631 	 * response. The active_port_map must always be a subset of the
24632 	 * member_port_map. An active port is eligible to send and receive
24633 	 * traffic.
24634 	 *
24635 	 * If the LAG mode is active-backup, only one port can be an active
24636 	 * port at a given time. All other ports in the member_port_map that
24637 	 * are not the active port are backup port. When the active port
24638 	 * fails, another member port takes over to become the active port.
24639 	 * The driver should use HWRM_FUNC_LAG_UPDATE to update
24640 	 * the active_port_map by only setting the port bit of the new active
24641 	 * port.
24642 	 *
24643 	 * In active-active, balance_xor or 802_3_ad mode, all member ports
24644 	 * can be active ports. If the driver determines that an active
24645 	 * port is down or unable to function, it should use
24646 	 * HWRM_FUNC_LAG_UPDATE to update the active_port_map by clearing
24647 	 * the port bit that has failed.
24648 	 */
24649 	uint8_t	active_port_map;
24650 	/* If this bit is set to '1', the port0 is a lag active port. */
24651 	#define HWRM_FUNC_LAG_CREATE_INPUT_ACTIVE_PORT_MAP_PORT_0	UINT32_C(0x1)
24652 	/* If this bit is set to '1', the port1 is a lag active port. */
24653 	#define HWRM_FUNC_LAG_CREATE_INPUT_ACTIVE_PORT_MAP_PORT_1	UINT32_C(0x2)
24654 	/* If this bit is set to '1', the port2 is a lag active port. */
24655 	#define HWRM_FUNC_LAG_CREATE_INPUT_ACTIVE_PORT_MAP_PORT_2	UINT32_C(0x4)
24656 	/* If this bit is set to '1', the port3 is a lag active port. */
24657 	#define HWRM_FUNC_LAG_CREATE_INPUT_ACTIVE_PORT_MAP_PORT_3	UINT32_C(0x8)
24658 	/* rsvd3 is 4 b */
24659 	#define HWRM_FUNC_LAG_CREATE_INPUT_ACTIVE_PORT_MAP_RSVD3_MASK UINT32_C(0xf0)
24660 	#define HWRM_FUNC_LAG_CREATE_INPUT_ACTIVE_PORT_MAP_RSVD3_SFT  4
24661 	/*
24662 	 * This is the bitmap of all member ports in the LAG. Each bit
24663 	 * represents a front panel port of the device. Ports are numbered
24664 	 * from 0 to n - 1 on a device with n ports. The number of front panel
24665 	 * ports is specified in the port_cnt field of the HWRM_PORT_PHY_QCAPS
24666 	 * response. There must be at least 2 ports in the member ports and
24667 	 * each must not be a member of another LAG. Note that on a 4-port
24668 	 * device, there can be either 2 ports or 4 ports in the member ports.
24669 	 * Using 3 member ports is not supported.
24670 	 */
24671 	uint8_t	member_port_map;
24672 	/* If this bit is set to '1', the port0 is a lag member port. */
24673 	#define HWRM_FUNC_LAG_CREATE_INPUT_MEMBER_PORT_MAP_PORT_0	UINT32_C(0x1)
24674 	/* If this bit is set to '1', the port1 is a lag member port. */
24675 	#define HWRM_FUNC_LAG_CREATE_INPUT_MEMBER_PORT_MAP_PORT_1	UINT32_C(0x2)
24676 	/* If this bit is set to '1', the port2 is a lag member port. */
24677 	#define HWRM_FUNC_LAG_CREATE_INPUT_MEMBER_PORT_MAP_PORT_2	UINT32_C(0x4)
24678 	/* If this bit is set to '1', the port3 is a lag member port. */
24679 	#define HWRM_FUNC_LAG_CREATE_INPUT_MEMBER_PORT_MAP_PORT_3	UINT32_C(0x8)
24680 	/* rsvd4 is 4 b */
24681 	#define HWRM_FUNC_LAG_CREATE_INPUT_MEMBER_PORT_MAP_RSVD4_MASK UINT32_C(0xf0)
24682 	#define HWRM_FUNC_LAG_CREATE_INPUT_MEMBER_PORT_MAP_RSVD4_SFT  4
24683 	/* Link aggregation mode being used. */
24684 	uint8_t	link_aggr_mode;
24685 	/* active active mode. */
24686 	#define HWRM_FUNC_LAG_CREATE_INPUT_AGGR_MODE_ACTIVE_ACTIVE UINT32_C(0x1)
24687 	/* active backup mode. */
24688 	#define HWRM_FUNC_LAG_CREATE_INPUT_AGGR_MODE_ACTIVE_BACKUP UINT32_C(0x2)
24689 	/* Balance XOR mode. */
24690 	#define HWRM_FUNC_LAG_CREATE_INPUT_AGGR_MODE_BALANCE_XOR   UINT32_C(0x3)
24691 	/* 802.3AD mode. */
24692 	#define HWRM_FUNC_LAG_CREATE_INPUT_AGGR_MODE_802_3_AD	UINT32_C(0x4)
24693 	#define HWRM_FUNC_LAG_CREATE_INPUT_AGGR_MODE_LAST	HWRM_FUNC_LAG_CREATE_INPUT_AGGR_MODE_802_3_AD
24694 	uint8_t	unused_0[4];
24695 } hwrm_func_lag_create_input_t, *phwrm_func_lag_create_input_t;
24696 
24697 /* hwrm_func_lag_create_output (size:128b/16B) */
24698 
24699 typedef struct hwrm_func_lag_create_output {
24700 	/* The specific error status for the command. */
24701 	uint16_t	error_code;
24702 	/* The HWRM command request type. */
24703 	uint16_t	req_type;
24704 	/* The sequence ID from the original command. */
24705 	uint16_t	seq_id;
24706 	/* The length of the response data in number of bytes. */
24707 	uint16_t	resp_len;
24708 	/*
24709 	 * LAG ID of the created LAG. This LAG ID will also be returned
24710 	 * in the HWRM_FUNC_QCFG response of all member ports.
24711 	 */
24712 	uint8_t	fw_lag_id;
24713 	uint8_t	unused_0[6];
24714 	/*
24715 	 * This field is used in Output records to indicate that the output
24716 	 * is completely written to RAM. This field should be read as '1'
24717 	 * to indicate that the output has been completely written. When
24718 	 * writing a command completion or response to an internal processor,
24719 	 * the order of writes has to be such that this field is written last.
24720 	 */
24721 	uint8_t	valid;
24722 } hwrm_func_lag_create_output_t, *phwrm_func_lag_create_output_t;
24723 
24724 /************************
24725  * hwrm_func_lag_update *
24726  ************************/
24727 
24728 
24729 /* hwrm_func_lag_update_input (size:192b/24B) */
24730 
24731 typedef struct hwrm_func_lag_update_input {
24732 	/* The HWRM command request type. */
24733 	uint16_t	req_type;
24734 	/*
24735 	 * The completion ring to send the completion event on. This should
24736 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
24737 	 */
24738 	uint16_t	cmpl_ring;
24739 	/*
24740 	 * The sequence ID is used by the driver for tracking multiple
24741 	 * commands. This ID is treated as opaque data by the firmware and
24742 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
24743 	 */
24744 	uint16_t	seq_id;
24745 	/*
24746 	 * The target ID of the command:
24747 	 * * 0x0-0xFFF8 - The function ID
24748 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24749 	 * * 0xFFFD - Reserved for user-space HWRM interface
24750 	 * * 0xFFFF - HWRM
24751 	 */
24752 	uint16_t	target_id;
24753 	/*
24754 	 * A physical address pointer pointing to a host buffer that the
24755 	 * command's response data will be written. This can be either a host
24756 	 * physical address (HPA) or a guest physical address (GPA) and must
24757 	 * point to a physically contiguous block of memory.
24758 	 */
24759 	uint64_t	resp_addr;
24760 	/* Link aggregation group ID of the LAG to be updated. */
24761 	uint8_t	fw_lag_id;
24762 	uint8_t	enables;
24763 	/*
24764 	 * This bit must be '1' for the active_port_map field to be
24765 	 * updated.
24766 	 */
24767 	#define HWRM_FUNC_LAG_UPDATE_INPUT_ENABLES_ACTIVE_PORT_MAP	UINT32_C(0x1)
24768 	/*
24769 	 * This bit must be '1' for the member_port_map field to be
24770 	 * updated.
24771 	 */
24772 	#define HWRM_FUNC_LAG_UPDATE_INPUT_ENABLES_MEMBER_PORT_MAP	UINT32_C(0x2)
24773 	/* This bit must be '1' for the aggr_mode field to be updated. */
24774 	#define HWRM_FUNC_LAG_UPDATE_INPUT_ENABLES_AGGR_MODE	UINT32_C(0x4)
24775 	/* rsvd1 is 5 b */
24776 	#define HWRM_FUNC_LAG_UPDATE_INPUT_ENABLES_RSVD1_MASK	UINT32_C(0xf8)
24777 	#define HWRM_FUNC_LAG_UPDATE_INPUT_ENABLES_RSVD1_SFT	3
24778 	/*
24779 	 * This is the bitmap of all active ports in the LAG. Each bit
24780 	 * represents a front panel port of the device. Ports are numbered
24781 	 * from 0 to n - 1 on a device with n ports. The number of front panel
24782 	 * ports is specified in the port_cnt field of the HWRM_PORT_PHY_QCAPS
24783 	 * response. The active_port_map must always be a subset of the
24784 	 * member_port_map. An active port is eligible to send and receive
24785 	 * traffic.
24786 	 *
24787 	 * If the LAG mode is active-backup, only one port can be an active
24788 	 * port at a given time. All other ports in the member_port_map that
24789 	 * are not the active port are backup port. When the active port
24790 	 * fails, another member port takes over to become the active port.
24791 	 * The driver should use HWRM_FUNC_LAG_UPDATE to update
24792 	 * the active_port_map by only setting the port bit of the new active
24793 	 * port.
24794 	 *
24795 	 * In active-active, balance_xor or 802_3_ad mode, all member ports
24796 	 * can be active ports. If the driver determines that an active
24797 	 * port is down or unable to function, it should use
24798 	 * HWRM_FUNC_LAG_UPDATE to update the active_port_map by clearing
24799 	 * the port bit that has failed.
24800 	 */
24801 	uint8_t	active_port_map;
24802 	/* If this bit is set to '1', the port0 is a lag active port. */
24803 	#define HWRM_FUNC_LAG_UPDATE_INPUT_ACTIVE_PORT_MAP_PORT_0	UINT32_C(0x1)
24804 	/* If this bit is set to '1', the port1 is a lag active port. */
24805 	#define HWRM_FUNC_LAG_UPDATE_INPUT_ACTIVE_PORT_MAP_PORT_1	UINT32_C(0x2)
24806 	/* If this bit is set to '1', the port2 is a lag active port. */
24807 	#define HWRM_FUNC_LAG_UPDATE_INPUT_ACTIVE_PORT_MAP_PORT_2	UINT32_C(0x4)
24808 	/* If this bit is set to '1', the port3 is a lag active port. */
24809 	#define HWRM_FUNC_LAG_UPDATE_INPUT_ACTIVE_PORT_MAP_PORT_3	UINT32_C(0x8)
24810 	/* rsvd3 is 4 b */
24811 	#define HWRM_FUNC_LAG_UPDATE_INPUT_ACTIVE_PORT_MAP_RSVD3_MASK UINT32_C(0xf0)
24812 	#define HWRM_FUNC_LAG_UPDATE_INPUT_ACTIVE_PORT_MAP_RSVD3_SFT  4
24813 	/*
24814 	 * This is the bitmap of all member ports in the LAG. Each bit
24815 	 * represents a front panel port of the device. Ports are numbered
24816 	 * from 0 to n - 1 on a device with n ports. The number of front panel
24817 	 * ports is specified in the port_cnt field of the HWRM_PORT_PHY_QCAPS
24818 	 * response. There must be at least 2 ports in the member ports and
24819 	 * each must not be a member of another LAG. Note that on a 4-port
24820 	 * device, there can be either 2 ports or 4 ports in the member ports.
24821 	 * Using 3 member ports is not supported.
24822 	 */
24823 	uint8_t	member_port_map;
24824 	/* If this bit is set to '1', the port0 is a lag member port. */
24825 	#define HWRM_FUNC_LAG_UPDATE_INPUT_MEMBER_PORT_MAP_PORT_0	UINT32_C(0x1)
24826 	/* If this bit is set to '1', the port1 is a lag member port. */
24827 	#define HWRM_FUNC_LAG_UPDATE_INPUT_MEMBER_PORT_MAP_PORT_1	UINT32_C(0x2)
24828 	/* If this bit is set to '1', the port2 is a lag member port. */
24829 	#define HWRM_FUNC_LAG_UPDATE_INPUT_MEMBER_PORT_MAP_PORT_2	UINT32_C(0x4)
24830 	/* If this bit is set to '1', the port3 is a lag member port. */
24831 	#define HWRM_FUNC_LAG_UPDATE_INPUT_MEMBER_PORT_MAP_PORT_3	UINT32_C(0x8)
24832 	/* rsvd4 is 4 b */
24833 	#define HWRM_FUNC_LAG_UPDATE_INPUT_MEMBER_PORT_MAP_RSVD4_MASK UINT32_C(0xf0)
24834 	#define HWRM_FUNC_LAG_UPDATE_INPUT_MEMBER_PORT_MAP_RSVD4_SFT  4
24835 	/* Link aggregation mode being used. */
24836 	uint8_t	link_aggr_mode;
24837 	/* active active mode. */
24838 	#define HWRM_FUNC_LAG_UPDATE_INPUT_AGGR_MODE_ACTIVE_ACTIVE UINT32_C(0x1)
24839 	/* active backup mode. */
24840 	#define HWRM_FUNC_LAG_UPDATE_INPUT_AGGR_MODE_ACTIVE_BACKUP UINT32_C(0x2)
24841 	/* Balance XOR mode. */
24842 	#define HWRM_FUNC_LAG_UPDATE_INPUT_AGGR_MODE_BALANCE_XOR   UINT32_C(0x3)
24843 	/* 802.3AD mode. */
24844 	#define HWRM_FUNC_LAG_UPDATE_INPUT_AGGR_MODE_802_3_AD	UINT32_C(0x4)
24845 	#define HWRM_FUNC_LAG_UPDATE_INPUT_AGGR_MODE_LAST	HWRM_FUNC_LAG_UPDATE_INPUT_AGGR_MODE_802_3_AD
24846 	uint8_t	unused_0[3];
24847 } hwrm_func_lag_update_input_t, *phwrm_func_lag_update_input_t;
24848 
24849 /* hwrm_func_lag_update_output (size:128b/16B) */
24850 
24851 typedef struct hwrm_func_lag_update_output {
24852 	/* The specific error status for the command. */
24853 	uint16_t	error_code;
24854 	/* The HWRM command request type. */
24855 	uint16_t	req_type;
24856 	/* The sequence ID from the original command. */
24857 	uint16_t	seq_id;
24858 	/* The length of the response data in number of bytes. */
24859 	uint16_t	resp_len;
24860 	uint8_t	unused_0[7];
24861 	/*
24862 	 * This field is used in Output records to indicate that the output
24863 	 * is completely written to RAM. This field should be read as '1'
24864 	 * to indicate that the output has been completely written. When
24865 	 * writing a command completion or response to an internal processor,
24866 	 * the order of writes has to be such that this field is written last.
24867 	 */
24868 	uint8_t	valid;
24869 } hwrm_func_lag_update_output_t, *phwrm_func_lag_update_output_t;
24870 
24871 /**********************
24872  * hwrm_func_lag_free *
24873  **********************/
24874 
24875 
24876 /* hwrm_func_lag_free_input (size:192b/24B) */
24877 
24878 typedef struct hwrm_func_lag_free_input {
24879 	/* The HWRM command request type. */
24880 	uint16_t	req_type;
24881 	/*
24882 	 * The completion ring to send the completion event on. This should
24883 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
24884 	 */
24885 	uint16_t	cmpl_ring;
24886 	/*
24887 	 * The sequence ID is used by the driver for tracking multiple
24888 	 * commands. This ID is treated as opaque data by the firmware and
24889 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
24890 	 */
24891 	uint16_t	seq_id;
24892 	/*
24893 	 * The target ID of the command:
24894 	 * * 0x0-0xFFF8 - The function ID
24895 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24896 	 * * 0xFFFD - Reserved for user-space HWRM interface
24897 	 * * 0xFFFF - HWRM
24898 	 */
24899 	uint16_t	target_id;
24900 	/*
24901 	 * A physical address pointer pointing to a host buffer that the
24902 	 * command's response data will be written. This can be either a host
24903 	 * physical address (HPA) or a guest physical address (GPA) and must
24904 	 * point to a physically contiguous block of memory.
24905 	 */
24906 	uint64_t	resp_addr;
24907 	/* Link aggregation group ID of the LAG to be freed. */
24908 	uint8_t	fw_lag_id;
24909 	uint8_t	unused_0[7];
24910 } hwrm_func_lag_free_input_t, *phwrm_func_lag_free_input_t;
24911 
24912 /* hwrm_func_lag_free_output (size:128b/16B) */
24913 
24914 typedef struct hwrm_func_lag_free_output {
24915 	/* The specific error status for the command. */
24916 	uint16_t	error_code;
24917 	/* The HWRM command request type. */
24918 	uint16_t	req_type;
24919 	/* The sequence ID from the original command. */
24920 	uint16_t	seq_id;
24921 	/* The length of the response data in number of bytes. */
24922 	uint16_t	resp_len;
24923 	uint8_t	unused_0[7];
24924 	/*
24925 	 * This field is used in Output records to indicate that the output
24926 	 * is completely written to RAM. This field should be read as '1'
24927 	 * to indicate that the output has been completely written. When
24928 	 * writing a command completion or response to an internal processor,
24929 	 * the order of writes has to be such that this field is written last.
24930 	 */
24931 	uint8_t	valid;
24932 } hwrm_func_lag_free_output_t, *phwrm_func_lag_free_output_t;
24933 
24934 /**********************
24935  * hwrm_func_lag_qcfg *
24936  **********************/
24937 
24938 
24939 /* hwrm_func_lag_qcfg_input (size:192b/24B) */
24940 
24941 typedef struct hwrm_func_lag_qcfg_input {
24942 	/* The HWRM command request type. */
24943 	uint16_t	req_type;
24944 	/*
24945 	 * The completion ring to send the completion event on. This should
24946 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
24947 	 */
24948 	uint16_t	cmpl_ring;
24949 	/*
24950 	 * The sequence ID is used by the driver for tracking multiple
24951 	 * commands. This ID is treated as opaque data by the firmware and
24952 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
24953 	 */
24954 	uint16_t	seq_id;
24955 	/*
24956 	 * The target ID of the command:
24957 	 * * 0x0-0xFFF8 - The function ID
24958 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24959 	 * * 0xFFFD - Reserved for user-space HWRM interface
24960 	 * * 0xFFFF - HWRM
24961 	 */
24962 	uint16_t	target_id;
24963 	/*
24964 	 * A physical address pointer pointing to a host buffer that the
24965 	 * command's response data will be written. This can be either a host
24966 	 * physical address (HPA) or a guest physical address (GPA) and must
24967 	 * point to a physically contiguous block of memory.
24968 	 */
24969 	uint64_t	resp_addr;
24970 	/* Link aggregation group ID of the LAG to be queried. */
24971 	uint8_t	fw_lag_id;
24972 	uint8_t	unused_0[7];
24973 } hwrm_func_lag_qcfg_input_t, *phwrm_func_lag_qcfg_input_t;
24974 
24975 /* hwrm_func_lag_qcfg_output (size:128b/16B) */
24976 
24977 typedef struct hwrm_func_lag_qcfg_output {
24978 	/* The specific error status for the command. */
24979 	uint16_t	error_code;
24980 	/* The HWRM command request type. */
24981 	uint16_t	req_type;
24982 	/* The sequence ID from the original command. */
24983 	uint16_t	seq_id;
24984 	/* The length of the response data in number of bytes. */
24985 	uint16_t	resp_len;
24986 	/*
24987 	 * This is the bitmap of all active ports in the LAG. Each bit
24988 	 * represents a front panel port of the device. Ports are numbered
24989 	 * from 0 to n - 1 on a device with n ports. The number of front panel
24990 	 * ports is specified in the port_cnt field of the HWRM_PORT_PHY_QCAPS
24991 	 * response. The active_port_map must always be a subset of the
24992 	 * member_port_map. An active port is eligible to send and receive
24993 	 * traffic.
24994 	 *
24995 	 * If the LAG mode is active-backup, only one port can be an active
24996 	 * port at a given time. All other ports in the member_port_map that
24997 	 * are not the active port are backup port. When the active port
24998 	 * fails, another member port takes over to become the active port.
24999 	 * The driver should use HWRM_FUNC_LAG_UPDATE to update
25000 	 * the active_port_map by only setting the port bit of the new active
25001 	 * port.
25002 	 *
25003 	 * In active-active, balance_xor or 802_3_ad mode, all member ports
25004 	 * can be active ports. If the driver determines that an active
25005 	 * port is down or unable to function, it should use
25006 	 * HWRM_FUNC_LAG_UPDATE to update the active_port_map by clearing
25007 	 * the port bit that has failed.
25008 	 */
25009 	uint8_t	active_port_map;
25010 	/* If this bit is set to '1', the port0 is a lag active port. */
25011 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_ACTIVE_PORT_MAP_PORT_0	UINT32_C(0x1)
25012 	/* If this bit is set to '1', the port1 is a lag active port. */
25013 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_ACTIVE_PORT_MAP_PORT_1	UINT32_C(0x2)
25014 	/* If this bit is set to '1', the port2 is a lag active port. */
25015 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_ACTIVE_PORT_MAP_PORT_2	UINT32_C(0x4)
25016 	/* If this bit is set to '1', the port3 is a lag active port. */
25017 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_ACTIVE_PORT_MAP_PORT_3	UINT32_C(0x8)
25018 	/* rsvd3 is 4 b */
25019 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_ACTIVE_PORT_MAP_RSVD3_MASK UINT32_C(0xf0)
25020 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_ACTIVE_PORT_MAP_RSVD3_SFT  4
25021 	/*
25022 	 * This is the bitmap of all member ports in the LAG. Each bit
25023 	 * represents a front panel port of the device. Ports are numbered
25024 	 * from 0 to n - 1 on a device with n ports. The number of front panel
25025 	 * ports is specified in the port_cnt field of the HWRM_PORT_PHY_QCAPS
25026 	 * response. There must be at least 2 ports in the member ports and
25027 	 * each must not be a member of another LAG. Note that on a 4-port
25028 	 * device, there can be either 2 ports or 4 ports in the member ports.
25029 	 * Using 3 member ports is not supported.
25030 	 */
25031 	uint8_t	member_port_map;
25032 	/* If this bit is set to '1', the port0 is a lag member port. */
25033 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_MEMBER_PORT_MAP_PORT_0	UINT32_C(0x1)
25034 	/* If this bit is set to '1', the port1 is a lag member port. */
25035 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_MEMBER_PORT_MAP_PORT_1	UINT32_C(0x2)
25036 	/* If this bit is set to '1', the port2 is a lag member port. */
25037 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_MEMBER_PORT_MAP_PORT_2	UINT32_C(0x4)
25038 	/* If this bit is set to '1', the port3 is a lag member port. */
25039 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_MEMBER_PORT_MAP_PORT_3	UINT32_C(0x8)
25040 	/* rsvd4 is 4 b */
25041 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_MEMBER_PORT_MAP_RSVD4_MASK UINT32_C(0xf0)
25042 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_MEMBER_PORT_MAP_RSVD4_SFT  4
25043 	/* Link aggregation mode being used. */
25044 	uint8_t	link_aggr_mode;
25045 	/* active active mode. */
25046 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_AGGR_MODE_ACTIVE_ACTIVE UINT32_C(0x1)
25047 	/* active backup mode. */
25048 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_AGGR_MODE_ACTIVE_BACKUP UINT32_C(0x2)
25049 	/* Balance XOR mode. */
25050 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_AGGR_MODE_BALANCE_XOR   UINT32_C(0x3)
25051 	/* 802.3AD mode. */
25052 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_AGGR_MODE_802_3_AD	UINT32_C(0x4)
25053 	#define HWRM_FUNC_LAG_QCFG_OUTPUT_AGGR_MODE_LAST	HWRM_FUNC_LAG_QCFG_OUTPUT_AGGR_MODE_802_3_AD
25054 	uint8_t	unused_0[4];
25055 	/*
25056 	 * This field is used in Output records to indicate that the output
25057 	 * is completely written to RAM. This field should be read as '1'
25058 	 * to indicate that the output has been completely written. When
25059 	 * writing a command completion or response to an internal processor,
25060 	 * the order of writes has to be such that this field is written last.
25061 	 */
25062 	uint8_t	valid;
25063 } hwrm_func_lag_qcfg_output_t, *phwrm_func_lag_qcfg_output_t;
25064 
25065 /**************************
25066  * hwrm_func_lag_mode_cfg *
25067  **************************/
25068 
25069 
25070 /* hwrm_func_lag_mode_cfg_input (size:192b/24B) */
25071 
25072 typedef struct hwrm_func_lag_mode_cfg_input {
25073 	/* The HWRM command request type. */
25074 	uint16_t	req_type;
25075 	/*
25076 	 * The completion ring to send the completion event on. This should
25077 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
25078 	 */
25079 	uint16_t	cmpl_ring;
25080 	/*
25081 	 * The sequence ID is used by the driver for tracking multiple
25082 	 * commands. This ID is treated as opaque data by the firmware and
25083 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
25084 	 */
25085 	uint16_t	seq_id;
25086 	/*
25087 	 * The target ID of the command:
25088 	 * * 0x0-0xFFF8 - The function ID
25089 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25090 	 * * 0xFFFD - Reserved for user-space HWRM interface
25091 	 * * 0xFFFF - HWRM
25092 	 */
25093 	uint16_t	target_id;
25094 	/*
25095 	 * A physical address pointer pointing to a host buffer that the
25096 	 * command's response data will be written. This can be either a host
25097 	 * physical address (HPA) or a guest physical address (GPA) and must
25098 	 * point to a physically contiguous block of memory.
25099 	 */
25100 	uint64_t	resp_addr;
25101 	uint8_t	enables;
25102 	/*
25103 	 * This bit must be '1' for the link aggregation enable or
25104 	 * disable flags to be configured.
25105 	 */
25106 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ENABLES_FLAGS		UINT32_C(0x1)
25107 	/*
25108 	 * This bit must be '1' for the active_port_map field to be
25109 	 * configured.
25110 	 */
25111 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ENABLES_ACTIVE_PORT_MAP	UINT32_C(0x2)
25112 	/*
25113 	 * This bit must be '1' for the member_port_map field to be
25114 	 * configured.
25115 	 */
25116 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ENABLES_MEMBER_PORT_MAP	UINT32_C(0x4)
25117 	/* This bit must be '1' for the aggr_mode field to be configured. */
25118 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ENABLES_AGGR_MODE	UINT32_C(0x8)
25119 	/* This bit must be '1' for the lag id field to be configured. */
25120 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ENABLES_LAG_ID		UINT32_C(0x10)
25121 	/* rsvd1 is 3 b */
25122 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ENABLES_RSVD1_MASK	UINT32_C(0xe0)
25123 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ENABLES_RSVD1_SFT	5
25124 	uint8_t	flags;
25125 	/*
25126 	 * If this bit is set to 1, the driver is requesting FW to disable
25127 	 * link aggregation feature during run time.
25128 	 */
25129 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_FLAGS_AGGR_DISABLE	UINT32_C(0x1)
25130 	/*
25131 	 * If this bit is set to 1, the driver is requesting FW to enable
25132 	 * link aggregation feature during run time.
25133 	 */
25134 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_FLAGS_AGGR_ENABLE	UINT32_C(0x2)
25135 	/* rsvd2 is 6 b */
25136 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_FLAGS_RSVD2_MASK	UINT32_C(0xfc)
25137 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_FLAGS_RSVD2_SFT	2
25138 	/*
25139 	 * This is the bitmap of all active ports in the LAG. Each bit
25140 	 * represents a front panel port of the device starting from port 0.
25141 	 * The number of front panel ports is specified in the port_cnt field
25142 	 * of the HWRM_PORT_PHY_QCAPS response.
25143 	 * The term "active port" is one of member ports which is eligible to
25144 	 * send or receive the traffic.
25145 	 * In the active-backup mode, only one member port is active port at
25146 	 * any given time. If the active port fails, another member port
25147 	 * automatically takes over the active role to ensure continuous
25148 	 * network connectivity.
25149 	 * In the active-active, balance_xor or 802_3_ad mode, all member ports
25150 	 * could be active port, if link status on one port is down, driver
25151 	 * needs to send the NIC a new active-port bitmap with marking this
25152 	 * port as not active port.
25153 	 * The PORT_2 and PORT_3 are only valid if the NIC has four front
25154 	 * panel ports.
25155 	 */
25156 	uint8_t	active_port_map;
25157 	/* If this bit is set to '1', the port0 is a lag active port. */
25158 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ACTIVE_PORT_MAP_PORT_0	UINT32_C(0x1)
25159 	/* If this bit is set to '1', the port1 is a lag active port. */
25160 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ACTIVE_PORT_MAP_PORT_1	UINT32_C(0x2)
25161 	/* If this bit is set to '1', the port2 is a lag active port. */
25162 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ACTIVE_PORT_MAP_PORT_2	UINT32_C(0x4)
25163 	/* If this bit is set to '1', the port3 is a lag active port. */
25164 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ACTIVE_PORT_MAP_PORT_3	UINT32_C(0x8)
25165 	/* rsvd3 is 4 b */
25166 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ACTIVE_PORT_MAP_RSVD3_MASK UINT32_C(0xf0)
25167 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_ACTIVE_PORT_MAP_RSVD3_SFT  4
25168 	/*
25169 	 * This is the bitmap of all member ports in the LAG. Each bit
25170 	 * represents a front panel port of the device starting from port 0.
25171 	 * The number of front panel ports is specified in the port_cnt field
25172 	 * of the HWRM_PORT_PHY_QCAPS response.
25173 	 * The term "member port" refers to a front panel port that is added to
25174 	 * the bond group as a slave device. These member ports are combined to
25175 	 * create a logical bond interface.
25176 	 * For a 4-port NIC, the LAG member port combination can consist of
25177 	 * either two ports or four ports. However, it is important to note
25178 	 * that the case with three ports in the same lag group is not
25179 	 * supported.
25180 	 * The PORT_2 and PORT_3 are only valid if the NIC has four front
25181 	 * panel ports. There could be a case to use multiple LAG groups,
25182 	 * for example, if the NIC has four front panel ports, the lag feature
25183 	 * can use up to two LAG groups, with two ports assigned to each group.
25184 	 */
25185 	uint8_t	member_port_map;
25186 	/* If this bit is set to '1', the port0 is a lag member port. */
25187 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_MEMBER_PORT_MAP_PORT_0	UINT32_C(0x1)
25188 	/* If this bit is set to '1', the port1 is a lag member port. */
25189 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_MEMBER_PORT_MAP_PORT_1	UINT32_C(0x2)
25190 	/* If this bit is set to '1', the port2 is a lag member port. */
25191 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_MEMBER_PORT_MAP_PORT_2	UINT32_C(0x4)
25192 	/* If this bit is set to '1', the port3 is a lag member port. */
25193 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_MEMBER_PORT_MAP_PORT_3	UINT32_C(0x8)
25194 	/* rsvd4 is 4 b */
25195 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_MEMBER_PORT_MAP_RSVD4_MASK UINT32_C(0xf0)
25196 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_MEMBER_PORT_MAP_RSVD4_SFT  4
25197 	/* Link aggregation mode being used. */
25198 	uint8_t	link_aggr_mode;
25199 	/* active active mode. */
25200 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_AGGR_MODE_ACTIVE_ACTIVE UINT32_C(0x1)
25201 	/* active backup mode. */
25202 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_AGGR_MODE_ACTIVE_BACKUP UINT32_C(0x2)
25203 	/* Balance XOR mode. */
25204 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_AGGR_MODE_BALANCE_XOR   UINT32_C(0x3)
25205 	/* 802.3AD mode. */
25206 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_AGGR_MODE_802_3_AD	UINT32_C(0x4)
25207 	#define HWRM_FUNC_LAG_MODE_CFG_INPUT_AGGR_MODE_LAST	HWRM_FUNC_LAG_MODE_CFG_INPUT_AGGR_MODE_802_3_AD
25208 	/* Link aggregation group idx being used. */
25209 	uint8_t	lag_id;
25210 	uint8_t	unused_0[2];
25211 } hwrm_func_lag_mode_cfg_input_t, *phwrm_func_lag_mode_cfg_input_t;
25212 
25213 /* hwrm_func_lag_mode_cfg_output (size:128b/16B) */
25214 
25215 typedef struct hwrm_func_lag_mode_cfg_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 	/* Link aggregation group idx being used. */
25225 	uint8_t	lag_id;
25226 	uint8_t	unused_0[6];
25227 	/*
25228 	 * This field is used in Output records to indicate that the output
25229 	 * is completely written to RAM. This field should be read as '1'
25230 	 * to indicate that the output has been completely written. When
25231 	 * writing a command completion or response to an internal processor,
25232 	 * the order of writes has to be such that this field is written last.
25233 	 */
25234 	uint8_t	valid;
25235 } hwrm_func_lag_mode_cfg_output_t, *phwrm_func_lag_mode_cfg_output_t;
25236 
25237 /***************************
25238  * hwrm_func_lag_mode_qcfg *
25239  ***************************/
25240 
25241 
25242 /* hwrm_func_lag_mode_qcfg_input (size:192b/24B) */
25243 
25244 typedef struct hwrm_func_lag_mode_qcfg_input {
25245 	/* The HWRM command request type. */
25246 	uint16_t	req_type;
25247 	/*
25248 	 * The completion ring to send the completion event on. This should
25249 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
25250 	 */
25251 	uint16_t	cmpl_ring;
25252 	/*
25253 	 * The sequence ID is used by the driver for tracking multiple
25254 	 * commands. This ID is treated as opaque data by the firmware and
25255 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
25256 	 */
25257 	uint16_t	seq_id;
25258 	/*
25259 	 * The target ID of the command:
25260 	 * * 0x0-0xFFF8 - The function ID
25261 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25262 	 * * 0xFFFD - Reserved for user-space HWRM interface
25263 	 * * 0xFFFF - HWRM
25264 	 */
25265 	uint16_t	target_id;
25266 	/*
25267 	 * A physical address pointer pointing to a host buffer that the
25268 	 * command's response data will be written. This can be either a host
25269 	 * physical address (HPA) or a guest physical address (GPA) and must
25270 	 * point to a physically contiguous block of memory.
25271 	 */
25272 	uint64_t	resp_addr;
25273 	uint8_t	unused_0[8];
25274 } hwrm_func_lag_mode_qcfg_input_t, *phwrm_func_lag_mode_qcfg_input_t;
25275 
25276 /* hwrm_func_lag_mode_qcfg_output (size:128b/16B) */
25277 
25278 typedef struct hwrm_func_lag_mode_qcfg_output {
25279 	/* The specific error status for the command. */
25280 	uint16_t	error_code;
25281 	/* The HWRM command request type. */
25282 	uint16_t	req_type;
25283 	/* The sequence ID from the original command. */
25284 	uint16_t	seq_id;
25285 	/* The length of the response data in number of bytes. */
25286 	uint16_t	resp_len;
25287 	uint8_t	aggr_enabled;
25288 	/*
25289 	 * This flag is used to query whether link aggregation is enabled
25290 	 * or disabled during run time.
25291 	 */
25292 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_AGGR_ENABLED	UINT32_C(0x1)
25293 	/* rsvd1 is 7 b */
25294 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_RSVD1_MASK	UINT32_C(0xfe)
25295 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_RSVD1_SFT	1
25296 	/*
25297 	 * This is the bitmap of all active ports in the LAG. Each bit
25298 	 * represents a front panel port of the device starting from port 0.
25299 	 * The number of front panel ports is specified in the port_cnt field
25300 	 * of the HWRM_PORT_PHY_QCAPS response.
25301 	 * The term "active port" is one of member ports which is eligible to
25302 	 * send or receive the traffic.
25303 	 * In the active-backup mode, only one member port is active port at
25304 	 * any given time. If the active port fails, another member port
25305 	 * automatically takes over the active role to ensure continuous
25306 	 * network connectivity.
25307 	 * In the active-active, balance_xor or 802_3_ad mode, all member ports
25308 	 * could be active port, if link status on one port is down, driver
25309 	 * needs to send the NIC a new active-port bitmap with marking this
25310 	 * port as not active port.
25311 	 * The PORT_2 and PORT_3 are only valid if the NIC has four front
25312 	 * panel ports.
25313 	 */
25314 	uint8_t	active_port_map;
25315 	/* If this bit is set to '1', the port0 is a lag active port. */
25316 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_ACTIVE_PORT_MAP_PORT_0	UINT32_C(0x1)
25317 	/* If this bit is set to '1', the port1 is a lag active port. */
25318 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_ACTIVE_PORT_MAP_PORT_1	UINT32_C(0x2)
25319 	/* If this bit is set to '1', the port2 is a lag active port. */
25320 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_ACTIVE_PORT_MAP_PORT_2	UINT32_C(0x4)
25321 	/* If this bit is set to '1', the port3 is a lag active port. */
25322 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_ACTIVE_PORT_MAP_PORT_3	UINT32_C(0x8)
25323 	/* rsvd2 is 4 b */
25324 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_ACTIVE_PORT_MAP_RSVD2_MASK UINT32_C(0xf0)
25325 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_ACTIVE_PORT_MAP_RSVD2_SFT  4
25326 	/*
25327 	 * This is the bitmap of all member ports in the LAG. Each bit
25328 	 * represents a front panel port of the device starting from port 0.
25329 	 * The number of front panel ports is specified in the port_cnt field
25330 	 * of the HWRM_PORT_PHY_QCAPS response.
25331 	 * The term "member port" refers to a front panel port that is added to
25332 	 * the bond group as a slave device. These member ports are combined to
25333 	 * create a logical bond interface.
25334 	 * For a 4-port NIC, the LAG member port combination can consist of
25335 	 * either two ports or four ports. However, it is important to note
25336 	 * that the case with three ports in the same lag group is not
25337 	 * supported.
25338 	 * The PORT_2 and PORT_3 are only valid if the NIC has four front
25339 	 * panel ports. There could be a case to use multiple LAG groups,
25340 	 * for example, if the NIC has four front panel ports, the lag feature
25341 	 * can use up to two LAG groups, with two ports assigned to each group.
25342 	 */
25343 	uint8_t	member_port_map;
25344 	/* If this bit is set to '1', the port0 is a lag member port. */
25345 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_MEMBER_PORT_MAP_PORT_0	UINT32_C(0x1)
25346 	/* If this bit is set to '1', the port1 is a lag member port. */
25347 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_MEMBER_PORT_MAP_PORT_1	UINT32_C(0x2)
25348 	/* If this bit is set to '1', the port2 is a lag member port. */
25349 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_MEMBER_PORT_MAP_PORT_2	UINT32_C(0x4)
25350 	/* If this bit is set to '1', the port3 is a lag member port. */
25351 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_MEMBER_PORT_MAP_PORT_3	UINT32_C(0x8)
25352 	/* rsvd3 is 4 b */
25353 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_MEMBER_PORT_MAP_RSVD3_MASK UINT32_C(0xf0)
25354 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_MEMBER_PORT_MAP_RSVD3_SFT  4
25355 	/* Link aggregation mode being used. */
25356 	uint8_t	link_aggr_mode;
25357 	/* active active mode. */
25358 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_AGGR_MODE_ACTIVE_ACTIVE UINT32_C(0x1)
25359 	/* active backup mode. */
25360 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_AGGR_MODE_ACTIVE_BACKUP UINT32_C(0x2)
25361 	/* Balance XOR mode. */
25362 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_AGGR_MODE_BALANCE_XOR   UINT32_C(0x3)
25363 	/* 802.3AD mode. */
25364 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_AGGR_MODE_802_3_AD	UINT32_C(0x4)
25365 	#define HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_AGGR_MODE_LAST	HWRM_FUNC_LAG_MODE_QCFG_OUTPUT_AGGR_MODE_802_3_AD
25366 	uint8_t	unused_0[3];
25367 	/*
25368 	 * This field is used in Output records to indicate that the output
25369 	 * is completely written to RAM. This field should be read as '1'
25370 	 * to indicate that the output has been completely written. When
25371 	 * writing a command completion or response to an internal processor,
25372 	 * the order of writes has to be such that this field is written last.
25373 	 */
25374 	uint8_t	valid;
25375 } hwrm_func_lag_mode_qcfg_output_t, *phwrm_func_lag_mode_qcfg_output_t;
25376 
25377 /***********************
25378  * hwrm_func_vlan_qcfg *
25379  ***********************/
25380 
25381 
25382 /* hwrm_func_vlan_qcfg_input (size:192b/24B) */
25383 
25384 typedef struct hwrm_func_vlan_qcfg_input {
25385 	/* The HWRM command request type. */
25386 	uint16_t	req_type;
25387 	/*
25388 	 * The completion ring to send the completion event on. This should
25389 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
25390 	 */
25391 	uint16_t	cmpl_ring;
25392 	/*
25393 	 * The sequence ID is used by the driver for tracking multiple
25394 	 * commands. This ID is treated as opaque data by the firmware and
25395 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
25396 	 */
25397 	uint16_t	seq_id;
25398 	/*
25399 	 * The target ID of the command:
25400 	 * * 0x0-0xFFF8 - The function ID
25401 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25402 	 * * 0xFFFD - Reserved for user-space HWRM interface
25403 	 * * 0xFFFF - HWRM
25404 	 */
25405 	uint16_t	target_id;
25406 	/*
25407 	 * A physical address pointer pointing to a host buffer that the
25408 	 * command's response data will be written. This can be either a host
25409 	 * physical address (HPA) or a guest physical address (GPA) and must
25410 	 * point to a physically contiguous block of memory.
25411 	 */
25412 	uint64_t	resp_addr;
25413 	/*
25414 	 * Function ID of the function that is being
25415 	 * configured.
25416 	 * If set to 0xFF... (All Fs), then the configuration is
25417 	 * for the requesting function.
25418 	 */
25419 	uint16_t	fid;
25420 	uint8_t	unused_0[6];
25421 } hwrm_func_vlan_qcfg_input_t, *phwrm_func_vlan_qcfg_input_t;
25422 
25423 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */
25424 
25425 typedef struct hwrm_func_vlan_qcfg_output {
25426 	/* The specific error status for the command. */
25427 	uint16_t	error_code;
25428 	/* The HWRM command request type. */
25429 	uint16_t	req_type;
25430 	/* The sequence ID from the original command. */
25431 	uint16_t	seq_id;
25432 	/* The length of the response data in number of bytes. */
25433 	uint16_t	resp_len;
25434 	uint64_t	unused_0;
25435 	/* S-TAG VLAN identifier configured for the function. */
25436 	uint16_t	stag_vid;
25437 	/* S-TAG PCP value configured for the function. */
25438 	uint8_t	stag_pcp;
25439 	uint8_t	unused_1;
25440 	/*
25441 	 * S-TAG TPID value configured for the function. This field is
25442 	 * specified in network byte order.
25443 	 */
25444 	uint16_t	stag_tpid;
25445 	/* C-TAG VLAN identifier configured for the function. */
25446 	uint16_t	ctag_vid;
25447 	/* C-TAG PCP value configured for the function. */
25448 	uint8_t	ctag_pcp;
25449 	uint8_t	unused_2;
25450 	/*
25451 	 * C-TAG TPID value configured for the function. This field is
25452 	 * specified in network byte order.
25453 	 */
25454 	uint16_t	ctag_tpid;
25455 	/* Future use. */
25456 	uint32_t	rsvd2;
25457 	/* Future use. */
25458 	uint32_t	rsvd3;
25459 	uint8_t	unused_3[3];
25460 	/*
25461 	 * This field is used in Output records to indicate that the output
25462 	 * is completely written to RAM. This field should be read as '1'
25463 	 * to indicate that the output has been completely written. When
25464 	 * writing a command completion or response to an internal processor,
25465 	 * the order of writes has to be such that this field is written last.
25466 	 */
25467 	uint8_t	valid;
25468 } hwrm_func_vlan_qcfg_output_t, *phwrm_func_vlan_qcfg_output_t;
25469 
25470 /**********************
25471  * hwrm_func_vlan_cfg *
25472  **********************/
25473 
25474 
25475 /* hwrm_func_vlan_cfg_input (size:384b/48B) */
25476 
25477 typedef struct hwrm_func_vlan_cfg_input {
25478 	/* The HWRM command request type. */
25479 	uint16_t	req_type;
25480 	/*
25481 	 * The completion ring to send the completion event on. This should
25482 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
25483 	 */
25484 	uint16_t	cmpl_ring;
25485 	/*
25486 	 * The sequence ID is used by the driver for tracking multiple
25487 	 * commands. This ID is treated as opaque data by the firmware and
25488 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
25489 	 */
25490 	uint16_t	seq_id;
25491 	/*
25492 	 * The target ID of the command:
25493 	 * * 0x0-0xFFF8 - The function ID
25494 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25495 	 * * 0xFFFD - Reserved for user-space HWRM interface
25496 	 * * 0xFFFF - HWRM
25497 	 */
25498 	uint16_t	target_id;
25499 	/*
25500 	 * A physical address pointer pointing to a host buffer that the
25501 	 * command's response data will be written. This can be either a host
25502 	 * physical address (HPA) or a guest physical address (GPA) and must
25503 	 * point to a physically contiguous block of memory.
25504 	 */
25505 	uint64_t	resp_addr;
25506 	/*
25507 	 * Function ID of the function that is being
25508 	 * configured.
25509 	 * If set to 0xFF... (All Fs), then the configuration is
25510 	 * for the requesting function.
25511 	 */
25512 	uint16_t	fid;
25513 	uint8_t	unused_0[2];
25514 	uint32_t	enables;
25515 	/*
25516 	 * This bit must be '1' for the stag_vid field to be
25517 	 * configured.
25518 	 */
25519 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID	UINT32_C(0x1)
25520 	/*
25521 	 * This bit must be '1' for the ctag_vid field to be
25522 	 * configured.
25523 	 */
25524 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID	UINT32_C(0x2)
25525 	/*
25526 	 * This bit must be '1' for the stag_pcp field to be
25527 	 * configured.
25528 	 */
25529 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP	UINT32_C(0x4)
25530 	/*
25531 	 * This bit must be '1' for the ctag_pcp field to be
25532 	 * configured.
25533 	 */
25534 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP	UINT32_C(0x8)
25535 	/*
25536 	 * This bit must be '1' for the stag_tpid field to be
25537 	 * configured.
25538 	 */
25539 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID	UINT32_C(0x10)
25540 	/*
25541 	 * This bit must be '1' for the ctag_tpid field to be
25542 	 * configured.
25543 	 */
25544 	#define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID	UINT32_C(0x20)
25545 	/* S-TAG VLAN identifier configured for the function. */
25546 	uint16_t	stag_vid;
25547 	/* S-TAG PCP value configured for the function. */
25548 	uint8_t	stag_pcp;
25549 	uint8_t	unused_1;
25550 	/*
25551 	 * S-TAG TPID value configured for the function. This field is
25552 	 * specified in network byte order.
25553 	 */
25554 	uint16_t	stag_tpid;
25555 	/* C-TAG VLAN identifier configured for the function. */
25556 	uint16_t	ctag_vid;
25557 	/* C-TAG PCP value configured for the function. */
25558 	uint8_t	ctag_pcp;
25559 	uint8_t	unused_2;
25560 	/*
25561 	 * C-TAG TPID value configured for the function. This field is
25562 	 * specified in network byte order.
25563 	 */
25564 	uint16_t	ctag_tpid;
25565 	/* Future use. */
25566 	uint32_t	rsvd1;
25567 	/* Future use. */
25568 	uint32_t	rsvd2;
25569 	uint8_t	unused_3[4];
25570 } hwrm_func_vlan_cfg_input_t, *phwrm_func_vlan_cfg_input_t;
25571 
25572 /* hwrm_func_vlan_cfg_output (size:128b/16B) */
25573 
25574 typedef struct hwrm_func_vlan_cfg_output {
25575 	/* The specific error status for the command. */
25576 	uint16_t	error_code;
25577 	/* The HWRM command request type. */
25578 	uint16_t	req_type;
25579 	/* The sequence ID from the original command. */
25580 	uint16_t	seq_id;
25581 	/* The length of the response data in number of bytes. */
25582 	uint16_t	resp_len;
25583 	uint8_t	unused_0[7];
25584 	/*
25585 	 * This field is used in Output records to indicate that the output
25586 	 * is completely written to RAM. This field should be read as '1'
25587 	 * to indicate that the output has been completely written. When
25588 	 * writing a command completion or response to an internal processor,
25589 	 * the order of writes has to be such that this field is written last.
25590 	 */
25591 	uint8_t	valid;
25592 } hwrm_func_vlan_cfg_output_t, *phwrm_func_vlan_cfg_output_t;
25593 
25594 /*******************************
25595  * hwrm_func_vf_vnic_ids_query *
25596  *******************************/
25597 
25598 
25599 /* hwrm_func_vf_vnic_ids_query_input (size:256b/32B) */
25600 
25601 typedef struct hwrm_func_vf_vnic_ids_query_input {
25602 	/* The HWRM command request type. */
25603 	uint16_t	req_type;
25604 	/*
25605 	 * The completion ring to send the completion event on. This should
25606 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
25607 	 */
25608 	uint16_t	cmpl_ring;
25609 	/*
25610 	 * The sequence ID is used by the driver for tracking multiple
25611 	 * commands. This ID is treated as opaque data by the firmware and
25612 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
25613 	 */
25614 	uint16_t	seq_id;
25615 	/*
25616 	 * The target ID of the command:
25617 	 * * 0x0-0xFFF8 - The function ID
25618 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25619 	 * * 0xFFFD - Reserved for user-space HWRM interface
25620 	 * * 0xFFFF - HWRM
25621 	 */
25622 	uint16_t	target_id;
25623 	/*
25624 	 * A physical address pointer pointing to a host buffer that the
25625 	 * command's response data will be written. This can be either a host
25626 	 * physical address (HPA) or a guest physical address (GPA) and must
25627 	 * point to a physically contiguous block of memory.
25628 	 */
25629 	uint64_t	resp_addr;
25630 	/*
25631 	 * This value is used to identify a Virtual Function (VF).
25632 	 * The scope of VF ID is local within a PF.
25633 	 */
25634 	uint16_t	vf_id;
25635 	uint8_t	unused_0[2];
25636 	/* Max number of vnic ids in vnic id table */
25637 	uint32_t	max_vnic_id_cnt;
25638 	/* This is the address for VF VNIC ID table */
25639 	uint64_t	vnic_id_tbl_addr;
25640 } hwrm_func_vf_vnic_ids_query_input_t, *phwrm_func_vf_vnic_ids_query_input_t;
25641 
25642 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */
25643 
25644 typedef struct hwrm_func_vf_vnic_ids_query_output {
25645 	/* The specific error status for the command. */
25646 	uint16_t	error_code;
25647 	/* The HWRM command request type. */
25648 	uint16_t	req_type;
25649 	/* The sequence ID from the original command. */
25650 	uint16_t	seq_id;
25651 	/* The length of the response data in number of bytes. */
25652 	uint16_t	resp_len;
25653 	/*
25654 	 * Actual number of vnic ids
25655 	 *
25656 	 * Each VNIC ID is written as a 32-bit number.
25657 	 */
25658 	uint32_t	vnic_id_cnt;
25659 	uint8_t	unused_0[3];
25660 	/*
25661 	 * This field is used in Output records to indicate that the output
25662 	 * is completely written to RAM. This field should be read as '1'
25663 	 * to indicate that the output has been completely written. When
25664 	 * writing a command completion or response to an internal processor,
25665 	 * the order of writes has to be such that this field is written last.
25666 	 */
25667 	uint8_t	valid;
25668 } hwrm_func_vf_vnic_ids_query_output_t, *phwrm_func_vf_vnic_ids_query_output_t;
25669 
25670 /***********************
25671  * hwrm_func_vf_bw_cfg *
25672  ***********************/
25673 
25674 
25675 /* hwrm_func_vf_bw_cfg_input (size:960b/120B) */
25676 
25677 typedef struct hwrm_func_vf_bw_cfg_input {
25678 	/* The HWRM command request type. */
25679 	uint16_t	req_type;
25680 	/*
25681 	 * The completion ring to send the completion event on. This should
25682 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
25683 	 */
25684 	uint16_t	cmpl_ring;
25685 	/*
25686 	 * The sequence ID is used by the driver for tracking multiple
25687 	 * commands. This ID is treated as opaque data by the firmware and
25688 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
25689 	 */
25690 	uint16_t	seq_id;
25691 	/*
25692 	 * The target ID of the command:
25693 	 * * 0x0-0xFFF8 - The function ID
25694 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25695 	 * * 0xFFFD - Reserved for user-space HWRM interface
25696 	 * * 0xFFFF - HWRM
25697 	 */
25698 	uint16_t	target_id;
25699 	/*
25700 	 * A physical address pointer pointing to a host buffer that the
25701 	 * command's response data will be written. This can be either a host
25702 	 * physical address (HPA) or a guest physical address (GPA) and must
25703 	 * point to a physically contiguous block of memory.
25704 	 */
25705 	uint64_t	resp_addr;
25706 	/*
25707 	 * The number of VF functions that are being configured.
25708 	 * The cmd space allows up to 50 VFs' BW to be configured with one cmd.
25709 	 */
25710 	uint16_t	num_vfs;
25711 	uint16_t	unused[3];
25712 	/* These 16-bit fields contain the VF fid and the rate scale percentage. */
25713 	uint16_t	vfn[48];
25714 	/* The physical VF id the adjustment will be made to. */
25715 	#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_MASK	UINT32_C(0xfff)
25716 	#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_SFT	0
25717 	/*
25718 	 * This field configures the rate scale percentage of the VF as specified
25719 	 * by the physical VF id.
25720 	 */
25721 	#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_MASK	UINT32_C(0xf000)
25722 	#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_SFT	12
25723 	/* 0% of the max tx rate */
25724 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_0	(UINT32_C(0x0) << 12)
25725 	/* 6.66% of the max tx rate */
25726 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_6_66   (UINT32_C(0x1) << 12)
25727 	/* 13.33% of the max tx rate */
25728 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_13_33  (UINT32_C(0x2) << 12)
25729 	/* 20% of the max tx rate */
25730 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_20	(UINT32_C(0x3) << 12)
25731 	/* 26.66% of the max tx rate */
25732 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_26_66  (UINT32_C(0x4) << 12)
25733 	/* 33% of the max tx rate */
25734 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_33_33  (UINT32_C(0x5) << 12)
25735 	/* 40% of the max tx rate */
25736 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_40	(UINT32_C(0x6) << 12)
25737 	/* 46.66% of the max tx rate */
25738 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_46_66  (UINT32_C(0x7) << 12)
25739 	/* 53.33% of the max tx rate */
25740 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_53_33  (UINT32_C(0x8) << 12)
25741 	/* 60% of the max tx rate */
25742 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_60	(UINT32_C(0x9) << 12)
25743 	/* 66.66% of the max tx rate */
25744 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_66_66  (UINT32_C(0xa) << 12)
25745 	/* 53.33% of the max tx rate */
25746 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_73_33  (UINT32_C(0xb) << 12)
25747 	/* 80% of the max tx rate */
25748 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_80	(UINT32_C(0xc) << 12)
25749 	/* 86.66% of the max tx rate */
25750 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_86_66  (UINT32_C(0xd) << 12)
25751 	/* 93.33% of the max tx rate */
25752 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_93_33  (UINT32_C(0xe) << 12)
25753 	/* 100% of the max tx rate */
25754 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100	(UINT32_C(0xf) << 12)
25755 		#define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_LAST	HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100
25756 } hwrm_func_vf_bw_cfg_input_t, *phwrm_func_vf_bw_cfg_input_t;
25757 
25758 /* hwrm_func_vf_bw_cfg_output (size:128b/16B) */
25759 
25760 typedef struct hwrm_func_vf_bw_cfg_output {
25761 	/* The specific error status for the command. */
25762 	uint16_t	error_code;
25763 	/* The HWRM command request type. */
25764 	uint16_t	req_type;
25765 	/* The sequence ID from the original command. */
25766 	uint16_t	seq_id;
25767 	/* The length of the response data in number of bytes. */
25768 	uint16_t	resp_len;
25769 	uint8_t	unused_0[7];
25770 	/*
25771 	 * This field is used in Output records to indicate that the output
25772 	 * is completely written to RAM. This field should be read as '1'
25773 	 * to indicate that the output has been completely written. When
25774 	 * writing a command completion or response to an internal processor,
25775 	 * the order of writes has to be such that this field is written last.
25776 	 */
25777 	uint8_t	valid;
25778 } hwrm_func_vf_bw_cfg_output_t, *phwrm_func_vf_bw_cfg_output_t;
25779 
25780 /************************
25781  * hwrm_func_vf_bw_qcfg *
25782  ************************/
25783 
25784 
25785 /* hwrm_func_vf_bw_qcfg_input (size:960b/120B) */
25786 
25787 typedef struct hwrm_func_vf_bw_qcfg_input {
25788 	/* The HWRM command request type. */
25789 	uint16_t	req_type;
25790 	/*
25791 	 * The completion ring to send the completion event on. This should
25792 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
25793 	 */
25794 	uint16_t	cmpl_ring;
25795 	/*
25796 	 * The sequence ID is used by the driver for tracking multiple
25797 	 * commands. This ID is treated as opaque data by the firmware and
25798 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
25799 	 */
25800 	uint16_t	seq_id;
25801 	/*
25802 	 * The target ID of the command:
25803 	 * * 0x0-0xFFF8 - The function ID
25804 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25805 	 * * 0xFFFD - Reserved for user-space HWRM interface
25806 	 * * 0xFFFF - HWRM
25807 	 */
25808 	uint16_t	target_id;
25809 	/*
25810 	 * A physical address pointer pointing to a host buffer that the
25811 	 * command's response data will be written. This can be either a host
25812 	 * physical address (HPA) or a guest physical address (GPA) and must
25813 	 * point to a physically contiguous block of memory.
25814 	 */
25815 	uint64_t	resp_addr;
25816 	/*
25817 	 * The number of VF functions that are being queried.
25818 	 * The inline response space allows the host to query up to 50 VFs'
25819 	 * rate scale percentage
25820 	 */
25821 	uint16_t	num_vfs;
25822 	uint16_t	unused[3];
25823 	/* These 16-bit fields contain the VF fid */
25824 	uint16_t	vfn[48];
25825 	/* The physical VF id of interest */
25826 	#define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff)
25827 	#define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_SFT 0
25828 } hwrm_func_vf_bw_qcfg_input_t, *phwrm_func_vf_bw_qcfg_input_t;
25829 
25830 /* hwrm_func_vf_bw_qcfg_output (size:960b/120B) */
25831 
25832 typedef struct hwrm_func_vf_bw_qcfg_output {
25833 	/* The specific error status for the command. */
25834 	uint16_t	error_code;
25835 	/* The HWRM command request type. */
25836 	uint16_t	req_type;
25837 	/* The sequence ID from the original command. */
25838 	uint16_t	seq_id;
25839 	/* The length of the response data in number of bytes. */
25840 	uint16_t	resp_len;
25841 	/*
25842 	 * The number of VF functions that are being queried.
25843 	 * The inline response space allows the host to query up to 50 VFs'
25844 	 * rate scale percentage.
25845 	 */
25846 	uint16_t	num_vfs;
25847 	uint16_t	unused[3];
25848 	/* These 16-bit fields contain the VF fid and the rate scale percentage. */
25849 	uint16_t	vfn[48];
25850 	/* The physical VF id the adjustment will be made to. */
25851 	#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_MASK	UINT32_C(0xfff)
25852 	#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_SFT	0
25853 	/*
25854 	 * This field configures the rate scale percentage of the VF as specified
25855 	 * by the physical VF id.
25856 	 */
25857 	#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_MASK	UINT32_C(0xf000)
25858 	#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_SFT	12
25859 	/* 0% of the max tx rate */
25860 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_0	(UINT32_C(0x0) << 12)
25861 	/* 6.66% of the max tx rate */
25862 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_6_66   (UINT32_C(0x1) << 12)
25863 	/* 13.33% of the max tx rate */
25864 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_13_33  (UINT32_C(0x2) << 12)
25865 	/* 20% of the max tx rate */
25866 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_20	(UINT32_C(0x3) << 12)
25867 	/* 26.66% of the max tx rate */
25868 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_26_66  (UINT32_C(0x4) << 12)
25869 	/* 33% of the max tx rate */
25870 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_33_33  (UINT32_C(0x5) << 12)
25871 	/* 40% of the max tx rate */
25872 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_40	(UINT32_C(0x6) << 12)
25873 	/* 46.66% of the max tx rate */
25874 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_46_66  (UINT32_C(0x7) << 12)
25875 	/* 53.33% of the max tx rate */
25876 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_53_33  (UINT32_C(0x8) << 12)
25877 	/* 60% of the max tx rate */
25878 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_60	(UINT32_C(0x9) << 12)
25879 	/* 66.66% of the max tx rate */
25880 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_66_66  (UINT32_C(0xa) << 12)
25881 	/* 53.33% of the max tx rate */
25882 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_73_33  (UINT32_C(0xb) << 12)
25883 	/* 80% of the max tx rate */
25884 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_80	(UINT32_C(0xc) << 12)
25885 	/* 86.66% of the max tx rate */
25886 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_86_66  (UINT32_C(0xd) << 12)
25887 	/* 93.33% of the max tx rate */
25888 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_93_33  (UINT32_C(0xe) << 12)
25889 	/* 100% of the max tx rate */
25890 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100	(UINT32_C(0xf) << 12)
25891 		#define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_LAST	HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100
25892 	uint8_t	unused_0[7];
25893 	/*
25894 	 * This field is used in Output records to indicate that the output
25895 	 * is completely written to RAM. This field should be read as '1'
25896 	 * to indicate that the output has been completely written. When
25897 	 * writing a command completion or response to an internal processor,
25898 	 * the order of writes has to be such that this field is written last.
25899 	 */
25900 	uint8_t	valid;
25901 } hwrm_func_vf_bw_qcfg_output_t, *phwrm_func_vf_bw_qcfg_output_t;
25902 
25903 /***************************
25904  * hwrm_func_drv_if_change *
25905  ***************************/
25906 
25907 
25908 /* hwrm_func_drv_if_change_input (size:192b/24B) */
25909 
25910 typedef struct hwrm_func_drv_if_change_input {
25911 	/* The HWRM command request type. */
25912 	uint16_t	req_type;
25913 	/*
25914 	 * The completion ring to send the completion event on. This should
25915 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
25916 	 */
25917 	uint16_t	cmpl_ring;
25918 	/*
25919 	 * The sequence ID is used by the driver for tracking multiple
25920 	 * commands. This ID is treated as opaque data by the firmware and
25921 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
25922 	 */
25923 	uint16_t	seq_id;
25924 	/*
25925 	 * The target ID of the command:
25926 	 * * 0x0-0xFFF8 - The function ID
25927 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25928 	 * * 0xFFFD - Reserved for user-space HWRM interface
25929 	 * * 0xFFFF - HWRM
25930 	 */
25931 	uint16_t	target_id;
25932 	/*
25933 	 * A physical address pointer pointing to a host buffer that the
25934 	 * command's response data will be written. This can be either a host
25935 	 * physical address (HPA) or a guest physical address (GPA) and must
25936 	 * point to a physically contiguous block of memory.
25937 	 */
25938 	uint64_t	resp_addr;
25939 	uint32_t	flags;
25940 	/*
25941 	 * When this bit is '1', the function driver is indicating
25942 	 * that the IF state is changing to UP state. The call should
25943 	 * be made at the beginning of the driver's open call before
25944 	 * resources are allocated. After making the call, the driver
25945 	 * should check the response to see if any resources may have
25946 	 * changed (see the response below). If the driver fails
25947 	 * the open call, the driver should make this call again with
25948 	 * this bit cleared to indicate that the IF state is not UP.
25949 	 * During the driver's close call when the IF state is changing
25950 	 * to DOWN, the driver should make this call with the bit cleared
25951 	 * after all resources have been freed.
25952 	 */
25953 	#define HWRM_FUNC_DRV_IF_CHANGE_INPUT_FLAGS_UP	UINT32_C(0x1)
25954 	uint32_t	unused;
25955 } hwrm_func_drv_if_change_input_t, *phwrm_func_drv_if_change_input_t;
25956 
25957 /* hwrm_func_drv_if_change_output (size:128b/16B) */
25958 
25959 typedef struct hwrm_func_drv_if_change_output {
25960 	/* The specific error status for the command. */
25961 	uint16_t	error_code;
25962 	/* The HWRM command request type. */
25963 	uint16_t	req_type;
25964 	/* The sequence ID from the original command. */
25965 	uint16_t	seq_id;
25966 	/* The length of the response data in number of bytes. */
25967 	uint16_t	resp_len;
25968 	uint32_t	flags;
25969 	/*
25970 	 * When this bit is '1', it indicates that the resources reserved
25971 	 * for this function may have changed. The driver should check
25972 	 * resource capabilities and reserve resources again before
25973 	 * allocating resources.
25974 	 */
25975 	#define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_RESC_CHANGE	UINT32_C(0x1)
25976 	/*
25977 	 * When this bit is '1', it indicates that the firmware got changed /
25978 	 * reset. The driver should do complete re-initialization when that
25979 	 * bit is set.
25980 	 */
25981 	#define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE	UINT32_C(0x2)
25982 	/*
25983 	 * When this bit is '1', it indicates that capabilities
25984 	 * for this function may have changed. The driver should
25985 	 * query for changes to capabilities.
25986 	 * The CAPS_CHANGE bit will only be set when it is safe for the
25987 	 * driver to completely re-initialize all resources for the function
25988 	 * including any children VFs.
25989 	 */
25990 	#define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_CAPS_CHANGE	UINT32_C(0x4)
25991 	uint8_t	unused_0[3];
25992 	/*
25993 	 * This field is used in Output records to indicate that the output
25994 	 * is completely written to RAM. This field should be read as '1'
25995 	 * to indicate that the output has been completely written. When
25996 	 * writing a command completion or response to an internal processor,
25997 	 * the order of writes has to be such that this field is written last.
25998 	 */
25999 	uint8_t	valid;
26000 } hwrm_func_drv_if_change_output_t, *phwrm_func_drv_if_change_output_t;
26001 
26002 /*******************************
26003  * hwrm_func_host_pf_ids_query *
26004  *******************************/
26005 
26006 
26007 /* hwrm_func_host_pf_ids_query_input (size:192b/24B) */
26008 
26009 typedef struct hwrm_func_host_pf_ids_query_input {
26010 	/* The HWRM command request type. */
26011 	uint16_t	req_type;
26012 	/*
26013 	 * The completion ring to send the completion event on. This should
26014 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
26015 	 */
26016 	uint16_t	cmpl_ring;
26017 	/*
26018 	 * The sequence ID is used by the driver for tracking multiple
26019 	 * commands. This ID is treated as opaque data by the firmware and
26020 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
26021 	 */
26022 	uint16_t	seq_id;
26023 	/*
26024 	 * The target ID of the command:
26025 	 * * 0x0-0xFFF8 - The function ID
26026 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26027 	 * * 0xFFFD - Reserved for user-space HWRM interface
26028 	 * * 0xFFFF - HWRM
26029 	 */
26030 	uint16_t	target_id;
26031 	/*
26032 	 * A physical address pointer pointing to a host buffer that the
26033 	 * command's response data will be written. This can be either a host
26034 	 * physical address (HPA) or a guest physical address (GPA) and must
26035 	 * point to a physically contiguous block of memory.
26036 	 */
26037 	uint64_t	resp_addr;
26038 	uint8_t	host;
26039 	/*
26040 	 * # If this bit is set to '1', the query will contain PF(s)
26041 	 * belongs to SOC host.
26042 	 */
26043 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_SOC	UINT32_C(0x1)
26044 	/*
26045 	 * # If this bit is set to '1', the query will contain PF(s)
26046 	 * belongs to EP0 host.
26047 	 */
26048 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_0	UINT32_C(0x2)
26049 	/*
26050 	 * # If this bit is set to '1', the query will contain PF(s)
26051 	 * belongs to EP1 host.
26052 	 */
26053 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_1	UINT32_C(0x4)
26054 	/*
26055 	 * # If this bit is set to '1', the query will contain PF(s)
26056 	 * belongs to EP2 host.
26057 	 */
26058 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_2	UINT32_C(0x8)
26059 	/*
26060 	 * # If this bit is set to '1', the query will contain PF(s)
26061 	 * belongs to EP3 host.
26062 	 */
26063 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_3	UINT32_C(0x10)
26064 	/*
26065 	 * This provides a filter of what PF(s) will be returned in the
26066 	 * query..
26067 	 */
26068 	uint8_t	filter;
26069 	/*
26070 	 * all available PF(s) belong to the host(s) (defined in the
26071 	 * host field). This includes the hidden PFs.
26072 	 */
26073 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ALL  UINT32_C(0x0)
26074 	/*
26075 	 * all available PF(s) belong to the host(s) (defined in the
26076 	 * host field) that is available for L2 traffic.
26077 	 */
26078 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_L2   UINT32_C(0x1)
26079 	/*
26080 	 * all available PF(s) belong to the host(s) (defined in the
26081 	 * host field) that is available for ROCE traffic.
26082 	 */
26083 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE UINT32_C(0x2)
26084 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_LAST HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE
26085 	uint8_t	unused_1[6];
26086 } hwrm_func_host_pf_ids_query_input_t, *phwrm_func_host_pf_ids_query_input_t;
26087 
26088 /* hwrm_func_host_pf_ids_query_output (size:128b/16B) */
26089 
26090 typedef struct hwrm_func_host_pf_ids_query_output {
26091 	/* The specific error status for the command. */
26092 	uint16_t	error_code;
26093 	/* The HWRM command request type. */
26094 	uint16_t	req_type;
26095 	/* The sequence ID from the original command. */
26096 	uint16_t	seq_id;
26097 	/* The length of the response data in number of bytes. */
26098 	uint16_t	resp_len;
26099 	/* This provides the first PF ID of the device. */
26100 	uint16_t	first_pf_id;
26101 	uint16_t	pf_ordinal_mask;
26102 	/*
26103 	 * When this bit is '1', it indicates first PF belongs to one of
26104 	 * the hosts defined in the input request.
26105 	 */
26106 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_0	UINT32_C(0x1)
26107 	/*
26108 	 * When this bit is '1', it indicates 2nd PF belongs to one of the
26109 	 * hosts defined in the input request.
26110 	 */
26111 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_1	UINT32_C(0x2)
26112 	/*
26113 	 * When this bit is '1', it indicates 3rd PF belongs to one of the
26114 	 * hosts defined in the input request.
26115 	 */
26116 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_2	UINT32_C(0x4)
26117 	/*
26118 	 * When this bit is '1', it indicates 4th PF belongs to one of the
26119 	 * hosts defined in the input request.
26120 	 */
26121 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_3	UINT32_C(0x8)
26122 	/*
26123 	 * When this bit is '1', it indicates 5th PF belongs to one of the
26124 	 * hosts defined in the input request.
26125 	 */
26126 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_4	UINT32_C(0x10)
26127 	/*
26128 	 * When this bit is '1', it indicates 6th PF belongs to one of the
26129 	 * hosts defined in the input request.
26130 	 */
26131 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_5	UINT32_C(0x20)
26132 	/*
26133 	 * When this bit is '1', it indicates 7th PF belongs to one of the
26134 	 * hosts defined in the input request.
26135 	 */
26136 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_6	UINT32_C(0x40)
26137 	/*
26138 	 * When this bit is '1', it indicates 8th PF belongs to one of the
26139 	 * hosts defined in the input request.
26140 	 */
26141 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_7	UINT32_C(0x80)
26142 	/*
26143 	 * When this bit is '1', it indicates 9th PF belongs to one of the
26144 	 * hosts defined in the input request.
26145 	 */
26146 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_8	UINT32_C(0x100)
26147 	/*
26148 	 * When this bit is '1', it indicates 10th PF belongs to one of the
26149 	 * hosts defined in the input request.
26150 	 */
26151 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_9	UINT32_C(0x200)
26152 	/*
26153 	 * When this bit is '1', it indicates 11th PF belongs to one of the
26154 	 * hosts defined in the input request.
26155 	 */
26156 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_10	UINT32_C(0x400)
26157 	/*
26158 	 * When this bit is '1', it indicates 12th PF belongs to one of the
26159 	 * hosts defined in the input request.
26160 	 */
26161 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_11	UINT32_C(0x800)
26162 	/*
26163 	 * When this bit is '1', it indicates 13th PF belongs to one of the
26164 	 * hosts defined in the input request.
26165 	 */
26166 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_12	UINT32_C(0x1000)
26167 	/*
26168 	 * When this bit is '1', it indicates 14th PF belongs to one of the
26169 	 * hosts defined in the input request.
26170 	 */
26171 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_13	UINT32_C(0x2000)
26172 	/*
26173 	 * When this bit is '1', it indicates 15th PF belongs to one of the
26174 	 * hosts defined in the input request.
26175 	 */
26176 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_14	UINT32_C(0x4000)
26177 	/*
26178 	 * When this bit is '1', it indicates 16th PF belongs to one of the
26179 	 * hosts defined in the input request.
26180 	 */
26181 	#define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_15	UINT32_C(0x8000)
26182 	uint8_t	unused_1[3];
26183 	/*
26184 	 * This field is used in Output records to indicate that the output
26185 	 * is completely written to RAM. This field should be read as '1'
26186 	 * to indicate that the output has been completely written. When
26187 	 * writing a command completion or response to an internal processor,
26188 	 * the order of writes has to be such that this field is written last.
26189 	 */
26190 	uint8_t	valid;
26191 } hwrm_func_host_pf_ids_query_output_t, *phwrm_func_host_pf_ids_query_output_t;
26192 
26193 /*********************
26194  * hwrm_func_spd_cfg *
26195  *********************/
26196 
26197 
26198 /* hwrm_func_spd_cfg_input (size:384b/48B) */
26199 
26200 typedef struct hwrm_func_spd_cfg_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-0xFFFC, 0xFFFE - Reserved for internal processors
26218 	 * * 0xFFFD - Reserved for user-space HWRM interface
26219 	 * * 0xFFFF - HWRM
26220 	 */
26221 	uint16_t	target_id;
26222 	/*
26223 	 * A physical address pointer pointing to a host buffer that the
26224 	 * command's response data will be written. This can be either a host
26225 	 * physical address (HPA) or a guest physical address (GPA) and must
26226 	 * point to a physically contiguous block of memory.
26227 	 */
26228 	uint64_t	resp_addr;
26229 	uint32_t	flags;
26230 	/* Set this bit is '1' to enable the SPD datapath forwarding. */
26231 	#define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_FWD_ENABLE	UINT32_C(0x1)
26232 	/* Set this bit is '1' to disable the SPD datapath forwarding. */
26233 	#define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_FWD_DISABLE	UINT32_C(0x2)
26234 	/*
26235 	 * Set this bit is '1' to enable the SPD datapath checksum
26236 	 * feature.
26237 	 */
26238 	#define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_CSUM_ENABLE	UINT32_C(0x4)
26239 	/*
26240 	 * Set this bit is '1' to disable the SPD datapath checksum
26241 	 * feature.
26242 	 */
26243 	#define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_CSUM_DISABLE	UINT32_C(0x8)
26244 	/*
26245 	 * Set this bit is '1' to enable the SPD datapath debug
26246 	 * feature.
26247 	 */
26248 	#define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_DBG_ENABLE	UINT32_C(0x10)
26249 	/*
26250 	 * Set this bit is '1' to disable the SPD datapath debug
26251 	 * feature.
26252 	 */
26253 	#define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_DBG_DISABLE	UINT32_C(0x20)
26254 	uint32_t	enables;
26255 	/*
26256 	 * This bit must be '1' for the ethertype field to be
26257 	 * configured.
26258 	 */
26259 	#define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_ETHERTYPE		UINT32_C(0x1)
26260 	/*
26261 	 * This bit must be '1' for the hash_mode_flags field to be
26262 	 * configured.
26263 	 */
26264 	#define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_MODE_FLAGS	UINT32_C(0x2)
26265 	/*
26266 	 * This bit must be '1' for the hash_type field to be
26267 	 * configured.
26268 	 */
26269 	#define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_TYPE		UINT32_C(0x4)
26270 	/*
26271 	 * This bit must be '1' for the ring_tbl_addr field to be
26272 	 * configured.
26273 	 */
26274 	#define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_RING_TBL_ADDR	UINT32_C(0x8)
26275 	/*
26276 	 * This bit must be '1' for the hash_key_tbl_addr field to be
26277 	 * configured.
26278 	 */
26279 	#define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_KEY_TBL_ADDR	UINT32_C(0x10)
26280 	/*
26281 	 * Ethertype value used in the encapsulated SPD packet header.
26282 	 * The user must choose a value that is not conflicting with
26283 	 * publicly defined ethertype values. By default, the ethertype
26284 	 * value of 0xffff is used if there is no user specified value.
26285 	 */
26286 	uint16_t	ethertype;
26287 	/* Flags to specify different RSS hash modes. */
26288 	uint8_t	hash_mode_flags;
26289 	/*
26290 	 * When this bit is '1', it indicates using current RSS
26291 	 * hash mode setting configured in the device.
26292 	 */
26293 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT	UINT32_C(0x1)
26294 	/*
26295 	 * When this bit is '1', it indicates requesting support of
26296 	 * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
26297 	 * l4.src, l4.dest} for tunnel packets. For none-tunnel
26298 	 * packets, the RSS hash is computed over the normal
26299 	 * src/dest l3 and src/dest l4 headers.
26300 	 */
26301 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4	UINT32_C(0x2)
26302 	/*
26303 	 * When this bit is '1', it indicates requesting support of
26304 	 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
26305 	 * tunnel packets. For none-tunnel packets, the RSS hash is
26306 	 * computed over the normal src/dest l3 headers.
26307 	 */
26308 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2	UINT32_C(0x4)
26309 	/*
26310 	 * When this bit is '1', it indicates requesting support of
26311 	 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
26312 	 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
26313 	 * packets, the RSS hash is computed over the normal
26314 	 * src/dest l3 and src/dest l4 headers.
26315 	 */
26316 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4	UINT32_C(0x8)
26317 	/*
26318 	 * When this bit is '1', it indicates requesting support of
26319 	 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
26320 	 * tunnel packets. For none-tunnel packets, the RSS hash is
26321 	 * computed over the normal src/dest l3 headers.
26322 	 */
26323 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2	UINT32_C(0x10)
26324 	uint8_t	unused_1;
26325 	uint32_t	hash_type;
26326 	/*
26327 	 * When this bit is '1', the RSS hash shall be computed
26328 	 * over source and destination IPv4 addresses of IPv4
26329 	 * packets.
26330 	 */
26331 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_IPV4	UINT32_C(0x1)
26332 	/*
26333 	 * When this bit is '1', the RSS hash shall be computed
26334 	 * over source/destination IPv4 addresses and
26335 	 * source/destination ports of TCP/IPv4 packets.
26336 	 */
26337 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_TCP_IPV4	UINT32_C(0x2)
26338 	/*
26339 	 * When this bit is '1', the RSS hash shall be computed
26340 	 * over source/destination IPv4 addresses and
26341 	 * source/destination ports of UDP/IPv4 packets.
26342 	 */
26343 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_UDP_IPV4	UINT32_C(0x4)
26344 	/*
26345 	 * When this bit is '1', the RSS hash shall be computed
26346 	 * over source and destination IPv4 addresses of IPv6
26347 	 * packets.
26348 	 */
26349 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_IPV6	UINT32_C(0x8)
26350 	/*
26351 	 * When this bit is '1', the RSS hash shall be computed
26352 	 * over source/destination IPv6 addresses and
26353 	 * source/destination ports of TCP/IPv6 packets.
26354 	 */
26355 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_TCP_IPV6	UINT32_C(0x10)
26356 	/*
26357 	 * When this bit is '1', the RSS hash shall be computed
26358 	 * over source/destination IPv6 addresses and
26359 	 * source/destination ports of UDP/IPv6 packets.
26360 	 */
26361 	#define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_UDP_IPV6	UINT32_C(0x20)
26362 	/* This is the address for rss ring group table */
26363 	uint64_t	ring_grp_tbl_addr;
26364 	/* This is the address for rss hash key table */
26365 	uint64_t	hash_key_tbl_addr;
26366 } hwrm_func_spd_cfg_input_t, *phwrm_func_spd_cfg_input_t;
26367 
26368 /* hwrm_func_spd_cfg_output (size:128b/16B) */
26369 
26370 typedef struct hwrm_func_spd_cfg_output {
26371 	/* The specific error status for the command. */
26372 	uint16_t	error_code;
26373 	/* The HWRM command request type. */
26374 	uint16_t	req_type;
26375 	/* The sequence ID from the original command. */
26376 	uint16_t	seq_id;
26377 	/* The length of the response data in number of bytes. */
26378 	uint16_t	resp_len;
26379 	uint8_t	unused_0[7];
26380 	/*
26381 	 * This field is used in Output records to indicate that the output
26382 	 * is completely written to RAM. This field should be read as '1'
26383 	 * to indicate that the output has been completely written. When
26384 	 * writing a command completion or response to an internal processor,
26385 	 * the order of writes has to be such that this field is written last.
26386 	 */
26387 	uint8_t	valid;
26388 } hwrm_func_spd_cfg_output_t, *phwrm_func_spd_cfg_output_t;
26389 
26390 /**********************
26391  * hwrm_func_spd_qcfg *
26392  **********************/
26393 
26394 
26395 /* hwrm_func_spd_qcfg_input (size:128b/16B) */
26396 
26397 typedef struct hwrm_func_spd_qcfg_input {
26398 	/* The HWRM command request type. */
26399 	uint16_t	req_type;
26400 	/*
26401 	 * The completion ring to send the completion event on. This should
26402 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
26403 	 */
26404 	uint16_t	cmpl_ring;
26405 	/*
26406 	 * The sequence ID is used by the driver for tracking multiple
26407 	 * commands. This ID is treated as opaque data by the firmware and
26408 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
26409 	 */
26410 	uint16_t	seq_id;
26411 	/*
26412 	 * The target ID of the command:
26413 	 * * 0x0-0xFFF8 - The function ID
26414 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26415 	 * * 0xFFFD - Reserved for user-space HWRM interface
26416 	 * * 0xFFFF - HWRM
26417 	 */
26418 	uint16_t	target_id;
26419 	/*
26420 	 * A physical address pointer pointing to a host buffer that the
26421 	 * command's response data will be written. This can be either a host
26422 	 * physical address (HPA) or a guest physical address (GPA) and must
26423 	 * point to a physically contiguous block of memory.
26424 	 */
26425 	uint64_t	resp_addr;
26426 } hwrm_func_spd_qcfg_input_t, *phwrm_func_spd_qcfg_input_t;
26427 
26428 /* hwrm_func_spd_qcfg_output (size:512b/64B) */
26429 
26430 typedef struct hwrm_func_spd_qcfg_output {
26431 	/* The specific error status for the command. */
26432 	uint16_t	error_code;
26433 	/* The HWRM command request type. */
26434 	uint16_t	req_type;
26435 	/* The sequence ID from the original command. */
26436 	uint16_t	seq_id;
26437 	/* The length of the response data in number of bytes. */
26438 	uint16_t	resp_len;
26439 	uint32_t	flags;
26440 	/*
26441 	 * The SPD datapath forwarding is currently enabled when this
26442 	 * flag is set to '1'.
26443 	 */
26444 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_FWD_ENABLED	UINT32_C(0x1)
26445 	/*
26446 	 * The SPD datapath checksum feature is currently enabled when
26447 	 * this flag is set to '1'.
26448 	 */
26449 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_CSUM_ENABLED	UINT32_C(0x2)
26450 	/*
26451 	 * The SPD datapath debug feature is currently enabled when
26452 	 * this flag is set to '1'.
26453 	 */
26454 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_DBG_ENABLED	UINT32_C(0x4)
26455 	uint32_t	hash_type;
26456 	/*
26457 	 * When this bit is '1', the RSS hash shall be computed
26458 	 * over source and destination IPv4 addresses of IPv4
26459 	 * packets.
26460 	 */
26461 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_IPV4	UINT32_C(0x1)
26462 	/*
26463 	 * When this bit is '1', the RSS hash shall be computed
26464 	 * over source/destination IPv4 addresses and
26465 	 * source/destination ports of TCP/IPv4 packets.
26466 	 */
26467 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4	UINT32_C(0x2)
26468 	/*
26469 	 * When this bit is '1', the RSS hash shall be computed
26470 	 * over source/destination IPv4 addresses and
26471 	 * source/destination ports of UDP/IPv4 packets.
26472 	 */
26473 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4	UINT32_C(0x4)
26474 	/*
26475 	 * When this bit is '1', the RSS hash shall be computed
26476 	 * over source and destination IPv4 addresses of IPv6
26477 	 * packets.
26478 	 */
26479 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_IPV6	UINT32_C(0x8)
26480 	/*
26481 	 * When this bit is '1', the RSS hash shall be computed
26482 	 * over source/destination IPv6 addresses and
26483 	 * source/destination ports of TCP/IPv6 packets.
26484 	 */
26485 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6	UINT32_C(0x10)
26486 	/*
26487 	 * When this bit is '1', the RSS hash shall be computed
26488 	 * over source/destination IPv6 addresses and
26489 	 * source/destination ports of UDP/IPv6 packets.
26490 	 */
26491 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6	UINT32_C(0x20)
26492 	/* This is the value of rss hash key */
26493 	uint32_t	hash_key[10];
26494 	/* Flags to specify different RSS hash modes. */
26495 	uint8_t	hash_mode_flags;
26496 	/*
26497 	 * When this bit is '1', it indicates using current RSS
26498 	 * hash mode setting configured in the device.
26499 	 */
26500 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT	UINT32_C(0x1)
26501 	/*
26502 	 * When this bit is '1', it indicates requesting support of
26503 	 * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
26504 	 * l4.src, l4.dest} for tunnel packets. For none-tunnel
26505 	 * packets, the RSS hash is computed over the normal
26506 	 * src/dest l3 and src/dest l4 headers.
26507 	 */
26508 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4	UINT32_C(0x2)
26509 	/*
26510 	 * When this bit is '1', it indicates requesting support of
26511 	 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
26512 	 * tunnel packets. For none-tunnel packets, the RSS hash is
26513 	 * computed over the normal src/dest l3 headers.
26514 	 */
26515 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2	UINT32_C(0x4)
26516 	/*
26517 	 * When this bit is '1', it indicates requesting support of
26518 	 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
26519 	 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
26520 	 * packets, the RSS hash is computed over the normal
26521 	 * src/dest l3 and src/dest l4 headers.
26522 	 */
26523 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4	UINT32_C(0x8)
26524 	/*
26525 	 * When this bit is '1', it indicates requesting support of
26526 	 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
26527 	 * tunnel packets. For none-tunnel packets, the RSS hash is
26528 	 * computed over the normal src/dest l3 headers.
26529 	 */
26530 	#define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2	UINT32_C(0x10)
26531 	uint8_t	unused_1;
26532 	/*
26533 	 * Ethertype value used in the encapsulated SPD packet header.
26534 	 * The user must choose a value that is not conflicting with
26535 	 * publicly defined ethertype values. By default, the ethertype
26536 	 * value of 0xffff is used if there is no user specified value.
26537 	 */
26538 	uint16_t	ethertype;
26539 	uint8_t	unused_2[3];
26540 	/*
26541 	 * This field is used in Output records to indicate that the output
26542 	 * is completely written to RAM. This field should be read as '1'
26543 	 * to indicate that the output has been completely written. When
26544 	 * writing a command completion or response to an internal processor,
26545 	 * the order of writes has to be such that this field is written last.
26546 	 */
26547 	uint8_t	valid;
26548 } hwrm_func_spd_qcfg_output_t, *phwrm_func_spd_qcfg_output_t;
26549 
26550 /*********************
26551  * hwrm_port_phy_cfg *
26552  *********************/
26553 
26554 
26555 /* hwrm_port_phy_cfg_input (size:512b/64B) */
26556 
26557 typedef struct hwrm_port_phy_cfg_input {
26558 	/* The HWRM command request type. */
26559 	uint16_t	req_type;
26560 	/*
26561 	 * The completion ring to send the completion event on. This should
26562 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
26563 	 */
26564 	uint16_t	cmpl_ring;
26565 	/*
26566 	 * The sequence ID is used by the driver for tracking multiple
26567 	 * commands. This ID is treated as opaque data by the firmware and
26568 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
26569 	 */
26570 	uint16_t	seq_id;
26571 	/*
26572 	 * The target ID of the command:
26573 	 * * 0x0-0xFFF8 - The function ID
26574 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26575 	 * * 0xFFFD - Reserved for user-space HWRM interface
26576 	 * * 0xFFFF - HWRM
26577 	 */
26578 	uint16_t	target_id;
26579 	/*
26580 	 * A physical address pointer pointing to a host buffer that the
26581 	 * command's response data will be written. This can be either a host
26582 	 * physical address (HPA) or a guest physical address (GPA) and must
26583 	 * point to a physically contiguous block of memory.
26584 	 */
26585 	uint64_t	resp_addr;
26586 	uint32_t	flags;
26587 	/*
26588 	 * When this bit is set to '1', the PHY for the port shall
26589 	 * be reset.
26590 	 *
26591 	 * # If this bit is set to 1, then the HWRM shall reset the
26592 	 * PHY after applying PHY configuration changes specified
26593 	 * in this command.
26594 	 * # In order to guarantee that PHY configuration changes
26595 	 * specified in this command take effect, the HWRM
26596 	 * client should set this flag to 1.
26597 	 * # If this bit is not set to 1, then the HWRM may reset
26598 	 * the PHY depending on the current PHY configuration and
26599 	 * settings specified in this command.
26600 	 */
26601 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY		UINT32_C(0x1)
26602 	/* deprecated bit. Do not use!!! */
26603 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED		UINT32_C(0x2)
26604 	/*
26605 	 * When this bit is set to '1', and the force_pam4_link_speed
26606 	 * bit in the 'enables' field is '0', the link shall be forced
26607 	 * to the force_link_speed value.
26608 	 *
26609 	 * When this bit is set to '1', and the force_pam4_link_speed
26610 	 * bit in the 'enables' field is '1', the link shall be forced
26611 	 * to the force_pam4_link_speed value.
26612 	 *
26613 	 * When this bit is set to '1', the HWRM client should
26614 	 * not enable any of the auto negotiation related
26615 	 * fields represented by auto_XXX fields in this command.
26616 	 * When this bit is set to '1' and the HWRM client has
26617 	 * enabled a auto_XXX field in this command, then the
26618 	 * HWRM shall ignore the enabled auto_XXX field.
26619 	 *
26620 	 * When this bit is set to zero, the link
26621 	 * shall be allowed to autoneg.
26622 	 */
26623 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE			UINT32_C(0x4)
26624 	/*
26625 	 * When this bit is set to '1', the auto-negotiation process
26626 	 * shall be restarted on the link.
26627 	 */
26628 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG		UINT32_C(0x8)
26629 	/*
26630 	 * When this bit is set to '1', Energy Efficient Ethernet
26631 	 * (EEE) is requested to be enabled on this link.
26632 	 * If EEE is not supported on this port, then this flag
26633 	 * shall be ignored by the HWRM.
26634 	 */
26635 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE		UINT32_C(0x10)
26636 	/*
26637 	 * When this bit is set to '1', Energy Efficient Ethernet
26638 	 * (EEE) is requested to be disabled on this link.
26639 	 * If EEE is not supported on this port, then this flag
26640 	 * shall be ignored by the HWRM.
26641 	 */
26642 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE		UINT32_C(0x20)
26643 	/*
26644 	 * When this bit is set to '1' and EEE is enabled on this
26645 	 * link, then TX LPI is requested to be enabled on the link.
26646 	 * If EEE is not supported on this port, then this flag
26647 	 * shall be ignored by the HWRM.
26648 	 * If EEE is disabled on this port, then this flag shall be
26649 	 * ignored by the HWRM.
26650 	 */
26651 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE	UINT32_C(0x40)
26652 	/*
26653 	 * When this bit is set to '1' and EEE is enabled on this
26654 	 * link, then TX LPI is requested to be disabled on the link.
26655 	 * If EEE is not supported on this port, then this flag
26656 	 * shall be ignored by the HWRM.
26657 	 * If EEE is disabled on this port, then this flag shall be
26658 	 * ignored by the HWRM.
26659 	 */
26660 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE	UINT32_C(0x80)
26661 	/*
26662 	 * When set to 1, then the HWRM shall enable FEC autonegotiation
26663 	 * on this port if supported. When enabled, at least one of the
26664 	 * FEC modes must be advertised by enabling the fec_clause_74_enable,
26665 	 * fec_clause_91_enable, fec_rs544_1xn_enable, fec_rs544_ieee_enable,
26666 	 * fec_rs272_1xn_enable, or fec_rs272_ieee_enable flag. If none
26667 	 * of the FEC mode is currently enabled, the HWRM shall choose
26668 	 * a default advertisement setting.
26669 	 * The default advertisement setting can be queried by calling
26670 	 * hwrm_port_phy_qcfg. Note that the link speed must be
26671 	 * in autonegotiation mode for FEC autonegotiation to take effect.
26672 	 * When set to 0, then this flag shall be ignored.
26673 	 * If FEC autonegotiation is not supported, then the HWRM shall
26674 	 * ignore this flag.
26675 	 */
26676 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE	UINT32_C(0x100)
26677 	/*
26678 	 * When set to 1, then the HWRM shall disable FEC autonegotiation
26679 	 * on this port and use forced FEC mode. In forced FEC mode, one
26680 	 * or more FEC forced settings under the same clause can be set.
26681 	 * When set to 0, then this flag shall be ignored.
26682 	 * If FEC autonegotiation is not supported, then the HWRM shall
26683 	 * ignore this flag.
26684 	 */
26685 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE	UINT32_C(0x200)
26686 	/*
26687 	 * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire
26688 	 * Code) on this port if supported, by advertising FEC CLAUSE 74 if
26689 	 * FEC autonegotiation is enabled or force enabled otherwise.
26690 	 * When set to 0, then this flag shall be ignored.
26691 	 * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
26692 	 * flag.
26693 	 */
26694 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE	UINT32_C(0x400)
26695 	/*
26696 	 * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire
26697 	 * Code) on this port if supported, by not advertising FEC CLAUSE 74
26698 	 * if FEC autonegotiation is enabled or force disabled otherwise.
26699 	 * When set to 0, then this flag shall be ignored.
26700 	 * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
26701 	 * flag.
26702 	 */
26703 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE	UINT32_C(0x800)
26704 	/*
26705 	 * When set to 1, then the HWRM shall enable FEC CLAUSE 91
26706 	 * (Reed Solomon RS(528,514) for NRZ) on this port if supported,
26707 	 * by advertising FEC RS(528,514) if FEC autonegotiation is enabled
26708 	 * or force enabled otherwise. In forced FEC mode, this flag
26709 	 * will only take effect if the speed is NRZ. Additional
26710 	 * RS544 or RS272 flags (also under clause 91) may be set for PAM4
26711 	 * in forced FEC mode.
26712 	 * When set to 0, then this flag shall be ignored.
26713 	 * If FEC RS(528,514) is not supported, then the HWRM shall ignore
26714 	 * this flag.
26715 	 */
26716 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE	UINT32_C(0x1000)
26717 	/*
26718 	 * When set to 1, then the HWRM shall disable FEC CLAUSE 91
26719 	 * (Reed Solomon RS(528,514) for NRZ) on this port if supported, by
26720 	 * not advertising RS(528,514) if FEC autonegotiation is enabled or
26721 	 * force disabled otherwise. When set to 0, then this flag shall be
26722 	 * ignored. If FEC RS(528,514) is not supported, then the HWRM
26723 	 * shall ignore this flag.
26724 	 */
26725 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE	UINT32_C(0x2000)
26726 	/*
26727 	 * When this bit is set to '1', the link shall be forced to
26728 	 * be taken down.
26729 	 *
26730 	 * # When this bit is set to '1", all other
26731 	 * command input settings related to the link speed shall
26732 	 * be ignored.
26733 	 * Once the link state is forced down, it can be
26734 	 * explicitly cleared from that state by setting this flag
26735 	 * to '0'.
26736 	 * # If this flag is set to '0', then the link shall be
26737 	 * cleared from forced down state if the link is in forced
26738 	 * down state.
26739 	 * There may be conditions (e.g. out-of-band or sideband
26740 	 * configuration changes for the link) outside the scope
26741 	 * of the HWRM implementation that may clear forced down
26742 	 * link state.
26743 	 */
26744 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN		UINT32_C(0x4000)
26745 	/*
26746 	 * When set to 1, then the HWRM shall enable FEC RS544_1XN
26747 	 * on this port if supported, by advertising FEC RS544_1XN if
26748 	 * FEC autonegotiation is enabled or force enabled otherwise.
26749 	 * In forced mode, this flag will only take effect if the speed is
26750 	 * PAM4. If this flag and fec_rs544_ieee_enable are set, the
26751 	 * HWRM shall choose one of the RS544 modes.
26752 	 * When set to 0, then this flag shall be ignored.
26753 	 * If FEC RS544_1XN is not supported, then the HWRM shall ignore this
26754 	 * flag.
26755 	 */
26756 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_1XN_ENABLE	UINT32_C(0x8000)
26757 	/*
26758 	 * When set to 1, then the HWRM shall disable FEC RS544_1XN
26759 	 * on this port if supported, by not advertising FEC RS544_1XN if
26760 	 * FEC autonegotiation is enabled or force disabled otherwise.
26761 	 * When set to 0, then this flag shall be ignored.
26762 	 * If FEC RS544_1XN is not supported, then the HWRM shall ignore
26763 	 * this flag.
26764 	 */
26765 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_1XN_DISABLE	UINT32_C(0x10000)
26766 	/*
26767 	 * When set to 1, then the HWRM shall enable FEC RS(544,514)
26768 	 * on this port if supported, by advertising FEC RS(544,514) if
26769 	 * FEC autonegotiation is enabled or force enabled otherwise.
26770 	 * In forced mode, this flag will only take effect if the speed is
26771 	 * PAM4. If this flag and fec_rs544_1xn_enable are set, the
26772 	 * HWRM shall choose one of the RS544 modes.
26773 	 * When set to 0, then this flag shall be ignored.
26774 	 * If FEC RS(544,514) is not supported, then the HWRM shall ignore
26775 	 * this flag.
26776 	 */
26777 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_IEEE_ENABLE	UINT32_C(0x20000)
26778 	/*
26779 	 * When set to 1, then the HWRM shall disable FEC RS(544,514)
26780 	 * on this port if supported, by not advertising FEC RS(544,514) if
26781 	 * FEC autonegotiation is enabled or force disabled otherwise.
26782 	 * When set to 0, then this flag shall be ignored.
26783 	 * If FEC RS(544,514) is not supported, then the HWRM shall ignore
26784 	 * this flag.
26785 	 */
26786 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_IEEE_DISABLE	UINT32_C(0x40000)
26787 	/*
26788 	 * When set to 1, then the HWRM shall enable FEC RS272_1XN
26789 	 * on this port if supported, by advertising FEC RS272_1XN if
26790 	 * FEC autonegotiation is enabled or force enabled otherwise.
26791 	 * In forced mode, this flag will only take effect if the speed is
26792 	 * PAM4. If this flag and fec_rs272_ieee_enable are set, the
26793 	 * HWRM shall choose one of the RS272 modes. Note that RS272
26794 	 * and RS544 modes cannot be set at the same time in forced FEC mode.
26795 	 * When set to 0, then this flag shall be ignored.
26796 	 * If FEC RS272_1XN is not supported, then the HWRM shall ignore this
26797 	 * flag.
26798 	 */
26799 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_1XN_ENABLE	UINT32_C(0x80000)
26800 	/*
26801 	 * When set to 1, then the HWRM shall disable FEC RS272_1XN
26802 	 * on this port if supported, by not advertising FEC RS272_1XN if
26803 	 * FEC autonegotiation is enabled or force disabled otherwise.
26804 	 * When set to 0, then this flag shall be ignored.
26805 	 * If FEC RS272_1XN is not supported, then the HWRM shall ignore
26806 	 * this flag.
26807 	 */
26808 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_1XN_DISABLE	UINT32_C(0x100000)
26809 	/*
26810 	 * When set to 1, then the HWRM shall enable FEC RS(272,257)
26811 	 * on this port if supported, by advertising FEC RS(272,257) if
26812 	 * FEC autonegotiation is enabled or force enabled otherwise.
26813 	 * In forced mode, this flag will only take effect if the speed is
26814 	 * PAM4. If this flag and fec_rs272_1xn_enable are set, the
26815 	 * HWRM shall choose one of the RS272 modes. Note that RS272
26816 	 * and RS544 modes cannot be set at the same time in forced FEC mode.
26817 	 * When set to 0, then this flag shall be ignored.
26818 	 * If FEC RS(272,257) is not supported, then the HWRM shall ignore
26819 	 * this flag.
26820 	 */
26821 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_IEEE_ENABLE	UINT32_C(0x200000)
26822 	/*
26823 	 * When set to 1, then the HWRM shall disable FEC RS(272,257)
26824 	 * on this port if supported, by not advertising FEC RS(272,257) if
26825 	 * FEC autonegotiation is enabled or force disabled otherwise.
26826 	 * When set to 0, then this flag shall be ignored.
26827 	 * If FEC RS(272,257) is not supported, then the HWRM shall ignore
26828 	 * this flag.
26829 	 */
26830 	#define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_IEEE_DISABLE	UINT32_C(0x400000)
26831 	uint32_t	enables;
26832 	/*
26833 	 * This bit must be '1' for the auto_mode field to be
26834 	 * configured.
26835 	 */
26836 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE			UINT32_C(0x1)
26837 	/*
26838 	 * This bit must be '1' for the auto_duplex field to be
26839 	 * configured.
26840 	 */
26841 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX		UINT32_C(0x2)
26842 	/*
26843 	 * This bit must be '1' for the auto_pause field to be
26844 	 * configured.
26845 	 */
26846 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE			UINT32_C(0x4)
26847 	/*
26848 	 * This bit must be '1' for the auto_link_speed field to be
26849 	 * configured.
26850 	 */
26851 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED		UINT32_C(0x8)
26852 	/*
26853 	 * This bit must be '1' for the auto_link_speed_mask field to be
26854 	 * configured.
26855 	 */
26856 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK	UINT32_C(0x10)
26857 	/*
26858 	 * This bit must be '1' for the wirespeed field to be
26859 	 * configured.
26860 	 */
26861 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED			UINT32_C(0x20)
26862 	/*
26863 	 * This bit must be '1' for the lpbk field to be
26864 	 * configured.
26865 	 */
26866 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK			UINT32_C(0x40)
26867 	/*
26868 	 * This bit must be '1' for the preemphasis field to be
26869 	 * configured.
26870 	 */
26871 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS		UINT32_C(0x80)
26872 	/*
26873 	 * This bit must be '1' for the force_pause field to be
26874 	 * configured.
26875 	 */
26876 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE		UINT32_C(0x100)
26877 	/*
26878 	 * This bit must be '1' for the eee_link_speed_mask field to be
26879 	 * configured.
26880 	 */
26881 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK	UINT32_C(0x200)
26882 	/*
26883 	 * This bit must be '1' for the tx_lpi_timer field to be
26884 	 * configured.
26885 	 */
26886 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER		UINT32_C(0x400)
26887 	/*
26888 	 * This bit must be '1' for the force_pam4_link_speed field to be
26889 	 * configured.
26890 	 */
26891 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAM4_LINK_SPEED	UINT32_C(0x800)
26892 	/*
26893 	 * This bit must be '1' for the auto_pam4_link_speed_mask field to
26894 	 * be configured.
26895 	 */
26896 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAM4_LINK_SPEED_MASK	UINT32_C(0x1000)
26897 	/*
26898 	 * This bit must be '1' for the force_link_speeds2 field to be
26899 	 * configured.
26900 	 */
26901 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_LINK_SPEEDS2		UINT32_C(0x2000)
26902 	/*
26903 	 * This bit must be '1' for the auto_link_speeds2_mask field to
26904 	 * be configured.
26905 	 */
26906 	#define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEEDS2_MASK	UINT32_C(0x4000)
26907 	/* Port ID of port that is to be configured. */
26908 	uint16_t	port_id;
26909 	/*
26910 	 * This is the speed that will be used if the force
26911 	 * bit is '1'. If unsupported speed is selected, an error
26912 	 * will be generated.
26913 	 */
26914 	uint16_t	force_link_speed;
26915 	/* 100Mb link speed */
26916 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
26917 	/* 1Gb link speed */
26918 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
26919 	/* 2Gb link speed */
26920 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
26921 	/* 25Gb link speed */
26922 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
26923 	/* 10Gb link speed */
26924 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
26925 	/* 20Mb link speed */
26926 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
26927 	/* 25Gb link speed */
26928 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
26929 	/* 40Gb link speed */
26930 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB  UINT32_C(0x190)
26931 	/* 50Gb link speed */
26932 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB  UINT32_C(0x1f4)
26933 	/* 100Gb link speed */
26934 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
26935 	/* 10Mb link speed */
26936 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB  UINT32_C(0xffff)
26937 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_LAST HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB
26938 	/*
26939 	 * This value is used to identify what autoneg mode is
26940 	 * used when the link speed is not being forced.
26941 	 */
26942 	uint8_t	auto_mode;
26943 	/* Disable autoneg or autoneg disabled. No speeds are selected. */
26944 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE	UINT32_C(0x0)
26945 	/* Select all possible speeds for autoneg mode. */
26946 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
26947 	/*
26948 	 * Select only the auto_link_speed speed for autoneg mode. This mode
26949 	 * has been DEPRECATED. An HWRM client should not use this mode.
26950 	 */
26951 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED	UINT32_C(0x2)
26952 	/*
26953 	 * Select the auto_link_speed or any speed below that speed for
26954 	 * autoneg. This mode has been DEPRECATED. An HWRM client should not
26955 	 * use this mode.
26956 	 */
26957 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
26958 	/*
26959 	 * Select the speeds based on the corresponding link speed mask
26960 	 * values that are provided. The included speeds are specified in the
26961 	 * auto_link_speed and auto_pam4_link_speed fields.
26962 	 */
26963 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
26964 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_LAST	HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK
26965 	/*
26966 	 * This is the duplex setting that will be used if the autoneg_mode
26967 	 * is "one_speed" or "one_or_below".
26968 	 */
26969 	uint8_t	auto_duplex;
26970 	/* Half Duplex will be requested. */
26971 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
26972 	/* Full duplex will be requested. */
26973 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
26974 	/* Both Half and Full duplex will be requested. */
26975 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
26976 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_LAST HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH
26977 	/*
26978 	 * This value is used to configure the pause that will be
26979 	 * used for autonegotiation.
26980 	 * Add text on the usage of auto_pause and force_pause.
26981 	 */
26982 	uint8_t	auto_pause;
26983 	/*
26984 	 * When this bit is '1', Generation of tx pause messages
26985 	 * has been requested. Disabled otherwise.
26986 	 */
26987 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX		UINT32_C(0x1)
26988 	/*
26989 	 * When this bit is '1', Reception of rx pause messages
26990 	 * has been requested. Disabled otherwise.
26991 	 */
26992 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX		UINT32_C(0x2)
26993 	/*
26994 	 * When set to 1, the advertisement of pause is enabled.
26995 	 *
26996 	 * # When the auto_mode is not set to none and this flag is
26997 	 * set to 1, then the auto_pause bits on this port are being
26998 	 * advertised and autoneg pause results are being interpreted.
26999 	 * # When the auto_mode is not set to none and this
27000 	 * flag is set to 0, the pause is forced as indicated in
27001 	 * force_pause, and also advertised as auto_pause bits, but
27002 	 * the autoneg results are not interpreted since the pause
27003 	 * configuration is being forced.
27004 	 * # When the auto_mode is set to none and this flag is set to
27005 	 * 1, auto_pause bits should be ignored and should be set to 0.
27006 	 */
27007 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE	UINT32_C(0x4)
27008 	/*
27009 	 * This field is only used by management firmware to communicate with
27010 	 * core firmware regarding phy_port_cfg.
27011 	 * It mainly used to notify core firmware that management firmware is
27012 	 * using port for NCSI over RMII communication or not.
27013 	 */
27014 	uint8_t	mgmt_flag;
27015 	/*
27016 	 * Bit denoting if management firmware is using the link for
27017 	 * NCSI over RMII communication.
27018 	 * When set to 1, management firmware is no longer using the given
27019 	 * port.
27020 	 * When set to 0, management firmware is using the given port.
27021 	 */
27022 	#define HWRM_PORT_PHY_CFG_INPUT_MGMT_FLAG_LINK_RELEASE	UINT32_C(0x1)
27023 	/*
27024 	 * Validity bit, set to 1 to indicate other bits in mgmt_flags are
27025 	 * valid.
27026 	 */
27027 	#define HWRM_PORT_PHY_CFG_INPUT_MGMT_FLAG_MGMT_VALID	UINT32_C(0x80)
27028 	/*
27029 	 * This is the speed that will be used if the autoneg_mode
27030 	 * is "one_speed" or "one_or_below". If an unsupported speed
27031 	 * is selected, an error will be generated.
27032 	 */
27033 	uint16_t	auto_link_speed;
27034 	/* 100Mb link speed */
27035 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
27036 	/* 1Gb link speed */
27037 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
27038 	/* 2Gb link speed */
27039 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
27040 	/* 25Gb link speed */
27041 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
27042 	/* 10Gb link speed */
27043 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
27044 	/* 20Mb link speed */
27045 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
27046 	/* 25Gb link speed */
27047 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
27048 	/* 40Gb link speed */
27049 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
27050 	/* 50Gb link speed */
27051 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
27052 	/* 100Gb link speed */
27053 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
27054 	/* 10Mb link speed */
27055 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB  UINT32_C(0xffff)
27056 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_LAST HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB
27057 	/*
27058 	 * This is a mask of link speeds that will be used if
27059 	 * autoneg_mode is "mask". If unsupported speed is enabled
27060 	 * an error will be generated.
27061 	 */
27062 	uint16_t	auto_link_speed_mask;
27063 	/* 100Mb link speed (Half-duplex) */
27064 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD	UINT32_C(0x1)
27065 	/* 100Mb link speed (Full-duplex) */
27066 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB	UINT32_C(0x2)
27067 	/* 1Gb link speed (Half-duplex) */
27068 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD	UINT32_C(0x4)
27069 	/* 1Gb link speed (Full-duplex) */
27070 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB	UINT32_C(0x8)
27071 	/* 2Gb link speed */
27072 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB	UINT32_C(0x10)
27073 	/* 25Gb link speed */
27074 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB	UINT32_C(0x20)
27075 	/* 10Gb link speed */
27076 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB	UINT32_C(0x40)
27077 	/* 20Gb link speed */
27078 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB	UINT32_C(0x80)
27079 	/* 25Gb link speed */
27080 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB	UINT32_C(0x100)
27081 	/* 40Gb link speed */
27082 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB	UINT32_C(0x200)
27083 	/* 50Gb link speed */
27084 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB	UINT32_C(0x400)
27085 	/* 100Gb link speed */
27086 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB	UINT32_C(0x800)
27087 	/* 10Mb link speed (Half-duplex) */
27088 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD	UINT32_C(0x1000)
27089 	/* 10Mb link speed (Full-duplex) */
27090 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB	UINT32_C(0x2000)
27091 	/* This value controls the wirespeed feature. */
27092 	uint8_t	wirespeed;
27093 	/* Wirespeed feature is disabled. */
27094 	#define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF UINT32_C(0x0)
27095 	/* Wirespeed feature is enabled. */
27096 	#define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON  UINT32_C(0x1)
27097 	#define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_LAST HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON
27098 	/* This value controls the loopback setting for the PHY. */
27099 	uint8_t	lpbk;
27100 	/* No loopback is selected. Normal operation. */
27101 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE	UINT32_C(0x0)
27102 	/*
27103 	 * The HW will be configured with local loopback such that
27104 	 * host data is sent back to the host without modification.
27105 	 */
27106 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL	UINT32_C(0x1)
27107 	/*
27108 	 * The HW will be configured with remote loopback such that
27109 	 * port logic will send packets back out the transmitter that
27110 	 * are received.
27111 	 */
27112 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE   UINT32_C(0x2)
27113 	/*
27114 	 * The HW will be configured with external loopback such that
27115 	 * host data is sent on the transmitter and based on the external
27116 	 * loopback connection the data will be received without
27117 	 * modification.
27118 	 */
27119 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL UINT32_C(0x3)
27120 	#define HWRM_PORT_PHY_CFG_INPUT_LPBK_LAST	HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL
27121 	/*
27122 	 * This value is used to configure the pause that will be
27123 	 * used for force mode.
27124 	 */
27125 	uint8_t	force_pause;
27126 	/*
27127 	 * When this bit is '1', Generation of tx pause messages
27128 	 * is supported. Disabled otherwise.
27129 	 */
27130 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX	UINT32_C(0x1)
27131 	/*
27132 	 * When this bit is '1', Reception of rx pause messages
27133 	 * is supported. Disabled otherwise.
27134 	 */
27135 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX	UINT32_C(0x2)
27136 	uint8_t	unused_1;
27137 	/*
27138 	 * This value controls the pre-emphasis to be used for the
27139 	 * link. Driver should not set this value (use
27140 	 * enable.preemphasis = 0) unless driver is sure of setting.
27141 	 * Normally HWRM FW will determine proper pre-emphasis.
27142 	 */
27143 	uint32_t	preemphasis;
27144 	/*
27145 	 * Setting for link speed mask that is used to
27146 	 * advertise speeds during autonegotiation when EEE is enabled.
27147 	 * This field is valid only when EEE is enabled.
27148 	 * The speeds specified in this field shall be a subset of
27149 	 * speeds specified in auto_link_speed_mask.
27150 	 * If EEE is enabled,then at least one speed shall be provided
27151 	 * in this mask.
27152 	 */
27153 	uint16_t	eee_link_speed_mask;
27154 	/* Reserved */
27155 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1	UINT32_C(0x1)
27156 	/* 100Mb link speed (Full-duplex) */
27157 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB	UINT32_C(0x2)
27158 	/* Reserved */
27159 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2	UINT32_C(0x4)
27160 	/* 1Gb link speed (Full-duplex) */
27161 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB	UINT32_C(0x8)
27162 	/* Reserved */
27163 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3	UINT32_C(0x10)
27164 	/* Reserved */
27165 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4	UINT32_C(0x20)
27166 	/* 10Gb link speed */
27167 	#define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB	UINT32_C(0x40)
27168 	/*
27169 	 * This is the speed that will be used if the force and force_pam4
27170 	 * bits are '1'. If unsupported speed is selected, an error
27171 	 * will be generated.
27172 	 */
27173 	uint16_t	force_pam4_link_speed;
27174 	/* 50Gb link speed */
27175 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_50GB  UINT32_C(0x1f4)
27176 	/* 100Gb link speed */
27177 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_100GB UINT32_C(0x3e8)
27178 	/* 200Gb link speed */
27179 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB UINT32_C(0x7d0)
27180 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_LAST HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB
27181 	/*
27182 	 * Requested setting of TX LPI timer in microseconds.
27183 	 * This field is valid only when EEE is enabled and TX LPI is
27184 	 * enabled.
27185 	 */
27186 	uint32_t	tx_lpi_timer;
27187 	#define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
27188 	#define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
27189 	/* This field specifies which PAM4 speeds are enabled for auto mode. */
27190 	uint16_t	auto_link_pam4_speed_mask;
27191 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_50G	UINT32_C(0x1)
27192 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_100G	UINT32_C(0x2)
27193 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_200G	UINT32_C(0x4)
27194 	/*
27195 	 * This is the speed that will be used if the force_link_speeds2
27196 	 * bit is '1'. If unsupported speed is selected, an error
27197 	 * will be generated.
27198 	 */
27199 	uint16_t	force_link_speeds2;
27200 	/* 1Gb link speed */
27201 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_1GB		UINT32_C(0xa)
27202 	/* 10Gb (NRZ: 10G per lane, 1 lane) link speed */
27203 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_10GB	UINT32_C(0x64)
27204 	/* 25Gb (NRZ: 25G per lane, 1 lane) link speed */
27205 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_25GB	UINT32_C(0xfa)
27206 	/* 40Gb (NRZ: 10G per lane, 4 lanes) link speed */
27207 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_40GB	UINT32_C(0x190)
27208 	/* 50Gb (NRZ: 25G per lane, 2 lanes) link speed */
27209 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_50GB	UINT32_C(0x1f4)
27210 	/* 100Gb (NRZ: 25G per lane, 4 lanes) link speed */
27211 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_100GB	UINT32_C(0x3e8)
27212 	/* 50Gb (PAM4-56: 50G per lane, 1 lane) link speed */
27213 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_50GB_PAM4_56   UINT32_C(0x1f5)
27214 	/* 100Gb (PAM4-56: 50G per lane, 2 lanes) link speed */
27215 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_100GB_PAM4_56  UINT32_C(0x3e9)
27216 	/* 200Gb (PAM4-56: 50G per lane, 4 lanes) link speed */
27217 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_200GB_PAM4_56  UINT32_C(0x7d1)
27218 	/* 400Gb (PAM4-56: 50G per lane, 8 lanes) link speed */
27219 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_400GB_PAM4_56  UINT32_C(0xfa1)
27220 	/* 100Gb (PAM4-112: 100G per lane, 1 lane) link speed */
27221 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_100GB_PAM4_112 UINT32_C(0x3ea)
27222 	/* 200Gb (PAM4-112: 100G per lane, 2 lanes) link speed */
27223 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_200GB_PAM4_112 UINT32_C(0x7d2)
27224 	/* 400Gb (PAM4-112: 100G per lane, 4 lanes) link speed */
27225 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_400GB_PAM4_112 UINT32_C(0xfa2)
27226 	/* 800Gb (PAM4-112: 100G per lane, 8 lanes) link speed */
27227 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_800GB_PAM4_112 UINT32_C(0x1f42)
27228 	#define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_LAST	HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEEDS2_800GB_PAM4_112
27229 	/*
27230 	 * This is a mask of link speeds that will be used if
27231 	 * auto_link_speeds2_mask bit in the "enables" field is 1.
27232 	 * If unsupported speed is enabled an error will be generated.
27233 	 */
27234 	uint16_t	auto_link_speeds2_mask;
27235 	/* 1Gb link speed */
27236 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_1GB		UINT32_C(0x1)
27237 	/* 10Gb (NRZ: 10G per lane, 1 lane) link speed */
27238 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_10GB		UINT32_C(0x2)
27239 	/* 25Gb (NRZ: 25G per lane, 1 lane) link speed */
27240 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_25GB		UINT32_C(0x4)
27241 	/* 40Gb (NRZ: 10G per lane, 4 lanes) link speed */
27242 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_40GB		UINT32_C(0x8)
27243 	/* 50Gb (NRZ: 25G per lane, 2 lanes) link speed */
27244 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_50GB		UINT32_C(0x10)
27245 	/* 100Gb (NRZ: 25G per lane, 4 lanes) link speed */
27246 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_100GB		UINT32_C(0x20)
27247 	/* 50Gb (PAM4-56: 50G per lane, 1 lane) link speed */
27248 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_50GB_PAM4_56	UINT32_C(0x40)
27249 	/* 100Gb (PAM4-56: 50G per lane, 2 lanes) link speed */
27250 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_100GB_PAM4_56	UINT32_C(0x80)
27251 	/* 200Gb (PAM4-56: 50G per lane, 4 lanes) link speed */
27252 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_200GB_PAM4_56	UINT32_C(0x100)
27253 	/* 400Gb (PAM4-56: 50G per lane, 8 lanes) link speed */
27254 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_400GB_PAM4_56	UINT32_C(0x200)
27255 	/* 100Gb (PAM4-112: 100G per lane, 1 lane) link speed */
27256 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_100GB_PAM4_112	UINT32_C(0x400)
27257 	/* 200Gb (PAM4-112: 100G per lane, 2 lanes) link speed */
27258 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_200GB_PAM4_112	UINT32_C(0x800)
27259 	/* 400Gb (PAM4-112: 100G per lane, 4 lanes) link speed */
27260 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_400GB_PAM4_112	UINT32_C(0x1000)
27261 	/* 800Gb (PAM4-112: 100G per lane, 8 lanes) link speed */
27262 	#define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEEDS2_MASK_800GB_PAM4_112	UINT32_C(0x2000)
27263 	uint8_t	unused_2[6];
27264 } hwrm_port_phy_cfg_input_t, *phwrm_port_phy_cfg_input_t;
27265 
27266 /* hwrm_port_phy_cfg_output (size:128b/16B) */
27267 
27268 typedef struct hwrm_port_phy_cfg_output {
27269 	/* The specific error status for the command. */
27270 	uint16_t	error_code;
27271 	/* The HWRM command request type. */
27272 	uint16_t	req_type;
27273 	/* The sequence ID from the original command. */
27274 	uint16_t	seq_id;
27275 	/* The length of the response data in number of bytes. */
27276 	uint16_t	resp_len;
27277 	uint8_t	unused_0[7];
27278 	/*
27279 	 * This field is used in Output records to indicate that the output
27280 	 * is completely written to RAM. This field should be read as '1'
27281 	 * to indicate that the output has been completely written. When
27282 	 * writing a command completion or response to an internal processor,
27283 	 * the order of writes has to be such that this field is written last.
27284 	 */
27285 	uint8_t	valid;
27286 } hwrm_port_phy_cfg_output_t, *phwrm_port_phy_cfg_output_t;
27287 
27288 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */
27289 
27290 typedef struct hwrm_port_phy_cfg_cmd_err {
27291 	/*
27292 	 * command specific error codes that goes to
27293 	 * the cmd_err field in Common HWRM Error Response.
27294 	 */
27295 	uint8_t	code;
27296 	/* Unknown error */
27297 	#define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
27298 	/* Unable to complete operation due to invalid speed */
27299 	#define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_ILLEGAL_SPEED UINT32_C(0x1)
27300 	/*
27301 	 * retry the command since the phy is not ready.
27302 	 * retry count is returned in opaque_0.
27303 	 * This is only valid for the first command and
27304 	 * this value will not change for successive calls.
27305 	 * but if a 0 is returned at any time then this should
27306 	 * be treated as an un recoverable failure,
27307 	 *
27308 	 * retry interval in milliseconds is returned in opaque_1.
27309 	 * This specifies the time that user should wait before
27310 	 * issuing the next port_phy_cfg command.
27311 	 */
27312 	#define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY	UINT32_C(0x2)
27313 	#define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST	HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY
27314 	uint8_t	unused_0[7];
27315 } hwrm_port_phy_cfg_cmd_err_t, *phwrm_port_phy_cfg_cmd_err_t;
27316 
27317 /**********************
27318  * hwrm_port_phy_qcfg *
27319  **********************/
27320 
27321 
27322 /* hwrm_port_phy_qcfg_input (size:192b/24B) */
27323 
27324 typedef struct hwrm_port_phy_qcfg_input {
27325 	/* The HWRM command request type. */
27326 	uint16_t	req_type;
27327 	/*
27328 	 * The completion ring to send the completion event on. This should
27329 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
27330 	 */
27331 	uint16_t	cmpl_ring;
27332 	/*
27333 	 * The sequence ID is used by the driver for tracking multiple
27334 	 * commands. This ID is treated as opaque data by the firmware and
27335 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
27336 	 */
27337 	uint16_t	seq_id;
27338 	/*
27339 	 * The target ID of the command:
27340 	 * * 0x0-0xFFF8 - The function ID
27341 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27342 	 * * 0xFFFD - Reserved for user-space HWRM interface
27343 	 * * 0xFFFF - HWRM
27344 	 */
27345 	uint16_t	target_id;
27346 	/*
27347 	 * A physical address pointer pointing to a host buffer that the
27348 	 * command's response data will be written. This can be either a host
27349 	 * physical address (HPA) or a guest physical address (GPA) and must
27350 	 * point to a physically contiguous block of memory.
27351 	 */
27352 	uint64_t	resp_addr;
27353 	/* Port ID of port that is to be queried. */
27354 	uint16_t	port_id;
27355 	uint8_t	unused_0[6];
27356 } hwrm_port_phy_qcfg_input_t, *phwrm_port_phy_qcfg_input_t;
27357 
27358 /* hwrm_port_phy_qcfg_output (size:832b/104B) */
27359 
27360 typedef struct hwrm_port_phy_qcfg_output {
27361 	/* The specific error status for the command. */
27362 	uint16_t	error_code;
27363 	/* The HWRM command request type. */
27364 	uint16_t	req_type;
27365 	/* The sequence ID from the original command. */
27366 	uint16_t	seq_id;
27367 	/* The length of the response data in number of bytes. */
27368 	uint16_t	resp_len;
27369 	/* This value indicates the current link status. */
27370 	uint8_t	link;
27371 	/* There is no link or cable detected. */
27372 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
27373 	/* There is no link, but a cable has been detected. */
27374 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL  UINT32_C(0x1)
27375 	/* There is a link. */
27376 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK	UINT32_C(0x2)
27377 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LAST   HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK
27378 	uint8_t	active_fec_signal_mode;
27379 	/*
27380 	 * This value indicates the current link signaling mode of the
27381 	 * connection.
27382 	 */
27383 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_MASK		UINT32_C(0xf)
27384 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_SFT		0
27385 	/* NRZ signaling */
27386 		#define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_NRZ		UINT32_C(0x0)
27387 	/* PAM4-56 signaling */
27388 		#define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4		UINT32_C(0x1)
27389 	/* PAM4-112 signaling */
27390 		#define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4_112		UINT32_C(0x2)
27391 		#define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_LAST		HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4_112
27392 	/* This value indicates the current active FEC mode. */
27393 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_MASK		UINT32_C(0xf0)
27394 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_SFT		4
27395 	/* No active FEC */
27396 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_NONE_ACTIVE	(UINT32_C(0x0) << 4)
27397 	/* FEC CLAUSE 74 (Fire Code) active, autonegotiated or forced. */
27398 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_CLAUSE74_ACTIVE	(UINT32_C(0x1) << 4)
27399 	/* FEC CLAUSE 91 RS(528,514) active, autonegotiated or forced. */
27400 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_CLAUSE91_ACTIVE	(UINT32_C(0x2) << 4)
27401 	/* FEC RS544_1XN active, autonegotiated or forced. */
27402 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS544_1XN_ACTIVE   (UINT32_C(0x3) << 4)
27403 	/* FEC RS(544,528) active, autonegotiated or forced. */
27404 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS544_IEEE_ACTIVE  (UINT32_C(0x4) << 4)
27405 	/* FEC RS272_1XN active, autonegotiated or forced. */
27406 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_1XN_ACTIVE   (UINT32_C(0x5) << 4)
27407 	/* FEC RS(272,257) active, autonegotiated or forced. */
27408 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_IEEE_ACTIVE  (UINT32_C(0x6) << 4)
27409 		#define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_LAST		HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_IEEE_ACTIVE
27410 	/*
27411 	 * This value indicates the current link speed of the connection.
27412 	 * The signal_mode field indicates if the link is using
27413 	 * NRZ or PAM4 signaling.
27414 	 */
27415 	uint16_t	link_speed;
27416 	/* 100Mb link speed */
27417 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
27418 	/* 1Gb link speed */
27419 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB   UINT32_C(0xa)
27420 	/* 2Gb link speed */
27421 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB   UINT32_C(0x14)
27422 	/* 25Gb link speed */
27423 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
27424 	/* 10Gb link speed */
27425 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB  UINT32_C(0x64)
27426 	/* 20Mb link speed */
27427 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB  UINT32_C(0xc8)
27428 	/* 25Gb link speed */
27429 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB  UINT32_C(0xfa)
27430 	/* 40Gb link speed */
27431 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB  UINT32_C(0x190)
27432 	/* 50Gb link speed */
27433 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB  UINT32_C(0x1f4)
27434 	/* 100Gb link speed */
27435 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
27436 	/* 200Gb link speed */
27437 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_200GB UINT32_C(0x7d0)
27438 	/* 400Gb link speed */
27439 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_400GB UINT32_C(0xfa0)
27440 	/* 800Gb link speed */
27441 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_800GB UINT32_C(0x1f40)
27442 	/* 10Mb link speed */
27443 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB  UINT32_C(0xffff)
27444 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB
27445 	/*
27446 	 * This value is indicates the duplex of the current
27447 	 * configuration.
27448 	 */
27449 	uint8_t	duplex_cfg;
27450 	/* Half Duplex connection. */
27451 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0)
27452 	/* Full duplex connection. */
27453 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1)
27454 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_LAST HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL
27455 	/*
27456 	 * This value is used to indicate the current
27457 	 * pause configuration. When autoneg is enabled, this value
27458 	 * represents the autoneg results of pause configuration.
27459 	 */
27460 	uint8_t	pause;
27461 	/*
27462 	 * When this bit is '1', Generation of tx pause messages
27463 	 * is supported. Disabled otherwise.
27464 	 */
27465 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX	UINT32_C(0x1)
27466 	/*
27467 	 * When this bit is '1', Reception of rx pause messages
27468 	 * is supported. Disabled otherwise.
27469 	 */
27470 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX	UINT32_C(0x2)
27471 	/*
27472 	 * The supported speeds for the port. This is a bit mask.
27473 	 * For each speed that is supported, the corresponding
27474 	 * bit will be set to '1'.
27475 	 */
27476 	uint16_t	support_speeds;
27477 	/* 100Mb link speed (Half-duplex) */
27478 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD	UINT32_C(0x1)
27479 	/* 100Mb link speed (Full-duplex) */
27480 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB	UINT32_C(0x2)
27481 	/* 1Gb link speed (Half-duplex) */
27482 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD	UINT32_C(0x4)
27483 	/* 1Gb link speed (Full-duplex) */
27484 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB	UINT32_C(0x8)
27485 	/* 2Gb link speed */
27486 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB	UINT32_C(0x10)
27487 	/* 25Gb link speed */
27488 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB	UINT32_C(0x20)
27489 	/* 10Gb link speed */
27490 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB	UINT32_C(0x40)
27491 	/* 20Gb link speed */
27492 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB	UINT32_C(0x80)
27493 	/* 25Gb link speed */
27494 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB	UINT32_C(0x100)
27495 	/* 40Gb link speed */
27496 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB	UINT32_C(0x200)
27497 	/* 50Gb link speed */
27498 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB	UINT32_C(0x400)
27499 	/* 100Gb link speed */
27500 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB	UINT32_C(0x800)
27501 	/* 10Mb link speed (Half-duplex) */
27502 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD	UINT32_C(0x1000)
27503 	/* 10Mb link speed (Full-duplex) */
27504 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB	UINT32_C(0x2000)
27505 	/*
27506 	 * Current setting of forced link speed.
27507 	 * When the link speed is not being forced, this
27508 	 * value shall be set to 0.
27509 	 */
27510 	uint16_t	force_link_speed;
27511 	/* 100Mb link speed */
27512 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
27513 	/* 1Gb link speed */
27514 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
27515 	/* 2Gb link speed */
27516 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
27517 	/* 25Gb link speed */
27518 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
27519 	/* 10Gb link speed */
27520 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
27521 	/* 20Mb link speed */
27522 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
27523 	/* 25Gb link speed */
27524 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
27525 	/* 40Gb link speed */
27526 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB  UINT32_C(0x190)
27527 	/* 50Gb link speed */
27528 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB  UINT32_C(0x1f4)
27529 	/* 100Gb link speed */
27530 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
27531 	/* 10Mb link speed */
27532 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB  UINT32_C(0xffff)
27533 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB
27534 	/* Current setting of auto negotiation mode. */
27535 	uint8_t	auto_mode;
27536 	/* Disable autoneg or autoneg disabled. No speeds are selected. */
27537 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE	UINT32_C(0x0)
27538 	/* Select all possible speeds for autoneg mode. */
27539 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
27540 	/*
27541 	 * Select only the auto_link_speed speed for autoneg mode. This mode
27542 	 * has been DEPRECATED. An HWRM client should not use this mode.
27543 	 */
27544 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED	UINT32_C(0x2)
27545 	/*
27546 	 * Select the auto_link_speed or any speed below that speed for
27547 	 * autoneg. This mode has been DEPRECATED. An HWRM client should not
27548 	 * use this mode.
27549 	 */
27550 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
27551 	/*
27552 	 * Select the speeds based on the corresponding link speed mask value
27553 	 * that is provided.
27554 	 */
27555 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
27556 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK
27557 	/*
27558 	 * Current setting of pause autonegotiation.
27559 	 * Move autoneg_pause flag here.
27560 	 */
27561 	uint8_t	auto_pause;
27562 	/*
27563 	 * When this bit is '1', Generation of tx pause messages
27564 	 * has been requested. Disabled otherwise.
27565 	 */
27566 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX		UINT32_C(0x1)
27567 	/*
27568 	 * When this bit is '1', Reception of rx pause messages
27569 	 * has been requested. Disabled otherwise.
27570 	 */
27571 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX		UINT32_C(0x2)
27572 	/*
27573 	 * When set to 1, the advertisement of pause is enabled.
27574 	 *
27575 	 * # When the auto_mode is not set to none and this flag is
27576 	 * set to 1, then the auto_pause bits on this port are being
27577 	 * advertised and autoneg pause results are being interpreted.
27578 	 * # When the auto_mode is not set to none and this
27579 	 * flag is set to 0, the pause is forced as indicated in
27580 	 * force_pause, and also advertised as auto_pause bits, but
27581 	 * the autoneg results are not interpreted since the pause
27582 	 * configuration is being forced.
27583 	 * # When the auto_mode is set to none and this flag is set to
27584 	 * 1, auto_pause bits should be ignored and should be set to 0.
27585 	 */
27586 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE	UINT32_C(0x4)
27587 	/*
27588 	 * Current setting for auto_link_speed. This field is only
27589 	 * valid when auto_mode is set to "one_speed" or "one_or_below".
27590 	 */
27591 	uint16_t	auto_link_speed;
27592 	/* 100Mb link speed */
27593 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
27594 	/* 1Gb link speed */
27595 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
27596 	/* 2Gb link speed */
27597 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
27598 	/* 25Gb link speed */
27599 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
27600 	/* 10Gb link speed */
27601 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
27602 	/* 20Mb link speed */
27603 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
27604 	/* 25Gb link speed */
27605 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
27606 	/* 40Gb link speed */
27607 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
27608 	/* 50Gb link speed */
27609 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
27610 	/* 100Gb link speed */
27611 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
27612 	/* 10Mb link speed */
27613 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB  UINT32_C(0xffff)
27614 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB
27615 	/*
27616 	 * Current setting for auto_link_speed_mask that is used to
27617 	 * advertise speeds during autonegotiation.
27618 	 * This field is only valid when auto_mode is set to "mask".
27619 	 * The speeds specified in this field shall be a subset of
27620 	 * supported speeds on this port.
27621 	 */
27622 	uint16_t	auto_link_speed_mask;
27623 	/* 100Mb link speed (Half-duplex) */
27624 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD	UINT32_C(0x1)
27625 	/* 100Mb link speed (Full-duplex) */
27626 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB	UINT32_C(0x2)
27627 	/* 1Gb link speed (Half-duplex) */
27628 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD	UINT32_C(0x4)
27629 	/* 1Gb link speed (Full-duplex) */
27630 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB	UINT32_C(0x8)
27631 	/* 2Gb link speed */
27632 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB	UINT32_C(0x10)
27633 	/* 25Gb link speed */
27634 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB	UINT32_C(0x20)
27635 	/* 10Gb link speed */
27636 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB	UINT32_C(0x40)
27637 	/* 20Gb link speed */
27638 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB	UINT32_C(0x80)
27639 	/* 25Gb link speed */
27640 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB	UINT32_C(0x100)
27641 	/* 40Gb link speed */
27642 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB	UINT32_C(0x200)
27643 	/* 50Gb link speed */
27644 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB	UINT32_C(0x400)
27645 	/* 100Gb link speed */
27646 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB	UINT32_C(0x800)
27647 	/* 10Mb link speed (Half-duplex) */
27648 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD	UINT32_C(0x1000)
27649 	/* 10Mb link speed (Full-duplex) */
27650 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB	UINT32_C(0x2000)
27651 	/* Current setting for wirespeed. */
27652 	uint8_t	wirespeed;
27653 	/* Wirespeed feature is disabled. */
27654 	#define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF UINT32_C(0x0)
27655 	/* Wirespeed feature is enabled. */
27656 	#define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON  UINT32_C(0x1)
27657 	#define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON
27658 	/* Current setting for loopback. */
27659 	uint8_t	lpbk;
27660 	/* No loopback is selected. Normal operation. */
27661 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE	UINT32_C(0x0)
27662 	/*
27663 	 * The HW will be configured with local loopback such that
27664 	 * host data is sent back to the host without modification.
27665 	 */
27666 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL	UINT32_C(0x1)
27667 	/*
27668 	 * The HW will be configured with remote loopback such that
27669 	 * port logic will send packets back out the transmitter that
27670 	 * are received.
27671 	 */
27672 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE   UINT32_C(0x2)
27673 	/*
27674 	 * The HW will be configured with external loopback such that
27675 	 * host data is sent on the transmitter and based on the external
27676 	 * loopback connection the data will be received without
27677 	 * modification.
27678 	 */
27679 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL UINT32_C(0x3)
27680 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL
27681 	/*
27682 	 * Current setting of forced pause.
27683 	 * When the pause configuration is not being forced, then
27684 	 * this value shall be set to 0.
27685 	 */
27686 	uint8_t	force_pause;
27687 	/*
27688 	 * When this bit is '1', Generation of tx pause messages
27689 	 * is supported. Disabled otherwise.
27690 	 */
27691 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX	UINT32_C(0x1)
27692 	/*
27693 	 * When this bit is '1', Reception of rx pause messages
27694 	 * is supported. Disabled otherwise.
27695 	 */
27696 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX	UINT32_C(0x2)
27697 	/*
27698 	 * This value indicates the current status of the optics module on
27699 	 * this port.
27700 	 */
27701 	uint8_t	module_status;
27702 	/* Module is inserted and accepted */
27703 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE	UINT32_C(0x0)
27704 	/* Module is rejected and transmit side Laser is disabled. */
27705 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX	UINT32_C(0x1)
27706 	/* Module mismatch warning. */
27707 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG	UINT32_C(0x2)
27708 	/* Module is rejected and powered down. */
27709 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN	UINT32_C(0x3)
27710 	/* Module is not inserted. */
27711 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED   UINT32_C(0x4)
27712 	/* Module is powered down because of over current fault. */
27713 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_CURRENTFAULT  UINT32_C(0x5)
27714 	/* Module is overheated. */
27715 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_OVERHEATED	UINT32_C(0x6)
27716 	/* Module status is not applicable. */
27717 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE UINT32_C(0xff)
27718 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE
27719 	/* Current setting for preemphasis. */
27720 	uint32_t	preemphasis;
27721 	/* This field represents the major version of the PHY. */
27722 	uint8_t	phy_maj;
27723 	/* This field represents the minor version of the PHY. */
27724 	uint8_t	phy_min;
27725 	/* This field represents the build version of the PHY. */
27726 	uint8_t	phy_bld;
27727 	/* This value represents a PHY type. */
27728 	uint8_t	phy_type;
27729 	/* Unknown */
27730 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN	UINT32_C(0x0)
27731 	/* BASE-CR */
27732 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR	UINT32_C(0x1)
27733 	/* BASE-KR4 (Deprecated) */
27734 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4	UINT32_C(0x2)
27735 	/* BASE-LR */
27736 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR	UINT32_C(0x3)
27737 	/* BASE-SR */
27738 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR	UINT32_C(0x4)
27739 	/* BASE-KR2 (Deprecated) */
27740 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2	UINT32_C(0x5)
27741 	/* BASE-KX */
27742 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX	UINT32_C(0x6)
27743 	/* BASE-KR */
27744 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR	UINT32_C(0x7)
27745 	/* BASE-T */
27746 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET		UINT32_C(0x8)
27747 	/* EEE capable BASE-T */
27748 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE	UINT32_C(0x9)
27749 	/* SGMII connected external PHY */
27750 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY	UINT32_C(0xa)
27751 	/* 25G_BASECR_CA_L */
27752 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L  UINT32_C(0xb)
27753 	/* 25G_BASECR_CA_S */
27754 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S  UINT32_C(0xc)
27755 	/* 25G_BASECR_CA_N */
27756 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N  UINT32_C(0xd)
27757 	/* 25G_BASESR */
27758 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR	UINT32_C(0xe)
27759 	/* 100G_BASECR4 */
27760 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4	UINT32_C(0xf)
27761 	/* 100G_BASESR4 */
27762 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4	UINT32_C(0x10)
27763 	/* 100G_BASELR4 */
27764 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4	UINT32_C(0x11)
27765 	/* 100G_BASEER4 */
27766 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4	UINT32_C(0x12)
27767 	/* 100G_BASESR10 */
27768 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10	UINT32_C(0x13)
27769 	/* 40G_BASECR4 */
27770 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4	UINT32_C(0x14)
27771 	/* 40G_BASESR4 */
27772 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4	UINT32_C(0x15)
27773 	/* 40G_BASELR4 */
27774 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4	UINT32_C(0x16)
27775 	/* 40G_BASEER4 */
27776 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4	UINT32_C(0x17)
27777 	/* 40G_ACTIVE_CABLE */
27778 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE UINT32_C(0x18)
27779 	/* 1G_baseT */
27780 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET	UINT32_C(0x19)
27781 	/* 1G_baseSX */
27782 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX	UINT32_C(0x1a)
27783 	/* 1G_baseCX */
27784 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX	UINT32_C(0x1b)
27785 	/* 200G_BASECR4 */
27786 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASECR4	UINT32_C(0x1c)
27787 	/* 200G_BASESR4 */
27788 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASESR4	UINT32_C(0x1d)
27789 	/* 200G_BASELR4 */
27790 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASELR4	UINT32_C(0x1e)
27791 	/* 200G_BASEER4 */
27792 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4	UINT32_C(0x1f)
27793 	/* 50G_BASECR */
27794 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASECR	UINT32_C(0x20)
27795 	/* 50G_BASESR */
27796 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASESR	UINT32_C(0x21)
27797 	/* 50G_BASELR */
27798 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASELR	UINT32_C(0x22)
27799 	/* 50G_BASEER */
27800 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASEER	UINT32_C(0x23)
27801 	/* 100G_BASECR2 */
27802 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR2	UINT32_C(0x24)
27803 	/* 100G_BASESR2 */
27804 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR2	UINT32_C(0x25)
27805 	/* 100G_BASELR2 */
27806 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR2	UINT32_C(0x26)
27807 	/* 100G_BASEER2 */
27808 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER2	UINT32_C(0x27)
27809 	/* 400G_BASECR */
27810 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR	UINT32_C(0x28)
27811 	/* 100G_BASESR */
27812 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR	UINT32_C(0x29)
27813 	/* 100G_BASELR */
27814 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR	UINT32_C(0x2a)
27815 	/* 100G_BASEER */
27816 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER	UINT32_C(0x2b)
27817 	/* 200G_BASECR2 */
27818 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASECR2	UINT32_C(0x2c)
27819 	/* 200G_BASESR2 */
27820 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASESR2	UINT32_C(0x2d)
27821 	/* 200G_BASELR2 */
27822 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASELR2	UINT32_C(0x2e)
27823 	/* 200G_BASEER2 */
27824 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER2	UINT32_C(0x2f)
27825 	/* 400G_BASECR8 */
27826 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_400G_BASECR8	UINT32_C(0x30)
27827 	/* 200G_BASESR8 */
27828 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_400G_BASESR8	UINT32_C(0x31)
27829 	/* 400G_BASELR8 */
27830 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_400G_BASELR8	UINT32_C(0x32)
27831 	/* 400G_BASEER8 */
27832 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_400G_BASEER8	UINT32_C(0x33)
27833 	/* 400G_BASECR4 */
27834 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_400G_BASECR4	UINT32_C(0x34)
27835 	/* 400G_BASESR4 */
27836 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_400G_BASESR4	UINT32_C(0x35)
27837 	/* 400G_BASELR4 */
27838 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_400G_BASELR4	UINT32_C(0x36)
27839 	/* 400G_BASEER4 */
27840 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_400G_BASEER4	UINT32_C(0x37)
27841 	/* 800G_BASECR8 */
27842 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_800G_BASECR8	UINT32_C(0x38)
27843 	/* 800G_BASESR8 */
27844 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_800G_BASESR8	UINT32_C(0x39)
27845 	/* 800G_BASELR8 */
27846 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_800G_BASELR8	UINT32_C(0x3a)
27847 	/* 800G_BASEER8 */
27848 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_800G_BASEER8	UINT32_C(0x3b)
27849 	/* 800G_BASEFR8 */
27850 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_800G_BASEFR8	UINT32_C(0x3c)
27851 	/* 800G_BASEDR8 */
27852 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_800G_BASEDR8	UINT32_C(0x3d)
27853 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_LAST		HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_800G_BASEDR8
27854 	/* This value represents a media type. */
27855 	uint8_t	media_type;
27856 	/* Unknown */
27857 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
27858 	/* Twisted Pair */
27859 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP	UINT32_C(0x1)
27860 	/* Direct Attached Copper */
27861 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC	UINT32_C(0x2)
27862 	/* Fiber */
27863 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE   UINT32_C(0x3)
27864 	#define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_LAST   HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE
27865 	/* This value represents a transceiver type. */
27866 	uint8_t	xcvr_pkg_type;
27867 	/* PHY and MAC are in the same package */
27868 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL UINT32_C(0x1)
27869 	/* PHY and MAC are in different packages */
27870 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL UINT32_C(0x2)
27871 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL
27872 	uint8_t	eee_config_phy_addr;
27873 	/* This field represents PHY address. */
27874 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK		UINT32_C(0x1f)
27875 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT		0
27876 	/*
27877 	 * This field represents flags related to EEE configuration.
27878 	 * These EEE configuration flags are valid only when the
27879 	 * auto_mode is not set to none (in other words autonegotiation
27880 	 * is enabled).
27881 	 */
27882 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK		UINT32_C(0xe0)
27883 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT		5
27884 	/*
27885 	 * When set to 1, Energy Efficient Ethernet (EEE) mode is
27886 	 * enabled. Speeds for autoneg with EEE mode enabled are based on
27887 	 * eee_link_speed_mask.
27888 	 */
27889 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED	UINT32_C(0x20)
27890 	/*
27891 	 * This flag is valid only when eee_enabled is set to 1.
27892 	 *
27893 	 * # If eee_enabled is set to 0, then EEE mode is disabled
27894 	 * and this flag shall be ignored.
27895 	 * # If eee_enabled is set to 1 and this flag is set to 1,
27896 	 * then Energy Efficient Ethernet (EEE) mode is enabled
27897 	 * and in use.
27898 	 * # If eee_enabled is set to 1 and this flag is set to 0,
27899 	 * then Energy Efficient Ethernet (EEE) mode is enabled
27900 	 * but is currently not in use.
27901 	 */
27902 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE	UINT32_C(0x40)
27903 	/*
27904 	 * This flag is valid only when eee_enabled is set to 1.
27905 	 *
27906 	 * # If eee_enabled is set to 0, then EEE mode is disabled
27907 	 * and this flag shall be ignored.
27908 	 * # If eee_enabled is set to 1 and this flag is set to 1,
27909 	 * then Energy Efficient Ethernet (EEE) mode is enabled
27910 	 * and TX LPI is enabled.
27911 	 * # If eee_enabled is set to 1 and this flag is set to 0,
27912 	 * then Energy Efficient Ethernet (EEE) mode is enabled
27913 	 * but TX LPI is disabled.
27914 	 */
27915 	#define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI	UINT32_C(0x80)
27916 	/*
27917 	 * When set to 1, the parallel detection is used to determine
27918 	 * the speed of the link partner.
27919 	 *
27920 	 * Parallel detection is used when a autonegotiation capable
27921 	 * device is connected to a link partner that is not capable
27922 	 * of autonegotiation.
27923 	 */
27924 	uint8_t	parallel_detect;
27925 	/*
27926 	 * When set to 1, the parallel detection is used to determine
27927 	 * the speed of the link partner.
27928 	 *
27929 	 * Parallel detection is used when a autonegotiation capable
27930 	 * device is connected to a link partner that is not capable
27931 	 * of autonegotiation.
27932 	 */
27933 	#define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT	UINT32_C(0x1)
27934 	/*
27935 	 * The advertised speeds for the port by the link partner.
27936 	 * Each advertised speed will be set to '1'.
27937 	 */
27938 	uint16_t	link_partner_adv_speeds;
27939 	/* 100Mb link speed (Half-duplex) */
27940 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD	UINT32_C(0x1)
27941 	/* 100Mb link speed (Full-duplex) */
27942 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB	UINT32_C(0x2)
27943 	/* 1Gb link speed (Half-duplex) */
27944 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD	UINT32_C(0x4)
27945 	/* 1Gb link speed (Full-duplex) */
27946 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB	UINT32_C(0x8)
27947 	/* 2Gb link speed */
27948 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB	UINT32_C(0x10)
27949 	/* 25Gb link speed */
27950 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB	UINT32_C(0x20)
27951 	/* 10Gb link speed */
27952 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB	UINT32_C(0x40)
27953 	/* 20Gb link speed */
27954 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB	UINT32_C(0x80)
27955 	/* 25Gb link speed */
27956 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB	UINT32_C(0x100)
27957 	/* 40Gb link speed */
27958 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB	UINT32_C(0x200)
27959 	/* 50Gb link speed */
27960 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB	UINT32_C(0x400)
27961 	/* 100Gb link speed */
27962 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB	UINT32_C(0x800)
27963 	/* 10Mb link speed (Half-duplex) */
27964 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD	UINT32_C(0x1000)
27965 	/* 10Mb link speed (Full-duplex) */
27966 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB	UINT32_C(0x2000)
27967 	/*
27968 	 * The advertised autoneg for the port by the link partner.
27969 	 * This field is deprecated and should be set to 0.
27970 	 */
27971 	uint8_t	link_partner_adv_auto_mode;
27972 	/* Disable autoneg or autoneg disabled. No speeds are selected. */
27973 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE	UINT32_C(0x0)
27974 	/* Select all possible speeds for autoneg mode. */
27975 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
27976 	/*
27977 	 * Select only the auto_link_speed speed for autoneg mode. This mode
27978 	 * has been DEPRECATED. An HWRM client should not use this mode.
27979 	 */
27980 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED	UINT32_C(0x2)
27981 	/*
27982 	 * Select the auto_link_speed or any speed below that speed for
27983 	 * autoneg. This mode has been DEPRECATED. An HWRM client should not
27984 	 * use this mode.
27985 	 */
27986 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
27987 	/*
27988 	 * Select the speeds based on the corresponding link speed mask value
27989 	 * that is provided.
27990 	 */
27991 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
27992 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK
27993 	/* The advertised pause settings on the port by the link partner. */
27994 	uint8_t	link_partner_adv_pause;
27995 	/*
27996 	 * When this bit is '1', Generation of tx pause messages
27997 	 * is supported. Disabled otherwise.
27998 	 */
27999 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX	UINT32_C(0x1)
28000 	/*
28001 	 * When this bit is '1', Reception of rx pause messages
28002 	 * is supported. Disabled otherwise.
28003 	 */
28004 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX	UINT32_C(0x2)
28005 	/*
28006 	 * Current setting for link speed mask that is used to
28007 	 * advertise speeds during autonegotiation when EEE is enabled.
28008 	 * This field is valid only when eee_enabled flags is set to 1.
28009 	 * The speeds specified in this field shall be a subset of
28010 	 * speeds specified in auto_link_speed_mask.
28011 	 */
28012 	uint16_t	adv_eee_link_speed_mask;
28013 	/* Reserved */
28014 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1	UINT32_C(0x1)
28015 	/* 100Mb link speed (Full-duplex) */
28016 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB	UINT32_C(0x2)
28017 	/* Reserved */
28018 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2	UINT32_C(0x4)
28019 	/* 1Gb link speed (Full-duplex) */
28020 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB	UINT32_C(0x8)
28021 	/* Reserved */
28022 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3	UINT32_C(0x10)
28023 	/* Reserved */
28024 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4	UINT32_C(0x20)
28025 	/* 10Gb link speed */
28026 	#define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB	UINT32_C(0x40)
28027 	/*
28028 	 * Current setting for link speed mask that is advertised by
28029 	 * the link partner when EEE is enabled.
28030 	 * This field is valid only when eee_enabled flags is set to 1.
28031 	 */
28032 	uint16_t	link_partner_adv_eee_link_speed_mask;
28033 	/* Reserved */
28034 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1	UINT32_C(0x1)
28035 	/* 100Mb link speed (Full-duplex) */
28036 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB	UINT32_C(0x2)
28037 	/* Reserved */
28038 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2	UINT32_C(0x4)
28039 	/* 1Gb link speed (Full-duplex) */
28040 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB	UINT32_C(0x8)
28041 	/* Reserved */
28042 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3	UINT32_C(0x10)
28043 	/* Reserved */
28044 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4	UINT32_C(0x20)
28045 	/* 10Gb link speed */
28046 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB	UINT32_C(0x40)
28047 	uint32_t	xcvr_identifier_type_tx_lpi_timer;
28048 	/*
28049 	 * Current setting of TX LPI timer in microseconds.
28050 	 * This field is valid only when_eee_enabled flag is set to 1
28051 	 * and tx_lpi_enabled is set to 1.
28052 	 */
28053 	#define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK		UINT32_C(0xffffff)
28054 	#define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT		0
28055 	/* This value represents transceiver identifier type. */
28056 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK	UINT32_C(0xff000000)
28057 	#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT	24
28058 	/* Unknown */
28059 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN   (UINT32_C(0x0) << 24)
28060 	/* SFP/SFP+/SFP28 */
28061 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP	(UINT32_C(0x3) << 24)
28062 	/* QSFP+ */
28063 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP	(UINT32_C(0xc) << 24)
28064 	/* QSFP+ */
28065 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS  (UINT32_C(0xd) << 24)
28066 	/* QSFP28/QSFP56 or later */
28067 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28	(UINT32_C(0x11) << 24)
28068 	/* QSFP-DD */
28069 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPDD	(UINT32_C(0x18) << 24)
28070 	/* QSFP112 */
28071 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP112   (UINT32_C(0x1e) << 24)
28072 	/* SFP-DD CMIS */
28073 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFPDD	(UINT32_C(0x1f) << 24)
28074 	/* SFP CMIS */
28075 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_CSFP	(UINT32_C(0x20) << 24)
28076 		#define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_CSFP
28077 	/*
28078 	 * This value represents the current configuration of
28079 	 * Forward Error Correction (FEC) on the port.
28080 	 */
28081 	uint16_t	fec_cfg;
28082 	/*
28083 	 * When set to 1, then FEC is not supported on this port. If this
28084 	 * flag is set to 1, then all other FEC configuration flags shall be
28085 	 * ignored. When set to 0, then FEC is supported as indicated by
28086 	 * other configuration flags.
28087 	 */
28088 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED	UINT32_C(0x1)
28089 	/*
28090 	 * When set to 1, then FEC autonegotiation is supported on this port.
28091 	 * When set to 0, then FEC autonegotiation is not supported on this
28092 	 * port.
28093 	 */
28094 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED	UINT32_C(0x2)
28095 	/*
28096 	 * When set to 1, then FEC autonegotiation is enabled on this port.
28097 	 * When set to 0, then FEC autonegotiation is disabled if supported.
28098 	 * This flag should be ignored if FEC autonegotiation is not
28099 	 * supported on this port.
28100 	 */
28101 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED	UINT32_C(0x4)
28102 	/*
28103 	 * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this
28104 	 * port. When set to 0, then FEC CLAUSE 74 (Fire Code) is not
28105 	 * supported on this port.
28106 	 */
28107 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED	UINT32_C(0x8)
28108 	/*
28109 	 * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this
28110 	 * port. This means that FEC CLAUSE 74 is either advertised if
28111 	 * FEC autonegotiation is enabled or FEC CLAUSE 74 is force enabled.
28112 	 * When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if
28113 	 * supported. This flag should be ignored if FEC CLAUSE 74 is not
28114 	 * supported on this port.
28115 	 */
28116 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED	UINT32_C(0x10)
28117 	/*
28118 	 * When set to 1, then FEC CLAUSE 91 (Reed Solomon RS(528,514) for
28119 	 * NRZ) is supported on this port.
28120 	 * When set to 0, then FEC RS(528,418) is not supported on this port.
28121 	 */
28122 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED	UINT32_C(0x20)
28123 	/*
28124 	 * When set to 1, then FEC CLAUSE 91 (Reed Solomon RS(528,514) for
28125 	 * NRZ) is enabled on this port. This means that FEC RS(528,514) is
28126 	 * either advertised if FEC autonegotiation is enabled or FEC
28127 	 * RS(528,514) is force enabled. When set to 0, then FEC RS(528,514)
28128 	 * is disabled if supported.
28129 	 * This flag should be ignored if FEC CLAUSE 91 is not supported on
28130 	 * this port.
28131 	 */
28132 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED	UINT32_C(0x40)
28133 	/*
28134 	 * When set to 1, then FEC RS544_1XN is supported on this port.
28135 	 * When set to 0, then FEC RS544_1XN is not supported on this port.
28136 	 */
28137 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_SUPPORTED	UINT32_C(0x80)
28138 	/*
28139 	 * When set to 1, then RS544_1XN is enabled on this
28140 	 * port. This means that FEC RS544_1XN is either advertised if
28141 	 * FEC autonegotiation is enabled or FEC RS544_1XN is force enabled.
28142 	 * When set to 0, then FEC RS544_1XN is disabled if supported.
28143 	 * This flag should be ignored if FEC RS544_1XN is not supported on
28144 	 * this port.
28145 	 */
28146 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_ENABLED	UINT32_C(0x100)
28147 	/*
28148 	 * When set to 1, then FEC RS(544,514) is supported on this port.
28149 	 * When set to 0, then FEC RS(544,514) is not supported on this port.
28150 	 */
28151 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_IEEE_SUPPORTED	UINT32_C(0x200)
28152 	/*
28153 	 * When set to 1, then RS(544,514) is enabled on this
28154 	 * port. This means that FEC RS(544,514) is either advertised if
28155 	 * FEC autonegotiation is enabled or FEC RS(544,514) is force
28156 	 * enabled. When set to 0, then FEC RS(544,514) is disabled if
28157 	 * supported. This flag should be ignored if FEC RS(544,514) is not
28158 	 * supported on this port.
28159 	 */
28160 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_IEEE_ENABLED	UINT32_C(0x400)
28161 	/*
28162 	 * When set to 1, then FEC RS272_1XN is supported on this port.
28163 	 * When set to 0, then FEC RS272_1XN is not supported on this port.
28164 	 */
28165 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_1XN_SUPPORTED	UINT32_C(0x800)
28166 	/*
28167 	 * When set to 1, then RS272_1XN is enabled on this
28168 	 * port. This means that FEC RS272_1XN is either advertised if
28169 	 * FEC autonegotiation is enabled or FEC RS272_1XN is force
28170 	 * enabled. When set to 0, then FEC RS272_1XN is disabled if
28171 	 * supported.
28172 	 * This flag should be ignored if FEC RS272_1XN is not supported on
28173 	 * this port.
28174 	 */
28175 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_1XN_ENABLED	UINT32_C(0x1000)
28176 	/*
28177 	 * When set to 1, then FEC RS(272,514) is supported on this port.
28178 	 * When set to 0, then FEC RS(272,514) is not supported on this port.
28179 	 */
28180 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_IEEE_SUPPORTED	UINT32_C(0x2000)
28181 	/*
28182 	 * When set to 1, then RS(272,257) is enabled on this
28183 	 * port. This means that FEC RS(272,257) is either advertised if
28184 	 * FEC autonegotiation is enabled or FEC RS(272,257) is force
28185 	 * enabled. When set to 0, then FEC RS(272,257) is disabled if
28186 	 * supported.
28187 	 * This flag should be ignored if FEC RS(272,257) is not supported on
28188 	 * this port.
28189 	 */
28190 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_IEEE_ENABLED	UINT32_C(0x4000)
28191 	/*
28192 	 * This value is indicates the duplex of the current
28193 	 * connection state.
28194 	 */
28195 	uint8_t	duplex_state;
28196 	/* Half Duplex connection. */
28197 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0)
28198 	/* Full duplex connection. */
28199 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1)
28200 	#define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_LAST HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL
28201 	/* Option flags fields. */
28202 	uint8_t	option_flags;
28203 	/* When this bit is '1', Media auto detect is enabled. */
28204 	#define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_MEDIA_AUTO_DETECT	UINT32_C(0x1)
28205 	/*
28206 	 * When this bit is '1', active_fec_signal_mode can be
28207 	 * trusted.
28208 	 */
28209 	#define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_SIGNAL_MODE_KNOWN	UINT32_C(0x2)
28210 	/*
28211 	 * When this bit is '1', speeds2 fields are used to get
28212 	 * speed details.
28213 	 */
28214 	#define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_SPEEDS2_SUPPORTED	UINT32_C(0x4)
28215 	/*
28216 	 * Up to 16 bytes of null padded ASCII string representing
28217 	 * PHY vendor.
28218 	 * If the string is set to null, then the vendor name is not
28219 	 * available.
28220 	 */
28221 	char	phy_vendor_name[16];
28222 	/*
28223 	 * Up to 16 bytes of null padded ASCII string that
28224 	 * identifies vendor specific part number of the PHY.
28225 	 * If the string is set to null, then the vendor specific
28226 	 * part number is not available.
28227 	 */
28228 	char	phy_vendor_partnumber[16];
28229 	/*
28230 	 * The supported PAM4 speeds for the port. This is a bit mask.
28231 	 * For each speed that is supported, the corresponding
28232 	 * bit will be set to '1'.
28233 	 */
28234 	uint16_t	support_pam4_speeds;
28235 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_50G	UINT32_C(0x1)
28236 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_100G	UINT32_C(0x2)
28237 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_200G	UINT32_C(0x4)
28238 	/*
28239 	 * Current setting of forced PAM4 link speed.
28240 	 * When the link speed is not being forced, this
28241 	 * value shall be set to 0.
28242 	 */
28243 	uint16_t	force_pam4_link_speed;
28244 	/* 50Gb link speed */
28245 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_50GB  UINT32_C(0x1f4)
28246 	/* 100Gb link speed */
28247 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_100GB UINT32_C(0x3e8)
28248 	/* 200Gb link speed */
28249 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_200GB UINT32_C(0x7d0)
28250 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_LAST HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_200GB
28251 	/*
28252 	 * Current setting for auto_pam4_link_speed_mask that is used to
28253 	 * advertise speeds during autonegotiation.
28254 	 * This field is only valid when auto_mode is set to "mask".
28255 	 * The speeds specified in this field shall be a subset of
28256 	 * supported speeds on this port.
28257 	 */
28258 	uint16_t	auto_pam4_link_speed_mask;
28259 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_50G	UINT32_C(0x1)
28260 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_100G	UINT32_C(0x2)
28261 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_200G	UINT32_C(0x4)
28262 	/*
28263 	 * The advertised PAM4 speeds for the port by the link partner.
28264 	 * Each advertised speed will be set to '1'.
28265 	 */
28266 	uint8_t	link_partner_pam4_adv_speeds;
28267 	/* 50Gb link speed */
28268 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_50GB	UINT32_C(0x1)
28269 	/* 100Gb link speed */
28270 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_100GB	UINT32_C(0x2)
28271 	/* 200Gb link speed */
28272 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_200GB	UINT32_C(0x4)
28273 	/*
28274 	 * This field is used to indicate the reasons for link down.
28275 	 * This field is set to 0, if the link down reason is unknown.
28276 	 */
28277 	uint8_t	link_down_reason;
28278 	/* Remote fault */
28279 	#define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_DOWN_REASON_RF	UINT32_C(0x1)
28280 	/*
28281 	 * The supported speeds for the port. This is a bit mask.
28282 	 * For each speed that is supported, the corresponding
28283 	 * bit will be set to '1'. This is valid only if speeds2_supported
28284 	 * is set in option_flags
28285 	 */
28286 	uint16_t	support_speeds2;
28287 	/* 1Gb link speed */
28288 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_1GB		UINT32_C(0x1)
28289 	/* 10Gb (NRZ: 10G per lane, 1 lane) link speed */
28290 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_10GB		UINT32_C(0x2)
28291 	/* 25Gb (NRZ: 25G per lane, 1 lane) link speed */
28292 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_25GB		UINT32_C(0x4)
28293 	/* 40Gb (NRZ: 10G per lane, 4 lanes) link speed */
28294 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_40GB		UINT32_C(0x8)
28295 	/* 50Gb (NRZ: 25G per lane, 2 lanes) link speed */
28296 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_50GB		UINT32_C(0x10)
28297 	/* 100Gb (NRZ: 25G per lane, 4 lanes) link speed */
28298 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_100GB		UINT32_C(0x20)
28299 	/* 50Gb (PAM4-56: 50G per lane, 1 lane) link speed */
28300 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_50GB_PAM4_56	UINT32_C(0x40)
28301 	/* 100Gb (PAM4-56: 50G per lane, 2 lanes) link speed */
28302 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_100GB_PAM4_56	UINT32_C(0x80)
28303 	/* 200Gb (PAM4-56: 50G per lane, 4 lanes) link speed */
28304 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_200GB_PAM4_56	UINT32_C(0x100)
28305 	/* 400Gb (PAM4-56: 50G per lane, 8 lanes) link speed */
28306 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_400GB_PAM4_56	UINT32_C(0x200)
28307 	/* 100Gb (PAM4-112: 100G per lane, 1 lane) link speed */
28308 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_100GB_PAM4_112	UINT32_C(0x400)
28309 	/* 200Gb (PAM4-112: 100G per lane, 2 lanes) link speed */
28310 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_200GB_PAM4_112	UINT32_C(0x800)
28311 	/* 400Gb (PAM4-112: 100G per lane, 4 lanes) link speed */
28312 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_400GB_PAM4_112	UINT32_C(0x1000)
28313 	/* 800Gb (PAM4-112: 100G per lane, 8 lanes) link speed */
28314 	#define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS2_800GB_PAM4_112	UINT32_C(0x2000)
28315 	/*
28316 	 * Current setting of forced link speed. When the link speed is not
28317 	 * being forced, this value shall be set to 0.
28318 	 * This field is valid only if speeds2_supported is set in
28319 	 * option_flags.
28320 	 */
28321 	uint16_t	force_link_speeds2;
28322 	/* 1Gb link speed */
28323 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_1GB		UINT32_C(0xa)
28324 	/* 10Gb (NRZ: 10G per lane, 1 lane) link speed */
28325 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_10GB	UINT32_C(0x64)
28326 	/* 25Gb (NRZ: 25G per lane, 1 lane) link speed */
28327 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_25GB	UINT32_C(0xfa)
28328 	/* 40Gb (NRZ: 10G per lane, 4 lanes) link speed */
28329 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_40GB	UINT32_C(0x190)
28330 	/* 50Gb (NRZ: 25G per lane, 2 lanes) link speed */
28331 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_50GB	UINT32_C(0x1f4)
28332 	/* 100Gb (NRZ: 25G per lane, 4 lanes) link speed */
28333 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_100GB	UINT32_C(0x3e8)
28334 	/* 50Gb (PAM4-56: 50G per lane, 1 lane) link speed */
28335 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_50GB_PAM4_56   UINT32_C(0x1f5)
28336 	/* 100Gb (PAM4-56: 50G per lane, 2 lanes) link speed */
28337 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_100GB_PAM4_56  UINT32_C(0x3e9)
28338 	/* 200Gb (PAM4-56: 50G per lane, 4 lanes) link speed */
28339 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_200GB_PAM4_56  UINT32_C(0x7d1)
28340 	/* 400Gb (PAM4-56: 50G per lane, 8 lanes) link speed */
28341 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_400GB_PAM4_56  UINT32_C(0xfa1)
28342 	/* 100Gb (PAM4-112: 100G per lane, 1 lane) link speed */
28343 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_100GB_PAM4_112 UINT32_C(0x3ea)
28344 	/* 200Gb (PAM4-112: 100G per lane, 2 lanes) link speed */
28345 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_200GB_PAM4_112 UINT32_C(0x7d2)
28346 	/* 400Gb (PAM4-112: 100G per lane, 4 lanes) link speed */
28347 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_400GB_PAM4_112 UINT32_C(0xfa2)
28348 	/* 800Gb (PAM4-112: 100G per lane, 8 lanes) link speed */
28349 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_800GB_PAM4_112 UINT32_C(0x1f42)
28350 	#define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_LAST	HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEEDS2_800GB_PAM4_112
28351 	/*
28352 	 * Current setting of auto_link speed_mask that is used to advertise
28353 	 * speeds during autonegotiation.
28354 	 * This field is only valid when auto_mode is set to "mask".
28355 	 * and if speeds2_supported is set in option_flags
28356 	 * The speeds specified in this field shall be a subset of
28357 	 * supported speeds on this port.
28358 	 */
28359 	uint16_t	auto_link_speeds2;
28360 	/* 1Gb link speed */
28361 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_1GB		UINT32_C(0x1)
28362 	/* 10Gb (NRZ: 10G per lane, 1 lane) link speed */
28363 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_10GB		UINT32_C(0x2)
28364 	/* 25Gb (NRZ: 25G per lane, 1 lane) link speed */
28365 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_25GB		UINT32_C(0x4)
28366 	/* 40Gb (NRZ: 10G per lane, 4 lanes) link speed */
28367 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_40GB		UINT32_C(0x8)
28368 	/* 50Gb (NRZ: 25G per lane, 2 lanes) link speed */
28369 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_50GB		UINT32_C(0x10)
28370 	/* 100Gb (NRZ: 25G per lane, 4 lanes) link speed */
28371 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_100GB		UINT32_C(0x20)
28372 	/* 50Gb (PAM4-56: 50G per lane, 1 lane) link speed */
28373 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_50GB_PAM4_56	UINT32_C(0x40)
28374 	/* 100Gb (PAM4-56: 50G per lane, 2 lanes) link speed */
28375 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_100GB_PAM4_56	UINT32_C(0x80)
28376 	/* 200Gb (PAM4-56: 50G per lane, 4 lanes) link speed */
28377 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_200GB_PAM4_56	UINT32_C(0x100)
28378 	/* 400Gb (PAM4-56: 50G per lane, 8 lanes) link speed */
28379 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_400GB_PAM4_56	UINT32_C(0x200)
28380 	/* 100Gb (PAM4-112: 100G per lane, 1 lane) link speed */
28381 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_100GB_PAM4_112	UINT32_C(0x400)
28382 	/* 200Gb (PAM4-112: 100G per lane, 2 lanes) link speed */
28383 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_200GB_PAM4_112	UINT32_C(0x800)
28384 	/* 400Gb (PAM4-112: 100G per lane, 4 lanes) link speed */
28385 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_400GB_PAM4_112	UINT32_C(0x1000)
28386 	/* 800Gb (PAM4-112: 100G per lane, 8 lanes) link speed */
28387 	#define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEEDS2_800GB_PAM4_112	UINT32_C(0x2000)
28388 	/*
28389 	 * This field is indicate the number of lanes used to transfer
28390 	 * data. If the link is down, the value is zero.
28391 	 * This is valid only if speeds2_supported is set in option_flags.
28392 	 */
28393 	uint8_t	active_lanes;
28394 	/*
28395 	 * This field is used in Output records to indicate that the output
28396 	 * is completely written to RAM. This field should be read as '1'
28397 	 * to indicate that the output has been completely written. When
28398 	 * writing a command completion or response to an internal processor,
28399 	 * the order of writes has to be such that this field is written last.
28400 	 */
28401 	uint8_t	valid;
28402 } hwrm_port_phy_qcfg_output_t, *phwrm_port_phy_qcfg_output_t;
28403 
28404 /*********************
28405  * hwrm_port_mac_cfg *
28406  *********************/
28407 
28408 
28409 /* hwrm_port_mac_cfg_input (size:448b/56B) */
28410 
28411 typedef struct hwrm_port_mac_cfg_input {
28412 	/* The HWRM command request type. */
28413 	uint16_t	req_type;
28414 	/*
28415 	 * The completion ring to send the completion event on. This should
28416 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
28417 	 */
28418 	uint16_t	cmpl_ring;
28419 	/*
28420 	 * The sequence ID is used by the driver for tracking multiple
28421 	 * commands. This ID is treated as opaque data by the firmware and
28422 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
28423 	 */
28424 	uint16_t	seq_id;
28425 	/*
28426 	 * The target ID of the command:
28427 	 * * 0x0-0xFFF8 - The function ID
28428 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28429 	 * * 0xFFFD - Reserved for user-space HWRM interface
28430 	 * * 0xFFFF - HWRM
28431 	 */
28432 	uint16_t	target_id;
28433 	/*
28434 	 * A physical address pointer pointing to a host buffer that the
28435 	 * command's response data will be written. This can be either a host
28436 	 * physical address (HPA) or a guest physical address (GPA) and must
28437 	 * point to a physically contiguous block of memory.
28438 	 */
28439 	uint64_t	resp_addr;
28440 	/*
28441 	 * In this field, there are a number of CoS mappings related flags
28442 	 * that are used to configure CoS mappings and their corresponding
28443 	 * priorities in the hardware.
28444 	 * For the priorities of CoS mappings, the HWRM uses the following
28445 	 * priority order (high to low) by default:
28446 	 * # vlan pri
28447 	 * # ip_dscp
28448 	 * # tunnel_vlan_pri
28449 	 * # default cos
28450 	 *
28451 	 * A subset of CoS mappings can be enabled.
28452 	 * If a priority is not specified for an enabled CoS mapping, the
28453 	 * priority will be assigned in the above order for the enabled CoS
28454 	 * mappings. For example, if vlan_pri and ip_dscp CoS mappings are
28455 	 * enabled and their priorities are not specified, the following
28456 	 * priority order (high to low) will be used by the HWRM:
28457 	 * # vlan_pri
28458 	 * # ip_dscp
28459 	 * # default cos
28460 	 *
28461 	 * vlan_pri CoS mapping together with default CoS with lower priority
28462 	 * are enabled by default by the HWRM.
28463 	 */
28464 	uint32_t	flags;
28465 	/*
28466 	 * When this bit is '1', this command will configure
28467 	 * the MAC to match the current link state of the PHY.
28468 	 * If the link is not established on the PHY, then this
28469 	 * bit has no effect.
28470 	 */
28471 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK			UINT32_C(0x1)
28472 	/*
28473 	 * When this bit is set to '1', the inner VLAN PRI to CoS mapping
28474 	 * is requested to be enabled.
28475 	 */
28476 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE	UINT32_C(0x2)
28477 	/*
28478 	 * When this bit is set to '1', tunnel VLAN PRI field to
28479 	 * CoS mapping is requested to be enabled.
28480 	 */
28481 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE	UINT32_C(0x4)
28482 	/*
28483 	 * When this bit is set to '1', the IP DSCP to CoS mapping is
28484 	 * requested to be enabled.
28485 	 */
28486 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE		UINT32_C(0x8)
28487 	/*
28488 	 * When this bit is '1', the HWRM is requested to
28489 	 * enable timestamp capture capability on the receive side
28490 	 * of this port.
28491 	 */
28492 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE	UINT32_C(0x10)
28493 	/*
28494 	 * When this bit is '1', the HWRM is requested to
28495 	 * disable timestamp capture capability on the receive side
28496 	 * of this port.
28497 	 */
28498 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE	UINT32_C(0x20)
28499 	/*
28500 	 * When this bit is '1', the HWRM is requested to
28501 	 * enable timestamp capture capability on the transmit side
28502 	 * of this port.
28503 	 */
28504 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE	UINT32_C(0x40)
28505 	/*
28506 	 * When this bit is '1', the HWRM is requested to
28507 	 * disable timestamp capture capability on the transmit side
28508 	 * of this port.
28509 	 */
28510 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE	UINT32_C(0x80)
28511 	/*
28512 	 * When this bit is '1', the Out-Of-Box WoL is requested to
28513 	 * be enabled on this port.
28514 	 */
28515 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE		UINT32_C(0x100)
28516 	/*
28517 	 * When this bit is '1', the Out-Of-Box WoL is requested to
28518 	 * be disabled on this port.
28519 	 */
28520 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE		UINT32_C(0x200)
28521 	/*
28522 	 * When this bit is set to '1', the inner VLAN PRI to CoS mapping
28523 	 * is requested to be disabled.
28524 	 */
28525 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE	UINT32_C(0x400)
28526 	/*
28527 	 * When this bit is set to '1', tunnel VLAN PRI field to
28528 	 * CoS mapping is requested to be disabled.
28529 	 */
28530 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE	UINT32_C(0x800)
28531 	/*
28532 	 * When this bit is set to '1', the IP DSCP to CoS mapping is
28533 	 * requested to be disabled.
28534 	 */
28535 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE	UINT32_C(0x1000)
28536 	/*
28537 	 * When this bit is set to '1', and the ptp_tx_ts_capture_enable
28538 	 * bit is set, then the device uses one step Tx timestamping.
28539 	 * This bit is temporary and used for experimental purposes.
28540 	 */
28541 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_ONE_STEP_TX_TS		UINT32_C(0x2000)
28542 	/*
28543 	 * When this bit is '1', the controller is requested to enable
28544 	 * timestamp capture capability on all packets (not just PTP)
28545 	 * of the receive side of this port.
28546 	 */
28547 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_ALL_RX_TS_CAPTURE_ENABLE	UINT32_C(0x4000)
28548 	/*
28549 	 * When this bit is '1', the controller is requested to disable
28550 	 * timestamp capture capability on all packets (not just PTP)
28551 	 * of the receive side of this port.
28552 	 */
28553 	#define HWRM_PORT_MAC_CFG_INPUT_FLAGS_ALL_RX_TS_CAPTURE_DISABLE	UINT32_C(0x8000)
28554 	uint32_t	enables;
28555 	/*
28556 	 * This bit must be '1' for the ipg field to be
28557 	 * configured.
28558 	 */
28559 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG				UINT32_C(0x1)
28560 	/*
28561 	 * This bit must be '1' for the lpbk field to be
28562 	 * configured.
28563 	 */
28564 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK			UINT32_C(0x2)
28565 	/*
28566 	 * This bit must be '1' for the vlan_pri2cos_map_pri field to be
28567 	 * configured.
28568 	 */
28569 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI	UINT32_C(0x4)
28570 	/*
28571 	 * This bit must be '1' for the tunnel_pri2cos_map_pri field to be
28572 	 * configured.
28573 	 */
28574 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI	UINT32_C(0x10)
28575 	/*
28576 	 * This bit must be '1' for the dscp2cos_map_pri field to be
28577 	 * configured.
28578 	 */
28579 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI		UINT32_C(0x20)
28580 	/*
28581 	 * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to
28582 	 * be configured.
28583 	 */
28584 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE	UINT32_C(0x40)
28585 	/*
28586 	 * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to
28587 	 * be configured.
28588 	 */
28589 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE	UINT32_C(0x80)
28590 	/*
28591 	 * This bit must be '1' for the cos_field_cfg field to be
28592 	 * configured.
28593 	 */
28594 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG		UINT32_C(0x100)
28595 	/*
28596 	 * This bit must be '1' for the ptp_freq_adj_ppb field to be
28597 	 * configured.
28598 	 */
28599 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_PPB		UINT32_C(0x200)
28600 	/*
28601 	 * This bit must be '1' for the ptp_adj_phase field to be
28602 	 * configured.
28603 	 */
28604 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_ADJ_PHASE		UINT32_C(0x400)
28605 	/*
28606 	 * This bit must be '1' for the ptp_load_control field to
28607 	 * be configured.
28608 	 */
28609 	#define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_LOAD_CONTROL		UINT32_C(0x800)
28610 	/* Port ID of port that is to be configured. */
28611 	uint16_t	port_id;
28612 	/*
28613 	 * This value is used to configure the minimum IPG that will
28614 	 * be sent between packets by this port.
28615 	 */
28616 	uint8_t	ipg;
28617 	/* This value controls the loopback setting for the MAC. */
28618 	uint8_t	lpbk;
28619 	/* No loopback is selected. Normal operation. */
28620 	#define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE   UINT32_C(0x0)
28621 	/*
28622 	 * The HW will be configured with local loopback such that
28623 	 * host data is sent back to the host without modification.
28624 	 */
28625 	#define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL  UINT32_C(0x1)
28626 	/*
28627 	 * The HW will be configured with remote loopback such that
28628 	 * port logic will send packets back out the transmitter that
28629 	 * are received.
28630 	 */
28631 	#define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
28632 	#define HWRM_PORT_MAC_CFG_INPUT_LPBK_LAST  HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE
28633 	/*
28634 	 * This value controls the priority setting of VLAN PRI to CoS
28635 	 * mapping based on VLAN Tags of inner packet headers of
28636 	 * tunneled packets or packet headers of non-tunneled packets.
28637 	 *
28638 	 * # Each XXX_pri variable shall have a unique priority value
28639 	 * when it is being specified.
28640 	 * # When comparing priorities of mappings, higher value
28641 	 * indicates higher priority.
28642 	 * For example, a value of 0-3 is returned where 0 is being
28643 	 * the lowest priority and 3 is being the highest priority.
28644 	 */
28645 	uint8_t	vlan_pri2cos_map_pri;
28646 	/* Reserved field. */
28647 	uint8_t	reserved1;
28648 	/*
28649 	 * This value controls the priority setting of VLAN PRI to CoS
28650 	 * mapping based on VLAN Tags of tunneled header.
28651 	 * This mapping only applies when tunneled headers
28652 	 * are present.
28653 	 *
28654 	 * # Each XXX_pri variable shall have a unique priority value
28655 	 * when it is being specified.
28656 	 * # When comparing priorities of mappings, higher value
28657 	 * indicates higher priority.
28658 	 * For example, a value of 0-3 is returned where 0 is being
28659 	 * the lowest priority and 3 is being the highest priority.
28660 	 */
28661 	uint8_t	tunnel_pri2cos_map_pri;
28662 	/*
28663 	 * This value controls the priority setting of IP DSCP to CoS
28664 	 * mapping based on inner IP header of tunneled packets or
28665 	 * IP header of non-tunneled packets.
28666 	 *
28667 	 * # Each XXX_pri variable shall have a unique priority value
28668 	 * when it is being specified.
28669 	 * # When comparing priorities of mappings, higher value
28670 	 * indicates higher priority.
28671 	 * For example, a value of 0-3 is returned where 0 is being
28672 	 * the lowest priority and 3 is being the highest priority.
28673 	 */
28674 	uint8_t	dscp2pri_map_pri;
28675 	/*
28676 	 * This is a 16-bit bit mask that is used to request a
28677 	 * specific configuration of time stamp capture of PTP messages
28678 	 * on the receive side of this port.
28679 	 * This field shall be ignored if the ptp_rx_ts_capture_enable
28680 	 * flag is not set in this command.
28681 	 * Otherwise, if bit 'i' is set, then the HWRM is being
28682 	 * requested to configure the receive side of the port to
28683 	 * capture the time stamp of every received PTP message
28684 	 * with messageType field value set to i.
28685 	 */
28686 	uint16_t	rx_ts_capture_ptp_msg_type;
28687 	/*
28688 	 * This is a 16-bit bit mask that is used to request a
28689 	 * specific configuration of time stamp capture of PTP messages
28690 	 * on the transmit side of this port.
28691 	 * This field shall be ignored if the ptp_tx_ts_capture_enable
28692 	 * flag is not set in this command.
28693 	 * Otherwise, if bit 'i' is set, then the HWRM is being
28694 	 * requested to configure the transmit side of the port to
28695 	 * capture the time stamp of every transmitted PTP message
28696 	 * with messageType field value set to i.
28697 	 */
28698 	uint16_t	tx_ts_capture_ptp_msg_type;
28699 	/* Configuration of CoS fields. */
28700 	uint8_t	cos_field_cfg;
28701 	/* Reserved */
28702 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1			UINT32_C(0x1)
28703 	/*
28704 	 * This field is used to specify selection of VLAN PRI value
28705 	 * based on whether one or two VLAN Tags are present in
28706 	 * the inner packet headers of tunneled packets or
28707 	 * non-tunneled packets.
28708 	 * This field is valid only if inner VLAN PRI to CoS mapping
28709 	 * is enabled.
28710 	 * If VLAN PRI to CoS mapping is not enabled, then this
28711 	 * field shall be ignored.
28712 	 */
28713 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK	UINT32_C(0x6)
28714 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT	1
28715 	/*
28716 	 * Select inner VLAN PRI when 1 or 2 VLAN Tags are
28717 	 * present in the inner packet headers
28718 	 */
28719 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST	(UINT32_C(0x0) << 1)
28720 	/*
28721 	 * Select outer VLAN Tag PRI when 2 VLAN Tags are
28722 	 * present in the inner packet headers.
28723 	 * No VLAN PRI shall be selected for this configuration
28724 	 * if only one VLAN Tag is present in the inner
28725 	 * packet headers.
28726 	 */
28727 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER	(UINT32_C(0x1) << 1)
28728 	/*
28729 	 * Select outermost VLAN PRI when 1 or 2 VLAN Tags
28730 	 * are present in the inner packet headers
28731 	 */
28732 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST	(UINT32_C(0x2) << 1)
28733 	/* Unspecified */
28734 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED	(UINT32_C(0x3) << 1)
28735 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST	HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
28736 	/*
28737 	 * This field is used to specify selection of tunnel VLAN
28738 	 * PRI value based on whether one or two VLAN Tags are
28739 	 * present in tunnel headers.
28740 	 * This field is valid only if tunnel VLAN PRI to CoS mapping
28741 	 * is enabled.
28742 	 * If tunnel VLAN PRI to CoS mapping is not enabled, then this
28743 	 * field shall be ignored.
28744 	 */
28745 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK	UINT32_C(0x18)
28746 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT	3
28747 	/*
28748 	 * Select inner VLAN PRI when 1 or 2 VLAN Tags are
28749 	 * present in the tunnel packet headers
28750 	 */
28751 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST	(UINT32_C(0x0) << 3)
28752 	/*
28753 	 * Select outer VLAN Tag PRI when 2 VLAN Tags are
28754 	 * present in the tunnel packet headers.
28755 	 * No tunnel VLAN PRI shall be selected for this
28756 	 * configuration if only one VLAN Tag is present in
28757 	 * the tunnel packet headers.
28758 	 */
28759 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER	(UINT32_C(0x1) << 3)
28760 	/*
28761 	 * Select outermost VLAN PRI when 1 or 2 VLAN Tags
28762 	 * are present in the tunnel packet headers
28763 	 */
28764 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST	(UINT32_C(0x2) << 3)
28765 	/* Unspecified */
28766 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED  (UINT32_C(0x3) << 3)
28767 		#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST	HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
28768 	/*
28769 	 * This field shall be used to provide default CoS value
28770 	 * that has been configured on this port.
28771 	 * This field is valid only if default CoS mapping
28772 	 * is enabled.
28773 	 * If default CoS mapping is not enabled, then this
28774 	 * field shall be ignored.
28775 	 */
28776 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK	UINT32_C(0xe0)
28777 	#define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT	5
28778 	uint8_t	unused_0[3];
28779 	/*
28780 	 * This signed field specifies by how much to adjust the frequency
28781 	 * of sync timer updates (measured in parts per billion).
28782 	 */
28783 	int32_t	ptp_freq_adj_ppb;
28784 	uint8_t	unused_1[3];
28785 	/*
28786 	 * This value controls how PTP configuration like freq_adj and
28787 	 * phase are loaded in the hardware block.
28788 	 */
28789 	uint8_t	ptp_load_control;
28790 	/* PTP configuration is not loaded in hardware. */
28791 	#define HWRM_PORT_MAC_CFG_INPUT_PTP_LOAD_CONTROL_NONE	UINT32_C(0x0)
28792 	/*
28793 	 * PTP configuration will be loaded immediately in the hardware
28794 	 * block. By default, it will always be immediate.
28795 	 */
28796 	#define HWRM_PORT_MAC_CFG_INPUT_PTP_LOAD_CONTROL_IMMEDIATE UINT32_C(0x1)
28797 	/*
28798 	 * PTP configuration will loaded at the next Pulse per second (PPS)
28799 	 * event in the hardware block.
28800 	 */
28801 	#define HWRM_PORT_MAC_CFG_INPUT_PTP_LOAD_CONTROL_PPS_EVENT UINT32_C(0x2)
28802 	#define HWRM_PORT_MAC_CFG_INPUT_PTP_LOAD_CONTROL_LAST	HWRM_PORT_MAC_CFG_INPUT_PTP_LOAD_CONTROL_PPS_EVENT
28803 	/*
28804 	 * This unsigned field specifies the phase offset to be applied
28805 	 * to the PHC (PTP Hardware Clock). This field is specified in
28806 	 * nanoseconds.
28807 	 */
28808 	int64_t	ptp_adj_phase;
28809 } hwrm_port_mac_cfg_input_t, *phwrm_port_mac_cfg_input_t;
28810 
28811 /* hwrm_port_mac_cfg_output (size:128b/16B) */
28812 
28813 typedef struct hwrm_port_mac_cfg_output {
28814 	/* The specific error status for the command. */
28815 	uint16_t	error_code;
28816 	/* The HWRM command request type. */
28817 	uint16_t	req_type;
28818 	/* The sequence ID from the original command. */
28819 	uint16_t	seq_id;
28820 	/* The length of the response data in number of bytes. */
28821 	uint16_t	resp_len;
28822 	/*
28823 	 * This is the configured maximum length of Ethernet packet
28824 	 * payload that is allowed to be received on the port.
28825 	 * This value does not include the number of bytes used by
28826 	 * Ethernet header and trailer (CRC).
28827 	 */
28828 	uint16_t	mru;
28829 	/*
28830 	 * This is the configured maximum length of Ethernet packet
28831 	 * payload that is allowed to be transmitted on the port.
28832 	 * This value does not include the number of bytes used by
28833 	 * Ethernet header and trailer (CRC).
28834 	 */
28835 	uint16_t	mtu;
28836 	/* Current configuration of the IPG value. */
28837 	uint8_t	ipg;
28838 	/* Current value of the loopback value. */
28839 	uint8_t	lpbk;
28840 	/* No loopback is selected. Normal operation. */
28841 	#define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
28842 	/*
28843 	 * The HW will be configured with local loopback such that
28844 	 * host data is sent back to the host without modification.
28845 	 */
28846 	#define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
28847 	/*
28848 	 * The HW will be configured with remote loopback such that
28849 	 * port logic will send packets back out the transmitter that
28850 	 * are received.
28851 	 */
28852 	#define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
28853 	#define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LAST  HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE
28854 	uint8_t	unused_0;
28855 	/*
28856 	 * This field is used in Output records to indicate that the output
28857 	 * is completely written to RAM. This field should be read as '1'
28858 	 * to indicate that the output has been completely written. When
28859 	 * writing a command completion or response to an internal processor,
28860 	 * the order of writes has to be such that this field is written last.
28861 	 */
28862 	uint8_t	valid;
28863 } hwrm_port_mac_cfg_output_t, *phwrm_port_mac_cfg_output_t;
28864 
28865 /**********************
28866  * hwrm_port_mac_qcfg *
28867  **********************/
28868 
28869 
28870 /* hwrm_port_mac_qcfg_input (size:192b/24B) */
28871 
28872 typedef struct hwrm_port_mac_qcfg_input {
28873 	/* The HWRM command request type. */
28874 	uint16_t	req_type;
28875 	/*
28876 	 * The completion ring to send the completion event on. This should
28877 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
28878 	 */
28879 	uint16_t	cmpl_ring;
28880 	/*
28881 	 * The sequence ID is used by the driver for tracking multiple
28882 	 * commands. This ID is treated as opaque data by the firmware and
28883 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
28884 	 */
28885 	uint16_t	seq_id;
28886 	/*
28887 	 * The target ID of the command:
28888 	 * * 0x0-0xFFF8 - The function ID
28889 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28890 	 * * 0xFFFD - Reserved for user-space HWRM interface
28891 	 * * 0xFFFF - HWRM
28892 	 */
28893 	uint16_t	target_id;
28894 	/*
28895 	 * A physical address pointer pointing to a host buffer that the
28896 	 * command's response data will be written. This can be either a host
28897 	 * physical address (HPA) or a guest physical address (GPA) and must
28898 	 * point to a physically contiguous block of memory.
28899 	 */
28900 	uint64_t	resp_addr;
28901 	/* Port ID of port that is to be configured. */
28902 	uint16_t	port_id;
28903 	uint8_t	unused_0[6];
28904 } hwrm_port_mac_qcfg_input_t, *phwrm_port_mac_qcfg_input_t;
28905 
28906 /* hwrm_port_mac_qcfg_output (size:256b/32B) */
28907 
28908 typedef struct hwrm_port_mac_qcfg_output {
28909 	/* The specific error status for the command. */
28910 	uint16_t	error_code;
28911 	/* The HWRM command request type. */
28912 	uint16_t	req_type;
28913 	/* The sequence ID from the original command. */
28914 	uint16_t	seq_id;
28915 	/* The length of the response data in number of bytes. */
28916 	uint16_t	resp_len;
28917 	/*
28918 	 * This is the configured maximum length of Ethernet packet
28919 	 * payload that is allowed to be received on the port.
28920 	 * This value does not include the number of bytes used by the
28921 	 * Ethernet header and trailer (CRC).
28922 	 */
28923 	uint16_t	mru;
28924 	/*
28925 	 * This is the configured maximum length of Ethernet packet
28926 	 * payload that is allowed to be transmitted on the port.
28927 	 * This value does not include the number of bytes used by the
28928 	 * Ethernet header and trailer (CRC).
28929 	 */
28930 	uint16_t	mtu;
28931 	/*
28932 	 * The minimum IPG that will
28933 	 * be sent between packets by this port.
28934 	 */
28935 	uint8_t	ipg;
28936 	/* The loopback setting for the MAC. */
28937 	uint8_t	lpbk;
28938 	/* No loopback is selected. Normal operation. */
28939 	#define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
28940 	/*
28941 	 * The HW will be configured with local loopback such that
28942 	 * host data is sent back to the host without modification.
28943 	 */
28944 	#define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
28945 	/*
28946 	 * The HW will be configured with remote loopback such that
28947 	 * port logic will send packets back out the transmitter that
28948 	 * are received.
28949 	 */
28950 	#define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
28951 	#define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LAST  HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE
28952 	/*
28953 	 * Priority setting for VLAN PRI to CoS mapping.
28954 	 * # Each XXX_pri variable shall have a unique priority value
28955 	 * when it is being used.
28956 	 * # When comparing priorities of mappings, higher value
28957 	 * indicates higher priority.
28958 	 * For example, a value of 0-3 is returned where 0 is being
28959 	 * the lowest priority and 3 is being the highest priority.
28960 	 * # If the corresponding CoS mapping is not enabled, then this
28961 	 * field should be ignored.
28962 	 * # This value indicates the normalized priority value retained
28963 	 * in the HWRM.
28964 	 */
28965 	uint8_t	vlan_pri2cos_map_pri;
28966 	/*
28967 	 * In this field, a number of CoS mappings related flags
28968 	 * are used to indicate configured CoS mappings.
28969 	 */
28970 	uint8_t	flags;
28971 	/*
28972 	 * When this bit is set to '1', the inner VLAN PRI to CoS mapping
28973 	 * is enabled.
28974 	 */
28975 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE	UINT32_C(0x1)
28976 	/*
28977 	 * When this bit is set to '1', tunnel VLAN PRI field to
28978 	 * CoS mapping is enabled.
28979 	 */
28980 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE	UINT32_C(0x2)
28981 	/*
28982 	 * When this bit is set to '1', the IP DSCP to CoS mapping is
28983 	 * enabled.
28984 	 */
28985 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE	UINT32_C(0x4)
28986 	/*
28987 	 * When this bit is '1', the Out-Of-Box WoL is enabled on this
28988 	 * port.
28989 	 */
28990 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE		UINT32_C(0x8)
28991 	/* When this bit is '1', PTP is enabled for RX on this port. */
28992 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE	UINT32_C(0x10)
28993 	/* When this bit is '1', PTP is enabled for TX on this port. */
28994 	#define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE	UINT32_C(0x20)
28995 	/*
28996 	 * Priority setting for tunnel VLAN PRI to CoS mapping.
28997 	 * # Each XXX_pri variable shall have a unique priority value
28998 	 * when it is being used.
28999 	 * # When comparing priorities of mappings, higher value
29000 	 * indicates higher priority.
29001 	 * For example, a value of 0-3 is returned where 0 is being
29002 	 * the lowest priority and 3 is being the highest priority.
29003 	 * # If the corresponding CoS mapping is not enabled, then this
29004 	 * field should be ignored.
29005 	 * # This value indicates the normalized priority value retained
29006 	 * in the HWRM.
29007 	 */
29008 	uint8_t	tunnel_pri2cos_map_pri;
29009 	/*
29010 	 * Priority setting for DSCP to PRI mapping.
29011 	 * # Each XXX_pri variable shall have a unique priority value
29012 	 * when it is being used.
29013 	 * # When comparing priorities of mappings, higher value
29014 	 * indicates higher priority.
29015 	 * For example, a value of 0-3 is returned where 0 is being
29016 	 * the lowest priority and 3 is being the highest priority.
29017 	 * # If the corresponding CoS mapping is not enabled, then this
29018 	 * field should be ignored.
29019 	 * # This value indicates the normalized priority value retained
29020 	 * in the HWRM.
29021 	 */
29022 	uint8_t	dscp2pri_map_pri;
29023 	/*
29024 	 * This is a 16-bit bit mask that represents the
29025 	 * current configuration of time stamp capture of PTP messages
29026 	 * on the receive side of this port.
29027 	 * If bit 'i' is set, then the receive side of the port
29028 	 * is configured to capture the time stamp of every
29029 	 * received PTP message with messageType field value set
29030 	 * to i.
29031 	 * If all bits are set to 0 (i.e. field value set 0),
29032 	 * then the receive side of the port is not configured
29033 	 * to capture timestamp for PTP messages.
29034 	 * If all bits are set to 1, then the receive side of the
29035 	 * port is configured to capture timestamp for all PTP
29036 	 * messages.
29037 	 */
29038 	uint16_t	rx_ts_capture_ptp_msg_type;
29039 	/*
29040 	 * This is a 16-bit bit mask that represents the
29041 	 * current configuration of time stamp capture of PTP messages
29042 	 * on the transmit side of this port.
29043 	 * If bit 'i' is set, then the transmit side of the port
29044 	 * is configured to capture the time stamp of every
29045 	 * received PTP message with messageType field value set
29046 	 * to i.
29047 	 * If all bits are set to 0 (i.e. field value set 0),
29048 	 * then the transmit side of the port is not configured
29049 	 * to capture timestamp for PTP messages.
29050 	 * If all bits are set to 1, then the transmit side of the
29051 	 * port is configured to capture timestamp for all PTP
29052 	 * messages.
29053 	 */
29054 	uint16_t	tx_ts_capture_ptp_msg_type;
29055 	/* Configuration of CoS fields. */
29056 	uint8_t	cos_field_cfg;
29057 	/* Reserved */
29058 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD			UINT32_C(0x1)
29059 	/*
29060 	 * This field is used for selecting VLAN PRI value
29061 	 * based on whether one or two VLAN Tags are present in
29062 	 * the inner packet headers of tunneled packets or
29063 	 * non-tunneled packets.
29064 	 */
29065 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK	UINT32_C(0x6)
29066 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT	1
29067 	/*
29068 	 * Select inner VLAN PRI when 1 or 2 VLAN Tags are
29069 	 * present in the inner packet headers
29070 	 */
29071 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST	(UINT32_C(0x0) << 1)
29072 	/*
29073 	 * Select outer VLAN Tag PRI when 2 VLAN Tags are
29074 	 * present in the inner packet headers.
29075 	 * No VLAN PRI is selected for this configuration
29076 	 * if only one VLAN Tag is present in the inner
29077 	 * packet headers.
29078 	 */
29079 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER	(UINT32_C(0x1) << 1)
29080 	/*
29081 	 * Select outermost VLAN PRI when 1 or 2 VLAN Tags
29082 	 * are present in the inner packet headers
29083 	 */
29084 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST	(UINT32_C(0x2) << 1)
29085 	/* Unspecified */
29086 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED	(UINT32_C(0x3) << 1)
29087 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST	HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
29088 	/*
29089 	 * This field is used for selecting tunnel VLAN PRI value
29090 	 * based on whether one or two VLAN Tags are present in
29091 	 * the tunnel headers of tunneled packets. This selection
29092 	 * does not apply to non-tunneled packets.
29093 	 */
29094 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK	UINT32_C(0x18)
29095 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT	3
29096 	/*
29097 	 * Select inner VLAN PRI when 1 or 2 VLAN Tags are
29098 	 * present in the tunnel packet headers
29099 	 */
29100 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST	(UINT32_C(0x0) << 3)
29101 	/*
29102 	 * Select outer VLAN Tag PRI when 2 VLAN Tags are
29103 	 * present in the tunnel packet headers.
29104 	 * No VLAN PRI is selected for this configuration
29105 	 * if only one VLAN Tag is present in the tunnel
29106 	 * packet headers.
29107 	 */
29108 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER	(UINT32_C(0x1) << 3)
29109 	/*
29110 	 * Select outermost VLAN PRI when 1 or 2 VLAN Tags
29111 	 * are present in the tunnel packet headers
29112 	 */
29113 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST	(UINT32_C(0x2) << 3)
29114 	/* Unspecified */
29115 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED  (UINT32_C(0x3) << 3)
29116 		#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST	HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
29117 	/*
29118 	 * This field is used to provide default CoS value that
29119 	 * has been configured on this port.
29120 	 */
29121 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK	UINT32_C(0xe0)
29122 	#define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT	5
29123 	uint8_t	unused_1;
29124 	uint16_t	port_svif_info;
29125 	/*
29126 	 * This field specifies the source virtual interface of the port
29127 	 * being queried. Drivers can use this to program port svif field in
29128 	 * the L2 context table.
29129 	 */
29130 	#define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_MASK	UINT32_C(0x7fff)
29131 	#define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_SFT	0
29132 	/* This field specifies whether port_svif is valid or not */
29133 	#define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_VALID	UINT32_C(0x8000)
29134 	/*
29135 	 * This field indicates the configured load control for PTP
29136 	 * time of day (TOD) block.
29137 	 */
29138 	uint8_t	ptp_load_control;
29139 	/* Indicates the current load control is none. */
29140 	#define HWRM_PORT_MAC_QCFG_OUTPUT_PTP_LOAD_CONTROL_NONE	UINT32_C(0x0)
29141 	/* Indicates the current load control is immediate. */
29142 	#define HWRM_PORT_MAC_QCFG_OUTPUT_PTP_LOAD_CONTROL_IMMEDIATE UINT32_C(0x1)
29143 	/*
29144 	 * Indicates current load control is at next Pulse per Second (PPS)
29145 	 * event.
29146 	 */
29147 	#define HWRM_PORT_MAC_QCFG_OUTPUT_PTP_LOAD_CONTROL_PPS_EVENT UINT32_C(0x2)
29148 	#define HWRM_PORT_MAC_QCFG_OUTPUT_PTP_LOAD_CONTROL_LAST	HWRM_PORT_MAC_QCFG_OUTPUT_PTP_LOAD_CONTROL_PPS_EVENT
29149 	uint8_t	unused_2[4];
29150 	/*
29151 	 * This field is used in Output records to indicate that the output
29152 	 * is completely written to RAM. This field should be read as '1'
29153 	 * to indicate that the output has been completely written. When
29154 	 * writing a command completion or response to an internal processor,
29155 	 * the order of writes has to be such that this field is written last.
29156 	 */
29157 	uint8_t	valid;
29158 } hwrm_port_mac_qcfg_output_t, *phwrm_port_mac_qcfg_output_t;
29159 
29160 /**************************
29161  * hwrm_port_mac_ptp_qcfg *
29162  **************************/
29163 
29164 
29165 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */
29166 
29167 typedef struct hwrm_port_mac_ptp_qcfg_input {
29168 	/* The HWRM command request type. */
29169 	uint16_t	req_type;
29170 	/*
29171 	 * The completion ring to send the completion event on. This should
29172 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
29173 	 */
29174 	uint16_t	cmpl_ring;
29175 	/*
29176 	 * The sequence ID is used by the driver for tracking multiple
29177 	 * commands. This ID is treated as opaque data by the firmware and
29178 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
29179 	 */
29180 	uint16_t	seq_id;
29181 	/*
29182 	 * The target ID of the command:
29183 	 * * 0x0-0xFFF8 - The function ID
29184 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29185 	 * * 0xFFFD - Reserved for user-space HWRM interface
29186 	 * * 0xFFFF - HWRM
29187 	 */
29188 	uint16_t	target_id;
29189 	/*
29190 	 * A physical address pointer pointing to a host buffer that the
29191 	 * command's response data will be written. This can be either a host
29192 	 * physical address (HPA) or a guest physical address (GPA) and must
29193 	 * point to a physically contiguous block of memory.
29194 	 */
29195 	uint64_t	resp_addr;
29196 	/* Port ID of port that is being queried. */
29197 	uint16_t	port_id;
29198 	uint8_t	unused_0[6];
29199 } hwrm_port_mac_ptp_qcfg_input_t, *phwrm_port_mac_ptp_qcfg_input_t;
29200 
29201 /* hwrm_port_mac_ptp_qcfg_output (size:704b/88B) */
29202 
29203 typedef struct hwrm_port_mac_ptp_qcfg_output {
29204 	/* The specific error status for the command. */
29205 	uint16_t	error_code;
29206 	/* The HWRM command request type. */
29207 	uint16_t	req_type;
29208 	/* The sequence ID from the original command. */
29209 	uint16_t	seq_id;
29210 	/* The length of the response data in number of bytes. */
29211 	uint16_t	resp_len;
29212 	/*
29213 	 * In this field, a number of PTP related flags
29214 	 * are used to indicate configured PTP capabilities.
29215 	 */
29216 	uint8_t	flags;
29217 	/*
29218 	 * When this bit is set to '1', the PTP related registers are
29219 	 * directly accessible by the host.
29220 	 */
29221 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS			UINT32_C(0x1)
29222 	/*
29223 	 * When this bit is set to '1', the device supports one-step
29224 	 * Tx timestamping.
29225 	 */
29226 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS			UINT32_C(0x4)
29227 	/*
29228 	 * When this bit is set to '1', the PTP information is accessible
29229 	 * via HWRM commands.
29230 	 */
29231 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS			UINT32_C(0x8)
29232 	/*
29233 	 * When this bit is set to '1', two specific registers for current
29234 	 * time (ts_ref_clock_reg_lower and ts_ref_clock_reg_upper) are
29235 	 * directly accessible by the host.
29236 	 */
29237 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_PARTIAL_DIRECT_ACCESS_REF_CLOCK	UINT32_C(0x10)
29238 	/*
29239 	 * When this bit is set to '1', it indicates that driver has
29240 	 * configured 64bit RTC.
29241 	 */
29242 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_RTC_CONFIGURED			UINT32_C(0x20)
29243 	/*
29244 	 * When this bit is set to '1', it indicates that current time
29245 	 * exposed to driver is 64bit.
29246 	 */
29247 	#define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_64B_PHC_TIME			UINT32_C(0x40)
29248 	uint8_t	unused_0[3];
29249 	/*
29250 	 * Offset of the PTP register for the lower 32 bits of timestamp
29251 	 * for RX.
29252 	 */
29253 	uint32_t	rx_ts_reg_off_lower;
29254 	/*
29255 	 * Offset of the PTP register for the upper 32 bits of timestamp
29256 	 * for RX.
29257 	 */
29258 	uint32_t	rx_ts_reg_off_upper;
29259 	/* Offset of the PTP register for the sequence ID for RX. */
29260 	uint32_t	rx_ts_reg_off_seq_id;
29261 	/* Offset of the first PTP source ID for RX. */
29262 	uint32_t	rx_ts_reg_off_src_id_0;
29263 	/* Offset of the second PTP source ID for RX. */
29264 	uint32_t	rx_ts_reg_off_src_id_1;
29265 	/* Offset of the third PTP source ID for RX. */
29266 	uint32_t	rx_ts_reg_off_src_id_2;
29267 	/* Offset of the domain ID for RX. */
29268 	uint32_t	rx_ts_reg_off_domain_id;
29269 	/* Offset of the PTP FIFO register for RX. */
29270 	uint32_t	rx_ts_reg_off_fifo;
29271 	/* Offset of the PTP advance FIFO register for RX. */
29272 	uint32_t	rx_ts_reg_off_fifo_adv;
29273 	/* PTP timestamp granularity for RX. */
29274 	uint32_t	rx_ts_reg_off_granularity;
29275 	/*
29276 	 * Offset of the PTP register for the lower 32 bits of timestamp
29277 	 * for TX.
29278 	 */
29279 	uint32_t	tx_ts_reg_off_lower;
29280 	/*
29281 	 * Offset of the PTP register for the upper 32 bits of timestamp
29282 	 * for TX.
29283 	 */
29284 	uint32_t	tx_ts_reg_off_upper;
29285 	/* Offset of the PTP register for the sequence ID for TX. */
29286 	uint32_t	tx_ts_reg_off_seq_id;
29287 	/* Offset of the PTP FIFO register for TX. */
29288 	uint32_t	tx_ts_reg_off_fifo;
29289 	/* PTP timestamp granularity for TX. */
29290 	uint32_t	tx_ts_reg_off_granularity;
29291 	/* Offset of register to get lower 32 bits of current time. */
29292 	uint32_t	ts_ref_clock_reg_lower;
29293 	/* Offset of register to get upper 32 bits of current time. */
29294 	uint32_t	ts_ref_clock_reg_upper;
29295 	uint8_t	unused_1[7];
29296 	/*
29297 	 * This field is used in Output records to indicate that the output
29298 	 * is completely written to RAM. This field should be read as '1'
29299 	 * to indicate that the output has been completely written. When
29300 	 * writing a command completion or response to an internal processor,
29301 	 * the order of writes has to be such that this field is written last.
29302 	 */
29303 	uint8_t	valid;
29304 } hwrm_port_mac_ptp_qcfg_output_t, *phwrm_port_mac_ptp_qcfg_output_t;
29305 
29306 /* Port Tx Statistics Format */
29307 /* tx_port_stats (size:3264b/408B) */
29308 
29309 typedef struct tx_port_stats {
29310 	/* Total Number of 64 Bytes frames transmitted */
29311 	uint64_t	tx_64b_frames;
29312 	/* Total Number of 65-127 Bytes frames transmitted */
29313 	uint64_t	tx_65b_127b_frames;
29314 	/* Total Number of 128-255 Bytes frames transmitted */
29315 	uint64_t	tx_128b_255b_frames;
29316 	/* Total Number of 256-511 Bytes frames transmitted */
29317 	uint64_t	tx_256b_511b_frames;
29318 	/* Total Number of 512-1023 Bytes frames transmitted */
29319 	uint64_t	tx_512b_1023b_frames;
29320 	/* Total Number of 1024-1518 Bytes frames transmitted */
29321 	uint64_t	tx_1024b_1518b_frames;
29322 	/*
29323 	 * Total Number of each good VLAN (excludes FCS errors)
29324 	 * frame transmitted which is 1519 to 1522 bytes in length
29325 	 * inclusive (excluding framing bits but including FCS bytes).
29326 	 */
29327 	uint64_t	tx_good_vlan_frames;
29328 	/* Total Number of 1519-2047 Bytes frames transmitted */
29329 	uint64_t	tx_1519b_2047b_frames;
29330 	/* Total Number of 2048-4095 Bytes frames transmitted */
29331 	uint64_t	tx_2048b_4095b_frames;
29332 	/* Total Number of 4096-9216 Bytes frames transmitted */
29333 	uint64_t	tx_4096b_9216b_frames;
29334 	/* Total Number of 9217-16383 Bytes frames transmitted */
29335 	uint64_t	tx_9217b_16383b_frames;
29336 	/* Total Number of good frames transmitted */
29337 	uint64_t	tx_good_frames;
29338 	/* Total Number of frames transmitted */
29339 	uint64_t	tx_total_frames;
29340 	/* Total number of unicast frames transmitted */
29341 	uint64_t	tx_ucast_frames;
29342 	/* Total number of multicast frames transmitted */
29343 	uint64_t	tx_mcast_frames;
29344 	/* Total number of broadcast frames transmitted */
29345 	uint64_t	tx_bcast_frames;
29346 	/* Total number of PAUSE control frames transmitted */
29347 	uint64_t	tx_pause_frames;
29348 	/*
29349 	 * Total number of PFC/per-priority PAUSE
29350 	 * control frames transmitted
29351 	 */
29352 	uint64_t	tx_pfc_frames;
29353 	/* Total number of jabber frames transmitted */
29354 	uint64_t	tx_jabber_frames;
29355 	/* Total number of frames transmitted with FCS error */
29356 	uint64_t	tx_fcs_err_frames;
29357 	/* Total number of control frames transmitted */
29358 	uint64_t	tx_control_frames;
29359 	/* Total number of over-sized frames transmitted */
29360 	uint64_t	tx_oversz_frames;
29361 	/* Total number of frames with single deferral */
29362 	uint64_t	tx_single_dfrl_frames;
29363 	/* Total number of frames with multiple deferrals */
29364 	uint64_t	tx_multi_dfrl_frames;
29365 	/* Total number of frames with single collision */
29366 	uint64_t	tx_single_coll_frames;
29367 	/* Total number of frames with multiple collisions */
29368 	uint64_t	tx_multi_coll_frames;
29369 	/* Total number of frames with late collisions */
29370 	uint64_t	tx_late_coll_frames;
29371 	/* Total number of frames with excessive collisions */
29372 	uint64_t	tx_excessive_coll_frames;
29373 	/* Total number of fragmented frames transmitted */
29374 	uint64_t	tx_frag_frames;
29375 	/* Total number of transmit errors */
29376 	uint64_t	tx_err;
29377 	/* Total number of single VLAN tagged frames transmitted */
29378 	uint64_t	tx_tagged_frames;
29379 	/* Total number of double VLAN tagged frames transmitted */
29380 	uint64_t	tx_dbl_tagged_frames;
29381 	/* Total number of runt frames transmitted */
29382 	uint64_t	tx_runt_frames;
29383 	/* Total number of TX FIFO under runs */
29384 	uint64_t	tx_fifo_underruns;
29385 	/*
29386 	 * Total number of PFC frames with PFC enabled bit for
29387 	 * Pri 0 transmitted
29388 	 */
29389 	uint64_t	tx_pfc_ena_frames_pri0;
29390 	/*
29391 	 * Total number of PFC frames with PFC enabled bit for
29392 	 * Pri 1 transmitted
29393 	 */
29394 	uint64_t	tx_pfc_ena_frames_pri1;
29395 	/*
29396 	 * Total number of PFC frames with PFC enabled bit for
29397 	 * Pri 2 transmitted
29398 	 */
29399 	uint64_t	tx_pfc_ena_frames_pri2;
29400 	/*
29401 	 * Total number of PFC frames with PFC enabled bit for
29402 	 * Pri 3 transmitted
29403 	 */
29404 	uint64_t	tx_pfc_ena_frames_pri3;
29405 	/*
29406 	 * Total number of PFC frames with PFC enabled bit for
29407 	 * Pri 4 transmitted
29408 	 */
29409 	uint64_t	tx_pfc_ena_frames_pri4;
29410 	/*
29411 	 * Total number of PFC frames with PFC enabled bit for
29412 	 * Pri 5 transmitted
29413 	 */
29414 	uint64_t	tx_pfc_ena_frames_pri5;
29415 	/*
29416 	 * Total number of PFC frames with PFC enabled bit for
29417 	 * Pri 6 transmitted
29418 	 */
29419 	uint64_t	tx_pfc_ena_frames_pri6;
29420 	/*
29421 	 * Total number of PFC frames with PFC enabled bit for
29422 	 * Pri 7 transmitted
29423 	 */
29424 	uint64_t	tx_pfc_ena_frames_pri7;
29425 	/* Total number of EEE LPI Events on TX */
29426 	uint64_t	tx_eee_lpi_events;
29427 	/* EEE LPI Duration Counter on TX */
29428 	uint64_t	tx_eee_lpi_duration;
29429 	/*
29430 	 * Total number of Link Level Flow Control (LLFC) messages
29431 	 * transmitted
29432 	 */
29433 	uint64_t	tx_llfc_logical_msgs;
29434 	/* Total number of HCFC messages transmitted */
29435 	uint64_t	tx_hcfc_msgs;
29436 	/* Total number of TX collisions */
29437 	uint64_t	tx_total_collisions;
29438 	/* Total number of transmitted bytes */
29439 	uint64_t	tx_bytes;
29440 	/* Total number of end-to-end HOL frames */
29441 	uint64_t	tx_xthol_frames;
29442 	/* Total Tx Drops per Port reported by STATS block */
29443 	uint64_t	tx_stat_discard;
29444 	/* Total Tx Error Drops per Port reported by STATS block */
29445 	uint64_t	tx_stat_error;
29446 } tx_port_stats_t, *ptx_port_stats_t;
29447 
29448 /* Port Rx Statistics Format */
29449 /* rx_port_stats (size:4224b/528B) */
29450 
29451 typedef struct rx_port_stats {
29452 	/* Total Number of 64 Bytes frames received */
29453 	uint64_t	rx_64b_frames;
29454 	/* Total Number of 65-127 Bytes frames received */
29455 	uint64_t	rx_65b_127b_frames;
29456 	/* Total Number of 128-255 Bytes frames received */
29457 	uint64_t	rx_128b_255b_frames;
29458 	/* Total Number of 256-511 Bytes frames received */
29459 	uint64_t	rx_256b_511b_frames;
29460 	/* Total Number of 512-1023 Bytes frames received */
29461 	uint64_t	rx_512b_1023b_frames;
29462 	/* Total Number of 1024-1518 Bytes frames received */
29463 	uint64_t	rx_1024b_1518b_frames;
29464 	/*
29465 	 * Total Number of each good VLAN (excludes FCS errors)
29466 	 * frame received which is 1519 to 1522 bytes in length
29467 	 * inclusive (excluding framing bits but including FCS bytes).
29468 	 */
29469 	uint64_t	rx_good_vlan_frames;
29470 	/* Total Number of 1519-2047 Bytes frames received */
29471 	uint64_t	rx_1519b_2047b_frames;
29472 	/* Total Number of 2048-4095 Bytes frames received */
29473 	uint64_t	rx_2048b_4095b_frames;
29474 	/* Total Number of 4096-9216 Bytes frames received */
29475 	uint64_t	rx_4096b_9216b_frames;
29476 	/* Total Number of 9217-16383 Bytes frames received */
29477 	uint64_t	rx_9217b_16383b_frames;
29478 	/* Total number of frames received */
29479 	uint64_t	rx_total_frames;
29480 	/* Total number of unicast frames received */
29481 	uint64_t	rx_ucast_frames;
29482 	/* Total number of multicast frames received */
29483 	uint64_t	rx_mcast_frames;
29484 	/* Total number of broadcast frames received */
29485 	uint64_t	rx_bcast_frames;
29486 	/* Total number of received frames with FCS error */
29487 	uint64_t	rx_fcs_err_frames;
29488 	/* Total number of control frames received */
29489 	uint64_t	rx_ctrl_frames;
29490 	/* Total number of PAUSE frames received */
29491 	uint64_t	rx_pause_frames;
29492 	/* Total number of PFC frames received */
29493 	uint64_t	rx_pfc_frames;
29494 	/*
29495 	 * Total number of frames received with an unsupported
29496 	 * opcode
29497 	 */
29498 	uint64_t	rx_unsupported_opcode_frames;
29499 	/*
29500 	 * Total number of frames received with an unsupported
29501 	 * DA for pause and PFC
29502 	 */
29503 	uint64_t	rx_unsupported_da_pausepfc_frames;
29504 	/* Total number of frames received with an unsupported SA */
29505 	uint64_t	rx_wrong_sa_frames;
29506 	/* Total number of received packets with alignment error */
29507 	uint64_t	rx_align_err_frames;
29508 	/* Total number of received frames with out-of-range length */
29509 	uint64_t	rx_oor_len_frames;
29510 	/* Total number of received frames with error termination */
29511 	uint64_t	rx_code_err_frames;
29512 	/*
29513 	 * Total number of received frames with a false carrier is
29514 	 * detected during idle, as defined by RX_ER samples active
29515 	 * and RXD is 0xE. The event is reported along with the
29516 	 * statistics generated on the next received frame. Only
29517 	 * one false carrier condition can be detected and logged
29518 	 * between frames.
29519 	 *
29520 	 * Carrier event, valid for 10M/100M speed modes only.
29521 	 */
29522 	uint64_t	rx_false_carrier_frames;
29523 	/* Total number of over-sized frames received */
29524 	uint64_t	rx_ovrsz_frames;
29525 	/* Total number of jabber packets received */
29526 	uint64_t	rx_jbr_frames;
29527 	/* Total number of received frames with MTU error */
29528 	uint64_t	rx_mtu_err_frames;
29529 	/* Total number of received frames with CRC match */
29530 	uint64_t	rx_match_crc_frames;
29531 	/* Total number of frames received promiscuously */
29532 	uint64_t	rx_promiscuous_frames;
29533 	/*
29534 	 * Total number of received frames with one or two VLAN
29535 	 * tags
29536 	 */
29537 	uint64_t	rx_tagged_frames;
29538 	/* Total number of received frames with two VLAN tags */
29539 	uint64_t	rx_double_tagged_frames;
29540 	/* Total number of truncated frames received */
29541 	uint64_t	rx_trunc_frames;
29542 	/* Total number of good frames (without errors) received */
29543 	uint64_t	rx_good_frames;
29544 	/*
29545 	 * Total number of received PFC frames with transition from
29546 	 * XON to XOFF on Pri 0
29547 	 */
29548 	uint64_t	rx_pfc_xon2xoff_frames_pri0;
29549 	/*
29550 	 * Total number of received PFC frames with transition from
29551 	 * XON to XOFF on Pri 1
29552 	 */
29553 	uint64_t	rx_pfc_xon2xoff_frames_pri1;
29554 	/*
29555 	 * Total number of received PFC frames with transition from
29556 	 * XON to XOFF on Pri 2
29557 	 */
29558 	uint64_t	rx_pfc_xon2xoff_frames_pri2;
29559 	/*
29560 	 * Total number of received PFC frames with transition from
29561 	 * XON to XOFF on Pri 3
29562 	 */
29563 	uint64_t	rx_pfc_xon2xoff_frames_pri3;
29564 	/*
29565 	 * Total number of received PFC frames with transition from
29566 	 * XON to XOFF on Pri 4
29567 	 */
29568 	uint64_t	rx_pfc_xon2xoff_frames_pri4;
29569 	/*
29570 	 * Total number of received PFC frames with transition from
29571 	 * XON to XOFF on Pri 5
29572 	 */
29573 	uint64_t	rx_pfc_xon2xoff_frames_pri5;
29574 	/*
29575 	 * Total number of received PFC frames with transition from
29576 	 * XON to XOFF on Pri 6
29577 	 */
29578 	uint64_t	rx_pfc_xon2xoff_frames_pri6;
29579 	/*
29580 	 * Total number of received PFC frames with transition from
29581 	 * XON to XOFF on Pri 7
29582 	 */
29583 	uint64_t	rx_pfc_xon2xoff_frames_pri7;
29584 	/*
29585 	 * Total number of received PFC frames with PFC enabled
29586 	 * bit for Pri 0
29587 	 */
29588 	uint64_t	rx_pfc_ena_frames_pri0;
29589 	/*
29590 	 * Total number of received PFC frames with PFC enabled
29591 	 * bit for Pri 1
29592 	 */
29593 	uint64_t	rx_pfc_ena_frames_pri1;
29594 	/*
29595 	 * Total number of received PFC frames with PFC enabled
29596 	 * bit for Pri 2
29597 	 */
29598 	uint64_t	rx_pfc_ena_frames_pri2;
29599 	/*
29600 	 * Total number of received PFC frames with PFC enabled
29601 	 * bit for Pri 3
29602 	 */
29603 	uint64_t	rx_pfc_ena_frames_pri3;
29604 	/*
29605 	 * Total number of received PFC frames with PFC enabled
29606 	 * bit for Pri 4
29607 	 */
29608 	uint64_t	rx_pfc_ena_frames_pri4;
29609 	/*
29610 	 * Total number of received PFC frames with PFC enabled
29611 	 * bit for Pri 5
29612 	 */
29613 	uint64_t	rx_pfc_ena_frames_pri5;
29614 	/*
29615 	 * Total number of received PFC frames with PFC enabled
29616 	 * bit for Pri 6
29617 	 */
29618 	uint64_t	rx_pfc_ena_frames_pri6;
29619 	/*
29620 	 * Total number of received PFC frames with PFC enabled
29621 	 * bit for Pri 7
29622 	 */
29623 	uint64_t	rx_pfc_ena_frames_pri7;
29624 	/* Total Number of frames received with SCH CRC error */
29625 	uint64_t	rx_sch_crc_err_frames;
29626 	/* Total Number of under-sized frames received */
29627 	uint64_t	rx_undrsz_frames;
29628 	/* Total Number of fragmented frames received */
29629 	uint64_t	rx_frag_frames;
29630 	/* Total number of RX EEE LPI Events */
29631 	uint64_t	rx_eee_lpi_events;
29632 	/* EEE LPI Duration Counter on RX */
29633 	uint64_t	rx_eee_lpi_duration;
29634 	/*
29635 	 * Total number of physical type Link Level Flow Control
29636 	 * (LLFC) messages received
29637 	 */
29638 	uint64_t	rx_llfc_physical_msgs;
29639 	/*
29640 	 * Total number of logical type Link Level Flow Control
29641 	 * (LLFC) messages received
29642 	 */
29643 	uint64_t	rx_llfc_logical_msgs;
29644 	/*
29645 	 * Total number of logical type Link Level Flow Control
29646 	 * (LLFC) messages received with CRC error
29647 	 */
29648 	uint64_t	rx_llfc_msgs_with_crc_err;
29649 	/* Total number of HCFC messages received */
29650 	uint64_t	rx_hcfc_msgs;
29651 	/* Total number of HCFC messages received with CRC error */
29652 	uint64_t	rx_hcfc_msgs_with_crc_err;
29653 	/* Total number of received bytes */
29654 	uint64_t	rx_bytes;
29655 	/* Total number of bytes received in runt frames */
29656 	uint64_t	rx_runt_bytes;
29657 	/* Total number of runt frames received */
29658 	uint64_t	rx_runt_frames;
29659 	/* Total Rx Discards per Port reported by STATS block */
29660 	uint64_t	rx_stat_discard;
29661 	uint64_t	rx_stat_err;
29662 } rx_port_stats_t, *prx_port_stats_t;
29663 
29664 /********************
29665  * hwrm_port_qstats *
29666  ********************/
29667 
29668 
29669 /* hwrm_port_qstats_input (size:320b/40B) */
29670 
29671 typedef struct hwrm_port_qstats_input {
29672 	/* The HWRM command request type. */
29673 	uint16_t	req_type;
29674 	/*
29675 	 * The completion ring to send the completion event on. This should
29676 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
29677 	 */
29678 	uint16_t	cmpl_ring;
29679 	/*
29680 	 * The sequence ID is used by the driver for tracking multiple
29681 	 * commands. This ID is treated as opaque data by the firmware and
29682 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
29683 	 */
29684 	uint16_t	seq_id;
29685 	/*
29686 	 * The target ID of the command:
29687 	 * * 0x0-0xFFF8 - The function ID
29688 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29689 	 * * 0xFFFD - Reserved for user-space HWRM interface
29690 	 * * 0xFFFF - HWRM
29691 	 */
29692 	uint16_t	target_id;
29693 	/*
29694 	 * A physical address pointer pointing to a host buffer that the
29695 	 * command's response data will be written. This can be either a host
29696 	 * physical address (HPA) or a guest physical address (GPA) and must
29697 	 * point to a physically contiguous block of memory.
29698 	 */
29699 	uint64_t	resp_addr;
29700 	/* Port ID of port that is being queried. */
29701 	uint16_t	port_id;
29702 	uint8_t	flags;
29703 	/*
29704 	 * This bit is set to 1 when request is for a counter mask,
29705 	 * representing the width of each of the stats counters, rather
29706 	 * than counters themselves.
29707 	 */
29708 	#define HWRM_PORT_QSTATS_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
29709 	uint8_t	unused_0[5];
29710 	/*
29711 	 * This is the host address where
29712 	 * Tx port statistics will be stored
29713 	 */
29714 	uint64_t	tx_stat_host_addr;
29715 	/*
29716 	 * This is the host address where
29717 	 * Rx port statistics will be stored
29718 	 */
29719 	uint64_t	rx_stat_host_addr;
29720 } hwrm_port_qstats_input_t, *phwrm_port_qstats_input_t;
29721 
29722 /* hwrm_port_qstats_output (size:128b/16B) */
29723 
29724 typedef struct hwrm_port_qstats_output {
29725 	/* The specific error status for the command. */
29726 	uint16_t	error_code;
29727 	/* The HWRM command request type. */
29728 	uint16_t	req_type;
29729 	/* The sequence ID from the original command. */
29730 	uint16_t	seq_id;
29731 	/* The length of the response data in number of bytes. */
29732 	uint16_t	resp_len;
29733 	/* The size of TX port statistics block in bytes. */
29734 	uint16_t	tx_stat_size;
29735 	/* The size of RX port statistics block in bytes. */
29736 	uint16_t	rx_stat_size;
29737 	uint8_t	unused_0[3];
29738 	/*
29739 	 * This field is used in Output records to indicate that the output
29740 	 * is completely written to RAM. This field should be read as '1'
29741 	 * to indicate that the output has been completely written. When
29742 	 * writing a command completion or response to an internal processor,
29743 	 * the order of writes has to be such that this field is written last.
29744 	 */
29745 	uint8_t	valid;
29746 } hwrm_port_qstats_output_t, *phwrm_port_qstats_output_t;
29747 
29748 /* Port Tx Statistics extended Format */
29749 /* tx_port_stats_ext (size:2048b/256B) */
29750 
29751 typedef struct tx_port_stats_ext {
29752 	/* Total number of tx bytes count on cos queue 0 */
29753 	uint64_t	tx_bytes_cos0;
29754 	/* Total number of tx bytes count on cos queue 1 */
29755 	uint64_t	tx_bytes_cos1;
29756 	/* Total number of tx bytes count on cos queue 2 */
29757 	uint64_t	tx_bytes_cos2;
29758 	/* Total number of tx bytes count on cos queue 3 */
29759 	uint64_t	tx_bytes_cos3;
29760 	/* Total number of tx bytes count on cos queue 4 */
29761 	uint64_t	tx_bytes_cos4;
29762 	/* Total number of tx bytes count on cos queue 5 */
29763 	uint64_t	tx_bytes_cos5;
29764 	/* Total number of tx bytes count on cos queue 6 */
29765 	uint64_t	tx_bytes_cos6;
29766 	/* Total number of tx bytes count on cos queue 7 */
29767 	uint64_t	tx_bytes_cos7;
29768 	/* Total number of tx packets count on cos queue 0 */
29769 	uint64_t	tx_packets_cos0;
29770 	/* Total number of tx packets count on cos queue 1 */
29771 	uint64_t	tx_packets_cos1;
29772 	/* Total number of tx packets count on cos queue 2 */
29773 	uint64_t	tx_packets_cos2;
29774 	/* Total number of tx packets count on cos queue 3 */
29775 	uint64_t	tx_packets_cos3;
29776 	/* Total number of tx packets count on cos queue 4 */
29777 	uint64_t	tx_packets_cos4;
29778 	/* Total number of tx packets count on cos queue 5 */
29779 	uint64_t	tx_packets_cos5;
29780 	/* Total number of tx packets count on cos queue 6 */
29781 	uint64_t	tx_packets_cos6;
29782 	/* Total number of tx packets count on cos queue 7 */
29783 	uint64_t	tx_packets_cos7;
29784 	/*
29785 	 * time duration between transmitting a XON -> XOFF and a subsequent XOFF
29786 	 * -> XON for priority 0
29787 	 */
29788 	uint64_t	pfc_pri0_tx_duration_us;
29789 	/*
29790 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29791 	 * priority 0
29792 	 */
29793 	uint64_t	pfc_pri0_tx_transitions;
29794 	/*
29795 	 * time duration between transmitting a XON -> XOFF and a subsequent XOFF
29796 	 * -> XON for priority 1
29797 	 */
29798 	uint64_t	pfc_pri1_tx_duration_us;
29799 	/*
29800 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29801 	 * priority 1
29802 	 */
29803 	uint64_t	pfc_pri1_tx_transitions;
29804 	/*
29805 	 * time duration between transmitting a XON -> XOFF and a subsequent XOFF
29806 	 * -> XON for priority 2
29807 	 */
29808 	uint64_t	pfc_pri2_tx_duration_us;
29809 	/*
29810 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29811 	 * priority 2
29812 	 */
29813 	uint64_t	pfc_pri2_tx_transitions;
29814 	/*
29815 	 * time duration between transmitting a XON -> XOFF and a subsequent XOFF
29816 	 * -> XON for priority 3
29817 	 */
29818 	uint64_t	pfc_pri3_tx_duration_us;
29819 	/*
29820 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29821 	 * priority 3
29822 	 */
29823 	uint64_t	pfc_pri3_tx_transitions;
29824 	/*
29825 	 * time duration between transmitting a XON -> XOFF and a subsequent XOFF
29826 	 * -> XON for priority 4
29827 	 */
29828 	uint64_t	pfc_pri4_tx_duration_us;
29829 	/*
29830 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29831 	 * priority 4
29832 	 */
29833 	uint64_t	pfc_pri4_tx_transitions;
29834 	/*
29835 	 * time duration between transmitting a XON -> XOFF and a subsequent XOFF
29836 	 * -> XON for priority 5
29837 	 */
29838 	uint64_t	pfc_pri5_tx_duration_us;
29839 	/*
29840 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29841 	 * priority 5
29842 	 */
29843 	uint64_t	pfc_pri5_tx_transitions;
29844 	/*
29845 	 * time duration between transmitting a XON -> XOFF and a subsequent XOFF
29846 	 * -> XON for priority 6
29847 	 */
29848 	uint64_t	pfc_pri6_tx_duration_us;
29849 	/*
29850 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29851 	 * priority 6
29852 	 */
29853 	uint64_t	pfc_pri6_tx_transitions;
29854 	/*
29855 	 * time duration between transmitting a XON -> XOFF and a subsequent XOFF
29856 	 * -> XON for priority 7
29857 	 */
29858 	uint64_t	pfc_pri7_tx_duration_us;
29859 	/*
29860 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29861 	 * priority 7
29862 	 */
29863 	uint64_t	pfc_pri7_tx_transitions;
29864 } tx_port_stats_ext_t, *ptx_port_stats_ext_t;
29865 
29866 /* Port Rx Statistics extended Format */
29867 /* rx_port_stats_ext (size:3904b/488B) */
29868 
29869 typedef struct rx_port_stats_ext {
29870 	/* Number of times link state changed to down */
29871 	uint64_t	link_down_events;
29872 	/* Number of times the idle rings with pause bit are found */
29873 	uint64_t	continuous_pause_events;
29874 	/* Number of times the active rings pause bit resumed back */
29875 	uint64_t	resume_pause_events;
29876 	/*
29877 	 * Number of times, the ROCE cos queue PFC is disabled to avoid pause
29878 	 * flood/burst
29879 	 */
29880 	uint64_t	continuous_roce_pause_events;
29881 	/* Number of times, the ROCE cos queue PFC is enabled back */
29882 	uint64_t	resume_roce_pause_events;
29883 	/* Total number of rx bytes count on cos queue 0 */
29884 	uint64_t	rx_bytes_cos0;
29885 	/* Total number of rx bytes count on cos queue 1 */
29886 	uint64_t	rx_bytes_cos1;
29887 	/* Total number of rx bytes count on cos queue 2 */
29888 	uint64_t	rx_bytes_cos2;
29889 	/* Total number of rx bytes count on cos queue 3 */
29890 	uint64_t	rx_bytes_cos3;
29891 	/* Total number of rx bytes count on cos queue 4 */
29892 	uint64_t	rx_bytes_cos4;
29893 	/* Total number of rx bytes count on cos queue 5 */
29894 	uint64_t	rx_bytes_cos5;
29895 	/* Total number of rx bytes count on cos queue 6 */
29896 	uint64_t	rx_bytes_cos6;
29897 	/* Total number of rx bytes count on cos queue 7 */
29898 	uint64_t	rx_bytes_cos7;
29899 	/* Total number of rx packets count on cos queue 0 */
29900 	uint64_t	rx_packets_cos0;
29901 	/* Total number of rx packets count on cos queue 1 */
29902 	uint64_t	rx_packets_cos1;
29903 	/* Total number of rx packets count on cos queue 2 */
29904 	uint64_t	rx_packets_cos2;
29905 	/* Total number of rx packets count on cos queue 3 */
29906 	uint64_t	rx_packets_cos3;
29907 	/* Total number of rx packets count on cos queue 4 */
29908 	uint64_t	rx_packets_cos4;
29909 	/* Total number of rx packets count on cos queue 5 */
29910 	uint64_t	rx_packets_cos5;
29911 	/* Total number of rx packets count on cos queue 6 */
29912 	uint64_t	rx_packets_cos6;
29913 	/* Total number of rx packets count on cos queue 7 */
29914 	uint64_t	rx_packets_cos7;
29915 	/*
29916 	 * time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for
29917 	 * priority 0
29918 	 */
29919 	uint64_t	pfc_pri0_rx_duration_us;
29920 	/*
29921 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29922 	 * priority 0
29923 	 */
29924 	uint64_t	pfc_pri0_rx_transitions;
29925 	/*
29926 	 * time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for
29927 	 * priority 1
29928 	 */
29929 	uint64_t	pfc_pri1_rx_duration_us;
29930 	/*
29931 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29932 	 * priority 1
29933 	 */
29934 	uint64_t	pfc_pri1_rx_transitions;
29935 	/*
29936 	 * time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for
29937 	 * priority 2
29938 	 */
29939 	uint64_t	pfc_pri2_rx_duration_us;
29940 	/*
29941 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29942 	 * priority 2
29943 	 */
29944 	uint64_t	pfc_pri2_rx_transitions;
29945 	/*
29946 	 * time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for
29947 	 * priority 3
29948 	 */
29949 	uint64_t	pfc_pri3_rx_duration_us;
29950 	/*
29951 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29952 	 * priority 3
29953 	 */
29954 	uint64_t	pfc_pri3_rx_transitions;
29955 	/*
29956 	 * time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for
29957 	 * priority 4
29958 	 */
29959 	uint64_t	pfc_pri4_rx_duration_us;
29960 	/*
29961 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29962 	 * priority 4
29963 	 */
29964 	uint64_t	pfc_pri4_rx_transitions;
29965 	/*
29966 	 * time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for
29967 	 * priority 5
29968 	 */
29969 	uint64_t	pfc_pri5_rx_duration_us;
29970 	/*
29971 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29972 	 * priority 5
29973 	 */
29974 	uint64_t	pfc_pri5_rx_transitions;
29975 	/*
29976 	 * time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for
29977 	 * priority 6
29978 	 */
29979 	uint64_t	pfc_pri6_rx_duration_us;
29980 	/*
29981 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29982 	 * priority 6
29983 	 */
29984 	uint64_t	pfc_pri6_rx_transitions;
29985 	/*
29986 	 * time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for
29987 	 * priority 7
29988 	 */
29989 	uint64_t	pfc_pri7_rx_duration_us;
29990 	/*
29991 	 * Number of times, a XON -> XOFF and XOFF -> XON transitions occur for
29992 	 * priority 7
29993 	 */
29994 	uint64_t	pfc_pri7_rx_transitions;
29995 	/* Total number of received bits */
29996 	uint64_t	rx_bits;
29997 	/* The number of events where the port receive buffer was over 85% full */
29998 	uint64_t	rx_buffer_passed_threshold;
29999 	/*
30000 	 * This counter represents uncorrected symbol errors post-FEC and may not
30001 	 * be populated in all cases. Each uncorrected FEC block may result in
30002 	 * one or more symbol errors.
30003 	 */
30004 	uint64_t	rx_pcs_symbol_err;
30005 	/* The number of corrected bits on the port according to active FEC */
30006 	uint64_t	rx_corrected_bits;
30007 	/* Total number of rx discard bytes count on cos queue 0 */
30008 	uint64_t	rx_discard_bytes_cos0;
30009 	/* Total number of rx discard bytes count on cos queue 1 */
30010 	uint64_t	rx_discard_bytes_cos1;
30011 	/* Total number of rx discard bytes count on cos queue 2 */
30012 	uint64_t	rx_discard_bytes_cos2;
30013 	/* Total number of rx discard bytes count on cos queue 3 */
30014 	uint64_t	rx_discard_bytes_cos3;
30015 	/* Total number of rx discard bytes count on cos queue 4 */
30016 	uint64_t	rx_discard_bytes_cos4;
30017 	/* Total number of rx discard bytes count on cos queue 5 */
30018 	uint64_t	rx_discard_bytes_cos5;
30019 	/* Total number of rx discard bytes count on cos queue 6 */
30020 	uint64_t	rx_discard_bytes_cos6;
30021 	/* Total number of rx discard bytes count on cos queue 7 */
30022 	uint64_t	rx_discard_bytes_cos7;
30023 	/* Total number of rx discard packets count on cos queue 0 */
30024 	uint64_t	rx_discard_packets_cos0;
30025 	/* Total number of rx discard packets count on cos queue 1 */
30026 	uint64_t	rx_discard_packets_cos1;
30027 	/* Total number of rx discard packets count on cos queue 2 */
30028 	uint64_t	rx_discard_packets_cos2;
30029 	/* Total number of rx discard packets count on cos queue 3 */
30030 	uint64_t	rx_discard_packets_cos3;
30031 	/* Total number of rx discard packets count on cos queue 4 */
30032 	uint64_t	rx_discard_packets_cos4;
30033 	/* Total number of rx discard packets count on cos queue 5 */
30034 	uint64_t	rx_discard_packets_cos5;
30035 	/* Total number of rx discard packets count on cos queue 6 */
30036 	uint64_t	rx_discard_packets_cos6;
30037 	/* Total number of rx discard packets count on cos queue 7 */
30038 	uint64_t	rx_discard_packets_cos7;
30039 	/* Total number of FEC blocks corrected by the FEC function in the PHY */
30040 	uint64_t	rx_fec_corrected_blocks;
30041 	/*
30042 	 * Total number of FEC blocks determined to be uncorrectable by the
30043 	 * FEC function in the PHY
30044 	 */
30045 	uint64_t	rx_fec_uncorrectable_blocks;
30046 	/*
30047 	 * Total number of packets that are dropped due to not matching
30048 	 * any RX filter rules. This value is zero on the non supported
30049 	 * controllers. This counter is per controller, Firmware reports the
30050 	 * same value on active ports. This counter does not include the
30051 	 * packet discards because of no available buffers.
30052 	 */
30053 	uint64_t	rx_filter_miss;
30054 	/*
30055 	 * This field represents the number of FEC symbol errors by counting
30056 	 * once for each 10-bit symbol corrected by FEC block.
30057 	 * rx_fec_corrected_blocks will be incremented if all symbol errors in a
30058 	 * codeword gets corrected.
30059 	 */
30060 	uint64_t	rx_fec_symbol_err;
30061 } rx_port_stats_ext_t, *prx_port_stats_ext_t;
30062 
30063 /*
30064  * Port Rx Statistics extended PFC WatchDog Format.
30065  * StormDetect and StormRevert event determination is based
30066  * on an integration period and a percentage threshold.
30067  * StormDetect event - when percentage of XOFF frames received
30068  * within an integration period exceeds the configured threshold.
30069  * StormRevert event - when percentage of XON frames received
30070  * within an integration period exceeds the configured threshold.
30071  * Actual number of XOFF/XON frames for the events to be triggered
30072  * depends on both configured integration period and sampling rate.
30073  * The statistics in this structure represent counts of specified
30074  * events from the moment the feature (PFC WatchDog) is enabled via
30075  * hwrm_queue_pfc_enable_cfg call.
30076  */
30077 /* rx_port_stats_ext_pfc_wd (size:5120b/640B) */
30078 
30079 typedef struct rx_port_stats_ext_pfc_wd {
30080 	/*
30081 	 * Total number of PFC WatchDog StormDetect events detected
30082 	 * for Pri 0
30083 	 */
30084 	uint64_t	rx_pfc_watchdog_storms_detected_pri0;
30085 	/*
30086 	 * Total number of PFC WatchDog StormDetect events detected
30087 	 * for Pri 1
30088 	 */
30089 	uint64_t	rx_pfc_watchdog_storms_detected_pri1;
30090 	/*
30091 	 * Total number of PFC WatchDog StormDetect events detected
30092 	 * for Pri 2
30093 	 */
30094 	uint64_t	rx_pfc_watchdog_storms_detected_pri2;
30095 	/*
30096 	 * Total number of PFC WatchDog StormDetect events detected
30097 	 * for Pri 3
30098 	 */
30099 	uint64_t	rx_pfc_watchdog_storms_detected_pri3;
30100 	/*
30101 	 * Total number of PFC WatchDog StormDetect events detected
30102 	 * for Pri 4
30103 	 */
30104 	uint64_t	rx_pfc_watchdog_storms_detected_pri4;
30105 	/*
30106 	 * Total number of PFC WatchDog StormDetect events detected
30107 	 * for Pri 5
30108 	 */
30109 	uint64_t	rx_pfc_watchdog_storms_detected_pri5;
30110 	/*
30111 	 * Total number of PFC WatchDog StormDetect events detected
30112 	 * for Pri 6
30113 	 */
30114 	uint64_t	rx_pfc_watchdog_storms_detected_pri6;
30115 	/*
30116 	 * Total number of PFC WatchDog StormDetect events detected
30117 	 * for Pri 7
30118 	 */
30119 	uint64_t	rx_pfc_watchdog_storms_detected_pri7;
30120 	/*
30121 	 * Total number of PFC WatchDog StormRevert events detected
30122 	 * for Pri 0
30123 	 */
30124 	uint64_t	rx_pfc_watchdog_storms_reverted_pri0;
30125 	/*
30126 	 * Total number of PFC WatchDog StormRevert events detected
30127 	 * for Pri 1
30128 	 */
30129 	uint64_t	rx_pfc_watchdog_storms_reverted_pri1;
30130 	/*
30131 	 * Total number of PFC WatchDog StormRevert events detected
30132 	 * for Pri 2
30133 	 */
30134 	uint64_t	rx_pfc_watchdog_storms_reverted_pri2;
30135 	/*
30136 	 * Total number of PFC WatchDog StormRevert events detected
30137 	 * for Pri 3
30138 	 */
30139 	uint64_t	rx_pfc_watchdog_storms_reverted_pri3;
30140 	/*
30141 	 * Total number of PFC WatchDog StormRevert events detected
30142 	 * for Pri 4
30143 	 */
30144 	uint64_t	rx_pfc_watchdog_storms_reverted_pri4;
30145 	/*
30146 	 * Total number of PFC WatchDog StormRevert events detected
30147 	 * for Pri 5
30148 	 */
30149 	uint64_t	rx_pfc_watchdog_storms_reverted_pri5;
30150 	/*
30151 	 * Total number of PFC WatchDog StormRevert events detected
30152 	 * for Pri 6
30153 	 */
30154 	uint64_t	rx_pfc_watchdog_storms_reverted_pri6;
30155 	/*
30156 	 * Total number of PFC WatchDog StormRevert events detected
30157 	 * for Pri 7
30158 	 */
30159 	uint64_t	rx_pfc_watchdog_storms_reverted_pri7;
30160 	/*
30161 	 * Total number of packets received during PFC watchdog storm
30162 	 * for pri 0
30163 	 */
30164 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri0;
30165 	/*
30166 	 * Total number of packets received during PFC watchdog storm
30167 	 * for pri 1
30168 	 */
30169 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri1;
30170 	/*
30171 	 * Total number of packets received during PFC watchdog storm
30172 	 *  for pri 2
30173 	 */
30174 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri2;
30175 	/*
30176 	 * Total number of packets received during PFC watchdog storm
30177 	 *  for pri 3
30178 	 */
30179 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri3;
30180 	/*
30181 	 * Total number of packets received during PFC watchdog storm
30182 	 *  for pri 4
30183 	 */
30184 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri4;
30185 	/*
30186 	 * Total number of packets received during PFC watchdog storm
30187 	 *  for pri 5
30188 	 */
30189 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri5;
30190 	/*
30191 	 * Total number of packets received during PFC watchdog storm
30192 	 *  for pri 6
30193 	 */
30194 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri6;
30195 	/*
30196 	 * Total number of packets received during PFC watchdog storm
30197 	 *  for pri 7
30198 	 */
30199 	uint64_t	rx_pfc_watchdog_storms_rx_packets_pri7;
30200 	/*
30201 	 * Total number of bytes received during PFC watchdog storm
30202 	 * for pri 0
30203 	 */
30204 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri0;
30205 	/*
30206 	 * Total number of bytes received during PFC watchdog storm
30207 	 * for pri 1
30208 	 */
30209 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri1;
30210 	/*
30211 	 * Total number of bytes received during PFC watchdog storm
30212 	 *  for pri 2
30213 	 */
30214 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri2;
30215 	/*
30216 	 * Total number of bytes received during PFC watchdog storm
30217 	 *  for pri 3
30218 	 */
30219 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri3;
30220 	/*
30221 	 * Total number of bytes received during PFC watchdog storm
30222 	 *  for pri 4
30223 	 */
30224 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri4;
30225 	/*
30226 	 * Total number of bytes received during PFC watchdog storm
30227 	 *  for pri 5
30228 	 */
30229 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri5;
30230 	/*
30231 	 * Total number of bytes received during PFC watchdog storm
30232 	 *  for pri 6
30233 	 */
30234 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri6;
30235 	/*
30236 	 * Total number of bytes received during PFC watchdog storm
30237 	 *  for pri 7
30238 	 */
30239 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_pri7;
30240 	/*
30241 	 * Total number of packets dropped on rx during PFC watchdog storm
30242 	 * for pri 0
30243 	 */
30244 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri0;
30245 	/*
30246 	 * Total number of packets dropped on rx during PFC watchdog storm
30247 	 * for pri 1
30248 	 */
30249 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri1;
30250 	/*
30251 	 * Total number of packets dropped on rx during PFC watchdog storm
30252 	 *  for pri 2
30253 	 */
30254 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri2;
30255 	/*
30256 	 * Total number of packets dropped on rx during PFC watchdog storm
30257 	 *  for pri 3
30258 	 */
30259 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri3;
30260 	/*
30261 	 * Total number of packets dropped on rx during PFC watchdog storm
30262 	 *  for pri 4
30263 	 */
30264 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri4;
30265 	/*
30266 	 * Total number of packets dropped on rx during PFC watchdog storm
30267 	 *  for pri 5
30268 	 */
30269 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri5;
30270 	/*
30271 	 * Total number of packets dropped on rx during PFC watchdog storm
30272 	 *  for pri 6
30273 	 */
30274 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri6;
30275 	/*
30276 	 * Total number of packets dropped on rx during PFC watchdog storm
30277 	 *  for pri 7
30278 	 */
30279 	uint64_t	rx_pfc_watchdog_storms_rx_packets_dropped_pri7;
30280 	/*
30281 	 * Total number of bytes dropped on rx during PFC watchdog storm
30282 	 * for pri 0
30283 	 */
30284 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri0;
30285 	/*
30286 	 * Total number of bytes dropped on rx during PFC watchdog storm
30287 	 * for pri 1
30288 	 */
30289 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri1;
30290 	/*
30291 	 * Total number of bytes dropped on rx during PFC watchdog storm
30292 	 *  for pri 2
30293 	 */
30294 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri2;
30295 	/*
30296 	 * Total number of bytes dropped on rx during PFC watchdog storm
30297 	 *  for pri 3
30298 	 */
30299 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri3;
30300 	/*
30301 	 * Total number of bytes dropped on rx during PFC watchdog storm
30302 	 *  for pri 4
30303 	 */
30304 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri4;
30305 	/*
30306 	 * Total number of bytes dropped on rx during PFC watchdog storm
30307 	 *  for pri 5
30308 	 */
30309 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri5;
30310 	/*
30311 	 * Total number of bytes dropped on rx during PFC watchdog storm
30312 	 *  for pri 6
30313 	 */
30314 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri6;
30315 	/*
30316 	 * Total number of bytes dropped on rx during PFC watchdog storm
30317 	 *  for pri 7
30318 	 */
30319 	uint64_t	rx_pfc_watchdog_storms_rx_bytes_dropped_pri7;
30320 	/*
30321 	 * Number of packets received during last PFC watchdog storm
30322 	 * for pri 0
30323 	 */
30324 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri0;
30325 	/*
30326 	 * Number of packets received during last PFC watchdog storm
30327 	 * for pri 1
30328 	 */
30329 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri1;
30330 	/*
30331 	 * Number of packets received during last PFC watchdog storm
30332 	 *  for pri 2
30333 	 */
30334 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri2;
30335 	/*
30336 	 * Number of packets received during last PFC watchdog storm
30337 	 *  for pri 3
30338 	 */
30339 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri3;
30340 	/*
30341 	 * Number of packets received during last PFC watchdog storm
30342 	 *  for pri 4
30343 	 */
30344 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri4;
30345 	/*
30346 	 * Number of packets received during last PFC watchdog storm
30347 	 *  for pri 5
30348 	 */
30349 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri5;
30350 	/*
30351 	 * Number of packets received during last PFC watchdog storm
30352 	 *  for pri 6
30353 	 */
30354 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri6;
30355 	/*
30356 	 * Number of packets received during last PFC watchdog storm
30357 	 *  for pri 7
30358 	 */
30359 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_pri7;
30360 	/*
30361 	 * Number of bytes received during last PFC watchdog storm
30362 	 * for pri 0
30363 	 */
30364 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri0;
30365 	/*
30366 	 * Number of bytes received during last PFC watchdog storm
30367 	 * for pri 1
30368 	 */
30369 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri1;
30370 	/*
30371 	 * Number of bytes received during last PFC watchdog storm
30372 	 *  for pri 2
30373 	 */
30374 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri2;
30375 	/*
30376 	 * Number of bytes received during last PFC watchdog storm
30377 	 *  for pri 3
30378 	 */
30379 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri3;
30380 	/*
30381 	 * Number of bytes received during last PFC watchdog storm
30382 	 *  for pri 4
30383 	 */
30384 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri4;
30385 	/*
30386 	 * Number of bytes received during last PFC watchdog storm
30387 	 *  for pri 5
30388 	 */
30389 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri5;
30390 	/*
30391 	 * Number of bytes received during last PFC watchdog storm
30392 	 *  for pri 6
30393 	 */
30394 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri6;
30395 	/*
30396 	 * Number of bytes received during last PFC watchdog storm
30397 	 *  for pri 7
30398 	 */
30399 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_pri7;
30400 	/*
30401 	 * Number of packets dropped on rx during last PFC watchdog storm
30402 	 * for pri 0
30403 	 */
30404 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri0;
30405 	/*
30406 	 * Number of packets dropped on rx during last PFC watchdog storm
30407 	 * for pri 1
30408 	 */
30409 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri1;
30410 	/*
30411 	 * Number of packets dropped on rx during last PFC watchdog storm
30412 	 *  for pri 2
30413 	 */
30414 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri2;
30415 	/*
30416 	 * Number of packets dropped on rx during last PFC watchdog storm
30417 	 *  for pri 3
30418 	 */
30419 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri3;
30420 	/*
30421 	 * Number of packets dropped on rx during last PFC watchdog storm
30422 	 *  for pri 4
30423 	 */
30424 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri4;
30425 	/*
30426 	 * Number of packets dropped on rx during last PFC watchdog storm
30427 	 *  for pri 5
30428 	 */
30429 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri5;
30430 	/*
30431 	 * Number of packets dropped on rx during last PFC watchdog storm
30432 	 *  for pri 6
30433 	 */
30434 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri6;
30435 	/*
30436 	 * Number of packets dropped on rx during last PFC watchdog storm
30437 	 *  for pri 7
30438 	 */
30439 	uint64_t	rx_pfc_watchdog_last_storm_rx_packets_dropped_pri7;
30440 	/*
30441 	 * Total number of bytes dropped on rx during PFC watchdog storm
30442 	 * for pri 0
30443 	 */
30444 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri0;
30445 	/*
30446 	 * Number of bytes dropped on rx during last PFC watchdog storm
30447 	 * for pri 1
30448 	 */
30449 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri1;
30450 	/*
30451 	 * Number of bytes dropped on rx during last PFC watchdog storm
30452 	 *  for pri 2
30453 	 */
30454 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri2;
30455 	/*
30456 	 * Number of bytes dropped on rx during last PFC watchdog storm
30457 	 *  for pri 3
30458 	 */
30459 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri3;
30460 	/*
30461 	 * Number of bytes dropped on rx during last PFC watchdog storm
30462 	 *  for pri 4
30463 	 */
30464 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri4;
30465 	/*
30466 	 * Number of bytes dropped on rx during last PFC watchdog storm
30467 	 *  for pri 5
30468 	 */
30469 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri5;
30470 	/*
30471 	 * Number of bytes dropped on rx during last PFC watchdog storm
30472 	 *  for pri 6
30473 	 */
30474 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri6;
30475 	/*
30476 	 * Number of bytes dropped on rx during last PFC watchdog storm
30477 	 *  for pri 7
30478 	 */
30479 	uint64_t	rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri7;
30480 } rx_port_stats_ext_pfc_wd_t, *prx_port_stats_ext_pfc_wd_t;
30481 
30482 /************************
30483  * hwrm_port_qstats_ext *
30484  ************************/
30485 
30486 
30487 /* hwrm_port_qstats_ext_input (size:320b/40B) */
30488 
30489 typedef struct hwrm_port_qstats_ext_input {
30490 	/* The HWRM command request type. */
30491 	uint16_t	req_type;
30492 	/*
30493 	 * The completion ring to send the completion event on. This should
30494 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30495 	 */
30496 	uint16_t	cmpl_ring;
30497 	/*
30498 	 * The sequence ID is used by the driver for tracking multiple
30499 	 * commands. This ID is treated as opaque data by the firmware and
30500 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30501 	 */
30502 	uint16_t	seq_id;
30503 	/*
30504 	 * The target ID of the command:
30505 	 * * 0x0-0xFFF8 - The function ID
30506 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30507 	 * * 0xFFFD - Reserved for user-space HWRM interface
30508 	 * * 0xFFFF - HWRM
30509 	 */
30510 	uint16_t	target_id;
30511 	/*
30512 	 * A physical address pointer pointing to a host buffer that the
30513 	 * command's response data will be written. This can be either a host
30514 	 * physical address (HPA) or a guest physical address (GPA) and must
30515 	 * point to a physically contiguous block of memory.
30516 	 */
30517 	uint64_t	resp_addr;
30518 	/* Port ID of port that is being queried. */
30519 	uint16_t	port_id;
30520 	/*
30521 	 * The size of TX port extended
30522 	 * statistics block in bytes.
30523 	 */
30524 	uint16_t	tx_stat_size;
30525 	/*
30526 	 * The size of RX port extended
30527 	 * statistics block in bytes
30528 	 */
30529 	uint16_t	rx_stat_size;
30530 	uint8_t	flags;
30531 	/*
30532 	 * This bit is set to 1 when request is for the counter mask,
30533 	 * representing width of each of the stats counters, rather than
30534 	 * counters themselves.
30535 	 */
30536 	#define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
30537 	uint8_t	unused_0;
30538 	/*
30539 	 * This is the host address where
30540 	 * Tx port statistics will be stored
30541 	 */
30542 	uint64_t	tx_stat_host_addr;
30543 	/*
30544 	 * This is the host address where
30545 	 * Rx port statistics will be stored
30546 	 */
30547 	uint64_t	rx_stat_host_addr;
30548 } hwrm_port_qstats_ext_input_t, *phwrm_port_qstats_ext_input_t;
30549 
30550 /* hwrm_port_qstats_ext_output (size:128b/16B) */
30551 
30552 typedef struct hwrm_port_qstats_ext_output {
30553 	/* The specific error status for the command. */
30554 	uint16_t	error_code;
30555 	/* The HWRM command request type. */
30556 	uint16_t	req_type;
30557 	/* The sequence ID from the original command. */
30558 	uint16_t	seq_id;
30559 	/* The length of the response data in number of bytes. */
30560 	uint16_t	resp_len;
30561 	/* The size of TX port statistics block in bytes. */
30562 	uint16_t	tx_stat_size;
30563 	/* The size of RX port statistics block in bytes. */
30564 	uint16_t	rx_stat_size;
30565 	/* Total number of active cos queues available. */
30566 	uint16_t	total_active_cos_queues;
30567 	uint8_t	flags;
30568 	/*
30569 	 * If set to 1, then this field indicates that clear
30570 	 * roce specific counters is supported.
30571 	 */
30572 	#define HWRM_PORT_QSTATS_EXT_OUTPUT_FLAGS_CLEAR_ROCE_COUNTERS_SUPPORTED	UINT32_C(0x1)
30573 	/*
30574 	 * This field is used in Output records to indicate that the output
30575 	 * is completely written to RAM. This field should be read as '1'
30576 	 * to indicate that the output has been completely written. When
30577 	 * writing a command completion or response to an internal processor,
30578 	 * the order of writes has to be such that this field is written last.
30579 	 */
30580 	uint8_t	valid;
30581 } hwrm_port_qstats_ext_output_t, *phwrm_port_qstats_ext_output_t;
30582 
30583 /*******************************
30584  * hwrm_port_qstats_ext_pfc_wd *
30585  *******************************/
30586 
30587 
30588 /* hwrm_port_qstats_ext_pfc_wd_input (size:256b/32B) */
30589 
30590 typedef struct hwrm_port_qstats_ext_pfc_wd_input {
30591 	/* The HWRM command request type. */
30592 	uint16_t	req_type;
30593 	/*
30594 	 * The completion ring to send the completion event on. This should
30595 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30596 	 */
30597 	uint16_t	cmpl_ring;
30598 	/*
30599 	 * The sequence ID is used by the driver for tracking multiple
30600 	 * commands. This ID is treated as opaque data by the firmware and
30601 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30602 	 */
30603 	uint16_t	seq_id;
30604 	/*
30605 	 * The target ID of the command:
30606 	 * * 0x0-0xFFF8 - The function ID
30607 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30608 	 * * 0xFFFD - Reserved for user-space HWRM interface
30609 	 * * 0xFFFF - HWRM
30610 	 */
30611 	uint16_t	target_id;
30612 	/*
30613 	 * A physical address pointer pointing to a host buffer that the
30614 	 * command's response data will be written. This can be either a host
30615 	 * physical address (HPA) or a guest physical address (GPA) and must
30616 	 * point to a physically contiguous block of memory.
30617 	 */
30618 	uint64_t	resp_addr;
30619 	/* Port ID of port that is being queried. */
30620 	uint16_t	port_id;
30621 	/*
30622 	 * The size of rx_port_stats_ext_pfc_wd
30623 	 * block in bytes
30624 	 */
30625 	uint16_t	pfc_wd_stat_size;
30626 	uint8_t	unused_0[4];
30627 	/*
30628 	 * This is the host address where
30629 	 * rx_port_stats_ext_pfc_wd will be stored
30630 	 */
30631 	uint64_t	pfc_wd_stat_host_addr;
30632 } hwrm_port_qstats_ext_pfc_wd_input_t, *phwrm_port_qstats_ext_pfc_wd_input_t;
30633 
30634 /* hwrm_port_qstats_ext_pfc_wd_output (size:128b/16B) */
30635 
30636 typedef struct hwrm_port_qstats_ext_pfc_wd_output {
30637 	/* The specific error status for the command. */
30638 	uint16_t	error_code;
30639 	/* The HWRM command request type. */
30640 	uint16_t	req_type;
30641 	/* The sequence ID from the original command. */
30642 	uint16_t	seq_id;
30643 	/* The length of the response data in number of bytes. */
30644 	uint16_t	resp_len;
30645 	/*
30646 	 * The size of rx_port_stats_ext_pfc_wd
30647 	 * statistics block in bytes.
30648 	 */
30649 	uint16_t	pfc_wd_stat_size;
30650 	uint8_t	unused_0[5];
30651 	/*
30652 	 * This field is used in Output records to indicate that the output
30653 	 * is completely written to RAM. This field should be read as '1'
30654 	 * to indicate that the output has been completely written. When
30655 	 * writing a command completion or response to an internal processor,
30656 	 * the order of writes has to be such that this field is written last.
30657 	 */
30658 	uint8_t	valid;
30659 } hwrm_port_qstats_ext_pfc_wd_output_t, *phwrm_port_qstats_ext_pfc_wd_output_t;
30660 
30661 /*************************
30662  * hwrm_port_lpbk_qstats *
30663  *************************/
30664 
30665 
30666 /* hwrm_port_lpbk_qstats_input (size:256b/32B) */
30667 
30668 typedef struct hwrm_port_lpbk_qstats_input {
30669 	/* The HWRM command request type. */
30670 	uint16_t	req_type;
30671 	/*
30672 	 * The completion ring to send the completion event on. This should
30673 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30674 	 */
30675 	uint16_t	cmpl_ring;
30676 	/*
30677 	 * The sequence ID is used by the driver for tracking multiple
30678 	 * commands. This ID is treated as opaque data by the firmware and
30679 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30680 	 */
30681 	uint16_t	seq_id;
30682 	/*
30683 	 * The target ID of the command:
30684 	 * * 0x0-0xFFF8 - The function ID
30685 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30686 	 * * 0xFFFD - Reserved for user-space HWRM interface
30687 	 * * 0xFFFF - HWRM
30688 	 */
30689 	uint16_t	target_id;
30690 	/*
30691 	 * A physical address pointer pointing to a host buffer that the
30692 	 * command's response data will be written. This can be either a host
30693 	 * physical address (HPA) or a guest physical address (GPA) and must
30694 	 * point to a physically contiguous block of memory.
30695 	 */
30696 	uint64_t	resp_addr;
30697 	/*
30698 	 * The size of the loopback statistics buffer passed in the
30699 	 * loopback_stat_host_addr in bytes.
30700 	 * Firmware will not exceed this size when it DMAs the
30701 	 * statistics structure to the host. The actual DMA size
30702 	 * will be returned in the response.
30703 	 */
30704 	uint16_t	lpbk_stat_size;
30705 	uint8_t	flags;
30706 	/*
30707 	 * This bit is set to 1 when request is for a counter mask,
30708 	 * representing the width of each of the stats counters, rather
30709 	 * than counters themselves.
30710 	 */
30711 	#define HWRM_PORT_LPBK_QSTATS_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
30712 	uint8_t	unused_0[5];
30713 	/*
30714 	 * This is the host address where
30715 	 * loopback statistics will be stored
30716 	 */
30717 	uint64_t	lpbk_stat_host_addr;
30718 } hwrm_port_lpbk_qstats_input_t, *phwrm_port_lpbk_qstats_input_t;
30719 
30720 /* hwrm_port_lpbk_qstats_output (size:128b/16B) */
30721 
30722 typedef struct hwrm_port_lpbk_qstats_output {
30723 	/* The specific error status for the command. */
30724 	uint16_t	error_code;
30725 	/* The HWRM command request type. */
30726 	uint16_t	req_type;
30727 	/* The sequence ID from the original command. */
30728 	uint16_t	seq_id;
30729 	/* The length of the response data in number of bytes. */
30730 	uint16_t	resp_len;
30731 	/*
30732 	 * The size of the loopback statistics block in bytes DMA'ed by the
30733 	 * firmware. Note that this size will never exceed the lpbk_stat_size
30734 	 * field passed in by the driver in the hwrm_port_lpbk_qstats_input
30735 	 * structure.
30736 	 */
30737 	uint16_t	lpbk_stat_size;
30738 	uint8_t	unused_0[5];
30739 	/*
30740 	 * This field is used in Output records to indicate that the output
30741 	 * is completely written to RAM. This field should be read as '1'
30742 	 * to indicate that the output has been completely written.
30743 	 * When writing a command completion or response to an internal
30744 	 * processor, the order of writes has to be such that this field is
30745 	 * written last.
30746 	 */
30747 	uint8_t	valid;
30748 } hwrm_port_lpbk_qstats_output_t, *phwrm_port_lpbk_qstats_output_t;
30749 
30750 /* Loopback Port Statistic Format */
30751 /* port_lpbk_stats (size:640b/80B) */
30752 
30753 typedef struct port_lpbk_stats {
30754 	/* Number of transmitted unicast frames */
30755 	uint64_t	lpbk_ucast_frames;
30756 	/* Number of transmitted multicast frames */
30757 	uint64_t	lpbk_mcast_frames;
30758 	/* Number of transmitted broadcast frames */
30759 	uint64_t	lpbk_bcast_frames;
30760 	/* Number of transmitted bytes for unicast traffic */
30761 	uint64_t	lpbk_ucast_bytes;
30762 	/* Number of transmitted bytes for multicast traffic */
30763 	uint64_t	lpbk_mcast_bytes;
30764 	/* Number of transmitted bytes for broadcast traffic */
30765 	uint64_t	lpbk_bcast_bytes;
30766 	/* Number of dropped tx packets */
30767 	uint64_t	lpbk_tx_discards;
30768 	/* Number of error dropped tx packets */
30769 	uint64_t	lpbk_tx_errors;
30770 	/* Number of dropped rx packets */
30771 	uint64_t	lpbk_rx_discards;
30772 	/* Number of error dropped rx packets */
30773 	uint64_t	lpbk_rx_errors;
30774 } port_lpbk_stats_t, *pport_lpbk_stats_t;
30775 
30776 /************************
30777  * hwrm_port_ecn_qstats *
30778  ************************/
30779 
30780 
30781 /* hwrm_port_ecn_qstats_input (size:256b/32B) */
30782 
30783 typedef struct hwrm_port_ecn_qstats_input {
30784 	/* The HWRM command request type. */
30785 	uint16_t	req_type;
30786 	/*
30787 	 * The completion ring to send the completion event on. This should
30788 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30789 	 */
30790 	uint16_t	cmpl_ring;
30791 	/*
30792 	 * The sequence ID is used by the driver for tracking multiple
30793 	 * commands. This ID is treated as opaque data by the firmware and
30794 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30795 	 */
30796 	uint16_t	seq_id;
30797 	/*
30798 	 * The target ID of the command:
30799 	 * * 0x0-0xFFF8 - The function ID
30800 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30801 	 * * 0xFFFD - Reserved for user-space HWRM interface
30802 	 * * 0xFFFF - HWRM
30803 	 */
30804 	uint16_t	target_id;
30805 	/*
30806 	 * A physical address pointer pointing to a host buffer that the
30807 	 * command's response data will be written. This can be either a host
30808 	 * physical address (HPA) or a guest physical address (GPA) and must
30809 	 * point to a physically contiguous block of memory.
30810 	 */
30811 	uint64_t	resp_addr;
30812 	/*
30813 	 * Port ID of port that is being queried. Unused if NIC is in
30814 	 * multi-host mode.
30815 	 */
30816 	uint16_t	port_id;
30817 	/*
30818 	 * Size of the DMA buffer the caller has allocated for the firmware to
30819 	 * write into.
30820 	 */
30821 	uint16_t	ecn_stat_buf_size;
30822 	uint8_t	flags;
30823 	/*
30824 	 * This bit is set to 1 when request is for a counter mask,
30825 	 * representing the width of each of the stats counters, rather
30826 	 * than counters themselves.
30827 	 */
30828 	#define HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
30829 	uint8_t	unused_0[3];
30830 	/*
30831 	 * This is the host address where
30832 	 * ECN port statistics will be stored
30833 	 */
30834 	uint64_t	ecn_stat_host_addr;
30835 } hwrm_port_ecn_qstats_input_t, *phwrm_port_ecn_qstats_input_t;
30836 
30837 /* hwrm_port_ecn_qstats_output (size:128b/16B) */
30838 
30839 typedef struct hwrm_port_ecn_qstats_output {
30840 	/* The specific error status for the command. */
30841 	uint16_t	error_code;
30842 	/* The HWRM command request type. */
30843 	uint16_t	req_type;
30844 	/* The sequence ID from the original command. */
30845 	uint16_t	seq_id;
30846 	/* The length of the response data in number of bytes. */
30847 	uint16_t	resp_len;
30848 	/* Number of bytes of stats the firmware wrote to the DMA buffer. */
30849 	uint16_t	ecn_stat_buf_size;
30850 	/*
30851 	 * Bitmask that indicates which CoS queues have ECN marking enabled.
30852 	 * Bit i corresponds to CoS queue i.
30853 	 */
30854 	uint8_t	mark_en;
30855 	uint8_t	unused_0[4];
30856 	/*
30857 	 * This field is used in Output records to indicate that the output
30858 	 * is completely written to RAM. This field should be read as '1'
30859 	 * to indicate that the output has been completely written. When
30860 	 * writing a command completion or response to an internal processor,
30861 	 * the order of writes has to be such that this field is written last.
30862 	 */
30863 	uint8_t	valid;
30864 } hwrm_port_ecn_qstats_output_t, *phwrm_port_ecn_qstats_output_t;
30865 
30866 /* ECN mark statistics format */
30867 /* port_stats_ecn (size:512b/64B) */
30868 
30869 typedef struct port_stats_ecn {
30870 	/*
30871 	 * Number of packets marked in CoS queue 0.
30872 	 * Or, if the driver requested counter masks, a mask to indicate the size
30873 	 * of the counter.
30874 	 */
30875 	uint64_t	mark_cnt_cos0;
30876 	/*
30877 	 * Number of packets marked in CoS queue 1.
30878 	 * Or, if the driver requested counter masks, a mask to indicate the size
30879 	 * of the counter.
30880 	 */
30881 	uint64_t	mark_cnt_cos1;
30882 	/*
30883 	 * Number of packets marked in CoS queue 2.
30884 	 * Or, if the driver requested counter masks, a mask to indicate the size
30885 	 * of the counter.
30886 	 */
30887 	uint64_t	mark_cnt_cos2;
30888 	/*
30889 	 * Number of packets marked in CoS queue 3.
30890 	 * Or, if the driver requested counter masks, a mask to indicate the size
30891 	 * of the counter.
30892 	 */
30893 	uint64_t	mark_cnt_cos3;
30894 	/*
30895 	 * Number of packets marked in CoS queue 4.
30896 	 * Or, if the driver requested counter masks, a mask to indicate the size
30897 	 * of the counter.
30898 	 */
30899 	uint64_t	mark_cnt_cos4;
30900 	/*
30901 	 * Number of packets marked in CoS queue 5.
30902 	 * Or, if the driver requested counter masks, a mask to indicate the size
30903 	 * of the counter.
30904 	 */
30905 	uint64_t	mark_cnt_cos5;
30906 	/*
30907 	 * Number of packets marked in CoS queue 6.
30908 	 * Or, if the driver requested counter masks, a mask to indicate the size
30909 	 * of the counter.
30910 	 */
30911 	uint64_t	mark_cnt_cos6;
30912 	/*
30913 	 * Number of packets marked in CoS queue 7.
30914 	 * Or, if the driver requested counter masks, a mask to indicate the size
30915 	 * of the counter.
30916 	 */
30917 	uint64_t	mark_cnt_cos7;
30918 } port_stats_ecn_t, *pport_stats_ecn_t;
30919 
30920 /***********************
30921  * hwrm_port_clr_stats *
30922  ***********************/
30923 
30924 
30925 /* hwrm_port_clr_stats_input (size:192b/24B) */
30926 
30927 typedef struct hwrm_port_clr_stats_input {
30928 	/* The HWRM command request type. */
30929 	uint16_t	req_type;
30930 	/*
30931 	 * The completion ring to send the completion event on. This should
30932 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
30933 	 */
30934 	uint16_t	cmpl_ring;
30935 	/*
30936 	 * The sequence ID is used by the driver for tracking multiple
30937 	 * commands. This ID is treated as opaque data by the firmware and
30938 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
30939 	 */
30940 	uint16_t	seq_id;
30941 	/*
30942 	 * The target ID of the command:
30943 	 * * 0x0-0xFFF8 - The function ID
30944 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30945 	 * * 0xFFFD - Reserved for user-space HWRM interface
30946 	 * * 0xFFFF - HWRM
30947 	 */
30948 	uint16_t	target_id;
30949 	/*
30950 	 * A physical address pointer pointing to a host buffer that the
30951 	 * command's response data will be written. This can be either a host
30952 	 * physical address (HPA) or a guest physical address (GPA) and must
30953 	 * point to a physically contiguous block of memory.
30954 	 */
30955 	uint64_t	resp_addr;
30956 	/* Port ID of port that is being queried. */
30957 	uint16_t	port_id;
30958 	uint8_t	flags;
30959 	/*
30960 	 * If set to 1, then this field indicates clear the following RoCE
30961 	 * specific counters.
30962 	 * RoCE associated TX/RX cos counters
30963 	 * CNP associated TX/RX cos counters
30964 	 * RoCE/CNP specific TX/RX flow counters
30965 	 * Firmware will determine the RoCE/CNP cos queue based on qos
30966 	 * profile.
30967 	 * This flag is honored only when RoCE is enabled on that port.
30968 	 */
30969 	#define HWRM_PORT_CLR_STATS_INPUT_FLAGS_ROCE_COUNTERS	UINT32_C(0x1)
30970 	uint8_t	unused_0[5];
30971 } hwrm_port_clr_stats_input_t, *phwrm_port_clr_stats_input_t;
30972 
30973 /* hwrm_port_clr_stats_output (size:128b/16B) */
30974 
30975 typedef struct hwrm_port_clr_stats_output {
30976 	/* The specific error status for the command. */
30977 	uint16_t	error_code;
30978 	/* The HWRM command request type. */
30979 	uint16_t	req_type;
30980 	/* The sequence ID from the original command. */
30981 	uint16_t	seq_id;
30982 	/* The length of the response data in number of bytes. */
30983 	uint16_t	resp_len;
30984 	uint8_t	unused_0[7];
30985 	/*
30986 	 * This field is used in Output records to indicate that the output
30987 	 * is completely written to RAM. This field should be read as '1'
30988 	 * to indicate that the output has been completely written. When
30989 	 * writing a command completion or response to an internal processor,
30990 	 * the order of writes has to be such that this field is written last.
30991 	 */
30992 	uint8_t	valid;
30993 } hwrm_port_clr_stats_output_t, *phwrm_port_clr_stats_output_t;
30994 
30995 /****************************
30996  * hwrm_port_lpbk_clr_stats *
30997  ****************************/
30998 
30999 
31000 /* hwrm_port_lpbk_clr_stats_input (size:192b/24B) */
31001 
31002 typedef struct hwrm_port_lpbk_clr_stats_input {
31003 	/* The HWRM command request type. */
31004 	uint16_t	req_type;
31005 	/*
31006 	 * The completion ring to send the completion event on. This should
31007 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31008 	 */
31009 	uint16_t	cmpl_ring;
31010 	/*
31011 	 * The sequence ID is used by the driver for tracking multiple
31012 	 * commands. This ID is treated as opaque data by the firmware and
31013 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31014 	 */
31015 	uint16_t	seq_id;
31016 	/*
31017 	 * The target ID of the command:
31018 	 * * 0x0-0xFFF8 - The function ID
31019 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31020 	 * * 0xFFFD - Reserved for user-space HWRM interface
31021 	 * * 0xFFFF - HWRM
31022 	 */
31023 	uint16_t	target_id;
31024 	/*
31025 	 * A physical address pointer pointing to a host buffer that the
31026 	 * command's response data will be written. This can be either a host
31027 	 * physical address (HPA) or a guest physical address (GPA) and must
31028 	 * point to a physically contiguous block of memory.
31029 	 */
31030 	uint64_t	resp_addr;
31031 	/* Port ID of port that is to be queried. */
31032 	uint16_t	port_id;
31033 	uint8_t	unused_0[6];
31034 } hwrm_port_lpbk_clr_stats_input_t, *phwrm_port_lpbk_clr_stats_input_t;
31035 
31036 /* hwrm_port_lpbk_clr_stats_output (size:128b/16B) */
31037 
31038 typedef struct hwrm_port_lpbk_clr_stats_output {
31039 	/* The specific error status for the command. */
31040 	uint16_t	error_code;
31041 	/* The HWRM command request type. */
31042 	uint16_t	req_type;
31043 	/* The sequence ID from the original command. */
31044 	uint16_t	seq_id;
31045 	/* The length of the response data in number of bytes. */
31046 	uint16_t	resp_len;
31047 	uint8_t	unused_0[7];
31048 	/*
31049 	 * This field is used in Output records to indicate that the output
31050 	 * is completely written to RAM. This field should be read as '1'
31051 	 * to indicate that the output has been completely written. When
31052 	 * writing a command completion or response to an internal processor,
31053 	 * the order of writes has to be such that this field is written last.
31054 	 */
31055 	uint8_t	valid;
31056 } hwrm_port_lpbk_clr_stats_output_t, *phwrm_port_lpbk_clr_stats_output_t;
31057 
31058 /**********************
31059  * hwrm_port_ts_query *
31060  **********************/
31061 
31062 
31063 /* hwrm_port_ts_query_input (size:320b/40B) */
31064 
31065 typedef struct hwrm_port_ts_query_input {
31066 	/* The HWRM command request type. */
31067 	uint16_t	req_type;
31068 	/*
31069 	 * The completion ring to send the completion event on. This should
31070 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31071 	 */
31072 	uint16_t	cmpl_ring;
31073 	/*
31074 	 * The sequence ID is used by the driver for tracking multiple
31075 	 * commands. This ID is treated as opaque data by the firmware and
31076 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31077 	 */
31078 	uint16_t	seq_id;
31079 	/*
31080 	 * The target ID of the command:
31081 	 * * 0x0-0xFFF8 - The function ID
31082 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31083 	 * * 0xFFFD - Reserved for user-space HWRM interface
31084 	 * * 0xFFFF - HWRM
31085 	 */
31086 	uint16_t	target_id;
31087 	/*
31088 	 * A physical address pointer pointing to a host buffer that the
31089 	 * command's response data will be written. This can be either a host
31090 	 * physical address (HPA) or a guest physical address (GPA) and must
31091 	 * point to a physically contiguous block of memory.
31092 	 */
31093 	uint64_t	resp_addr;
31094 	uint32_t	flags;
31095 	/*
31096 	 * Enumeration denoting the RX, TX type of the resource.
31097 	 * This enumeration is used for resources that are similar for both
31098 	 * TX and RX paths of the chip.
31099 	 */
31100 	#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH		UINT32_C(0x1)
31101 	/* tx path */
31102 		#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_TX		UINT32_C(0x0)
31103 	/* rx path */
31104 		#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX		UINT32_C(0x1)
31105 		#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_LAST	HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX
31106 	/*
31107 	 * If set, the response includes the current value of the free
31108 	 * running timer.
31109 	 */
31110 	#define HWRM_PORT_TS_QUERY_INPUT_FLAGS_CURRENT_TIME	UINT32_C(0x2)
31111 	/* Port ID of port that is being queried. */
31112 	uint16_t	port_id;
31113 	uint8_t	unused_0[2];
31114 	uint16_t	enables;
31115 	/*
31116 	 * This bit must be '1' for the ts_req_timeout field to be
31117 	 * configured.
31118 	 */
31119 	#define HWRM_PORT_TS_QUERY_INPUT_ENABLES_TS_REQ_TIMEOUT	UINT32_C(0x1)
31120 	/*
31121 	 * This bit must be '1' for the ptp_seq_id field to be
31122 	 * configured.
31123 	 */
31124 	#define HWRM_PORT_TS_QUERY_INPUT_ENABLES_PTP_SEQ_ID	UINT32_C(0x2)
31125 	/*
31126 	 * This bit must be '1' for the ptp_hdr_offset field to be
31127 	 * configured.
31128 	 */
31129 	#define HWRM_PORT_TS_QUERY_INPUT_ENABLES_PTP_HDR_OFFSET	UINT32_C(0x4)
31130 	/*
31131 	 * Specifies the timeout in microseconds. If this is specified,
31132 	 * firmware will keep checking for a matching timestamp packet
31133 	 * till the timeout is exhausted. User can specify a max timeout
31134 	 * of 65535 microseconds. Firmware will return HWRM_ERR_CODE_BUSY
31135 	 * if a matching timestamp is not found. Firmware will return
31136 	 * HWRM_ERROR_CODE_FAIL if we are unable to read timestamps
31137 	 * from FIFO.
31138 	 */
31139 	uint16_t	ts_req_timeout;
31140 	/*
31141 	 * Specifies the sequence ID of the PTP timestamp packet we
31142 	 * are interested in. When this is specified, firmware will
31143 	 * only return the timestamp of the packet which matches this
31144 	 * sequence ID.
31145 	 */
31146 	uint32_t	ptp_seq_id;
31147 	/*
31148 	 * Specifies the PTP header offset of the PTP packet for which
31149 	 * the timestamp is requested.
31150 	 */
31151 	uint16_t	ptp_hdr_offset;
31152 	uint8_t	unused_1[6];
31153 } hwrm_port_ts_query_input_t, *phwrm_port_ts_query_input_t;
31154 
31155 /* hwrm_port_ts_query_output (size:192b/24B) */
31156 
31157 typedef struct hwrm_port_ts_query_output {
31158 	/* The specific error status for the command. */
31159 	uint16_t	error_code;
31160 	/* The HWRM command request type. */
31161 	uint16_t	req_type;
31162 	/* The sequence ID from the original command. */
31163 	uint16_t	seq_id;
31164 	/* The length of the response data in number of bytes. */
31165 	uint16_t	resp_len;
31166 	/*
31167 	 * Timestamp value of PTP message captured, or current value of
31168 	 * free running timer.
31169 	 */
31170 	uint64_t	ptp_msg_ts;
31171 	/* Sequence ID of the PTP message captured. */
31172 	uint16_t	ptp_msg_seqid;
31173 	uint8_t	unused_0[5];
31174 	/*
31175 	 * This field is used in Output records to indicate that the output
31176 	 * is completely written to RAM. This field should be read as '1'
31177 	 * to indicate that the output has been completely written. When
31178 	 * writing a command completion or response to an internal processor,
31179 	 * the order of writes has to be such that this field is written last.
31180 	 */
31181 	uint8_t	valid;
31182 } hwrm_port_ts_query_output_t, *phwrm_port_ts_query_output_t;
31183 
31184 /***********************
31185  * hwrm_port_phy_qcaps *
31186  ***********************/
31187 
31188 
31189 /* hwrm_port_phy_qcaps_input (size:192b/24B) */
31190 
31191 typedef struct hwrm_port_phy_qcaps_input {
31192 	/* The HWRM command request type. */
31193 	uint16_t	req_type;
31194 	/*
31195 	 * The completion ring to send the completion event on. This should
31196 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31197 	 */
31198 	uint16_t	cmpl_ring;
31199 	/*
31200 	 * The sequence ID is used by the driver for tracking multiple
31201 	 * commands. This ID is treated as opaque data by the firmware and
31202 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31203 	 */
31204 	uint16_t	seq_id;
31205 	/*
31206 	 * The target ID of the command:
31207 	 * * 0x0-0xFFF8 - The function ID
31208 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31209 	 * * 0xFFFD - Reserved for user-space HWRM interface
31210 	 * * 0xFFFF - HWRM
31211 	 */
31212 	uint16_t	target_id;
31213 	/*
31214 	 * A physical address pointer pointing to a host buffer that the
31215 	 * command's response data will be written. This can be either a host
31216 	 * physical address (HPA) or a guest physical address (GPA) and must
31217 	 * point to a physically contiguous block of memory.
31218 	 */
31219 	uint64_t	resp_addr;
31220 	/* Port ID of port that is being queried. */
31221 	uint16_t	port_id;
31222 	uint8_t	unused_0[6];
31223 } hwrm_port_phy_qcaps_input_t, *phwrm_port_phy_qcaps_input_t;
31224 
31225 /* hwrm_port_phy_qcaps_output (size:320b/40B) */
31226 
31227 typedef struct hwrm_port_phy_qcaps_output {
31228 	/* The specific error status for the command. */
31229 	uint16_t	error_code;
31230 	/* The HWRM command request type. */
31231 	uint16_t	req_type;
31232 	/* The sequence ID from the original command. */
31233 	uint16_t	seq_id;
31234 	/* The length of the response data in number of bytes. */
31235 	uint16_t	resp_len;
31236 	/* PHY capability flags */
31237 	uint8_t	flags;
31238 	/*
31239 	 * If set to 1, then this field indicates that the
31240 	 * link is capable of supporting EEE.
31241 	 */
31242 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED			UINT32_C(0x1)
31243 	/*
31244 	 * If set to 1, then this field indicates that the
31245 	 * PHY is capable of supporting external loopback.
31246 	 */
31247 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED	UINT32_C(0x2)
31248 	/*
31249 	 * If set to 1, then this field indicates that the
31250 	 * PHY is capable of supporting loopback in autoneg mode.
31251 	 */
31252 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_AUTONEG_LPBK_SUPPORTED	UINT32_C(0x4)
31253 	/*
31254 	 * Indicates if the configuration of shared PHY settings is
31255 	 * supported. In cases where a physical port is shared by multiple
31256 	 * functions (e.g. NPAR, multihost, etc), the configuration of PHY
31257 	 * settings may not be allowed. Callers to HWRM_PORT_PHY_CFG will
31258 	 * get an HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED error in this case.
31259 	 */
31260 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_SHARED_PHY_CFG_SUPPORTED	UINT32_C(0x8)
31261 	/*
31262 	 * If set to 1, it indicates that the port counters and extended
31263 	 * port counters will not reset when the firmware shuts down or
31264 	 * resets the PHY. These counters will only be reset during power
31265 	 * cycle or by calling HWRM_PORT_CLR_STATS.
31266 	 * If set to 0, the state of the counters is unspecified when
31267 	 * firmware shuts down or resets the PHY.
31268 	 */
31269 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_CUMULATIVE_COUNTERS_ON_RESET	UINT32_C(0x10)
31270 	/*
31271 	 * If set to 1, then this field indicates that the
31272 	 * local loopback is not supported on this controller.
31273 	 */
31274 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_LOCAL_LPBK_NOT_SUPPORTED	UINT32_C(0x20)
31275 	/*
31276 	 * If set to 1, then this field indicates that the
31277 	 * PHY/Link down policy during PF shutdown is totally
31278 	 * controlled by the firmware. It can shutdown the link
31279 	 * even when there are active VFs associated with the PF.
31280 	 * Host PF driver can send HWRM_PHY_CFG command to bring
31281 	 * down the PHY even when the port is shared between VFs
31282 	 * and PFs.
31283 	 */
31284 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_FW_MANAGED_LINK_DOWN		UINT32_C(0x40)
31285 	/*
31286 	 * If set to 1, this field indicates that the FCS may
31287 	 * be disabled for a given packet via the transmit
31288 	 * buffer descriptor.
31289 	 */
31290 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_NO_FCS			UINT32_C(0x80)
31291 	/* Number of front panel ports for this device. */
31292 	uint8_t	port_cnt;
31293 	/* Not supported or unknown */
31294 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN UINT32_C(0x0)
31295 	/* single port device */
31296 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1	UINT32_C(0x1)
31297 	/* 2-port device */
31298 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2	UINT32_C(0x2)
31299 	/* 3-port device */
31300 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3	UINT32_C(0x3)
31301 	/* 4-port device */
31302 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4	UINT32_C(0x4)
31303 	/* 12-port device */
31304 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_12	UINT32_C(0xc)
31305 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_LAST   HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_12
31306 	/*
31307 	 * This is a bit mask to indicate what speeds are supported
31308 	 * as forced speeds on this link.
31309 	 * For each speed that can be forced on this link, the
31310 	 * corresponding mask bit shall be set to '1'.
31311 	 */
31312 	uint16_t	supported_speeds_force_mode;
31313 	/* 100Mb link speed (Half-duplex) */
31314 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD	UINT32_C(0x1)
31315 	/* 100Mb link speed (Full-duplex) */
31316 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB	UINT32_C(0x2)
31317 	/* 1Gb link speed (Half-duplex) */
31318 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD	UINT32_C(0x4)
31319 	/* 1Gb link speed (Full-duplex) */
31320 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB	UINT32_C(0x8)
31321 	/* 2Gb link speed */
31322 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB	UINT32_C(0x10)
31323 	/* 25Gb link speed */
31324 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB	UINT32_C(0x20)
31325 	/* 10Gb link speed */
31326 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB	UINT32_C(0x40)
31327 	/* 20Gb link speed */
31328 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB	UINT32_C(0x80)
31329 	/* 25Gb link speed */
31330 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB	UINT32_C(0x100)
31331 	/* 40Gb link speed */
31332 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB	UINT32_C(0x200)
31333 	/* 50Gb link speed */
31334 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB	UINT32_C(0x400)
31335 	/* 100Gb link speed */
31336 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB	UINT32_C(0x800)
31337 	/* 10Mb link speed (Half-duplex) */
31338 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD	UINT32_C(0x1000)
31339 	/* 10Mb link speed (Full-duplex) */
31340 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB	UINT32_C(0x2000)
31341 	/*
31342 	 * This is a bit mask to indicate what speeds are supported
31343 	 * for autonegotiation on this link.
31344 	 * For each speed that can be autonegotiated on this link, the
31345 	 * corresponding mask bit shall be set to '1'.
31346 	 */
31347 	uint16_t	supported_speeds_auto_mode;
31348 	/* 100Mb link speed (Half-duplex) */
31349 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD	UINT32_C(0x1)
31350 	/* 100Mb link speed (Full-duplex) */
31351 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB	UINT32_C(0x2)
31352 	/* 1Gb link speed (Half-duplex) */
31353 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD	UINT32_C(0x4)
31354 	/* 1Gb link speed (Full-duplex) */
31355 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB	UINT32_C(0x8)
31356 	/* 2Gb link speed */
31357 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB	UINT32_C(0x10)
31358 	/* 25Gb link speed */
31359 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB	UINT32_C(0x20)
31360 	/* 10Gb link speed */
31361 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB	UINT32_C(0x40)
31362 	/* 20Gb link speed */
31363 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB	UINT32_C(0x80)
31364 	/* 25Gb link speed */
31365 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB	UINT32_C(0x100)
31366 	/* 40Gb link speed */
31367 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB	UINT32_C(0x200)
31368 	/* 50Gb link speed */
31369 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB	UINT32_C(0x400)
31370 	/* 100Gb link speed */
31371 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB	UINT32_C(0x800)
31372 	/* 10Mb link speed (Half-duplex) */
31373 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD	UINT32_C(0x1000)
31374 	/* 10Mb link speed (Full-duplex) */
31375 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB	UINT32_C(0x2000)
31376 	/*
31377 	 * This is a bit mask to indicate what speeds are supported
31378 	 * for EEE on this link.
31379 	 * For each speed that can be autonegotiated when EEE is enabled
31380 	 * on this link, the corresponding mask bit shall be set to '1'.
31381 	 * This field is only valid when the eee_supported is set to '1'.
31382 	 */
31383 	uint16_t	supported_speeds_eee_mode;
31384 	/* Reserved */
31385 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1	UINT32_C(0x1)
31386 	/* 100Mb link speed (Full-duplex) */
31387 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB	UINT32_C(0x2)
31388 	/* Reserved */
31389 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2	UINT32_C(0x4)
31390 	/* 1Gb link speed (Full-duplex) */
31391 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB	UINT32_C(0x8)
31392 	/* Reserved */
31393 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3	UINT32_C(0x10)
31394 	/* Reserved */
31395 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4	UINT32_C(0x20)
31396 	/* 10Gb link speed */
31397 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB	UINT32_C(0x40)
31398 	uint32_t	tx_lpi_timer_low;
31399 	/*
31400 	 * The lowest value of TX LPI timer that can be set on this link
31401 	 * when EEE is enabled. This value is in microseconds.
31402 	 * This field is valid only when_eee_supported is set to '1'.
31403 	 */
31404 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK UINT32_C(0xffffff)
31405 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT 0
31406 	/*
31407 	 * Reserved field. The HWRM shall set this field to 0.
31408 	 * An HWRM client shall ignore this field.
31409 	 */
31410 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK	UINT32_C(0xff000000)
31411 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT		24
31412 	uint32_t	valid_tx_lpi_timer_high;
31413 	/*
31414 	 * The highest value of TX LPI timer that can be set on this link
31415 	 * when EEE is enabled. This value is in microseconds.
31416 	 * This field is valid only when_eee_supported is set to '1'.
31417 	 */
31418 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK UINT32_C(0xffffff)
31419 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT 0
31420 	/*
31421 	 * Reserved field. The HWRM shall set this field to 0.
31422 	 * An HWRM client shall ignore this field.
31423 	 */
31424 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD_MASK		UINT32_C(0xff000000)
31425 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD_SFT		24
31426 	/*
31427 	 * This field is used to advertise which PAM4 speeds are supported
31428 	 * in auto mode.
31429 	 */
31430 	uint16_t	supported_pam4_speeds_auto_mode;
31431 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_50G	UINT32_C(0x1)
31432 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_100G	UINT32_C(0x2)
31433 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_200G	UINT32_C(0x4)
31434 	/*
31435 	 * This field is used to advertise which PAM4 speeds are supported
31436 	 * in forced mode.
31437 	 */
31438 	uint16_t	supported_pam4_speeds_force_mode;
31439 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_50G	UINT32_C(0x1)
31440 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_100G	UINT32_C(0x2)
31441 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_200G	UINT32_C(0x4)
31442 	/* More PHY capability flags */
31443 	uint16_t	flags2;
31444 	/*
31445 	 * If set to 1, then this field indicates that
31446 	 * 802.3x flow control is not supported.
31447 	 */
31448 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_PAUSE_UNSUPPORTED	UINT32_C(0x1)
31449 	/*
31450 	 * If set to 1, then this field indicates that
31451 	 * priority-based flow control is not supported.
31452 	 */
31453 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_PFC_UNSUPPORTED		UINT32_C(0x2)
31454 	/*
31455 	 * If set to 1, then this field indicates that
31456 	 * bank based addressing is supported in firmware.
31457 	 */
31458 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_BANK_ADDR_SUPPORTED	UINT32_C(0x4)
31459 	/*
31460 	 * If set to 1, then this field indicates that
31461 	 * supported_speed2 field is to be used in lieu of all
31462 	 * supported_speed variants.
31463 	 */
31464 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_SPEEDS2_SUPPORTED	UINT32_C(0x8)
31465 	/*
31466 	 * If set to 1, then this field indicates that
31467 	 * the device does not support remote loopback.
31468 	 */
31469 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_REMOTE_LPBK_UNSUPPORTED	UINT32_C(0x10)
31470 	/*
31471 	 * Number of internal ports for this device. This field allows the FW
31472 	 * to advertise how many internal ports are present. Manufacturing
31473 	 * tools uses this to determine how many internal ports should have
31474 	 * the PRBS test run on them. This field always return 0 unless NVM
31475 	 * option "HPTN_MODE" is set to 1.
31476 	 */
31477 	uint8_t	internal_port_cnt;
31478 	uint8_t	unused_0;
31479 	/*
31480 	 * This is a bit mask to indicate what speeds are supported
31481 	 * as forced speeds on this link.
31482 	 * For each speed that can be forced on this link, the
31483 	 * corresponding mask bit shall be set to '1'.
31484 	 * This field is valid only if speeds2_supported bit is set in flags2
31485 	 */
31486 	uint16_t	supported_speeds2_force_mode;
31487 	/* 1Gb link speed */
31488 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_1GB		UINT32_C(0x1)
31489 	/* 10Gb (NRZ: 10G per lane, 1 lane) link speed */
31490 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_10GB		UINT32_C(0x2)
31491 	/* 25Gb (NRZ: 25G per lane, 1 lane) link speed */
31492 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_25GB		UINT32_C(0x4)
31493 	/* 40Gb (NRZ: 10G per lane, 4 lanes) link speed */
31494 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_40GB		UINT32_C(0x8)
31495 	/* 50Gb (NRZ: 25G per lane, 2 lanes) link speed */
31496 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_50GB		UINT32_C(0x10)
31497 	/* 100Gb (NRZ: 25G per lane, 4 lanes) link speed */
31498 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_100GB		UINT32_C(0x20)
31499 	/* 50Gb (PAM4-56: 50G per lane, 1 lane) link speed */
31500 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_50GB_PAM4_56	UINT32_C(0x40)
31501 	/* 100Gb (PAM4-56: 50G per lane, 2 lanes) link speed */
31502 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_100GB_PAM4_56	UINT32_C(0x80)
31503 	/* 200Gb (PAM4-56: 50G per lane, 4 lanes) link speed */
31504 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_200GB_PAM4_56	UINT32_C(0x100)
31505 	/* 400Gb (PAM4-56: 50G per lane, 8 lanes) link speed */
31506 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_400GB_PAM4_56	UINT32_C(0x200)
31507 	/* 100Gb (PAM4-112: 100G per lane, 1 lane) link speed */
31508 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_100GB_PAM4_112	UINT32_C(0x400)
31509 	/* 200Gb (PAM4-112: 100G per lane, 2 lanes) link speed */
31510 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_200GB_PAM4_112	UINT32_C(0x800)
31511 	/* 400Gb (PAM4-112: 100G per lane, 4 lanes) link speed */
31512 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_400GB_PAM4_112	UINT32_C(0x1000)
31513 	/* 800Gb (PAM4-112: 100G per lane, 8 lanes) link speed */
31514 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_FORCE_MODE_800GB_PAM4_112	UINT32_C(0x2000)
31515 	/*
31516 	 * This is a bit mask to indicate what speeds are supported
31517 	 * for autonegotiation on this link.
31518 	 * For each speed that can be autonegotiated on this link, the
31519 	 * corresponding mask bit shall be set to '1'.
31520 	 * This field is valid only if speeds2_supported bit is set in flags2
31521 	 */
31522 	uint16_t	supported_speeds2_auto_mode;
31523 	/* 1Gb link speed */
31524 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_1GB		UINT32_C(0x1)
31525 	/* 10Gb (NRZ: 10G per lane, 1 lane) link speed */
31526 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_10GB		UINT32_C(0x2)
31527 	/* 25Gb (NRZ: 25G per lane, 1 lane) link speed */
31528 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_25GB		UINT32_C(0x4)
31529 	/* 40Gb (NRZ: 10G per lane, 4 lanes) link speed */
31530 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_40GB		UINT32_C(0x8)
31531 	/* 50Gb (NRZ: 25G per lane, 2 lanes) link speed */
31532 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_50GB		UINT32_C(0x10)
31533 	/* 100Gb (NRZ: 25G per lane, 4 lanes) link speed */
31534 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_100GB		UINT32_C(0x20)
31535 	/* 50Gb (PAM4-56: 50G per lane, 1 lane) link speed */
31536 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_50GB_PAM4_56	UINT32_C(0x40)
31537 	/* 100Gb (PAM4-56: 50G per lane, 2 lanes) link speed */
31538 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_100GB_PAM4_56	UINT32_C(0x80)
31539 	/* 200Gb (PAM4-56: 50G per lane, 4 lanes) link speed */
31540 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_200GB_PAM4_56	UINT32_C(0x100)
31541 	/* 400Gb (PAM4-56: 50G per lane, 8 lanes) link speed */
31542 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_400GB_PAM4_56	UINT32_C(0x200)
31543 	/* 100Gb (PAM4-112: 100G per lane, 1 lane) link speed */
31544 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_100GB_PAM4_112	UINT32_C(0x400)
31545 	/* 200Gb (PAM4-112: 100G per lane, 2 lanes) link speed */
31546 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_200GB_PAM4_112	UINT32_C(0x800)
31547 	/* 400Gb (PAM4-112: 100G per lane, 4 lanes) link speed */
31548 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_400GB_PAM4_112	UINT32_C(0x1000)
31549 	/* 800Gb (PAM4-112: 100G per lane, 8 lanes) link speed */
31550 	#define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS2_AUTO_MODE_800GB_PAM4_112	UINT32_C(0x2000)
31551 	uint8_t	unused_1[3];
31552 	/*
31553 	 * This field is used in Output records to indicate that the output
31554 	 * is completely written to RAM. This field should be read as '1'
31555 	 * to indicate that the output has been completely written. When
31556 	 * writing a command completion or response to an internal processor,
31557 	 * the order of writes has to be such that this field is written last.
31558 	 */
31559 	uint8_t	valid;
31560 } hwrm_port_phy_qcaps_output_t, *phwrm_port_phy_qcaps_output_t;
31561 
31562 /***************************
31563  * hwrm_port_phy_i2c_write *
31564  ***************************/
31565 
31566 
31567 /* hwrm_port_phy_i2c_write_input (size:832b/104B) */
31568 
31569 typedef struct hwrm_port_phy_i2c_write_input {
31570 	/* The HWRM command request type. */
31571 	uint16_t	req_type;
31572 	/*
31573 	 * The completion ring to send the completion event on. This should
31574 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31575 	 */
31576 	uint16_t	cmpl_ring;
31577 	/*
31578 	 * The sequence ID is used by the driver for tracking multiple
31579 	 * commands. This ID is treated as opaque data by the firmware and
31580 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31581 	 */
31582 	uint16_t	seq_id;
31583 	/*
31584 	 * The target ID of the command:
31585 	 * * 0x0-0xFFF8 - The function ID
31586 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31587 	 * * 0xFFFD - Reserved for user-space HWRM interface
31588 	 * * 0xFFFF - HWRM
31589 	 */
31590 	uint16_t	target_id;
31591 	/*
31592 	 * A physical address pointer pointing to a host buffer that the
31593 	 * command's response data will be written. This can be either a host
31594 	 * physical address (HPA) or a guest physical address (GPA) and must
31595 	 * point to a physically contiguous block of memory.
31596 	 */
31597 	uint64_t	resp_addr;
31598 	uint32_t	flags;
31599 	uint32_t	enables;
31600 	/*
31601 	 * This bit must be '1' for the page_offset field to be
31602 	 * configured.
31603 	 */
31604 	#define HWRM_PORT_PHY_I2C_WRITE_INPUT_ENABLES_PAGE_OFFSET	UINT32_C(0x1)
31605 	/*
31606 	 * This bit must be '1' for the bank_number field to be
31607 	 * configured.
31608 	 */
31609 	#define HWRM_PORT_PHY_I2C_WRITE_INPUT_ENABLES_BANK_NUMBER	UINT32_C(0x2)
31610 	/* Port ID of port. */
31611 	uint16_t	port_id;
31612 	/* 8-bit I2C slave address. */
31613 	uint8_t	i2c_slave_addr;
31614 	/* The bank number of the page that is being accessed over I2C. */
31615 	uint8_t	bank_number;
31616 	/* The page number that is being accessed over I2C. */
31617 	uint16_t	page_number;
31618 	/* Offset within the page that is being accessed over I2C. */
31619 	uint16_t	page_offset;
31620 	/*
31621 	 * Length of data to write, in bytes starting at the offset
31622 	 * specified above. If the offset is not specified, then
31623 	 * the data shall be written from the beginning of the page.
31624 	 */
31625 	uint8_t	data_length;
31626 	uint8_t	unused_1[7];
31627 	/* Up to 64B of data. */
31628 	uint32_t	data[16];
31629 } hwrm_port_phy_i2c_write_input_t, *phwrm_port_phy_i2c_write_input_t;
31630 
31631 /* hwrm_port_phy_i2c_write_output (size:128b/16B) */
31632 
31633 typedef struct hwrm_port_phy_i2c_write_output {
31634 	/* The specific error status for the command. */
31635 	uint16_t	error_code;
31636 	/* The HWRM command request type. */
31637 	uint16_t	req_type;
31638 	/* The sequence ID from the original command. */
31639 	uint16_t	seq_id;
31640 	/* The length of the response data in number of bytes. */
31641 	uint16_t	resp_len;
31642 	uint8_t	unused_0[7];
31643 	/*
31644 	 * This field is used in Output records to indicate that the output
31645 	 * is completely written to RAM. This field should be read as '1'
31646 	 * to indicate that the output has been completely written. When
31647 	 * writing a command completion or response to an internal processor,
31648 	 * the order of writes has to be such that this field is written last.
31649 	 */
31650 	uint8_t	valid;
31651 } hwrm_port_phy_i2c_write_output_t, *phwrm_port_phy_i2c_write_output_t;
31652 
31653 /**************************
31654  * hwrm_port_phy_i2c_read *
31655  **************************/
31656 
31657 
31658 /* hwrm_port_phy_i2c_read_input (size:320b/40B) */
31659 
31660 typedef struct hwrm_port_phy_i2c_read_input {
31661 	/* The HWRM command request type. */
31662 	uint16_t	req_type;
31663 	/*
31664 	 * The completion ring to send the completion event on. This should
31665 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31666 	 */
31667 	uint16_t	cmpl_ring;
31668 	/*
31669 	 * The sequence ID is used by the driver for tracking multiple
31670 	 * commands. This ID is treated as opaque data by the firmware and
31671 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31672 	 */
31673 	uint16_t	seq_id;
31674 	/*
31675 	 * The target ID of the command:
31676 	 * * 0x0-0xFFF8 - The function ID
31677 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31678 	 * * 0xFFFD - Reserved for user-space HWRM interface
31679 	 * * 0xFFFF - HWRM
31680 	 */
31681 	uint16_t	target_id;
31682 	/*
31683 	 * A physical address pointer pointing to a host buffer that the
31684 	 * command's response data will be written. This can be either a host
31685 	 * physical address (HPA) or a guest physical address (GPA) and must
31686 	 * point to a physically contiguous block of memory.
31687 	 */
31688 	uint64_t	resp_addr;
31689 	uint32_t	flags;
31690 	uint32_t	enables;
31691 	/*
31692 	 * This bit must be '1' for the page_offset field to be
31693 	 * configured.
31694 	 */
31695 	#define HWRM_PORT_PHY_I2C_READ_INPUT_ENABLES_PAGE_OFFSET	UINT32_C(0x1)
31696 	/*
31697 	 * This bit must be '1' for the bank_number field to be
31698 	 * configured.
31699 	 */
31700 	#define HWRM_PORT_PHY_I2C_READ_INPUT_ENABLES_BANK_NUMBER	UINT32_C(0x2)
31701 	/* Port ID of port. */
31702 	uint16_t	port_id;
31703 	/* 8-bit I2C slave address. */
31704 	uint8_t	i2c_slave_addr;
31705 	/* The bank number of the page that is being accessed over I2C. */
31706 	uint8_t	bank_number;
31707 	/* The page number that is being accessed over I2C. */
31708 	uint16_t	page_number;
31709 	/* Offset within the page that is being accessed over I2C. */
31710 	uint16_t	page_offset;
31711 	/*
31712 	 * Length of data to read, in bytes starting at the offset
31713 	 * specified above. If the offset is not specified, then
31714 	 * the data shall be read from the beginning of the page.
31715 	 */
31716 	uint8_t	data_length;
31717 	uint8_t	unused_1[7];
31718 } hwrm_port_phy_i2c_read_input_t, *phwrm_port_phy_i2c_read_input_t;
31719 
31720 /* hwrm_port_phy_i2c_read_output (size:640b/80B) */
31721 
31722 typedef struct hwrm_port_phy_i2c_read_output {
31723 	/* The specific error status for the command. */
31724 	uint16_t	error_code;
31725 	/* The HWRM command request type. */
31726 	uint16_t	req_type;
31727 	/* The sequence ID from the original command. */
31728 	uint16_t	seq_id;
31729 	/* The length of the response data in number of bytes. */
31730 	uint16_t	resp_len;
31731 	/* Up to 64B of data. */
31732 	uint32_t	data[16];
31733 	uint8_t	unused_0[7];
31734 	/*
31735 	 * This field is used in Output records to indicate that the output
31736 	 * is completely written to RAM. This field should be read as '1'
31737 	 * to indicate that the output has been completely written. When
31738 	 * writing a command completion or response to an internal processor,
31739 	 * the order of writes has to be such that this field is written last.
31740 	 */
31741 	uint8_t	valid;
31742 } hwrm_port_phy_i2c_read_output_t, *phwrm_port_phy_i2c_read_output_t;
31743 
31744 /****************************
31745  * hwrm_port_phy_mdio_write *
31746  ****************************/
31747 
31748 
31749 /* hwrm_port_phy_mdio_write_input (size:320b/40B) */
31750 
31751 typedef struct hwrm_port_phy_mdio_write_input {
31752 	/* The HWRM command request type. */
31753 	uint16_t	req_type;
31754 	/*
31755 	 * The completion ring to send the completion event on. This should
31756 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31757 	 */
31758 	uint16_t	cmpl_ring;
31759 	/*
31760 	 * The sequence ID is used by the driver for tracking multiple
31761 	 * commands. This ID is treated as opaque data by the firmware and
31762 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31763 	 */
31764 	uint16_t	seq_id;
31765 	/*
31766 	 * The target ID of the command:
31767 	 * * 0x0-0xFFF8 - The function ID
31768 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31769 	 * * 0xFFFD - Reserved for user-space HWRM interface
31770 	 * * 0xFFFF - HWRM
31771 	 */
31772 	uint16_t	target_id;
31773 	/*
31774 	 * A physical address pointer pointing to a host buffer that the
31775 	 * command's response data will be written. This can be either a host
31776 	 * physical address (HPA) or a guest physical address (GPA) and must
31777 	 * point to a physically contiguous block of memory.
31778 	 */
31779 	uint64_t	resp_addr;
31780 	/* Reserved for future use. */
31781 	uint64_t	unused_0;
31782 	/* Port ID of port. */
31783 	uint16_t	port_id;
31784 	/* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
31785 	uint8_t	phy_addr;
31786 	/* 8-bit device address. */
31787 	uint8_t	dev_addr;
31788 	/* 16-bit register address. */
31789 	uint16_t	reg_addr;
31790 	/* 16-bit register data. */
31791 	uint16_t	reg_data;
31792 	/*
31793 	 * When this bit is set to 1 a Clause 45 mdio access is done.
31794 	 * when this bit is set to 0 a Clause 22 mdio access is done.
31795 	 */
31796 	uint8_t	cl45_mdio;
31797 	/*  */
31798 	uint8_t	unused_1[7];
31799 } hwrm_port_phy_mdio_write_input_t, *phwrm_port_phy_mdio_write_input_t;
31800 
31801 /* hwrm_port_phy_mdio_write_output (size:128b/16B) */
31802 
31803 typedef struct hwrm_port_phy_mdio_write_output {
31804 	/* The specific error status for the command. */
31805 	uint16_t	error_code;
31806 	/* The HWRM command request type. */
31807 	uint16_t	req_type;
31808 	/* The sequence ID from the original command. */
31809 	uint16_t	seq_id;
31810 	/* The length of the response data in number of bytes. */
31811 	uint16_t	resp_len;
31812 	uint8_t	unused_0[7];
31813 	/*
31814 	 * This field is used in Output records to indicate that the output
31815 	 * is completely written to RAM. This field should be read as '1'
31816 	 * to indicate that the output has been completely written. When
31817 	 * writing a command completion or response to an internal processor,
31818 	 * the order of writes has to be such that this field is written last.
31819 	 */
31820 	uint8_t	valid;
31821 } hwrm_port_phy_mdio_write_output_t, *phwrm_port_phy_mdio_write_output_t;
31822 
31823 /***************************
31824  * hwrm_port_phy_mdio_read *
31825  ***************************/
31826 
31827 
31828 /* hwrm_port_phy_mdio_read_input (size:256b/32B) */
31829 
31830 typedef struct hwrm_port_phy_mdio_read_input {
31831 	/* The HWRM command request type. */
31832 	uint16_t	req_type;
31833 	/*
31834 	 * The completion ring to send the completion event on. This should
31835 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31836 	 */
31837 	uint16_t	cmpl_ring;
31838 	/*
31839 	 * The sequence ID is used by the driver for tracking multiple
31840 	 * commands. This ID is treated as opaque data by the firmware and
31841 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31842 	 */
31843 	uint16_t	seq_id;
31844 	/*
31845 	 * The target ID of the command:
31846 	 * * 0x0-0xFFF8 - The function ID
31847 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31848 	 * * 0xFFFD - Reserved for user-space HWRM interface
31849 	 * * 0xFFFF - HWRM
31850 	 */
31851 	uint16_t	target_id;
31852 	/*
31853 	 * A physical address pointer pointing to a host buffer that the
31854 	 * command's response data will be written. This can be either a host
31855 	 * physical address (HPA) or a guest physical address (GPA) and must
31856 	 * point to a physically contiguous block of memory.
31857 	 */
31858 	uint64_t	resp_addr;
31859 	/* Reserved for future use. */
31860 	uint64_t	unused_0;
31861 	/* Port ID of port. */
31862 	uint16_t	port_id;
31863 	/* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
31864 	uint8_t	phy_addr;
31865 	/* 8-bit device address. */
31866 	uint8_t	dev_addr;
31867 	/* 16-bit register address. */
31868 	uint16_t	reg_addr;
31869 	/*
31870 	 * When this bit is set to 1 a Clause 45 mdio access is done.
31871 	 * when this bit is set to 0 a Clause 22 mdio access is done.
31872 	 */
31873 	uint8_t	cl45_mdio;
31874 	/*  */
31875 	uint8_t	unused_1;
31876 } hwrm_port_phy_mdio_read_input_t, *phwrm_port_phy_mdio_read_input_t;
31877 
31878 /* hwrm_port_phy_mdio_read_output (size:128b/16B) */
31879 
31880 typedef struct hwrm_port_phy_mdio_read_output {
31881 	/* The specific error status for the command. */
31882 	uint16_t	error_code;
31883 	/* The HWRM command request type. */
31884 	uint16_t	req_type;
31885 	/* The sequence ID from the original command. */
31886 	uint16_t	seq_id;
31887 	/* The length of the response data in number of bytes. */
31888 	uint16_t	resp_len;
31889 	/* 16-bit register data. */
31890 	uint16_t	reg_data;
31891 	uint8_t	unused_0[5];
31892 	/*
31893 	 * This field is used in Output records to indicate that the output
31894 	 * is completely written to RAM. This field should be read as '1'
31895 	 * to indicate that the output has been completely written. When
31896 	 * writing a command completion or response to an internal processor,
31897 	 * the order of writes has to be such that this field is written last.
31898 	 */
31899 	uint8_t	valid;
31900 } hwrm_port_phy_mdio_read_output_t, *phwrm_port_phy_mdio_read_output_t;
31901 
31902 /*********************
31903  * hwrm_port_led_cfg *
31904  *********************/
31905 
31906 
31907 /* hwrm_port_led_cfg_input (size:512b/64B) */
31908 
31909 typedef struct hwrm_port_led_cfg_input {
31910 	/* The HWRM command request type. */
31911 	uint16_t	req_type;
31912 	/*
31913 	 * The completion ring to send the completion event on. This should
31914 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
31915 	 */
31916 	uint16_t	cmpl_ring;
31917 	/*
31918 	 * The sequence ID is used by the driver for tracking multiple
31919 	 * commands. This ID is treated as opaque data by the firmware and
31920 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
31921 	 */
31922 	uint16_t	seq_id;
31923 	/*
31924 	 * The target ID of the command:
31925 	 * * 0x0-0xFFF8 - The function ID
31926 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31927 	 * * 0xFFFD - Reserved for user-space HWRM interface
31928 	 * * 0xFFFF - HWRM
31929 	 */
31930 	uint16_t	target_id;
31931 	/*
31932 	 * A physical address pointer pointing to a host buffer that the
31933 	 * command's response data will be written. This can be either a host
31934 	 * physical address (HPA) or a guest physical address (GPA) and must
31935 	 * point to a physically contiguous block of memory.
31936 	 */
31937 	uint64_t	resp_addr;
31938 	uint32_t	enables;
31939 	/*
31940 	 * This bit must be '1' for the led0_id field to be
31941 	 * configured.
31942 	 */
31943 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID		UINT32_C(0x1)
31944 	/*
31945 	 * This bit must be '1' for the led0_state field to be
31946 	 * configured.
31947 	 */
31948 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE	UINT32_C(0x2)
31949 	/*
31950 	 * This bit must be '1' for the led0_color field to be
31951 	 * configured.
31952 	 */
31953 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR	UINT32_C(0x4)
31954 	/*
31955 	 * This bit must be '1' for the led0_blink_on field to be
31956 	 * configured.
31957 	 */
31958 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON	UINT32_C(0x8)
31959 	/*
31960 	 * This bit must be '1' for the led0_blink_off field to be
31961 	 * configured.
31962 	 */
31963 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF	UINT32_C(0x10)
31964 	/*
31965 	 * This bit must be '1' for the led0_group_id field to be
31966 	 * configured.
31967 	 */
31968 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID	UINT32_C(0x20)
31969 	/*
31970 	 * This bit must be '1' for the led1_id field to be
31971 	 * configured.
31972 	 */
31973 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID		UINT32_C(0x40)
31974 	/*
31975 	 * This bit must be '1' for the led1_state field to be
31976 	 * configured.
31977 	 */
31978 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE	UINT32_C(0x80)
31979 	/*
31980 	 * This bit must be '1' for the led1_color field to be
31981 	 * configured.
31982 	 */
31983 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR	UINT32_C(0x100)
31984 	/*
31985 	 * This bit must be '1' for the led1_blink_on field to be
31986 	 * configured.
31987 	 */
31988 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON	UINT32_C(0x200)
31989 	/*
31990 	 * This bit must be '1' for the led1_blink_off field to be
31991 	 * configured.
31992 	 */
31993 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF	UINT32_C(0x400)
31994 	/*
31995 	 * This bit must be '1' for the led1_group_id field to be
31996 	 * configured.
31997 	 */
31998 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID	UINT32_C(0x800)
31999 	/*
32000 	 * This bit must be '1' for the led2_id field to be
32001 	 * configured.
32002 	 */
32003 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID		UINT32_C(0x1000)
32004 	/*
32005 	 * This bit must be '1' for the led2_state field to be
32006 	 * configured.
32007 	 */
32008 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE	UINT32_C(0x2000)
32009 	/*
32010 	 * This bit must be '1' for the led2_color field to be
32011 	 * configured.
32012 	 */
32013 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR	UINT32_C(0x4000)
32014 	/*
32015 	 * This bit must be '1' for the led2_blink_on field to be
32016 	 * configured.
32017 	 */
32018 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON	UINT32_C(0x8000)
32019 	/*
32020 	 * This bit must be '1' for the led2_blink_off field to be
32021 	 * configured.
32022 	 */
32023 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF	UINT32_C(0x10000)
32024 	/*
32025 	 * This bit must be '1' for the led2_group_id field to be
32026 	 * configured.
32027 	 */
32028 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID	UINT32_C(0x20000)
32029 	/*
32030 	 * This bit must be '1' for the led3_id field to be
32031 	 * configured.
32032 	 */
32033 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID		UINT32_C(0x40000)
32034 	/*
32035 	 * This bit must be '1' for the led3_state field to be
32036 	 * configured.
32037 	 */
32038 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE	UINT32_C(0x80000)
32039 	/*
32040 	 * This bit must be '1' for the led3_color field to be
32041 	 * configured.
32042 	 */
32043 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR	UINT32_C(0x100000)
32044 	/*
32045 	 * This bit must be '1' for the led3_blink_on field to be
32046 	 * configured.
32047 	 */
32048 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON	UINT32_C(0x200000)
32049 	/*
32050 	 * This bit must be '1' for the led3_blink_off field to be
32051 	 * configured.
32052 	 */
32053 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF	UINT32_C(0x400000)
32054 	/*
32055 	 * This bit must be '1' for the led3_group_id field to be
32056 	 * configured.
32057 	 */
32058 	#define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID	UINT32_C(0x800000)
32059 	/* Port ID of port whose LEDs are configured. */
32060 	uint16_t	port_id;
32061 	/*
32062 	 * The number of LEDs that are being configured.
32063 	 * Up to 4 LEDs can be configured with this command.
32064 	 */
32065 	uint8_t	num_leds;
32066 	/* Reserved field. */
32067 	uint8_t	rsvd;
32068 	/* An identifier for the LED #0. */
32069 	uint8_t	led0_id;
32070 	/* The requested state of the LED #0. */
32071 	uint8_t	led0_state;
32072 	/* Default state of the LED */
32073 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
32074 	/* Off */
32075 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF	UINT32_C(0x1)
32076 	/* On */
32077 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON	UINT32_C(0x2)
32078 	/* Blink */
32079 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK	UINT32_C(0x3)
32080 	/* Blink Alternately */
32081 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
32082 	#define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_LAST	HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT
32083 	/* The requested color of LED #0. */
32084 	uint8_t	led0_color;
32085 	/* Default */
32086 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT	UINT32_C(0x0)
32087 	/* Amber */
32088 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER	UINT32_C(0x1)
32089 	/* Green */
32090 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN	UINT32_C(0x2)
32091 	/* Green or Amber */
32092 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
32093 	#define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_LAST	HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER
32094 	uint8_t	unused_0;
32095 	/*
32096 	 * If the LED #0 state is "blink" or "blinkalt", then
32097 	 * this field represents the requested time in milliseconds
32098 	 * to keep LED on between cycles.
32099 	 */
32100 	uint16_t	led0_blink_on;
32101 	/*
32102 	 * If the LED #0 state is "blink" or "blinkalt", then
32103 	 * this field represents the requested time in milliseconds
32104 	 * to keep LED off between cycles.
32105 	 */
32106 	uint16_t	led0_blink_off;
32107 	/*
32108 	 * An identifier for the group of LEDs that LED #0 belongs
32109 	 * to.
32110 	 * If set to 0, then the LED #0 shall not be grouped and
32111 	 * shall be treated as an individual resource.
32112 	 * For all other non-zero values of this field, LED #0 shall
32113 	 * be grouped together with the LEDs with the same group ID
32114 	 * value.
32115 	 */
32116 	uint8_t	led0_group_id;
32117 	/* Reserved field. */
32118 	uint8_t	rsvd0;
32119 	/* An identifier for the LED #1. */
32120 	uint8_t	led1_id;
32121 	/* The requested state of the LED #1. */
32122 	uint8_t	led1_state;
32123 	/* Default state of the LED */
32124 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
32125 	/* Off */
32126 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF	UINT32_C(0x1)
32127 	/* On */
32128 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON	UINT32_C(0x2)
32129 	/* Blink */
32130 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK	UINT32_C(0x3)
32131 	/* Blink Alternately */
32132 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
32133 	#define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_LAST	HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT
32134 	/* The requested color of LED #1. */
32135 	uint8_t	led1_color;
32136 	/* Default */
32137 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT	UINT32_C(0x0)
32138 	/* Amber */
32139 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER	UINT32_C(0x1)
32140 	/* Green */
32141 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN	UINT32_C(0x2)
32142 	/* Green or Amber */
32143 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
32144 	#define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_LAST	HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER
32145 	uint8_t	unused_1;
32146 	/*
32147 	 * If the LED #1 state is "blink" or "blinkalt", then
32148 	 * this field represents the requested time in milliseconds
32149 	 * to keep LED on between cycles.
32150 	 */
32151 	uint16_t	led1_blink_on;
32152 	/*
32153 	 * If the LED #1 state is "blink" or "blinkalt", then
32154 	 * this field represents the requested time in milliseconds
32155 	 * to keep LED off between cycles.
32156 	 */
32157 	uint16_t	led1_blink_off;
32158 	/*
32159 	 * An identifier for the group of LEDs that LED #1 belongs
32160 	 * to.
32161 	 * If set to 0, then the LED #1 shall not be grouped and
32162 	 * shall be treated as an individual resource.
32163 	 * For all other non-zero values of this field, LED #1 shall
32164 	 * be grouped together with the LEDs with the same group ID
32165 	 * value.
32166 	 */
32167 	uint8_t	led1_group_id;
32168 	/* Reserved field. */
32169 	uint8_t	rsvd1;
32170 	/* An identifier for the LED #2. */
32171 	uint8_t	led2_id;
32172 	/* The requested state of the LED #2. */
32173 	uint8_t	led2_state;
32174 	/* Default state of the LED */
32175 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
32176 	/* Off */
32177 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF	UINT32_C(0x1)
32178 	/* On */
32179 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON	UINT32_C(0x2)
32180 	/* Blink */
32181 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK	UINT32_C(0x3)
32182 	/* Blink Alternately */
32183 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
32184 	#define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_LAST	HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT
32185 	/* The requested color of LED #2. */
32186 	uint8_t	led2_color;
32187 	/* Default */
32188 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT	UINT32_C(0x0)
32189 	/* Amber */
32190 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER	UINT32_C(0x1)
32191 	/* Green */
32192 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN	UINT32_C(0x2)
32193 	/* Green or Amber */
32194 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
32195 	#define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_LAST	HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER
32196 	uint8_t	unused_2;
32197 	/*
32198 	 * If the LED #2 state is "blink" or "blinkalt", then
32199 	 * this field represents the requested time in milliseconds
32200 	 * to keep LED on between cycles.
32201 	 */
32202 	uint16_t	led2_blink_on;
32203 	/*
32204 	 * If the LED #2 state is "blink" or "blinkalt", then
32205 	 * this field represents the requested time in milliseconds
32206 	 * to keep LED off between cycles.
32207 	 */
32208 	uint16_t	led2_blink_off;
32209 	/*
32210 	 * An identifier for the group of LEDs that LED #2 belongs
32211 	 * to.
32212 	 * If set to 0, then the LED #2 shall not be grouped and
32213 	 * shall be treated as an individual resource.
32214 	 * For all other non-zero values of this field, LED #2 shall
32215 	 * be grouped together with the LEDs with the same group ID
32216 	 * value.
32217 	 */
32218 	uint8_t	led2_group_id;
32219 	/* Reserved field. */
32220 	uint8_t	rsvd2;
32221 	/* An identifier for the LED #3. */
32222 	uint8_t	led3_id;
32223 	/* The requested state of the LED #3. */
32224 	uint8_t	led3_state;
32225 	/* Default state of the LED */
32226 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
32227 	/* Off */
32228 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF	UINT32_C(0x1)
32229 	/* On */
32230 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON	UINT32_C(0x2)
32231 	/* Blink */
32232 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK	UINT32_C(0x3)
32233 	/* Blink Alternately */
32234 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
32235 	#define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_LAST	HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT
32236 	/* The requested color of LED #3. */
32237 	uint8_t	led3_color;
32238 	/* Default */
32239 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT	UINT32_C(0x0)
32240 	/* Amber */
32241 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER	UINT32_C(0x1)
32242 	/* Green */
32243 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN	UINT32_C(0x2)
32244 	/* Green or Amber */
32245 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
32246 	#define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_LAST	HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER
32247 	uint8_t	unused_3;
32248 	/*
32249 	 * If the LED #3 state is "blink" or "blinkalt", then
32250 	 * this field represents the requested time in milliseconds
32251 	 * to keep LED on between cycles.
32252 	 */
32253 	uint16_t	led3_blink_on;
32254 	/*
32255 	 * If the LED #3 state is "blink" or "blinkalt", then
32256 	 * this field represents the requested time in milliseconds
32257 	 * to keep LED off between cycles.
32258 	 */
32259 	uint16_t	led3_blink_off;
32260 	/*
32261 	 * An identifier for the group of LEDs that LED #3 belongs
32262 	 * to.
32263 	 * If set to 0, then the LED #3 shall not be grouped and
32264 	 * shall be treated as an individual resource.
32265 	 * For all other non-zero values of this field, LED #3 shall
32266 	 * be grouped together with the LEDs with the same group ID
32267 	 * value.
32268 	 */
32269 	uint8_t	led3_group_id;
32270 	/* Reserved field. */
32271 	uint8_t	rsvd3;
32272 } hwrm_port_led_cfg_input_t, *phwrm_port_led_cfg_input_t;
32273 
32274 /* hwrm_port_led_cfg_output (size:128b/16B) */
32275 
32276 typedef struct hwrm_port_led_cfg_output {
32277 	/* The specific error status for the command. */
32278 	uint16_t	error_code;
32279 	/* The HWRM command request type. */
32280 	uint16_t	req_type;
32281 	/* The sequence ID from the original command. */
32282 	uint16_t	seq_id;
32283 	/* The length of the response data in number of bytes. */
32284 	uint16_t	resp_len;
32285 	uint8_t	unused_0[7];
32286 	/*
32287 	 * This field is used in Output records to indicate that the output
32288 	 * is completely written to RAM. This field should be read as '1'
32289 	 * to indicate that the output has been completely written. When
32290 	 * writing a command completion or response to an internal processor,
32291 	 * the order of writes has to be such that this field is written last.
32292 	 */
32293 	uint8_t	valid;
32294 } hwrm_port_led_cfg_output_t, *phwrm_port_led_cfg_output_t;
32295 
32296 /**********************
32297  * hwrm_port_led_qcfg *
32298  **********************/
32299 
32300 
32301 /* hwrm_port_led_qcfg_input (size:192b/24B) */
32302 
32303 typedef struct hwrm_port_led_qcfg_input {
32304 	/* The HWRM command request type. */
32305 	uint16_t	req_type;
32306 	/*
32307 	 * The completion ring to send the completion event on. This should
32308 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
32309 	 */
32310 	uint16_t	cmpl_ring;
32311 	/*
32312 	 * The sequence ID is used by the driver for tracking multiple
32313 	 * commands. This ID is treated as opaque data by the firmware and
32314 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
32315 	 */
32316 	uint16_t	seq_id;
32317 	/*
32318 	 * The target ID of the command:
32319 	 * * 0x0-0xFFF8 - The function ID
32320 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32321 	 * * 0xFFFD - Reserved for user-space HWRM interface
32322 	 * * 0xFFFF - HWRM
32323 	 */
32324 	uint16_t	target_id;
32325 	/*
32326 	 * A physical address pointer pointing to a host buffer that the
32327 	 * command's response data will be written. This can be either a host
32328 	 * physical address (HPA) or a guest physical address (GPA) and must
32329 	 * point to a physically contiguous block of memory.
32330 	 */
32331 	uint64_t	resp_addr;
32332 	/* Port ID of port whose LED configuration is being queried. */
32333 	uint16_t	port_id;
32334 	uint8_t	unused_0[6];
32335 } hwrm_port_led_qcfg_input_t, *phwrm_port_led_qcfg_input_t;
32336 
32337 /* hwrm_port_led_qcfg_output (size:448b/56B) */
32338 
32339 typedef struct hwrm_port_led_qcfg_output {
32340 	/* The specific error status for the command. */
32341 	uint16_t	error_code;
32342 	/* The HWRM command request type. */
32343 	uint16_t	req_type;
32344 	/* The sequence ID from the original command. */
32345 	uint16_t	seq_id;
32346 	/* The length of the response data in number of bytes. */
32347 	uint16_t	resp_len;
32348 	/*
32349 	 * The number of LEDs that are configured on this port.
32350 	 * Up to 4 LEDs can be returned in the response.
32351 	 */
32352 	uint8_t	num_leds;
32353 	/* An identifier for the LED #0. */
32354 	uint8_t	led0_id;
32355 	/* The type of LED #0. */
32356 	uint8_t	led0_type;
32357 	/* Speed LED */
32358 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED	UINT32_C(0x0)
32359 	/* Activity LED */
32360 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
32361 	/* Invalid */
32362 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
32363 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID
32364 	/* The current state of the LED #0. */
32365 	uint8_t	led0_state;
32366 	/* Default state of the LED */
32367 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
32368 	/* Off */
32369 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF	UINT32_C(0x1)
32370 	/* On */
32371 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON	UINT32_C(0x2)
32372 	/* Blink */
32373 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK	UINT32_C(0x3)
32374 	/* Blink Alternately */
32375 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
32376 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT
32377 	/* The color of LED #0. */
32378 	uint8_t	led0_color;
32379 	/* Default */
32380 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT	UINT32_C(0x0)
32381 	/* Amber */
32382 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER	UINT32_C(0x1)
32383 	/* Green */
32384 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN	UINT32_C(0x2)
32385 	/* Green or Amber */
32386 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
32387 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER
32388 	uint8_t	unused_0;
32389 	/*
32390 	 * If the LED #0 state is "blink" or "blinkalt", then
32391 	 * this field represents the requested time in milliseconds
32392 	 * to keep LED on between cycles.
32393 	 */
32394 	uint16_t	led0_blink_on;
32395 	/*
32396 	 * If the LED #0 state is "blink" or "blinkalt", then
32397 	 * this field represents the requested time in milliseconds
32398 	 * to keep LED off between cycles.
32399 	 */
32400 	uint16_t	led0_blink_off;
32401 	/*
32402 	 * An identifier for the group of LEDs that LED #0 belongs
32403 	 * to.
32404 	 * If set to 0, then the LED #0 is not grouped.
32405 	 * For all other non-zero values of this field, LED #0 is
32406 	 * grouped together with the LEDs with the same group ID
32407 	 * value.
32408 	 */
32409 	uint8_t	led0_group_id;
32410 	/* An identifier for the LED #1. */
32411 	uint8_t	led1_id;
32412 	/* The type of LED #1. */
32413 	uint8_t	led1_type;
32414 	/* Speed LED */
32415 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED	UINT32_C(0x0)
32416 	/* Activity LED */
32417 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
32418 	/* Invalid */
32419 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
32420 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID
32421 	/* The current state of the LED #1. */
32422 	uint8_t	led1_state;
32423 	/* Default state of the LED */
32424 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
32425 	/* Off */
32426 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF	UINT32_C(0x1)
32427 	/* On */
32428 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON	UINT32_C(0x2)
32429 	/* Blink */
32430 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK	UINT32_C(0x3)
32431 	/* Blink Alternately */
32432 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
32433 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT
32434 	/* The color of LED #1. */
32435 	uint8_t	led1_color;
32436 	/* Default */
32437 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT	UINT32_C(0x0)
32438 	/* Amber */
32439 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER	UINT32_C(0x1)
32440 	/* Green */
32441 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN	UINT32_C(0x2)
32442 	/* Green or Amber */
32443 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
32444 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER
32445 	uint8_t	unused_1;
32446 	/*
32447 	 * If the LED #1 state is "blink" or "blinkalt", then
32448 	 * this field represents the requested time in milliseconds
32449 	 * to keep LED on between cycles.
32450 	 */
32451 	uint16_t	led1_blink_on;
32452 	/*
32453 	 * If the LED #1 state is "blink" or "blinkalt", then
32454 	 * this field represents the requested time in milliseconds
32455 	 * to keep LED off between cycles.
32456 	 */
32457 	uint16_t	led1_blink_off;
32458 	/*
32459 	 * An identifier for the group of LEDs that LED #1 belongs
32460 	 * to.
32461 	 * If set to 0, then the LED #1 is not grouped.
32462 	 * For all other non-zero values of this field, LED #1 is
32463 	 * grouped together with the LEDs with the same group ID
32464 	 * value.
32465 	 */
32466 	uint8_t	led1_group_id;
32467 	/* An identifier for the LED #2. */
32468 	uint8_t	led2_id;
32469 	/* The type of LED #2. */
32470 	uint8_t	led2_type;
32471 	/* Speed LED */
32472 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED	UINT32_C(0x0)
32473 	/* Activity LED */
32474 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
32475 	/* Invalid */
32476 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
32477 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID
32478 	/* The current state of the LED #2. */
32479 	uint8_t	led2_state;
32480 	/* Default state of the LED */
32481 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
32482 	/* Off */
32483 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF	UINT32_C(0x1)
32484 	/* On */
32485 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON	UINT32_C(0x2)
32486 	/* Blink */
32487 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK	UINT32_C(0x3)
32488 	/* Blink Alternately */
32489 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
32490 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT
32491 	/* The color of LED #2. */
32492 	uint8_t	led2_color;
32493 	/* Default */
32494 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT	UINT32_C(0x0)
32495 	/* Amber */
32496 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER	UINT32_C(0x1)
32497 	/* Green */
32498 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN	UINT32_C(0x2)
32499 	/* Green or Amber */
32500 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
32501 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER
32502 	uint8_t	unused_2;
32503 	/*
32504 	 * If the LED #2 state is "blink" or "blinkalt", then
32505 	 * this field represents the requested time in milliseconds
32506 	 * to keep LED on between cycles.
32507 	 */
32508 	uint16_t	led2_blink_on;
32509 	/*
32510 	 * If the LED #2 state is "blink" or "blinkalt", then
32511 	 * this field represents the requested time in milliseconds
32512 	 * to keep LED off between cycles.
32513 	 */
32514 	uint16_t	led2_blink_off;
32515 	/*
32516 	 * An identifier for the group of LEDs that LED #2 belongs
32517 	 * to.
32518 	 * If set to 0, then the LED #2 is not grouped.
32519 	 * For all other non-zero values of this field, LED #2 is
32520 	 * grouped together with the LEDs with the same group ID
32521 	 * value.
32522 	 */
32523 	uint8_t	led2_group_id;
32524 	/* An identifier for the LED #3. */
32525 	uint8_t	led3_id;
32526 	/* The type of LED #3. */
32527 	uint8_t	led3_type;
32528 	/* Speed LED */
32529 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED	UINT32_C(0x0)
32530 	/* Activity LED */
32531 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
32532 	/* Invalid */
32533 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
32534 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID
32535 	/* The current state of the LED #3. */
32536 	uint8_t	led3_state;
32537 	/* Default state of the LED */
32538 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
32539 	/* Off */
32540 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF	UINT32_C(0x1)
32541 	/* On */
32542 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON	UINT32_C(0x2)
32543 	/* Blink */
32544 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK	UINT32_C(0x3)
32545 	/* Blink Alternately */
32546 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
32547 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT
32548 	/* The color of LED #3. */
32549 	uint8_t	led3_color;
32550 	/* Default */
32551 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT	UINT32_C(0x0)
32552 	/* Amber */
32553 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER	UINT32_C(0x1)
32554 	/* Green */
32555 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN	UINT32_C(0x2)
32556 	/* Green or Amber */
32557 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
32558 	#define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_LAST	HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER
32559 	uint8_t	unused_3;
32560 	/*
32561 	 * If the LED #3 state is "blink" or "blinkalt", then
32562 	 * this field represents the requested time in milliseconds
32563 	 * to keep LED on between cycles.
32564 	 */
32565 	uint16_t	led3_blink_on;
32566 	/*
32567 	 * If the LED #3 state is "blink" or "blinkalt", then
32568 	 * this field represents the requested time in milliseconds
32569 	 * to keep LED off between cycles.
32570 	 */
32571 	uint16_t	led3_blink_off;
32572 	/*
32573 	 * An identifier for the group of LEDs that LED #3 belongs
32574 	 * to.
32575 	 * If set to 0, then the LED #3 is not grouped.
32576 	 * For all other non-zero values of this field, LED #3 is
32577 	 * grouped together with the LEDs with the same group ID
32578 	 * value.
32579 	 */
32580 	uint8_t	led3_group_id;
32581 	uint8_t	unused_4[6];
32582 	/*
32583 	 * This field is used in Output records to indicate that the output
32584 	 * is completely written to RAM. This field should be read as '1'
32585 	 * to indicate that the output has been completely written. When
32586 	 * writing a command completion or response to an internal processor,
32587 	 * the order of writes has to be such that this field is written last.
32588 	 */
32589 	uint8_t	valid;
32590 } hwrm_port_led_qcfg_output_t, *phwrm_port_led_qcfg_output_t;
32591 
32592 /***********************
32593  * hwrm_port_led_qcaps *
32594  ***********************/
32595 
32596 
32597 /* hwrm_port_led_qcaps_input (size:192b/24B) */
32598 
32599 typedef struct hwrm_port_led_qcaps_input {
32600 	/* The HWRM command request type. */
32601 	uint16_t	req_type;
32602 	/*
32603 	 * The completion ring to send the completion event on. This should
32604 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
32605 	 */
32606 	uint16_t	cmpl_ring;
32607 	/*
32608 	 * The sequence ID is used by the driver for tracking multiple
32609 	 * commands. This ID is treated as opaque data by the firmware and
32610 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
32611 	 */
32612 	uint16_t	seq_id;
32613 	/*
32614 	 * The target ID of the command:
32615 	 * * 0x0-0xFFF8 - The function ID
32616 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32617 	 * * 0xFFFD - Reserved for user-space HWRM interface
32618 	 * * 0xFFFF - HWRM
32619 	 */
32620 	uint16_t	target_id;
32621 	/*
32622 	 * A physical address pointer pointing to a host buffer that the
32623 	 * command's response data will be written. This can be either a host
32624 	 * physical address (HPA) or a guest physical address (GPA) and must
32625 	 * point to a physically contiguous block of memory.
32626 	 */
32627 	uint64_t	resp_addr;
32628 	/* Port ID of port whose LED configuration is being queried. */
32629 	uint16_t	port_id;
32630 	uint8_t	unused_0[6];
32631 } hwrm_port_led_qcaps_input_t, *phwrm_port_led_qcaps_input_t;
32632 
32633 /* hwrm_port_led_qcaps_output (size:384b/48B) */
32634 
32635 typedef struct hwrm_port_led_qcaps_output {
32636 	/* The specific error status for the command. */
32637 	uint16_t	error_code;
32638 	/* The HWRM command request type. */
32639 	uint16_t	req_type;
32640 	/* The sequence ID from the original command. */
32641 	uint16_t	seq_id;
32642 	/* The length of the response data in number of bytes. */
32643 	uint16_t	resp_len;
32644 	/*
32645 	 * The number of LEDs that are configured on this port.
32646 	 * Up to 4 LEDs can be returned in the response.
32647 	 */
32648 	uint8_t	num_leds;
32649 	/* Reserved for future use. */
32650 	uint8_t	unused[3];
32651 	/* An identifier for the LED #0. */
32652 	uint8_t	led0_id;
32653 	/* The type of LED #0. */
32654 	uint8_t	led0_type;
32655 	/* Speed LED */
32656 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED	UINT32_C(0x0)
32657 	/* Activity LED */
32658 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
32659 	/* Invalid */
32660 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
32661 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_LAST	HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID
32662 	/*
32663 	 * An identifier for the group of LEDs that LED #0 belongs
32664 	 * to.
32665 	 * If set to 0, then the LED #0 cannot be grouped.
32666 	 * For all other non-zero values of this field, LED #0 is
32667 	 * grouped together with the LEDs with the same group ID
32668 	 * value.
32669 	 */
32670 	uint8_t	led0_group_id;
32671 	uint8_t	unused_0;
32672 	/* The states supported by LED #0. */
32673 	uint16_t	led0_state_caps;
32674 	/*
32675 	 * If set to 1, this LED is enabled.
32676 	 * If set to 0, this LED is disabled.
32677 	 */
32678 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED		UINT32_C(0x1)
32679 	/*
32680 	 * If set to 1, off state is supported on this LED.
32681 	 * If set to 0, off state is not supported on this LED.
32682 	 */
32683 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED	UINT32_C(0x2)
32684 	/*
32685 	 * If set to 1, on state is supported on this LED.
32686 	 * If set to 0, on state is not supported on this LED.
32687 	 */
32688 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED		UINT32_C(0x4)
32689 	/*
32690 	 * If set to 1, blink state is supported on this LED.
32691 	 * If set to 0, blink state is not supported on this LED.
32692 	 */
32693 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED	UINT32_C(0x8)
32694 	/*
32695 	 * If set to 1, blink_alt state is supported on this LED.
32696 	 * If set to 0, blink_alt state is not supported on this LED.
32697 	 */
32698 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED	UINT32_C(0x10)
32699 	/* The colors supported by LED #0. */
32700 	uint16_t	led0_color_caps;
32701 	/* reserved. */
32702 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD		UINT32_C(0x1)
32703 	/*
32704 	 * If set to 1, Amber color is supported on this LED.
32705 	 * If set to 0, Amber color is not supported on this LED.
32706 	 */
32707 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED	UINT32_C(0x2)
32708 	/*
32709 	 * If set to 1, Green color is supported on this LED.
32710 	 * If set to 0, Green color is not supported on this LED.
32711 	 */
32712 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED	UINT32_C(0x4)
32713 	/* An identifier for the LED #1. */
32714 	uint8_t	led1_id;
32715 	/* The type of LED #1. */
32716 	uint8_t	led1_type;
32717 	/* Speed LED */
32718 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED	UINT32_C(0x0)
32719 	/* Activity LED */
32720 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
32721 	/* Invalid */
32722 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
32723 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_LAST	HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID
32724 	/*
32725 	 * An identifier for the group of LEDs that LED #1 belongs
32726 	 * to.
32727 	 * If set to 0, then the LED #0 cannot be grouped.
32728 	 * For all other non-zero values of this field, LED #0 is
32729 	 * grouped together with the LEDs with the same group ID
32730 	 * value.
32731 	 */
32732 	uint8_t	led1_group_id;
32733 	uint8_t	unused_1;
32734 	/* The states supported by LED #1. */
32735 	uint16_t	led1_state_caps;
32736 	/*
32737 	 * If set to 1, this LED is enabled.
32738 	 * If set to 0, this LED is disabled.
32739 	 */
32740 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED		UINT32_C(0x1)
32741 	/*
32742 	 * If set to 1, off state is supported on this LED.
32743 	 * If set to 0, off state is not supported on this LED.
32744 	 */
32745 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED	UINT32_C(0x2)
32746 	/*
32747 	 * If set to 1, on state is supported on this LED.
32748 	 * If set to 0, on state is not supported on this LED.
32749 	 */
32750 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED		UINT32_C(0x4)
32751 	/*
32752 	 * If set to 1, blink state is supported on this LED.
32753 	 * If set to 0, blink state is not supported on this LED.
32754 	 */
32755 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED	UINT32_C(0x8)
32756 	/*
32757 	 * If set to 1, blink_alt state is supported on this LED.
32758 	 * If set to 0, blink_alt state is not supported on this LED.
32759 	 */
32760 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED	UINT32_C(0x10)
32761 	/* The colors supported by LED #1. */
32762 	uint16_t	led1_color_caps;
32763 	/* reserved. */
32764 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD		UINT32_C(0x1)
32765 	/*
32766 	 * If set to 1, Amber color is supported on this LED.
32767 	 * If set to 0, Amber color is not supported on this LED.
32768 	 */
32769 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED	UINT32_C(0x2)
32770 	/*
32771 	 * If set to 1, Green color is supported on this LED.
32772 	 * If set to 0, Green color is not supported on this LED.
32773 	 */
32774 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED	UINT32_C(0x4)
32775 	/* An identifier for the LED #2. */
32776 	uint8_t	led2_id;
32777 	/* The type of LED #2. */
32778 	uint8_t	led2_type;
32779 	/* Speed LED */
32780 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED	UINT32_C(0x0)
32781 	/* Activity LED */
32782 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
32783 	/* Invalid */
32784 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
32785 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_LAST	HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID
32786 	/*
32787 	 * An identifier for the group of LEDs that LED #0 belongs
32788 	 * to.
32789 	 * If set to 0, then the LED #0 cannot be grouped.
32790 	 * For all other non-zero values of this field, LED #0 is
32791 	 * grouped together with the LEDs with the same group ID
32792 	 * value.
32793 	 */
32794 	uint8_t	led2_group_id;
32795 	uint8_t	unused_2;
32796 	/* The states supported by LED #2. */
32797 	uint16_t	led2_state_caps;
32798 	/*
32799 	 * If set to 1, this LED is enabled.
32800 	 * If set to 0, this LED is disabled.
32801 	 */
32802 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED		UINT32_C(0x1)
32803 	/*
32804 	 * If set to 1, off state is supported on this LED.
32805 	 * If set to 0, off state is not supported on this LED.
32806 	 */
32807 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED	UINT32_C(0x2)
32808 	/*
32809 	 * If set to 1, on state is supported on this LED.
32810 	 * If set to 0, on state is not supported on this LED.
32811 	 */
32812 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED		UINT32_C(0x4)
32813 	/*
32814 	 * If set to 1, blink state is supported on this LED.
32815 	 * If set to 0, blink state is not supported on this LED.
32816 	 */
32817 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED	UINT32_C(0x8)
32818 	/*
32819 	 * If set to 1, blink_alt state is supported on this LED.
32820 	 * If set to 0, blink_alt state is not supported on this LED.
32821 	 */
32822 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED	UINT32_C(0x10)
32823 	/* The colors supported by LED #2. */
32824 	uint16_t	led2_color_caps;
32825 	/* reserved. */
32826 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD		UINT32_C(0x1)
32827 	/*
32828 	 * If set to 1, Amber color is supported on this LED.
32829 	 * If set to 0, Amber color is not supported on this LED.
32830 	 */
32831 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED	UINT32_C(0x2)
32832 	/*
32833 	 * If set to 1, Green color is supported on this LED.
32834 	 * If set to 0, Green color is not supported on this LED.
32835 	 */
32836 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED	UINT32_C(0x4)
32837 	/* An identifier for the LED #3. */
32838 	uint8_t	led3_id;
32839 	/* The type of LED #3. */
32840 	uint8_t	led3_type;
32841 	/* Speed LED */
32842 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED	UINT32_C(0x0)
32843 	/* Activity LED */
32844 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
32845 	/* Invalid */
32846 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
32847 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_LAST	HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID
32848 	/*
32849 	 * An identifier for the group of LEDs that LED #3 belongs
32850 	 * to.
32851 	 * If set to 0, then the LED #0 cannot be grouped.
32852 	 * For all other non-zero values of this field, LED #0 is
32853 	 * grouped together with the LEDs with the same group ID
32854 	 * value.
32855 	 */
32856 	uint8_t	led3_group_id;
32857 	uint8_t	unused_3;
32858 	/* The states supported by LED #3. */
32859 	uint16_t	led3_state_caps;
32860 	/*
32861 	 * If set to 1, this LED is enabled.
32862 	 * If set to 0, this LED is disabled.
32863 	 */
32864 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED		UINT32_C(0x1)
32865 	/*
32866 	 * If set to 1, off state is supported on this LED.
32867 	 * If set to 0, off state is not supported on this LED.
32868 	 */
32869 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED	UINT32_C(0x2)
32870 	/*
32871 	 * If set to 1, on state is supported on this LED.
32872 	 * If set to 0, on state is not supported on this LED.
32873 	 */
32874 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED		UINT32_C(0x4)
32875 	/*
32876 	 * If set to 1, blink state is supported on this LED.
32877 	 * If set to 0, blink state is not supported on this LED.
32878 	 */
32879 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED	UINT32_C(0x8)
32880 	/*
32881 	 * If set to 1, blink_alt state is supported on this LED.
32882 	 * If set to 0, blink_alt state is not supported on this LED.
32883 	 */
32884 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED	UINT32_C(0x10)
32885 	/* The colors supported by LED #3. */
32886 	uint16_t	led3_color_caps;
32887 	/* reserved. */
32888 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD		UINT32_C(0x1)
32889 	/*
32890 	 * If set to 1, Amber color is supported on this LED.
32891 	 * If set to 0, Amber color is not supported on this LED.
32892 	 */
32893 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED	UINT32_C(0x2)
32894 	/*
32895 	 * If set to 1, Green color is supported on this LED.
32896 	 * If set to 0, Green color is not supported on this LED.
32897 	 */
32898 	#define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED	UINT32_C(0x4)
32899 	uint8_t	unused_4[3];
32900 	/*
32901 	 * This field is used in Output records to indicate that the output
32902 	 * is completely written to RAM. This field should be read as '1'
32903 	 * to indicate that the output has been completely written. When
32904 	 * writing a command completion or response to an internal processor,
32905 	 * the order of writes has to be such that this field is written last.
32906 	 */
32907 	uint8_t	valid;
32908 } hwrm_port_led_qcaps_output_t, *phwrm_port_led_qcaps_output_t;
32909 
32910 /***********************
32911  * hwrm_port_prbs_test *
32912  ***********************/
32913 
32914 
32915 /* hwrm_port_prbs_test_input (size:384b/48B) */
32916 
32917 typedef struct hwrm_port_prbs_test_input {
32918 	/* The HWRM command request type. */
32919 	uint16_t	req_type;
32920 	/*
32921 	 * The completion ring to send the completion event on. This should
32922 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
32923 	 */
32924 	uint16_t	cmpl_ring;
32925 	/*
32926 	 * The sequence ID is used by the driver for tracking multiple
32927 	 * commands. This ID is treated as opaque data by the firmware and
32928 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
32929 	 */
32930 	uint16_t	seq_id;
32931 	/*
32932 	 * The target ID of the command:
32933 	 * * 0x0-0xFFF8 - The function ID
32934 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32935 	 * * 0xFFFD - Reserved for user-space HWRM interface
32936 	 * * 0xFFFF - HWRM
32937 	 */
32938 	uint16_t	target_id;
32939 	/*
32940 	 * A physical address pointer pointing to a host buffer that the
32941 	 * command's response data will be written. This can be either a host
32942 	 * physical address (HPA) or a guest physical address (GPA) and must
32943 	 * point to a physically contiguous block of memory.
32944 	 */
32945 	uint64_t	resp_addr;
32946 	/* Host address data is to DMA'd to. */
32947 	uint64_t	resp_data_addr;
32948 	/*
32949 	 * Size of the buffer pointed to by resp_data_addr. The firmware may
32950 	 * use this entire buffer or less than the entire buffer, but never
32951 	 * more.
32952 	 */
32953 	uint16_t	data_len;
32954 	uint16_t	flags;
32955 	/*
32956 	 * If set, the port_id field should be interpreted as an internal
32957 	 * port. The internal port id range is returned in port_phy_qcaps
32958 	 * response internal_port_cnt field.
32959 	 */
32960 	#define HWRM_PORT_PRBS_TEST_INPUT_FLAGS_INTERNAL	UINT32_C(0x1)
32961 	uint32_t	unused_1;
32962 	/* Port ID of port where PRBS test to be run. */
32963 	uint16_t	port_id;
32964 	/* Polynomial selection for PRBS test. */
32965 	uint16_t	poly;
32966 	/* PRBS7 */
32967 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS7   UINT32_C(0x0)
32968 	/* PRBS9 */
32969 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS9   UINT32_C(0x1)
32970 	/* PRBS11 */
32971 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS11  UINT32_C(0x2)
32972 	/* PRBS15 */
32973 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS15  UINT32_C(0x3)
32974 	/* PRBS23 */
32975 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS23  UINT32_C(0x4)
32976 	/* PRBS31 */
32977 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS31  UINT32_C(0x5)
32978 	/* PRBS58 */
32979 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS58  UINT32_C(0x6)
32980 	/* PRBS49 */
32981 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS49  UINT32_C(0x7)
32982 	/* PRBS10 */
32983 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS10  UINT32_C(0x8)
32984 	/* PRBS20 */
32985 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS20  UINT32_C(0x9)
32986 	/* PRBS13 */
32987 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS13  UINT32_C(0xa)
32988 	/* Invalid */
32989 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID UINT32_C(0xff)
32990 	#define HWRM_PORT_PRBS_TEST_INPUT_POLY_LAST   HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID
32991 	/*
32992 	 * Configuration bits for PRBS test.
32993 	 * Use enable bit to start/stop test.
32994 	 * Use tx/rx lane map bits to run test on specific lanes,
32995 	 * if set to 0 test will be run on all lanes.
32996 	 */
32997 	uint16_t	prbs_config;
32998 	/*
32999 	 * Set 0 to stop test currently in progress
33000 	 * Set 1 to start test with configuration provided.
33001 	 */
33002 	#define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_START_STOP		UINT32_C(0x1)
33003 	/*
33004 	 * If set to 1, tx_lane_map bitmap should have lane bits set.
33005 	 * If set to 0, test will be run on all lanes for this port.
33006 	 */
33007 	#define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_TX_LANE_MAP_VALID	UINT32_C(0x2)
33008 	/*
33009 	 * If set to 1, rx_lane_map bitmap should have lane bits set.
33010 	 * If set to 0, test will be run on all lanes for this port.
33011 	 */
33012 	#define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_RX_LANE_MAP_VALID	UINT32_C(0x4)
33013 	/* If set to 1, FEC stat t-code 0-7 registers are enabled. */
33014 	#define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_FEC_STAT_T0_T7	UINT32_C(0x8)
33015 	/*
33016 	 * If set to 1, FEC stat t-code 8-15 registers are enabled.
33017 	 * If fec_stat_t0_t7 is set, fec_stat_t8_t15 field will be ignored.
33018 	 */
33019 	#define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_FEC_STAT_T8_T15	UINT32_C(0x10)
33020 	/* If set, prbs test will run t-code project as well. */
33021 	#define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_T_CODE		UINT32_C(0x20)
33022 	/* Duration in seconds to run the PRBS test. */
33023 	uint16_t	timeout;
33024 	/*
33025 	 * If tx_lane_map_valid is set to 1, this field is a bitmap
33026 	 * of tx lanes to run PRBS test. bit0 = lane0,
33027 	 * bit1 = lane1 ..bit31 = lane31
33028 	 */
33029 	uint32_t	tx_lane_map;
33030 	/*
33031 	 * If rx_lane_map_valid is set to 1, this field is a bitmap
33032 	 * of rx lanes to run PRBS test. bit0 = lane0,
33033 	 * bit1 = lane1 ..bit31 = lane31
33034 	 */
33035 	uint32_t	rx_lane_map;
33036 } hwrm_port_prbs_test_input_t, *phwrm_port_prbs_test_input_t;
33037 
33038 /* hwrm_port_prbs_test_output (size:128b/16B) */
33039 
33040 typedef struct hwrm_port_prbs_test_output {
33041 	/* The specific error status for the command. */
33042 	uint16_t	error_code;
33043 	/* The HWRM command request type. */
33044 	uint16_t	req_type;
33045 	/* The sequence ID from the original command. */
33046 	uint16_t	seq_id;
33047 	/* The length of the response data in number of bytes. */
33048 	uint16_t	resp_len;
33049 	/* Total length of stored data. */
33050 	uint16_t	total_data_len;
33051 	/* This field is used in Output records to indicate the output format */
33052 	uint8_t	ber_format;
33053 	/* BER_FORMAT_PRBS */
33054 	#define HWRM_PORT_PRBS_TEST_OUTPUT_BER_FORMAT_PRBS UINT32_C(0x0)
33055 	/* BER_FORMAT_FEC */
33056 	#define HWRM_PORT_PRBS_TEST_OUTPUT_BER_FORMAT_FEC  UINT32_C(0x1)
33057 	#define HWRM_PORT_PRBS_TEST_OUTPUT_BER_FORMAT_LAST HWRM_PORT_PRBS_TEST_OUTPUT_BER_FORMAT_FEC
33058 	uint8_t	unused_0;
33059 	uint8_t	unused_1[3];
33060 	/*
33061 	 * This field is used in Output records to indicate that the output
33062 	 * is completely written to RAM. This field should be read as '1'
33063 	 * to indicate that the output has been completely written. When
33064 	 * writing a command completion or response to an internal processor,
33065 	 * the order of writes has to be such that this field is written last.
33066 	 */
33067 	uint8_t	valid;
33068 } hwrm_port_prbs_test_output_t, *phwrm_port_prbs_test_output_t;
33069 
33070 /**********************
33071  * hwrm_port_dsc_dump *
33072  **********************/
33073 
33074 
33075 /* hwrm_port_dsc_dump_input (size:320b/40B) */
33076 
33077 typedef struct hwrm_port_dsc_dump_input {
33078 	/* The HWRM command request type. */
33079 	uint16_t	req_type;
33080 	/*
33081 	 * The completion ring to send the completion event on. This should
33082 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33083 	 */
33084 	uint16_t	cmpl_ring;
33085 	/*
33086 	 * The sequence ID is used by the driver for tracking multiple
33087 	 * commands. This ID is treated as opaque data by the firmware and
33088 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33089 	 */
33090 	uint16_t	seq_id;
33091 	/*
33092 	 * The target ID of the command:
33093 	 * * 0x0-0xFFF8 - The function ID
33094 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33095 	 * * 0xFFFD - Reserved for user-space HWRM interface
33096 	 * * 0xFFFF - HWRM
33097 	 */
33098 	uint16_t	target_id;
33099 	/*
33100 	 * A physical address pointer pointing to a host buffer that the
33101 	 * command's response data will be written. This can be either a host
33102 	 * physical address (HPA) or a guest physical address (GPA) and must
33103 	 * point to a physically contiguous block of memory.
33104 	 */
33105 	uint64_t	resp_addr;
33106 	/* Host address where response diagnostic data is returned. */
33107 	uint64_t	resp_data_addr;
33108 	/*
33109 	 * Size of the host buffer pointed to by resp_data_addr. The firmware
33110 	 * may use this entire buffer or less than the entire buffer, but
33111 	 * never more.
33112 	 */
33113 	uint16_t	data_len;
33114 	uint16_t	unused_0;
33115 	/*
33116 	 * Ignored by the start command.
33117 	 * In legacy buffer mode, this is ignored. The transfer starts
33118 	 * at buffer offset zero and must be transferred in one command.
33119 	 * In big buffer mode, this is the offset into the NIC buffer for
33120 	 * the current retrieve command to start.
33121 	 */
33122 	uint32_t	data_offset;
33123 	/* Port ID of port where dsc dump to be collected. */
33124 	uint16_t	port_id;
33125 	/* Diag level specified by the user */
33126 	uint16_t	diag_level;
33127 	/* SRDS_DIAG_LANE */
33128 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_LANE	UINT32_C(0x0)
33129 	/* SRDS_DIAG_CORE */
33130 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_CORE	UINT32_C(0x1)
33131 	/* SRDS_DIAG_EVENT */
33132 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EVENT	UINT32_C(0x2)
33133 	/* SRDS_DIAG_EYE */
33134 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EYE	UINT32_C(0x3)
33135 	/* SRDS_DIAG_REG_CORE */
33136 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_REG_CORE   UINT32_C(0x4)
33137 	/* SRDS_DIAG_REG_LANE */
33138 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_REG_LANE   UINT32_C(0x5)
33139 	/* SRDS_DIAG_UC_CORE */
33140 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_UC_CORE	UINT32_C(0x6)
33141 	/* SRDS_DIAG_UC_LANE */
33142 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_UC_LANE	UINT32_C(0x7)
33143 	/* SRDS_DIAG_LANE_DEBUG */
33144 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_LANE_DEBUG UINT32_C(0x8)
33145 	/* SRDS_DIAG_BER_VERT */
33146 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_BER_VERT   UINT32_C(0x9)
33147 	/* SRDS_DIAG_BER_HORZ */
33148 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_BER_HORZ   UINT32_C(0xa)
33149 	/* SRDS_DIAG_EVENT_SAFE */
33150 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EVENT_SAFE UINT32_C(0xb)
33151 	/* SRDS_DIAG_TIMESTAMP */
33152 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_TIMESTAMP  UINT32_C(0xc)
33153 	#define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_LAST		HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_TIMESTAMP
33154 	/*
33155 	 * This field is the lane number on which to collect the dsc dump.
33156 	 * If this is 0xFFFF, the dsc dump will be collected for all lanes,
33157 	 * if the hardware and firmware support this feature.
33158 	 */
33159 	uint16_t	lane_number;
33160 	/* Configuration bits. */
33161 	uint16_t	dsc_dump_config;
33162 	/*
33163 	 * Set 0 to retrieve the dsc dump
33164 	 * Set 1 to start the dsc dump
33165 	 * Some configuration parameter for the dscdump report are
33166 	 * set by the start request, and can not be modified until the
33167 	 * retrieve operation is complete, on the next start.
33168 	 */
33169 	#define HWRM_PORT_DSC_DUMP_INPUT_DSC_DUMP_CONFIG_START_RETRIEVE	UINT32_C(0x1)
33170 	/*
33171 	 * Set 0 to limit the report size to 65535 bytes.
33172 	 * Set 1 to allow a larger buffer size.
33173 	 * This can only be set 1 in the start operation.
33174 	 * If this is set 0 in the start operation, the firmware will
33175 	 * assume it needs to only expose up to 65535 bytes of the report,
33176 	 * and only allow a single retrieve operation to retrieve the
33177 	 * entire report. This mode will truncate longer reports.
33178 	 * If this is set 1 in the start operation, the firmware will
33179 	 * report the full size of the report (up to the firmware's limit),
33180 	 * permit retrieve operations to hold the buffer using the config
33181 	 * defer_close, and honour the data_offset value so later data
33182 	 * in the report can be retrieved.
33183 	 */
33184 	#define HWRM_PORT_DSC_DUMP_INPUT_DSC_DUMP_CONFIG_BIG_BUFFER	UINT32_C(0x2)
33185 	/*
33186 	 * Set 0 on the last 'retrieve' to release the firmware buffer
33187 	 * Set 1 on the other 'retrieve' to hold the firmware buffer
33188 	 * This only affects retrieve operations.
33189 	 * In big_buffer mode, this allows the driver or tool to tell
33190 	 * the firmware to keep the report around, as it intends to read
33191 	 * more of it in. The final read must set this to zero, to tell
33192 	 * the firmware the report buffer can be released.
33193 	 * This only works if the start request specified big_buffer as
33194 	 * one; it is ignored otherwise.
33195 	 */
33196 	#define HWRM_PORT_DSC_DUMP_INPUT_DSC_DUMP_CONFIG_DEFER_CLOSE	UINT32_C(0x4)
33197 } hwrm_port_dsc_dump_input_t, *phwrm_port_dsc_dump_input_t;
33198 
33199 /* hwrm_port_dsc_dump_output (size:128b/16B) */
33200 
33201 typedef struct hwrm_port_dsc_dump_output {
33202 	/* The specific error status for the command. */
33203 	uint16_t	error_code;
33204 	/* The HWRM command request type. */
33205 	uint16_t	req_type;
33206 	/* The sequence ID from the original command. */
33207 	uint16_t	seq_id;
33208 	/* The length of the response data in number of bytes. */
33209 	uint16_t	resp_len;
33210 	/*
33211 	 * Total length of stored data; if big_buffer is one, this
33212 	 * only contains the lower 16 bits of the total length.
33213 	 * In legacy buffer mode, this is zero in the 'start' response.
33214 	 * In big buffer mode, this has the size of the report even
33215 	 * in the 'start' response.
33216 	 * In both modes, this contains the number of bytes written
33217 	 * to the host in 'retrieve' responses.
33218 	 */
33219 	uint16_t	total_data_len;
33220 	/*
33221 	 * The upper 16 bits of the total length of stored data.
33222 	 * In legacy buffer mode, this will always be zero.
33223 	 * In big buffer mode, this will be populated even in the
33224 	 * 'start' response.
33225 	 * This is always zero for 'retrieve' responses.
33226 	 */
33227 	uint16_t	total_data_len_high;
33228 	uint8_t	unused_1[2];
33229 	/* Result information bits. */
33230 	uint8_t	flags;
33231 	/*
33232 	 * Set according to the start request's input big_buffer.
33233 	 * If this is zero, it indicates the function is acting per
33234 	 * legacy behaviour -- it will report a buffer size up to almost
33235 	 * 64KiB, and allow only one retrieval request before releasing
33236 	 * the firmware buffer containing the report (total_data_len_high
33237 	 * will be zero). The request's data_offset field and defer_close
33238 	 * and use_offset config flags are ignored.
33239 	 * If this is one, it indicates support for (and request of)
33240 	 * support for larger reports. The full 32b report size (up to the
33241 	 * firmware buffer limit) is provided by the start response in
33242 	 * total_data_len (low 16b) and total_data_len_high (high 16b),
33243 	 * and retrieve requests may keep the buffer using the defer_close
33244 	 * flag, and retrieve the later parts of the report using the
33245 	 * data_offset field.
33246 	 */
33247 	#define HWRM_PORT_DSC_DUMP_OUTPUT_FLAGS_BIG_BUFFER	UINT32_C(0x1)
33248 	/*
33249 	 * This field is used in Output records to indicate that the output
33250 	 * is completely written to RAM. This field should be read as '1'
33251 	 * to indicate that the output has been completely written. When
33252 	 * writing a command completion or response to an internal processor,
33253 	 * the order of writes has to be such that this field is written last.
33254 	 */
33255 	uint8_t	valid;
33256 } hwrm_port_dsc_dump_output_t, *phwrm_port_dsc_dump_output_t;
33257 
33258 /******************************
33259  * hwrm_port_sfp_sideband_cfg *
33260  ******************************/
33261 
33262 
33263 /* hwrm_port_sfp_sideband_cfg_input (size:256b/32B) */
33264 
33265 typedef struct hwrm_port_sfp_sideband_cfg_input {
33266 	/* The HWRM command request type. */
33267 	uint16_t	req_type;
33268 	/*
33269 	 * The completion ring to send the completion event on. This should
33270 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33271 	 */
33272 	uint16_t	cmpl_ring;
33273 	/*
33274 	 * The sequence ID is used by the driver for tracking multiple
33275 	 * commands. This ID is treated as opaque data by the firmware and
33276 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33277 	 */
33278 	uint16_t	seq_id;
33279 	/*
33280 	 * The target ID of the command:
33281 	 * * 0x0-0xFFF8 - The function ID
33282 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33283 	 * * 0xFFFD - Reserved for user-space HWRM interface
33284 	 * * 0xFFFF - HWRM
33285 	 */
33286 	uint16_t	target_id;
33287 	/*
33288 	 * A physical address pointer pointing to a host buffer that the
33289 	 * command's response data will be written. This can be either a host
33290 	 * physical address (HPA) or a guest physical address (GPA) and must
33291 	 * point to a physically contiguous block of memory.
33292 	 */
33293 	uint64_t	resp_addr;
33294 	/* Port ID of port that is to be queried. */
33295 	uint16_t	port_id;
33296 	uint8_t	unused_0[6];
33297 	/*
33298 	 * This bitfield is used to specify which bits from the 'flags'
33299 	 * fields are being configured by the caller.
33300 	 */
33301 	uint32_t	enables;
33302 	/* This bit must be '1' for rs0 to be configured. */
33303 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RS0	UINT32_C(0x1)
33304 	/* This bit must be '1' for rs1 to be configured. */
33305 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RS1	UINT32_C(0x2)
33306 	/* This bit must be '1' for tx_disable to be configured. */
33307 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_TX_DIS	UINT32_C(0x4)
33308 	/*
33309 	 * This bit must be '1' for mod_sel to be configured.
33310 	 * Valid only on QSFP modules
33311 	 */
33312 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_MOD_SEL	UINT32_C(0x8)
33313 	/* This bit must be '1' for reset_l to be configured. */
33314 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RESET_L	UINT32_C(0x10)
33315 	/* This bit must be '1' for lp_mode to be configured. */
33316 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_LP_MODE	UINT32_C(0x20)
33317 	/* This bit must be '1' for pwr_disable to be configured. */
33318 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_PWR_DIS	UINT32_C(0x40)
33319 	/*
33320 	 * Only bits that have corresponding bits in the 'enables'
33321 	 * bitfield are processed by the firmware, all other bits
33322 	 * of 'flags' are ignored.
33323 	 */
33324 	uint32_t	flags;
33325 	/*
33326 	 * This bit along with rs1 configures the current speed of the dual
33327 	 * rate module. If these pins are GNDed then the speed can be changed
33328 	 * by directly writing to EEPROM.
33329 	 */
33330 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RS0	UINT32_C(0x1)
33331 	/*
33332 	 * This bit along with rs0 configures the current speed of the dual
33333 	 * rate module. If these pins are GNDed then the speed can be changed
33334 	 * by directly writing to EEPROM.
33335 	 */
33336 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RS1	UINT32_C(0x2)
33337 	/*
33338 	 * When this bit is set to '1', tx_disable is set.
33339 	 * On a 1G BASE-T module, if this bit is set,
33340 	 * module PHY registers will not be accessible.
33341 	 */
33342 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_TX_DIS	UINT32_C(0x4)
33343 	/*
33344 	 * When this bit is set to '1', this module is selected.
33345 	 * Valid only on QSFP modules
33346 	 */
33347 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_MOD_SEL	UINT32_C(0x8)
33348 	/*
33349 	 * If reset_l is set to 0, Module will be taken out of reset
33350 	 * and other signals will be set to their requested state once
33351 	 * the module is out of reset.
33352 	 * Valid only on QSFP modules
33353 	 */
33354 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RESET_L	UINT32_C(0x10)
33355 	/*
33356 	 * When this bit is set to '1', the module will be configured
33357 	 * in low power mode.
33358 	 * Valid only on QSFP modules
33359 	 */
33360 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_LP_MODE	UINT32_C(0x20)
33361 	/* When this bit is set to '1', the module will be powered down. */
33362 	#define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_PWR_DIS	UINT32_C(0x40)
33363 } hwrm_port_sfp_sideband_cfg_input_t, *phwrm_port_sfp_sideband_cfg_input_t;
33364 
33365 /* hwrm_port_sfp_sideband_cfg_output (size:128b/16B) */
33366 
33367 typedef struct hwrm_port_sfp_sideband_cfg_output {
33368 	/* The specific error status for the command. */
33369 	uint16_t	error_code;
33370 	/* The HWRM command request type. */
33371 	uint16_t	req_type;
33372 	/* The sequence ID from the original command. */
33373 	uint16_t	seq_id;
33374 	/* The length of the response data in number of bytes. */
33375 	uint16_t	resp_len;
33376 	uint8_t	unused[7];
33377 	/*
33378 	 * This field is used in Output records to indicate that the output
33379 	 * is completely written to RAM. This field should be read as '1'
33380 	 * to indicate that the output has been completely written. When
33381 	 * writing a command completion or response to an internal processor,
33382 	 * the order of writes has to be such that this field is written last.
33383 	 */
33384 	uint8_t	valid;
33385 } hwrm_port_sfp_sideband_cfg_output_t, *phwrm_port_sfp_sideband_cfg_output_t;
33386 
33387 /*******************************
33388  * hwrm_port_sfp_sideband_qcfg *
33389  *******************************/
33390 
33391 
33392 /* hwrm_port_sfp_sideband_qcfg_input (size:192b/24B) */
33393 
33394 typedef struct hwrm_port_sfp_sideband_qcfg_input {
33395 	/* The HWRM command request type. */
33396 	uint16_t	req_type;
33397 	/*
33398 	 * The completion ring to send the completion event on. This should
33399 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33400 	 */
33401 	uint16_t	cmpl_ring;
33402 	/*
33403 	 * The sequence ID is used by the driver for tracking multiple
33404 	 * commands. This ID is treated as opaque data by the firmware and
33405 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33406 	 */
33407 	uint16_t	seq_id;
33408 	/*
33409 	 * The target ID of the command:
33410 	 * * 0x0-0xFFF8 - The function ID
33411 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33412 	 * * 0xFFFD - Reserved for user-space HWRM interface
33413 	 * * 0xFFFF - HWRM
33414 	 */
33415 	uint16_t	target_id;
33416 	/*
33417 	 * A physical address pointer pointing to a host buffer that the
33418 	 * command's response data will be written. This can be either a host
33419 	 * physical address (HPA) or a guest physical address (GPA) and must
33420 	 * point to a physically contiguous block of memory.
33421 	 */
33422 	uint64_t	resp_addr;
33423 	/* Port ID of port that is to be queried. */
33424 	uint16_t	port_id;
33425 	uint8_t	unused_0[6];
33426 } hwrm_port_sfp_sideband_qcfg_input_t, *phwrm_port_sfp_sideband_qcfg_input_t;
33427 
33428 /* hwrm_port_sfp_sideband_qcfg_output (size:192b/24B) */
33429 
33430 typedef struct hwrm_port_sfp_sideband_qcfg_output {
33431 	/* The specific error status for the command. */
33432 	uint16_t	error_code;
33433 	/* The HWRM command request type. */
33434 	uint16_t	req_type;
33435 	/* The sequence ID from the original command. */
33436 	uint16_t	seq_id;
33437 	/* The length of the response data in number of bytes. */
33438 	uint16_t	resp_len;
33439 	/*
33440 	 * Bitmask indicating which sideband signals are valid.
33441 	 * This is based on the board and nvm cfg that is present on the board.
33442 	 */
33443 	uint32_t	supported_mask;
33444 	uint32_t	sideband_signals;
33445 	/* When this bit is set to '1', the Module is absent. */
33446 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_MOD_ABS	UINT32_C(0x1)
33447 	/*
33448 	 * When this bit is set to '1', there is no valid signal on RX.
33449 	 * This signal is a filtered version of Signal Detect.
33450 	 */
33451 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RX_LOS	UINT32_C(0x2)
33452 	/*
33453 	 * This bit along with rs1 indicates the current speed of the dual
33454 	 * rate module.If these pins are grounded then the speed can be
33455 	 * changed by directly writing to EEPROM.
33456 	 */
33457 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RS0	UINT32_C(0x4)
33458 	/*
33459 	 * This bit along with rs0 indicates the current speed of the dual
33460 	 * rate module.If these pins are grounded then the speed can be
33461 	 * changed by directly writing to EEPROM.
33462 	 */
33463 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RS1	UINT32_C(0x8)
33464 	/*
33465 	 * When this bit is set to '1', tx_disable is set.
33466 	 * On a 1G BASE-T module, if this bit is set, module PHY
33467 	 * registers will not be accessible.
33468 	 */
33469 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_TX_DIS	UINT32_C(0x10)
33470 	/* When this bit is set to '1', tx_fault is set. */
33471 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_TX_FAULT	UINT32_C(0x20)
33472 	/*
33473 	 * When this bit is set to '1', module is selected.
33474 	 * Valid only on QSFP modules
33475 	 */
33476 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_MOD_SEL	UINT32_C(0x40)
33477 	/*
33478 	 * When this bit is set to '0', the module is held in reset.
33479 	 * if reset_l is set to 1,first module is taken out of reset
33480 	 * and other signals will be set to their requested state.
33481 	 * Valid only on QSFP modules.
33482 	 */
33483 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RESET_L	UINT32_C(0x80)
33484 	/*
33485 	 * When this bit is set to '1', the module is in low power mode.
33486 	 * Valid only on QSFP modules
33487 	 */
33488 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_LP_MODE	UINT32_C(0x100)
33489 	/* When this bit is set to '1', module is in power down state. */
33490 	#define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_PWR_DIS	UINT32_C(0x200)
33491 	uint8_t	unused[7];
33492 	/*
33493 	 * This field is used in Output records to indicate that the output
33494 	 * is completely written to RAM. This field should be read as '1'
33495 	 * to indicate that the output has been completely written. When
33496 	 * writing a command completion or response to an internal processor,
33497 	 * the order of writes has to be such that this field is written last.
33498 	 */
33499 	uint8_t	valid;
33500 } hwrm_port_sfp_sideband_qcfg_output_t, *phwrm_port_sfp_sideband_qcfg_output_t;
33501 
33502 /**********************************
33503  * hwrm_port_phy_mdio_bus_acquire *
33504  **********************************/
33505 
33506 
33507 /* hwrm_port_phy_mdio_bus_acquire_input (size:192b/24B) */
33508 
33509 typedef struct hwrm_port_phy_mdio_bus_acquire_input {
33510 	/* The HWRM command request type. */
33511 	uint16_t	req_type;
33512 	/*
33513 	 * The completion ring to send the completion event on. This should
33514 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33515 	 */
33516 	uint16_t	cmpl_ring;
33517 	/*
33518 	 * The sequence ID is used by the driver for tracking multiple
33519 	 * commands. This ID is treated as opaque data by the firmware and
33520 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33521 	 */
33522 	uint16_t	seq_id;
33523 	/*
33524 	 * The target ID of the command:
33525 	 * * 0x0-0xFFF8 - The function ID
33526 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33527 	 * * 0xFFFD - Reserved for user-space HWRM interface
33528 	 * * 0xFFFF - HWRM
33529 	 */
33530 	uint16_t	target_id;
33531 	/*
33532 	 * A physical address pointer pointing to a host buffer that the
33533 	 * command's response data will be written. This can be either a host
33534 	 * physical address (HPA) or a guest physical address (GPA) and must
33535 	 * point to a physically contiguous block of memory.
33536 	 */
33537 	uint64_t	resp_addr;
33538 	/* Port ID of the port. */
33539 	uint16_t	port_id;
33540 	/*
33541 	 * client_id of the client requesting BUS access.
33542 	 * Any value from 0x10 to 0xFFFF can be used.
33543 	 * Client should make sure that the returned client_id
33544 	 * in response matches the client_id in request.
33545 	 * 0-0xF are reserved for internal use.
33546 	 */
33547 	uint16_t	client_id;
33548 	/*
33549 	 * Timeout in milliseconds, MDIO BUS will be released automatically
33550 	 * after this time, if another mdio acquire command is not received
33551 	 * within the timeout window from the same client.
33552 	 * A 0xFFFF will hold the bus until this bus is released.
33553 	 */
33554 	uint16_t	mdio_bus_timeout;
33555 	uint8_t	unused_0[2];
33556 } hwrm_port_phy_mdio_bus_acquire_input_t, *phwrm_port_phy_mdio_bus_acquire_input_t;
33557 
33558 /* hwrm_port_phy_mdio_bus_acquire_output (size:128b/16B) */
33559 
33560 typedef struct hwrm_port_phy_mdio_bus_acquire_output {
33561 	/* The specific error status for the command. */
33562 	uint16_t	error_code;
33563 	/* The HWRM command request type. */
33564 	uint16_t	req_type;
33565 	/* The sequence ID from the original command. */
33566 	uint16_t	seq_id;
33567 	/* The length of the response data in number of bytes. */
33568 	uint16_t	resp_len;
33569 	uint16_t	unused_0;
33570 	/*
33571 	 * client_id of the module holding the BUS.
33572 	 * 0-0xF are reserved for internal use.
33573 	 */
33574 	uint16_t	client_id;
33575 	uint8_t	unused_1[3];
33576 	/*
33577 	 * This field is used in Output records to indicate that the output
33578 	 * is completely written to RAM. This field should be read as '1'
33579 	 * to indicate that the output has been completely written. When
33580 	 * writing a command completion or response to an internal processor,
33581 	 * the order of writes has to be such that this field is written last.
33582 	 */
33583 	uint8_t	valid;
33584 } hwrm_port_phy_mdio_bus_acquire_output_t, *phwrm_port_phy_mdio_bus_acquire_output_t;
33585 
33586 /**********************************
33587  * hwrm_port_phy_mdio_bus_release *
33588  **********************************/
33589 
33590 
33591 /* hwrm_port_phy_mdio_bus_release_input (size:192b/24B) */
33592 
33593 typedef struct hwrm_port_phy_mdio_bus_release_input {
33594 	/* The HWRM command request type. */
33595 	uint16_t	req_type;
33596 	/*
33597 	 * The completion ring to send the completion event on. This should
33598 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33599 	 */
33600 	uint16_t	cmpl_ring;
33601 	/*
33602 	 * The sequence ID is used by the driver for tracking multiple
33603 	 * commands. This ID is treated as opaque data by the firmware and
33604 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33605 	 */
33606 	uint16_t	seq_id;
33607 	/*
33608 	 * The target ID of the command:
33609 	 * * 0x0-0xFFF8 - The function ID
33610 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33611 	 * * 0xFFFD - Reserved for user-space HWRM interface
33612 	 * * 0xFFFF - HWRM
33613 	 */
33614 	uint16_t	target_id;
33615 	/*
33616 	 * A physical address pointer pointing to a host buffer that the
33617 	 * command's response data will be written. This can be either a host
33618 	 * physical address (HPA) or a guest physical address (GPA) and must
33619 	 * point to a physically contiguous block of memory.
33620 	 */
33621 	uint64_t	resp_addr;
33622 	/* Port ID of the port. */
33623 	uint16_t	port_id;
33624 	/*
33625 	 * client_id of the client requesting BUS release.
33626 	 * A client should not release any other clients BUS.
33627 	 */
33628 	uint16_t	client_id;
33629 	uint8_t	unused_0[4];
33630 } hwrm_port_phy_mdio_bus_release_input_t, *phwrm_port_phy_mdio_bus_release_input_t;
33631 
33632 /* hwrm_port_phy_mdio_bus_release_output (size:128b/16B) */
33633 
33634 typedef struct hwrm_port_phy_mdio_bus_release_output {
33635 	/* The specific error status for the command. */
33636 	uint16_t	error_code;
33637 	/* The HWRM command request type. */
33638 	uint16_t	req_type;
33639 	/* The sequence ID from the original command. */
33640 	uint16_t	seq_id;
33641 	/* The length of the response data in number of bytes. */
33642 	uint16_t	resp_len;
33643 	uint16_t	unused_0;
33644 	/* The BUS is released if client_id matches the client_id in request. */
33645 	uint16_t	clients_id;
33646 	uint8_t	unused_1[3];
33647 	/*
33648 	 * This field is used in Output records to indicate that the output
33649 	 * is completely written to RAM. This field should be read as '1'
33650 	 * to indicate that the output has been completely written. When
33651 	 * writing a command completion or response to an internal processor,
33652 	 * the order of writes has to be such that this field is written last.
33653 	 */
33654 	uint8_t	valid;
33655 } hwrm_port_phy_mdio_bus_release_output_t, *phwrm_port_phy_mdio_bus_release_output_t;
33656 
33657 /************************
33658  * hwrm_port_tx_fir_cfg *
33659  ************************/
33660 
33661 
33662 /* hwrm_port_tx_fir_cfg_input (size:320b/40B) */
33663 
33664 typedef struct hwrm_port_tx_fir_cfg_input {
33665 	/* The HWRM command request type. */
33666 	uint16_t	req_type;
33667 	/*
33668 	 * The completion ring to send the completion event on. This should
33669 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33670 	 */
33671 	uint16_t	cmpl_ring;
33672 	/*
33673 	 * The sequence ID is used by the driver for tracking multiple
33674 	 * commands. This ID is treated as opaque data by the firmware and
33675 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33676 	 */
33677 	uint16_t	seq_id;
33678 	/*
33679 	 * The target ID of the command:
33680 	 * * 0x0-0xFFF8 - The function ID
33681 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33682 	 * * 0xFFFD - Reserved for user-space HWRM interface
33683 	 * * 0xFFFF - HWRM
33684 	 */
33685 	uint16_t	target_id;
33686 	/*
33687 	 * A physical address pointer pointing to a host buffer that the
33688 	 * command's response data will be written. This can be either a host
33689 	 * physical address (HPA) or a guest physical address (GPA) and must
33690 	 * point to a physically contiguous block of memory.
33691 	 */
33692 	uint64_t	resp_addr;
33693 	/* Modulation types of TX FIR: NRZ, PAM4. */
33694 	uint8_t	mod_type;
33695 	/* For NRZ */
33696 	#define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_NRZ	UINT32_C(0x0)
33697 	/* For PAM4 */
33698 	#define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_PAM4	UINT32_C(0x1)
33699 	/* For Optical NRZ */
33700 	#define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_C2M_NRZ	UINT32_C(0x2)
33701 	/* For Optical PAM4 */
33702 	#define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_C2M_PAM4	UINT32_C(0x3)
33703 	/* For DAC PAM4 112G */
33704 	#define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_PAM4_112	UINT32_C(0x4)
33705 	/* For Optical PAM4 112G */
33706 	#define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_C2M_PAM4_112G UINT32_C(0x5)
33707 	/* For LPO PAM4 112G */
33708 	#define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_LPO_PAM4_112G UINT32_C(0x6)
33709 	#define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_LAST	HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_LPO_PAM4_112G
33710 	/* The lane mask of the lane TX FIR will be configured. */
33711 	uint8_t	lane_mask;
33712 	uint8_t	unused_0[2];
33713 	/* Value1 of TX FIR, required for NRZ or PAM4. */
33714 	uint32_t	txfir_val_1;
33715 	/* Value2 of TX FIR, required for NRZ or PAM4. */
33716 	uint32_t	txfir_val_2;
33717 	/* Value3 of TX FIR, required for PAM4. */
33718 	uint32_t	txfir_val_3;
33719 	/* Value4 of TX FIR, required for PAM4. */
33720 	uint32_t	txfir_val_4;
33721 	uint8_t	unused_1[4];
33722 } hwrm_port_tx_fir_cfg_input_t, *phwrm_port_tx_fir_cfg_input_t;
33723 
33724 /* hwrm_port_tx_fir_cfg_output (size:128b/16B) */
33725 
33726 typedef struct hwrm_port_tx_fir_cfg_output {
33727 	/* The specific error status for the command. */
33728 	uint16_t	error_code;
33729 	/* The HWRM command request type. */
33730 	uint16_t	req_type;
33731 	/* The sequence ID from the original command. */
33732 	uint16_t	seq_id;
33733 	/* The length of the response data in number of bytes. */
33734 	uint16_t	resp_len;
33735 	uint8_t	unused[7];
33736 	/*
33737 	 * This field is used in Output records to indicate that the output
33738 	 * is completely written to RAM. This field should be read as '1'
33739 	 * to indicate that the output has been completely written. When
33740 	 * writing a command completion or response to an internal processor,
33741 	 * the order of writes has to be such that this field is written last.
33742 	 */
33743 	uint8_t	valid;
33744 } hwrm_port_tx_fir_cfg_output_t, *phwrm_port_tx_fir_cfg_output_t;
33745 
33746 /*************************
33747  * hwrm_port_tx_fir_qcfg *
33748  *************************/
33749 
33750 
33751 /* hwrm_port_tx_fir_qcfg_input (size:192b/24B) */
33752 
33753 typedef struct hwrm_port_tx_fir_qcfg_input {
33754 	/* The HWRM command request type. */
33755 	uint16_t	req_type;
33756 	/*
33757 	 * The completion ring to send the completion event on. This should
33758 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33759 	 */
33760 	uint16_t	cmpl_ring;
33761 	/*
33762 	 * The sequence ID is used by the driver for tracking multiple
33763 	 * commands. This ID is treated as opaque data by the firmware and
33764 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33765 	 */
33766 	uint16_t	seq_id;
33767 	/*
33768 	 * The target ID of the command:
33769 	 * * 0x0-0xFFF8 - The function ID
33770 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33771 	 * * 0xFFFD - Reserved for user-space HWRM interface
33772 	 * * 0xFFFF - HWRM
33773 	 */
33774 	uint16_t	target_id;
33775 	/*
33776 	 * A physical address pointer pointing to a host buffer that the
33777 	 * command's response data will be written. This can be either a host
33778 	 * physical address (HPA) or a guest physical address (GPA) and must
33779 	 * point to a physically contiguous block of memory.
33780 	 */
33781 	uint64_t	resp_addr;
33782 	/* Modulation types of TX FIR: NRZ, PAM4. */
33783 	uint8_t	mod_type;
33784 	/* For NRZ */
33785 	#define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_NRZ	UINT32_C(0x0)
33786 	/* For PAM4 56G */
33787 	#define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_PAM4	UINT32_C(0x1)
33788 	/* For Optical NRZ */
33789 	#define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_C2M_NRZ	UINT32_C(0x2)
33790 	/* For Optical PAM4 56G */
33791 	#define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_C2M_PAM4	UINT32_C(0x3)
33792 	/* For DAC PAM4 112G */
33793 	#define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_PAM4_112	UINT32_C(0x4)
33794 	/* For Optical PAM4 112G */
33795 	#define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_C2M_PAM4_112 UINT32_C(0x5)
33796 	/* For LPO PAM4 112G */
33797 	#define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_LPO_PAM4_112 UINT32_C(0x6)
33798 	#define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_LAST	HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_LPO_PAM4_112
33799 	/* The ID of the lane TX FIR will be queried. */
33800 	uint8_t	lane_id;
33801 	uint8_t	unused[6];
33802 } hwrm_port_tx_fir_qcfg_input_t, *phwrm_port_tx_fir_qcfg_input_t;
33803 
33804 /* hwrm_port_tx_fir_qcfg_output (size:256b/32B) */
33805 
33806 typedef struct hwrm_port_tx_fir_qcfg_output {
33807 	/* The specific error status for the command. */
33808 	uint16_t	error_code;
33809 	/* The HWRM command request type. */
33810 	uint16_t	req_type;
33811 	/* The sequence ID from the original command. */
33812 	uint16_t	seq_id;
33813 	/* The length of the response data in number of bytes. */
33814 	uint16_t	resp_len;
33815 	/* Value1 of TX FIR, required for NRZ or PAM4. */
33816 	uint32_t	txfir_val_1;
33817 	/* Value2 of TX FIR, required for NRZ or PAM4. */
33818 	uint32_t	txfir_val_2;
33819 	/* Value3 of TX FIR, required for PAM4. */
33820 	uint32_t	txfir_val_3;
33821 	/* Value4 of TX FIR, required for PAM4. */
33822 	uint32_t	txfir_val_4;
33823 	uint8_t	unused[7];
33824 	/*
33825 	 * This field is used in Output records to indicate that the output
33826 	 * is completely written to RAM. This field should be read as '1'
33827 	 * to indicate that the output has been completely written. When
33828 	 * writing a command completion or response to an internal processor,
33829 	 * the order of writes has to be such that this field is written last.
33830 	 */
33831 	uint8_t	valid;
33832 } hwrm_port_tx_fir_qcfg_output_t, *phwrm_port_tx_fir_qcfg_output_t;
33833 
33834 /***********************
33835  * hwrm_port_ep_tx_cfg *
33836  ***********************/
33837 
33838 
33839 /* hwrm_port_ep_tx_cfg_input (size:256b/32B) */
33840 
33841 typedef struct hwrm_port_ep_tx_cfg_input {
33842 	/* The HWRM command request type. */
33843 	uint16_t	req_type;
33844 	/*
33845 	 * The completion ring to send the completion event on. This should
33846 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
33847 	 */
33848 	uint16_t	cmpl_ring;
33849 	/*
33850 	 * The sequence ID is used by the driver for tracking multiple
33851 	 * commands. This ID is treated as opaque data by the firmware and
33852 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
33853 	 */
33854 	uint16_t	seq_id;
33855 	/*
33856 	 * The target ID of the command:
33857 	 * * 0x0-0xFFF8 - The function ID
33858 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33859 	 * * 0xFFFD - Reserved for user-space HWRM interface
33860 	 * * 0xFFFF - HWRM
33861 	 */
33862 	uint16_t	target_id;
33863 	/*
33864 	 * A physical address pointer pointing to a host buffer that the
33865 	 * command's response data will be written. This can be either a host
33866 	 * physical address (HPA) or a guest physical address (GPA) and must
33867 	 * point to a physically contiguous block of memory.
33868 	 */
33869 	uint64_t	resp_addr;
33870 	uint16_t	enables;
33871 	/* When this bit is '1', the value in the ep0_min_bw field is valid. */
33872 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP0_MIN_BW	UINT32_C(0x1)
33873 	/* When this bit is '1', the value in the ep0_max_bw field is valid. */
33874 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP0_MAX_BW	UINT32_C(0x2)
33875 	/* When this bit is '1', the value in the ep1_min_bw field is valid. */
33876 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP1_MIN_BW	UINT32_C(0x4)
33877 	/* When this bit is '1', the value in the ep1_max_bw field is valid. */
33878 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP1_MAX_BW	UINT32_C(0x8)
33879 	/* When this bit is '1', the value in the ep2_min_bw field is valid. */
33880 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP2_MIN_BW	UINT32_C(0x10)
33881 	/* When this bit is '1', the value in the ep2_max_bw field is valid. */
33882 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP2_MAX_BW	UINT32_C(0x20)
33883 	/* When this bit is '1', the value in the ep3_min_bw field is valid. */
33884 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP3_MIN_BW	UINT32_C(0x40)
33885 	/* When this bit is '1', the value in the ep3_max_bw field is valid. */
33886 	#define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP3_MAX_BW	UINT32_C(0x80)
33887 	/* A port index, from 0 to the number of front panel ports, minus 1. */
33888 	uint8_t	port_id;
33889 	uint8_t	unused;
33890 	/*
33891 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
33892 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 0 for
33893 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
33894 	 * minimum rate. The endpoint's min_bw must be less than or equal to
33895 	 * max_bw. The sum of all configured minimum bandwidths for a port must
33896 	 * be less than or equal to 100.
33897 	 */
33898 	uint8_t	ep0_min_bw;
33899 	/*
33900 	 * Specifies the maximum portion of the port's bandwidth that the set
33901 	 * of PFs and VFs on PCIe endpoint 0 may use. The value is a percentage
33902 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
33903 	 * maximum rate.
33904 	 */
33905 	uint8_t	ep0_max_bw;
33906 	/*
33907 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
33908 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 1 for
33909 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
33910 	 * minimum rate. The endpoint's min_bw must be less than or equal to
33911 	 * max_bw. The sum of all configured minimum bandwidths for a port must
33912 	 * be less than or equal to 100.
33913 	 */
33914 	uint8_t	ep1_min_bw;
33915 	/*
33916 	 * Specifies the maximum portion of the port's bandwidth that the set
33917 	 * of PFs and VFs on PCIe endpoint 1 may use. The value is a percentage
33918 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
33919 	 * maximum rate.
33920 	 */
33921 	uint8_t	ep1_max_bw;
33922 	/*
33923 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
33924 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 2 for
33925 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
33926 	 * minimum rate. The endpoint's min_bw must be less than or equal to
33927 	 * max_bw. The sum of all configured minimum bandwidths for a port must
33928 	 * be less than or equal to 100.
33929 	 */
33930 	uint8_t	ep2_min_bw;
33931 	/*
33932 	 * Specifies the maximum portion of the port's bandwidth that the set
33933 	 * of PFs and VFs on PCIe endpoint 2 may use. The value is a percentage
33934 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
33935 	 * maximum rate.
33936 	 */
33937 	uint8_t	ep2_max_bw;
33938 	/*
33939 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
33940 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 3 for
33941 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
33942 	 * minimum rate. The endpoint's min_bw must be less than or equal to
33943 	 * max_bw. The sum of all configured minimum bandwidths for a port must
33944 	 * be less than or equal to 100.
33945 	 */
33946 	uint8_t	ep3_min_bw;
33947 	/*
33948 	 * Specifies the maximum portion of the port's bandwidth that the set
33949 	 * of PFs and VFs on PCIe endpoint 3 may use. The value is a percentage
33950 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
33951 	 * maximum rate.
33952 	 */
33953 	uint8_t	ep3_max_bw;
33954 	uint8_t	unused_1[4];
33955 } hwrm_port_ep_tx_cfg_input_t, *phwrm_port_ep_tx_cfg_input_t;
33956 
33957 /* hwrm_port_ep_tx_cfg_output (size:128b/16B) */
33958 
33959 typedef struct hwrm_port_ep_tx_cfg_output {
33960 	/* The specific error status for the command. */
33961 	uint16_t	error_code;
33962 	/* The HWRM command request type. */
33963 	uint16_t	req_type;
33964 	/* The sequence ID from the original command. */
33965 	uint16_t	seq_id;
33966 	/* The length of the response data in number of bytes. */
33967 	uint16_t	resp_len;
33968 	uint8_t	unused_0[7];
33969 	/*
33970 	 * This field is used in output records to indicate that the output
33971 	 * is completely written to RAM. This field should be read as '1'
33972 	 * to indicate that the output has been completely written.
33973 	 * When writing a command completion or response to an internal
33974 	 * processor, the order of writes has to be such that this field
33975 	 * is written last.
33976 	 */
33977 	uint8_t	valid;
33978 } hwrm_port_ep_tx_cfg_output_t, *phwrm_port_ep_tx_cfg_output_t;
33979 
33980 /* hwrm_port_ep_tx_cfg_cmd_err (size:64b/8B) */
33981 
33982 typedef struct hwrm_port_ep_tx_cfg_cmd_err {
33983 	/*
33984 	 * command specific error codes for the cmd_err field in
33985 	 * hwrm_err_output
33986 	 */
33987 	uint8_t	code;
33988 	/* Unknown error. */
33989 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_UNKNOWN		UINT32_C(0x0)
33990 	/* The port ID is invalid */
33991 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_PORT_ID_INVALID	UINT32_C(0x1)
33992 	/* One of the PCIe endpoints configured is not active. */
33993 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_EP_INACTIVE	UINT32_C(0x2)
33994 	/* A minimum bandwidth is out of range. */
33995 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_BW_RANGE	UINT32_C(0x3)
33996 	/*
33997 	 * One endpoint's minimum bandwidth is more than its maximum
33998 	 * bandwidth.
33999 	 */
34000 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_MORE_THAN_MAX  UINT32_C(0x4)
34001 	/* The sum of the minimum bandwidths on the port is more than 100%. */
34002 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_BW_SUM	UINT32_C(0x5)
34003 	/*
34004 	 * The NIC does not support enforcement of a minimum guaranteed
34005 	 * bandwidth for an endpoint.
34006 	 */
34007 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_BW_UNSUPPORTED UINT32_C(0x6)
34008 	#define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_LAST		HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_BW_UNSUPPORTED
34009 	uint8_t	unused_0[7];
34010 } hwrm_port_ep_tx_cfg_cmd_err_t, *phwrm_port_ep_tx_cfg_cmd_err_t;
34011 
34012 /************************
34013  * hwrm_port_ep_tx_qcfg *
34014  ************************/
34015 
34016 
34017 /* hwrm_port_ep_tx_qcfg_input (size:192b/24B) */
34018 
34019 typedef struct hwrm_port_ep_tx_qcfg_input {
34020 	/* The HWRM command request type. */
34021 	uint16_t	req_type;
34022 	/*
34023 	 * The completion ring to send the completion event on. This should
34024 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34025 	 */
34026 	uint16_t	cmpl_ring;
34027 	/*
34028 	 * The sequence ID is used by the driver for tracking multiple
34029 	 * commands. This ID is treated as opaque data by the firmware and
34030 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34031 	 */
34032 	uint16_t	seq_id;
34033 	/*
34034 	 * The target ID of the command:
34035 	 * * 0x0-0xFFF8 - The function ID
34036 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34037 	 * * 0xFFFD - Reserved for user-space HWRM interface
34038 	 * * 0xFFFF - HWRM
34039 	 */
34040 	uint16_t	target_id;
34041 	/*
34042 	 * A physical address pointer pointing to a host buffer that the
34043 	 * command's response data will be written. This can be either a host
34044 	 * physical address (HPA) or a guest physical address (GPA) and must
34045 	 * point to a physically contiguous block of memory.
34046 	 */
34047 	uint64_t	resp_addr;
34048 	/* The port whose endpoint rate limits are queried. */
34049 	uint8_t	port_id;
34050 	uint8_t	unused[7];
34051 } hwrm_port_ep_tx_qcfg_input_t, *phwrm_port_ep_tx_qcfg_input_t;
34052 
34053 /* hwrm_port_ep_tx_qcfg_output (size:192b/24B) */
34054 
34055 typedef struct hwrm_port_ep_tx_qcfg_output {
34056 	/* The specific error status for the command. */
34057 	uint16_t	error_code;
34058 	/* The HWRM command request type. */
34059 	uint16_t	req_type;
34060 	/* The sequence ID from the original command. */
34061 	uint16_t	seq_id;
34062 	/* The length of the response data in number of bytes. */
34063 	uint16_t	resp_len;
34064 	/*
34065 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
34066 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 0 for
34067 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
34068 	 * minimum rate. The endpoint's min_bw must be less than or equal to
34069 	 * max_bw. The sum of all configured minimum bandwidths for a port must
34070 	 * be less than or equal to 100.
34071 	 */
34072 	uint8_t	ep0_min_bw;
34073 	/*
34074 	 * Specifies the maximum portion of the port's bandwidth that the set
34075 	 * of PFs and VFs on PCIe endpoint 0 may use. The value is a percentage
34076 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
34077 	 * maximum rate.
34078 	 */
34079 	uint8_t	ep0_max_bw;
34080 	/*
34081 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
34082 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 1 for
34083 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
34084 	 * minimum rate. The endpoint's min_bw must be less than or equal to
34085 	 * max_bw. The sum of all configured minimum bandwidths for a port must
34086 	 * be less than or equal to 100.
34087 	 */
34088 	uint8_t	ep1_min_bw;
34089 	/*
34090 	 * Specifies the maximum portion of the port's bandwidth that the set
34091 	 * of PFs and VFs on PCIe endpoint 1 may use. The value is a percentage
34092 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
34093 	 * maximum rate.
34094 	 */
34095 	uint8_t	ep1_max_bw;
34096 	/*
34097 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
34098 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 2 for
34099 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
34100 	 * minimum rate. The endpoint's min_bw must be less than or equal to
34101 	 * max_bw. The sum of all configured minimum bandwidths for a port must
34102 	 * be less than or equal to 100.
34103 	 */
34104 	uint8_t	ep2_min_bw;
34105 	/*
34106 	 * Specifies the maximum portion of the port's bandwidth that the set
34107 	 * of PFs and VFs on PCIe endpoint 2 may use. The value is a percentage
34108 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
34109 	 * maximum rate.
34110 	 */
34111 	uint8_t	ep2_max_bw;
34112 	/*
34113 	 * Specifies a minimum guaranteed bandwidth, as a percentage of the
34114 	 * port bandwidth, for the set of PFs and VFs on PCIe endpoint 3 for
34115 	 * the specified port. The range is 0 to 100. A value of 0 indicates no
34116 	 * minimum rate. The endpoint's min_bw must be less than or equal to
34117 	 * max_bw. The sum of all configured minimum bandwidths for a port must
34118 	 * be less than or equal to 100.
34119 	 */
34120 	uint8_t	ep3_min_bw;
34121 	/*
34122 	 * Specifies the maximum portion of the port's bandwidth that the set
34123 	 * of PFs and VFs on PCIe endpoint 3 may use. The value is a percentage
34124 	 * of the link bandwidth, from 0 to 100. A value of 0 indicates no
34125 	 * maximum rate.
34126 	 */
34127 	uint8_t	ep3_max_bw;
34128 	uint8_t	unused_0[7];
34129 	/*
34130 	 * This field is used in output records to indicate that the output
34131 	 * is completely written to RAM. This field should be read as '1'
34132 	 * to indicate that the output has been completely written.
34133 	 * When writing a command completion or response to an internal
34134 	 * processor, the order of writes has to be such that this field is
34135 	 * written last.
34136 	 */
34137 	uint8_t	valid;
34138 } hwrm_port_ep_tx_qcfg_output_t, *phwrm_port_ep_tx_qcfg_output_t;
34139 
34140 /*****************
34141  * hwrm_port_cfg *
34142  *****************/
34143 
34144 
34145 /* hwrm_port_cfg_input (size:256b/32B) */
34146 
34147 typedef struct hwrm_port_cfg_input {
34148 	/* The HWRM command request type. */
34149 	uint16_t	req_type;
34150 	/*
34151 	 * The completion ring to send the completion event on. This should
34152 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34153 	 */
34154 	uint16_t	cmpl_ring;
34155 	/*
34156 	 * The sequence ID is used by the driver for tracking multiple
34157 	 * commands. This ID is treated as opaque data by the firmware and
34158 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34159 	 */
34160 	uint16_t	seq_id;
34161 	/*
34162 	 * The target ID of the command:
34163 	 * * 0x0-0xFFF8 - The function ID
34164 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34165 	 * * 0xFFFD - Reserved for user-space HWRM interface
34166 	 * * 0xFFFF - HWRM
34167 	 */
34168 	uint16_t	target_id;
34169 	/*
34170 	 * A physical address pointer pointing to a host buffer that the
34171 	 * command's response data will be written. This can be either a host
34172 	 * physical address (HPA) or a guest physical address (GPA) and must
34173 	 * point to a physically contiguous block of memory.
34174 	 */
34175 	uint64_t	resp_addr;
34176 	uint32_t	flags;
34177 	uint32_t	enables;
34178 	/*
34179 	 * This bit must be '1' for the tx_rate_limit field to
34180 	 * be configured.
34181 	 */
34182 	#define HWRM_PORT_CFG_INPUT_ENABLES_TX_RATE_LIMIT	UINT32_C(0x1)
34183 	/* Port ID of port that is to be configured. */
34184 	uint16_t	port_id;
34185 	uint16_t	unused_0;
34186 	/*
34187 	 * Requested setting of TX rate limit in Mbps.
34188 	 * tx_rate_limit = 0 will cancel the rate limit if any.
34189 	 * This field is valid only when tx_rate_limit bit in 'enables'
34190 	 * field is '1'.
34191 	 */
34192 	uint32_t	tx_rate_limit;
34193 } hwrm_port_cfg_input_t, *phwrm_port_cfg_input_t;
34194 
34195 /* hwrm_port_cfg_output (size:128b/16B) */
34196 
34197 typedef struct hwrm_port_cfg_output {
34198 	/* The specific error status for the command. */
34199 	uint16_t	error_code;
34200 	/* The HWRM command request type. */
34201 	uint16_t	req_type;
34202 	/* The sequence ID from the original command. */
34203 	uint16_t	seq_id;
34204 	/* The length of the response data in number of bytes. */
34205 	uint16_t	resp_len;
34206 	uint8_t	unused_0[7];
34207 	/*
34208 	 * This field is used in Output records to indicate that the output
34209 	 * is completely written to RAM. This field should be read as '1'
34210 	 * to indicate that the output has been completely written. When
34211 	 * writing a command completion or response to an internal processor,
34212 	 * the order of writes has to be such that this field is written last.
34213 	 */
34214 	uint8_t	valid;
34215 } hwrm_port_cfg_output_t, *phwrm_port_cfg_output_t;
34216 
34217 /******************
34218  * hwrm_port_qcfg *
34219  ******************/
34220 
34221 
34222 /* hwrm_port_qcfg_input (size:192b/24B) */
34223 
34224 typedef struct hwrm_port_qcfg_input {
34225 	/* The HWRM command request type. */
34226 	uint16_t	req_type;
34227 	/*
34228 	 * The completion ring to send the completion event on. This should
34229 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34230 	 */
34231 	uint16_t	cmpl_ring;
34232 	/*
34233 	 * The sequence ID is used by the driver for tracking multiple
34234 	 * commands. This ID is treated as opaque data by the firmware and
34235 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34236 	 */
34237 	uint16_t	seq_id;
34238 	/*
34239 	 * The target ID of the command:
34240 	 * * 0x0-0xFFF8 - The function ID
34241 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34242 	 * * 0xFFFD - Reserved for user-space HWRM interface
34243 	 * * 0xFFFF - HWRM
34244 	 */
34245 	uint16_t	target_id;
34246 	/*
34247 	 * A physical address pointer pointing to a host buffer that the
34248 	 * command's response data will be written. This can be either a host
34249 	 * physical address (HPA) or a guest physical address (GPA) and must
34250 	 * point to a physically contiguous block of memory.
34251 	 */
34252 	uint64_t	resp_addr;
34253 	/* Port ID of port that is to be queried. */
34254 	uint16_t	port_id;
34255 	uint8_t	unused_0[6];
34256 } hwrm_port_qcfg_input_t, *phwrm_port_qcfg_input_t;
34257 
34258 /* hwrm_port_qcfg_output (size:192b/24B) */
34259 
34260 typedef struct hwrm_port_qcfg_output {
34261 	/* The specific error status for the command. */
34262 	uint16_t	error_code;
34263 	/* The HWRM command request type. */
34264 	uint16_t	req_type;
34265 	/* The sequence ID from the original command. */
34266 	uint16_t	seq_id;
34267 	/* The length of the response data in number of bytes. */
34268 	uint16_t	resp_len;
34269 	uint32_t	supported;
34270 	/*
34271 	 * If set to '1', then this bit indicates that TX rate limit
34272 	 * could be configured via hwrm_port_cfg command.
34273 	 */
34274 	#define HWRM_PORT_QCFG_OUTPUT_SUPPORTED_TX_RATE_LIMIT	UINT32_C(0x1)
34275 	uint32_t	enabled;
34276 	/*
34277 	 * If set to '1', then this bit indicates that TX rate limit
34278 	 * is enabled and could be found in tx_rate_limit field.
34279 	 */
34280 	#define HWRM_PORT_QCFG_OUTPUT_ENABLED_TX_RATE_LIMIT	UINT32_C(0x1)
34281 	/*
34282 	 * Current setting of TX rate limit in Mbps.
34283 	 * This field is valid only when tx_rate_limit bit in 'enabled'
34284 	 * field is '1'.
34285 	 */
34286 	uint32_t	tx_rate_limit;
34287 	uint8_t	unused_0[3];
34288 	/*
34289 	 * This field is used in Output records to indicate that the output
34290 	 * is completely written to RAM. This field should be read as '1'
34291 	 * to indicate that the output has been completely written. When
34292 	 * writing a command completion or response to an internal processor,
34293 	 * the order of writes has to be such that this field is written last.
34294 	 */
34295 	uint8_t	valid;
34296 } hwrm_port_qcfg_output_t, *phwrm_port_qcfg_output_t;
34297 
34298 /***********************
34299  * hwrm_port_mac_qcaps *
34300  ***********************/
34301 
34302 
34303 /* hwrm_port_mac_qcaps_input (size:192b/24B) */
34304 
34305 typedef struct hwrm_port_mac_qcaps_input {
34306 	/* The HWRM command request type. */
34307 	uint16_t	req_type;
34308 	/*
34309 	 * The completion ring to send the completion event on. This should
34310 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34311 	 */
34312 	uint16_t	cmpl_ring;
34313 	/*
34314 	 * The sequence ID is used by the driver for tracking multiple
34315 	 * commands. This ID is treated as opaque data by the firmware and
34316 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34317 	 */
34318 	uint16_t	seq_id;
34319 	/*
34320 	 * The target ID of the command:
34321 	 * * 0x0-0xFFF8 - The function ID
34322 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34323 	 * * 0xFFFD - Reserved for user-space HWRM interface
34324 	 * * 0xFFFF - HWRM
34325 	 */
34326 	uint16_t	target_id;
34327 	/*
34328 	 * A physical address pointer pointing to a host buffer that the
34329 	 * command's response data will be written. This can be either a host
34330 	 * physical address (HPA) or a guest physical address (GPA) and must
34331 	 * point to a physically contiguous block of memory.
34332 	 */
34333 	uint64_t	resp_addr;
34334 	/* Port ID of port that is being queried. */
34335 	uint16_t	port_id;
34336 	uint8_t	unused_0[6];
34337 } hwrm_port_mac_qcaps_input_t, *phwrm_port_mac_qcaps_input_t;
34338 
34339 /* hwrm_port_mac_qcaps_output (size:128b/16B) */
34340 
34341 typedef struct hwrm_port_mac_qcaps_output {
34342 	/* The specific error status for the command. */
34343 	uint16_t	error_code;
34344 	/* The HWRM command request type. */
34345 	uint16_t	req_type;
34346 	/* The sequence ID from the original command. */
34347 	uint16_t	seq_id;
34348 	/* The length of the response data in number of bytes. */
34349 	uint16_t	resp_len;
34350 	/* MAC capability flags */
34351 	uint8_t	flags;
34352 	/*
34353 	 * If set to 1, then this field indicates that the
34354 	 * MAC does not support local loopback.
34355 	 */
34356 	#define HWRM_PORT_MAC_QCAPS_OUTPUT_FLAGS_LOCAL_LPBK_NOT_SUPPORTED	UINT32_C(0x1)
34357 	/*
34358 	 * If set to 1, then this field indicates that the
34359 	 * MAC is capable of supporting remote loopback.
34360 	 */
34361 	#define HWRM_PORT_MAC_QCAPS_OUTPUT_FLAGS_REMOTE_LPBK_SUPPORTED	UINT32_C(0x2)
34362 	uint8_t	unused_0[6];
34363 	/*
34364 	 * This field is used in Output records to indicate that the output
34365 	 * is completely written to RAM. This field should be read as '1'
34366 	 * to indicate that the output has been completely written. When
34367 	 * writing a command completion or response to an internal processor,
34368 	 * the order of writes has to be such that this field is written last.
34369 	 */
34370 	uint8_t	valid;
34371 } hwrm_port_mac_qcaps_output_t, *phwrm_port_mac_qcaps_output_t;
34372 
34373 /*********************
34374  * hwrm_port_poe_cfg *
34375  *********************/
34376 
34377 
34378 /* hwrm_port_poe_cfg_input (size:192b/24B) */
34379 
34380 typedef struct hwrm_port_poe_cfg_input {
34381 	/* The HWRM command request type. */
34382 	uint16_t	req_type;
34383 	/*
34384 	 * The completion ring to send the completion event on. This should
34385 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34386 	 */
34387 	uint16_t	cmpl_ring;
34388 	/*
34389 	 * The sequence ID is used by the driver for tracking multiple
34390 	 * commands. This ID is treated as opaque data by the firmware and
34391 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34392 	 */
34393 	uint16_t	seq_id;
34394 	/*
34395 	 * The target ID of the command:
34396 	 * * 0x0-0xFFF8 - The function ID
34397 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34398 	 * * 0xFFFD - Reserved for user-space HWRM interface
34399 	 * * 0xFFFF - HWRM
34400 	 */
34401 	uint16_t	target_id;
34402 	/*
34403 	 * A physical address pointer pointing to a host buffer that the
34404 	 * command's response data will be written. This can be either a host
34405 	 * physical address (HPA) or a guest physical address (GPA) and must
34406 	 * point to a physically contiguous block of memory.
34407 	 */
34408 	uint64_t	resp_addr;
34409 	/* Expander port index for which PoE has to be enabled/disabled */
34410 	uint8_t	exp_port_idx;
34411 	/* PoE enable/disable flag */
34412 	uint8_t	flags;
34413 	/* This field indicates that the PoE has to be enabled. */
34414 	#define HWRM_PORT_POE_CFG_INPUT_FLAGS_ENABLE_POE	UINT32_C(0x1)
34415 	uint8_t	unused_0[6];
34416 } hwrm_port_poe_cfg_input_t, *phwrm_port_poe_cfg_input_t;
34417 
34418 /* hwrm_port_poe_cfg_output (size:128b/16B) */
34419 
34420 typedef struct hwrm_port_poe_cfg_output {
34421 	/* The specific error status for the command. */
34422 	uint16_t	error_code;
34423 	/* The HWRM command request type. */
34424 	uint16_t	req_type;
34425 	/* The sequence ID from the original command. */
34426 	uint16_t	seq_id;
34427 	/* The length of the response data in number of bytes. */
34428 	uint16_t	resp_len;
34429 	uint8_t	unused_0[7];
34430 	/*
34431 	 * This field is used in Output records to indicate that the output
34432 	 * is completely written to RAM. This field should be read as '1'
34433 	 * to indicate that the output has been completely written. When
34434 	 * writing a command completion or response to an internal processor,
34435 	 * the order of writes has to be such that this field is written last.
34436 	 */
34437 	uint8_t	valid;
34438 } hwrm_port_poe_cfg_output_t, *phwrm_port_poe_cfg_output_t;
34439 
34440 /**********************
34441  * hwrm_port_poe_qcfg *
34442  **********************/
34443 
34444 
34445 /* hwrm_port_poe_qcfg_input (size:192b/24B) */
34446 
34447 typedef struct hwrm_port_poe_qcfg_input {
34448 	/* The HWRM command request type. */
34449 	uint16_t	req_type;
34450 	/*
34451 	 * The completion ring to send the completion event on. This should
34452 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34453 	 */
34454 	uint16_t	cmpl_ring;
34455 	/*
34456 	 * The sequence ID is used by the driver for tracking multiple
34457 	 * commands. This ID is treated as opaque data by the firmware and
34458 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34459 	 */
34460 	uint16_t	seq_id;
34461 	/*
34462 	 * The target ID of the command:
34463 	 * * 0x0-0xFFF8 - The function ID
34464 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34465 	 * * 0xFFFD - Reserved for user-space HWRM interface
34466 	 * * 0xFFFF - HWRM
34467 	 */
34468 	uint16_t	target_id;
34469 	/*
34470 	 * A physical address pointer pointing to a host buffer that the
34471 	 * command's response data will be written. This can be either a host
34472 	 * physical address (HPA) or a guest physical address (GPA) and must
34473 	 * point to a physically contiguous block of memory.
34474 	 */
34475 	uint64_t	resp_addr;
34476 	/* Expander port which is queried */
34477 	uint8_t	exp_port_idx;
34478 	uint8_t	unused_0[7];
34479 } hwrm_port_poe_qcfg_input_t, *phwrm_port_poe_qcfg_input_t;
34480 
34481 /* hwrm_port_poe_qcfg_output (size:128b/16B) */
34482 
34483 typedef struct hwrm_port_poe_qcfg_output {
34484 	/* The specific error status for the command. */
34485 	uint16_t	error_code;
34486 	/* The HWRM command request type. */
34487 	uint16_t	req_type;
34488 	/* The sequence ID from the original command. */
34489 	uint16_t	seq_id;
34490 	/* The length of the response data in number of bytes. */
34491 	uint16_t	resp_len;
34492 	/* This field indicates if the PoE is enabled/disabled */
34493 	uint8_t	status;
34494 	/* This field indicates that the PoE is enabled. */
34495 	#define HWRM_PORT_POE_QCFG_OUTPUT_STATUS_POE_ENABLED	UINT32_C(0x1)
34496 	uint8_t	unused_0[6];
34497 	/*
34498 	 * This field is used in Output records to indicate that the output
34499 	 * is completely written to RAM. This field should be read as '1'
34500 	 * to indicate that the output has been completely written. When
34501 	 * writing a command completion or response to an internal processor,
34502 	 * the order of writes has to be such that this field is written last.
34503 	 */
34504 	uint8_t	valid;
34505 } hwrm_port_poe_qcfg_output_t, *phwrm_port_poe_qcfg_output_t;
34506 
34507 /***********************
34508  * hwrm_queue_qportcfg *
34509  ***********************/
34510 
34511 
34512 /* hwrm_queue_qportcfg_input (size:192b/24B) */
34513 
34514 typedef struct hwrm_queue_qportcfg_input {
34515 	/* The HWRM command request type. */
34516 	uint16_t	req_type;
34517 	/*
34518 	 * The completion ring to send the completion event on. This should
34519 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
34520 	 */
34521 	uint16_t	cmpl_ring;
34522 	/*
34523 	 * The sequence ID is used by the driver for tracking multiple
34524 	 * commands. This ID is treated as opaque data by the firmware and
34525 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
34526 	 */
34527 	uint16_t	seq_id;
34528 	/*
34529 	 * The target ID of the command:
34530 	 * * 0x0-0xFFF8 - The function ID
34531 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34532 	 * * 0xFFFD - Reserved for user-space HWRM interface
34533 	 * * 0xFFFF - HWRM
34534 	 */
34535 	uint16_t	target_id;
34536 	/*
34537 	 * A physical address pointer pointing to a host buffer that the
34538 	 * command's response data will be written. This can be either a host
34539 	 * physical address (HPA) or a guest physical address (GPA) and must
34540 	 * point to a physically contiguous block of memory.
34541 	 */
34542 	uint64_t	resp_addr;
34543 	uint32_t	flags;
34544 	/*
34545 	 * Enumeration denoting the RX, TX type of the resource.
34546 	 * This enumeration is used for resources that are similar for both
34547 	 * TX and RX paths of the chip.
34548 	 */
34549 	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
34550 	/* tx path */
34551 		#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
34552 	/* rx path */
34553 		#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
34554 		#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
34555 	/*
34556 	 * Port ID of port for which the queue configuration is being
34557 	 * queried. This field is only required when sent by IPC.
34558 	 */
34559 	uint16_t	port_id;
34560 	/*
34561 	 * Drivers will set this capability when it can use
34562 	 * queue_idx_service_profile to map the queues to application.
34563 	 */
34564 	uint8_t	drv_qmap_cap;
34565 	/* disabled */
34566 	#define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
34567 	/* enabled */
34568 	#define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED  UINT32_C(0x1)
34569 	#define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST	HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
34570 	uint8_t	unused_0;
34571 } hwrm_queue_qportcfg_input_t, *phwrm_queue_qportcfg_input_t;
34572 
34573 /* hwrm_queue_qportcfg_output (size:1344b/168B) */
34574 
34575 typedef struct hwrm_queue_qportcfg_output {
34576 	/* The specific error status for the command. */
34577 	uint16_t	error_code;
34578 	/* The HWRM command request type. */
34579 	uint16_t	req_type;
34580 	/* The sequence ID from the original command. */
34581 	uint16_t	seq_id;
34582 	/* The length of the response data in number of bytes. */
34583 	uint16_t	resp_len;
34584 	/*
34585 	 * The maximum number of queues that can be configured on this
34586 	 * port.
34587 	 * Valid values range from 1 through 8.
34588 	 */
34589 	uint8_t	max_configurable_queues;
34590 	/*
34591 	 * The maximum number of lossless queues that can be configured
34592 	 * on this port.
34593 	 * Valid values range from 0 through 8.
34594 	 */
34595 	uint8_t	max_configurable_lossless_queues;
34596 	/*
34597 	 * Bitmask indicating which queues can be configured by the
34598 	 * hwrm_queue_cfg command.
34599 	 *
34600 	 * Each bit represents a specific queue where bit 0 represents
34601 	 * queue 0 and bit 7 represents queue 7.
34602 	 * # A value of 0 indicates that the queue is not configurable
34603 	 * by the hwrm_queue_cfg command.
34604 	 * # A value of 1 indicates that the queue is configurable.
34605 	 * # A hwrm_queue_cfg command shall return error when trying to
34606 	 * configure a queue not configurable.
34607 	 */
34608 	uint8_t	queue_cfg_allowed;
34609 	/* Information about queue configuration. */
34610 	uint8_t	queue_cfg_info;
34611 	/*
34612 	 * If this flag is set to '1', then the queues are
34613 	 * configured asymmetrically on TX and RX sides.
34614 	 * If this flag is set to '0', then the queues are
34615 	 * configured symmetrically on TX and RX sides. For
34616 	 * symmetric configuration, the queue configuration
34617 	 * including queue ids and service profiles on the
34618 	 * TX side is the same as the corresponding queue
34619 	 * configuration on the RX side.
34620 	 */
34621 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG		UINT32_C(0x1)
34622 	/*
34623 	 * If this flag is set to '1', then service_profile will carry
34624 	 * either lossy/lossless type and the new service_profile_type
34625 	 * field will be used to determine if the queue is for L2/ROCE/CNP.
34626 	 */
34627 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_USE_PROFILE_TYPE	UINT32_C(0x2)
34628 	/*
34629 	 * Bitmask indicating which queues can be configured by the
34630 	 * hwrm_queue_pfcenable_cfg command.
34631 	 *
34632 	 * Each bit represents a specific priority where bit 0 represents
34633 	 * priority 0 and bit 7 represents priority 7.
34634 	 * # A value of 0 indicates that the priority is not configurable by
34635 	 * the hwrm_queue_pfcenable_cfg command.
34636 	 * # A value of 1 indicates that the priority is configurable.
34637 	 * # A hwrm_queue_pfcenable_cfg command shall return error when
34638 	 * trying to configure a priority that is not configurable.
34639 	 */
34640 	uint8_t	queue_pfcenable_cfg_allowed;
34641 	/*
34642 	 * Bitmask indicating which queues can be configured by the
34643 	 * hwrm_queue_pri2cos_cfg command.
34644 	 *
34645 	 * Each bit represents a specific queue where bit 0 represents
34646 	 * queue 0 and bit 7 represents queue 7.
34647 	 * # A value of 0 indicates that the queue is not configurable
34648 	 * by the hwrm_queue_pri2cos_cfg command.
34649 	 * # A value of 1 indicates that the queue is configurable.
34650 	 * # A hwrm_queue_pri2cos_cfg command shall return error when
34651 	 * trying to configure a queue that is not configurable.
34652 	 */
34653 	uint8_t	queue_pri2cos_cfg_allowed;
34654 	/*
34655 	 * Bitmask indicating which queues can be configured by the
34656 	 * hwrm_queue_pri2cos_cfg command.
34657 	 *
34658 	 * Each bit represents a specific queue where bit 0 represents
34659 	 * queue 0 and bit 7 represents queue 7.
34660 	 * # A value of 0 indicates that the queue is not configurable
34661 	 * by the hwrm_queue_pri2cos_cfg command.
34662 	 * # A value of 1 indicates that the queue is configurable.
34663 	 * # A hwrm_queue_pri2cos_cfg command shall return error when
34664 	 * trying to configure a queue not configurable.
34665 	 */
34666 	uint8_t	queue_cos2bw_cfg_allowed;
34667 	/*
34668 	 * ID of CoS Queue 0.
34669 	 * FF - Invalid id
34670 	 *
34671 	 * # This ID can be used on any subsequent call to an hwrm command
34672 	 * that takes a queue id.
34673 	 * # IDs must always be queried by this command before any use
34674 	 * by the driver or software.
34675 	 * # The CoS queue index is obtained by applying modulo 10 to the
34676 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
34677 	 * The CoS queue index is used to reference port statistics for the
34678 	 * CoS queue.
34679 	 * # A value of 0xff indicates that the queue is not available.
34680 	 * # Available queues may not be in sequential order.
34681 	 */
34682 	uint8_t	queue_id0;
34683 	/* This value specifies service profile kind for CoS queue */
34684 	uint8_t	queue_id0_service_profile;
34685 	/* Lossy (best-effort) */
34686 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
34687 	/* Lossless */
34688 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
34689 	/* Lossless RoCE (deprecated) */
34690 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
34691 	/* Lossy RoCE CNP (deprecated) */
34692 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
34693 	/* Lossless NIC (deprecated) */
34694 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
34695 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
34696 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
34697 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
34698 	/*
34699 	 * ID of CoS Queue 1.
34700 	 * FF - Invalid id
34701 	 *
34702 	 * # This ID can be used on any subsequent call to an hwrm command
34703 	 * that takes a queue id.
34704 	 * # IDs must always be queried by this command before any use
34705 	 * by the driver or software.
34706 	 * # The CoS queue index is obtained by applying modulo 10 to the
34707 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
34708 	 * The CoS queue index is used to reference port statistics for the
34709 	 * CoS queue.
34710 	 * # A value of 0xff indicates that the queue is not available.
34711 	 * # Available queues may not be in sequential order.
34712 	 */
34713 	uint8_t	queue_id1;
34714 	/* This value specifies service profile kind for CoS queue */
34715 	uint8_t	queue_id1_service_profile;
34716 	/* Lossy (best-effort) */
34717 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
34718 	/* Lossless */
34719 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
34720 	/* Lossless RoCE (deprecated) */
34721 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
34722 	/* Lossy RoCE CNP (deprecated) */
34723 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
34724 	/* Lossless NIC (deprecated) */
34725 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
34726 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
34727 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
34728 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
34729 	/*
34730 	 * ID of CoS Queue 2.
34731 	 * FF - Invalid id
34732 	 *
34733 	 * # This ID can be used on any subsequent call to an hwrm command
34734 	 * that takes a queue id.
34735 	 * # IDs must always be queried by this command before any use
34736 	 * by the driver or software.
34737 	 * # The CoS queue index is obtained by applying modulo 10 to the
34738 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
34739 	 * The CoS queue index is used to reference port statistics for the
34740 	 * CoS queue.
34741 	 * # A value of 0xff indicates that the queue is not available.
34742 	 * # Available queues may not be in sequential order.
34743 	 */
34744 	uint8_t	queue_id2;
34745 	/* This value specifies service profile kind for CoS queue */
34746 	uint8_t	queue_id2_service_profile;
34747 	/* Lossy (best-effort) */
34748 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
34749 	/* Lossless */
34750 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
34751 	/* Lossless RoCE (deprecated) */
34752 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
34753 	/* Lossy RoCE CNP (deprecated) */
34754 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
34755 	/* Lossless NIC (deprecated) */
34756 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
34757 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
34758 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
34759 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
34760 	/*
34761 	 * ID of CoS Queue 3.
34762 	 * FF - Invalid id
34763 	 *
34764 	 * # This ID can be used on any subsequent call to an hwrm command
34765 	 * that takes a queue id.
34766 	 * # IDs must always be queried by this command before any use
34767 	 * by the driver or software.
34768 	 * # The CoS queue index is obtained by applying modulo 10 to the
34769 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
34770 	 * The CoS queue index is used to reference port statistics for the
34771 	 * CoS queue.
34772 	 * # A value of 0xff indicates that the queue is not available.
34773 	 * # Available queues may not be in sequential order.
34774 	 */
34775 	uint8_t	queue_id3;
34776 	/* This value specifies service profile kind for CoS queue */
34777 	uint8_t	queue_id3_service_profile;
34778 	/* Lossy (best-effort) */
34779 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
34780 	/* Lossless */
34781 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
34782 	/* Lossless RoCE (deprecated) */
34783 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
34784 	/* Lossy RoCE CNP (deprecated) */
34785 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
34786 	/* Lossless NIC (deprecated) */
34787 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
34788 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
34789 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
34790 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
34791 	/*
34792 	 * ID of CoS Queue 4.
34793 	 * FF - Invalid id
34794 	 *
34795 	 * # This ID can be used on any subsequent call to an hwrm command
34796 	 * that takes a queue id.
34797 	 * # IDs must always be queried by this command before any use
34798 	 * by the driver or software.
34799 	 * # The CoS queue index is obtained by applying modulo 10 to the
34800 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
34801 	 * The CoS queue index is used to reference port statistics for the
34802 	 * CoS queue.
34803 	 * # A value of 0xff indicates that the queue is not available.
34804 	 * # Available queues may not be in sequential order.
34805 	 */
34806 	uint8_t	queue_id4;
34807 	/* This value specifies service profile kind for CoS queue */
34808 	uint8_t	queue_id4_service_profile;
34809 	/* Lossy (best-effort) */
34810 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
34811 	/* Lossless */
34812 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
34813 	/* Lossless RoCE (deprecated) */
34814 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
34815 	/* Lossy RoCE CNP (deprecated) */
34816 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
34817 	/* Lossless NIC (deprecated) */
34818 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
34819 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
34820 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
34821 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
34822 	/*
34823 	 * ID of CoS Queue 5.
34824 	 * FF - Invalid id
34825 	 *
34826 	 * # This ID can be used on any subsequent call to an hwrm command
34827 	 * that takes a queue id.
34828 	 * # IDs must always be queried by this command before any use
34829 	 * by the driver or software.
34830 	 * # The CoS queue index is obtained by applying modulo 10 to the
34831 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
34832 	 * The CoS queue index is used to reference port statistics for the
34833 	 * CoS queue.
34834 	 * # A value of 0xff indicates that the queue is not available.
34835 	 * # Available queues may not be in sequential order.
34836 	 */
34837 	uint8_t	queue_id5;
34838 	/* This value specifies service profile kind for CoS queue */
34839 	uint8_t	queue_id5_service_profile;
34840 	/* Lossy (best-effort) */
34841 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
34842 	/* Lossless */
34843 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
34844 	/* Lossless RoCE (deprecated) */
34845 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
34846 	/* Lossy RoCE CNP (deprecated) */
34847 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
34848 	/* Lossless NIC (deprecated) */
34849 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
34850 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
34851 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
34852 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
34853 	/*
34854 	 * ID of CoS Queue 6.
34855 	 * FF - Invalid id
34856 	 *
34857 	 * # This ID can be used on any subsequent call to an hwrm command
34858 	 * that takes a queue id.
34859 	 * # IDs must always be queried by this command before any use
34860 	 * by the driver or software.
34861 	 * # The CoS queue index is obtained by applying modulo 10 to the
34862 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
34863 	 * The CoS queue index is used to reference port statistics for the
34864 	 * CoS queue.
34865 	 * # A value of 0xff indicates that the queue is not available.
34866 	 * # Available queues may not be in sequential order.
34867 	 */
34868 	uint8_t	queue_id6;
34869 	/* This value specifies service profile kind for CoS queue */
34870 	uint8_t	queue_id6_service_profile;
34871 	/* Lossy (best-effort) */
34872 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
34873 	/* Lossless */
34874 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
34875 	/* Lossless RoCE (deprecated) */
34876 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
34877 	/* Lossy RoCE CNP (deprecated) */
34878 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
34879 	/* Lossless NIC (deprecated) */
34880 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
34881 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
34882 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
34883 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
34884 	/*
34885 	 * ID of CoS Queue 7.
34886 	 * FF - Invalid id
34887 	 *
34888 	 * # This ID can be used on any subsequent call to an hwrm command
34889 	 * that takes a queue id.
34890 	 * # IDs must always be queried by this command before any use
34891 	 * by the driver or software.
34892 	 * # The CoS queue index is obtained by applying modulo 10 to the
34893 	 * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
34894 	 * The CoS queue index is used to reference port statistics for the
34895 	 * CoS queue.
34896 	 * # A value of 0xff indicates that the queue is not available.
34897 	 * # Available queues may not be in sequential order.
34898 	 */
34899 	uint8_t	queue_id7;
34900 	/* This value specifies service profile kind for CoS queue */
34901 	uint8_t	queue_id7_service_profile;
34902 	/* Lossy (best-effort) */
34903 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
34904 	/* Lossless */
34905 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS	UINT32_C(0x1)
34906 	/* Lossless RoCE (deprecated) */
34907 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE  UINT32_C(0x1)
34908 	/* Lossy RoCE CNP (deprecated) */
34909 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP UINT32_C(0x2)
34910 	/* Lossless NIC (deprecated) */
34911 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC   UINT32_C(0x3)
34912 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
34913 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN	UINT32_C(0xff)
34914 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
34915 	/*
34916 	 * This value specifies traffic type for the service profile. We can
34917 	 * have a TC mapped to multiple traffic types. For example shared
34918 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
34919 	 * A value of zero is considered as invalid.
34920 	 */
34921 	uint8_t	queue_id0_service_profile_type;
34922 	/* Recommended to be used for RoCE traffic only. */
34923 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
34924 	/* Recommended to be used for NIC/L2 traffic only. */
34925 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
34926 	/* Recommended to be used for CNP traffic only. */
34927 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
34928 	/*
34929 	 * Up to 16 bytes of null padded ASCII string describing this queue.
34930 	 * The queue name includes a CoS queue index and, in some cases, text
34931 	 * that distinguishes the queue from other queues in the group.
34932 	 */
34933 	char	qid0_name[16];
34934 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
34935 	char	qid1_name[16];
34936 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
34937 	char	qid2_name[16];
34938 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
34939 	char	qid3_name[16];
34940 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
34941 	char	qid4_name[16];
34942 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
34943 	char	qid5_name[16];
34944 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
34945 	char	qid6_name[16];
34946 	/* Up to 16 bytes of null padded ASCII string describing this queue. */
34947 	char	qid7_name[16];
34948 	/*
34949 	 * This value specifies traffic type for the service profile. We can
34950 	 * have a TC mapped to multiple traffic types. For example shared
34951 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
34952 	 * A value of zero is considered as invalid.
34953 	 */
34954 	uint8_t	queue_id1_service_profile_type;
34955 	/* Recommended to be used for RoCE traffic only. */
34956 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
34957 	/* Recommended to be used for NIC/L2 traffic only. */
34958 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
34959 	/* Recommended to be used for CNP traffic only. */
34960 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
34961 	/*
34962 	 * This value specifies traffic type for the service profile. We can
34963 	 * have a TC mapped to multiple traffic types. For example shared
34964 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
34965 	 * A value of zero is considered as invalid.
34966 	 */
34967 	uint8_t	queue_id2_service_profile_type;
34968 	/* Recommended to be used for RoCE traffic only. */
34969 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
34970 	/* Recommended to be used for NIC/L2 traffic only. */
34971 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
34972 	/* Recommended to be used for CNP traffic only. */
34973 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
34974 	/*
34975 	 * This value specifies traffic type for the service profile. We can
34976 	 * have a TC mapped to multiple traffic types. For example shared
34977 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
34978 	 * A value of zero is considered as invalid.
34979 	 */
34980 	uint8_t	queue_id3_service_profile_type;
34981 	/* Recommended to be used for RoCE traffic only. */
34982 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
34983 	/* Recommended to be used for NIC/L2 traffic only. */
34984 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
34985 	/* Recommended to be used for CNP traffic only. */
34986 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
34987 	/*
34988 	 * This value specifies traffic type for the service profile. We can
34989 	 * have a TC mapped to multiple traffic types. For example shared
34990 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
34991 	 * A value of zero is considered as invalid.
34992 	 */
34993 	uint8_t	queue_id4_service_profile_type;
34994 	/* Recommended to be used for RoCE traffic only. */
34995 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
34996 	/* Recommended to be used for NIC/L2 traffic only. */
34997 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
34998 	/* Recommended to be used for CNP traffic only. */
34999 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
35000 	/*
35001 	 * This value specifies traffic type for the service profile. We can
35002 	 * have a TC mapped to multiple traffic types. For example shared
35003 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
35004 	 * A value of zero is considered as invalid.
35005 	 */
35006 	uint8_t	queue_id5_service_profile_type;
35007 	/* Recommended to be used for RoCE traffic only. */
35008 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
35009 	/* Recommended to be used for NIC/L2 traffic only. */
35010 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
35011 	/* Recommended to be used for CNP traffic only. */
35012 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
35013 	/*
35014 	 * This value specifies traffic type for the service profile. We can
35015 	 * have a TC mapped to multiple traffic types. For example shared
35016 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
35017 	 * A value of zero is considered as invalid.
35018 	 */
35019 	uint8_t	queue_id6_service_profile_type;
35020 	/* Recommended to be used for RoCE traffic only. */
35021 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
35022 	/* Recommended to be used for NIC/L2 traffic only. */
35023 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
35024 	/* Recommended to be used for CNP traffic only. */
35025 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
35026 	/*
35027 	 * This value specifies traffic type for the service profile. We can
35028 	 * have a TC mapped to multiple traffic types. For example shared
35029 	 * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
35030 	 * A value of zero is considered as invalid.
35031 	 */
35032 	uint8_t	queue_id7_service_profile_type;
35033 	/* Recommended to be used for RoCE traffic only. */
35034 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_ROCE	UINT32_C(0x1)
35035 	/* Recommended to be used for NIC/L2 traffic only. */
35036 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_NIC	UINT32_C(0x2)
35037 	/* Recommended to be used for CNP traffic only. */
35038 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_CNP	UINT32_C(0x4)
35039 	/*
35040 	 * This field is used in Output records to indicate that the output
35041 	 * is completely written to RAM. This field should be read as '1'
35042 	 * to indicate that the output has been completely written. When
35043 	 * writing a command completion or response to an internal processor,
35044 	 * the order of writes has to be such that this field is written last.
35045 	 */
35046 	uint8_t	valid;
35047 } hwrm_queue_qportcfg_output_t, *phwrm_queue_qportcfg_output_t;
35048 
35049 /*******************
35050  * hwrm_queue_qcfg *
35051  *******************/
35052 
35053 
35054 /* hwrm_queue_qcfg_input (size:192b/24B) */
35055 
35056 typedef struct hwrm_queue_qcfg_input {
35057 	/* The HWRM command request type. */
35058 	uint16_t	req_type;
35059 	/*
35060 	 * The completion ring to send the completion event on. This should
35061 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
35062 	 */
35063 	uint16_t	cmpl_ring;
35064 	/*
35065 	 * The sequence ID is used by the driver for tracking multiple
35066 	 * commands. This ID is treated as opaque data by the firmware and
35067 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
35068 	 */
35069 	uint16_t	seq_id;
35070 	/*
35071 	 * The target ID of the command:
35072 	 * * 0x0-0xFFF8 - The function ID
35073 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35074 	 * * 0xFFFD - Reserved for user-space HWRM interface
35075 	 * * 0xFFFF - HWRM
35076 	 */
35077 	uint16_t	target_id;
35078 	/*
35079 	 * A physical address pointer pointing to a host buffer that the
35080 	 * command's response data will be written. This can be either a host
35081 	 * physical address (HPA) or a guest physical address (GPA) and must
35082 	 * point to a physically contiguous block of memory.
35083 	 */
35084 	uint64_t	resp_addr;
35085 	uint32_t	flags;
35086 	/*
35087 	 * Enumeration denoting the RX, TX type of the resource.
35088 	 * This enumeration is used for resources that are similar for both
35089 	 * TX and RX paths of the chip.
35090 	 */
35091 	#define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
35092 	/* tx path */
35093 		#define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
35094 	/* rx path */
35095 		#define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
35096 		#define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
35097 	/* Queue ID of the queue. */
35098 	uint32_t	queue_id;
35099 } hwrm_queue_qcfg_input_t, *phwrm_queue_qcfg_input_t;
35100 
35101 /* hwrm_queue_qcfg_output (size:128b/16B) */
35102 
35103 typedef struct hwrm_queue_qcfg_output {
35104 	/* The specific error status for the command. */
35105 	uint16_t	error_code;
35106 	/* The HWRM command request type. */
35107 	uint16_t	req_type;
35108 	/* The sequence ID from the original command. */
35109 	uint16_t	seq_id;
35110 	/* The length of the response data in number of bytes. */
35111 	uint16_t	resp_len;
35112 	/*
35113 	 * This value is the estimate packet length used in the
35114 	 * TX arbiter.
35115 	 */
35116 	uint32_t	queue_len;
35117 	/* This value is applicable to CoS queues only. */
35118 	uint8_t	service_profile;
35119 	/* Lossy (best-effort) */
35120 	#define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
35121 	/* Lossless */
35122 	#define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
35123 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
35124 	#define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
35125 	#define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LAST	HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN
35126 	/* Information about queue configuration. */
35127 	uint8_t	queue_cfg_info;
35128 	/*
35129 	 * If this flag is set to '1', then the queue is
35130 	 * configured asymmetrically on TX and RX sides.
35131 	 * If this flag is set to '0', then this queue is
35132 	 * configured symmetrically on TX and RX sides.
35133 	 */
35134 	#define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG	UINT32_C(0x1)
35135 	uint8_t	unused_0;
35136 	/*
35137 	 * This field is used in Output records to indicate that the output
35138 	 * is completely written to RAM. This field should be read as '1'
35139 	 * to indicate that the output has been completely written. When
35140 	 * writing a command completion or response to an internal processor,
35141 	 * the order of writes has to be such that this field is written last.
35142 	 */
35143 	uint8_t	valid;
35144 } hwrm_queue_qcfg_output_t, *phwrm_queue_qcfg_output_t;
35145 
35146 /******************
35147  * hwrm_queue_cfg *
35148  ******************/
35149 
35150 
35151 /* hwrm_queue_cfg_input (size:320b/40B) */
35152 
35153 typedef struct hwrm_queue_cfg_input {
35154 	/* The HWRM command request type. */
35155 	uint16_t	req_type;
35156 	/*
35157 	 * The completion ring to send the completion event on. This should
35158 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
35159 	 */
35160 	uint16_t	cmpl_ring;
35161 	/*
35162 	 * The sequence ID is used by the driver for tracking multiple
35163 	 * commands. This ID is treated as opaque data by the firmware and
35164 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
35165 	 */
35166 	uint16_t	seq_id;
35167 	/*
35168 	 * The target ID of the command:
35169 	 * * 0x0-0xFFF8 - The function ID
35170 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35171 	 * * 0xFFFD - Reserved for user-space HWRM interface
35172 	 * * 0xFFFF - HWRM
35173 	 */
35174 	uint16_t	target_id;
35175 	/*
35176 	 * A physical address pointer pointing to a host buffer that the
35177 	 * command's response data will be written. This can be either a host
35178 	 * physical address (HPA) or a guest physical address (GPA) and must
35179 	 * point to a physically contiguous block of memory.
35180 	 */
35181 	uint64_t	resp_addr;
35182 	uint32_t	flags;
35183 	/*
35184 	 * Enumeration denoting the RX, TX, or both directions applicable to
35185 	 * the resource. This enumeration is used for resources that are
35186 	 * similar for both TX and RX paths of the chip.
35187 	 */
35188 	#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
35189 	#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT  0
35190 	/* tx path */
35191 		#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
35192 	/* rx path */
35193 		#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
35194 	/* Bi-directional (Symmetrically applicable to TX and RX paths) */
35195 		#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
35196 		#define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST  HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR
35197 	uint32_t	enables;
35198 	/*
35199 	 * This bit must be '1' for the dflt_len field to be
35200 	 * configured.
35201 	 */
35202 	#define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN		UINT32_C(0x1)
35203 	/*
35204 	 * This bit must be '1' for the service_profile field to be
35205 	 * configured.
35206 	 */
35207 	#define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE	UINT32_C(0x2)
35208 	/* Queue ID of queue that is to be configured by this function. */
35209 	uint32_t	queue_id;
35210 	/*
35211 	 * This value is a the estimate packet length used in the
35212 	 * TX arbiter.
35213 	 * Set to 0xFF... (All Fs) to not adjust this value.
35214 	 */
35215 	uint32_t	dflt_len;
35216 	/* This value is applicable to CoS queues only. */
35217 	uint8_t	service_profile;
35218 	/* Lossy (best-effort) */
35219 	#define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY	UINT32_C(0x0)
35220 	/* Lossless */
35221 	#define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
35222 	/* Set to 0xFF... (All Fs) if there is no service profile specified */
35223 	#define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
35224 	#define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST	HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN
35225 	uint8_t	unused_0[7];
35226 } hwrm_queue_cfg_input_t, *phwrm_queue_cfg_input_t;
35227 
35228 /* hwrm_queue_cfg_output (size:128b/16B) */
35229 
35230 typedef struct hwrm_queue_cfg_output {
35231 	/* The specific error status for the command. */
35232 	uint16_t	error_code;
35233 	/* The HWRM command request type. */
35234 	uint16_t	req_type;
35235 	/* The sequence ID from the original command. */
35236 	uint16_t	seq_id;
35237 	/* The length of the response data in number of bytes. */
35238 	uint16_t	resp_len;
35239 	uint8_t	unused_0[7];
35240 	/*
35241 	 * This field is used in Output records to indicate that the output
35242 	 * is completely written to RAM. This field should be read as '1'
35243 	 * to indicate that the output has been completely written. When
35244 	 * writing a command completion or response to an internal processor,
35245 	 * the order of writes has to be such that this field is written last.
35246 	 */
35247 	uint8_t	valid;
35248 } hwrm_queue_cfg_output_t, *phwrm_queue_cfg_output_t;
35249 
35250 /*****************************
35251  * hwrm_queue_pfcenable_qcfg *
35252  *****************************/
35253 
35254 
35255 /* hwrm_queue_pfcenable_qcfg_input (size:192b/24B) */
35256 
35257 typedef struct hwrm_queue_pfcenable_qcfg_input {
35258 	/* The HWRM command request type. */
35259 	uint16_t	req_type;
35260 	/*
35261 	 * The completion ring to send the completion event on. This should
35262 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
35263 	 */
35264 	uint16_t	cmpl_ring;
35265 	/*
35266 	 * The sequence ID is used by the driver for tracking multiple
35267 	 * commands. This ID is treated as opaque data by the firmware and
35268 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
35269 	 */
35270 	uint16_t	seq_id;
35271 	/*
35272 	 * The target ID of the command:
35273 	 * * 0x0-0xFFF8 - The function ID
35274 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35275 	 * * 0xFFFD - Reserved for user-space HWRM interface
35276 	 * * 0xFFFF - HWRM
35277 	 */
35278 	uint16_t	target_id;
35279 	/*
35280 	 * A physical address pointer pointing to a host buffer that the
35281 	 * command's response data will be written. This can be either a host
35282 	 * physical address (HPA) or a guest physical address (GPA) and must
35283 	 * point to a physically contiguous block of memory.
35284 	 */
35285 	uint64_t	resp_addr;
35286 	/*
35287 	 * Port ID of port for which the table is being configured.
35288 	 * The HWRM needs to check whether this function is allowed
35289 	 * to configure pri2cos mapping on this port.
35290 	 */
35291 	uint16_t	port_id;
35292 	uint8_t	unused_0[6];
35293 } hwrm_queue_pfcenable_qcfg_input_t, *phwrm_queue_pfcenable_qcfg_input_t;
35294 
35295 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */
35296 
35297 typedef struct hwrm_queue_pfcenable_qcfg_output {
35298 	/* The specific error status for the command. */
35299 	uint16_t	error_code;
35300 	/* The HWRM command request type. */
35301 	uint16_t	req_type;
35302 	/* The sequence ID from the original command. */
35303 	uint16_t	seq_id;
35304 	/* The length of the response data in number of bytes. */
35305 	uint16_t	resp_len;
35306 	uint32_t	flags;
35307 	/* If set to 1, then PFC is enabled on PRI 0. */
35308 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED		UINT32_C(0x1)
35309 	/* If set to 1, then PFC is enabled on PRI 1. */
35310 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED		UINT32_C(0x2)
35311 	/* If set to 1, then PFC is enabled on PRI 2. */
35312 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED		UINT32_C(0x4)
35313 	/* If set to 1, then PFC is enabled on PRI 3. */
35314 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED		UINT32_C(0x8)
35315 	/* If set to 1, then PFC is enabled on PRI 4. */
35316 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED		UINT32_C(0x10)
35317 	/* If set to 1, then PFC is enabled on PRI 5. */
35318 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED		UINT32_C(0x20)
35319 	/* If set to 1, then PFC is enabled on PRI 6. */
35320 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED		UINT32_C(0x40)
35321 	/* If set to 1, then PFC is enabled on PRI 7. */
35322 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED		UINT32_C(0x80)
35323 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI0. */
35324 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_WATCHDOG_ENABLED	UINT32_C(0x100)
35325 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI1. */
35326 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_WATCHDOG_ENABLED	UINT32_C(0x200)
35327 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI2. */
35328 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_WATCHDOG_ENABLED	UINT32_C(0x400)
35329 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI3. */
35330 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_WATCHDOG_ENABLED	UINT32_C(0x800)
35331 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI4. */
35332 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_WATCHDOG_ENABLED	UINT32_C(0x1000)
35333 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI5. */
35334 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_WATCHDOG_ENABLED	UINT32_C(0x2000)
35335 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI6. */
35336 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_WATCHDOG_ENABLED	UINT32_C(0x4000)
35337 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI7. */
35338 	#define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_WATCHDOG_ENABLED	UINT32_C(0x8000)
35339 	uint8_t	unused_0[3];
35340 	/*
35341 	 * This field is used in Output records to indicate that the output
35342 	 * is completely written to RAM. This field should be read as '1'
35343 	 * to indicate that the output has been completely written. When
35344 	 * writing a command completion or response to an internal processor,
35345 	 * the order of writes has to be such that this field is written last.
35346 	 */
35347 	uint8_t	valid;
35348 } hwrm_queue_pfcenable_qcfg_output_t, *phwrm_queue_pfcenable_qcfg_output_t;
35349 
35350 /****************************
35351  * hwrm_queue_pfcenable_cfg *
35352  ****************************/
35353 
35354 
35355 /* hwrm_queue_pfcenable_cfg_input (size:192b/24B) */
35356 
35357 typedef struct hwrm_queue_pfcenable_cfg_input {
35358 	/* The HWRM command request type. */
35359 	uint16_t	req_type;
35360 	/*
35361 	 * The completion ring to send the completion event on. This should
35362 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
35363 	 */
35364 	uint16_t	cmpl_ring;
35365 	/*
35366 	 * The sequence ID is used by the driver for tracking multiple
35367 	 * commands. This ID is treated as opaque data by the firmware and
35368 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
35369 	 */
35370 	uint16_t	seq_id;
35371 	/*
35372 	 * The target ID of the command:
35373 	 * * 0x0-0xFFF8 - The function ID
35374 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35375 	 * * 0xFFFD - Reserved for user-space HWRM interface
35376 	 * * 0xFFFF - HWRM
35377 	 */
35378 	uint16_t	target_id;
35379 	/*
35380 	 * A physical address pointer pointing to a host buffer that the
35381 	 * command's response data will be written. This can be either a host
35382 	 * physical address (HPA) or a guest physical address (GPA) and must
35383 	 * point to a physically contiguous block of memory.
35384 	 */
35385 	uint64_t	resp_addr;
35386 	uint32_t	flags;
35387 	/* If set to 1, then PFC is requested to be enabled on PRI 0. */
35388 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED		UINT32_C(0x1)
35389 	/* If set to 1, then PFC is requested to be enabled on PRI 1. */
35390 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED		UINT32_C(0x2)
35391 	/* If set to 1, then PFC is requested to be enabled on PRI 2. */
35392 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED		UINT32_C(0x4)
35393 	/* If set to 1, then PFC is requested to be enabled on PRI 3. */
35394 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED		UINT32_C(0x8)
35395 	/* If set to 1, then PFC is requested to be enabled on PRI 4. */
35396 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED		UINT32_C(0x10)
35397 	/* If set to 1, then PFC is requested to be enabled on PRI 5. */
35398 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED		UINT32_C(0x20)
35399 	/* If set to 1, then PFC is requested to be enabled on PRI 6. */
35400 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED		UINT32_C(0x40)
35401 	/* If set to 1, then PFC is requested to be enabled on PRI 7. */
35402 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED		UINT32_C(0x80)
35403 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI0. */
35404 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_WATCHDOG_ENABLED	UINT32_C(0x100)
35405 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI1. */
35406 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_WATCHDOG_ENABLED	UINT32_C(0x200)
35407 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI2. */
35408 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_WATCHDOG_ENABLED	UINT32_C(0x400)
35409 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI3. */
35410 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_WATCHDOG_ENABLED	UINT32_C(0x800)
35411 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI4. */
35412 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_WATCHDOG_ENABLED	UINT32_C(0x1000)
35413 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI5. */
35414 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_WATCHDOG_ENABLED	UINT32_C(0x2000)
35415 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI6. */
35416 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_WATCHDOG_ENABLED	UINT32_C(0x4000)
35417 	/* If set to 1, then PFC WatchDog is requested to be enabled on PRI7. */
35418 	#define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_WATCHDOG_ENABLED	UINT32_C(0x8000)
35419 	/*
35420 	 * Port ID of port for which the table is being configured.
35421 	 * The HWRM needs to check whether this function is allowed
35422 	 * to configure pri2cos mapping on this port.
35423 	 */
35424 	uint16_t	port_id;
35425 	uint8_t	unused_0[2];
35426 } hwrm_queue_pfcenable_cfg_input_t, *phwrm_queue_pfcenable_cfg_input_t;
35427 
35428 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */
35429 
35430 typedef struct hwrm_queue_pfcenable_cfg_output {
35431 	/* The specific error status for the command. */
35432 	uint16_t	error_code;
35433 	/* The HWRM command request type. */
35434 	uint16_t	req_type;
35435 	/* The sequence ID from the original command. */
35436 	uint16_t	seq_id;
35437 	/* The length of the response data in number of bytes. */
35438 	uint16_t	resp_len;
35439 	uint8_t	unused_0[7];
35440 	/*
35441 	 * This field is used in Output records to indicate that the output
35442 	 * is completely written to RAM. This field should be read as '1'
35443 	 * to indicate that the output has been completely written. When
35444 	 * writing a command completion or response to an internal processor,
35445 	 * the order of writes has to be such that this field is written last.
35446 	 */
35447 	uint8_t	valid;
35448 } hwrm_queue_pfcenable_cfg_output_t, *phwrm_queue_pfcenable_cfg_output_t;
35449 
35450 /***************************
35451  * hwrm_queue_pri2cos_qcfg *
35452  ***************************/
35453 
35454 
35455 /* hwrm_queue_pri2cos_qcfg_input (size:192b/24B) */
35456 
35457 typedef struct hwrm_queue_pri2cos_qcfg_input {
35458 	/* The HWRM command request type. */
35459 	uint16_t	req_type;
35460 	/*
35461 	 * The completion ring to send the completion event on. This should
35462 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
35463 	 */
35464 	uint16_t	cmpl_ring;
35465 	/*
35466 	 * The sequence ID is used by the driver for tracking multiple
35467 	 * commands. This ID is treated as opaque data by the firmware and
35468 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
35469 	 */
35470 	uint16_t	seq_id;
35471 	/*
35472 	 * The target ID of the command:
35473 	 * * 0x0-0xFFF8 - The function ID
35474 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35475 	 * * 0xFFFD - Reserved for user-space HWRM interface
35476 	 * * 0xFFFF - HWRM
35477 	 */
35478 	uint16_t	target_id;
35479 	/*
35480 	 * A physical address pointer pointing to a host buffer that the
35481 	 * command's response data will be written. This can be either a host
35482 	 * physical address (HPA) or a guest physical address (GPA) and must
35483 	 * point to a physically contiguous block of memory.
35484 	 */
35485 	uint64_t	resp_addr;
35486 	uint32_t	flags;
35487 	/*
35488 	 * Enumeration denoting the RX, TX type of the resource.
35489 	 * This enumeration is used for resources that are similar for both
35490 	 * TX and RX paths of the chip.
35491 	 */
35492 	#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
35493 	/* tx path */
35494 		#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
35495 	/* rx path */
35496 		#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
35497 		#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST  HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX
35498 	/*
35499 	 * When this bit is set to '0', the query is
35500 	 * for PRI from tunnel headers.
35501 	 * When this bit is set to '1', the query is
35502 	 * for PRI from inner packet headers.
35503 	 */
35504 	#define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN	UINT32_C(0x2)
35505 	/*
35506 	 * Port ID of port for which the table is being configured.
35507 	 * The HWRM needs to check whether this function is allowed
35508 	 * to configure pri2cos mapping on this port.
35509 	 */
35510 	uint8_t	port_id;
35511 	uint8_t	unused_0[3];
35512 } hwrm_queue_pri2cos_qcfg_input_t, *phwrm_queue_pri2cos_qcfg_input_t;
35513 
35514 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */
35515 
35516 typedef struct hwrm_queue_pri2cos_qcfg_output {
35517 	/* The specific error status for the command. */
35518 	uint16_t	error_code;
35519 	/* The HWRM command request type. */
35520 	uint16_t	req_type;
35521 	/* The sequence ID from the original command. */
35522 	uint16_t	seq_id;
35523 	/* The length of the response data in number of bytes. */
35524 	uint16_t	resp_len;
35525 	/*
35526 	 * CoS Queue assigned to priority 0. This value can only
35527 	 * be changed before traffic has started.
35528 	 * A value of 0xff indicates that no CoS queue is assigned to the
35529 	 * specified priority.
35530 	 */
35531 	uint8_t	pri0_cos_queue_id;
35532 	/*
35533 	 * CoS Queue assigned to priority 1. This value can only
35534 	 * be changed before traffic has started.
35535 	 * A value of 0xff indicates that no CoS queue is assigned to the
35536 	 * specified priority.
35537 	 */
35538 	uint8_t	pri1_cos_queue_id;
35539 	/*
35540 	 * CoS Queue assigned to priority 2. This value can only
35541 	 * be changed before traffic has started.
35542 	 * A value of 0xff indicates that no CoS queue is assigned to the
35543 	 * specified priority.
35544 	 */
35545 	uint8_t	pri2_cos_queue_id;
35546 	/*
35547 	 * CoS Queue assigned to priority 3. This value can only
35548 	 * be changed before traffic has started.
35549 	 * A value of 0xff indicates that no CoS queue is assigned to the
35550 	 * specified priority.
35551 	 */
35552 	uint8_t	pri3_cos_queue_id;
35553 	/*
35554 	 * CoS Queue assigned to priority 4. This value can only
35555 	 * be changed before traffic has started.
35556 	 * A value of 0xff indicates that no CoS queue is assigned to the
35557 	 * specified priority.
35558 	 */
35559 	uint8_t	pri4_cos_queue_id;
35560 	/*
35561 	 * CoS Queue assigned to priority 5. This value can only
35562 	 * be changed before traffic has started.
35563 	 * A value of 0xff indicates that no CoS queue is assigned to the
35564 	 * specified priority.
35565 	 */
35566 	uint8_t	pri5_cos_queue_id;
35567 	/*
35568 	 * CoS Queue assigned to priority 6. This value can only
35569 	 * be changed before traffic has started.
35570 	 * A value of 0xff indicates that no CoS queue is assigned to the
35571 	 * specified priority.
35572 	 */
35573 	uint8_t	pri6_cos_queue_id;
35574 	/*
35575 	 * CoS Queue assigned to priority 7. This value can only
35576 	 * be changed before traffic has started.
35577 	 * A value of 0xff indicates that no CoS queue is assigned to the
35578 	 * specified priority.
35579 	 */
35580 	uint8_t	pri7_cos_queue_id;
35581 	/* Information about queue configuration. */
35582 	uint8_t	queue_cfg_info;
35583 	/*
35584 	 * If this flag is set to '1', then the PRI to CoS
35585 	 * configuration is asymmetric on TX and RX sides.
35586 	 * If this flag is set to '0', then PRI to CoS configuration
35587 	 * is symmetric on TX and RX sides.
35588 	 */
35589 	#define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG	UINT32_C(0x1)
35590 	uint8_t	unused_0[6];
35591 	/*
35592 	 * This field is used in Output records to indicate that the output
35593 	 * is completely written to RAM. This field should be read as '1'
35594 	 * to indicate that the output has been completely written. When
35595 	 * writing a command completion or response to an internal processor,
35596 	 * the order of writes has to be such that this field is written last.
35597 	 */
35598 	uint8_t	valid;
35599 } hwrm_queue_pri2cos_qcfg_output_t, *phwrm_queue_pri2cos_qcfg_output_t;
35600 
35601 /**************************
35602  * hwrm_queue_pri2cos_cfg *
35603  **************************/
35604 
35605 
35606 /* hwrm_queue_pri2cos_cfg_input (size:320b/40B) */
35607 
35608 typedef struct hwrm_queue_pri2cos_cfg_input {
35609 	/* The HWRM command request type. */
35610 	uint16_t	req_type;
35611 	/*
35612 	 * The completion ring to send the completion event on. This should
35613 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
35614 	 */
35615 	uint16_t	cmpl_ring;
35616 	/*
35617 	 * The sequence ID is used by the driver for tracking multiple
35618 	 * commands. This ID is treated as opaque data by the firmware and
35619 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
35620 	 */
35621 	uint16_t	seq_id;
35622 	/*
35623 	 * The target ID of the command:
35624 	 * * 0x0-0xFFF8 - The function ID
35625 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35626 	 * * 0xFFFD - Reserved for user-space HWRM interface
35627 	 * * 0xFFFF - HWRM
35628 	 */
35629 	uint16_t	target_id;
35630 	/*
35631 	 * A physical address pointer pointing to a host buffer that the
35632 	 * command's response data will be written. This can be either a host
35633 	 * physical address (HPA) or a guest physical address (GPA) and must
35634 	 * point to a physically contiguous block of memory.
35635 	 */
35636 	uint64_t	resp_addr;
35637 	uint32_t	flags;
35638 	/*
35639 	 * Enumeration denoting the RX, TX, or both directions applicable to
35640 	 * the resource. This enumeration is used for resources that are
35641 	 * similar for both TX and RX paths of the chip.
35642 	 */
35643 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
35644 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT  0
35645 	/* tx path */
35646 		#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
35647 	/* rx path */
35648 		#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
35649 	/* Bi-directional (Symmetrically applicable to TX and RX paths) */
35650 		#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
35651 		#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST  HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR
35652 	/*
35653 	 * When this bit is set to '0', the mapping is requested
35654 	 * for PRI from tunnel headers.
35655 	 * When this bit is set to '1', the mapping is requested
35656 	 * for PRI from inner packet headers.
35657 	 */
35658 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN	UINT32_C(0x4)
35659 	uint32_t	enables;
35660 	/*
35661 	 * This bit must be '1' for the pri0_cos_queue_id field to be
35662 	 * configured.
35663 	 */
35664 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID	UINT32_C(0x1)
35665 	/*
35666 	 * This bit must be '1' for the pri1_cos_queue_id field to be
35667 	 * configured.
35668 	 */
35669 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID	UINT32_C(0x2)
35670 	/*
35671 	 * This bit must be '1' for the pri2_cos_queue_id field to be
35672 	 * configured.
35673 	 */
35674 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID	UINT32_C(0x4)
35675 	/*
35676 	 * This bit must be '1' for the pri3_cos_queue_id field to be
35677 	 * configured.
35678 	 */
35679 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID	UINT32_C(0x8)
35680 	/*
35681 	 * This bit must be '1' for the pri4_cos_queue_id field to be
35682 	 * configured.
35683 	 */
35684 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID	UINT32_C(0x10)
35685 	/*
35686 	 * This bit must be '1' for the pri5_cos_queue_id field to be
35687 	 * configured.
35688 	 */
35689 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID	UINT32_C(0x20)
35690 	/*
35691 	 * This bit must be '1' for the pri6_cos_queue_id field to be
35692 	 * configured.
35693 	 */
35694 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID	UINT32_C(0x40)
35695 	/*
35696 	 * This bit must be '1' for the pri7_cos_queue_id field to be
35697 	 * configured.
35698 	 */
35699 	#define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID	UINT32_C(0x80)
35700 	/*
35701 	 * Port ID of port for which the table is being configured.
35702 	 * The HWRM needs to check whether this function is allowed
35703 	 * to configure pri2cos mapping on this port.
35704 	 */
35705 	uint8_t	port_id;
35706 	/*
35707 	 * CoS Queue assigned to priority 0. This value can only
35708 	 * be changed before traffic has started.
35709 	 */
35710 	uint8_t	pri0_cos_queue_id;
35711 	/*
35712 	 * CoS Queue assigned to priority 1. This value can only
35713 	 * be changed before traffic has started.
35714 	 */
35715 	uint8_t	pri1_cos_queue_id;
35716 	/*
35717 	 * CoS Queue assigned to priority 2. This value can only
35718 	 * be changed before traffic has started.
35719 	 */
35720 	uint8_t	pri2_cos_queue_id;
35721 	/*
35722 	 * CoS Queue assigned to priority 3. This value can only
35723 	 * be changed before traffic has started.
35724 	 */
35725 	uint8_t	pri3_cos_queue_id;
35726 	/*
35727 	 * CoS Queue assigned to priority 4. This value can only
35728 	 * be changed before traffic has started.
35729 	 */
35730 	uint8_t	pri4_cos_queue_id;
35731 	/*
35732 	 * CoS Queue assigned to priority 5. This value can only
35733 	 * be changed before traffic has started.
35734 	 */
35735 	uint8_t	pri5_cos_queue_id;
35736 	/*
35737 	 * CoS Queue assigned to priority 6. This value can only
35738 	 * be changed before traffic has started.
35739 	 */
35740 	uint8_t	pri6_cos_queue_id;
35741 	/*
35742 	 * CoS Queue assigned to priority 7. This value can only
35743 	 * be changed before traffic has started.
35744 	 */
35745 	uint8_t	pri7_cos_queue_id;
35746 	uint8_t	unused_0[7];
35747 } hwrm_queue_pri2cos_cfg_input_t, *phwrm_queue_pri2cos_cfg_input_t;
35748 
35749 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */
35750 
35751 typedef struct hwrm_queue_pri2cos_cfg_output {
35752 	/* The specific error status for the command. */
35753 	uint16_t	error_code;
35754 	/* The HWRM command request type. */
35755 	uint16_t	req_type;
35756 	/* The sequence ID from the original command. */
35757 	uint16_t	seq_id;
35758 	/* The length of the response data in number of bytes. */
35759 	uint16_t	resp_len;
35760 	uint8_t	unused_0[7];
35761 	/*
35762 	 * This field is used in Output records to indicate that the output
35763 	 * is completely written to RAM. This field should be read as '1'
35764 	 * to indicate that the output has been completely written. When
35765 	 * writing a command completion or response to an internal processor,
35766 	 * the order of writes has to be such that this field is written last.
35767 	 */
35768 	uint8_t	valid;
35769 } hwrm_queue_pri2cos_cfg_output_t, *phwrm_queue_pri2cos_cfg_output_t;
35770 
35771 /**************************
35772  * hwrm_queue_cos2bw_qcfg *
35773  **************************/
35774 
35775 
35776 /* hwrm_queue_cos2bw_qcfg_input (size:192b/24B) */
35777 
35778 typedef struct hwrm_queue_cos2bw_qcfg_input {
35779 	/* The HWRM command request type. */
35780 	uint16_t	req_type;
35781 	/*
35782 	 * The completion ring to send the completion event on. This should
35783 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
35784 	 */
35785 	uint16_t	cmpl_ring;
35786 	/*
35787 	 * The sequence ID is used by the driver for tracking multiple
35788 	 * commands. This ID is treated as opaque data by the firmware and
35789 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
35790 	 */
35791 	uint16_t	seq_id;
35792 	/*
35793 	 * The target ID of the command:
35794 	 * * 0x0-0xFFF8 - The function ID
35795 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35796 	 * * 0xFFFD - Reserved for user-space HWRM interface
35797 	 * * 0xFFFF - HWRM
35798 	 */
35799 	uint16_t	target_id;
35800 	/*
35801 	 * A physical address pointer pointing to a host buffer that the
35802 	 * command's response data will be written. This can be either a host
35803 	 * physical address (HPA) or a guest physical address (GPA) and must
35804 	 * point to a physically contiguous block of memory.
35805 	 */
35806 	uint64_t	resp_addr;
35807 	/*
35808 	 * Port ID of port for which the table is being configured.
35809 	 * The HWRM needs to check whether this function is allowed
35810 	 * to configure TC BW assignment on this port.
35811 	 */
35812 	uint16_t	port_id;
35813 	uint8_t	unused_0[6];
35814 } hwrm_queue_cos2bw_qcfg_input_t, *phwrm_queue_cos2bw_qcfg_input_t;
35815 
35816 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */
35817 
35818 typedef struct hwrm_queue_cos2bw_qcfg_output {
35819 	/* The specific error status for the command. */
35820 	uint16_t	error_code;
35821 	/* The HWRM command request type. */
35822 	uint16_t	req_type;
35823 	/* The sequence ID from the original command. */
35824 	uint16_t	seq_id;
35825 	/* The length of the response data in number of bytes. */
35826 	uint16_t	resp_len;
35827 	/* ID of CoS Queue 0. */
35828 	uint8_t	queue_id0;
35829 	uint8_t	unused_0;
35830 	uint16_t	unused_1;
35831 	/*
35832 	 * Minimum BW allocated to CoS Queue.
35833 	 * The HWRM will translate this value into byte counter and
35834 	 * time interval used for this COS inside the device.
35835 	 */
35836 	uint32_t	queue_id0_min_bw;
35837 	/* The bandwidth value. */
35838 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
35839 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT		0
35840 	/* The granularity of the value (bits or bytes). */
35841 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE			UINT32_C(0x10000000)
35842 	/* Value is in bits. */
35843 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
35844 	/* Value is in bytes. */
35845 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
35846 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
35847 	/* bw_value_unit is 3 b */
35848 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
35849 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT	29
35850 	/* Value is in Mb or MB (base 10). */
35851 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
35852 	/* Value is in Kb or KB (base 10). */
35853 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
35854 	/* Value is in bits or bytes. */
35855 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
35856 	/* Value is in Gb or GB (base 10). */
35857 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
35858 	/* Value is in 1/100th of a percentage of total bandwidth. */
35859 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
35860 	/* Invalid unit */
35861 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
35862 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
35863 	/*
35864 	 * Maximum BW allocated to CoS Queue.
35865 	 * The HWRM will translate this value into byte counter and
35866 	 * time interval used for this COS inside the device.
35867 	 */
35868 	uint32_t	queue_id0_max_bw;
35869 	/* The bandwidth value. */
35870 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
35871 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT		0
35872 	/* The granularity of the value (bits or bytes). */
35873 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE			UINT32_C(0x10000000)
35874 	/* Value is in bits. */
35875 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
35876 	/* Value is in bytes. */
35877 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
35878 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
35879 	/* bw_value_unit is 3 b */
35880 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
35881 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT	29
35882 	/* Value is in Mb or MB (base 10). */
35883 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
35884 	/* Value is in Kb or KB (base 10). */
35885 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
35886 	/* Value is in bits or bytes. */
35887 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
35888 	/* Value is in Gb or GB (base 10). */
35889 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
35890 	/* Value is in 1/100th of a percentage of total bandwidth. */
35891 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
35892 	/* Invalid unit */
35893 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
35894 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
35895 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
35896 	uint8_t	queue_id0_tsa_assign;
35897 	/* Strict Priority */
35898 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP		UINT32_C(0x0)
35899 	/* Enhanced Transmission Selection */
35900 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS		UINT32_C(0x1)
35901 	/* reserved. */
35902 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
35903 	/* reserved. */
35904 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
35905 	/*
35906 	 * Priority level for strict priority. Valid only when the
35907 	 * tsa_assign is 0 - Strict Priority (SP)
35908 	 * 0..7 - Valid values.
35909 	 * 8..255 - Reserved.
35910 	 */
35911 	uint8_t	queue_id0_pri_lvl;
35912 	/*
35913 	 * Weight used to allocate remaining BW for this COS after
35914 	 * servicing guaranteed bandwidths for all COS.
35915 	 */
35916 	uint8_t	queue_id0_bw_weight;
35917 	/* ID of CoS Queue 1. */
35918 	uint8_t	queue_id1;
35919 	/*
35920 	 * Minimum BW allocated to CoS Queue.
35921 	 * The HWRM will translate this value into byte counter and
35922 	 * time interval used for this COS inside the device.
35923 	 */
35924 	uint32_t	queue_id1_min_bw;
35925 	/* The bandwidth value. */
35926 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
35927 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT		0
35928 	/* The granularity of the value (bits or bytes). */
35929 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE			UINT32_C(0x10000000)
35930 	/* Value is in bits. */
35931 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
35932 	/* Value is in bytes. */
35933 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
35934 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
35935 	/* bw_value_unit is 3 b */
35936 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
35937 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT	29
35938 	/* Value is in Mb or MB (base 10). */
35939 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
35940 	/* Value is in Kb or KB (base 10). */
35941 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
35942 	/* Value is in bits or bytes. */
35943 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
35944 	/* Value is in Gb or GB (base 10). */
35945 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
35946 	/* Value is in 1/100th of a percentage of total bandwidth. */
35947 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
35948 	/* Invalid unit */
35949 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
35950 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
35951 	/*
35952 	 * Maximum BW allocated to CoS queue.
35953 	 * The HWRM will translate this value into byte counter and
35954 	 * time interval used for this COS inside the device.
35955 	 */
35956 	uint32_t	queue_id1_max_bw;
35957 	/* The bandwidth value. */
35958 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
35959 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT		0
35960 	/* The granularity of the value (bits or bytes). */
35961 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE			UINT32_C(0x10000000)
35962 	/* Value is in bits. */
35963 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
35964 	/* Value is in bytes. */
35965 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
35966 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
35967 	/* bw_value_unit is 3 b */
35968 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
35969 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT	29
35970 	/* Value is in Mb or MB (base 10). */
35971 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
35972 	/* Value is in Kb or KB (base 10). */
35973 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
35974 	/* Value is in bits or bytes. */
35975 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
35976 	/* Value is in Gb or GB (base 10). */
35977 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
35978 	/* Value is in 1/100th of a percentage of total bandwidth. */
35979 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
35980 	/* Invalid unit */
35981 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
35982 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
35983 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
35984 	uint8_t	queue_id1_tsa_assign;
35985 	/* Strict Priority */
35986 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP		UINT32_C(0x0)
35987 	/* Enhanced Transmission Selection */
35988 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS		UINT32_C(0x1)
35989 	/* reserved. */
35990 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
35991 	/* reserved. */
35992 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
35993 	/*
35994 	 * Priority level for strict priority. Valid only when the
35995 	 * tsa_assign is 0 - Strict Priority (SP)
35996 	 * 0..7 - Valid values.
35997 	 * 8..255 - Reserved.
35998 	 */
35999 	uint8_t	queue_id1_pri_lvl;
36000 	/*
36001 	 * Weight used to allocate remaining BW for this COS after
36002 	 * servicing guaranteed bandwidths for all COS.
36003 	 */
36004 	uint8_t	queue_id1_bw_weight;
36005 	/* ID of CoS Queue 2. */
36006 	uint8_t	queue_id2;
36007 	/*
36008 	 * Minimum BW allocated to CoS Queue.
36009 	 * The HWRM will translate this value into byte counter and
36010 	 * time interval used for this COS inside the device.
36011 	 */
36012 	uint32_t	queue_id2_min_bw;
36013 	/* The bandwidth value. */
36014 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36015 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT		0
36016 	/* The granularity of the value (bits or bytes). */
36017 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE			UINT32_C(0x10000000)
36018 	/* Value is in bits. */
36019 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36020 	/* Value is in bytes. */
36021 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36022 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
36023 	/* bw_value_unit is 3 b */
36024 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36025 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT	29
36026 	/* Value is in Mb or MB (base 10). */
36027 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36028 	/* Value is in Kb or KB (base 10). */
36029 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36030 	/* Value is in bits or bytes. */
36031 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36032 	/* Value is in Gb or GB (base 10). */
36033 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36034 	/* Value is in 1/100th of a percentage of total bandwidth. */
36035 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36036 	/* Invalid unit */
36037 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36038 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
36039 	/*
36040 	 * Maximum BW allocated to CoS queue.
36041 	 * The HWRM will translate this value into byte counter and
36042 	 * time interval used for this COS inside the device.
36043 	 */
36044 	uint32_t	queue_id2_max_bw;
36045 	/* The bandwidth value. */
36046 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36047 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT		0
36048 	/* The granularity of the value (bits or bytes). */
36049 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE			UINT32_C(0x10000000)
36050 	/* Value is in bits. */
36051 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36052 	/* Value is in bytes. */
36053 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36054 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
36055 	/* bw_value_unit is 3 b */
36056 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36057 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT	29
36058 	/* Value is in Mb or MB (base 10). */
36059 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36060 	/* Value is in Kb or KB (base 10). */
36061 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36062 	/* Value is in bits or bytes. */
36063 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36064 	/* Value is in Gb or GB (base 10). */
36065 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36066 	/* Value is in 1/100th of a percentage of total bandwidth. */
36067 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36068 	/* Invalid unit */
36069 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36070 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
36071 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
36072 	uint8_t	queue_id2_tsa_assign;
36073 	/* Strict Priority */
36074 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP		UINT32_C(0x0)
36075 	/* Enhanced Transmission Selection */
36076 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS		UINT32_C(0x1)
36077 	/* reserved. */
36078 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
36079 	/* reserved. */
36080 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
36081 	/*
36082 	 * Priority level for strict priority. Valid only when the
36083 	 * tsa_assign is 0 - Strict Priority (SP)
36084 	 * 0..7 - Valid values.
36085 	 * 8..255 - Reserved.
36086 	 */
36087 	uint8_t	queue_id2_pri_lvl;
36088 	/*
36089 	 * Weight used to allocate remaining BW for this COS after
36090 	 * servicing guaranteed bandwidths for all COS.
36091 	 */
36092 	uint8_t	queue_id2_bw_weight;
36093 	/* ID of CoS Queue 3. */
36094 	uint8_t	queue_id3;
36095 	/*
36096 	 * Minimum BW allocated to CoS Queue.
36097 	 * The HWRM will translate this value into byte counter and
36098 	 * time interval used for this COS inside the device.
36099 	 */
36100 	uint32_t	queue_id3_min_bw;
36101 	/* The bandwidth value. */
36102 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36103 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT		0
36104 	/* The granularity of the value (bits or bytes). */
36105 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE			UINT32_C(0x10000000)
36106 	/* Value is in bits. */
36107 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36108 	/* Value is in bytes. */
36109 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36110 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
36111 	/* bw_value_unit is 3 b */
36112 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36113 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT	29
36114 	/* Value is in Mb or MB (base 10). */
36115 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36116 	/* Value is in Kb or KB (base 10). */
36117 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36118 	/* Value is in bits or bytes. */
36119 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36120 	/* Value is in Gb or GB (base 10). */
36121 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36122 	/* Value is in 1/100th of a percentage of total bandwidth. */
36123 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36124 	/* Invalid unit */
36125 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36126 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
36127 	/*
36128 	 * Maximum BW allocated to CoS queue.
36129 	 * The HWRM will translate this value into byte counter and
36130 	 * time interval used for this COS inside the device.
36131 	 */
36132 	uint32_t	queue_id3_max_bw;
36133 	/* The bandwidth value. */
36134 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36135 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT		0
36136 	/* The granularity of the value (bits or bytes). */
36137 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE			UINT32_C(0x10000000)
36138 	/* Value is in bits. */
36139 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36140 	/* Value is in bytes. */
36141 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36142 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
36143 	/* bw_value_unit is 3 b */
36144 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36145 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT	29
36146 	/* Value is in Mb or MB (base 10). */
36147 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36148 	/* Value is in Kb or KB (base 10). */
36149 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36150 	/* Value is in bits or bytes. */
36151 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36152 	/* Value is in Gb or GB (base 10). */
36153 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36154 	/* Value is in 1/100th of a percentage of total bandwidth. */
36155 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36156 	/* Invalid unit */
36157 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36158 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
36159 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
36160 	uint8_t	queue_id3_tsa_assign;
36161 	/* Strict Priority */
36162 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP		UINT32_C(0x0)
36163 	/* Enhanced Transmission Selection */
36164 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS		UINT32_C(0x1)
36165 	/* reserved. */
36166 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
36167 	/* reserved. */
36168 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
36169 	/*
36170 	 * Priority level for strict priority. Valid only when the
36171 	 * tsa_assign is 0 - Strict Priority (SP)
36172 	 * 0..7 - Valid values.
36173 	 * 8..255 - Reserved.
36174 	 */
36175 	uint8_t	queue_id3_pri_lvl;
36176 	/*
36177 	 * Weight used to allocate remaining BW for this COS after
36178 	 * servicing guaranteed bandwidths for all COS.
36179 	 */
36180 	uint8_t	queue_id3_bw_weight;
36181 	/* ID of CoS Queue 4. */
36182 	uint8_t	queue_id4;
36183 	/*
36184 	 * Minimum BW allocated to CoS Queue.
36185 	 * The HWRM will translate this value into byte counter and
36186 	 * time interval used for this COS inside the device.
36187 	 */
36188 	uint32_t	queue_id4_min_bw;
36189 	/* The bandwidth value. */
36190 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36191 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT		0
36192 	/* The granularity of the value (bits or bytes). */
36193 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE			UINT32_C(0x10000000)
36194 	/* Value is in bits. */
36195 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36196 	/* Value is in bytes. */
36197 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36198 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
36199 	/* bw_value_unit is 3 b */
36200 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36201 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT	29
36202 	/* Value is in Mb or MB (base 10). */
36203 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36204 	/* Value is in Kb or KB (base 10). */
36205 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36206 	/* Value is in bits or bytes. */
36207 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36208 	/* Value is in Gb or GB (base 10). */
36209 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36210 	/* Value is in 1/100th of a percentage of total bandwidth. */
36211 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36212 	/* Invalid unit */
36213 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36214 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
36215 	/*
36216 	 * Maximum BW allocated to CoS queue.
36217 	 * The HWRM will translate this value into byte counter and
36218 	 * time interval used for this COS inside the device.
36219 	 */
36220 	uint32_t	queue_id4_max_bw;
36221 	/* The bandwidth value. */
36222 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36223 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT		0
36224 	/* The granularity of the value (bits or bytes). */
36225 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE			UINT32_C(0x10000000)
36226 	/* Value is in bits. */
36227 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36228 	/* Value is in bytes. */
36229 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36230 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
36231 	/* bw_value_unit is 3 b */
36232 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36233 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT	29
36234 	/* Value is in Mb or MB (base 10). */
36235 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36236 	/* Value is in Kb or KB (base 10). */
36237 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36238 	/* Value is in bits or bytes. */
36239 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36240 	/* Value is in Gb or GB (base 10). */
36241 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36242 	/* Value is in 1/100th of a percentage of total bandwidth. */
36243 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36244 	/* Invalid unit */
36245 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36246 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
36247 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
36248 	uint8_t	queue_id4_tsa_assign;
36249 	/* Strict Priority */
36250 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP		UINT32_C(0x0)
36251 	/* Enhanced Transmission Selection */
36252 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS		UINT32_C(0x1)
36253 	/* reserved. */
36254 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
36255 	/* reserved. */
36256 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
36257 	/*
36258 	 * Priority level for strict priority. Valid only when the
36259 	 * tsa_assign is 0 - Strict Priority (SP)
36260 	 * 0..7 - Valid values.
36261 	 * 8..255 - Reserved.
36262 	 */
36263 	uint8_t	queue_id4_pri_lvl;
36264 	/*
36265 	 * Weight used to allocate remaining BW for this COS after
36266 	 * servicing guaranteed bandwidths for all COS.
36267 	 */
36268 	uint8_t	queue_id4_bw_weight;
36269 	/* ID of CoS Queue 5. */
36270 	uint8_t	queue_id5;
36271 	/*
36272 	 * Minimum BW allocated to CoS Queue.
36273 	 * The HWRM will translate this value into byte counter and
36274 	 * time interval used for this COS inside the device.
36275 	 */
36276 	uint32_t	queue_id5_min_bw;
36277 	/* The bandwidth value. */
36278 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36279 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT		0
36280 	/* The granularity of the value (bits or bytes). */
36281 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE			UINT32_C(0x10000000)
36282 	/* Value is in bits. */
36283 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36284 	/* Value is in bytes. */
36285 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36286 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
36287 	/* bw_value_unit is 3 b */
36288 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36289 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT	29
36290 	/* Value is in Mb or MB (base 10). */
36291 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36292 	/* Value is in Kb or KB (base 10). */
36293 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36294 	/* Value is in bits or bytes. */
36295 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36296 	/* Value is in Gb or GB (base 10). */
36297 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36298 	/* Value is in 1/100th of a percentage of total bandwidth. */
36299 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36300 	/* Invalid unit */
36301 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36302 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
36303 	/*
36304 	 * Maximum BW allocated to CoS queue.
36305 	 * The HWRM will translate this value into byte counter and
36306 	 * time interval used for this COS inside the device.
36307 	 */
36308 	uint32_t	queue_id5_max_bw;
36309 	/* The bandwidth value. */
36310 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36311 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT		0
36312 	/* The granularity of the value (bits or bytes). */
36313 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE			UINT32_C(0x10000000)
36314 	/* Value is in bits. */
36315 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36316 	/* Value is in bytes. */
36317 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36318 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
36319 	/* bw_value_unit is 3 b */
36320 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36321 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT	29
36322 	/* Value is in Mb or MB (base 10). */
36323 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36324 	/* Value is in Kb or KB (base 10). */
36325 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36326 	/* Value is in bits or bytes. */
36327 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36328 	/* Value is in Gb or GB (base 10). */
36329 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36330 	/* Value is in 1/100th of a percentage of total bandwidth. */
36331 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36332 	/* Invalid unit */
36333 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36334 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
36335 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
36336 	uint8_t	queue_id5_tsa_assign;
36337 	/* Strict Priority */
36338 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP		UINT32_C(0x0)
36339 	/* Enhanced Transmission Selection */
36340 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS		UINT32_C(0x1)
36341 	/* reserved. */
36342 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
36343 	/* reserved. */
36344 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
36345 	/*
36346 	 * Priority level for strict priority. Valid only when the
36347 	 * tsa_assign is 0 - Strict Priority (SP)
36348 	 * 0..7 - Valid values.
36349 	 * 8..255 - Reserved.
36350 	 */
36351 	uint8_t	queue_id5_pri_lvl;
36352 	/*
36353 	 * Weight used to allocate remaining BW for this COS after
36354 	 * servicing guaranteed bandwidths for all COS.
36355 	 */
36356 	uint8_t	queue_id5_bw_weight;
36357 	/* ID of CoS Queue 6. */
36358 	uint8_t	queue_id6;
36359 	/*
36360 	 * Minimum BW allocated to CoS Queue.
36361 	 * The HWRM will translate this value into byte counter and
36362 	 * time interval used for this COS inside the device.
36363 	 */
36364 	uint32_t	queue_id6_min_bw;
36365 	/* The bandwidth value. */
36366 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36367 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT		0
36368 	/* The granularity of the value (bits or bytes). */
36369 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE			UINT32_C(0x10000000)
36370 	/* Value is in bits. */
36371 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36372 	/* Value is in bytes. */
36373 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36374 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
36375 	/* bw_value_unit is 3 b */
36376 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36377 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT	29
36378 	/* Value is in Mb or MB (base 10). */
36379 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36380 	/* Value is in Kb or KB (base 10). */
36381 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36382 	/* Value is in bits or bytes. */
36383 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36384 	/* Value is in Gb or GB (base 10). */
36385 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36386 	/* Value is in 1/100th of a percentage of total bandwidth. */
36387 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36388 	/* Invalid unit */
36389 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36390 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
36391 	/*
36392 	 * Maximum BW allocated to CoS queue.
36393 	 * The HWRM will translate this value into byte counter and
36394 	 * time interval used for this COS inside the device.
36395 	 */
36396 	uint32_t	queue_id6_max_bw;
36397 	/* The bandwidth value. */
36398 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36399 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT		0
36400 	/* The granularity of the value (bits or bytes). */
36401 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE			UINT32_C(0x10000000)
36402 	/* Value is in bits. */
36403 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36404 	/* Value is in bytes. */
36405 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36406 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
36407 	/* bw_value_unit is 3 b */
36408 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36409 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT	29
36410 	/* Value is in Mb or MB (base 10). */
36411 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36412 	/* Value is in Kb or KB (base 10). */
36413 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36414 	/* Value is in bits or bytes. */
36415 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36416 	/* Value is in Gb or GB (base 10). */
36417 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36418 	/* Value is in 1/100th of a percentage of total bandwidth. */
36419 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36420 	/* Invalid unit */
36421 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36422 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
36423 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
36424 	uint8_t	queue_id6_tsa_assign;
36425 	/* Strict Priority */
36426 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP		UINT32_C(0x0)
36427 	/* Enhanced Transmission Selection */
36428 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS		UINT32_C(0x1)
36429 	/* reserved. */
36430 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
36431 	/* reserved. */
36432 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
36433 	/*
36434 	 * Priority level for strict priority. Valid only when the
36435 	 * tsa_assign is 0 - Strict Priority (SP)
36436 	 * 0..7 - Valid values.
36437 	 * 8..255 - Reserved.
36438 	 */
36439 	uint8_t	queue_id6_pri_lvl;
36440 	/*
36441 	 * Weight used to allocate remaining BW for this COS after
36442 	 * servicing guaranteed bandwidths for all COS.
36443 	 */
36444 	uint8_t	queue_id6_bw_weight;
36445 	/* ID of CoS Queue 7. */
36446 	uint8_t	queue_id7;
36447 	/*
36448 	 * Minimum BW allocated to CoS Queue.
36449 	 * The HWRM will translate this value into byte counter and
36450 	 * time interval used for this COS inside the device.
36451 	 */
36452 	uint32_t	queue_id7_min_bw;
36453 	/* The bandwidth value. */
36454 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36455 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT		0
36456 	/* The granularity of the value (bits or bytes). */
36457 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE			UINT32_C(0x10000000)
36458 	/* Value is in bits. */
36459 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36460 	/* Value is in bytes. */
36461 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36462 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
36463 	/* bw_value_unit is 3 b */
36464 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36465 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT	29
36466 	/* Value is in Mb or MB (base 10). */
36467 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36468 	/* Value is in Kb or KB (base 10). */
36469 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36470 	/* Value is in bits or bytes. */
36471 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36472 	/* Value is in Gb or GB (base 10). */
36473 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36474 	/* Value is in 1/100th of a percentage of total bandwidth. */
36475 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36476 	/* Invalid unit */
36477 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36478 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
36479 	/*
36480 	 * Maximum BW allocated to CoS queue.
36481 	 * The HWRM will translate this value into byte counter and
36482 	 * time interval used for this COS inside the device.
36483 	 */
36484 	uint32_t	queue_id7_max_bw;
36485 	/* The bandwidth value. */
36486 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36487 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT		0
36488 	/* The granularity of the value (bits or bytes). */
36489 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE			UINT32_C(0x10000000)
36490 	/* Value is in bits. */
36491 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36492 	/* Value is in bytes. */
36493 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36494 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
36495 	/* bw_value_unit is 3 b */
36496 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36497 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT	29
36498 	/* Value is in Mb or MB (base 10). */
36499 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36500 	/* Value is in Kb or KB (base 10). */
36501 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36502 	/* Value is in bits or bytes. */
36503 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36504 	/* Value is in Gb or GB (base 10). */
36505 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36506 	/* Value is in 1/100th of a percentage of total bandwidth. */
36507 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36508 	/* Invalid unit */
36509 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36510 		#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
36511 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
36512 	uint8_t	queue_id7_tsa_assign;
36513 	/* Strict Priority */
36514 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP		UINT32_C(0x0)
36515 	/* Enhanced Transmission Selection */
36516 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS		UINT32_C(0x1)
36517 	/* reserved. */
36518 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
36519 	/* reserved. */
36520 	#define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
36521 	/*
36522 	 * Priority level for strict priority. Valid only when the
36523 	 * tsa_assign is 0 - Strict Priority (SP)
36524 	 * 0..7 - Valid values.
36525 	 * 8..255 - Reserved.
36526 	 */
36527 	uint8_t	queue_id7_pri_lvl;
36528 	/*
36529 	 * Weight used to allocate remaining BW for this COS after
36530 	 * servicing guaranteed bandwidths for all COS.
36531 	 */
36532 	uint8_t	queue_id7_bw_weight;
36533 	uint8_t	unused_2[4];
36534 	/*
36535 	 * This field is used in Output records to indicate that the output
36536 	 * is completely written to RAM. This field should be read as '1'
36537 	 * to indicate that the output has been completely written. When
36538 	 * writing a command completion or response to an internal processor,
36539 	 * the order of writes has to be such that this field is written last.
36540 	 */
36541 	uint8_t	valid;
36542 } hwrm_queue_cos2bw_qcfg_output_t, *phwrm_queue_cos2bw_qcfg_output_t;
36543 
36544 /*************************
36545  * hwrm_queue_cos2bw_cfg *
36546  *************************/
36547 
36548 
36549 /* hwrm_queue_cos2bw_cfg_input (size:1024b/128B) */
36550 
36551 typedef struct hwrm_queue_cos2bw_cfg_input {
36552 	/* The HWRM command request type. */
36553 	uint16_t	req_type;
36554 	/*
36555 	 * The completion ring to send the completion event on. This should
36556 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
36557 	 */
36558 	uint16_t	cmpl_ring;
36559 	/*
36560 	 * The sequence ID is used by the driver for tracking multiple
36561 	 * commands. This ID is treated as opaque data by the firmware and
36562 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
36563 	 */
36564 	uint16_t	seq_id;
36565 	/*
36566 	 * The target ID of the command:
36567 	 * * 0x0-0xFFF8 - The function ID
36568 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36569 	 * * 0xFFFD - Reserved for user-space HWRM interface
36570 	 * * 0xFFFF - HWRM
36571 	 */
36572 	uint16_t	target_id;
36573 	/*
36574 	 * A physical address pointer pointing to a host buffer that the
36575 	 * command's response data will be written. This can be either a host
36576 	 * physical address (HPA) or a guest physical address (GPA) and must
36577 	 * point to a physically contiguous block of memory.
36578 	 */
36579 	uint64_t	resp_addr;
36580 	uint32_t	flags;
36581 	uint32_t	enables;
36582 	/*
36583 	 * If this bit is set to 1, then all queue_id0 related
36584 	 * parameters in this command are valid.
36585 	 */
36586 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID	UINT32_C(0x1)
36587 	/*
36588 	 * If this bit is set to 1, then all queue_id1 related
36589 	 * parameters in this command are valid.
36590 	 */
36591 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID	UINT32_C(0x2)
36592 	/*
36593 	 * If this bit is set to 1, then all queue_id2 related
36594 	 * parameters in this command are valid.
36595 	 */
36596 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID	UINT32_C(0x4)
36597 	/*
36598 	 * If this bit is set to 1, then all queue_id3 related
36599 	 * parameters in this command are valid.
36600 	 */
36601 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID	UINT32_C(0x8)
36602 	/*
36603 	 * If this bit is set to 1, then all queue_id4 related
36604 	 * parameters in this command are valid.
36605 	 */
36606 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID	UINT32_C(0x10)
36607 	/*
36608 	 * If this bit is set to 1, then all queue_id5 related
36609 	 * parameters in this command are valid.
36610 	 */
36611 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID	UINT32_C(0x20)
36612 	/*
36613 	 * If this bit is set to 1, then all queue_id6 related
36614 	 * parameters in this command are valid.
36615 	 */
36616 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID	UINT32_C(0x40)
36617 	/*
36618 	 * If this bit is set to 1, then all queue_id7 related
36619 	 * parameters in this command are valid.
36620 	 */
36621 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID	UINT32_C(0x80)
36622 	/*
36623 	 * Port ID of port for which the table is being configured.
36624 	 * The HWRM needs to check whether this function is allowed
36625 	 * to configure TC BW assignment on this port.
36626 	 */
36627 	uint16_t	port_id;
36628 	/* ID of CoS Queue 0. */
36629 	uint8_t	queue_id0;
36630 	uint8_t	unused_0;
36631 	/*
36632 	 * Minimum BW allocated to CoS Queue.
36633 	 * The HWRM will translate this value into byte counter and
36634 	 * time interval used for this COS inside the device.
36635 	 */
36636 	uint32_t	queue_id0_min_bw;
36637 	/* The bandwidth value. */
36638 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36639 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT		0
36640 	/* The granularity of the value (bits or bytes). */
36641 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE			UINT32_C(0x10000000)
36642 	/* Value is in bits. */
36643 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36644 	/* Value is in bytes. */
36645 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36646 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
36647 	/* bw_value_unit is 3 b */
36648 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36649 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT	29
36650 	/* Value is in Mb or MB (base 10). */
36651 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36652 	/* Value is in Kb or KB (base 10). */
36653 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36654 	/* Value is in bits or bytes. */
36655 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36656 	/* Value is in Gb or GB (base 10). */
36657 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36658 	/* Value is in 1/100th of a percentage of total bandwidth. */
36659 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36660 	/* Invalid unit */
36661 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36662 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
36663 	/*
36664 	 * Maximum BW allocated to CoS Queue.
36665 	 * The HWRM will translate this value into byte counter and
36666 	 * time interval used for this COS inside the device.
36667 	 */
36668 	uint32_t	queue_id0_max_bw;
36669 	/* The bandwidth value. */
36670 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36671 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT		0
36672 	/* The granularity of the value (bits or bytes). */
36673 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE			UINT32_C(0x10000000)
36674 	/* Value is in bits. */
36675 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36676 	/* Value is in bytes. */
36677 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36678 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
36679 	/* bw_value_unit is 3 b */
36680 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36681 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT	29
36682 	/* Value is in Mb or MB (base 10). */
36683 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36684 	/* Value is in Kb or KB (base 10). */
36685 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36686 	/* Value is in bits or bytes. */
36687 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36688 	/* Value is in Gb or GB (base 10). */
36689 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36690 	/* Value is in 1/100th of a percentage of total bandwidth. */
36691 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36692 	/* Invalid unit */
36693 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36694 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
36695 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
36696 	uint8_t	queue_id0_tsa_assign;
36697 	/* Strict Priority */
36698 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP		UINT32_C(0x0)
36699 	/* Enhanced Transmission Selection */
36700 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS		UINT32_C(0x1)
36701 	/* reserved. */
36702 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
36703 	/* reserved. */
36704 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
36705 	/*
36706 	 * Priority level for strict priority. Valid only when the
36707 	 * tsa_assign is 0 - Strict Priority (SP)
36708 	 * 0..7 - Valid values.
36709 	 * 8..255 - Reserved.
36710 	 */
36711 	uint8_t	queue_id0_pri_lvl;
36712 	/*
36713 	 * Weight used to allocate remaining BW for this COS after
36714 	 * servicing guaranteed bandwidths for all COS.
36715 	 */
36716 	uint8_t	queue_id0_bw_weight;
36717 	/* ID of CoS Queue 1. */
36718 	uint8_t	queue_id1;
36719 	/*
36720 	 * Minimum BW allocated to CoS Queue.
36721 	 * The HWRM will translate this value into byte counter and
36722 	 * time interval used for this COS inside the device.
36723 	 */
36724 	uint32_t	queue_id1_min_bw;
36725 	/* The bandwidth value. */
36726 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36727 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT		0
36728 	/* The granularity of the value (bits or bytes). */
36729 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE			UINT32_C(0x10000000)
36730 	/* Value is in bits. */
36731 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36732 	/* Value is in bytes. */
36733 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36734 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
36735 	/* bw_value_unit is 3 b */
36736 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36737 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT	29
36738 	/* Value is in Mb or MB (base 10). */
36739 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36740 	/* Value is in Kb or KB (base 10). */
36741 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36742 	/* Value is in bits or bytes. */
36743 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36744 	/* Value is in Gb or GB (base 10). */
36745 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36746 	/* Value is in 1/100th of a percentage of total bandwidth. */
36747 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36748 	/* Invalid unit */
36749 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36750 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
36751 	/*
36752 	 * Maximum BW allocated to CoS queue.
36753 	 * The HWRM will translate this value into byte counter and
36754 	 * time interval used for this COS inside the device.
36755 	 */
36756 	uint32_t	queue_id1_max_bw;
36757 	/* The bandwidth value. */
36758 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36759 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT		0
36760 	/* The granularity of the value (bits or bytes). */
36761 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE			UINT32_C(0x10000000)
36762 	/* Value is in bits. */
36763 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36764 	/* Value is in bytes. */
36765 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36766 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
36767 	/* bw_value_unit is 3 b */
36768 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36769 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT	29
36770 	/* Value is in Mb or MB (base 10). */
36771 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36772 	/* Value is in Kb or KB (base 10). */
36773 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36774 	/* Value is in bits or bytes. */
36775 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36776 	/* Value is in Gb or GB (base 10). */
36777 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36778 	/* Value is in 1/100th of a percentage of total bandwidth. */
36779 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36780 	/* Invalid unit */
36781 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36782 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
36783 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
36784 	uint8_t	queue_id1_tsa_assign;
36785 	/* Strict Priority */
36786 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP		UINT32_C(0x0)
36787 	/* Enhanced Transmission Selection */
36788 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS		UINT32_C(0x1)
36789 	/* reserved. */
36790 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
36791 	/* reserved. */
36792 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
36793 	/*
36794 	 * Priority level for strict priority. Valid only when the
36795 	 * tsa_assign is 0 - Strict Priority (SP)
36796 	 * 0..7 - Valid values.
36797 	 * 8..255 - Reserved.
36798 	 */
36799 	uint8_t	queue_id1_pri_lvl;
36800 	/*
36801 	 * Weight used to allocate remaining BW for this COS after
36802 	 * servicing guaranteed bandwidths for all COS.
36803 	 */
36804 	uint8_t	queue_id1_bw_weight;
36805 	/* ID of CoS Queue 2. */
36806 	uint8_t	queue_id2;
36807 	/*
36808 	 * Minimum BW allocated to CoS Queue.
36809 	 * The HWRM will translate this value into byte counter and
36810 	 * time interval used for this COS inside the device.
36811 	 */
36812 	uint32_t	queue_id2_min_bw;
36813 	/* The bandwidth value. */
36814 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36815 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT		0
36816 	/* The granularity of the value (bits or bytes). */
36817 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE			UINT32_C(0x10000000)
36818 	/* Value is in bits. */
36819 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36820 	/* Value is in bytes. */
36821 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36822 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
36823 	/* bw_value_unit is 3 b */
36824 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36825 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT	29
36826 	/* Value is in Mb or MB (base 10). */
36827 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36828 	/* Value is in Kb or KB (base 10). */
36829 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36830 	/* Value is in bits or bytes. */
36831 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36832 	/* Value is in Gb or GB (base 10). */
36833 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36834 	/* Value is in 1/100th of a percentage of total bandwidth. */
36835 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36836 	/* Invalid unit */
36837 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36838 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
36839 	/*
36840 	 * Maximum BW allocated to CoS queue.
36841 	 * The HWRM will translate this value into byte counter and
36842 	 * time interval used for this COS inside the device.
36843 	 */
36844 	uint32_t	queue_id2_max_bw;
36845 	/* The bandwidth value. */
36846 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36847 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT		0
36848 	/* The granularity of the value (bits or bytes). */
36849 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE			UINT32_C(0x10000000)
36850 	/* Value is in bits. */
36851 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36852 	/* Value is in bytes. */
36853 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36854 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
36855 	/* bw_value_unit is 3 b */
36856 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36857 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT	29
36858 	/* Value is in Mb or MB (base 10). */
36859 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36860 	/* Value is in Kb or KB (base 10). */
36861 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36862 	/* Value is in bits or bytes. */
36863 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36864 	/* Value is in Gb or GB (base 10). */
36865 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36866 	/* Value is in 1/100th of a percentage of total bandwidth. */
36867 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36868 	/* Invalid unit */
36869 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36870 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
36871 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
36872 	uint8_t	queue_id2_tsa_assign;
36873 	/* Strict Priority */
36874 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP		UINT32_C(0x0)
36875 	/* Enhanced Transmission Selection */
36876 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS		UINT32_C(0x1)
36877 	/* reserved. */
36878 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
36879 	/* reserved. */
36880 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
36881 	/*
36882 	 * Priority level for strict priority. Valid only when the
36883 	 * tsa_assign is 0 - Strict Priority (SP)
36884 	 * 0..7 - Valid values.
36885 	 * 8..255 - Reserved.
36886 	 */
36887 	uint8_t	queue_id2_pri_lvl;
36888 	/*
36889 	 * Weight used to allocate remaining BW for this COS after
36890 	 * servicing guaranteed bandwidths for all COS.
36891 	 */
36892 	uint8_t	queue_id2_bw_weight;
36893 	/* ID of CoS Queue 3. */
36894 	uint8_t	queue_id3;
36895 	/*
36896 	 * Minimum BW allocated to CoS Queue.
36897 	 * The HWRM will translate this value into byte counter and
36898 	 * time interval used for this COS inside the device.
36899 	 */
36900 	uint32_t	queue_id3_min_bw;
36901 	/* The bandwidth value. */
36902 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36903 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT		0
36904 	/* The granularity of the value (bits or bytes). */
36905 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE			UINT32_C(0x10000000)
36906 	/* Value is in bits. */
36907 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36908 	/* Value is in bytes. */
36909 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36910 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
36911 	/* bw_value_unit is 3 b */
36912 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36913 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT	29
36914 	/* Value is in Mb or MB (base 10). */
36915 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36916 	/* Value is in Kb or KB (base 10). */
36917 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36918 	/* Value is in bits or bytes. */
36919 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36920 	/* Value is in Gb or GB (base 10). */
36921 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36922 	/* Value is in 1/100th of a percentage of total bandwidth. */
36923 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36924 	/* Invalid unit */
36925 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36926 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
36927 	/*
36928 	 * Maximum BW allocated to CoS queue.
36929 	 * The HWRM will translate this value into byte counter and
36930 	 * time interval used for this COS inside the device.
36931 	 */
36932 	uint32_t	queue_id3_max_bw;
36933 	/* The bandwidth value. */
36934 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36935 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT		0
36936 	/* The granularity of the value (bits or bytes). */
36937 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE			UINT32_C(0x10000000)
36938 	/* Value is in bits. */
36939 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36940 	/* Value is in bytes. */
36941 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36942 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
36943 	/* bw_value_unit is 3 b */
36944 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
36945 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT	29
36946 	/* Value is in Mb or MB (base 10). */
36947 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
36948 	/* Value is in Kb or KB (base 10). */
36949 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
36950 	/* Value is in bits or bytes. */
36951 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
36952 	/* Value is in Gb or GB (base 10). */
36953 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
36954 	/* Value is in 1/100th of a percentage of total bandwidth. */
36955 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
36956 	/* Invalid unit */
36957 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
36958 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
36959 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
36960 	uint8_t	queue_id3_tsa_assign;
36961 	/* Strict Priority */
36962 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP		UINT32_C(0x0)
36963 	/* Enhanced Transmission Selection */
36964 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS		UINT32_C(0x1)
36965 	/* reserved. */
36966 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
36967 	/* reserved. */
36968 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
36969 	/*
36970 	 * Priority level for strict priority. Valid only when the
36971 	 * tsa_assign is 0 - Strict Priority (SP)
36972 	 * 0..7 - Valid values.
36973 	 * 8..255 - Reserved.
36974 	 */
36975 	uint8_t	queue_id3_pri_lvl;
36976 	/*
36977 	 * Weight used to allocate remaining BW for this COS after
36978 	 * servicing guaranteed bandwidths for all COS.
36979 	 */
36980 	uint8_t	queue_id3_bw_weight;
36981 	/* ID of CoS Queue 4. */
36982 	uint8_t	queue_id4;
36983 	/*
36984 	 * Minimum BW allocated to CoS Queue.
36985 	 * The HWRM will translate this value into byte counter and
36986 	 * time interval used for this COS inside the device.
36987 	 */
36988 	uint32_t	queue_id4_min_bw;
36989 	/* The bandwidth value. */
36990 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
36991 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT		0
36992 	/* The granularity of the value (bits or bytes). */
36993 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE			UINT32_C(0x10000000)
36994 	/* Value is in bits. */
36995 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
36996 	/* Value is in bytes. */
36997 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
36998 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
36999 	/* bw_value_unit is 3 b */
37000 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
37001 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT	29
37002 	/* Value is in Mb or MB (base 10). */
37003 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
37004 	/* Value is in Kb or KB (base 10). */
37005 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
37006 	/* Value is in bits or bytes. */
37007 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
37008 	/* Value is in Gb or GB (base 10). */
37009 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
37010 	/* Value is in 1/100th of a percentage of total bandwidth. */
37011 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
37012 	/* Invalid unit */
37013 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
37014 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
37015 	/*
37016 	 * Maximum BW allocated to CoS queue.
37017 	 * The HWRM will translate this value into byte counter and
37018 	 * time interval used for this COS inside the device.
37019 	 */
37020 	uint32_t	queue_id4_max_bw;
37021 	/* The bandwidth value. */
37022 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
37023 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT		0
37024 	/* The granularity of the value (bits or bytes). */
37025 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE			UINT32_C(0x10000000)
37026 	/* Value is in bits. */
37027 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
37028 	/* Value is in bytes. */
37029 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
37030 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
37031 	/* bw_value_unit is 3 b */
37032 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
37033 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT	29
37034 	/* Value is in Mb or MB (base 10). */
37035 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
37036 	/* Value is in Kb or KB (base 10). */
37037 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
37038 	/* Value is in bits or bytes. */
37039 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
37040 	/* Value is in Gb or GB (base 10). */
37041 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
37042 	/* Value is in 1/100th of a percentage of total bandwidth. */
37043 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
37044 	/* Invalid unit */
37045 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
37046 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
37047 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
37048 	uint8_t	queue_id4_tsa_assign;
37049 	/* Strict Priority */
37050 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP		UINT32_C(0x0)
37051 	/* Enhanced Transmission Selection */
37052 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS		UINT32_C(0x1)
37053 	/* reserved. */
37054 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
37055 	/* reserved. */
37056 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
37057 	/*
37058 	 * Priority level for strict priority. Valid only when the
37059 	 * tsa_assign is 0 - Strict Priority (SP)
37060 	 * 0..7 - Valid values.
37061 	 * 8..255 - Reserved.
37062 	 */
37063 	uint8_t	queue_id4_pri_lvl;
37064 	/*
37065 	 * Weight used to allocate remaining BW for this COS after
37066 	 * servicing guaranteed bandwidths for all COS.
37067 	 */
37068 	uint8_t	queue_id4_bw_weight;
37069 	/* ID of CoS Queue 5. */
37070 	uint8_t	queue_id5;
37071 	/*
37072 	 * Minimum BW allocated to CoS Queue.
37073 	 * The HWRM will translate this value into byte counter and
37074 	 * time interval used for this COS inside the device.
37075 	 */
37076 	uint32_t	queue_id5_min_bw;
37077 	/* The bandwidth value. */
37078 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
37079 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT		0
37080 	/* The granularity of the value (bits or bytes). */
37081 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE			UINT32_C(0x10000000)
37082 	/* Value is in bits. */
37083 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
37084 	/* Value is in bytes. */
37085 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
37086 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
37087 	/* bw_value_unit is 3 b */
37088 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
37089 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT	29
37090 	/* Value is in Mb or MB (base 10). */
37091 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
37092 	/* Value is in Kb or KB (base 10). */
37093 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
37094 	/* Value is in bits or bytes. */
37095 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
37096 	/* Value is in Gb or GB (base 10). */
37097 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
37098 	/* Value is in 1/100th of a percentage of total bandwidth. */
37099 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
37100 	/* Invalid unit */
37101 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
37102 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
37103 	/*
37104 	 * Maximum BW allocated to CoS queue.
37105 	 * The HWRM will translate this value into byte counter and
37106 	 * time interval used for this COS inside the device.
37107 	 */
37108 	uint32_t	queue_id5_max_bw;
37109 	/* The bandwidth value. */
37110 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
37111 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT		0
37112 	/* The granularity of the value (bits or bytes). */
37113 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE			UINT32_C(0x10000000)
37114 	/* Value is in bits. */
37115 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
37116 	/* Value is in bytes. */
37117 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
37118 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
37119 	/* bw_value_unit is 3 b */
37120 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
37121 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT	29
37122 	/* Value is in Mb or MB (base 10). */
37123 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
37124 	/* Value is in Kb or KB (base 10). */
37125 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
37126 	/* Value is in bits or bytes. */
37127 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
37128 	/* Value is in Gb or GB (base 10). */
37129 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
37130 	/* Value is in 1/100th of a percentage of total bandwidth. */
37131 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
37132 	/* Invalid unit */
37133 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
37134 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
37135 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
37136 	uint8_t	queue_id5_tsa_assign;
37137 	/* Strict Priority */
37138 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP		UINT32_C(0x0)
37139 	/* Enhanced Transmission Selection */
37140 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS		UINT32_C(0x1)
37141 	/* reserved. */
37142 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
37143 	/* reserved. */
37144 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
37145 	/*
37146 	 * Priority level for strict priority. Valid only when the
37147 	 * tsa_assign is 0 - Strict Priority (SP)
37148 	 * 0..7 - Valid values.
37149 	 * 8..255 - Reserved.
37150 	 */
37151 	uint8_t	queue_id5_pri_lvl;
37152 	/*
37153 	 * Weight used to allocate remaining BW for this COS after
37154 	 * servicing guaranteed bandwidths for all COS.
37155 	 */
37156 	uint8_t	queue_id5_bw_weight;
37157 	/* ID of CoS Queue 6. */
37158 	uint8_t	queue_id6;
37159 	/*
37160 	 * Minimum BW allocated to CoS Queue.
37161 	 * The HWRM will translate this value into byte counter and
37162 	 * time interval used for this COS inside the device.
37163 	 */
37164 	uint32_t	queue_id6_min_bw;
37165 	/* The bandwidth value. */
37166 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
37167 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT		0
37168 	/* The granularity of the value (bits or bytes). */
37169 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE			UINT32_C(0x10000000)
37170 	/* Value is in bits. */
37171 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
37172 	/* Value is in bytes. */
37173 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
37174 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
37175 	/* bw_value_unit is 3 b */
37176 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
37177 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT	29
37178 	/* Value is in Mb or MB (base 10). */
37179 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
37180 	/* Value is in Kb or KB (base 10). */
37181 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
37182 	/* Value is in bits or bytes. */
37183 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
37184 	/* Value is in Gb or GB (base 10). */
37185 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
37186 	/* Value is in 1/100th of a percentage of total bandwidth. */
37187 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
37188 	/* Invalid unit */
37189 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
37190 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
37191 	/*
37192 	 * Maximum BW allocated to CoS queue.
37193 	 * The HWRM will translate this value into byte counter and
37194 	 * time interval used for this COS inside the device.
37195 	 */
37196 	uint32_t	queue_id6_max_bw;
37197 	/* The bandwidth value. */
37198 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
37199 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT		0
37200 	/* The granularity of the value (bits or bytes). */
37201 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE			UINT32_C(0x10000000)
37202 	/* Value is in bits. */
37203 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
37204 	/* Value is in bytes. */
37205 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
37206 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
37207 	/* bw_value_unit is 3 b */
37208 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
37209 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT	29
37210 	/* Value is in Mb or MB (base 10). */
37211 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
37212 	/* Value is in Kb or KB (base 10). */
37213 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
37214 	/* Value is in bits or bytes. */
37215 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
37216 	/* Value is in Gb or GB (base 10). */
37217 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
37218 	/* Value is in 1/100th of a percentage of total bandwidth. */
37219 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
37220 	/* Invalid unit */
37221 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
37222 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
37223 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
37224 	uint8_t	queue_id6_tsa_assign;
37225 	/* Strict Priority */
37226 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP		UINT32_C(0x0)
37227 	/* Enhanced Transmission Selection */
37228 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS		UINT32_C(0x1)
37229 	/* reserved. */
37230 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
37231 	/* reserved. */
37232 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
37233 	/*
37234 	 * Priority level for strict priority. Valid only when the
37235 	 * tsa_assign is 0 - Strict Priority (SP)
37236 	 * 0..7 - Valid values.
37237 	 * 8..255 - Reserved.
37238 	 */
37239 	uint8_t	queue_id6_pri_lvl;
37240 	/*
37241 	 * Weight used to allocate remaining BW for this COS after
37242 	 * servicing guaranteed bandwidths for all COS.
37243 	 */
37244 	uint8_t	queue_id6_bw_weight;
37245 	/* ID of CoS Queue 7. */
37246 	uint8_t	queue_id7;
37247 	/*
37248 	 * Minimum BW allocated to CoS Queue.
37249 	 * The HWRM will translate this value into byte counter and
37250 	 * time interval used for this COS inside the device.
37251 	 */
37252 	uint32_t	queue_id7_min_bw;
37253 	/* The bandwidth value. */
37254 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
37255 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT		0
37256 	/* The granularity of the value (bits or bytes). */
37257 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE			UINT32_C(0x10000000)
37258 	/* Value is in bits. */
37259 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
37260 	/* Value is in bytes. */
37261 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
37262 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
37263 	/* bw_value_unit is 3 b */
37264 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
37265 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT	29
37266 	/* Value is in Mb or MB (base 10). */
37267 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
37268 	/* Value is in Kb or KB (base 10). */
37269 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
37270 	/* Value is in bits or bytes. */
37271 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
37272 	/* Value is in Gb or GB (base 10). */
37273 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
37274 	/* Value is in 1/100th of a percentage of total bandwidth. */
37275 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
37276 	/* Invalid unit */
37277 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
37278 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
37279 	/*
37280 	 * Maximum BW allocated to CoS queue.
37281 	 * The HWRM will translate this value into byte counter and
37282 	 * time interval used for this COS inside the device.
37283 	 */
37284 	uint32_t	queue_id7_max_bw;
37285 	/* The bandwidth value. */
37286 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
37287 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT		0
37288 	/* The granularity of the value (bits or bytes). */
37289 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE			UINT32_C(0x10000000)
37290 	/* Value is in bits. */
37291 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
37292 	/* Value is in bytes. */
37293 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
37294 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST		HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
37295 	/* bw_value_unit is 3 b */
37296 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
37297 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT	29
37298 	/* Value is in Mb or MB (base 10). */
37299 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
37300 	/* Value is in Kb or KB (base 10). */
37301 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
37302 	/* Value is in bits or bytes. */
37303 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
37304 	/* Value is in Gb or GB (base 10). */
37305 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
37306 	/* Value is in 1/100th of a percentage of total bandwidth. */
37307 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
37308 	/* Invalid unit */
37309 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
37310 		#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
37311 	/* Transmission Selection Algorithm (TSA) for CoS Queue. */
37312 	uint8_t	queue_id7_tsa_assign;
37313 	/* Strict Priority */
37314 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP		UINT32_C(0x0)
37315 	/* Enhanced Transmission Selection */
37316 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS		UINT32_C(0x1)
37317 	/* reserved. */
37318 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST UINT32_C(0x2)
37319 	/* reserved. */
37320 	#define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST  UINT32_C(0xff)
37321 	/*
37322 	 * Priority level for strict priority. Valid only when the
37323 	 * tsa_assign is 0 - Strict Priority (SP)
37324 	 * 0..7 - Valid values.
37325 	 * 8..255 - Reserved.
37326 	 */
37327 	uint8_t	queue_id7_pri_lvl;
37328 	/*
37329 	 * Weight used to allocate remaining BW for this COS after
37330 	 * servicing guaranteed bandwidths for all COS.
37331 	 */
37332 	uint8_t	queue_id7_bw_weight;
37333 	uint8_t	unused_1[5];
37334 } hwrm_queue_cos2bw_cfg_input_t, *phwrm_queue_cos2bw_cfg_input_t;
37335 
37336 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */
37337 
37338 typedef struct hwrm_queue_cos2bw_cfg_output {
37339 	/* The specific error status for the command. */
37340 	uint16_t	error_code;
37341 	/* The HWRM command request type. */
37342 	uint16_t	req_type;
37343 	/* The sequence ID from the original command. */
37344 	uint16_t	seq_id;
37345 	/* The length of the response data in number of bytes. */
37346 	uint16_t	resp_len;
37347 	uint8_t	unused_0[7];
37348 	/*
37349 	 * This field is used in Output records to indicate that the output
37350 	 * is completely written to RAM. This field should be read as '1'
37351 	 * to indicate that the output has been completely written. When
37352 	 * writing a command completion or response to an internal processor,
37353 	 * the order of writes has to be such that this field is written last.
37354 	 */
37355 	uint8_t	valid;
37356 } hwrm_queue_cos2bw_cfg_output_t, *phwrm_queue_cos2bw_cfg_output_t;
37357 
37358 /*************************
37359  * hwrm_queue_dscp_qcaps *
37360  *************************/
37361 
37362 
37363 /* hwrm_queue_dscp_qcaps_input (size:192b/24B) */
37364 
37365 typedef struct hwrm_queue_dscp_qcaps_input {
37366 	/* The HWRM command request type. */
37367 	uint16_t	req_type;
37368 	/*
37369 	 * The completion ring to send the completion event on. This should
37370 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37371 	 */
37372 	uint16_t	cmpl_ring;
37373 	/*
37374 	 * The sequence ID is used by the driver for tracking multiple
37375 	 * commands. This ID is treated as opaque data by the firmware and
37376 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37377 	 */
37378 	uint16_t	seq_id;
37379 	/*
37380 	 * The target ID of the command:
37381 	 * * 0x0-0xFFF8 - The function ID
37382 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37383 	 * * 0xFFFD - Reserved for user-space HWRM interface
37384 	 * * 0xFFFF - HWRM
37385 	 */
37386 	uint16_t	target_id;
37387 	/*
37388 	 * A physical address pointer pointing to a host buffer that the
37389 	 * command's response data will be written. This can be either a host
37390 	 * physical address (HPA) or a guest physical address (GPA) and must
37391 	 * point to a physically contiguous block of memory.
37392 	 */
37393 	uint64_t	resp_addr;
37394 	/*
37395 	 * Port ID of port for which the table is being configured.
37396 	 * The HWRM needs to check whether this function is allowed
37397 	 * to configure pri2cos mapping on this port.
37398 	 */
37399 	uint8_t	port_id;
37400 	uint8_t	unused_0[7];
37401 } hwrm_queue_dscp_qcaps_input_t, *phwrm_queue_dscp_qcaps_input_t;
37402 
37403 /* hwrm_queue_dscp_qcaps_output (size:128b/16B) */
37404 
37405 typedef struct hwrm_queue_dscp_qcaps_output {
37406 	/* The specific error status for the command. */
37407 	uint16_t	error_code;
37408 	/* The HWRM command request type. */
37409 	uint16_t	req_type;
37410 	/* The sequence ID from the original command. */
37411 	uint16_t	seq_id;
37412 	/* The length of the response data in number of bytes. */
37413 	uint16_t	resp_len;
37414 	/* The number of bits provided by the hardware for the DSCP value. */
37415 	uint8_t	num_dscp_bits;
37416 	uint8_t	unused_0;
37417 	/* Max number of DSCP-MASK-PRI entries supported. */
37418 	uint16_t	max_entries;
37419 	uint8_t	unused_1[3];
37420 	/*
37421 	 * This field is used in Output records to indicate that the output
37422 	 * is completely written to RAM. This field should be read as '1'
37423 	 * to indicate that the output has been completely written. When
37424 	 * writing a command completion or response to an internal processor,
37425 	 * the order of writes has to be such that this field is written last.
37426 	 */
37427 	uint8_t	valid;
37428 } hwrm_queue_dscp_qcaps_output_t, *phwrm_queue_dscp_qcaps_output_t;
37429 
37430 /****************************
37431  * hwrm_queue_dscp2pri_qcfg *
37432  ****************************/
37433 
37434 
37435 /* hwrm_queue_dscp2pri_qcfg_input (size:256b/32B) */
37436 
37437 typedef struct hwrm_queue_dscp2pri_qcfg_input {
37438 	/* The HWRM command request type. */
37439 	uint16_t	req_type;
37440 	/*
37441 	 * The completion ring to send the completion event on. This should
37442 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37443 	 */
37444 	uint16_t	cmpl_ring;
37445 	/*
37446 	 * The sequence ID is used by the driver for tracking multiple
37447 	 * commands. This ID is treated as opaque data by the firmware and
37448 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37449 	 */
37450 	uint16_t	seq_id;
37451 	/*
37452 	 * The target ID of the command:
37453 	 * * 0x0-0xFFF8 - The function ID
37454 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37455 	 * * 0xFFFD - Reserved for user-space HWRM interface
37456 	 * * 0xFFFF - HWRM
37457 	 */
37458 	uint16_t	target_id;
37459 	/*
37460 	 * A physical address pointer pointing to a host buffer that the
37461 	 * command's response data will be written. This can be either a host
37462 	 * physical address (HPA) or a guest physical address (GPA) and must
37463 	 * point to a physically contiguous block of memory.
37464 	 */
37465 	uint64_t	resp_addr;
37466 	/*
37467 	 * This is the host address where the 24-bits DSCP-MASK-PRI
37468 	 * tuple(s) will be copied to.
37469 	 */
37470 	uint64_t	dest_data_addr;
37471 	/*
37472 	 * Port ID of port for which the table is being configured.
37473 	 * The HWRM needs to check whether this function is allowed
37474 	 * to configure pri2cos mapping on this port.
37475 	 */
37476 	uint8_t	port_id;
37477 	uint8_t	unused_0;
37478 	/* Size of the buffer pointed to by dest_data_addr. */
37479 	uint16_t	dest_data_buffer_size;
37480 	uint8_t	unused_1[4];
37481 } hwrm_queue_dscp2pri_qcfg_input_t, *phwrm_queue_dscp2pri_qcfg_input_t;
37482 
37483 /* hwrm_queue_dscp2pri_qcfg_output (size:128b/16B) */
37484 
37485 typedef struct hwrm_queue_dscp2pri_qcfg_output {
37486 	/* The specific error status for the command. */
37487 	uint16_t	error_code;
37488 	/* The HWRM command request type. */
37489 	uint16_t	req_type;
37490 	/* The sequence ID from the original command. */
37491 	uint16_t	seq_id;
37492 	/* The length of the response data in number of bytes. */
37493 	uint16_t	resp_len;
37494 	/*
37495 	 * A count of the number of DSCP-MASK-PRI tuple(s) pointed to
37496 	 * by the dest_data_addr.
37497 	 */
37498 	uint16_t	entry_cnt;
37499 	/*
37500 	 * This is the default PRI which un-initialized DSCP values are
37501 	 * mapped to.
37502 	 */
37503 	uint8_t	default_pri;
37504 	uint8_t	unused_0[4];
37505 	/*
37506 	 * This field is used in Output records to indicate that the output
37507 	 * is completely written to RAM. This field should be read as '1'
37508 	 * to indicate that the output has been completely written. When
37509 	 * writing a command completion or response to an internal processor,
37510 	 * the order of writes has to be such that this field is written last.
37511 	 */
37512 	uint8_t	valid;
37513 } hwrm_queue_dscp2pri_qcfg_output_t, *phwrm_queue_dscp2pri_qcfg_output_t;
37514 
37515 /***************************
37516  * hwrm_queue_dscp2pri_cfg *
37517  ***************************/
37518 
37519 
37520 /* hwrm_queue_dscp2pri_cfg_input (size:320b/40B) */
37521 
37522 typedef struct hwrm_queue_dscp2pri_cfg_input {
37523 	/* The HWRM command request type. */
37524 	uint16_t	req_type;
37525 	/*
37526 	 * The completion ring to send the completion event on. This should
37527 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37528 	 */
37529 	uint16_t	cmpl_ring;
37530 	/*
37531 	 * The sequence ID is used by the driver for tracking multiple
37532 	 * commands. This ID is treated as opaque data by the firmware and
37533 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37534 	 */
37535 	uint16_t	seq_id;
37536 	/*
37537 	 * The target ID of the command:
37538 	 * * 0x0-0xFFF8 - The function ID
37539 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37540 	 * * 0xFFFD - Reserved for user-space HWRM interface
37541 	 * * 0xFFFF - HWRM
37542 	 */
37543 	uint16_t	target_id;
37544 	/*
37545 	 * A physical address pointer pointing to a host buffer that the
37546 	 * command's response data will be written. This can be either a host
37547 	 * physical address (HPA) or a guest physical address (GPA) and must
37548 	 * point to a physically contiguous block of memory.
37549 	 */
37550 	uint64_t	resp_addr;
37551 	/*
37552 	 * This is the host address where the 24-bits DSCP-MASK-PRI tuple
37553 	 * will be copied from. A non-zero mask "adds" a tuple, while
37554 	 * a mask equal to 0 triggers the firmware to remove a tuple.
37555 	 * Only tuples with unique DSCP values are stored. On chips
37556 	 * prior to Thor a mask can be 0 - 0x3f, while on Thor it can
37557 	 * be 0 or 0x3f.
37558 	 */
37559 	uint64_t	src_data_addr;
37560 	uint32_t	flags;
37561 	/* use_hw_default_pri is 1 b */
37562 	#define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_FLAGS_USE_HW_DEFAULT_PRI	UINT32_C(0x1)
37563 	uint32_t	enables;
37564 	/*
37565 	 * This bit must be '1' for the default_pri field to be
37566 	 * configured.
37567 	 */
37568 	#define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_ENABLES_DEFAULT_PRI	UINT32_C(0x1)
37569 	/*
37570 	 * Port ID of port for which the table is being configured.
37571 	 * The HWRM needs to check whether this function is allowed
37572 	 * to configure pri2cos mapping on this port.
37573 	 */
37574 	uint8_t	port_id;
37575 	/*
37576 	 * This is the default PRI which un-initialized DSCP values will be
37577 	 * mapped to.
37578 	 */
37579 	uint8_t	default_pri;
37580 	/*
37581 	 * A count of the number of DSCP-MASK-PRI tuple(s) in the data pointed
37582 	 * to by src_data_addr.
37583 	 */
37584 	uint16_t	entry_cnt;
37585 	uint8_t	unused_0[4];
37586 } hwrm_queue_dscp2pri_cfg_input_t, *phwrm_queue_dscp2pri_cfg_input_t;
37587 
37588 /* hwrm_queue_dscp2pri_cfg_output (size:128b/16B) */
37589 
37590 typedef struct hwrm_queue_dscp2pri_cfg_output {
37591 	/* The specific error status for the command. */
37592 	uint16_t	error_code;
37593 	/* The HWRM command request type. */
37594 	uint16_t	req_type;
37595 	/* The sequence ID from the original command. */
37596 	uint16_t	seq_id;
37597 	/* The length of the response data in number of bytes. */
37598 	uint16_t	resp_len;
37599 	uint8_t	unused_0[7];
37600 	/*
37601 	 * This field is used in Output records to indicate that the output
37602 	 * is completely written to RAM. This field should be read as '1'
37603 	 * to indicate that the output has been completely written. When
37604 	 * writing a command completion or response to an internal processor,
37605 	 * the order of writes has to be such that this field is written last.
37606 	 */
37607 	uint8_t	valid;
37608 } hwrm_queue_dscp2pri_cfg_output_t, *phwrm_queue_dscp2pri_cfg_output_t;
37609 
37610 /*************************
37611  * hwrm_queue_mpls_qcaps *
37612  *************************/
37613 
37614 
37615 /* hwrm_queue_mpls_qcaps_input (size:192b/24B) */
37616 
37617 typedef struct hwrm_queue_mpls_qcaps_input {
37618 	/* The HWRM command request type. */
37619 	uint16_t	req_type;
37620 	/*
37621 	 * The completion ring to send the completion event on. This should
37622 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37623 	 */
37624 	uint16_t	cmpl_ring;
37625 	/*
37626 	 * The sequence ID is used by the driver for tracking multiple
37627 	 * commands. This ID is treated as opaque data by the firmware and
37628 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37629 	 */
37630 	uint16_t	seq_id;
37631 	/*
37632 	 * The target ID of the command:
37633 	 * * 0x0-0xFFF8 - The function ID
37634 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37635 	 * * 0xFFFD - Reserved for user-space HWRM interface
37636 	 * * 0xFFFF - HWRM
37637 	 */
37638 	uint16_t	target_id;
37639 	/*
37640 	 * A physical address pointer pointing to a host buffer that the
37641 	 * command's response data will be written. This can be either a host
37642 	 * physical address (HPA) or a guest physical address (GPA) and must
37643 	 * point to a physically contiguous block of memory.
37644 	 */
37645 	uint64_t	resp_addr;
37646 	/*
37647 	 * Port ID of port for which the table is being configured.
37648 	 * The HWRM needs to check whether this function is allowed
37649 	 * to configure MPLS TC(EXP) to pri mapping on this port.
37650 	 */
37651 	uint8_t	port_id;
37652 	uint8_t	unused_0[7];
37653 } hwrm_queue_mpls_qcaps_input_t, *phwrm_queue_mpls_qcaps_input_t;
37654 
37655 /* hwrm_queue_mpls_qcaps_output (size:128b/16B) */
37656 
37657 typedef struct hwrm_queue_mpls_qcaps_output {
37658 	/* The specific error status for the command. */
37659 	uint16_t	error_code;
37660 	/* The HWRM command request type. */
37661 	uint16_t	req_type;
37662 	/* The sequence ID from the original command. */
37663 	uint16_t	seq_id;
37664 	/* The length of the response data in number of bytes. */
37665 	uint16_t	resp_len;
37666 	/*
37667 	 * Bitmask indicating which queues can be configured by the
37668 	 * hwrm_queue_mplstc2pri_cfg command.
37669 	 *
37670 	 * Each bit represents a specific pri where bit 0 represents
37671 	 * pri 0 and bit 7 represents pri 7.
37672 	 * # A value of 0 indicates that the pri is not configurable
37673 	 * by the hwrm_queue_mplstc2pri_cfg command.
37674 	 * # A value of 1 indicates that the pri is configurable.
37675 	 * # A hwrm_queue_mplstc2pri_cfg command shall return error when
37676 	 * trying to configure a pri that is not configurable.
37677 	 */
37678 	uint8_t	queue_mplstc2pri_cfg_allowed;
37679 	/*
37680 	 * This is the default PRI which un-initialized MPLS values will be
37681 	 * mapped to.
37682 	 */
37683 	uint8_t	hw_default_pri;
37684 	uint8_t	unused_0[5];
37685 	/*
37686 	 * This field is used in Output records to indicate that the output
37687 	 * is completely written to RAM. This field should be read as '1'
37688 	 * to indicate that the output has been completely written. When
37689 	 * writing a command completion or response to an internal processor,
37690 	 * the order of writes has to be such that this field is written last.
37691 	 */
37692 	uint8_t	valid;
37693 } hwrm_queue_mpls_qcaps_output_t, *phwrm_queue_mpls_qcaps_output_t;
37694 
37695 /******************************
37696  * hwrm_queue_mplstc2pri_qcfg *
37697  ******************************/
37698 
37699 
37700 /* hwrm_queue_mplstc2pri_qcfg_input (size:192b/24B) */
37701 
37702 typedef struct hwrm_queue_mplstc2pri_qcfg_input {
37703 	/* The HWRM command request type. */
37704 	uint16_t	req_type;
37705 	/*
37706 	 * The completion ring to send the completion event on. This should
37707 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37708 	 */
37709 	uint16_t	cmpl_ring;
37710 	/*
37711 	 * The sequence ID is used by the driver for tracking multiple
37712 	 * commands. This ID is treated as opaque data by the firmware and
37713 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37714 	 */
37715 	uint16_t	seq_id;
37716 	/*
37717 	 * The target ID of the command:
37718 	 * * 0x0-0xFFF8 - The function ID
37719 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37720 	 * * 0xFFFD - Reserved for user-space HWRM interface
37721 	 * * 0xFFFF - HWRM
37722 	 */
37723 	uint16_t	target_id;
37724 	/*
37725 	 * A physical address pointer pointing to a host buffer that the
37726 	 * command's response data will be written. This can be either a host
37727 	 * physical address (HPA) or a guest physical address (GPA) and must
37728 	 * point to a physically contiguous block of memory.
37729 	 */
37730 	uint64_t	resp_addr;
37731 	/*
37732 	 * Port ID of port for which the table is being configured.
37733 	 * The HWRM needs to check whether this function is allowed
37734 	 * to configure MPLS TC(EXP) to pri mapping on this port.
37735 	 */
37736 	uint8_t	port_id;
37737 	uint8_t	unused_0[7];
37738 } hwrm_queue_mplstc2pri_qcfg_input_t, *phwrm_queue_mplstc2pri_qcfg_input_t;
37739 
37740 /* hwrm_queue_mplstc2pri_qcfg_output (size:192b/24B) */
37741 
37742 typedef struct hwrm_queue_mplstc2pri_qcfg_output {
37743 	/* The specific error status for the command. */
37744 	uint16_t	error_code;
37745 	/* The HWRM command request type. */
37746 	uint16_t	req_type;
37747 	/* The sequence ID from the original command. */
37748 	uint16_t	seq_id;
37749 	/* The length of the response data in number of bytes. */
37750 	uint16_t	resp_len;
37751 	/*
37752 	 * pri assigned to MPLS TC(EXP) 0. This value can only be changed
37753 	 * before traffic has started.
37754 	 * A value of 0xff indicates that no pri is assigned to the
37755 	 * MPLS TC(EXP) 0.
37756 	 */
37757 	uint8_t	tc0_pri_queue_id;
37758 	/*
37759 	 * pri assigned to MPLS TC(EXP) 1. This value can only be changed
37760 	 * before traffic has started.
37761 	 * A value of 0xff indicates that no pri is assigned to the
37762 	 * MPLS TC(EXP) 1.
37763 	 */
37764 	uint8_t	tc1_pri_queue_id;
37765 	/*
37766 	 * pri assigned to MPLS TC(EXP) 2. This value can only be changed
37767 	 * before traffic has started.
37768 	 * A value of 0xff indicates that no pri is assigned to the
37769 	 * MPLS TC(EXP) 2.
37770 	 */
37771 	uint8_t	tc2_pri_queue_id;
37772 	/*
37773 	 * pri assigned to MPLS TC(EXP) 3. This value can only be changed
37774 	 * before traffic has started.
37775 	 * A value of 0xff indicates that no pri is assigned to the
37776 	 * MPLS TC(EXP) 3.
37777 	 */
37778 	uint8_t	tc3_pri_queue_id;
37779 	/*
37780 	 * pri assigned to MPLS TC(EXP) 4. This value can only be changed
37781 	 * before traffic has started.
37782 	 * A value of 0xff indicates that no pri is assigned to the
37783 	 * MPLS TC(EXP) 4.
37784 	 */
37785 	uint8_t	tc4_pri_queue_id;
37786 	/*
37787 	 * pri assigned to MPLS TC(EXP) 5. This value can only be changed
37788 	 * before traffic has started.
37789 	 * A value of 0xff indicates that no pri is assigned to the
37790 	 * MPLS TC(EXP) 5.
37791 	 */
37792 	uint8_t	tc5_pri_queue_id;
37793 	/*
37794 	 * pri assigned to MPLS TC(EXP) 6. This value can only
37795 	 * be changed before traffic has started.
37796 	 * A value of 0xff indicates that no pri is assigned to the
37797 	 * MPLS TC(EXP) 6.
37798 	 */
37799 	uint8_t	tc6_pri_queue_id;
37800 	/*
37801 	 * pri assigned to MPLS TC(EXP) 7. This value can only
37802 	 * be changed before traffic has started.
37803 	 * A value of 0xff indicates that no pri is assigned to the
37804 	 * MPLS TC(EXP) 7.
37805 	 */
37806 	uint8_t	tc7_pri_queue_id;
37807 	uint8_t	unused_0[7];
37808 	/*
37809 	 * This field is used in Output records to indicate that the output
37810 	 * is completely written to RAM. This field should be read as '1'
37811 	 * to indicate that the output has been completely written. When
37812 	 * writing a command completion or response to an internal processor,
37813 	 * the order of writes has to be such that this field is written last.
37814 	 */
37815 	uint8_t	valid;
37816 } hwrm_queue_mplstc2pri_qcfg_output_t, *phwrm_queue_mplstc2pri_qcfg_output_t;
37817 
37818 /*****************************
37819  * hwrm_queue_mplstc2pri_cfg *
37820  *****************************/
37821 
37822 
37823 /* hwrm_queue_mplstc2pri_cfg_input (size:256b/32B) */
37824 
37825 typedef struct hwrm_queue_mplstc2pri_cfg_input {
37826 	/* The HWRM command request type. */
37827 	uint16_t	req_type;
37828 	/*
37829 	 * The completion ring to send the completion event on. This should
37830 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37831 	 */
37832 	uint16_t	cmpl_ring;
37833 	/*
37834 	 * The sequence ID is used by the driver for tracking multiple
37835 	 * commands. This ID is treated as opaque data by the firmware and
37836 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37837 	 */
37838 	uint16_t	seq_id;
37839 	/*
37840 	 * The target ID of the command:
37841 	 * * 0x0-0xFFF8 - The function ID
37842 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37843 	 * * 0xFFFD - Reserved for user-space HWRM interface
37844 	 * * 0xFFFF - HWRM
37845 	 */
37846 	uint16_t	target_id;
37847 	/*
37848 	 * A physical address pointer pointing to a host buffer that the
37849 	 * command's response data will be written. This can be either a host
37850 	 * physical address (HPA) or a guest physical address (GPA) and must
37851 	 * point to a physically contiguous block of memory.
37852 	 */
37853 	uint64_t	resp_addr;
37854 	uint32_t	enables;
37855 	/*
37856 	 * This bit must be '1' for the mplstc0_pri_queue_id field to be
37857 	 * configured.
37858 	 */
37859 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC0_PRI_QUEUE_ID	UINT32_C(0x1)
37860 	/*
37861 	 * This bit must be '1' for the mplstc1_pri_queue_id field to be
37862 	 * configured.
37863 	 */
37864 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC1_PRI_QUEUE_ID	UINT32_C(0x2)
37865 	/*
37866 	 * This bit must be '1' for the mplstc2_pri_queue_id field to be
37867 	 * configured.
37868 	 */
37869 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC2_PRI_QUEUE_ID	UINT32_C(0x4)
37870 	/*
37871 	 * This bit must be '1' for the mplstc3_pri_queue_id field to be
37872 	 * configured.
37873 	 */
37874 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC3_PRI_QUEUE_ID	UINT32_C(0x8)
37875 	/*
37876 	 * This bit must be '1' for the mplstc4_pri_queue_id field to be
37877 	 * configured.
37878 	 */
37879 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC4_PRI_QUEUE_ID	UINT32_C(0x10)
37880 	/*
37881 	 * This bit must be '1' for the mplstc5_pri_queue_id field to be
37882 	 * configured.
37883 	 */
37884 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC5_PRI_QUEUE_ID	UINT32_C(0x20)
37885 	/*
37886 	 * This bit must be '1' for the mplstc6_pri_queue_id field to be
37887 	 * configured.
37888 	 */
37889 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC6_PRI_QUEUE_ID	UINT32_C(0x40)
37890 	/*
37891 	 * This bit must be '1' for the mplstc7_pri_queue_id field to be
37892 	 * configured.
37893 	 */
37894 	#define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC7_PRI_QUEUE_ID	UINT32_C(0x80)
37895 	/*
37896 	 * Port ID of port for which the table is being configured.
37897 	 * The HWRM needs to check whether this function is allowed
37898 	 * to configure MPLS TC(EXP)to pri mapping on this port.
37899 	 */
37900 	uint8_t	port_id;
37901 	uint8_t	unused_0[3];
37902 	/*
37903 	 * pri assigned to MPLS TC(EXP) 0. This value can only
37904 	 * be changed before traffic has started.
37905 	 */
37906 	uint8_t	tc0_pri_queue_id;
37907 	/*
37908 	 * pri assigned to MPLS TC(EXP) 1. This value can only
37909 	 * be changed before traffic has started.
37910 	 */
37911 	uint8_t	tc1_pri_queue_id;
37912 	/*
37913 	 * pri assigned to MPLS TC(EXP) 2. This value can only
37914 	 * be changed before traffic has started.
37915 	 */
37916 	uint8_t	tc2_pri_queue_id;
37917 	/*
37918 	 * pri assigned to MPLS TC(EXP) 3. This value can only
37919 	 * be changed before traffic has started.
37920 	 */
37921 	uint8_t	tc3_pri_queue_id;
37922 	/*
37923 	 * pri assigned to MPLS TC(EXP) 4. This value can only
37924 	 * be changed before traffic has started.
37925 	 */
37926 	uint8_t	tc4_pri_queue_id;
37927 	/*
37928 	 * pri assigned to MPLS TC(EXP) 5. This value can only
37929 	 * be changed before traffic has started.
37930 	 */
37931 	uint8_t	tc5_pri_queue_id;
37932 	/*
37933 	 * pri assigned to MPLS TC(EXP) 6. This value can only
37934 	 * be changed before traffic has started.
37935 	 */
37936 	uint8_t	tc6_pri_queue_id;
37937 	/*
37938 	 * pri assigned to MPLS TC(EXP) 7. This value can only
37939 	 * be changed before traffic has started.
37940 	 */
37941 	uint8_t	tc7_pri_queue_id;
37942 } hwrm_queue_mplstc2pri_cfg_input_t, *phwrm_queue_mplstc2pri_cfg_input_t;
37943 
37944 /* hwrm_queue_mplstc2pri_cfg_output (size:128b/16B) */
37945 
37946 typedef struct hwrm_queue_mplstc2pri_cfg_output {
37947 	/* The specific error status for the command. */
37948 	uint16_t	error_code;
37949 	/* The HWRM command request type. */
37950 	uint16_t	req_type;
37951 	/* The sequence ID from the original command. */
37952 	uint16_t	seq_id;
37953 	/* The length of the response data in number of bytes. */
37954 	uint16_t	resp_len;
37955 	uint8_t	unused_0[7];
37956 	/*
37957 	 * This field is used in Output records to indicate that the output
37958 	 * is completely written to RAM. This field should be read as '1'
37959 	 * to indicate that the output has been completely written. When
37960 	 * writing a command completion or response to an internal processor,
37961 	 * the order of writes has to be such that this field is written last.
37962 	 */
37963 	uint8_t	valid;
37964 } hwrm_queue_mplstc2pri_cfg_output_t, *phwrm_queue_mplstc2pri_cfg_output_t;
37965 
37966 /****************************
37967  * hwrm_queue_vlanpri_qcaps *
37968  ****************************/
37969 
37970 
37971 /* hwrm_queue_vlanpri_qcaps_input (size:192b/24B) */
37972 
37973 typedef struct hwrm_queue_vlanpri_qcaps_input {
37974 	/* The HWRM command request type. */
37975 	uint16_t	req_type;
37976 	/*
37977 	 * The completion ring to send the completion event on. This should
37978 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
37979 	 */
37980 	uint16_t	cmpl_ring;
37981 	/*
37982 	 * The sequence ID is used by the driver for tracking multiple
37983 	 * commands. This ID is treated as opaque data by the firmware and
37984 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
37985 	 */
37986 	uint16_t	seq_id;
37987 	/*
37988 	 * The target ID of the command:
37989 	 * * 0x0-0xFFF8 - The function ID
37990 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37991 	 * * 0xFFFD - Reserved for user-space HWRM interface
37992 	 * * 0xFFFF - HWRM
37993 	 */
37994 	uint16_t	target_id;
37995 	/*
37996 	 * A physical address pointer pointing to a host buffer that the
37997 	 * command's response data will be written. This can be either a host
37998 	 * physical address (HPA) or a guest physical address (GPA) and must
37999 	 * point to a physically contiguous block of memory.
38000 	 */
38001 	uint64_t	resp_addr;
38002 	/*
38003 	 * Port ID of port for which the table is being configured.
38004 	 * The HWRM needs to check whether this function is allowed
38005 	 * to configure VLAN priority to user priority mapping on this port.
38006 	 */
38007 	uint8_t	port_id;
38008 	uint8_t	unused_0[7];
38009 } hwrm_queue_vlanpri_qcaps_input_t, *phwrm_queue_vlanpri_qcaps_input_t;
38010 
38011 /* hwrm_queue_vlanpri_qcaps_output (size:128b/16B) */
38012 
38013 typedef struct hwrm_queue_vlanpri_qcaps_output {
38014 	/* The specific error status for the command. */
38015 	uint16_t	error_code;
38016 	/* The HWRM command request type. */
38017 	uint16_t	req_type;
38018 	/* The sequence ID from the original command. */
38019 	uint16_t	seq_id;
38020 	/* The length of the response data in number of bytes. */
38021 	uint16_t	resp_len;
38022 	/*
38023 	 * This is the default user priority which all VLAN priority values
38024 	 * are mapped to if there is no VLAN priority to user priority mapping.
38025 	 */
38026 	uint8_t	hw_default_pri;
38027 	uint8_t	unused_0[6];
38028 	/*
38029 	 * This field is used in Output records to indicate that the output
38030 	 * is completely written to RAM. This field should be read as '1'
38031 	 * to indicate that the output has been completely written. When
38032 	 * writing a command completion or response to an internal processor,
38033 	 * the order of writes has to be such that this field is written last.
38034 	 */
38035 	uint8_t	valid;
38036 } hwrm_queue_vlanpri_qcaps_output_t, *phwrm_queue_vlanpri_qcaps_output_t;
38037 
38038 /*******************************
38039  * hwrm_queue_vlanpri2pri_qcfg *
38040  *******************************/
38041 
38042 
38043 /* hwrm_queue_vlanpri2pri_qcfg_input (size:192b/24B) */
38044 
38045 typedef struct hwrm_queue_vlanpri2pri_qcfg_input {
38046 	/* The HWRM command request type. */
38047 	uint16_t	req_type;
38048 	/*
38049 	 * The completion ring to send the completion event on. This should
38050 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38051 	 */
38052 	uint16_t	cmpl_ring;
38053 	/*
38054 	 * The sequence ID is used by the driver for tracking multiple
38055 	 * commands. This ID is treated as opaque data by the firmware and
38056 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38057 	 */
38058 	uint16_t	seq_id;
38059 	/*
38060 	 * The target ID of the command:
38061 	 * * 0x0-0xFFF8 - The function ID
38062 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38063 	 * * 0xFFFD - Reserved for user-space HWRM interface
38064 	 * * 0xFFFF - HWRM
38065 	 */
38066 	uint16_t	target_id;
38067 	/*
38068 	 * A physical address pointer pointing to a host buffer that the
38069 	 * command's response data will be written. This can be either a host
38070 	 * physical address (HPA) or a guest physical address (GPA) and must
38071 	 * point to a physically contiguous block of memory.
38072 	 */
38073 	uint64_t	resp_addr;
38074 	/*
38075 	 * Port ID of port for which the table is being configured.
38076 	 * The HWRM needs to check whether this function is allowed
38077 	 * to configure VLAN priority to user priority mapping on this port.
38078 	 */
38079 	uint8_t	port_id;
38080 	uint8_t	unused_0[7];
38081 } hwrm_queue_vlanpri2pri_qcfg_input_t, *phwrm_queue_vlanpri2pri_qcfg_input_t;
38082 
38083 /* hwrm_queue_vlanpri2pri_qcfg_output (size:192b/24B) */
38084 
38085 typedef struct hwrm_queue_vlanpri2pri_qcfg_output {
38086 	/* The specific error status for the command. */
38087 	uint16_t	error_code;
38088 	/* The HWRM command request type. */
38089 	uint16_t	req_type;
38090 	/* The sequence ID from the original command. */
38091 	uint16_t	seq_id;
38092 	/* The length of the response data in number of bytes. */
38093 	uint16_t	resp_len;
38094 	/*
38095 	 * User priority assigned to VLAN priority 0. A value of 0xff
38096 	 * indicates that no user priority is assigned. The default user
38097 	 * priority will be used.
38098 	 */
38099 	uint8_t	vlanpri0_user_pri_id;
38100 	/*
38101 	 * User priority assigned to VLAN priority 1. A value of 0xff
38102 	 * indicates that no user priority is assigned. The default user
38103 	 * priority will be used.
38104 	 */
38105 	uint8_t	vlanpri1_user_pri_id;
38106 	/*
38107 	 * User priority assigned to VLAN priority 2. A value of 0xff
38108 	 * indicates that no user priority is assigned. The default user
38109 	 * priority will be used.
38110 	 */
38111 	uint8_t	vlanpri2_user_pri_id;
38112 	/*
38113 	 * User priority assigned to VLAN priority 3. A value of 0xff
38114 	 * indicates that no user priority is assigned. The default user
38115 	 * priority will be used.
38116 	 */
38117 	uint8_t	vlanpri3_user_pri_id;
38118 	/*
38119 	 * User priority assigned to VLAN priority 4. A value of 0xff
38120 	 * indicates that no user priority is assigned. The default user
38121 	 * priority will be used.
38122 	 */
38123 	uint8_t	vlanpri4_user_pri_id;
38124 	/*
38125 	 * User priority assigned to VLAN priority 5. A value of 0xff
38126 	 * indicates that no user priority is assigned. The default user
38127 	 * priority will be used.
38128 	 */
38129 	uint8_t	vlanpri5_user_pri_id;
38130 	/*
38131 	 * User priority assigned to VLAN priority 6. A value of 0xff
38132 	 * indicates that no user priority is assigned. The default user
38133 	 * priority will be used.
38134 	 */
38135 	uint8_t	vlanpri6_user_pri_id;
38136 	/*
38137 	 * User priority assigned to VLAN priority 7. A value of 0xff
38138 	 * indicates that no user priority is assigned. The default user
38139 	 * priority will be used.
38140 	 */
38141 	uint8_t	vlanpri7_user_pri_id;
38142 	uint8_t	unused_0[7];
38143 	/*
38144 	 * This field is used in Output records to indicate that the output
38145 	 * is completely written to RAM. This field should be read as '1'
38146 	 * to indicate that the output has been completely written. When
38147 	 * writing a command completion or response to an internal processor,
38148 	 * the order of writes has to be such that this field is written last.
38149 	 */
38150 	uint8_t	valid;
38151 } hwrm_queue_vlanpri2pri_qcfg_output_t, *phwrm_queue_vlanpri2pri_qcfg_output_t;
38152 
38153 /******************************
38154  * hwrm_queue_vlanpri2pri_cfg *
38155  ******************************/
38156 
38157 
38158 /* hwrm_queue_vlanpri2pri_cfg_input (size:256b/32B) */
38159 
38160 typedef struct hwrm_queue_vlanpri2pri_cfg_input {
38161 	/* The HWRM command request type. */
38162 	uint16_t	req_type;
38163 	/*
38164 	 * The completion ring to send the completion event on. This should
38165 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38166 	 */
38167 	uint16_t	cmpl_ring;
38168 	/*
38169 	 * The sequence ID is used by the driver for tracking multiple
38170 	 * commands. This ID is treated as opaque data by the firmware and
38171 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38172 	 */
38173 	uint16_t	seq_id;
38174 	/*
38175 	 * The target ID of the command:
38176 	 * * 0x0-0xFFF8 - The function ID
38177 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38178 	 * * 0xFFFD - Reserved for user-space HWRM interface
38179 	 * * 0xFFFF - HWRM
38180 	 */
38181 	uint16_t	target_id;
38182 	/*
38183 	 * A physical address pointer pointing to a host buffer that the
38184 	 * command's response data will be written. This can be either a host
38185 	 * physical address (HPA) or a guest physical address (GPA) and must
38186 	 * point to a physically contiguous block of memory.
38187 	 */
38188 	uint64_t	resp_addr;
38189 	uint32_t	enables;
38190 	/*
38191 	 * This bit must be '1' for the vlanpri0_user_pri_id field to be
38192 	 * configured.
38193 	 */
38194 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI0_USER_PRI_ID	UINT32_C(0x1)
38195 	/*
38196 	 * This bit must be '1' for the vlanpri1_user_pri_id field to be
38197 	 * configured.
38198 	 */
38199 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI1_USER_PRI_ID	UINT32_C(0x2)
38200 	/*
38201 	 * This bit must be '1' for the vlanpri2_user_pri_id field to be
38202 	 * configured.
38203 	 */
38204 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI2_USER_PRI_ID	UINT32_C(0x4)
38205 	/*
38206 	 * This bit must be '1' for the vlanpri3_user_pri_id field to be
38207 	 * configured.
38208 	 */
38209 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI3_USER_PRI_ID	UINT32_C(0x8)
38210 	/*
38211 	 * This bit must be '1' for the vlanpri4_user_pri_id field to be
38212 	 * configured.
38213 	 */
38214 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI4_USER_PRI_ID	UINT32_C(0x10)
38215 	/*
38216 	 * This bit must be '1' for the vlanpri5_user_pri_id field to be
38217 	 * configured.
38218 	 */
38219 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI5_USER_PRI_ID	UINT32_C(0x20)
38220 	/*
38221 	 * This bit must be '1' for the vlanpri6_user_pri_id field to be
38222 	 * configured.
38223 	 */
38224 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI6_USER_PRI_ID	UINT32_C(0x40)
38225 	/*
38226 	 * This bit must be '1' for the vlanpri7_user_pri_id field to be
38227 	 * configured.
38228 	 */
38229 	#define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI7_USER_PRI_ID	UINT32_C(0x80)
38230 	/*
38231 	 * Port ID of port for which the table is being configured.
38232 	 * The HWRM needs to check whether this function is allowed
38233 	 * to configure VLAN priority to user priority mapping on this port.
38234 	 */
38235 	uint8_t	port_id;
38236 	uint8_t	unused_0[3];
38237 	/*
38238 	 * User priority assigned to VLAN priority 0. This value can only
38239 	 * be changed before traffic has started.
38240 	 */
38241 	uint8_t	vlanpri0_user_pri_id;
38242 	/*
38243 	 * User priority assigned to VLAN priority 1. This value can only
38244 	 * be changed before traffic has started.
38245 	 */
38246 	uint8_t	vlanpri1_user_pri_id;
38247 	/*
38248 	 * User priority assigned to VLAN priority 2. This value can only
38249 	 * be changed before traffic has started.
38250 	 */
38251 	uint8_t	vlanpri2_user_pri_id;
38252 	/*
38253 	 * User priority assigned to VLAN priority 3. This value can only
38254 	 * be changed before traffic has started.
38255 	 */
38256 	uint8_t	vlanpri3_user_pri_id;
38257 	/*
38258 	 * User priority assigned to VLAN priority 4. This value can only
38259 	 * be changed before traffic has started.
38260 	 */
38261 	uint8_t	vlanpri4_user_pri_id;
38262 	/*
38263 	 * User priority assigned to VLAN priority 5. This value can only
38264 	 * be changed before traffic has started.
38265 	 */
38266 	uint8_t	vlanpri5_user_pri_id;
38267 	/*
38268 	 * User priority assigned to VLAN priority 6. This value can only
38269 	 * be changed before traffic has started.
38270 	 */
38271 	uint8_t	vlanpri6_user_pri_id;
38272 	/*
38273 	 * User priority assigned to VLAN priority 7. This value can only
38274 	 * be changed before traffic has started.
38275 	 */
38276 	uint8_t	vlanpri7_user_pri_id;
38277 } hwrm_queue_vlanpri2pri_cfg_input_t, *phwrm_queue_vlanpri2pri_cfg_input_t;
38278 
38279 /* hwrm_queue_vlanpri2pri_cfg_output (size:128b/16B) */
38280 
38281 typedef struct hwrm_queue_vlanpri2pri_cfg_output {
38282 	/* The specific error status for the command. */
38283 	uint16_t	error_code;
38284 	/* The HWRM command request type. */
38285 	uint16_t	req_type;
38286 	/* The sequence ID from the original command. */
38287 	uint16_t	seq_id;
38288 	/* The length of the response data in number of bytes. */
38289 	uint16_t	resp_len;
38290 	uint8_t	unused_0[7];
38291 	/*
38292 	 * This field is used in Output records to indicate that the output
38293 	 * is completely written to RAM. This field should be read as '1'
38294 	 * to indicate that the output has been completely written. When
38295 	 * writing a command completion or response to an internal processor,
38296 	 * the order of writes has to be such that this field is written last.
38297 	 */
38298 	uint8_t	valid;
38299 } hwrm_queue_vlanpri2pri_cfg_output_t, *phwrm_queue_vlanpri2pri_cfg_output_t;
38300 
38301 /*************************
38302  * hwrm_queue_global_cfg *
38303  *************************/
38304 
38305 
38306 /* hwrm_queue_global_cfg_input (size:192b/24B) */
38307 
38308 typedef struct hwrm_queue_global_cfg_input {
38309 	/* The HWRM command request type. */
38310 	uint16_t	req_type;
38311 	/*
38312 	 * The completion ring to send the completion event on. This should
38313 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38314 	 */
38315 	uint16_t	cmpl_ring;
38316 	/*
38317 	 * The sequence ID is used by the driver for tracking multiple
38318 	 * commands. This ID is treated as opaque data by the firmware and
38319 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38320 	 */
38321 	uint16_t	seq_id;
38322 	/*
38323 	 * The target ID of the command:
38324 	 * * 0x0-0xFFF8 - The function ID
38325 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38326 	 * * 0xFFFD - Reserved for user-space HWRM interface
38327 	 * * 0xFFFF - HWRM
38328 	 */
38329 	uint16_t	target_id;
38330 	/*
38331 	 * A physical address pointer pointing to a host buffer that the
38332 	 * command's response data will be written. This can be either a host
38333 	 * physical address (HPA) or a guest physical address (GPA) and must
38334 	 * point to a physically contiguous block of memory.
38335 	 */
38336 	uint64_t	resp_addr;
38337 	/*
38338 	 * Configuration mode for rx cos queues, configuring whether they
38339 	 * use one shared buffer pool (across ports or PCIe endpoints) or
38340 	 * independent per port or per endpoint buffer pools.
38341 	 */
38342 	uint8_t	mode;
38343 	/* One shared buffer pool to be used by all RX CoS queues */
38344 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_SHARED	UINT32_C(0x0)
38345 	/*
38346 	 * Each port or PCIe endpoint to use an independent buffer pool
38347 	 * for its RX CoS queues
38348 	 */
38349 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_INDEPENDENT UINT32_C(0x1)
38350 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_LAST	HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_INDEPENDENT
38351 	uint8_t	unused_0;
38352 	uint16_t	enables;
38353 	/* This bit must be '1' when the mode field is configured. */
38354 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_MODE	UINT32_C(0x1)
38355 	/*
38356 	 * This bit must be '1' when the maximum bandwidth for queue group 0
38357 	 * (g0_max_bw) is configured.
38358 	 */
38359 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_G0_MAX_BW	UINT32_C(0x2)
38360 	/*
38361 	 * This bit must be '1' when the maximum bandwidth for queue group 1
38362 	 * (g1_max_bw) is configured.
38363 	 */
38364 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_G1_MAX_BW	UINT32_C(0x4)
38365 	/*
38366 	 * This bit must be '1' when the maximum bandwidth for queue group 2
38367 	 * (g2_max_bw) is configured.
38368 	 */
38369 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_G2_MAX_BW	UINT32_C(0x8)
38370 	/*
38371 	 * This bit must be '1' when the maximum bandwidth for queue group 3
38372 	 * (g3_max_bw) is configured.
38373 	 */
38374 	#define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_G3_MAX_BW	UINT32_C(0x10)
38375 	/*
38376 	 * Specifies the maximum receive rate, as a percentage of total link
38377 	 * bandwidth, of the receive traffic through queue group 0. A value
38378 	 * of 0 indicates no rate limit.
38379 	 *
38380 	 * A queue group is a set of queues, one per traffic class. In
38381 	 * single-host mode, each panel port has its own queue group, and thus,
38382 	 * this rate limit shapes the traffic received on a port, in this case,
38383 	 * through port 0. In multi-root or multi-host mode, each PCIe endpoint
38384 	 * on the NIC has its own queue group. In these cases, the rate limit
38385 	 * shapes the traffic sent to the host through one of the PCIe
38386 	 * endpoints, in this case endpoint 0.
38387 	 */
38388 	uint8_t	g0_max_bw;
38389 	/*
38390 	 * Specifies the maximum rate of the traffic through receive CoS queue
38391 	 * group 1 (for port 1 or PCIe endpoint 1). The rate is a percentage of
38392 	 * total link bandwidth (the sum of the bandwidths of all links). A
38393 	 * value of 0 indicates no rate limit.
38394 	 */
38395 	uint8_t	g1_max_bw;
38396 	/*
38397 	 * Specifies the maximum rate of the traffic through receive CoS queue
38398 	 * group 2 (for port 2 or PCIe endpoint 2). The rate is a percentage of
38399 	 * total link bandwidth (the sum of the bandwidths of all links). A
38400 	 * value of 0 indicates no rate limit.
38401 	 */
38402 	uint8_t	g2_max_bw;
38403 	/*
38404 	 * Specifies the maximum receive rate, in Mbps, of the receive traffic
38405 	 * through queue group 3 (for port 3 or PCIe endpoint 3). A value of 0
38406 	 * indicates no rate limit.
38407 	 */
38408 	uint8_t	g3_max_bw;
38409 } hwrm_queue_global_cfg_input_t, *phwrm_queue_global_cfg_input_t;
38410 
38411 /* hwrm_queue_global_cfg_output (size:128b/16B) */
38412 
38413 typedef struct hwrm_queue_global_cfg_output {
38414 	/* The specific error status for the command. */
38415 	uint16_t	error_code;
38416 	/* The HWRM command request type. */
38417 	uint16_t	req_type;
38418 	/* The sequence ID from the original command. */
38419 	uint16_t	seq_id;
38420 	/* The length of the response data in number of bytes. */
38421 	uint16_t	resp_len;
38422 	uint8_t	unused_0[7];
38423 	/*
38424 	 * This field is used in Output records to indicate that the output
38425 	 * is completely written to RAM. This field should be read as '1'
38426 	 * to indicate that the output has been completely written. When
38427 	 * writing a command completion or response to an internal processor,
38428 	 * the order of writes has to be such that this field is written last.
38429 	 */
38430 	uint8_t	valid;
38431 } hwrm_queue_global_cfg_output_t, *phwrm_queue_global_cfg_output_t;
38432 
38433 /**************************
38434  * hwrm_queue_global_qcfg *
38435  **************************/
38436 
38437 
38438 /* hwrm_queue_global_qcfg_input (size:128b/16B) */
38439 
38440 typedef struct hwrm_queue_global_qcfg_input {
38441 	/* The HWRM command request type. */
38442 	uint16_t	req_type;
38443 	/*
38444 	 * The completion ring to send the completion event on. This should
38445 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38446 	 */
38447 	uint16_t	cmpl_ring;
38448 	/*
38449 	 * The sequence ID is used by the driver for tracking multiple
38450 	 * commands. This ID is treated as opaque data by the firmware and
38451 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38452 	 */
38453 	uint16_t	seq_id;
38454 	/*
38455 	 * The target ID of the command:
38456 	 * * 0x0-0xFFF8 - The function ID
38457 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38458 	 * * 0xFFFD - Reserved for user-space HWRM interface
38459 	 * * 0xFFFF - HWRM
38460 	 */
38461 	uint16_t	target_id;
38462 	/*
38463 	 * A physical address pointer pointing to a host buffer that the
38464 	 * command's response data will be written. This can be either a host
38465 	 * physical address (HPA) or a guest physical address (GPA) and must
38466 	 * point to a physically contiguous block of memory.
38467 	 */
38468 	uint64_t	resp_addr;
38469 } hwrm_queue_global_qcfg_input_t, *phwrm_queue_global_qcfg_input_t;
38470 
38471 /* hwrm_queue_global_qcfg_output (size:320b/40B) */
38472 
38473 typedef struct hwrm_queue_global_qcfg_output {
38474 	/* The specific error status for the command. */
38475 	uint16_t	error_code;
38476 	/* The HWRM command request type. */
38477 	uint16_t	req_type;
38478 	/* The sequence ID from the original command. */
38479 	uint16_t	seq_id;
38480 	/* The length of the response data in number of bytes. */
38481 	uint16_t	resp_len;
38482 	/* Port or PCIe endpoint id to be mapped for buffer pool 0. */
38483 	uint8_t	buffer_pool_id0_map;
38484 	/* Port or PCIe endpoint id to be mapped for buffer pool 1. */
38485 	uint8_t	buffer_pool_id1_map;
38486 	/* Port or PCIe endpoint id to be mapped for buffer pool 2. */
38487 	uint8_t	buffer_pool_id2_map;
38488 	/* Port or PCIe endpoint id to be mapped for buffer pool 3. */
38489 	uint8_t	buffer_pool_id3_map;
38490 	/* Size of buffer pool 0 (KBytes). */
38491 	uint32_t	buffer_pool_id0_size;
38492 	/* Size of buffer pool 1 (KBytes). */
38493 	uint32_t	buffer_pool_id1_size;
38494 	/* Size of buffer pool 2 (KBytes). */
38495 	uint32_t	buffer_pool_id2_size;
38496 	/* Size of buffer pool 3 (KBytes). */
38497 	uint32_t	buffer_pool_id3_size;
38498 	uint16_t	flags;
38499 	/*
38500 	 * Enumeration denoting whether the rx buffer pool mapping is
38501 	 * per port or per PCIe endpoint
38502 	 */
38503 	#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING			UINT32_C(0x1)
38504 	/*
38505 	 * The buffer_pool_id[0-3]_map field represents mapping of rx
38506 	 * buffer pools to a port.
38507 	 */
38508 		#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_MAPPING_PER_PORT	UINT32_C(0x0)
38509 	/*
38510 	 * The buffer_pool_id[0-3]_map field represents mapping of rx
38511 	 * buffer pools to a PCIe endpoint.
38512 	 */
38513 		#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_MAPPING_PER_ENDPOINT  UINT32_C(0x1)
38514 		#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_LAST		HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_MAPPING_PER_ENDPOINT
38515 	/*
38516 	 * Configuration mode for rx cos queues, configuring whether they
38517 	 * use one shared buffer pool (across ports or PCIe endpoints) or
38518 	 * independent per port or per endpoint buffer pools.
38519 	 */
38520 	uint8_t	mode;
38521 	/* One shared buffer pool to be used by all RX CoS queues */
38522 	#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_SHARED	UINT32_C(0x0)
38523 	/*
38524 	 * Each port or PCIe endpoint to use an independent buffer pool
38525 	 * for its RX CoS queues
38526 	 */
38527 	#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_INDEPENDENT UINT32_C(0x1)
38528 	#define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_LAST	HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_INDEPENDENT
38529 	uint8_t	unused_0;
38530 	/*
38531 	 * Reports the rate limit applied to traffic through receive CoS queue
38532 	 * group 0. The rate limit is a percentage of total link bandwidth. A
38533 	 * value of 0 indicates no rate limit.
38534 	 *
38535 	 * A queue group is a set of queues, one per traffic class. In
38536 	 * single-host mode, each panel port has its own queue group, and thus,
38537 	 * this rate limit shapes the traffic received on a port, in this case,
38538 	 * through port 0. In multi-root or multi-host mode, each PCIe endpoint
38539 	 * on the NIC has its own queue group. In these cases, the rate limit
38540 	 * shapes the traffic sent to the host through one of the PCIe
38541 	 * endpoints, in this case endpoint 0.
38542 	 */
38543 	uint8_t	g0_max_bw;
38544 	/*
38545 	 * Reports the rate limit applied to traffic through receive CoS queue
38546 	 * group 1 (for port 1 or PCIe endpoint 1). The rate limit is a
38547 	 * percentage of total link bandwidth. A value of 0 indicates no rate
38548 	 * limit.
38549 	 */
38550 	uint8_t	g1_max_bw;
38551 	/*
38552 	 * Reports the rate limit applied to traffic through receive CoS queue
38553 	 * group 2 (for port 2 or PCIe endpoint 2). The rate limit is a
38554 	 * percentage of total link bandwidth. A value of 0 indicates no rate
38555 	 * limit.
38556 	 */
38557 	uint8_t	g2_max_bw;
38558 	/*
38559 	 * Reports the rate limit applied to traffic through receive CoS queue
38560 	 * group 3 (for port 3 or PCIe endpoint 3). The rate limit is a
38561 	 * percentage of total link bandwidth. A value of 0 indicates no rate
38562 	 * limit.
38563 	 */
38564 	uint8_t	g3_max_bw;
38565 	uint8_t	unused_1[3];
38566 	/*
38567 	 * This field is used in Output records to indicate that the output
38568 	 * is completely written to RAM. This field should be read as '1'
38569 	 * to indicate that the output has been completely written. When
38570 	 * writing a command completion or response to an internal processor,
38571 	 * the order of writes has to be such that this field is written last.
38572 	 */
38573 	uint8_t	valid;
38574 } hwrm_queue_global_qcfg_output_t, *phwrm_queue_global_qcfg_output_t;
38575 
38576 /****************************************
38577  * hwrm_queue_adptv_qos_rx_feature_qcfg *
38578  ****************************************/
38579 
38580 
38581 /* hwrm_queue_adptv_qos_rx_feature_qcfg_input (size:128b/16B) */
38582 
38583 typedef struct hwrm_queue_adptv_qos_rx_feature_qcfg_input {
38584 	/* The HWRM command request type. */
38585 	uint16_t	req_type;
38586 	/*
38587 	 * The completion ring to send the completion event on. This should
38588 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38589 	 */
38590 	uint16_t	cmpl_ring;
38591 	/*
38592 	 * The sequence ID is used by the driver for tracking multiple
38593 	 * commands. This ID is treated as opaque data by the firmware and
38594 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38595 	 */
38596 	uint16_t	seq_id;
38597 	/*
38598 	 * The target ID of the command:
38599 	 * * 0x0-0xFFF8 - The function ID
38600 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38601 	 * * 0xFFFD - Reserved for user-space HWRM interface
38602 	 * * 0xFFFF - HWRM
38603 	 */
38604 	uint16_t	target_id;
38605 	/*
38606 	 * A physical address pointer pointing to a host buffer that the
38607 	 * command's response data will be written. This can be either a host
38608 	 * physical address (HPA) or a guest physical address (GPA) and must
38609 	 * point to a physically contiguous block of memory.
38610 	 */
38611 	uint64_t	resp_addr;
38612 } hwrm_queue_adptv_qos_rx_feature_qcfg_input_t, *phwrm_queue_adptv_qos_rx_feature_qcfg_input_t;
38613 
38614 /* hwrm_queue_adptv_qos_rx_feature_qcfg_output (size:128b/16B) */
38615 
38616 typedef struct hwrm_queue_adptv_qos_rx_feature_qcfg_output {
38617 	/* The specific error status for the command. */
38618 	uint16_t	error_code;
38619 	/* The HWRM command request type. */
38620 	uint16_t	req_type;
38621 	/* The sequence ID from the original command. */
38622 	uint16_t	seq_id;
38623 	/* The length of the response data in number of bytes. */
38624 	uint16_t	resp_len;
38625 	/*
38626 	 * Bitmask indicating which RX CoS queues are enabled or disabled.
38627 	 *
38628 	 * Each bit represents a specific queue where bit 0 represents
38629 	 * queue 0 and bit 7 represents queue 7.
38630 	 * A value of 0 indicates that the queue is not enabled.
38631 	 * A value of 1 indicates that the queue is enabled.
38632 	 */
38633 	uint8_t	queue_enable;
38634 	/* If set to 1, then the queue is enabled. */
38635 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID0_ENABLE	UINT32_C(0x1)
38636 	/* Queue is disabled. */
38637 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID0_ENABLE_DISABLED  UINT32_C(0x0)
38638 	/* Queue is enabled. */
38639 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID0_ENABLE_ENABLED   UINT32_C(0x1)
38640 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID0_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID0_ENABLE_ENABLED
38641 	/* If set to 1, then the queue is enabled. */
38642 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID1_ENABLE	UINT32_C(0x2)
38643 	/* Queue is disabled. */
38644 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID1_ENABLE_DISABLED  (UINT32_C(0x0) << 1)
38645 	/* Queue is enabled. */
38646 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID1_ENABLE_ENABLED   (UINT32_C(0x1) << 1)
38647 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID1_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID1_ENABLE_ENABLED
38648 	/* If set to 1, then the queue is enabled. */
38649 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID2_ENABLE	UINT32_C(0x4)
38650 	/* Queue is disabled. */
38651 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID2_ENABLE_DISABLED  (UINT32_C(0x0) << 2)
38652 	/* Queue is enabled. */
38653 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID2_ENABLE_ENABLED   (UINT32_C(0x1) << 2)
38654 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID2_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID2_ENABLE_ENABLED
38655 	/* If set to 1, then the queue is enabled. */
38656 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID3_ENABLE	UINT32_C(0x8)
38657 	/* Queue is disabled. */
38658 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID3_ENABLE_DISABLED  (UINT32_C(0x0) << 3)
38659 	/* Queue is enabled. */
38660 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID3_ENABLE_ENABLED   (UINT32_C(0x1) << 3)
38661 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID3_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID3_ENABLE_ENABLED
38662 	/* If set to 1, then the queue is enabled. */
38663 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID4_ENABLE	UINT32_C(0x10)
38664 	/* Queue is disabled. */
38665 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID4_ENABLE_DISABLED  (UINT32_C(0x0) << 4)
38666 	/* Queue is enabled. */
38667 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID4_ENABLE_ENABLED   (UINT32_C(0x1) << 4)
38668 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID4_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID4_ENABLE_ENABLED
38669 	/* If set to 1, then the queue is enabled. */
38670 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID5_ENABLE	UINT32_C(0x20)
38671 	/* Queue is disabled. */
38672 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID5_ENABLE_DISABLED  (UINT32_C(0x0) << 5)
38673 	/* Queue is enabled. */
38674 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID5_ENABLE_ENABLED   (UINT32_C(0x1) << 5)
38675 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID5_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID5_ENABLE_ENABLED
38676 	/* If set to 1, then the queue is enabled. */
38677 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID6_ENABLE	UINT32_C(0x40)
38678 	/* Queue is disabled. */
38679 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID6_ENABLE_DISABLED  (UINT32_C(0x0) << 6)
38680 	/* Queue is enabled. */
38681 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID6_ENABLE_ENABLED   (UINT32_C(0x1) << 6)
38682 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID6_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID6_ENABLE_ENABLED
38683 	/* If set to 1, then the queue is enabled. */
38684 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID7_ENABLE	UINT32_C(0x80)
38685 	/* Queue is disabled. */
38686 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID7_ENABLE_DISABLED  (UINT32_C(0x0) << 7)
38687 	/* Queue is enabled. */
38688 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID7_ENABLE_ENABLED   (UINT32_C(0x1) << 7)
38689 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID7_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID7_ENABLE_ENABLED
38690 	/*
38691 	 * Bitmask indicating which CoS queues are lossy or lossless.
38692 	 * This setting is kept same across Rx and Tx directions, despite
38693 	 * the name mentioning only Rx. Each bit represents a specific queue
38694 	 * where bit 0 represents queue 0 and bit 7 represents queue 7.
38695 	 * A value of 0 indicates that the queue is lossy.
38696 	 * A value of 1 indicates that the queue is lossless.
38697 	 */
38698 	uint8_t	queue_mode;
38699 	/* If set to 0, then the queue is lossy, else lossless. */
38700 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID0_MODE	UINT32_C(0x1)
38701 	/* Lossy (best-effort). */
38702 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID0_MODE_LOSSY	UINT32_C(0x0)
38703 	/* Lossless. */
38704 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID0_MODE_LOSSLESS  UINT32_C(0x1)
38705 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID0_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID0_MODE_LOSSLESS
38706 	/* If set to 0, then the queue is lossy, else lossless. */
38707 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID1_MODE	UINT32_C(0x2)
38708 	/* Lossy (best-effort). */
38709 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID1_MODE_LOSSY	(UINT32_C(0x0) << 1)
38710 	/* Lossless. */
38711 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID1_MODE_LOSSLESS  (UINT32_C(0x1) << 1)
38712 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID1_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID1_MODE_LOSSLESS
38713 	/* If set to 0, then the queue is lossy, else lossless. */
38714 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID2_MODE	UINT32_C(0x4)
38715 	/* Lossy (best-effort). */
38716 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID2_MODE_LOSSY	(UINT32_C(0x0) << 2)
38717 	/* Lossless. */
38718 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID2_MODE_LOSSLESS  (UINT32_C(0x1) << 2)
38719 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID2_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID2_MODE_LOSSLESS
38720 	/* If set to 0, then the queue is lossy, else lossless. */
38721 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID3_MODE	UINT32_C(0x8)
38722 	/* Lossy (best-effort). */
38723 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID3_MODE_LOSSY	(UINT32_C(0x0) << 3)
38724 	/* Lossless. */
38725 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID3_MODE_LOSSLESS  (UINT32_C(0x1) << 3)
38726 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID3_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID3_MODE_LOSSLESS
38727 	/* If set to 0, then the queue is lossy, else lossless. */
38728 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID4_MODE	UINT32_C(0x10)
38729 	/* Lossy (best-effort). */
38730 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID4_MODE_LOSSY	(UINT32_C(0x0) << 4)
38731 	/* Lossless. */
38732 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID4_MODE_LOSSLESS  (UINT32_C(0x1) << 4)
38733 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID4_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID4_MODE_LOSSLESS
38734 	/* If set to 0, then the queue is lossy, else lossless. */
38735 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID5_MODE	UINT32_C(0x20)
38736 	/* Lossy (best-effort). */
38737 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID5_MODE_LOSSY	(UINT32_C(0x0) << 5)
38738 	/* Lossless. */
38739 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID5_MODE_LOSSLESS  (UINT32_C(0x1) << 5)
38740 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID5_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID5_MODE_LOSSLESS
38741 	/* If set to 0, then the queue is lossy, else lossless. */
38742 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID6_MODE	UINT32_C(0x40)
38743 	/* Lossy (best-effort). */
38744 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID6_MODE_LOSSY	(UINT32_C(0x0) << 6)
38745 	/* Lossless. */
38746 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID6_MODE_LOSSLESS  (UINT32_C(0x1) << 6)
38747 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID6_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID6_MODE_LOSSLESS
38748 	/* If set to 0, then the queue is lossy, else lossless. */
38749 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID7_MODE	UINT32_C(0x80)
38750 	/* Lossy (best-effort). */
38751 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID7_MODE_LOSSY	(UINT32_C(0x0) << 7)
38752 	/* Lossless. */
38753 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID7_MODE_LOSSLESS  (UINT32_C(0x1) << 7)
38754 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID7_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG_OUTPUT_QUEUE_MODE_QID7_MODE_LOSSLESS
38755 	uint8_t	unused_0[5];
38756 	/*
38757 	 * This field is used in Output records to indicate that the output
38758 	 * is completely written to RAM. This field should be read as '1'
38759 	 * to indicate that the output has been completely written. When
38760 	 * writing a command completion or response to an internal processor,
38761 	 * the order of writes has to be such that this field is written last.
38762 	 */
38763 	uint8_t	valid;
38764 } hwrm_queue_adptv_qos_rx_feature_qcfg_output_t, *phwrm_queue_adptv_qos_rx_feature_qcfg_output_t;
38765 
38766 /***************************************
38767  * hwrm_queue_adptv_qos_rx_feature_cfg *
38768  ***************************************/
38769 
38770 
38771 /* hwrm_queue_adptv_qos_rx_feature_cfg_input (size:192b/24B) */
38772 
38773 typedef struct hwrm_queue_adptv_qos_rx_feature_cfg_input {
38774 	/* The HWRM command request type. */
38775 	uint16_t	req_type;
38776 	/*
38777 	 * The completion ring to send the completion event on. This should
38778 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38779 	 */
38780 	uint16_t	cmpl_ring;
38781 	/*
38782 	 * The sequence ID is used by the driver for tracking multiple
38783 	 * commands. This ID is treated as opaque data by the firmware and
38784 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38785 	 */
38786 	uint16_t	seq_id;
38787 	/*
38788 	 * The target ID of the command:
38789 	 * * 0x0-0xFFF8 - The function ID
38790 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38791 	 * * 0xFFFD - Reserved for user-space HWRM interface
38792 	 * * 0xFFFF - HWRM
38793 	 */
38794 	uint16_t	target_id;
38795 	/*
38796 	 * A physical address pointer pointing to a host buffer that the
38797 	 * command's response data will be written. This can be either a host
38798 	 * physical address (HPA) or a guest physical address (GPA) and must
38799 	 * point to a physically contiguous block of memory.
38800 	 */
38801 	uint64_t	resp_addr;
38802 	uint32_t	enables;
38803 	/* This bit must be '1' for the queue_enable field to be configured. */
38804 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_ENABLES_QUEUE_ENABLE	UINT32_C(0x1)
38805 	/* This bit must be '1' for the queue_mode field to be configured. */
38806 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_ENABLES_QUEUE_MODE	UINT32_C(0x2)
38807 	/*
38808 	 * Bitmask indicating which RX CoS queues are enabled or disabled.
38809 	 *
38810 	 * Each bit represents a specific queue where bit 0 represents
38811 	 * queue 0 and bit 7 represents queue 7.
38812 	 * A value of 0 indicates that the queue is not enabled.
38813 	 * A value of 1 indicates that the queue is enabled.
38814 	 */
38815 	uint8_t	queue_enable;
38816 	/* If set to 1, then the queue is enabled. */
38817 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID0_ENABLE	UINT32_C(0x1)
38818 	/* Queue is disabled. */
38819 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID0_ENABLE_DISABLED  UINT32_C(0x0)
38820 	/* Queue is enabled. */
38821 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID0_ENABLE_ENABLED   UINT32_C(0x1)
38822 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID0_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID0_ENABLE_ENABLED
38823 	/* If set to 1, then the queue is enabled. */
38824 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID1_ENABLE	UINT32_C(0x2)
38825 	/* Queue is disabled. */
38826 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID1_ENABLE_DISABLED  (UINT32_C(0x0) << 1)
38827 	/* Queue is enabled. */
38828 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID1_ENABLE_ENABLED   (UINT32_C(0x1) << 1)
38829 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID1_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID1_ENABLE_ENABLED
38830 	/* If set to 1, then the queue is enabled. */
38831 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID2_ENABLE	UINT32_C(0x4)
38832 	/* Queue is disabled. */
38833 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID2_ENABLE_DISABLED  (UINT32_C(0x0) << 2)
38834 	/* Queue is enabled. */
38835 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID2_ENABLE_ENABLED   (UINT32_C(0x1) << 2)
38836 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID2_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID2_ENABLE_ENABLED
38837 	/* If set to 1, then the queue is enabled. */
38838 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID3_ENABLE	UINT32_C(0x8)
38839 	/* Queue is disabled. */
38840 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID3_ENABLE_DISABLED  (UINT32_C(0x0) << 3)
38841 	/* Queue is enabled. */
38842 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID3_ENABLE_ENABLED   (UINT32_C(0x1) << 3)
38843 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID3_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID3_ENABLE_ENABLED
38844 	/* If set to 1, then the queue is enabled. */
38845 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID4_ENABLE	UINT32_C(0x10)
38846 	/* Queue is disabled. */
38847 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID4_ENABLE_DISABLED  (UINT32_C(0x0) << 4)
38848 	/* Queue is enabled. */
38849 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID4_ENABLE_ENABLED   (UINT32_C(0x1) << 4)
38850 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID4_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID4_ENABLE_ENABLED
38851 	/* If set to 1, then the queue is enabled. */
38852 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID5_ENABLE	UINT32_C(0x20)
38853 	/* Queue is disabled. */
38854 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID5_ENABLE_DISABLED  (UINT32_C(0x0) << 5)
38855 	/* Queue is enabled. */
38856 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID5_ENABLE_ENABLED   (UINT32_C(0x1) << 5)
38857 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID5_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID5_ENABLE_ENABLED
38858 	/* If set to 1, then the queue is enabled. */
38859 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID6_ENABLE	UINT32_C(0x40)
38860 	/* Queue is disabled. */
38861 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID6_ENABLE_DISABLED  (UINT32_C(0x0) << 6)
38862 	/* Queue is enabled. */
38863 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID6_ENABLE_ENABLED   (UINT32_C(0x1) << 6)
38864 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID6_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID6_ENABLE_ENABLED
38865 	/* If set to 1, then the queue is enabled. */
38866 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID7_ENABLE	UINT32_C(0x80)
38867 	/* Queue is disabled. */
38868 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID7_ENABLE_DISABLED  (UINT32_C(0x0) << 7)
38869 	/* Queue is enabled. */
38870 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID7_ENABLE_ENABLED   (UINT32_C(0x1) << 7)
38871 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID7_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID7_ENABLE_ENABLED
38872 	/*
38873 	 * Bitmask indicating which CoS queues are lossy or lossless.
38874 	 * This setting is kept symmetric (or same) across Tx and Rx.
38875 	 * Each bit represents a specific queue where bit 0 represents
38876 	 * queue 0 and bit 7 represents queue 7.
38877 	 * A value of 0 indicates that the queue is lossy.
38878 	 * A value of 1 indicates that the queue is lossless.
38879 	 */
38880 	uint8_t	queue_mode;
38881 	/* If set to 0, then the queue is lossy, else lossless. */
38882 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID0_MODE	UINT32_C(0x1)
38883 	/* Lossy (best-effort). */
38884 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID0_MODE_LOSSY	UINT32_C(0x0)
38885 	/* Lossless. */
38886 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID0_MODE_LOSSLESS  UINT32_C(0x1)
38887 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID0_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID0_MODE_LOSSLESS
38888 	/* If set to 0, then the queue is lossy, else lossless. */
38889 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID1_MODE	UINT32_C(0x2)
38890 	/* Lossy (best-effort). */
38891 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID1_MODE_LOSSY	(UINT32_C(0x0) << 1)
38892 	/* Lossless. */
38893 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID1_MODE_LOSSLESS  (UINT32_C(0x1) << 1)
38894 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID1_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID1_MODE_LOSSLESS
38895 	/* If set to 0, then the queue is lossy, else lossless. */
38896 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID2_MODE	UINT32_C(0x4)
38897 	/* Lossy (best-effort). */
38898 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID2_MODE_LOSSY	(UINT32_C(0x0) << 2)
38899 	/* Lossless. */
38900 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID2_MODE_LOSSLESS  (UINT32_C(0x1) << 2)
38901 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID2_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID2_MODE_LOSSLESS
38902 	/* If set to 0, then the queue is lossy, else lossless. */
38903 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID3_MODE	UINT32_C(0x8)
38904 	/* Lossy (best-effort). */
38905 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID3_MODE_LOSSY	(UINT32_C(0x0) << 3)
38906 	/* Lossless. */
38907 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID3_MODE_LOSSLESS  (UINT32_C(0x1) << 3)
38908 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID3_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID3_MODE_LOSSLESS
38909 	/* If set to 0, then the queue is lossy, else lossless. */
38910 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID4_MODE	UINT32_C(0x10)
38911 	/* Lossy (best-effort). */
38912 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID4_MODE_LOSSY	(UINT32_C(0x0) << 4)
38913 	/* Lossless. */
38914 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID4_MODE_LOSSLESS  (UINT32_C(0x1) << 4)
38915 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID4_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID4_MODE_LOSSLESS
38916 	/* If set to 0, then the queue is lossy, else lossless. */
38917 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID5_MODE	UINT32_C(0x20)
38918 	/* Lossy (best-effort). */
38919 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID5_MODE_LOSSY	(UINT32_C(0x0) << 5)
38920 	/* Lossless. */
38921 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID5_MODE_LOSSLESS  (UINT32_C(0x1) << 5)
38922 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID5_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID5_MODE_LOSSLESS
38923 	/* If set to 0, then the queue is lossy, else lossless. */
38924 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID6_MODE	UINT32_C(0x40)
38925 	/* Lossy (best-effort). */
38926 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID6_MODE_LOSSY	(UINT32_C(0x0) << 6)
38927 	/* Lossless. */
38928 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID6_MODE_LOSSLESS  (UINT32_C(0x1) << 6)
38929 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID6_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID6_MODE_LOSSLESS
38930 	/* If set to 0, then the queue is lossy, else lossless. */
38931 	#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID7_MODE	UINT32_C(0x80)
38932 	/* Lossy (best-effort). */
38933 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID7_MODE_LOSSY	(UINT32_C(0x0) << 7)
38934 	/* Lossless. */
38935 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID7_MODE_LOSSLESS  (UINT32_C(0x1) << 7)
38936 		#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID7_MODE_LAST	HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG_INPUT_QUEUE_MODE_QID7_MODE_LOSSLESS
38937 	uint8_t	unused_0[2];
38938 } hwrm_queue_adptv_qos_rx_feature_cfg_input_t, *phwrm_queue_adptv_qos_rx_feature_cfg_input_t;
38939 
38940 /* hwrm_queue_adptv_qos_rx_feature_cfg_output (size:128b/16B) */
38941 
38942 typedef struct hwrm_queue_adptv_qos_rx_feature_cfg_output {
38943 	/* The specific error status for the command. */
38944 	uint16_t	error_code;
38945 	/* The HWRM command request type. */
38946 	uint16_t	req_type;
38947 	/* The sequence ID from the original command. */
38948 	uint16_t	seq_id;
38949 	/* The length of the response data in number of bytes. */
38950 	uint16_t	resp_len;
38951 	uint8_t	unused_0[7];
38952 	/*
38953 	 * This field is used in Output records to indicate that the output
38954 	 * is completely written to RAM. This field should be read as '1'
38955 	 * to indicate that the output has been completely written. When
38956 	 * writing a command completion or response to an internal processor,
38957 	 * the order of writes has to be such that this field is written last.
38958 	 */
38959 	uint8_t	valid;
38960 } hwrm_queue_adptv_qos_rx_feature_cfg_output_t, *phwrm_queue_adptv_qos_rx_feature_cfg_output_t;
38961 
38962 /****************************************
38963  * hwrm_queue_adptv_qos_tx_feature_qcfg *
38964  ****************************************/
38965 
38966 
38967 /* hwrm_queue_adptv_qos_tx_feature_qcfg_input (size:128b/16B) */
38968 
38969 typedef struct hwrm_queue_adptv_qos_tx_feature_qcfg_input {
38970 	/* The HWRM command request type. */
38971 	uint16_t	req_type;
38972 	/*
38973 	 * The completion ring to send the completion event on. This should
38974 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
38975 	 */
38976 	uint16_t	cmpl_ring;
38977 	/*
38978 	 * The sequence ID is used by the driver for tracking multiple
38979 	 * commands. This ID is treated as opaque data by the firmware and
38980 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
38981 	 */
38982 	uint16_t	seq_id;
38983 	/*
38984 	 * The target ID of the command:
38985 	 * * 0x0-0xFFF8 - The function ID
38986 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38987 	 * * 0xFFFD - Reserved for user-space HWRM interface
38988 	 * * 0xFFFF - HWRM
38989 	 */
38990 	uint16_t	target_id;
38991 	/*
38992 	 * A physical address pointer pointing to a host buffer that the
38993 	 * command's response data will be written. This can be either a host
38994 	 * physical address (HPA) or a guest physical address (GPA) and must
38995 	 * point to a physically contiguous block of memory.
38996 	 */
38997 	uint64_t	resp_addr;
38998 } hwrm_queue_adptv_qos_tx_feature_qcfg_input_t, *phwrm_queue_adptv_qos_tx_feature_qcfg_input_t;
38999 
39000 /* hwrm_queue_adptv_qos_tx_feature_qcfg_output (size:128b/16B) */
39001 
39002 typedef struct hwrm_queue_adptv_qos_tx_feature_qcfg_output {
39003 	/* The specific error status for the command. */
39004 	uint16_t	error_code;
39005 	/* The HWRM command request type. */
39006 	uint16_t	req_type;
39007 	/* The sequence ID from the original command. */
39008 	uint16_t	seq_id;
39009 	/* The length of the response data in number of bytes. */
39010 	uint16_t	resp_len;
39011 	/*
39012 	 * Bitmask indicating which TX CoS queues are enabled or disabled.
39013 	 *
39014 	 * Each bit represents a specific queue where bit 0 represents
39015 	 * queue 0 and bit 7 represents queue 7.
39016 	 * A value of 0 indicates that the queue is not enabled.
39017 	 * A value of 1 indicates that the queue is enabled.
39018 	 */
39019 	uint8_t	queue_enable;
39020 	/* If set to 1, then the queue is enabled. */
39021 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID0_ENABLE	UINT32_C(0x1)
39022 	/* Queue is disabled. */
39023 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID0_ENABLE_DISABLED  UINT32_C(0x0)
39024 	/* Queue is enabled. */
39025 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID0_ENABLE_ENABLED   UINT32_C(0x1)
39026 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID0_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID0_ENABLE_ENABLED
39027 	/* If set to 1, then the queue is enabled. */
39028 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID1_ENABLE	UINT32_C(0x2)
39029 	/* Queue is disabled. */
39030 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID1_ENABLE_DISABLED  (UINT32_C(0x0) << 1)
39031 	/* Queue is enabled. */
39032 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID1_ENABLE_ENABLED   (UINT32_C(0x1) << 1)
39033 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID1_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID1_ENABLE_ENABLED
39034 	/* If set to 1, then the queue is enabled. */
39035 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID2_ENABLE	UINT32_C(0x4)
39036 	/* Queue is disabled. */
39037 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID2_ENABLE_DISABLED  (UINT32_C(0x0) << 2)
39038 	/* Queue is enabled. */
39039 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID2_ENABLE_ENABLED   (UINT32_C(0x1) << 2)
39040 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID2_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID2_ENABLE_ENABLED
39041 	/* If set to 1, then the queue is enabled. */
39042 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID3_ENABLE	UINT32_C(0x8)
39043 	/* Queue is disabled. */
39044 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID3_ENABLE_DISABLED  (UINT32_C(0x0) << 3)
39045 	/* Queue is enabled. */
39046 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID3_ENABLE_ENABLED   (UINT32_C(0x1) << 3)
39047 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID3_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID3_ENABLE_ENABLED
39048 	/* If set to 1, then the queue is enabled. */
39049 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID4_ENABLE	UINT32_C(0x10)
39050 	/* Queue is disabled. */
39051 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID4_ENABLE_DISABLED  (UINT32_C(0x0) << 4)
39052 	/* Queue is enabled. */
39053 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID4_ENABLE_ENABLED   (UINT32_C(0x1) << 4)
39054 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID4_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID4_ENABLE_ENABLED
39055 	/* If set to 1, then the queue is enabled. */
39056 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID5_ENABLE	UINT32_C(0x20)
39057 	/* Queue is disabled. */
39058 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID5_ENABLE_DISABLED  (UINT32_C(0x0) << 5)
39059 	/* Queue is enabled. */
39060 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID5_ENABLE_ENABLED   (UINT32_C(0x1) << 5)
39061 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID5_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID5_ENABLE_ENABLED
39062 	/* If set to 1, then the queue is enabled. */
39063 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID6_ENABLE	UINT32_C(0x40)
39064 	/* Queue is disabled. */
39065 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID6_ENABLE_DISABLED  (UINT32_C(0x0) << 6)
39066 	/* Queue is enabled. */
39067 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID6_ENABLE_ENABLED   (UINT32_C(0x1) << 6)
39068 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID6_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID6_ENABLE_ENABLED
39069 	/* If set to 1, then the queue is enabled. */
39070 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID7_ENABLE	UINT32_C(0x80)
39071 	/* Queue is disabled. */
39072 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID7_ENABLE_DISABLED  (UINT32_C(0x0) << 7)
39073 	/* Queue is enabled. */
39074 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID7_ENABLE_ENABLED   (UINT32_C(0x1) << 7)
39075 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID7_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG_OUTPUT_QUEUE_ENABLE_QID7_ENABLE_ENABLED
39076 	uint8_t	unused_0[6];
39077 	/*
39078 	 * This field is used in Output records to indicate that the output
39079 	 * is completely written to RAM. This field should be read as '1'
39080 	 * to indicate that the output has been completely written. When
39081 	 * writing a command completion or response to an internal processor,
39082 	 * the order of writes has to be such that this field is written last.
39083 	 */
39084 	uint8_t	valid;
39085 } hwrm_queue_adptv_qos_tx_feature_qcfg_output_t, *phwrm_queue_adptv_qos_tx_feature_qcfg_output_t;
39086 
39087 /***************************************
39088  * hwrm_queue_adptv_qos_tx_feature_cfg *
39089  ***************************************/
39090 
39091 
39092 /* hwrm_queue_adptv_qos_tx_feature_cfg_input (size:192b/24B) */
39093 
39094 typedef struct hwrm_queue_adptv_qos_tx_feature_cfg_input {
39095 	/* The HWRM command request type. */
39096 	uint16_t	req_type;
39097 	/*
39098 	 * The completion ring to send the completion event on. This should
39099 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
39100 	 */
39101 	uint16_t	cmpl_ring;
39102 	/*
39103 	 * The sequence ID is used by the driver for tracking multiple
39104 	 * commands. This ID is treated as opaque data by the firmware and
39105 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
39106 	 */
39107 	uint16_t	seq_id;
39108 	/*
39109 	 * The target ID of the command:
39110 	 * * 0x0-0xFFF8 - The function ID
39111 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39112 	 * * 0xFFFD - Reserved for user-space HWRM interface
39113 	 * * 0xFFFF - HWRM
39114 	 */
39115 	uint16_t	target_id;
39116 	/*
39117 	 * A physical address pointer pointing to a host buffer that the
39118 	 * command's response data will be written. This can be either a host
39119 	 * physical address (HPA) or a guest physical address (GPA) and must
39120 	 * point to a physically contiguous block of memory.
39121 	 */
39122 	uint64_t	resp_addr;
39123 	uint32_t	enables;
39124 	/* This bit must be '1' for the queue_enable field to be configured. */
39125 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_ENABLES_QUEUE_ENABLE	UINT32_C(0x1)
39126 	/*
39127 	 * Bitmask indicating which TX CoS queues are enabled or disabled.
39128 	 *
39129 	 * Each bit represents a specific queue where bit 0 represents
39130 	 * queue 0 and bit 7 represents queue 7.
39131 	 * A value of 0 indicates that the queue is not enabled.
39132 	 * A value of 1 indicates that the queue is enabled.
39133 	 */
39134 	uint8_t	queue_enable;
39135 	/* If set to 1, then the queue is enabled. */
39136 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID0_ENABLE	UINT32_C(0x1)
39137 	/* Queue is disabled. */
39138 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID0_ENABLE_DISABLED  UINT32_C(0x0)
39139 	/* Queue is enabled. */
39140 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID0_ENABLE_ENABLED   UINT32_C(0x1)
39141 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID0_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID0_ENABLE_ENABLED
39142 	/* If set to 1, then the queue is enabled. */
39143 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID1_ENABLE	UINT32_C(0x2)
39144 	/* Queue is disabled. */
39145 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID1_ENABLE_DISABLED  (UINT32_C(0x0) << 1)
39146 	/* Queue is enabled. */
39147 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID1_ENABLE_ENABLED   (UINT32_C(0x1) << 1)
39148 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID1_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID1_ENABLE_ENABLED
39149 	/* If set to 1, then the queue is enabled. */
39150 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID2_ENABLE	UINT32_C(0x4)
39151 	/* Queue is disabled. */
39152 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID2_ENABLE_DISABLED  (UINT32_C(0x0) << 2)
39153 	/* Queue is enabled. */
39154 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID2_ENABLE_ENABLED   (UINT32_C(0x1) << 2)
39155 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID2_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID2_ENABLE_ENABLED
39156 	/* If set to 1, then the queue is enabled. */
39157 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID3_ENABLE	UINT32_C(0x8)
39158 	/* Queue is disabled. */
39159 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID3_ENABLE_DISABLED  (UINT32_C(0x0) << 3)
39160 	/* Queue is enabled. */
39161 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID3_ENABLE_ENABLED   (UINT32_C(0x1) << 3)
39162 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID3_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID3_ENABLE_ENABLED
39163 	/* If set to 1, then the queue is enabled. */
39164 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID4_ENABLE	UINT32_C(0x10)
39165 	/* Queue is disabled. */
39166 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID4_ENABLE_DISABLED  (UINT32_C(0x0) << 4)
39167 	/* Queue is enabled. */
39168 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID4_ENABLE_ENABLED   (UINT32_C(0x1) << 4)
39169 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID4_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID4_ENABLE_ENABLED
39170 	/* If set to 1, then the queue is enabled. */
39171 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID5_ENABLE	UINT32_C(0x20)
39172 	/* Queue is disabled. */
39173 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID5_ENABLE_DISABLED  (UINT32_C(0x0) << 5)
39174 	/* Queue is enabled. */
39175 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID5_ENABLE_ENABLED   (UINT32_C(0x1) << 5)
39176 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID5_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID5_ENABLE_ENABLED
39177 	/* If set to 1, then the queue is enabled. */
39178 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID6_ENABLE	UINT32_C(0x40)
39179 	/* Queue is disabled. */
39180 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID6_ENABLE_DISABLED  (UINT32_C(0x0) << 6)
39181 	/* Queue is enabled. */
39182 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID6_ENABLE_ENABLED   (UINT32_C(0x1) << 6)
39183 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID6_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID6_ENABLE_ENABLED
39184 	/* If set to 1, then the queue is enabled. */
39185 	#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID7_ENABLE	UINT32_C(0x80)
39186 	/* Queue is disabled. */
39187 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID7_ENABLE_DISABLED  (UINT32_C(0x0) << 7)
39188 	/* Queue is enabled. */
39189 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID7_ENABLE_ENABLED   (UINT32_C(0x1) << 7)
39190 		#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID7_ENABLE_LAST	HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG_INPUT_QUEUE_ENABLE_QID7_ENABLE_ENABLED
39191 	uint8_t	unused_0[3];
39192 } hwrm_queue_adptv_qos_tx_feature_cfg_input_t, *phwrm_queue_adptv_qos_tx_feature_cfg_input_t;
39193 
39194 /* hwrm_queue_adptv_qos_tx_feature_cfg_output (size:128b/16B) */
39195 
39196 typedef struct hwrm_queue_adptv_qos_tx_feature_cfg_output {
39197 	/* The specific error status for the command. */
39198 	uint16_t	error_code;
39199 	/* The HWRM command request type. */
39200 	uint16_t	req_type;
39201 	/* The sequence ID from the original command. */
39202 	uint16_t	seq_id;
39203 	/* The length of the response data in number of bytes. */
39204 	uint16_t	resp_len;
39205 	uint8_t	unused_0[7];
39206 	/*
39207 	 * This field is used in Output records to indicate that the output
39208 	 * is completely written to RAM. This field should be read as '1'
39209 	 * to indicate that the output has been completely written. When
39210 	 * writing a command completion or response to an internal processor,
39211 	 * the order of writes has to be such that this field is written last.
39212 	 */
39213 	uint8_t	valid;
39214 } hwrm_queue_adptv_qos_tx_feature_cfg_output_t, *phwrm_queue_adptv_qos_tx_feature_cfg_output_t;
39215 
39216 /********************
39217  * hwrm_queue_qcaps *
39218  ********************/
39219 
39220 
39221 /* hwrm_queue_qcaps_input (size:128b/16B) */
39222 
39223 typedef struct hwrm_queue_qcaps_input {
39224 	/* The HWRM command request type. */
39225 	uint16_t	req_type;
39226 	/*
39227 	 * The completion ring to send the completion event on. This should
39228 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
39229 	 */
39230 	uint16_t	cmpl_ring;
39231 	/*
39232 	 * The sequence ID is used by the driver for tracking multiple
39233 	 * commands. This ID is treated as opaque data by the firmware and
39234 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
39235 	 */
39236 	uint16_t	seq_id;
39237 	/*
39238 	 * The target ID of the command:
39239 	 * * 0x0-0xFFF8 - The function ID
39240 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39241 	 * * 0xFFFD - Reserved for user-space HWRM interface
39242 	 * * 0xFFFF - HWRM
39243 	 */
39244 	uint16_t	target_id;
39245 	/*
39246 	 * A physical address pointer pointing to a host buffer that the
39247 	 * command's response data will be written. This can be either a host
39248 	 * physical address (HPA) or a guest physical address (GPA) and must
39249 	 * point to a physically contiguous block of memory.
39250 	 */
39251 	uint64_t	resp_addr;
39252 } hwrm_queue_qcaps_input_t, *phwrm_queue_qcaps_input_t;
39253 
39254 /* hwrm_queue_qcaps_output (size:256b/32B) */
39255 
39256 typedef struct hwrm_queue_qcaps_output {
39257 	/* The specific error status for the command. */
39258 	uint16_t	error_code;
39259 	/* The HWRM command request type. */
39260 	uint16_t	req_type;
39261 	/* The sequence ID from the original command. */
39262 	uint16_t	seq_id;
39263 	/* The length of the response data in number of bytes. */
39264 	uint16_t	resp_len;
39265 	/* Adaptive QoS RX feature parameter capability flags. */
39266 	uint32_t	rx_feature_params;
39267 	/*
39268 	 * When this bit is '1' the capability to configure queue_enable
39269 	 * is supported.
39270 	 * If set to '0', then the capability to configure queue_enable
39271 	 * is not supported.
39272 	 */
39273 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_FEATURE_PARAMS_QUEUE_ENABLE_CAP	UINT32_C(0x1)
39274 	/*
39275 	 * When this bit is '1' the capability to configure queue_mode
39276 	 * is supported.
39277 	 * If set to '0', then the capability to configure queue_mode
39278 	 * is not supported.
39279 	 */
39280 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_FEATURE_PARAMS_QUEUE_MODE_CAP	UINT32_C(0x2)
39281 	/* Adaptive QoS TX feature parameter capability flags. */
39282 	uint32_t	tx_feature_params;
39283 	/*
39284 	 * When this bit is '1' the capability to configure queue_enable
39285 	 * is supported.
39286 	 * If set to '0', then the capability to configure queue_enable
39287 	 * is not supported.
39288 	 */
39289 	#define HWRM_QUEUE_QCAPS_OUTPUT_TX_FEATURE_PARAMS_QUEUE_ENABLE_CAP	UINT32_C(0x1)
39290 	/*
39291 	 * The maximum number of queues that can be configured on this device.
39292 	 * Valid values range from 1 through 8.
39293 	 */
39294 	uint8_t	max_configurable_queues;
39295 	uint8_t	unused_0[3];
39296 	/* Adaptive QoS RX tuning parameter capability flags. */
39297 	uint32_t	rx_tuning_params;
39298 	/*
39299 	 * When this bit is '1' the capability to configure the option
39300 	 * is supported.
39301 	 * If set to '0', then the capability to configure the option
39302 	 * is not supported.
39303 	 */
39304 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_WFQ_COST_CAP			UINT32_C(0x1)
39305 	/*
39306 	 * When this bit is '1' the capability to configure the option
39307 	 * is supported.
39308 	 * If set to '0', then the capability to configure the option
39309 	 * is not supported.
39310 	 */
39311 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_WFQ_UPPER_FACTOR_CAP		UINT32_C(0x2)
39312 	/*
39313 	 * When this bit is '1' the capability to configure the option
39314 	 * is supported.
39315 	 * If set to '0', then the capability to configure the option
39316 	 * is not supported.
39317 	 */
39318 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_HYST_WINDOW_SIZE_FACTOR_CAP	UINT32_C(0x4)
39319 	/*
39320 	 * When this bit is '1' the capability to configure the option
39321 	 * is supported.
39322 	 * If set to '0', then the capability to configure the option
39323 	 * is not supported.
39324 	 */
39325 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_PCIE_BW_EFF_CAP		UINT32_C(0x8)
39326 	/*
39327 	 * When this bit is '1' the capability to configure the option
39328 	 * is supported.
39329 	 * If set to '0', then the capability to configure the option
39330 	 * is not supported.
39331 	 */
39332 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_XOFF_HEADROOM_FACTOR_CAP	UINT32_C(0x10)
39333 	/*
39334 	 * When this bit is '1' the capability to configure the option
39335 	 * is supported.
39336 	 * If set to '0', then the capability to configure the option
39337 	 * is not supported.
39338 	 */
39339 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_L2_MIN_LATENCY_CAP		UINT32_C(0x20)
39340 	/*
39341 	 * When this bit is '1' the capability to configure the option
39342 	 * is supported.
39343 	 * If set to '0', then the capability to configure the option
39344 	 * is not supported.
39345 	 */
39346 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_L2_MAX_LATENCY_CAP		UINT32_C(0x40)
39347 	/*
39348 	 * When this bit is '1' the capability to configure the option
39349 	 * is supported.
39350 	 * If set to '0', then the capability to configure the option
39351 	 * is not supported.
39352 	 */
39353 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_ROCE_MIN_LATENCY_CAP		UINT32_C(0x80)
39354 	/*
39355 	 * When this bit is '1' the capability to configure the option
39356 	 * is supported.
39357 	 * If set to '0', then the capability to configure the option
39358 	 * is not supported.
39359 	 */
39360 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_ROCE_MAX_LATENCY_CAP		UINT32_C(0x100)
39361 	/*
39362 	 * When this bit is '1' the capability to configure the option
39363 	 * is supported.
39364 	 * If set to '0', then the capability to configure the option
39365 	 * is not supported.
39366 	 */
39367 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_L2_PIPE_COS_LATENCY_CAP	UINT32_C(0x200)
39368 	/*
39369 	 * When this bit is '1' the capability to configure the option
39370 	 * is supported.
39371 	 * If set to '0', then the capability to configure the option
39372 	 * is not supported.
39373 	 */
39374 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_ROCE_PIPE_COS_LATENCY_CAP	UINT32_C(0x400)
39375 	/*
39376 	 * When this bit is '1' the capability to configure the option
39377 	 * is supported.
39378 	 * If set to '0', then the capability to configure the option
39379 	 * is not supported.
39380 	 */
39381 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_COS_SHARED_MIN_RATIO_CAP	UINT32_C(0x800)
39382 	/*
39383 	 * When this bit is '1' the capability to configure the option
39384 	 * is supported.
39385 	 * If set to '0', then the capability to configure the option
39386 	 * is not supported.
39387 	 */
39388 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_RSVD_CELLS_LIMIT_RATIO_CAP	UINT32_C(0x1000)
39389 	/*
39390 	 * When this bit is '1' the capability to configure the option
39391 	 * is supported.
39392 	 * If set to '0', then the capability to configure the option
39393 	 * is not supported.
39394 	 */
39395 	#define HWRM_QUEUE_QCAPS_OUTPUT_RX_TUNING_PARAMS_SHAPER_REFILL_TIMER_CAP	UINT32_C(0x2000)
39396 	/* Adaptive QoS TX tuning parameter capability flags. */
39397 	uint32_t	tx_tuning_params;
39398 	/*
39399 	 * When this bit is '1' the capability to configure the option
39400 	 * is supported.
39401 	 * If set to '0', then the capability to configure the option
39402 	 * is not supported.
39403 	 */
39404 	#define HWRM_QUEUE_QCAPS_OUTPUT_TX_TUNING_PARAMS_WFQ_COST_CAP			UINT32_C(0x1)
39405 	/*
39406 	 * When this bit is '1' the capability to configure the option
39407 	 * is supported.
39408 	 * If set to '0', then the capability to configure the option
39409 	 * is not supported.
39410 	 */
39411 	#define HWRM_QUEUE_QCAPS_OUTPUT_TX_TUNING_PARAMS_WFQ_UPPER_FACTOR_CAP		UINT32_C(0x2)
39412 	/*
39413 	 * When this bit is '1' the capability to configure the option
39414 	 * is supported.
39415 	 * If set to '0', then the capability to configure the option
39416 	 * is not supported.
39417 	 */
39418 	#define HWRM_QUEUE_QCAPS_OUTPUT_TX_TUNING_PARAMS_HYST_WINDOW_SIZE_FACTOR_CAP	UINT32_C(0x4)
39419 	/*
39420 	 * When this bit is '1' the capability to configure the option
39421 	 * is supported.
39422 	 * If set to '0', then the capability to configure the option
39423 	 * is not supported.
39424 	 */
39425 	#define HWRM_QUEUE_QCAPS_OUTPUT_TX_TUNING_PARAMS_RSVD_CELLS_LIMIT_RATIO_CAP	UINT32_C(0x8)
39426 	/*
39427 	 * When this bit is '1' the capability to configure the option
39428 	 * is supported.
39429 	 * If set to '0', then the capability to configure the option
39430 	 * is not supported.
39431 	 */
39432 	#define HWRM_QUEUE_QCAPS_OUTPUT_TX_TUNING_PARAMS_L2_MIN_LATENCY_CAP		UINT32_C(0x10)
39433 	/*
39434 	 * When this bit is '1' the capability to configure the option
39435 	 * is supported.
39436 	 * If set to '0', then the capability to configure the option
39437 	 * is not supported.
39438 	 */
39439 	#define HWRM_QUEUE_QCAPS_OUTPUT_TX_TUNING_PARAMS_L2_MAX_LATENCY_CAP		UINT32_C(0x20)
39440 	/*
39441 	 * When this bit is '1' the capability to configure the option
39442 	 * is supported.
39443 	 * If set to '0', then the capability to configure the option
39444 	 * is not supported.
39445 	 */
39446 	#define HWRM_QUEUE_QCAPS_OUTPUT_TX_TUNING_PARAMS_ROCE_MIN_LATENCY_CAP		UINT32_C(0x40)
39447 	/*
39448 	 * When this bit is '1' the capability to configure the option
39449 	 * is supported.
39450 	 * If set to '0', then the capability to configure the option
39451 	 * is not supported.
39452 	 */
39453 	#define HWRM_QUEUE_QCAPS_OUTPUT_TX_TUNING_PARAMS_ROCE_MAX_LATENCY_CAP		UINT32_C(0x80)
39454 	/*
39455 	 * When this bit is '1' the capability to configure the option
39456 	 * is supported.
39457 	 * If set to '0', then the capability to configure the option
39458 	 * is not supported.
39459 	 */
39460 	#define HWRM_QUEUE_QCAPS_OUTPUT_TX_TUNING_PARAMS_MAX_TBM_CELLS_PRERESERVED_CAP	UINT32_C(0x100)
39461 	/*
39462 	 * When this bit is '1' the capability to configure the option
39463 	 * is supported.
39464 	 * If set to '0', then the capability to configure the option
39465 	 * is not supported.
39466 	 */
39467 	#define HWRM_QUEUE_QCAPS_OUTPUT_TX_TUNING_PARAMS_SHAPER_REFILL_TIMER_CAP	UINT32_C(0x200)
39468 	uint8_t	unused_1[3];
39469 	/*
39470 	 * This field is used in Output records to indicate that the output
39471 	 * is completely written to RAM. This field should be read as '1'
39472 	 * to indicate that the output has been completely written. When
39473 	 * writing a command completion or response to an internal processor,
39474 	 * the order of writes has to be such that this field is written last.
39475 	 */
39476 	uint8_t	valid;
39477 } hwrm_queue_qcaps_output_t, *phwrm_queue_qcaps_output_t;
39478 
39479 /***************************************
39480  * hwrm_queue_adptv_qos_rx_tuning_qcfg *
39481  ***************************************/
39482 
39483 
39484 /* hwrm_queue_adptv_qos_rx_tuning_qcfg_input (size:128b/16B) */
39485 
39486 typedef struct hwrm_queue_adptv_qos_rx_tuning_qcfg_input {
39487 	/* The HWRM command request type. */
39488 	uint16_t	req_type;
39489 	/*
39490 	 * The completion ring to send the completion event on. This should
39491 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
39492 	 */
39493 	uint16_t	cmpl_ring;
39494 	/*
39495 	 * The sequence ID is used by the driver for tracking multiple
39496 	 * commands. This ID is treated as opaque data by the firmware and
39497 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
39498 	 */
39499 	uint16_t	seq_id;
39500 	/*
39501 	 * The target ID of the command:
39502 	 * * 0x0-0xFFF8 - The function ID
39503 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39504 	 * * 0xFFFD - Reserved for user-space HWRM interface
39505 	 * * 0xFFFF - HWRM
39506 	 */
39507 	uint16_t	target_id;
39508 	/*
39509 	 * A physical address pointer pointing to a host buffer that the
39510 	 * command's response data will be written. This can be either a host
39511 	 * physical address (HPA) or a guest physical address (GPA) and must
39512 	 * point to a physically contiguous block of memory.
39513 	 */
39514 	uint64_t	resp_addr;
39515 } hwrm_queue_adptv_qos_rx_tuning_qcfg_input_t, *phwrm_queue_adptv_qos_rx_tuning_qcfg_input_t;
39516 
39517 /* hwrm_queue_adptv_qos_rx_tuning_qcfg_output (size:576b/72B) */
39518 
39519 typedef struct hwrm_queue_adptv_qos_rx_tuning_qcfg_output {
39520 	/* The specific error status for the command. */
39521 	uint16_t	error_code;
39522 	/* The HWRM command request type. */
39523 	uint16_t	req_type;
39524 	/* The sequence ID from the original command. */
39525 	uint16_t	seq_id;
39526 	/* The length of the response data in number of bytes. */
39527 	uint16_t	resp_len;
39528 	/* Indicates max credit as required by hardware. */
39529 	uint32_t	wfq_cost;
39530 	/*
39531 	 * Specifies a factor that determines the upper bound for each
39532 	 * cos_wfq_credit_weight.
39533 	 */
39534 	uint32_t	wfq_upper_factor;
39535 	/*
39536 	 * The algorithm multiplies this factor by the MRU size to compute the
39537 	 * hysteresis window size which in turn is used in deassert
39538 	 * threshold calculations.
39539 	 */
39540 	uint32_t	hyst_window_size_factor;
39541 	/*
39542 	 * Specifies PCIe BW efficiency in the range of 0-100%. System
39543 	 * characterization determines the value of this parameter. A value of
39544 	 * less than 100% accounts for internal PCIe over-subscription. The
39545 	 * algorithm uses this parameter to determine the PCIe BW available
39546 	 * for transferring received packets to the host.
39547 	 */
39548 	uint32_t	pcie_bw_eff;
39549 	/* Scales the number of cells for xoff. */
39550 	uint32_t	xoff_headroom_factor;
39551 	/*
39552 	 * It is used to calculate the number of reserved cells for cos queues
39553 	 * configured for L2. Its value is derived from system
39554 	 * characterization.
39555 	 */
39556 	uint32_t	l2_min_latency;
39557 	/*
39558 	 * It is used to calculate the number of shared cells for cos queues
39559 	 * configured for L2. Its value is derived from system
39560 	 * characterization.
39561 	 */
39562 	uint32_t	l2_max_latency;
39563 	/*
39564 	 * It is used to calculate the number of reserved cells for cos queues
39565 	 * configured for RoCE. Its value is derived from system
39566 	 * characterization.
39567 	 */
39568 	uint32_t	roce_min_latency;
39569 	/*
39570 	 * It is used to calculate the number of shared cells for cos queues
39571 	 * configured for RoCE. Its value is derived from system
39572 	 * characterization.
39573 	 */
39574 	uint32_t	roce_max_latency;
39575 	/*
39576 	 * The algorithm uses this parameter to calculate the number of cells
39577 	 * to be excluded from the total buffer pool to account for the
39578 	 * latency of pipeline post RE_DEC to PCIe block. Its value is derived
39579 	 * from system characterization.
39580 	 */
39581 	uint32_t	l2_pipe_cos_latency;
39582 	/*
39583 	 * The algorithm uses this parameter to calculate the number of cells
39584 	 * to be excluded from the total buffer pool to account for the
39585 	 * latency of pipeline post RE_DEC to PCIe block. Its value is derived
39586 	 * from system characterization.
39587 	 */
39588 	uint32_t	roce_pipe_cos_latency;
39589 	/* Sets the minimum number of shared cells each cos queue can have. */
39590 	uint32_t	cos_shared_min_ratio;
39591 	/*
39592 	 * The parameter limits the total reserved cells. If the computed
39593 	 * total reserved cells becomes larger than rsvd_cells_limit_ratio x
39594 	 * port_cells_avail, then the reserved cells are set to the limit
39595 	 * value. Its range of values is 0-50%.
39596 	 */
39597 	uint32_t	rsvd_cells_limit_ratio;
39598 	/*
39599 	 * This parameter is used to compute the time interval for
39600 	 * replenishing the shaper credit buckets for all RX cos queues.
39601 	 */
39602 	uint32_t	shaper_refill_timer;
39603 	uint8_t	unused_0[7];
39604 	/*
39605 	 * This field is used in Output records to indicate that the output
39606 	 * is completely written to RAM. This field should be read as '1'
39607 	 * to indicate that the output has been completely written. When
39608 	 * writing a command completion or response to an internal processor,
39609 	 * the order of writes has to be such that this field is written last.
39610 	 */
39611 	uint8_t	valid;
39612 } hwrm_queue_adptv_qos_rx_tuning_qcfg_output_t, *phwrm_queue_adptv_qos_rx_tuning_qcfg_output_t;
39613 
39614 /**************************************
39615  * hwrm_queue_adptv_qos_rx_tuning_cfg *
39616  **************************************/
39617 
39618 
39619 /* hwrm_queue_adptv_qos_rx_tuning_cfg_input (size:640b/80B) */
39620 
39621 typedef struct hwrm_queue_adptv_qos_rx_tuning_cfg_input {
39622 	/* The HWRM command request type. */
39623 	uint16_t	req_type;
39624 	/*
39625 	 * The completion ring to send the completion event on. This should
39626 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
39627 	 */
39628 	uint16_t	cmpl_ring;
39629 	/*
39630 	 * The sequence ID is used by the driver for tracking multiple
39631 	 * commands. This ID is treated as opaque data by the firmware and
39632 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
39633 	 */
39634 	uint16_t	seq_id;
39635 	/*
39636 	 * The target ID of the command:
39637 	 * * 0x0-0xFFF8 - The function ID
39638 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39639 	 * * 0xFFFD - Reserved for user-space HWRM interface
39640 	 * * 0xFFFF - HWRM
39641 	 */
39642 	uint16_t	target_id;
39643 	/*
39644 	 * A physical address pointer pointing to a host buffer that the
39645 	 * command's response data will be written. This can be either a host
39646 	 * physical address (HPA) or a guest physical address (GPA) and must
39647 	 * point to a physically contiguous block of memory.
39648 	 */
39649 	uint64_t	resp_addr;
39650 	uint32_t	enables;
39651 	/* This bit must be '1' for the option to be configured. */
39652 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_WFQ_COST			UINT32_C(0x1)
39653 	/* This bit must be '1' for the option to be configured. */
39654 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_WFQ_UPPER_FACTOR		UINT32_C(0x2)
39655 	/* This bit must be '1' for the option to be configured. */
39656 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_HYST_WINDOW_SIZE_FACTOR	UINT32_C(0x4)
39657 	/* This bit must be '1' for the option to be configured. */
39658 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_PCIE_BW_EFF		UINT32_C(0x8)
39659 	/* This bit must be '1' for the option to be configured. */
39660 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_XOFF_HEADROOM_FACTOR	UINT32_C(0x10)
39661 	/* This bit must be '1' for the option to be configured. */
39662 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_L2_MIN_LATENCY		UINT32_C(0x20)
39663 	/* This bit must be '1' for the option to be configured. */
39664 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_L2_MAX_LATENCY		UINT32_C(0x40)
39665 	/* This bit must be '1' for the option to be configured. */
39666 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_ROCE_MIN_LATENCY		UINT32_C(0x80)
39667 	/* This bit must be '1' for the option to be configured. */
39668 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_ROCE_MAX_LATENCY		UINT32_C(0x100)
39669 	/* This bit must be '1' for the option to be configured. */
39670 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_L2_PIPE_COS_LATENCY	UINT32_C(0x200)
39671 	/* This bit must be '1' for the option to be configured. */
39672 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_ROCE_PIPE_COS_LATENCY	UINT32_C(0x400)
39673 	/* This bit must be '1' for the option to be configured. */
39674 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_COS_SHARED_MIN_RATIO	UINT32_C(0x800)
39675 	/* This bit must be '1' for the option to be configured. */
39676 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_RSVD_CELLS_LIMIT_RATIO	UINT32_C(0x1000)
39677 	/* This bit must be '1' for the option to be configured. */
39678 	#define HWRM_QUEUE_ADPTV_QOS_RX_TUNING_CFG_INPUT_ENABLES_SHAPER_REFILL_TIMER	UINT32_C(0x2000)
39679 	/* Indicates max credit as required by hardware. */
39680 	uint32_t	wfq_cost;
39681 	/*
39682 	 * Specifies a factor that determines the upper bound for each
39683 	 * cos_wfq_credit_weight.
39684 	 */
39685 	uint32_t	wfq_upper_factor;
39686 	/*
39687 	 * The algorithm multiplies this factor by the MRU size to compute the
39688 	 * hysteresis window size which in turn is used in deassert
39689 	 * threshold calculations.
39690 	 */
39691 	uint32_t	hyst_window_size_factor;
39692 	/*
39693 	 * Specifies PCIe BW efficiency in the range of 0-100%. System
39694 	 * characterization determines the value of this parameter. A value of
39695 	 * less than 100% accounts for internal PCIe over-subscription. The
39696 	 * algorithm uses this parameter to determine the PCIe BW available
39697 	 * for transferring received packets to the host.
39698 	 */
39699 	uint32_t	pcie_bw_eff;
39700 	/* Scales the number of cells for xoff. */
39701 	uint32_t	xoff_headroom_factor;
39702 	/*
39703 	 * It is used to calculate the number of reserved cells for cos queues
39704 	 * configured for L2. Its value is derived from system
39705 	 * characterization.
39706 	 */
39707 	uint32_t	l2_min_latency;
39708 	/*
39709 	 * It is used to calculate the number of shared cells for cos queues
39710 	 * configured for L2. Its value is derived from system
39711 	 * characterization.
39712 	 */
39713 	uint32_t	l2_max_latency;
39714 	/*
39715 	 * It is used to calculate the number of reserved cells for cos queues
39716 	 * configured for RoCE. Its value is derived from system
39717 	 * characterization.
39718 	 */
39719 	uint32_t	roce_min_latency;
39720 	/*
39721 	 * It is used to calculate the number of shared cells for cos queues
39722 	 * configured for RoCE. Its value is derived from system
39723 	 * characterization.
39724 	 */
39725 	uint32_t	roce_max_latency;
39726 	/*
39727 	 * The algorithm uses this parameter to calculate the number of cells
39728 	 * to be excluded from the total buffer pool to account for the
39729 	 * latency of pipeline post RE_DEC to PCIe block. Its value is derived
39730 	 * from system characterization.
39731 	 */
39732 	uint32_t	l2_pipe_cos_latency;
39733 	/*
39734 	 * The algorithm uses this parameter to calculate the number of cells
39735 	 * to be excluded from the total buffer pool to account for the
39736 	 * latency of pipeline post RE_DEC to PCIe block. Its value is derived
39737 	 * from system characterization.
39738 	 */
39739 	uint32_t	roce_pipe_cos_latency;
39740 	/* Sets the minimum number of shared cells each cos queue can have. */
39741 	uint32_t	cos_shared_min_ratio;
39742 	/*
39743 	 * The parameter limits the total reserved cells. If the computed
39744 	 * total reserved cells becomes larger than rsvd_cells_limit_ratio x
39745 	 * port_cells_avail, then the reserved cells are set to the limit
39746 	 * value. Its range of values is 0-50%.
39747 	 */
39748 	uint32_t	rsvd_cells_limit_ratio;
39749 	/*
39750 	 * This parameter is used to compute the time interval for
39751 	 * replenishing the shaper credit buckets for all RX cos queues.
39752 	 */
39753 	uint32_t	shaper_refill_timer;
39754 	uint8_t	unused_0[4];
39755 } hwrm_queue_adptv_qos_rx_tuning_cfg_input_t, *phwrm_queue_adptv_qos_rx_tuning_cfg_input_t;
39756 
39757 /* hwrm_queue_adptv_qos_rx_tuning_cfg_output (size:128b/16B) */
39758 
39759 typedef struct hwrm_queue_adptv_qos_rx_tuning_cfg_output {
39760 	/* The specific error status for the command. */
39761 	uint16_t	error_code;
39762 	/* The HWRM command request type. */
39763 	uint16_t	req_type;
39764 	/* The sequence ID from the original command. */
39765 	uint16_t	seq_id;
39766 	/* The length of the response data in number of bytes. */
39767 	uint16_t	resp_len;
39768 	uint8_t	unused_0[7];
39769 	/*
39770 	 * This field is used in Output records to indicate that the output
39771 	 * is completely written to RAM. This field should be read as '1'
39772 	 * to indicate that the output has been completely written. When
39773 	 * writing a command completion or response to an internal processor,
39774 	 * the order of writes has to be such that this field is written last.
39775 	 */
39776 	uint8_t	valid;
39777 } hwrm_queue_adptv_qos_rx_tuning_cfg_output_t, *phwrm_queue_adptv_qos_rx_tuning_cfg_output_t;
39778 
39779 /***************************************
39780  * hwrm_queue_adptv_qos_tx_tuning_qcfg *
39781  ***************************************/
39782 
39783 
39784 /* hwrm_queue_adptv_qos_tx_tuning_qcfg_input (size:128b/16B) */
39785 
39786 typedef struct hwrm_queue_adptv_qos_tx_tuning_qcfg_input {
39787 	/* The HWRM command request type. */
39788 	uint16_t	req_type;
39789 	/*
39790 	 * The completion ring to send the completion event on. This should
39791 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
39792 	 */
39793 	uint16_t	cmpl_ring;
39794 	/*
39795 	 * The sequence ID is used by the driver for tracking multiple
39796 	 * commands. This ID is treated as opaque data by the firmware and
39797 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
39798 	 */
39799 	uint16_t	seq_id;
39800 	/*
39801 	 * The target ID of the command:
39802 	 * * 0x0-0xFFF8 - The function ID
39803 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39804 	 * * 0xFFFD - Reserved for user-space HWRM interface
39805 	 * * 0xFFFF - HWRM
39806 	 */
39807 	uint16_t	target_id;
39808 	/*
39809 	 * A physical address pointer pointing to a host buffer that the
39810 	 * command's response data will be written. This can be either a host
39811 	 * physical address (HPA) or a guest physical address (GPA) and must
39812 	 * point to a physically contiguous block of memory.
39813 	 */
39814 	uint64_t	resp_addr;
39815 } hwrm_queue_adptv_qos_tx_tuning_qcfg_input_t, *phwrm_queue_adptv_qos_tx_tuning_qcfg_input_t;
39816 
39817 /* hwrm_queue_adptv_qos_tx_tuning_qcfg_output (size:448b/56B) */
39818 
39819 typedef struct hwrm_queue_adptv_qos_tx_tuning_qcfg_output {
39820 	/* The specific error status for the command. */
39821 	uint16_t	error_code;
39822 	/* The HWRM command request type. */
39823 	uint16_t	req_type;
39824 	/* The sequence ID from the original command. */
39825 	uint16_t	seq_id;
39826 	/* The length of the response data in number of bytes. */
39827 	uint16_t	resp_len;
39828 	/* Indicates max credit as required by hardware. */
39829 	uint32_t	wfq_cost;
39830 	/*
39831 	 * Specifies a factor that determines the upper bound for each
39832 	 * cos_wfq_credit_weight.
39833 	 */
39834 	uint32_t	wfq_upper_factor;
39835 	/*
39836 	 * The algorithm multiplies this factor by the MRU size to compute the
39837 	 * hysteresis window size which in turn is used in deassert
39838 	 * threshold calculations.
39839 	 */
39840 	uint32_t	hyst_window_size_factor;
39841 	/*
39842 	 * The parameter limits the total reserved cells. If the computed
39843 	 * total reserved cells becomes larger than rsvd_cells_limit_ratio x
39844 	 * port_cells_avail, then the reserved cells are set to the limit
39845 	 * value. Its range of values is 0-50%.
39846 	 */
39847 	uint32_t	rsvd_cells_limit_ratio;
39848 	/*
39849 	 * It is used to calculate the number of reserved cells for cos queues
39850 	 * configured for L2. Its value is derived from system
39851 	 * characterization.
39852 	 */
39853 	uint32_t	l2_min_latency;
39854 	/*
39855 	 * It is used to calculate the number of shared cells for cos queues
39856 	 * configured for L2. Its value is derived from system
39857 	 * characterization.
39858 	 */
39859 	uint32_t	l2_max_latency;
39860 	/*
39861 	 * It is used to calculate the number of reserved cells for cos queues
39862 	 * configured for RoCE. Its value is derived from system
39863 	 * characterization.
39864 	 */
39865 	uint32_t	roce_min_latency;
39866 	/*
39867 	 * It is used to calculate the number of shared cells for cos queues
39868 	 * configured for RoCE. Its value is derived from system
39869 	 * characterization.
39870 	 */
39871 	uint32_t	roce_max_latency;
39872 	/* Specifies the number of reserved cells TRP requires per cos queue. */
39873 	uint32_t	max_tbm_cells_prereserved;
39874 	/*
39875 	 * This parameter is used to compute the time interval for
39876 	 * replenishing the shaper credit buckets for all TX cos queues.
39877 	 */
39878 	uint32_t	shaper_refill_timer;
39879 	uint8_t	unused_0[7];
39880 	/*
39881 	 * This field is used in Output records to indicate that the output
39882 	 * is completely written to RAM. This field should be read as '1'
39883 	 * to indicate that the output has been completely written. When
39884 	 * writing a command completion or response to an internal processor,
39885 	 * the order of writes has to be such that this field is written last.
39886 	 */
39887 	uint8_t	valid;
39888 } hwrm_queue_adptv_qos_tx_tuning_qcfg_output_t, *phwrm_queue_adptv_qos_tx_tuning_qcfg_output_t;
39889 
39890 /**************************************
39891  * hwrm_queue_adptv_qos_tx_tuning_cfg *
39892  **************************************/
39893 
39894 
39895 /* hwrm_queue_adptv_qos_tx_tuning_cfg_input (size:512b/64B) */
39896 
39897 typedef struct hwrm_queue_adptv_qos_tx_tuning_cfg_input {
39898 	/* The HWRM command request type. */
39899 	uint16_t	req_type;
39900 	/*
39901 	 * The completion ring to send the completion event on. This should
39902 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
39903 	 */
39904 	uint16_t	cmpl_ring;
39905 	/*
39906 	 * The sequence ID is used by the driver for tracking multiple
39907 	 * commands. This ID is treated as opaque data by the firmware and
39908 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
39909 	 */
39910 	uint16_t	seq_id;
39911 	/*
39912 	 * The target ID of the command:
39913 	 * * 0x0-0xFFF8 - The function ID
39914 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39915 	 * * 0xFFFD - Reserved for user-space HWRM interface
39916 	 * * 0xFFFF - HWRM
39917 	 */
39918 	uint16_t	target_id;
39919 	/*
39920 	 * A physical address pointer pointing to a host buffer that the
39921 	 * command's response data will be written. This can be either a host
39922 	 * physical address (HPA) or a guest physical address (GPA) and must
39923 	 * point to a physically contiguous block of memory.
39924 	 */
39925 	uint64_t	resp_addr;
39926 	uint32_t	enables;
39927 	/* This bit must be '1' for the option to be configured. */
39928 	#define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG_INPUT_ENABLES_WFQ_COST			UINT32_C(0x1)
39929 	/* This bit must be '1' for the option to be configured. */
39930 	#define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG_INPUT_ENABLES_WFQ_UPPER_FACTOR		UINT32_C(0x2)
39931 	/* This bit must be '1' for the option to be configured. */
39932 	#define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG_INPUT_ENABLES_HYST_WINDOW_SIZE_FACTOR	UINT32_C(0x4)
39933 	/* This bit must be '1' for the option to be configured. */
39934 	#define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG_INPUT_ENABLES_RSVD_CELLS_LIMIT_RATIO	UINT32_C(0x8)
39935 	/* This bit must be '1' for the option to be configured. */
39936 	#define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG_INPUT_ENABLES_L2_MIN_LATENCY		UINT32_C(0x10)
39937 	/* This bit must be '1' for the option to be configured. */
39938 	#define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG_INPUT_ENABLES_L2_MAX_LATENCY		UINT32_C(0x20)
39939 	/* This bit must be '1' for the option to be configured. */
39940 	#define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG_INPUT_ENABLES_ROCE_MIN_LATENCY		UINT32_C(0x40)
39941 	/* This bit must be '1' for the option to be configured. */
39942 	#define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG_INPUT_ENABLES_ROCE_MAX_LATENCY		UINT32_C(0x80)
39943 	/* This bit must be '1' for the option to be configured. */
39944 	#define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG_INPUT_ENABLES_MAX_TBM_CELLS_PRERESERVED	UINT32_C(0x100)
39945 	/* This bit must be '1' for the option to be configured. */
39946 	#define HWRM_QUEUE_ADPTV_QOS_TX_TUNING_CFG_INPUT_ENABLES_SHAPER_REFILL_TIMER	UINT32_C(0x200)
39947 	/* Indicates max credit as required by hardware. */
39948 	uint32_t	wfq_cost;
39949 	/*
39950 	 * Specifies a factor that determines the upper bound for each
39951 	 * cos_wfq_credit_weight.
39952 	 */
39953 	uint32_t	wfq_upper_factor;
39954 	/*
39955 	 * The algorithm multiplies this factor by the MRU size to compute the
39956 	 * hysteresis window size which in turn is used in deassert
39957 	 * threshold calculations.
39958 	 */
39959 	uint32_t	hyst_window_size_factor;
39960 	/*
39961 	 * The parameter limits the total reserved cells. If the computed
39962 	 * total reserved cells becomes larger than rsvd_cells_limit_ratio x
39963 	 * port_cells_avail, then the reserved cells are set to the limit
39964 	 * value. Its range of values is 0-50%.
39965 	 */
39966 	uint32_t	rsvd_cells_limit_ratio;
39967 	/*
39968 	 * It is used to calculate the number of reserved cells for cos queues
39969 	 * configured for L2. Its value is derived from system
39970 	 * characterization.
39971 	 */
39972 	uint32_t	l2_min_latency;
39973 	/*
39974 	 * It is used to calculate the number of shared cells for cos queues
39975 	 * configured for L2. Its value is derived from system
39976 	 * characterization.
39977 	 */
39978 	uint32_t	l2_max_latency;
39979 	/*
39980 	 * It is used to calculate the number of reserved cells for cos queues
39981 	 * configured for RoCE. Its value is derived from system
39982 	 * characterization.
39983 	 */
39984 	uint32_t	roce_min_latency;
39985 	/*
39986 	 * It is used to calculate the number of shared cells for cos queues
39987 	 * configured for RoCE. Its value is derived from system
39988 	 * characterization.
39989 	 */
39990 	uint32_t	roce_max_latency;
39991 	/* Specifies the number of reserved cells TRP requires per cos queue. */
39992 	uint32_t	max_tbm_cells_prereserved;
39993 	/*
39994 	 * This parameter is used to compute the time interval for
39995 	 * replenishing the shaper credit buckets for all TX cos queues.
39996 	 */
39997 	uint32_t	shaper_refill_timer;
39998 	uint8_t	unused_0[4];
39999 } hwrm_queue_adptv_qos_tx_tuning_cfg_input_t, *phwrm_queue_adptv_qos_tx_tuning_cfg_input_t;
40000 
40001 /* hwrm_queue_adptv_qos_tx_tuning_cfg_output (size:128b/16B) */
40002 
40003 typedef struct hwrm_queue_adptv_qos_tx_tuning_cfg_output {
40004 	/* The specific error status for the command. */
40005 	uint16_t	error_code;
40006 	/* The HWRM command request type. */
40007 	uint16_t	req_type;
40008 	/* The sequence ID from the original command. */
40009 	uint16_t	seq_id;
40010 	/* The length of the response data in number of bytes. */
40011 	uint16_t	resp_len;
40012 	uint8_t	unused_0[7];
40013 	/*
40014 	 * This field is used in Output records to indicate that the output
40015 	 * is completely written to RAM. This field should be read as '1'
40016 	 * to indicate that the output has been completely written. When
40017 	 * writing a command completion or response to an internal processor,
40018 	 * the order of writes has to be such that this field is written last.
40019 	 */
40020 	uint8_t	valid;
40021 } hwrm_queue_adptv_qos_tx_tuning_cfg_output_t, *phwrm_queue_adptv_qos_tx_tuning_cfg_output_t;
40022 
40023 /**********************************
40024  * hwrm_queue_pfcwd_timeout_qcaps *
40025  **********************************/
40026 
40027 
40028 /* hwrm_queue_pfcwd_timeout_qcaps_input (size:128b/16B) */
40029 
40030 typedef struct hwrm_queue_pfcwd_timeout_qcaps_input {
40031 	/* The HWRM command request type. */
40032 	uint16_t	req_type;
40033 	/*
40034 	 * The completion ring to send the completion event on. This should
40035 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40036 	 */
40037 	uint16_t	cmpl_ring;
40038 	/*
40039 	 * The sequence ID is used by the driver for tracking multiple
40040 	 * commands. This ID is treated as opaque data by the firmware and
40041 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40042 	 */
40043 	uint16_t	seq_id;
40044 	/*
40045 	 * The target ID of the command:
40046 	 * * 0x0-0xFFF8 - The function ID
40047 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40048 	 * * 0xFFFD - Reserved for user-space HWRM interface
40049 	 * * 0xFFFF - HWRM
40050 	 */
40051 	uint16_t	target_id;
40052 	/*
40053 	 * A physical address pointer pointing to a host buffer that the
40054 	 * command's response data will be written. This can be either a host
40055 	 * physical address (HPA) or a guest physical address (GPA) and must
40056 	 * point to a physically contiguous block of memory.
40057 	 */
40058 	uint64_t	resp_addr;
40059 } hwrm_queue_pfcwd_timeout_qcaps_input_t, *phwrm_queue_pfcwd_timeout_qcaps_input_t;
40060 
40061 /* hwrm_queue_pfcwd_timeout_qcaps_output (size:128b/16B) */
40062 
40063 typedef struct hwrm_queue_pfcwd_timeout_qcaps_output {
40064 	/* The specific error status for the command. */
40065 	uint16_t	error_code;
40066 	/* The HWRM command request type. */
40067 	uint16_t	req_type;
40068 	/* The sequence ID from the original command. */
40069 	uint16_t	seq_id;
40070 	/* The length of the response data in number of bytes. */
40071 	uint16_t	resp_len;
40072 	/* Max configurable pfc watchdog timeout value in msec. */
40073 	uint16_t	max_pfcwd_timeout;
40074 	uint8_t	unused_0[5];
40075 	/*
40076 	 * This field is used in Output records to indicate that the output
40077 	 * is completely written to RAM. This field should be read as '1'
40078 	 * to indicate that the output has been completely written. When
40079 	 * writing a command completion or response to an internal processor,
40080 	 * the order of writes has to be such that this field is written last.
40081 	 */
40082 	uint8_t	valid;
40083 } hwrm_queue_pfcwd_timeout_qcaps_output_t, *phwrm_queue_pfcwd_timeout_qcaps_output_t;
40084 
40085 /********************************
40086  * hwrm_queue_pfcwd_timeout_cfg *
40087  ********************************/
40088 
40089 
40090 /* hwrm_queue_pfcwd_timeout_cfg_input (size:192b/24B) */
40091 
40092 typedef struct hwrm_queue_pfcwd_timeout_cfg_input {
40093 	/* The HWRM command request type. */
40094 	uint16_t	req_type;
40095 	/*
40096 	 * The completion ring to send the completion event on. This should
40097 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40098 	 */
40099 	uint16_t	cmpl_ring;
40100 	/*
40101 	 * The sequence ID is used by the driver for tracking multiple
40102 	 * commands. This ID is treated as opaque data by the firmware and
40103 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40104 	 */
40105 	uint16_t	seq_id;
40106 	/*
40107 	 * The target ID of the command:
40108 	 * * 0x0-0xFFF8 - The function ID
40109 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40110 	 * * 0xFFFD - Reserved for user-space HWRM interface
40111 	 * * 0xFFFF - HWRM
40112 	 */
40113 	uint16_t	target_id;
40114 	/*
40115 	 * A physical address pointer pointing to a host buffer that the
40116 	 * command's response data will be written. This can be either a host
40117 	 * physical address (HPA) or a guest physical address (GPA) and must
40118 	 * point to a physically contiguous block of memory.
40119 	 */
40120 	uint64_t	resp_addr;
40121 	/*
40122 	 * pfc watchdog timeout value in msec.
40123 	 * A value of 0 means firmware will disable the PFC watchdog.
40124 	 * A value of 0xffff means firmware will reset the timeout
40125 	 * value to Hardware defaults. Anywhere between 0 to 0xffff is
40126 	 * valid range for timeout value depending on the Hardware
40127 	 * capability.
40128 	 */
40129 	uint16_t	pfcwd_timeout_value;
40130 	uint8_t	unused_0[6];
40131 } hwrm_queue_pfcwd_timeout_cfg_input_t, *phwrm_queue_pfcwd_timeout_cfg_input_t;
40132 
40133 /* hwrm_queue_pfcwd_timeout_cfg_output (size:128b/16B) */
40134 
40135 typedef struct hwrm_queue_pfcwd_timeout_cfg_output {
40136 	/* The specific error status for the command. */
40137 	uint16_t	error_code;
40138 	/* The HWRM command request type. */
40139 	uint16_t	req_type;
40140 	/* The sequence ID from the original command. */
40141 	uint16_t	seq_id;
40142 	/* The length of the response data in number of bytes. */
40143 	uint16_t	resp_len;
40144 	uint8_t	unused_0[7];
40145 	/*
40146 	 * This field is used in Output records to indicate that the output
40147 	 * is completely written to RAM. This field should be read as '1'
40148 	 * to indicate that the output has been completely written. When
40149 	 * writing a command completion or response to an internal processor,
40150 	 * the order of writes has to be such that this field is written last.
40151 	 */
40152 	uint8_t	valid;
40153 } hwrm_queue_pfcwd_timeout_cfg_output_t, *phwrm_queue_pfcwd_timeout_cfg_output_t;
40154 
40155 /*********************************
40156  * hwrm_queue_pfcwd_timeout_qcfg *
40157  *********************************/
40158 
40159 
40160 /* hwrm_queue_pfcwd_timeout_qcfg_input (size:128b/16B) */
40161 
40162 typedef struct hwrm_queue_pfcwd_timeout_qcfg_input {
40163 	/* The HWRM command request type. */
40164 	uint16_t	req_type;
40165 	/*
40166 	 * The completion ring to send the completion event on. This should
40167 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40168 	 */
40169 	uint16_t	cmpl_ring;
40170 	/*
40171 	 * The sequence ID is used by the driver for tracking multiple
40172 	 * commands. This ID is treated as opaque data by the firmware and
40173 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40174 	 */
40175 	uint16_t	seq_id;
40176 	/*
40177 	 * The target ID of the command:
40178 	 * * 0x0-0xFFF8 - The function ID
40179 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40180 	 * * 0xFFFD - Reserved for user-space HWRM interface
40181 	 * * 0xFFFF - HWRM
40182 	 */
40183 	uint16_t	target_id;
40184 	/*
40185 	 * A physical address pointer pointing to a host buffer that the
40186 	 * command's response data will be written. This can be either a host
40187 	 * physical address (HPA) or a guest physical address (GPA) and must
40188 	 * point to a physically contiguous block of memory.
40189 	 */
40190 	uint64_t	resp_addr;
40191 } hwrm_queue_pfcwd_timeout_qcfg_input_t, *phwrm_queue_pfcwd_timeout_qcfg_input_t;
40192 
40193 /* hwrm_queue_pfcwd_timeout_qcfg_output (size:128b/16B) */
40194 
40195 typedef struct hwrm_queue_pfcwd_timeout_qcfg_output {
40196 	/* The specific error status for the command. */
40197 	uint16_t	error_code;
40198 	/* The HWRM command request type. */
40199 	uint16_t	req_type;
40200 	/* The sequence ID from the original command. */
40201 	uint16_t	seq_id;
40202 	/* The length of the response data in number of bytes. */
40203 	uint16_t	resp_len;
40204 	/*
40205 	 * Current configured pfc watchdog timeout value in msec.
40206 	 * A value of 0 means PFC watchdog functionality is disabled.
40207 	 */
40208 	uint16_t	pfcwd_timeout_value;
40209 	uint8_t	unused_0[5];
40210 	/*
40211 	 * This field is used in Output records to indicate that the output
40212 	 * is completely written to RAM. This field should be read as '1'
40213 	 * to indicate that the output has been completely written. When
40214 	 * writing a command completion or response to an internal processor,
40215 	 * the order of writes has to be such that this field is written last.
40216 	 */
40217 	uint8_t	valid;
40218 } hwrm_queue_pfcwd_timeout_qcfg_output_t, *phwrm_queue_pfcwd_timeout_qcfg_output_t;
40219 
40220 /*******************
40221  * hwrm_vnic_alloc *
40222  *******************/
40223 
40224 
40225 /* hwrm_vnic_alloc_input (size:192b/24B) */
40226 
40227 typedef struct hwrm_vnic_alloc_input {
40228 	/* The HWRM command request type. */
40229 	uint16_t	req_type;
40230 	/*
40231 	 * The completion ring to send the completion event on. This should
40232 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40233 	 */
40234 	uint16_t	cmpl_ring;
40235 	/*
40236 	 * The sequence ID is used by the driver for tracking multiple
40237 	 * commands. This ID is treated as opaque data by the firmware and
40238 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40239 	 */
40240 	uint16_t	seq_id;
40241 	/*
40242 	 * The target ID of the command:
40243 	 * * 0x0-0xFFF8 - The function ID
40244 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40245 	 * * 0xFFFD - Reserved for user-space HWRM interface
40246 	 * * 0xFFFF - HWRM
40247 	 */
40248 	uint16_t	target_id;
40249 	/*
40250 	 * A physical address pointer pointing to a host buffer that the
40251 	 * command's response data will be written. This can be either a host
40252 	 * physical address (HPA) or a guest physical address (GPA) and must
40253 	 * point to a physically contiguous block of memory.
40254 	 */
40255 	uint64_t	resp_addr;
40256 	uint32_t	flags;
40257 	/*
40258 	 * When this bit is '1', this VNIC is requested to
40259 	 * be the default VNIC for this function.
40260 	 */
40261 	#define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT		UINT32_C(0x1)
40262 	/*
40263 	 * When this bit is '1', proxy VEE PF is requesting
40264 	 * allocation of a default VNIC on behalf of virtio-net
40265 	 * function given in virtio_net_fid field.
40266 	 */
40267 	#define HWRM_VNIC_ALLOC_INPUT_FLAGS_VIRTIO_NET_FID_VALID	UINT32_C(0x2)
40268 	/*
40269 	 * Virtio-net function's FID.
40270 	 * This virtio-net function is requesting allocation of default
40271 	 * VNIC through proxy VEE PF.
40272 	 */
40273 	uint16_t	virtio_net_fid;
40274 	uint8_t	unused_0[2];
40275 } hwrm_vnic_alloc_input_t, *phwrm_vnic_alloc_input_t;
40276 
40277 /* hwrm_vnic_alloc_output (size:128b/16B) */
40278 
40279 typedef struct hwrm_vnic_alloc_output {
40280 	/* The specific error status for the command. */
40281 	uint16_t	error_code;
40282 	/* The HWRM command request type. */
40283 	uint16_t	req_type;
40284 	/* The sequence ID from the original command. */
40285 	uint16_t	seq_id;
40286 	/* The length of the response data in number of bytes. */
40287 	uint16_t	resp_len;
40288 	/* Logical vnic ID */
40289 	uint32_t	vnic_id;
40290 	uint8_t	unused_0[3];
40291 	/*
40292 	 * This field is used in Output records to indicate that the output
40293 	 * is completely written to RAM. This field should be read as '1'
40294 	 * to indicate that the output has been completely written. When
40295 	 * writing a command completion or response to an internal processor,
40296 	 * the order of writes has to be such that this field is written last.
40297 	 */
40298 	uint8_t	valid;
40299 } hwrm_vnic_alloc_output_t, *phwrm_vnic_alloc_output_t;
40300 
40301 /********************
40302  * hwrm_vnic_update *
40303  ********************/
40304 
40305 
40306 /* hwrm_vnic_update_input (size:256b/32B) */
40307 
40308 typedef struct hwrm_vnic_update_input {
40309 	/* The HWRM command request type. */
40310 	uint16_t	req_type;
40311 	/*
40312 	 * The completion ring to send the completion event on. This should
40313 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40314 	 */
40315 	uint16_t	cmpl_ring;
40316 	/*
40317 	 * The sequence ID is used by the driver for tracking multiple
40318 	 * commands. This ID is treated as opaque data by the firmware and
40319 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40320 	 */
40321 	uint16_t	seq_id;
40322 	/*
40323 	 * The target ID of the command:
40324 	 * * 0x0-0xFFF8 - The function ID
40325 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40326 	 * * 0xFFFD - Reserved for user-space HWRM interface
40327 	 * * 0xFFFF - HWRM
40328 	 */
40329 	uint16_t	target_id;
40330 	/*
40331 	 * A physical address pointer pointing to a host buffer that the
40332 	 * command's response data will be written. This can be either a host
40333 	 * physical address (HPA) or a guest physical address (GPA) and must
40334 	 * point to a physically contiguous block of memory.
40335 	 */
40336 	uint64_t	resp_addr;
40337 	/* Logical vnic ID */
40338 	uint32_t	vnic_id;
40339 	uint32_t	enables;
40340 	/*
40341 	 * This bit must be '1' for the vnic_state field to be
40342 	 * configured.
40343 	 */
40344 	#define HWRM_VNIC_UPDATE_INPUT_ENABLES_VNIC_STATE_VALID		UINT32_C(0x1)
40345 	/*
40346 	 * This bit must be '1' for the mru field to be
40347 	 * configured.
40348 	 */
40349 	#define HWRM_VNIC_UPDATE_INPUT_ENABLES_MRU_VALID			UINT32_C(0x2)
40350 	/*
40351 	 * This bit must be '1' for the metadata_format_type field to be
40352 	 * configured.
40353 	 */
40354 	#define HWRM_VNIC_UPDATE_INPUT_ENABLES_METADATA_FORMAT_TYPE_VALID	UINT32_C(0x4)
40355 	/*
40356 	 * This will update the context variable with the same name if
40357 	 * the corresponding enable is set.
40358 	 */
40359 	uint8_t	vnic_state;
40360 	/* Normal operation state for the VNIC. */
40361 	#define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_NORMAL UINT32_C(0x0)
40362 	/* All packets are dropped in this state. */
40363 	#define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_DROP   UINT32_C(0x1)
40364 	#define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_LAST  HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_DROP
40365 	/*
40366 	 * The metadata format type used in all the RX packet completions
40367 	 * going through this VNIC. This value is product specific. Refer to
40368 	 * the L2 HSI completion ring structures for the detailed
40369 	 * descriptions. For Thor and Thor2, it corresponds to 'meta_format'
40370 	 * in 'rx_pkt_cmpl_hi' and 'rx_pkt_v3_cmpl_hi', respectively.
40371 	 */
40372 	uint8_t	metadata_format_type;
40373 	#define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_0 UINT32_C(0x0)
40374 	#define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_1 UINT32_C(0x1)
40375 	#define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_2 UINT32_C(0x2)
40376 	#define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_3 UINT32_C(0x3)
40377 	#define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_4 UINT32_C(0x4)
40378 	#define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_LAST HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_4
40379 	/*
40380 	 * The maximum receive unit of the vnic.
40381 	 * Each vnic is associated with a function.
40382 	 * The vnic mru value overwrites the mru setting of the
40383 	 * associated function.
40384 	 * The HWRM shall make sure that vnic mru does not exceed
40385 	 * the mru of the port the function is associated with.
40386 	 */
40387 	uint16_t	mru;
40388 	uint8_t	unused_1[4];
40389 } hwrm_vnic_update_input_t, *phwrm_vnic_update_input_t;
40390 
40391 /* hwrm_vnic_update_output (size:128b/16B) */
40392 
40393 typedef struct hwrm_vnic_update_output {
40394 	/* The specific error status for the command. */
40395 	uint16_t	error_code;
40396 	/* The HWRM command request type. */
40397 	uint16_t	req_type;
40398 	/* The sequence ID from the original command. */
40399 	uint16_t	seq_id;
40400 	/* The length of the response data in number of bytes. */
40401 	uint16_t	resp_len;
40402 	uint8_t	unused_0[7];
40403 	/*
40404 	 * This field is used in Output records to indicate that the output
40405 	 * is completely written to RAM. This field should be read as '1'
40406 	 * to indicate that the output has been completely written.
40407 	 * When writing a command completion or response to an internal
40408 	 * processor, the order of writes has to be such that this field is
40409 	 * written last.
40410 	 */
40411 	uint8_t	valid;
40412 } hwrm_vnic_update_output_t, *phwrm_vnic_update_output_t;
40413 
40414 /******************
40415  * hwrm_vnic_free *
40416  ******************/
40417 
40418 
40419 /* hwrm_vnic_free_input (size:192b/24B) */
40420 
40421 typedef struct hwrm_vnic_free_input {
40422 	/* The HWRM command request type. */
40423 	uint16_t	req_type;
40424 	/*
40425 	 * The completion ring to send the completion event on. This should
40426 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40427 	 */
40428 	uint16_t	cmpl_ring;
40429 	/*
40430 	 * The sequence ID is used by the driver for tracking multiple
40431 	 * commands. This ID is treated as opaque data by the firmware and
40432 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40433 	 */
40434 	uint16_t	seq_id;
40435 	/*
40436 	 * The target ID of the command:
40437 	 * * 0x0-0xFFF8 - The function ID
40438 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40439 	 * * 0xFFFD - Reserved for user-space HWRM interface
40440 	 * * 0xFFFF - HWRM
40441 	 */
40442 	uint16_t	target_id;
40443 	/*
40444 	 * A physical address pointer pointing to a host buffer that the
40445 	 * command's response data will be written. This can be either a host
40446 	 * physical address (HPA) or a guest physical address (GPA) and must
40447 	 * point to a physically contiguous block of memory.
40448 	 */
40449 	uint64_t	resp_addr;
40450 	/* Logical vnic ID */
40451 	uint32_t	vnic_id;
40452 	uint8_t	unused_0[4];
40453 } hwrm_vnic_free_input_t, *phwrm_vnic_free_input_t;
40454 
40455 /* hwrm_vnic_free_output (size:128b/16B) */
40456 
40457 typedef struct hwrm_vnic_free_output {
40458 	/* The specific error status for the command. */
40459 	uint16_t	error_code;
40460 	/* The HWRM command request type. */
40461 	uint16_t	req_type;
40462 	/* The sequence ID from the original command. */
40463 	uint16_t	seq_id;
40464 	/* The length of the response data in number of bytes. */
40465 	uint16_t	resp_len;
40466 	uint8_t	unused_0[7];
40467 	/*
40468 	 * This field is used in Output records to indicate that the output
40469 	 * is completely written to RAM. This field should be read as '1'
40470 	 * to indicate that the output has been completely written. When
40471 	 * writing a command completion or response to an internal processor,
40472 	 * the order of writes has to be such that this field is written last.
40473 	 */
40474 	uint8_t	valid;
40475 } hwrm_vnic_free_output_t, *phwrm_vnic_free_output_t;
40476 
40477 /*****************
40478  * hwrm_vnic_cfg *
40479  *****************/
40480 
40481 
40482 /* hwrm_vnic_cfg_input (size:384b/48B) */
40483 
40484 typedef struct hwrm_vnic_cfg_input {
40485 	/* The HWRM command request type. */
40486 	uint16_t	req_type;
40487 	/*
40488 	 * The completion ring to send the completion event on. This should
40489 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40490 	 */
40491 	uint16_t	cmpl_ring;
40492 	/*
40493 	 * The sequence ID is used by the driver for tracking multiple
40494 	 * commands. This ID is treated as opaque data by the firmware and
40495 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40496 	 */
40497 	uint16_t	seq_id;
40498 	/*
40499 	 * The target ID of the command:
40500 	 * * 0x0-0xFFF8 - The function ID
40501 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40502 	 * * 0xFFFD - Reserved for user-space HWRM interface
40503 	 * * 0xFFFF - HWRM
40504 	 */
40505 	uint16_t	target_id;
40506 	/*
40507 	 * A physical address pointer pointing to a host buffer that the
40508 	 * command's response data will be written. This can be either a host
40509 	 * physical address (HPA) or a guest physical address (GPA) and must
40510 	 * point to a physically contiguous block of memory.
40511 	 */
40512 	uint64_t	resp_addr;
40513 	uint32_t	flags;
40514 	/*
40515 	 * When this bit is '1', the VNIC is requested to
40516 	 * be the default VNIC for the function.
40517 	 */
40518 	#define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT				UINT32_C(0x1)
40519 	/*
40520 	 * When this bit is '1', the VNIC is being configured to
40521 	 * strip VLAN in the RX path.
40522 	 * If set to '0', then VLAN stripping is disabled on
40523 	 * this VNIC.
40524 	 */
40525 	#define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE			UINT32_C(0x2)
40526 	/*
40527 	 * When this bit is '1', the VNIC is being configured to
40528 	 * buffer receive packets in the hardware until the host
40529 	 * posts new receive buffers.
40530 	 * If set to '0', then bd_stall is being configured to be
40531 	 * disabled on this VNIC.
40532 	 */
40533 	#define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE			UINT32_C(0x4)
40534 	/*
40535 	 * When this bit is '1', the VNIC is being configured to
40536 	 * receive both RoCE and non-RoCE traffic.
40537 	 * If set to '0', then this VNIC is not configured to be
40538 	 * operating in dual VNIC mode.
40539 	 */
40540 	#define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE		UINT32_C(0x8)
40541 	/*
40542 	 * When this flag is set to '1', the VNIC is requested to
40543 	 * be configured to receive only RoCE traffic.
40544 	 * If this flag is set to '0', then this flag shall be
40545 	 * ignored by the HWRM.
40546 	 * If roce_dual_vnic_mode flag is set to '1'
40547 	 * or roce_mirroring_capable_vnic_mode flag to 1,
40548 	 * then the HWRM client shall not set this flag to '1'.
40549 	 */
40550 	#define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE		UINT32_C(0x10)
40551 	/*
40552 	 * When a VNIC uses one destination ring group for certain
40553 	 * application (e.g. Receive Flow Steering) where
40554 	 * exact match is used to direct packets to a VNIC with one
40555 	 * destination ring group only, there is no need to configure
40556 	 * RSS indirection table for that VNIC as only one destination
40557 	 * ring group is used.
40558 	 *
40559 	 * This flag is used to enable a mode where
40560 	 * RSS is enabled in the VNIC using a RSS context
40561 	 * for computing RSS hash but the RSS indirection table is
40562 	 * not configured using hwrm_vnic_rss_cfg.
40563 	 *
40564 	 * If this mode is enabled, then the driver should not program
40565 	 * RSS indirection table for the RSS context that is used for
40566 	 * computing RSS hash only.
40567 	 */
40568 	#define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE			UINT32_C(0x20)
40569 	/*
40570 	 * When this bit is '1', the VNIC is being configured to
40571 	 * receive both RoCE and non-RoCE traffic, but forward only the
40572 	 * RoCE traffic further. Also, RoCE traffic can be mirrored to
40573 	 * L2 driver.
40574 	 */
40575 	#define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE	UINT32_C(0x40)
40576 	/*
40577 	 * When this bit is '1' it enables ring selection using the incoming
40578 	 * spif and lcos for the packet.
40579 	 */
40580 	#define HWRM_VNIC_CFG_INPUT_FLAGS_PORTCOS_MAPPING_MODE		UINT32_C(0x80)
40581 	uint32_t	enables;
40582 	/*
40583 	 * This bit must be '1' for the dflt_ring_grp field to be
40584 	 * configured.
40585 	 */
40586 	#define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP		UINT32_C(0x1)
40587 	/*
40588 	 * This bit must be '1' for the rss_rule field to be
40589 	 * configured.
40590 	 */
40591 	#define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE		UINT32_C(0x2)
40592 	/*
40593 	 * This bit must be '1' for the cos_rule field to be
40594 	 * configured.
40595 	 */
40596 	#define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE		UINT32_C(0x4)
40597 	/*
40598 	 * This bit must be '1' for the lb_rule field to be
40599 	 * configured.
40600 	 */
40601 	#define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE		UINT32_C(0x8)
40602 	/*
40603 	 * This bit must be '1' for the mru field to be
40604 	 * configured.
40605 	 */
40606 	#define HWRM_VNIC_CFG_INPUT_ENABLES_MRU			UINT32_C(0x10)
40607 	/*
40608 	 * This bit must be '1' for the default_rx_ring_id field to be
40609 	 * configured.
40610 	 */
40611 	#define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID	UINT32_C(0x20)
40612 	/*
40613 	 * This bit must be '1' for the default_cmpl_ring_id field to be
40614 	 * configured.
40615 	 */
40616 	#define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID	UINT32_C(0x40)
40617 	/* This bit must be '1' for the queue_id field to be configured. */
40618 	#define HWRM_VNIC_CFG_INPUT_ENABLES_QUEUE_ID		UINT32_C(0x80)
40619 	/*
40620 	 * This bit must be '1' for the rx_csum_v2_mode field to be
40621 	 * configured.
40622 	 */
40623 	#define HWRM_VNIC_CFG_INPUT_ENABLES_RX_CSUM_V2_MODE	UINT32_C(0x100)
40624 	/* This bit must be '1' for the l2_cqe_mode field to be configured. */
40625 	#define HWRM_VNIC_CFG_INPUT_ENABLES_L2_CQE_MODE		UINT32_C(0x200)
40626 	/* Logical vnic ID */
40627 	uint16_t	vnic_id;
40628 	/*
40629 	 * Default Completion ring for the VNIC. This ring will
40630 	 * be chosen if packet does not match any RSS rules and if
40631 	 * there is no COS rule.
40632 	 */
40633 	uint16_t	dflt_ring_grp;
40634 	/*
40635 	 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if
40636 	 * there is no RSS rule.
40637 	 */
40638 	uint16_t	rss_rule;
40639 	/*
40640 	 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if
40641 	 * there is no COS rule.
40642 	 */
40643 	uint16_t	cos_rule;
40644 	/*
40645 	 * RSS ID for load balancing rule/table structure.
40646 	 * 0xFF... (All Fs) if there is no LB rule.
40647 	 */
40648 	uint16_t	lb_rule;
40649 	/*
40650 	 * The maximum receive unit of the vnic.
40651 	 * Each vnic is associated with a function.
40652 	 * The vnic mru value overwrites the mru setting of the
40653 	 * associated function.
40654 	 * The HWRM shall make sure that vnic mru does not exceed
40655 	 * the mru of the port the function is associated with.
40656 	 */
40657 	uint16_t	mru;
40658 	/*
40659 	 * Default Rx ring for the VNIC. This ring will
40660 	 * be chosen if packet does not match any RSS rules.
40661 	 * The aggregation ring associated with the Rx ring is
40662 	 * implied based on the Rx ring specified when the
40663 	 * aggregation ring was allocated.
40664 	 */
40665 	uint16_t	default_rx_ring_id;
40666 	/*
40667 	 * Default completion ring for the VNIC. This ring will
40668 	 * be chosen if packet does not match any RSS rules.
40669 	 */
40670 	uint16_t	default_cmpl_ring_id;
40671 	/*
40672 	 * When specified, only incoming packets classified to the specified
40673 	 * CoS queue ID will be arriving on this VNIC. Packet priority to CoS
40674 	 * mapping rules can be specified using HWRM_QUEUE_PRI2COS_CFG. In this
40675 	 * mode, ntuple filters with VNIC destination specified are invalid
40676 	 * since they conflict with the CoS to VNIC steering rules in this
40677 	 * mode.
40678 	 *
40679 	 * If this field is not specified, packet to VNIC steering will be
40680 	 * subject to the standard L2 filter rules and any additional ntuple
40681 	 * filter rules with destination VNIC specified.
40682 	 */
40683 	uint16_t	queue_id;
40684 	/*
40685 	 * If the device supports the RX V2 and RX TPA start V2 completion
40686 	 * records as indicated by the HWRM_VNIC_QCAPS command, this field is
40687 	 * used to specify the two RX checksum modes supported by these
40688 	 * completion records.
40689 	 */
40690 	uint8_t	rx_csum_v2_mode;
40691 	/*
40692 	 * When configured with this checksum mode, the number of header
40693 	 * groups in the delivered packet with a valid IP checksum and
40694 	 * the number of header groups in the delivered packet with a valid
40695 	 * L4 checksum are reported. Valid checksums are counted from the
40696 	 * outermost header group to the innermost header group, stopping at
40697 	 * the first error. This is the default checksum mode supported if
40698 	 * the driver doesn't explicitly configure the RX checksum mode.
40699 	 */
40700 	#define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_DEFAULT UINT32_C(0x0)
40701 	/*
40702 	 * When configured with this checksum mode, the checksum status is
40703 	 * reported using 'all ok' mode. In the RX completion record, one
40704 	 * bit indicates if the IP checksum is valid for all the parsed
40705 	 * header groups with an IP checksum. Another bit indicates if the
40706 	 * L4 checksum is valid for all the parsed header groups with an L4
40707 	 * checksum. The number of header groups that were parsed by the
40708 	 * chip and passed in the delivered packet is also reported.
40709 	 */
40710 	#define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_ALL_OK  UINT32_C(0x1)
40711 	/*
40712 	 * Any rx_csum_v2_mode value larger than or equal to this is not
40713 	 * valid
40714 	 */
40715 	#define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_MAX	UINT32_C(0x2)
40716 	#define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_LAST   HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_MAX
40717 	/*
40718 	 * If the device supports different L2 RX CQE modes, as indicated by
40719 	 * the HWRM_VNIC_QCAPS command, this field is used to configure the
40720 	 * CQE mode.
40721 	 */
40722 	uint8_t	l2_cqe_mode;
40723 	/*
40724 	 * When configured with this cqe mode, A normal (32B) CQE
40725 	 * will be generated. This is the default mode.
40726 	 */
40727 	#define HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_DEFAULT	UINT32_C(0x0)
40728 	/*
40729 	 * When configured with this cqe mode, A compressed (16B) CQE
40730 	 * will be generated. In this mode TPA and HDS are not supported.
40731 	 * Host drivers should not configure the TPA and HDS along with
40732 	 * compressed mode, per VNIC. FW returns error, if host drivers
40733 	 * try to configure the VNIC with compressed mode and (TPA or HDS).
40734 	 * The compressed completion does not include PTP data. Host
40735 	 * drivers should not use this mode to receive the PTP data.
40736 	 */
40737 	#define HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_COMPRESSED UINT32_C(0x1)
40738 	/*
40739 	 * When configured with this cqe mode, HW generates either a 32B
40740 	 * completion or a 16B completion depending on use case within a
40741 	 * VNIC. For ex. a simple L2 packet could use the compressed form
40742 	 * while a PTP packet on the same VNIC would use the 32B form.
40743 	 */
40744 	#define HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_MIXED	UINT32_C(0x2)
40745 	#define HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_LAST	HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_MIXED
40746 	uint8_t	unused0[4];
40747 } hwrm_vnic_cfg_input_t, *phwrm_vnic_cfg_input_t;
40748 
40749 /* hwrm_vnic_cfg_output (size:128b/16B) */
40750 
40751 typedef struct hwrm_vnic_cfg_output {
40752 	/* The specific error status for the command. */
40753 	uint16_t	error_code;
40754 	/* The HWRM command request type. */
40755 	uint16_t	req_type;
40756 	/* The sequence ID from the original command. */
40757 	uint16_t	seq_id;
40758 	/* The length of the response data in number of bytes. */
40759 	uint16_t	resp_len;
40760 	uint8_t	unused_0[7];
40761 	/*
40762 	 * This field is used in Output records to indicate that the output
40763 	 * is completely written to RAM. This field should be read as '1'
40764 	 * to indicate that the output has been completely written. When
40765 	 * writing a command completion or response to an internal processor,
40766 	 * the order of writes has to be such that this field is written last.
40767 	 */
40768 	uint8_t	valid;
40769 } hwrm_vnic_cfg_output_t, *phwrm_vnic_cfg_output_t;
40770 
40771 /******************
40772  * hwrm_vnic_qcfg *
40773  ******************/
40774 
40775 
40776 /* hwrm_vnic_qcfg_input (size:256b/32B) */
40777 
40778 typedef struct hwrm_vnic_qcfg_input {
40779 	/* The HWRM command request type. */
40780 	uint16_t	req_type;
40781 	/*
40782 	 * The completion ring to send the completion event on. This should
40783 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
40784 	 */
40785 	uint16_t	cmpl_ring;
40786 	/*
40787 	 * The sequence ID is used by the driver for tracking multiple
40788 	 * commands. This ID is treated as opaque data by the firmware and
40789 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
40790 	 */
40791 	uint16_t	seq_id;
40792 	/*
40793 	 * The target ID of the command:
40794 	 * * 0x0-0xFFF8 - The function ID
40795 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40796 	 * * 0xFFFD - Reserved for user-space HWRM interface
40797 	 * * 0xFFFF - HWRM
40798 	 */
40799 	uint16_t	target_id;
40800 	/*
40801 	 * A physical address pointer pointing to a host buffer that the
40802 	 * command's response data will be written. This can be either a host
40803 	 * physical address (HPA) or a guest physical address (GPA) and must
40804 	 * point to a physically contiguous block of memory.
40805 	 */
40806 	uint64_t	resp_addr;
40807 	uint32_t	enables;
40808 	/*
40809 	 * This bit must be '1' for the vf_id_valid field to be
40810 	 * configured.
40811 	 */
40812 	#define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID	UINT32_C(0x1)
40813 	/* Logical vnic ID */
40814 	uint32_t	vnic_id;
40815 	/* ID of Virtual Function whose VNIC resource is being queried. */
40816 	uint16_t	vf_id;
40817 	uint8_t	unused_0[6];
40818 } hwrm_vnic_qcfg_input_t, *phwrm_vnic_qcfg_input_t;
40819 
40820 /* hwrm_vnic_qcfg_output (size:256b/32B) */
40821 
40822 typedef struct hwrm_vnic_qcfg_output {
40823 	/* The specific error status for the command. */
40824 	uint16_t	error_code;
40825 	/* The HWRM command request type. */
40826 	uint16_t	req_type;
40827 	/* The sequence ID from the original command. */
40828 	uint16_t	seq_id;
40829 	/* The length of the response data in number of bytes. */
40830 	uint16_t	resp_len;
40831 	/* Default Completion ring for the VNIC. */
40832 	uint16_t	dflt_ring_grp;
40833 	/*
40834 	 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if
40835 	 * there is no RSS rule.
40836 	 */
40837 	uint16_t	rss_rule;
40838 	/*
40839 	 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if
40840 	 * there is no COS rule.
40841 	 */
40842 	uint16_t	cos_rule;
40843 	/*
40844 	 * RSS ID for load balancing rule/table structure.
40845 	 * 0xFF... (All Fs) if there is no LB rule.
40846 	 */
40847 	uint16_t	lb_rule;
40848 	/* The maximum receive unit of the vnic. */
40849 	uint16_t	mru;
40850 	uint8_t	unused_0[2];
40851 	uint32_t	flags;
40852 	/*
40853 	 * When this bit is '1', the VNIC is the default VNIC for
40854 	 * the function.
40855 	 */
40856 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT				UINT32_C(0x1)
40857 	/*
40858 	 * When this bit is '1', the VNIC is configured to
40859 	 * strip VLAN in the RX path.
40860 	 * If set to '0', then VLAN stripping is disabled on
40861 	 * this VNIC.
40862 	 */
40863 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE			UINT32_C(0x2)
40864 	/*
40865 	 * When this bit is '1', the VNIC is configured to
40866 	 * buffer receive packets in the hardware until the host
40867 	 * posts new receive buffers.
40868 	 * If set to '0', then bd_stall is disabled on
40869 	 * this VNIC.
40870 	 */
40871 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE			UINT32_C(0x4)
40872 	/*
40873 	 * When this bit is '1', the VNIC is configured to
40874 	 * receive both RoCE and non-RoCE traffic.
40875 	 * If set to '0', then this VNIC is not configured to
40876 	 * operate in dual VNIC mode.
40877 	 */
40878 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE		UINT32_C(0x8)
40879 	/*
40880 	 * When this flag is set to '1', the VNIC is configured to
40881 	 * receive only RoCE traffic.
40882 	 * When this flag is set to '0', the VNIC is not configured
40883 	 * to receive only RoCE traffic.
40884 	 * If roce_dual_vnic_mode flag and this flag both are set
40885 	 * to '1', then it is an invalid configuration of the
40886 	 * VNIC. The HWRM should not allow that type of
40887 	 * mis-configuration by HWRM clients.
40888 	 */
40889 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE		UINT32_C(0x10)
40890 	/*
40891 	 * When a VNIC uses one destination ring group for certain
40892 	 * application (e.g. Receive Flow Steering) where
40893 	 * exact match is used to direct packets to a VNIC with one
40894 	 * destination ring group only, there is no need to configure
40895 	 * RSS indirection table for that VNIC as only one destination
40896 	 * ring group is used.
40897 	 *
40898 	 * When this bit is set to '1', then the VNIC is enabled in a
40899 	 * mode where RSS is enabled in the VNIC using a RSS context
40900 	 * for computing RSS hash but the RSS indirection table is
40901 	 * not configured.
40902 	 */
40903 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE			UINT32_C(0x20)
40904 	/*
40905 	 * When this bit is '1', the VNIC is configured to
40906 	 * receive both RoCE and non-RoCE traffic, but forward only
40907 	 * RoCE traffic further. Also RoCE traffic can be mirrored to
40908 	 * L2 driver.
40909 	 */
40910 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE	UINT32_C(0x40)
40911 	/*
40912 	 * When this bit is '0', VNIC is in normal operation state.
40913 	 * When this bit is '1', VNIC drops all the received packets.
40914 	 */
40915 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_OPERATION_STATE			UINT32_C(0x80)
40916 	/* When this bit is '1' it indicates port cos_mapping_mode enabled. */
40917 	#define HWRM_VNIC_QCFG_OUTPUT_FLAGS_PORTCOS_MAPPING_MODE		UINT32_C(0x100)
40918 	/*
40919 	 * When returned with a valid CoS Queue id, the CoS Queue/VNIC
40920 	 * association is valid. Otherwise it will return 0xFFFF to indicate no
40921 	 * VNIC/CoS queue association.
40922 	 */
40923 	uint16_t	queue_id;
40924 	/*
40925 	 * If the device supports the RX V2 and RX TPA start V2 completion
40926 	 * records as indicated by the HWRM_VNIC_QCAPS command, this field is
40927 	 * used to specify the current RX checksum mode configured for all the
40928 	 * RX rings of a VNIC.
40929 	 */
40930 	uint8_t	rx_csum_v2_mode;
40931 	/*
40932 	 * This value indicates that the VNIC is configured to use the
40933 	 * default RX checksum mode for all the rings associated with this
40934 	 * VNIC.
40935 	 */
40936 	#define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_DEFAULT UINT32_C(0x0)
40937 	/*
40938 	 * This value indicates that the VNIC is configured to use the RX
40939 	 * checksum 'all_ok' mode for all the rings associated with this
40940 	 * VNIC.
40941 	 */
40942 	#define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_ALL_OK  UINT32_C(0x1)
40943 	/*
40944 	 * Any rx_csum_v2_mode value larger than or equal to this is not
40945 	 * valid
40946 	 */
40947 	#define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_MAX	UINT32_C(0x2)
40948 	#define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_LAST   HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_MAX
40949 	/*
40950 	 * If the device supports different L2 RX CQE modes, as indicated by
40951 	 * the HWRM_VNIC_QCAPS command, this field is used to convey the
40952 	 * configured CQE mode.
40953 	 */
40954 	uint8_t	l2_cqe_mode;
40955 	/*
40956 	 * This value indicates that the VNIC is configured with normal
40957 	 * (32B) CQE mode.
40958 	 */
40959 	#define HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_DEFAULT	UINT32_C(0x0)
40960 	/*
40961 	 * This value indicates that the VNIC is configured with compressed
40962 	 * (16B) CQE mode.
40963 	 */
40964 	#define HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_COMPRESSED UINT32_C(0x1)
40965 	/*
40966 	 * This value indicates that the VNIC is configured with mixed
40967 	 * CQE mode. HW generates either a 32B completion or a 16B
40968 	 * completion depending on use case within a VNIC.
40969 	 */
40970 	#define HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_MIXED	UINT32_C(0x2)
40971 	#define HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_LAST	HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_MIXED
40972 	/*
40973 	 * This field conveys the metadata format type that has been
40974 	 * configured. This value is product specific. Refer to the L2 HSI
40975 	 * completion ring structures for the detailed descriptions. For Thor
40976 	 * and Thor2, it corresponds to 'meta_format' in 'rx_pkt_cmpl_hi' and
40977 	 * 'rx_pkt_v3_cmpl_hi', respectively.
40978 	 */
40979 	uint8_t	metadata_format_type;
40980 	#define HWRM_VNIC_QCFG_OUTPUT_METADATA_FORMAT_TYPE_0 UINT32_C(0x0)
40981 	#define HWRM_VNIC_QCFG_OUTPUT_METADATA_FORMAT_TYPE_1 UINT32_C(0x1)
40982 	#define HWRM_VNIC_QCFG_OUTPUT_METADATA_FORMAT_TYPE_2 UINT32_C(0x2)
40983 	#define HWRM_VNIC_QCFG_OUTPUT_METADATA_FORMAT_TYPE_3 UINT32_C(0x3)
40984 	#define HWRM_VNIC_QCFG_OUTPUT_METADATA_FORMAT_TYPE_4 UINT32_C(0x4)
40985 	#define HWRM_VNIC_QCFG_OUTPUT_METADATA_FORMAT_TYPE_LAST HWRM_VNIC_QCFG_OUTPUT_METADATA_FORMAT_TYPE_4
40986 	/* This field conveys the VNIC operation state. */
40987 	uint8_t	vnic_state;
40988 	/* Normal operation state. */
40989 	#define HWRM_VNIC_QCFG_OUTPUT_VNIC_STATE_NORMAL UINT32_C(0x0)
40990 	/* Drop all packets. */
40991 	#define HWRM_VNIC_QCFG_OUTPUT_VNIC_STATE_DROP   UINT32_C(0x1)
40992 	#define HWRM_VNIC_QCFG_OUTPUT_VNIC_STATE_LAST  HWRM_VNIC_QCFG_OUTPUT_VNIC_STATE_DROP
40993 	uint8_t	unused_1;
40994 	/*
40995 	 * This field is used in Output records to indicate that the output
40996 	 * is completely written to RAM. This field should be read as '1'
40997 	 * to indicate that the output has been completely written. When
40998 	 * writing a command completion or response to an internal processor,
40999 	 * the order of writes has to be such that this field is written last.
41000 	 */
41001 	uint8_t	valid;
41002 } hwrm_vnic_qcfg_output_t, *phwrm_vnic_qcfg_output_t;
41003 
41004 /*******************
41005  * hwrm_vnic_qcaps *
41006  *******************/
41007 
41008 
41009 /* hwrm_vnic_qcaps_input (size:192b/24B) */
41010 
41011 typedef struct hwrm_vnic_qcaps_input {
41012 	/* The HWRM command request type. */
41013 	uint16_t	req_type;
41014 	/*
41015 	 * The completion ring to send the completion event on. This should
41016 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
41017 	 */
41018 	uint16_t	cmpl_ring;
41019 	/*
41020 	 * The sequence ID is used by the driver for tracking multiple
41021 	 * commands. This ID is treated as opaque data by the firmware and
41022 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
41023 	 */
41024 	uint16_t	seq_id;
41025 	/*
41026 	 * The target ID of the command:
41027 	 * * 0x0-0xFFF8 - The function ID
41028 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41029 	 * * 0xFFFD - Reserved for user-space HWRM interface
41030 	 * * 0xFFFF - HWRM
41031 	 */
41032 	uint16_t	target_id;
41033 	/*
41034 	 * A physical address pointer pointing to a host buffer that the
41035 	 * command's response data will be written. This can be either a host
41036 	 * physical address (HPA) or a guest physical address (GPA) and must
41037 	 * point to a physically contiguous block of memory.
41038 	 */
41039 	uint64_t	resp_addr;
41040 	uint32_t	enables;
41041 	uint8_t	unused_0[4];
41042 } hwrm_vnic_qcaps_input_t, *phwrm_vnic_qcaps_input_t;
41043 
41044 /* hwrm_vnic_qcaps_output (size:192b/24B) */
41045 
41046 typedef struct hwrm_vnic_qcaps_output {
41047 	/* The specific error status for the command. */
41048 	uint16_t	error_code;
41049 	/* The HWRM command request type. */
41050 	uint16_t	req_type;
41051 	/* The sequence ID from the original command. */
41052 	uint16_t	seq_id;
41053 	/* The length of the response data in number of bytes. */
41054 	uint16_t	resp_len;
41055 	/* The maximum receive unit that is settable on a vnic. */
41056 	uint16_t	mru;
41057 	uint8_t	unused_0[2];
41058 	uint32_t	flags;
41059 	/* Unused. */
41060 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED				UINT32_C(0x1)
41061 	/*
41062 	 * When this bit is '1', the capability of stripping VLAN in
41063 	 * the RX path is supported on VNIC(s).
41064 	 * If set to '0', then VLAN stripping capability is
41065 	 * not supported on VNIC(s).
41066 	 */
41067 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP			UINT32_C(0x2)
41068 	/*
41069 	 * When this bit is '1', the capability to buffer receive
41070 	 * packets in the hardware until the host posts new receive buffers
41071 	 * is supported on VNIC(s).
41072 	 * If set to '0', then bd_stall capability is not supported
41073 	 * on VNIC(s).
41074 	 */
41075 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP				UINT32_C(0x4)
41076 	/*
41077 	 * When this bit is '1', the capability to
41078 	 * receive both RoCE and non-RoCE traffic on VNIC(s) is
41079 	 * supported.
41080 	 * If set to '0', then the capability to receive
41081 	 * both RoCE and non-RoCE traffic on VNIC(s) is
41082 	 * not supported.
41083 	 */
41084 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP			UINT32_C(0x8)
41085 	/*
41086 	 * When this bit is set to '1', the capability to configure
41087 	 * a VNIC to receive only RoCE traffic is supported.
41088 	 * When this flag is set to '0', the VNIC capability to
41089 	 * configure to receive only RoCE traffic is not supported.
41090 	 */
41091 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP			UINT32_C(0x10)
41092 	/*
41093 	 * When this bit is set to '1', then the capability to enable
41094 	 * a VNIC in a mode where RSS context without configuring
41095 	 * RSS indirection table is supported (for RSS hash computation).
41096 	 * When this bit is set to '0', then a VNIC can not be configured
41097 	 * with a mode to enable RSS context without configuring RSS
41098 	 * indirection table.
41099 	 */
41100 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP			UINT32_C(0x20)
41101 	/*
41102 	 * When this bit is '1', the capability to
41103 	 * mirror the RoCE traffic is supported.
41104 	 * If set to '0', then the capability to mirror the
41105 	 * RoCE traffic is not supported.
41106 	 */
41107 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP	UINT32_C(0x40)
41108 	/*
41109 	 * When this bit is '1', the outermost RSS hashing capability
41110 	 * is supported. If set to '0', then the outermost RSS hashing
41111 	 * capability is not supported.
41112 	 */
41113 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_CAP			UINT32_C(0x80)
41114 	/*
41115 	 * When this bit is '1', it indicates that firmware supports the
41116 	 * ability to steer incoming packets from one CoS queue to one
41117 	 * VNIC. This optional feature can then be enabled
41118 	 * using HWRM_VNIC_CFG on any VNIC. This feature is only
41119 	 * available when NVM option 'enable_cos_classification' is set
41120 	 * to 1. If set to '0', firmware does not support this feature.
41121 	 */
41122 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_COS_ASSIGNMENT_CAP			UINT32_C(0x100)
41123 	/*
41124 	 * When this bit is '1', it indicates that HW and firmware supports
41125 	 * the use of RX V2 and RX TPA start V2 completion records for all
41126 	 * the RX rings of a VNIC. Once set, this feature is mandatory to
41127 	 * be used for the RX rings of the VNIC. Additionally, two new RX
41128 	 * checksum features supported by these completion records can be
41129 	 * configured using the HWRM_VNIC_CFG on a VNIC. If set to '0', the
41130 	 * HW and the firmware does not support this feature.
41131 	 */
41132 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RX_CMPL_V2_CAP			UINT32_C(0x200)
41133 	/*
41134 	 * When this bit is '1', it indicates that HW and firmware support
41135 	 * vnic state change. Host drivers can change the vnic state using
41136 	 * HWRM_VNIC_UPDATE. If set to '0', the HW and firmware do not
41137 	 * support this feature.
41138 	 */
41139 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VNIC_STATE_CAP			UINT32_C(0x400)
41140 	/*
41141 	 * When this bit is '1', it indicates that firmware supports
41142 	 * virtio-net functions default VNIC allocation using
41143 	 * HWRM_VNIC_ALLOC.
41144 	 * This capability is available only on Proxy VEE PF. If set to '0',
41145 	 * firmware does not support this feature.
41146 	 */
41147 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VIRTIO_NET_VNIC_ALLOC_CAP		UINT32_C(0x800)
41148 	/*
41149 	 * When this bit is set '1', then the capability to configure the
41150 	 * metadata format in the RX completion is supported for the VNIC.
41151 	 * When this bit is set to '0', then the capability to configure
41152 	 * the metadata format in the RX completion is not supported for
41153 	 * the VNIC.
41154 	 */
41155 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_METADATA_FORMAT_CAP			UINT32_C(0x1000)
41156 	/*
41157 	 * When this bit is set '1', it indicates that firmware returns
41158 	 * INVALID_PARAM error, if host drivers choose invalid hash type
41159 	 * bit combinations in vnic_rss_cfg.
41160 	 */
41161 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_STRICT_HASH_TYPE_CAP		UINT32_C(0x2000)
41162 	/*
41163 	 * When this bit is set '1', it indicates that firmware supports
41164 	 * the hash_type include and exclude flags in hwrm_vnic_rss_cfg.
41165 	 */
41166 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_HASH_TYPE_DELTA_CAP		UINT32_C(0x4000)
41167 	/*
41168 	 * When this bit is '1', it indicates that HW is capable of using
41169 	 * Toeplitz algorithm. This mode uses Toeplitz algorithm and
41170 	 * provided Toeplitz hash key to hash the packets according to the
41171 	 * configured hash type and hash mode. The Toeplitz hash results and
41172 	 * the provided Toeplitz RSS indirection table are used to determine
41173 	 * the RSS rings.
41174 	 */
41175 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RING_SELECT_MODE_TOEPLITZ_CAP	UINT32_C(0x8000)
41176 	/*
41177 	 * When this bit is '1', it indicates that HW is capable of using
41178 	 * XOR algorithm. This mode uses 'XOR' algorithm to hash the packets
41179 	 * according to the configured hash type and hash mode. The XOR
41180 	 * hash results and the provided XOR RSS indirection table are
41181 	 * used to determine the RSS rings. Host drivers provided hash key
41182 	 * is not honored in this mode.
41183 	 */
41184 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RING_SELECT_MODE_XOR_CAP		UINT32_C(0x10000)
41185 	/*
41186 	 * When this bit is '1', it indicates that HW is capable of using
41187 	 * checksum algorithm. In this mode, HW uses inner packets checksum
41188 	 * algorithm to distribute the packets across the rings and Toeplitz
41189 	 * algorithm to calculate the hash to convey it in the RX
41190 	 * completions. Host drivers should provide Toeplitz hash key.
41191 	 * As HW uses innermost packets checksum to distribute the packets
41192 	 * across the rings, host drivers can't convey hash mode to choose
41193 	 * outer headers to calculate Toeplitz hash. FW will fail such
41194 	 * configuration.
41195 	 */
41196 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RING_SELECT_MODE_TOEPLITZ_CHKSM_CAP	UINT32_C(0x20000)
41197 	/*
41198 	 * When this bit is '1' HW supports hash calculation
41199 	 * based on IPV6 flow labels.
41200 	 */
41201 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPV6_FLOW_LABEL_CAP		UINT32_C(0x40000)
41202 	/*
41203 	 * When this bit is '1', it indicates that HW and firmware supports
41204 	 * the use of RX V3 and RX TPA start V3 completion records for all
41205 	 * the RX rings of a VNIC. Once set, this feature is mandatory to
41206 	 * be used for the RX rings of the VNIC. If set to '0', the
41207 	 * HW and the firmware does not support this feature.
41208 	 */
41209 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RX_CMPL_V3_CAP			UINT32_C(0x80000)
41210 	/*
41211 	 * When this bit is '1' HW supports different RX CQE record types.
41212 	 * Host drivers can choose the mode based on their application
41213 	 * requirements like performance, TPA, HDS and PTP.
41214 	 */
41215 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_L2_CQE_MODE_CAP			UINT32_C(0x100000)
41216 	/*
41217 	 * When this bit is '1' HW supports hash calculation
41218 	 * based on IPv4 IPSEC AH SPI field.
41219 	 */
41220 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPSEC_AH_SPI_IPV4_CAP		UINT32_C(0x200000)
41221 	/*
41222 	 * When this bit is '1' HW supports hash calculation
41223 	 * based on IPv4 IPSEC ESP SPI field.
41224 	 */
41225 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPSEC_ESP_SPI_IPV4_CAP		UINT32_C(0x400000)
41226 	/*
41227 	 * When this bit is '1' HW supports hash calculation
41228 	 * based on IPv6 IPSEC AH SPI field.
41229 	 */
41230 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPSEC_AH_SPI_IPV6_CAP		UINT32_C(0x800000)
41231 	/*
41232 	 * When this bit is '1' HW supports hash calculation
41233 	 * based on IPv6 IPSEC ESP SPI field.
41234 	 */
41235 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPSEC_ESP_SPI_IPV6_CAP		UINT32_C(0x1000000)
41236 	/*
41237 	 * When outermost_rss_cap is '1' and this bit is '1', the outermost
41238 	 * RSS hash mode may be set on a PF or trusted VF.
41239 	 * When outermost_rss_cap is '1' and this bit is '0', the outermost
41240 	 * RSS hash mode may be set on a PF.
41241 	 */
41242 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_TRUSTED_VF_CAP		UINT32_C(0x2000000)
41243 	/*
41244 	 * When this bit is '1' it indicates HW is capable of enabling ring
41245 	 * selection using the incoming spif and lcos for the packet.
41246 	 */
41247 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_PORTCOS_MAPPING_MODE			UINT32_C(0x4000000)
41248 	/*
41249 	 * When this bit is '1', it indicates controller enabled
41250 	 * RSS profile TCAM mode.
41251 	 */
41252 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_PROF_TCAM_MODE_ENABLED		UINT32_C(0x8000000)
41253 	/* When this bit is '1' FW supports VNIC hash mode. */
41254 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VNIC_RSS_HASH_MODE_CAP		UINT32_C(0x10000000)
41255 	/* When this bit is set to '1', hardware supports tunnel TPA. */
41256 	#define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_HW_TUNNEL_TPA_CAP			UINT32_C(0x20000000)
41257 	/*
41258 	 * This field advertises the maximum concurrent TPA aggregations
41259 	 * supported by the VNIC on new devices that support TPA v2 or v3.
41260 	 * '0' means that both the TPA v2 and v3 are not supported.
41261 	 */
41262 	uint16_t	max_aggs_supported;
41263 	uint8_t	unused_1[5];
41264 	/*
41265 	 * This field is used in Output records to indicate that the output
41266 	 * is completely written to RAM. This field should be read as '1'
41267 	 * to indicate that the output has been completely written. When
41268 	 * writing a command completion or response to an internal processor,
41269 	 * the order of writes has to be such that this field is written last.
41270 	 */
41271 	uint8_t	valid;
41272 } hwrm_vnic_qcaps_output_t, *phwrm_vnic_qcaps_output_t;
41273 
41274 /*********************
41275  * hwrm_vnic_tpa_cfg *
41276  *********************/
41277 
41278 
41279 /* hwrm_vnic_tpa_cfg_input (size:384b/48B) */
41280 
41281 typedef struct hwrm_vnic_tpa_cfg_input {
41282 	/* The HWRM command request type. */
41283 	uint16_t	req_type;
41284 	/*
41285 	 * The completion ring to send the completion event on. This should
41286 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
41287 	 */
41288 	uint16_t	cmpl_ring;
41289 	/*
41290 	 * The sequence ID is used by the driver for tracking multiple
41291 	 * commands. This ID is treated as opaque data by the firmware and
41292 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
41293 	 */
41294 	uint16_t	seq_id;
41295 	/*
41296 	 * The target ID of the command:
41297 	 * * 0x0-0xFFF8 - The function ID
41298 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41299 	 * * 0xFFFD - Reserved for user-space HWRM interface
41300 	 * * 0xFFFF - HWRM
41301 	 */
41302 	uint16_t	target_id;
41303 	/*
41304 	 * A physical address pointer pointing to a host buffer that the
41305 	 * command's response data will be written. This can be either a host
41306 	 * physical address (HPA) or a guest physical address (GPA) and must
41307 	 * point to a physically contiguous block of memory.
41308 	 */
41309 	uint64_t	resp_addr;
41310 	uint32_t	flags;
41311 	/*
41312 	 * When this bit is '1', the VNIC shall be configured to
41313 	 * perform transparent packet aggregation (TPA) of
41314 	 * non-tunneled TCP packets.
41315 	 */
41316 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA			UINT32_C(0x1)
41317 	/*
41318 	 * When this bit is '1', the VNIC shall be configured to
41319 	 * perform transparent packet aggregation (TPA) of
41320 	 * tunneled TCP packets.
41321 	 */
41322 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA		UINT32_C(0x2)
41323 	/*
41324 	 * When this bit is '1', the VNIC shall be configured to
41325 	 * perform transparent packet aggregation (TPA) according
41326 	 * to Windows Receive Segment Coalescing (RSC) rules.
41327 	 */
41328 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE		UINT32_C(0x4)
41329 	/*
41330 	 * When this bit is '1', the VNIC shall be configured to
41331 	 * perform transparent packet aggregation (TPA) according
41332 	 * to Linux Generic Receive Offload (GRO) rules.
41333 	 */
41334 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO			UINT32_C(0x8)
41335 	/*
41336 	 * When this bit is '1', the VNIC shall be configured to
41337 	 * perform transparent packet aggregation (TPA) for TCP
41338 	 * packets with IP ECN set to non-zero.
41339 	 */
41340 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN		UINT32_C(0x10)
41341 	/*
41342 	 * When this bit is '1', the VNIC shall be configured to
41343 	 * perform transparent packet aggregation (TPA) for
41344 	 * GRE tunneled TCP packets only if all packets have the
41345 	 * same GRE sequence.
41346 	 */
41347 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ	UINT32_C(0x20)
41348 	/*
41349 	 * When this bit is '1' and the GRO mode is enabled,
41350 	 * the VNIC shall be configured to
41351 	 * perform transparent packet aggregation (TPA) for
41352 	 * TCP/IPv4 packets with consecutively increasing IPIDs.
41353 	 * In other words, the last packet that is being
41354 	 * aggregated to an already existing aggregation context
41355 	 * shall have IPID 1 more than the IPID of the last packet
41356 	 * that was aggregated in that aggregation context.
41357 	 */
41358 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK		UINT32_C(0x40)
41359 	/*
41360 	 * When this bit is '1' and the GRO mode is enabled,
41361 	 * the VNIC shall be configured to
41362 	 * perform transparent packet aggregation (TPA) for
41363 	 * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
41364 	 * value.
41365 	 */
41366 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK		UINT32_C(0x80)
41367 	/*
41368 	 * When this bit is '1' and the GRO mode is enabled,
41369 	 * the VNIC shall DMA payload data using GRO rules.
41370 	 * When this bit is '0', the VNIC shall DMA payload data
41371 	 * using the more efficient LRO rules of filling all
41372 	 * aggregation buffers.
41373 	 */
41374 	#define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_PACK_AS_GRO	UINT32_C(0x100)
41375 	uint32_t	enables;
41376 	/*
41377 	 * This bit must be '1' for the max_agg_segs field to be
41378 	 * configured.
41379 	 */
41380 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS	UINT32_C(0x1)
41381 	/*
41382 	 * This bit must be '1' for the max_aggs field to be
41383 	 * configured.
41384 	 */
41385 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS	UINT32_C(0x2)
41386 	/*
41387 	 * This bit must be '1' for the max_agg_timer field to be
41388 	 * configured.
41389 	 */
41390 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER	UINT32_C(0x4)
41391 	/* deprecated bit. Do not use!!! */
41392 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN	UINT32_C(0x8)
41393 	/*
41394 	 * This bit must be '1' for the tnl_tpa_en_bitmap field to be
41395 	 * configured.
41396 	 */
41397 	#define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_TNL_TPA_EN	UINT32_C(0x10)
41398 	/* Logical vnic ID */
41399 	uint16_t	vnic_id;
41400 	/*
41401 	 * This is the maximum number of TCP segments that can
41402 	 * be aggregated (unit is Log2). Max value is 31. On new
41403 	 * devices supporting TPA v2, the unit is multiples of 4 and
41404 	 * valid values are > 0 and <= 63.
41405 	 */
41406 	uint16_t	max_agg_segs;
41407 	/* 1 segment */
41408 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
41409 	/* 2 segments */
41410 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
41411 	/* 4 segments */
41412 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
41413 	/* 8 segments */
41414 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
41415 	/* Any segment size larger than this is not valid */
41416 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
41417 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_LAST HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX
41418 	/*
41419 	 * This is the maximum number of aggregations this VNIC is
41420 	 * allowed (unit is Log2). Max value is 7. On new devices
41421 	 * supporting TPA v2, this is in unit of 1 and must be > 0
41422 	 * and <= max_aggs_supported in the hwrm_vnic_qcaps response
41423 	 * to enable TPA v2.
41424 	 */
41425 	uint16_t	max_aggs;
41426 	/* 1 aggregation */
41427 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1   UINT32_C(0x0)
41428 	/* 2 aggregations */
41429 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2   UINT32_C(0x1)
41430 	/* 4 aggregations */
41431 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4   UINT32_C(0x2)
41432 	/* 8 aggregations */
41433 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8   UINT32_C(0x3)
41434 	/* 16 aggregations */
41435 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16  UINT32_C(0x4)
41436 	/* Any aggregation size larger than this is not valid */
41437 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
41438 	#define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_LAST HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX
41439 	uint8_t	unused_0[2];
41440 	/*
41441 	 * This is the maximum amount of time allowed for
41442 	 * an aggregation context to complete after it was initiated.
41443 	 */
41444 	uint32_t	max_agg_timer;
41445 	/*
41446 	 * This is the minimum amount of payload length required to
41447 	 * start an aggregation context. This field is deprecated and
41448 	 * should be set to 0. The minimum length is set by firmware
41449 	 * and can be queried using hwrm_vnic_tpa_qcfg.
41450 	 */
41451 	uint32_t	min_agg_len;
41452 	/*
41453 	 * If the device supports hardware tunnel TPA feature, as indicated by
41454 	 * the HWRM_VNIC_QCAPS command, this field is used to configure the
41455 	 * tunnel types to be enabled. Each bit corresponds to a specific
41456 	 * tunnel type. If a bit is set to '1', then the associated tunnel
41457 	 * type is enabled; otherwise, it is disabled.
41458 	 */
41459 	uint32_t	tnl_tpa_en_bitmap;
41460 	/*
41461 	 * When this bit is '1', enable VXLAN encapsulated packets for
41462 	 * aggregation.
41463 	 */
41464 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_VXLAN	UINT32_C(0x1)
41465 	/*
41466 	 * When this bit is set to '1', enable GENEVE encapsulated packets
41467 	 * for aggregation.
41468 	 */
41469 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_GENEVE	UINT32_C(0x2)
41470 	/*
41471 	 * When this bit is set to '1', enable NVGRE encapsulated packets
41472 	 * for aggregation..
41473 	 */
41474 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_NVGRE	UINT32_C(0x4)
41475 	/*
41476 	 * When this bit is set to '1', enable GRE encapsulated packets
41477 	 * for aggregation..
41478 	 */
41479 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_GRE		UINT32_C(0x8)
41480 	/*
41481 	 * When this bit is set to '1', enable IPV4 encapsulated packets
41482 	 * for aggregation..
41483 	 */
41484 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_IPV4		UINT32_C(0x10)
41485 	/*
41486 	 * When this bit is set to '1', enable IPV6 encapsulated packets
41487 	 * for aggregation..
41488 	 */
41489 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_IPV6		UINT32_C(0x20)
41490 	/*
41491 	 * When this bit is '1', enable VXLAN_GPE encapsulated packets for
41492 	 * aggregation.
41493 	 */
41494 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_VXLAN_GPE	UINT32_C(0x40)
41495 	/*
41496 	 * When this bit is '1', enable VXLAN_CUSTOMER1 encapsulated packets
41497 	 * for aggregation.
41498 	 */
41499 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_VXLAN_CUST1	UINT32_C(0x80)
41500 	/*
41501 	 * When this bit is '1', enable GRE_CUSTOMER1 encapsulated packets
41502 	 * for aggregation.
41503 	 */
41504 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_GRE_CUST1	UINT32_C(0x100)
41505 	/*
41506 	 * When this bit is '1', enable UPAR1 encapsulated packets for
41507 	 * aggregation.
41508 	 */
41509 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_UPAR1	UINT32_C(0x200)
41510 	/*
41511 	 * When this bit is '1', enable UPAR2 encapsulated packets for
41512 	 * aggregation.
41513 	 */
41514 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_UPAR2	UINT32_C(0x400)
41515 	/*
41516 	 * When this bit is '1', enable UPAR3 encapsulated packets for
41517 	 * aggregation.
41518 	 */
41519 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_UPAR3	UINT32_C(0x800)
41520 	/*
41521 	 * When this bit is '1', enable UPAR4 encapsulated packets for
41522 	 * aggregation.
41523 	 */
41524 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_UPAR4	UINT32_C(0x1000)
41525 	/*
41526 	 * When this bit is '1', enable UPAR5 encapsulated packets for
41527 	 * aggregation.
41528 	 */
41529 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_UPAR5	UINT32_C(0x2000)
41530 	/*
41531 	 * When this bit is '1', enable UPAR6 encapsulated packets for
41532 	 * aggregation.
41533 	 */
41534 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_UPAR6	UINT32_C(0x4000)
41535 	/*
41536 	 * When this bit is '1', enable UPAR7 encapsulated packets for
41537 	 * aggregation.
41538 	 */
41539 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_UPAR7	UINT32_C(0x8000)
41540 	/*
41541 	 * When this bit is '1', enable UPAR8 encapsulated packets for
41542 	 * aggregation.
41543 	 */
41544 	#define HWRM_VNIC_TPA_CFG_INPUT_TNL_TPA_EN_BITMAP_UPAR8	UINT32_C(0x10000)
41545 	uint8_t	unused_1[4];
41546 } hwrm_vnic_tpa_cfg_input_t, *phwrm_vnic_tpa_cfg_input_t;
41547 
41548 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
41549 
41550 typedef struct hwrm_vnic_tpa_cfg_output {
41551 	/* The specific error status for the command. */
41552 	uint16_t	error_code;
41553 	/* The HWRM command request type. */
41554 	uint16_t	req_type;
41555 	/* The sequence ID from the original command. */
41556 	uint16_t	seq_id;
41557 	/* The length of the response data in number of bytes. */
41558 	uint16_t	resp_len;
41559 	uint8_t	unused_0[7];
41560 	/*
41561 	 * This field is used in Output records to indicate that the output
41562 	 * is completely written to RAM. This field should be read as '1'
41563 	 * to indicate that the output has been completely written. When
41564 	 * writing a command completion or response to an internal processor,
41565 	 * the order of writes has to be such that this field is written last.
41566 	 */
41567 	uint8_t	valid;
41568 } hwrm_vnic_tpa_cfg_output_t, *phwrm_vnic_tpa_cfg_output_t;
41569 
41570 /**********************
41571  * hwrm_vnic_tpa_qcfg *
41572  **********************/
41573 
41574 
41575 /* hwrm_vnic_tpa_qcfg_input (size:192b/24B) */
41576 
41577 typedef struct hwrm_vnic_tpa_qcfg_input {
41578 	/* The HWRM command request type. */
41579 	uint16_t	req_type;
41580 	/*
41581 	 * The completion ring to send the completion event on. This should
41582 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
41583 	 */
41584 	uint16_t	cmpl_ring;
41585 	/*
41586 	 * The sequence ID is used by the driver for tracking multiple
41587 	 * commands. This ID is treated as opaque data by the firmware and
41588 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
41589 	 */
41590 	uint16_t	seq_id;
41591 	/*
41592 	 * The target ID of the command:
41593 	 * * 0x0-0xFFF8 - The function ID
41594 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41595 	 * * 0xFFFD - Reserved for user-space HWRM interface
41596 	 * * 0xFFFF - HWRM
41597 	 */
41598 	uint16_t	target_id;
41599 	/*
41600 	 * A physical address pointer pointing to a host buffer that the
41601 	 * command's response data will be written. This can be either a host
41602 	 * physical address (HPA) or a guest physical address (GPA) and must
41603 	 * point to a physically contiguous block of memory.
41604 	 */
41605 	uint64_t	resp_addr;
41606 	/* Logical vnic ID */
41607 	uint16_t	vnic_id;
41608 	uint8_t	unused_0[6];
41609 } hwrm_vnic_tpa_qcfg_input_t, *phwrm_vnic_tpa_qcfg_input_t;
41610 
41611 /* hwrm_vnic_tpa_qcfg_output (size:256b/32B) */
41612 
41613 typedef struct hwrm_vnic_tpa_qcfg_output {
41614 	/* The specific error status for the command. */
41615 	uint16_t	error_code;
41616 	/* The HWRM command request type. */
41617 	uint16_t	req_type;
41618 	/* The sequence ID from the original command. */
41619 	uint16_t	seq_id;
41620 	/* The length of the response data in number of bytes. */
41621 	uint16_t	resp_len;
41622 	uint32_t	flags;
41623 	/*
41624 	 * When this bit is '1', the VNIC is configured to
41625 	 * perform transparent packet aggregation (TPA) of
41626 	 * non-tunneled TCP packets.
41627 	 */
41628 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_TPA			UINT32_C(0x1)
41629 	/*
41630 	 * When this bit is '1', the VNIC is configured to
41631 	 * perform transparent packet aggregation (TPA) of
41632 	 * tunneled TCP packets.
41633 	 */
41634 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_ENCAP_TPA		UINT32_C(0x2)
41635 	/*
41636 	 * When this bit is '1', the VNIC is configured to
41637 	 * perform transparent packet aggregation (TPA) according
41638 	 * to Windows Receive Segment Coalescing (RSC) rules.
41639 	 */
41640 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_RSC_WND_UPDATE		UINT32_C(0x4)
41641 	/*
41642 	 * When this bit is '1', the VNIC is configured to
41643 	 * perform transparent packet aggregation (TPA) according
41644 	 * to Linux Generic Receive Offload (GRO) rules.
41645 	 */
41646 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_GRO			UINT32_C(0x8)
41647 	/*
41648 	 * When this bit is '1', the VNIC is configured to
41649 	 * perform transparent packet aggregation (TPA) for TCP
41650 	 * packets with IP ECN set to non-zero.
41651 	 */
41652 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_AGG_WITH_ECN		UINT32_C(0x10)
41653 	/*
41654 	 * When this bit is '1', the VNIC is configured to
41655 	 * perform transparent packet aggregation (TPA) for
41656 	 * GRE tunneled TCP packets only if all packets have the
41657 	 * same GRE sequence.
41658 	 */
41659 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ	UINT32_C(0x20)
41660 	/*
41661 	 * When this bit is '1' and the GRO mode is enabled,
41662 	 * the VNIC is configured to
41663 	 * perform transparent packet aggregation (TPA) for
41664 	 * TCP/IPv4 packets with consecutively increasing IPIDs.
41665 	 * In other words, the last packet that is being
41666 	 * aggregated to an already existing aggregation context
41667 	 * shall have IPID 1 more than the IPID of the last packet
41668 	 * that was aggregated in that aggregation context.
41669 	 */
41670 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_GRO_IPID_CHECK		UINT32_C(0x40)
41671 	/*
41672 	 * When this bit is '1' and the GRO mode is enabled,
41673 	 * the VNIC is configured to
41674 	 * perform transparent packet aggregation (TPA) for
41675 	 * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
41676 	 * value.
41677 	 */
41678 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_FLAGS_GRO_TTL_CHECK		UINT32_C(0x80)
41679 	/*
41680 	 * This is the maximum number of TCP segments that can
41681 	 * be aggregated (unit is Log2). Max value is 31.
41682 	 */
41683 	uint16_t	max_agg_segs;
41684 	/* 1 segment */
41685 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
41686 	/* 2 segments */
41687 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
41688 	/* 4 segments */
41689 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
41690 	/* 8 segments */
41691 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
41692 	/* Any segment size larger than this is not valid */
41693 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
41694 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_LAST HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGG_SEGS_MAX
41695 	/*
41696 	 * This is the maximum number of aggregations this VNIC is
41697 	 * allowed (unit is Log2). Max value is 7
41698 	 */
41699 	uint16_t	max_aggs;
41700 	/* 1 aggregation */
41701 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_1   UINT32_C(0x0)
41702 	/* 2 aggregations */
41703 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_2   UINT32_C(0x1)
41704 	/* 4 aggregations */
41705 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_4   UINT32_C(0x2)
41706 	/* 8 aggregations */
41707 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_8   UINT32_C(0x3)
41708 	/* 16 aggregations */
41709 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_16  UINT32_C(0x4)
41710 	/* Any aggregation size larger than this is not valid */
41711 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_MAX UINT32_C(0x7)
41712 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_LAST HWRM_VNIC_TPA_QCFG_OUTPUT_MAX_AGGS_MAX
41713 	/*
41714 	 * This is the maximum amount of time allowed for
41715 	 * an aggregation context to complete after it was initiated.
41716 	 */
41717 	uint32_t	max_agg_timer;
41718 	/*
41719 	 * This is the minimum amount of payload length required to
41720 	 * start an aggregation context.
41721 	 */
41722 	uint32_t	min_agg_len;
41723 	/*
41724 	 * If the device supports hardware tunnel TPA feature, as indicated by
41725 	 * the HWRM_VNIC_QCAPS command, this field conveys the bitmap of the
41726 	 * tunnel types that have been configured. Each bit corresponds to a
41727 	 * specific tunnel type. If a bit is set to '1', then the associated
41728 	 * tunnel type is enabled; otherwise, it is disabled.
41729 	 */
41730 	uint32_t	tnl_tpa_en_bitmap;
41731 	/*
41732 	 * When this bit is '1', enable VXLAN encapsulated packets for
41733 	 * aggregation.
41734 	 */
41735 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_VXLAN	UINT32_C(0x1)
41736 	/*
41737 	 * When this bit is set to '1', enable GENEVE encapsulated packets
41738 	 * for aggregation.
41739 	 */
41740 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_GENEVE	UINT32_C(0x2)
41741 	/*
41742 	 * When this bit is set to '1', enable NVGRE encapsulated packets
41743 	 * for aggregation..
41744 	 */
41745 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_NVGRE	UINT32_C(0x4)
41746 	/*
41747 	 * When this bit is set to '1', enable GRE encapsulated packets
41748 	 * for aggregation..
41749 	 */
41750 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_GRE		UINT32_C(0x8)
41751 	/*
41752 	 * When this bit is set to '1', enable IPV4 encapsulated packets
41753 	 * for aggregation..
41754 	 */
41755 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_IPV4		UINT32_C(0x10)
41756 	/*
41757 	 * When this bit is set to '1', enable IPV6 encapsulated packets
41758 	 * for aggregation..
41759 	 */
41760 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_IPV6		UINT32_C(0x20)
41761 	/*
41762 	 * When this bit is '1', enable VXLAN_GPE encapsulated packets for
41763 	 * aggregation.
41764 	 */
41765 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_VXLAN_GPE	UINT32_C(0x40)
41766 	/*
41767 	 * When this bit is '1', enable VXLAN_CUSTOMER1 encapsulated packets
41768 	 * for aggregation.
41769 	 */
41770 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_VXLAN_CUST1	UINT32_C(0x80)
41771 	/*
41772 	 * When this bit is '1', enable GRE_CUSTOMER1 encapsulated packets
41773 	 * for aggregation.
41774 	 */
41775 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_GRE_CUST1	UINT32_C(0x100)
41776 	/*
41777 	 * When this bit is '1', enable UPAR1 encapsulated packets for
41778 	 * aggregation.
41779 	 */
41780 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_UPAR1	UINT32_C(0x200)
41781 	/*
41782 	 * When this bit is '1', enable UPAR2 encapsulated packets for
41783 	 * aggregation.
41784 	 */
41785 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_UPAR2	UINT32_C(0x400)
41786 	/*
41787 	 * When this bit is '1', enable UPAR3 encapsulated packets for
41788 	 * aggregation.
41789 	 */
41790 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_UPAR3	UINT32_C(0x800)
41791 	/*
41792 	 * When this bit is '1', enable UPAR4 encapsulated packets for
41793 	 * aggregation.
41794 	 */
41795 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_UPAR4	UINT32_C(0x1000)
41796 	/*
41797 	 * When this bit is '1', enable UPAR5 encapsulated packets for
41798 	 * aggregation.
41799 	 */
41800 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_UPAR5	UINT32_C(0x2000)
41801 	/*
41802 	 * When this bit is '1', enable UPAR6 encapsulated packets for
41803 	 * aggregation.
41804 	 */
41805 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_UPAR6	UINT32_C(0x4000)
41806 	/*
41807 	 * When this bit is '1', enable UPAR7 encapsulated packets for
41808 	 * aggregation.
41809 	 */
41810 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_UPAR7	UINT32_C(0x8000)
41811 	/*
41812 	 * When this bit is '1', enable UPAR8 encapsulated packets for
41813 	 * aggregation.
41814 	 */
41815 	#define HWRM_VNIC_TPA_QCFG_OUTPUT_TNL_TPA_EN_BITMAP_UPAR8	UINT32_C(0x10000)
41816 	uint8_t	unused_0[3];
41817 	/*
41818 	 * This field is used in Output records to indicate that the output
41819 	 * is completely written to RAM. This field should be read as '1'
41820 	 * to indicate that the output has been completely written. When
41821 	 * writing a command completion or response to an internal processor,
41822 	 * the order of writes has to be such that this field is written last.
41823 	 */
41824 	uint8_t	valid;
41825 } hwrm_vnic_tpa_qcfg_output_t, *phwrm_vnic_tpa_qcfg_output_t;
41826 
41827 /*********************
41828  * hwrm_vnic_rss_cfg *
41829  *********************/
41830 
41831 
41832 /* hwrm_vnic_rss_cfg_input (size:384b/48B) */
41833 
41834 typedef struct hwrm_vnic_rss_cfg_input {
41835 	/* The HWRM command request type. */
41836 	uint16_t	req_type;
41837 	/*
41838 	 * The completion ring to send the completion event on. This should
41839 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
41840 	 */
41841 	uint16_t	cmpl_ring;
41842 	/*
41843 	 * The sequence ID is used by the driver for tracking multiple
41844 	 * commands. This ID is treated as opaque data by the firmware and
41845 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
41846 	 */
41847 	uint16_t	seq_id;
41848 	/*
41849 	 * The target ID of the command:
41850 	 * * 0x0-0xFFF8 - The function ID
41851 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41852 	 * * 0xFFFD - Reserved for user-space HWRM interface
41853 	 * * 0xFFFF - HWRM
41854 	 */
41855 	uint16_t	target_id;
41856 	/*
41857 	 * A physical address pointer pointing to a host buffer that the
41858 	 * command's response data will be written. This can be either a host
41859 	 * physical address (HPA) or a guest physical address (GPA) and must
41860 	 * point to a physically contiguous block of memory.
41861 	 */
41862 	uint64_t	resp_addr;
41863 	uint32_t	hash_type;
41864 	/*
41865 	 * When this bit is '1', the RSS hash shall be computed
41866 	 * over source and destination IPv4 addresses of IPv4
41867 	 * packets.
41868 	 */
41869 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4		UINT32_C(0x1)
41870 	/*
41871 	 * When this bit is '1', the RSS hash shall be computed
41872 	 * over source/destination IPv4 addresses and
41873 	 * source/destination ports of TCP/IPv4 packets.
41874 	 */
41875 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4		UINT32_C(0x2)
41876 	/*
41877 	 * When this bit is '1', the RSS hash shall be computed
41878 	 * over source/destination IPv4 addresses and
41879 	 * source/destination ports of UDP/IPv4 packets.
41880 	 */
41881 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4		UINT32_C(0x4)
41882 	/*
41883 	 * When this bit is '1', the RSS hash shall be computed
41884 	 * over source and destination IPv6 addresses of IPv6
41885 	 * packets.
41886 	 */
41887 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6		UINT32_C(0x8)
41888 	/*
41889 	 * When this bit is '1', the RSS hash shall be computed
41890 	 * over source/destination IPv6 addresses and
41891 	 * source/destination ports of TCP/IPv6 packets.
41892 	 */
41893 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6		UINT32_C(0x10)
41894 	/*
41895 	 * When this bit is '1', the RSS hash shall be computed
41896 	 * over source/destination IPv6 addresses and
41897 	 * source/destination ports of UDP/IPv6 packets.
41898 	 */
41899 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6		UINT32_C(0x20)
41900 	/*
41901 	 * When this bit is '1', the RSS hash shall be computed
41902 	 * over source, destination IPv6 addresses and flow label of IPv6
41903 	 * packets. Hash type ipv6 and ipv6_flow_label are mutually
41904 	 * exclusive. HW does not include the flow_label in hash
41905 	 * calculation for the packets that are matching tcp_ipv6 and
41906 	 * udp_ipv6 hash types. Host drivers should set this bit based on
41907 	 * rss_ipv6_flow_label_cap.
41908 	 */
41909 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL	UINT32_C(0x40)
41910 	/*
41911 	 * When this bit is '1', the RSS hash shall be computed over
41912 	 * source/destination IPv4 addresses and IPSEC AH SPI field of IPSEC
41913 	 * AH/IPv4 packets. Host drivers should set this bit based on
41914 	 * rss_ipsec_ah_spi_ipv4_cap.
41915 	 */
41916 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_AH_SPI_IPV4	UINT32_C(0x80)
41917 	/*
41918 	 * When this bit is '1', the RSS hash shall be computed over
41919 	 * source/destination IPv4 addresses and IPSEC ESP SPI field of IPSEC
41920 	 * ESP/IPv4 packets. Host drivers should set this bit based on
41921 	 * rss_ipsec_esp_spi_ipv4_cap.
41922 	 */
41923 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV4	UINT32_C(0x100)
41924 	/*
41925 	 * When this bit is '1', the RSS hash shall be computed over
41926 	 * source/destination IPv6 addresses and IPSEC AH SPI field of IPSEC
41927 	 * AH/IPv6 packets. Host drivers should set this bit based on
41928 	 * rss_ipsec_ah_spi_ipv6_cap.
41929 	 */
41930 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_AH_SPI_IPV6	UINT32_C(0x200)
41931 	/*
41932 	 * When this bit is '1', the RSS hash shall be computed over
41933 	 * source/destination IPv6 addresses and IPSEC ESP SPI field of IPSEC
41934 	 * ESP/IPv6 packets. Host drivers should set this bit based on
41935 	 * rss_ipsec_esp_spi_ipv6_cap.
41936 	 */
41937 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV6	UINT32_C(0x400)
41938 	/* VNIC ID of VNIC associated with RSS table being configured. */
41939 	uint16_t	vnic_id;
41940 	/*
41941 	 * Specifies which VNIC ring table pair to configure.
41942 	 * Valid values range from 0 to 7.
41943 	 */
41944 	uint8_t	ring_table_pair_index;
41945 	/*
41946 	 * Flags to specify different RSS hash modes. Global RSS hash mode is
41947 	 * indicated when vnic_id and rss_ctx_idx fields are set to value of
41948 	 * 0xffff. Only PF can initiate global RSS hash mode setting changes.
41949 	 * VNIC RSS hash mode is indicated with valid vnic_id and rss_ctx_idx,
41950 	 * if FW is VNIC_RSS_HASH_MODE capable. FW configures the mode based
41951 	 * on first come first serve order. Global RSS hash mode and VNIC RSS
41952 	 * hash modes are mutually exclusive. FW returns invalid error
41953 	 * if FW receives conflicting requests. To change the current hash
41954 	 * mode, the mode associated drivers need to be unloaded and apply
41955 	 * the new configuration.
41956 	 */
41957 	uint8_t	hash_mode_flags;
41958 	/*
41959 	 * When this bit is '1' and FW is VNIC_RSS_HASH_MODE capable,
41960 	 * innermost_4 and innermost_2 hash modes are used to configure
41961 	 * the tuple mode. When this bit is '1' and FW is not
41962 	 * VNIC_RSS_HASH_MODE capable, It indicates using current RSS hash
41963 	 * mode setting configured in the device otherwise.
41964 	 */
41965 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT	UINT32_C(0x1)
41966 	/*
41967 	 * When this bit is '1', it indicates requesting support of
41968 	 * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
41969 	 * l4.src, l4.dest} for tunnel packets. For none-tunnel
41970 	 * packets, the RSS hash is computed over the normal
41971 	 * src/dest l3 and src/dest l4 headers.
41972 	 */
41973 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4	UINT32_C(0x2)
41974 	/*
41975 	 * When this bit is '1', it indicates requesting support of
41976 	 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
41977 	 * tunnel packets. For none-tunnel packets, the RSS hash is
41978 	 * computed over the normal src/dest l3 headers.
41979 	 */
41980 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2	UINT32_C(0x4)
41981 	/*
41982 	 * When this bit is '1', it indicates requesting support of
41983 	 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
41984 	 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
41985 	 * packets, the RSS hash is computed over the normal
41986 	 * src/dest l3 and src/dest l4 headers.
41987 	 */
41988 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4	UINT32_C(0x8)
41989 	/*
41990 	 * When this bit is '1', it indicates requesting support of
41991 	 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
41992 	 * tunnel packets. For none-tunnel packets, the RSS hash is
41993 	 * computed over the normal src/dest l3 headers.
41994 	 */
41995 	#define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2	UINT32_C(0x10)
41996 	/* This is the address for rss ring group table */
41997 	uint64_t	ring_grp_tbl_addr;
41998 	/* This is the address for rss hash key table */
41999 	uint64_t	hash_key_tbl_addr;
42000 	/* Index to the rss indirection table. */
42001 	uint16_t	rss_ctx_idx;
42002 	uint8_t	flags;
42003 	/*
42004 	 * When this bit is '1', it indicates that the hash_type field is
42005 	 * interpreted as a change relative the current configuration. Each
42006 	 * '1' bit in hash_type represents a header to add to the current
42007 	 * hash. Zeroes designate the hash_type state bits that should remain
42008 	 * unchanged, if possible. If this constraint on the existing state
42009 	 * cannot be satisfied, then the implementation should preference
42010 	 * adding other headers so as to honor the request to add the
42011 	 * specified headers. It is an error to set this flag concurrently
42012 	 * with hash_type_exclude.
42013 	 */
42014 	#define HWRM_VNIC_RSS_CFG_INPUT_FLAGS_HASH_TYPE_INCLUDE		UINT32_C(0x1)
42015 	/*
42016 	 * When this bit is '1', it indicates that the hash_type field is
42017 	 * interpreted as a change relative the current configuration. Each
42018 	 * '1' bit in hash_type represents a header to remove from the
42019 	 * current hash. Zeroes designate the hash_type state bits that
42020 	 * should remain unchanged, if possible. If this constraint on the
42021 	 * existing state cannot be satisfied, then the implementation should
42022 	 * preference removing other headers so as to honor the request to
42023 	 * remove the specified headers. It is an error to set this flag
42024 	 * concurrently with hash_type_include.
42025 	 */
42026 	#define HWRM_VNIC_RSS_CFG_INPUT_FLAGS_HASH_TYPE_EXCLUDE		UINT32_C(0x2)
42027 	/*
42028 	 * When this bit is '1', it indicates that the support of setting
42029 	 * ipsec hash_types by the host drivers.
42030 	 */
42031 	#define HWRM_VNIC_RSS_CFG_INPUT_FLAGS_IPSEC_HASH_TYPE_CFG_SUPPORT	UINT32_C(0x4)
42032 	uint8_t	ring_select_mode;
42033 	/*
42034 	 * In this mode, HW uses Toeplitz algorithm and provided Toeplitz
42035 	 * hash key to hash the packets according to the configured hash
42036 	 * type and hash mode. The Toeplitz hash results and the provided
42037 	 * Toeplitz RSS indirection table are used to determine the RSS
42038 	 * rings.
42039 	 */
42040 	#define HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_TOEPLITZ	UINT32_C(0x0)
42041 	/*
42042 	 * In this mode, HW uses XOR algorithm to hash the packets according
42043 	 * to the configured hash type and hash mode. The XOR hash results
42044 	 * and the provided XOR RSS indirection table are used to determine
42045 	 * the RSS rings. Host drivers provided hash key is not honored in
42046 	 * this mode.
42047 	 */
42048 	#define HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_XOR		UINT32_C(0x1)
42049 	/*
42050 	 * In this mode, HW uses inner packets checksum algorithm to
42051 	 * distribute the packets across the rings and Toeplitz algorithm
42052 	 * to calculate the hash to convey it in the RX completions. Host
42053 	 * drivers should provide Toeplitz hash key. As HW uses innermost
42054 	 * packets checksum to distribute the packets across the rings,
42055 	 * host drivers can't convey hash mode to choose outer headers to
42056 	 * calculate Toeplitz hash. FW will fail such configuration.
42057 	 */
42058 	#define HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_TOEPLITZ_CHECKSUM UINT32_C(0x2)
42059 	#define HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_LAST		HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_TOEPLITZ_CHECKSUM
42060 	uint8_t	unused_1[4];
42061 } hwrm_vnic_rss_cfg_input_t, *phwrm_vnic_rss_cfg_input_t;
42062 
42063 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */
42064 
42065 typedef struct hwrm_vnic_rss_cfg_output {
42066 	/* The specific error status for the command. */
42067 	uint16_t	error_code;
42068 	/* The HWRM command request type. */
42069 	uint16_t	req_type;
42070 	/* The sequence ID from the original command. */
42071 	uint16_t	seq_id;
42072 	/* The length of the response data in number of bytes. */
42073 	uint16_t	resp_len;
42074 	uint8_t	unused_0[7];
42075 	/*
42076 	 * This field is used in Output records to indicate that the output
42077 	 * is completely written to RAM. This field should be read as '1'
42078 	 * to indicate that the output has been completely written. When
42079 	 * writing a command completion or response to an internal processor,
42080 	 * the order of writes has to be such that this field is written last.
42081 	 */
42082 	uint8_t	valid;
42083 } hwrm_vnic_rss_cfg_output_t, *phwrm_vnic_rss_cfg_output_t;
42084 
42085 /* hwrm_vnic_rss_cfg_cmd_err (size:64b/8B) */
42086 
42087 typedef struct hwrm_vnic_rss_cfg_cmd_err {
42088 	/*
42089 	 * command specific error codes that goes to
42090 	 * the cmd_err field in Common HWRM Error Response.
42091 	 */
42092 	uint8_t	code;
42093 	/* Unknown error */
42094 	#define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_UNKNOWN		UINT32_C(0x0)
42095 	/*
42096 	 * Unable to change global RSS mode to outer due to all active
42097 	 * interfaces are not ready to support outer RSS hashing.
42098 	 */
42099 	#define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY UINT32_C(0x1)
42100 	#define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_LAST		HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY
42101 	uint8_t	unused_0[7];
42102 } hwrm_vnic_rss_cfg_cmd_err_t, *phwrm_vnic_rss_cfg_cmd_err_t;
42103 
42104 /**********************
42105  * hwrm_vnic_rss_qcfg *
42106  **********************/
42107 
42108 
42109 /* hwrm_vnic_rss_qcfg_input (size:192b/24B) */
42110 
42111 typedef struct hwrm_vnic_rss_qcfg_input {
42112 	/* The HWRM command request type. */
42113 	uint16_t	req_type;
42114 	/*
42115 	 * The completion ring to send the completion event on. This should
42116 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
42117 	 */
42118 	uint16_t	cmpl_ring;
42119 	/*
42120 	 * The sequence ID is used by the driver for tracking multiple
42121 	 * commands. This ID is treated as opaque data by the firmware and
42122 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
42123 	 */
42124 	uint16_t	seq_id;
42125 	/*
42126 	 * The target ID of the command:
42127 	 * * 0x0-0xFFF8 - The function ID
42128 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42129 	 * * 0xFFFD - Reserved for user-space HWRM interface
42130 	 * * 0xFFFF - HWRM
42131 	 */
42132 	uint16_t	target_id;
42133 	/*
42134 	 * A physical address pointer pointing to a host buffer that the
42135 	 * command's response data will be written. This can be either a host
42136 	 * physical address (HPA) or a guest physical address (GPA) and must
42137 	 * point to a physically contiguous block of memory.
42138 	 */
42139 	uint64_t	resp_addr;
42140 	/*
42141 	 * Index to the rss indirection table. This field is used as a lookup
42142 	 * for chips before Thor - i.e. Cumulus and Whitney.
42143 	 */
42144 	uint16_t	rss_ctx_idx;
42145 	/*
42146 	 * VNIC ID of VNIC associated with RSS table being queried. This field
42147 	 * is used as a lookup for Thor and later chips.
42148 	 */
42149 	uint16_t	vnic_id;
42150 	uint8_t	unused_0[4];
42151 } hwrm_vnic_rss_qcfg_input_t, *phwrm_vnic_rss_qcfg_input_t;
42152 
42153 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
42154 
42155 typedef struct hwrm_vnic_rss_qcfg_output {
42156 	/* The specific error status for the command. */
42157 	uint16_t	error_code;
42158 	/* The HWRM command request type. */
42159 	uint16_t	req_type;
42160 	/* The sequence ID from the original command. */
42161 	uint16_t	seq_id;
42162 	/* The length of the response data in number of bytes. */
42163 	uint16_t	resp_len;
42164 	uint32_t	hash_type;
42165 	/*
42166 	 * When this bit is '1', the RSS hash shall be computed
42167 	 * over source and destination IPv4 addresses of IPv4
42168 	 * packets.
42169 	 */
42170 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4		UINT32_C(0x1)
42171 	/*
42172 	 * When this bit is '1', the RSS hash shall be computed
42173 	 * over source/destination IPv4 addresses and
42174 	 * source/destination ports of TCP/IPv4 packets.
42175 	 */
42176 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4		UINT32_C(0x2)
42177 	/*
42178 	 * When this bit is '1', the RSS hash shall be computed
42179 	 * over source/destination IPv4 addresses and
42180 	 * source/destination ports of UDP/IPv4 packets.
42181 	 */
42182 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4		UINT32_C(0x4)
42183 	/*
42184 	 * When this bit is '1', the RSS hash shall be computed
42185 	 * over source and destination IPv6 addresses of IPv6
42186 	 * packets.
42187 	 */
42188 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6		UINT32_C(0x8)
42189 	/*
42190 	 * When this bit is '1', the RSS hash shall be computed
42191 	 * over source/destination IPv6 addresses and
42192 	 * source/destination ports of TCP/IPv6 packets.
42193 	 */
42194 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6		UINT32_C(0x10)
42195 	/*
42196 	 * When this bit is '1', the RSS hash shall be computed
42197 	 * over source/destination IPv6 addresses and
42198 	 * source/destination ports of UDP/IPv6 packets.
42199 	 */
42200 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6		UINT32_C(0x20)
42201 	/*
42202 	 * When this bit is '1', the RSS hash shall be computed
42203 	 * over source, destination IPv6 addresses and flow label of IPv6
42204 	 * packets. Hash type ipv6 and ipv6_flow_label are mutually
42205 	 * exclusive. HW does not include the flow_label in hash
42206 	 * calculation for the packets that are matching tcp_ipv6 and
42207 	 * udp_ipv6 hash types. This bit will be '0' if
42208 	 * rss_ipv6_flow_label_cap is '0'.
42209 	 */
42210 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6_FLOW_LABEL	UINT32_C(0x40)
42211 	/*
42212 	 * When this bit is '1', the RSS hash shall be computed over
42213 	 * source/destination IPv4 addresses and IPSEC AH SPI field of IPSEC
42214 	 * AH/IPv4 packets. This bit will be '0' if rss_ipsec_ah_spi_ipv4_cap
42215 	 * is '0'.
42216 	 */
42217 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_AH_SPI_IPV4	UINT32_C(0x80)
42218 	/*
42219 	 * When this bit is '1', the RSS hash shall be computed over
42220 	 * source/destination IPv4 addresses and IPSEC ESP SPI field of IPSEC
42221 	 * ESP/IPv4 packets. This bit will be '0' if
42222 	 * rss_ipsec_esp_spi_ipv4_cap is '0'.
42223 	 */
42224 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_ESP_SPI_IPV4	UINT32_C(0x100)
42225 	/*
42226 	 * When this bit is '1', the RSS hash shall be computed over
42227 	 * source/destination IPv6 addresses and IPSEC AH SPI field of IPSEC
42228 	 * AH/IPv6 packets. This bit will be '0' if
42229 	 * rss_ipsec_ah_spi_ipv6_cap is '0'.
42230 	 */
42231 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_AH_SPI_IPV6	UINT32_C(0x200)
42232 	/*
42233 	 * When this bit is '1', the RSS hash shall be computed over
42234 	 * source/destination IPv6 addresses and IPSEC ESP SPI field of IPSEC
42235 	 * ESP/IPv6 packets. This bit will be '0' if
42236 	 * rss_ipsec_esp_spi_ipv6_cap is '0'.
42237 	 */
42238 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_ESP_SPI_IPV6	UINT32_C(0x400)
42239 	uint8_t	unused_0[4];
42240 	/* This is the value of rss hash key */
42241 	uint32_t	hash_key[10];
42242 	/*
42243 	 * Flags to specify different RSS hash modes. Setting rss_ctx_idx to
42244 	 * the value of 0xffff implies a global RSS configuration query.
42245 	 * hash_mode_flags are only valid for global RSS configuration query.
42246 	 * Only the PF can initiate a global RSS configuration query.
42247 	 * The query request fails if any VNIC is configured with hash mode
42248 	 * and rss_ctx_idx is 0xffff.
42249 	 */
42250 	uint8_t	hash_mode_flags;
42251 	/*
42252 	 * When this bit is '1' and FW is VNIC_RSS_HASH_MODE capable,
42253 	 * it indicates VNIC's configured RSS hash mode.
42254 	 * When this bit is '1' and FW is not VNIC_RSS_HASH_MODE capable,
42255 	 * It indicates using current RSS hash mode setting configured in the
42256 	 * device.
42257 	 */
42258 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT	UINT32_C(0x1)
42259 	/*
42260 	 * When this bit is '1', it indicates requesting support of
42261 	 * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
42262 	 * l4.src, l4.dest} for tunnel packets. For none-tunnel
42263 	 * packets, the RSS hash is computed over the normal
42264 	 * src/dest l3 and src/dest l4 headers.
42265 	 */
42266 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4	UINT32_C(0x2)
42267 	/*
42268 	 * When this bit is '1', it indicates requesting support of
42269 	 * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
42270 	 * tunnel packets. For none-tunnel packets, the RSS hash is
42271 	 * computed over the normal src/dest l3 headers.
42272 	 */
42273 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2	UINT32_C(0x4)
42274 	/*
42275 	 * When this bit is '1', it indicates requesting support of
42276 	 * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
42277 	 * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
42278 	 * packets, the RSS hash is computed over the normal
42279 	 * src/dest l3 and src/dest l4 headers.
42280 	 */
42281 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4	UINT32_C(0x8)
42282 	/*
42283 	 * When this bit is '1', it indicates requesting support of
42284 	 * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
42285 	 * tunnel packets. For none-tunnel packets, the RSS hash is
42286 	 * computed over the normal src/dest l3 headers.
42287 	 */
42288 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2	UINT32_C(0x10)
42289 	uint8_t	ring_select_mode;
42290 	/*
42291 	 * In this mode, HW uses Toeplitz algorithm and provided Toeplitz
42292 	 * hash key to hash the packets according to the configured hash
42293 	 * type and hash mode. The Toeplitz hash results and the provided
42294 	 * Toeplitz RSS indirection table are used to determine the RSS
42295 	 * rings.
42296 	 */
42297 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_TOEPLITZ	UINT32_C(0x0)
42298 	/*
42299 	 * In this mode, HW uses XOR algorithm to hash the packets according
42300 	 * to the configured hash type and hash mode. The XOR hash results
42301 	 * and the provided XOR RSS indirection table are used to determine
42302 	 * the RSS rings. Host drivers provided hash key is not honored in
42303 	 * this mode.
42304 	 */
42305 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_XOR		UINT32_C(0x1)
42306 	/*
42307 	 * In this mode, HW uses inner packets checksum algorithm to
42308 	 * distribute the packets across the rings and Toeplitz algorithm
42309 	 * to calculate the hash to convey it in the RX completions. Host
42310 	 * drivers should provide Toeplitz hash key. As HW uses innermost
42311 	 * packets checksum to distribute the packets across the rings,
42312 	 * host drivers can't convey hash mode to choose outer headers to
42313 	 * calculate Toeplitz hash. FW will fail such configuration.
42314 	 */
42315 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_TOEPLITZ_CHECKSUM UINT32_C(0x2)
42316 	#define HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_LAST		HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_TOEPLITZ_CHECKSUM
42317 	uint8_t	unused_1[5];
42318 	/*
42319 	 * This field is used in Output records to indicate that the output
42320 	 * is completely written to RAM. This field should be read as '1'
42321 	 * to indicate that the output has been completely written. When
42322 	 * writing a command completion or response to an internal processor,
42323 	 * the order of writes has to be such that this field is written last.
42324 	 */
42325 	uint8_t	valid;
42326 } hwrm_vnic_rss_qcfg_output_t, *phwrm_vnic_rss_qcfg_output_t;
42327 
42328 /**************************
42329  * hwrm_vnic_plcmodes_cfg *
42330  **************************/
42331 
42332 
42333 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */
42334 
42335 typedef struct hwrm_vnic_plcmodes_cfg_input {
42336 	/* The HWRM command request type. */
42337 	uint16_t	req_type;
42338 	/*
42339 	 * The completion ring to send the completion event on. This should
42340 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
42341 	 */
42342 	uint16_t	cmpl_ring;
42343 	/*
42344 	 * The sequence ID is used by the driver for tracking multiple
42345 	 * commands. This ID is treated as opaque data by the firmware and
42346 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
42347 	 */
42348 	uint16_t	seq_id;
42349 	/*
42350 	 * The target ID of the command:
42351 	 * * 0x0-0xFFF8 - The function ID
42352 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42353 	 * * 0xFFFD - Reserved for user-space HWRM interface
42354 	 * * 0xFFFF - HWRM
42355 	 */
42356 	uint16_t	target_id;
42357 	/*
42358 	 * A physical address pointer pointing to a host buffer that the
42359 	 * command's response data will be written. This can be either a host
42360 	 * physical address (HPA) or a guest physical address (GPA) and must
42361 	 * point to a physically contiguous block of memory.
42362 	 */
42363 	uint64_t	resp_addr;
42364 	uint32_t	flags;
42365 	/*
42366 	 * When this bit is '1', the VNIC shall be configured to
42367 	 * use regular placement algorithm.
42368 	 * By default, the regular placement algorithm shall be
42369 	 * enabled on the VNIC.
42370 	 */
42371 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT	UINT32_C(0x1)
42372 	/*
42373 	 * When this bit is '1', the VNIC shall be configured
42374 	 * use the jumbo placement algorithm.
42375 	 */
42376 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT	UINT32_C(0x2)
42377 	/*
42378 	 * When this bit is '1', the VNIC shall be configured
42379 	 * to enable Header-Data split for IPv4 packets according
42380 	 * to the following rules:
42381 	 * # If the packet is identified as TCP/IPv4, then the
42382 	 * packet is split at the beginning of the TCP payload.
42383 	 * # If the packet is identified as UDP/IPv4, then the
42384 	 * packet is split at the beginning of UDP payload.
42385 	 * # If the packet is identified as non-TCP and non-UDP
42386 	 * IPv4 packet, then the packet is split at the beginning
42387 	 * of the upper layer protocol header carried in the IPv4
42388 	 * packet.
42389 	 */
42390 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4		UINT32_C(0x4)
42391 	/*
42392 	 * When this bit is '1', the VNIC shall be configured
42393 	 * to enable Header-Data split for IPv6 packets according
42394 	 * to the following rules:
42395 	 * # If the packet is identified as TCP/IPv6, then the
42396 	 * packet is split at the beginning of the TCP payload.
42397 	 * # If the packet is identified as UDP/IPv6, then the
42398 	 * packet is split at the beginning of UDP payload.
42399 	 * # If the packet is identified as non-TCP and non-UDP
42400 	 * IPv6 packet, then the packet is split at the beginning
42401 	 * of the upper layer protocol header carried in the IPv6
42402 	 * packet.
42403 	 */
42404 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6		UINT32_C(0x8)
42405 	/*
42406 	 * When this bit is '1', the VNIC shall be configured
42407 	 * to enable Header-Data split for FCoE packets at the
42408 	 * beginning of FC payload.
42409 	 */
42410 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE		UINT32_C(0x10)
42411 	/*
42412 	 * When this bit is '1', the VNIC shall be configured
42413 	 * to enable Header-Data split for RoCE packets at the
42414 	 * beginning of RoCE payload (after BTH/GRH headers).
42415 	 */
42416 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE		UINT32_C(0x20)
42417 	/*
42418 	 * When this bit is '1', the VNIC shall be configured use the virtio
42419 	 * placement algorithm. This feature can only be configured when
42420 	 * proxy mode is supported on the function.
42421 	 */
42422 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_VIRTIO_PLACEMENT	UINT32_C(0x40)
42423 	uint32_t	enables;
42424 	/*
42425 	 * This bit must be '1' for the jumbo_thresh_valid field to be
42426 	 * configured.
42427 	 */
42428 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID	UINT32_C(0x1)
42429 	/*
42430 	 * This bit must be '1' for the hds_offset_valid field to be
42431 	 * configured.
42432 	 */
42433 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID	UINT32_C(0x2)
42434 	/*
42435 	 * This bit must be '1' for the hds_threshold_valid field to be
42436 	 * configured.
42437 	 */
42438 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID	UINT32_C(0x4)
42439 	/*
42440 	 * This bit must be '1' for the max_bds_valid field to be
42441 	 * configured.
42442 	 */
42443 	#define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_MAX_BDS_VALID	UINT32_C(0x8)
42444 	/* Logical vnic ID */
42445 	uint32_t	vnic_id;
42446 	/*
42447 	 * When jumbo placement algorithm is enabled, this value
42448 	 * is used to determine the threshold for jumbo placement.
42449 	 * Packets with length larger than this value will be
42450 	 * placed according to the jumbo placement algorithm.
42451 	 */
42452 	uint16_t	jumbo_thresh;
42453 	/*
42454 	 * This value is used to determine the offset into
42455 	 * packet buffer where the split data (payload) will be
42456 	 * placed according to one of HDS placement algorithm.
42457 	 *
42458 	 * The lengths of packet buffers provided for split data
42459 	 * shall be larger than this value.
42460 	 */
42461 	uint16_t	hds_offset;
42462 	/*
42463 	 * When one of the HDS placement algorithm is enabled, this
42464 	 * value is used to determine the threshold for HDS
42465 	 * placement.
42466 	 * Packets with length larger than this value will be
42467 	 * placed according to the HDS placement algorithm.
42468 	 * This value shall be in multiple of 4 bytes.
42469 	 */
42470 	uint16_t	hds_threshold;
42471 	/*
42472 	 * When virtio placement algorithm is enabled, this
42473 	 * value is used to determine the maximum number of BDs
42474 	 * that can be used to place an Rx Packet.
42475 	 * If an incoming packet does not fit in the buffers described
42476 	 * by the max BDs, the packet will be dropped and an error
42477 	 * will be reported in the completion. Valid values for this
42478 	 * field are between 1 and 8. If the VNIC uses header-data-
42479 	 * separation and/or TPA with buffer spanning enabled, valid
42480 	 * values for this field are between 2 and 8.
42481 	 * This feature can only be configured when proxy mode is
42482 	 * supported on the function.
42483 	 */
42484 	uint16_t	max_bds;
42485 	uint8_t	unused_0[4];
42486 } hwrm_vnic_plcmodes_cfg_input_t, *phwrm_vnic_plcmodes_cfg_input_t;
42487 
42488 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
42489 
42490 typedef struct hwrm_vnic_plcmodes_cfg_output {
42491 	/* The specific error status for the command. */
42492 	uint16_t	error_code;
42493 	/* The HWRM command request type. */
42494 	uint16_t	req_type;
42495 	/* The sequence ID from the original command. */
42496 	uint16_t	seq_id;
42497 	/* The length of the response data in number of bytes. */
42498 	uint16_t	resp_len;
42499 	uint8_t	unused_0[7];
42500 	/*
42501 	 * This field is used in Output records to indicate that the output
42502 	 * is completely written to RAM. This field should be read as '1'
42503 	 * to indicate that the output has been completely written.
42504 	 * When writing a command completion or response to an internal
42505 	 * processor, the order of writes has to be such that this field is
42506 	 * written last.
42507 	 */
42508 	uint8_t	valid;
42509 } hwrm_vnic_plcmodes_cfg_output_t, *phwrm_vnic_plcmodes_cfg_output_t;
42510 
42511 /***************************
42512  * hwrm_vnic_plcmodes_qcfg *
42513  ***************************/
42514 
42515 
42516 /* hwrm_vnic_plcmodes_qcfg_input (size:192b/24B) */
42517 
42518 typedef struct hwrm_vnic_plcmodes_qcfg_input {
42519 	/* The HWRM command request type. */
42520 	uint16_t	req_type;
42521 	/*
42522 	 * The completion ring to send the completion event on. This should
42523 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
42524 	 */
42525 	uint16_t	cmpl_ring;
42526 	/*
42527 	 * The sequence ID is used by the driver for tracking multiple
42528 	 * commands. This ID is treated as opaque data by the firmware and
42529 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
42530 	 */
42531 	uint16_t	seq_id;
42532 	/*
42533 	 * The target ID of the command:
42534 	 * * 0x0-0xFFF8 - The function ID
42535 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42536 	 * * 0xFFFD - Reserved for user-space HWRM interface
42537 	 * * 0xFFFF - HWRM
42538 	 */
42539 	uint16_t	target_id;
42540 	/*
42541 	 * A physical address pointer pointing to a host buffer that the
42542 	 * command's response data will be written. This can be either a host
42543 	 * physical address (HPA) or a guest physical address (GPA) and must
42544 	 * point to a physically contiguous block of memory.
42545 	 */
42546 	uint64_t	resp_addr;
42547 	/* Logical vnic ID */
42548 	uint32_t	vnic_id;
42549 	uint8_t	unused_0[4];
42550 } hwrm_vnic_plcmodes_qcfg_input_t, *phwrm_vnic_plcmodes_qcfg_input_t;
42551 
42552 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */
42553 
42554 typedef struct hwrm_vnic_plcmodes_qcfg_output {
42555 	/* The specific error status for the command. */
42556 	uint16_t	error_code;
42557 	/* The HWRM command request type. */
42558 	uint16_t	req_type;
42559 	/* The sequence ID from the original command. */
42560 	uint16_t	seq_id;
42561 	/* The length of the response data in number of bytes. */
42562 	uint16_t	resp_len;
42563 	uint32_t	flags;
42564 	/*
42565 	 * When this bit is '1', the VNIC is configured to
42566 	 * use regular placement algorithm.
42567 	 */
42568 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT	UINT32_C(0x1)
42569 	/*
42570 	 * When this bit is '1', the VNIC is configured to
42571 	 * use the jumbo placement algorithm.
42572 	 */
42573 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT	UINT32_C(0x2)
42574 	/*
42575 	 * When this bit is '1', the VNIC is configured
42576 	 * to enable Header-Data split for IPv4 packets.
42577 	 */
42578 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4		UINT32_C(0x4)
42579 	/*
42580 	 * When this bit is '1', the VNIC is configured
42581 	 * to enable Header-Data split for IPv6 packets.
42582 	 */
42583 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6		UINT32_C(0x8)
42584 	/*
42585 	 * When this bit is '1', the VNIC is configured
42586 	 * to enable Header-Data split for FCoE packets.
42587 	 */
42588 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE		UINT32_C(0x10)
42589 	/*
42590 	 * When this bit is '1', the VNIC is configured
42591 	 * to enable Header-Data split for RoCE packets.
42592 	 */
42593 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE		UINT32_C(0x20)
42594 	/*
42595 	 * When this bit is '1', the VNIC is configured
42596 	 * to be the default VNIC of the requesting function.
42597 	 */
42598 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC		UINT32_C(0x40)
42599 	/*
42600 	 * When this bit is '1', the VNIC is configured to use the virtio
42601 	 * placement algorithm. This feature can only be configured when
42602 	 * proxy mode is supported on the function.
42603 	 */
42604 	#define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_VIRTIO_PLACEMENT	UINT32_C(0x80)
42605 	/*
42606 	 * When jumbo placement algorithm is enabled, this value
42607 	 * is used to determine the threshold for jumbo placement.
42608 	 * Packets with length larger than this value will be
42609 	 * placed according to the jumbo placement algorithm.
42610 	 */
42611 	uint16_t	jumbo_thresh;
42612 	/*
42613 	 * This value is used to determine the offset into
42614 	 * packet buffer where the split data (payload) will be
42615 	 * placed according to one of HDS placement algorithm.
42616 	 *
42617 	 * The lengths of packet buffers provided for split data
42618 	 * shall be larger than this value.
42619 	 */
42620 	uint16_t	hds_offset;
42621 	/*
42622 	 * When one of the HDS placement algorithm is enabled, this
42623 	 * value is used to determine the threshold for HDS
42624 	 * placement.
42625 	 * Packets with length larger than this value will be
42626 	 * placed according to the HDS placement algorithm.
42627 	 * This value shall be in multiple of 4 bytes.
42628 	 */
42629 	uint16_t	hds_threshold;
42630 	/*
42631 	 * When virtio placement algorithm is enabled, this
42632 	 * value is used to determine the maximum number of BDs
42633 	 * that can be used to place an Rx Packet.
42634 	 * If an incoming packet does not fit in the buffers described
42635 	 * by the max BDs, the packet will be dropped and an error
42636 	 * will be reported in the completion. Valid values for this
42637 	 * field are between 1 and 8. If the VNIC uses header-data-
42638 	 * separation and/or TPA with buffer spanning enabled, valid
42639 	 * values for this field are between 2 and 8.
42640 	 * This feature can only be configured when proxy mode is supported
42641 	 * on the function
42642 	 */
42643 	uint16_t	max_bds;
42644 	uint8_t	unused_0[3];
42645 	/*
42646 	 * This field is used in Output records to indicate that the output
42647 	 * is completely written to RAM. This field should be read as '1'
42648 	 * to indicate that the output has been completely written.
42649 	 * When writing a command completion or response to an internal
42650 	 * processor, the order of writes has to be such that this field is
42651 	 * written last.
42652 	 */
42653 	uint8_t	valid;
42654 } hwrm_vnic_plcmodes_qcfg_output_t, *phwrm_vnic_plcmodes_qcfg_output_t;
42655 
42656 /**********************************
42657  * hwrm_vnic_rss_cos_lb_ctx_alloc *
42658  **********************************/
42659 
42660 
42661 /* hwrm_vnic_rss_cos_lb_ctx_alloc_input (size:128b/16B) */
42662 
42663 typedef struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
42664 	/* The HWRM command request type. */
42665 	uint16_t	req_type;
42666 	/*
42667 	 * The completion ring to send the completion event on. This should
42668 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
42669 	 */
42670 	uint16_t	cmpl_ring;
42671 	/*
42672 	 * The sequence ID is used by the driver for tracking multiple
42673 	 * commands. This ID is treated as opaque data by the firmware and
42674 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
42675 	 */
42676 	uint16_t	seq_id;
42677 	/*
42678 	 * The target ID of the command:
42679 	 * * 0x0-0xFFF8 - The function ID
42680 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42681 	 * * 0xFFFD - Reserved for user-space HWRM interface
42682 	 * * 0xFFFF - HWRM
42683 	 */
42684 	uint16_t	target_id;
42685 	/*
42686 	 * A physical address pointer pointing to a host buffer that the
42687 	 * command's response data will be written. This can be either a host
42688 	 * physical address (HPA) or a guest physical address (GPA) and must
42689 	 * point to a physically contiguous block of memory.
42690 	 */
42691 	uint64_t	resp_addr;
42692 } hwrm_vnic_rss_cos_lb_ctx_alloc_input_t, *phwrm_vnic_rss_cos_lb_ctx_alloc_input_t;
42693 
42694 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */
42695 
42696 typedef struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
42697 	/* The specific error status for the command. */
42698 	uint16_t	error_code;
42699 	/* The HWRM command request type. */
42700 	uint16_t	req_type;
42701 	/* The sequence ID from the original command. */
42702 	uint16_t	seq_id;
42703 	/* The length of the response data in number of bytes. */
42704 	uint16_t	resp_len;
42705 	/* rss_cos_lb_ctx_id is 16 b */
42706 	uint16_t	rss_cos_lb_ctx_id;
42707 	uint8_t	unused_0[5];
42708 	/*
42709 	 * This field is used in Output records to indicate that the output
42710 	 * is completely written to RAM. This field should be read as '1'
42711 	 * to indicate that the output has been completely written. When
42712 	 * writing a command completion or response to an internal processor,
42713 	 * the order of writes has to be such that this field is written last.
42714 	 */
42715 	uint8_t	valid;
42716 } hwrm_vnic_rss_cos_lb_ctx_alloc_output_t, *phwrm_vnic_rss_cos_lb_ctx_alloc_output_t;
42717 
42718 /*********************************
42719  * hwrm_vnic_rss_cos_lb_ctx_free *
42720  *********************************/
42721 
42722 
42723 /* hwrm_vnic_rss_cos_lb_ctx_free_input (size:192b/24B) */
42724 
42725 typedef struct hwrm_vnic_rss_cos_lb_ctx_free_input {
42726 	/* The HWRM command request type. */
42727 	uint16_t	req_type;
42728 	/*
42729 	 * The completion ring to send the completion event on. This should
42730 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
42731 	 */
42732 	uint16_t	cmpl_ring;
42733 	/*
42734 	 * The sequence ID is used by the driver for tracking multiple
42735 	 * commands. This ID is treated as opaque data by the firmware and
42736 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
42737 	 */
42738 	uint16_t	seq_id;
42739 	/*
42740 	 * The target ID of the command:
42741 	 * * 0x0-0xFFF8 - The function ID
42742 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42743 	 * * 0xFFFD - Reserved for user-space HWRM interface
42744 	 * * 0xFFFF - HWRM
42745 	 */
42746 	uint16_t	target_id;
42747 	/*
42748 	 * A physical address pointer pointing to a host buffer that the
42749 	 * command's response data will be written. This can be either a host
42750 	 * physical address (HPA) or a guest physical address (GPA) and must
42751 	 * point to a physically contiguous block of memory.
42752 	 */
42753 	uint64_t	resp_addr;
42754 	/* rss_cos_lb_ctx_id is 16 b */
42755 	uint16_t	rss_cos_lb_ctx_id;
42756 	uint8_t	unused_0[6];
42757 } hwrm_vnic_rss_cos_lb_ctx_free_input_t, *phwrm_vnic_rss_cos_lb_ctx_free_input_t;
42758 
42759 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */
42760 
42761 typedef struct hwrm_vnic_rss_cos_lb_ctx_free_output {
42762 	/* The specific error status for the command. */
42763 	uint16_t	error_code;
42764 	/* The HWRM command request type. */
42765 	uint16_t	req_type;
42766 	/* The sequence ID from the original command. */
42767 	uint16_t	seq_id;
42768 	/* The length of the response data in number of bytes. */
42769 	uint16_t	resp_len;
42770 	uint8_t	unused_0[7];
42771 	/*
42772 	 * This field is used in Output records to indicate that the output
42773 	 * is completely written to RAM. This field should be read as '1'
42774 	 * to indicate that the output has been completely written. When
42775 	 * writing a command completion or response to an internal processor,
42776 	 * the order of writes has to be such that this field is written last.
42777 	 */
42778 	uint8_t	valid;
42779 } hwrm_vnic_rss_cos_lb_ctx_free_output_t, *phwrm_vnic_rss_cos_lb_ctx_free_output_t;
42780 
42781 /*******************
42782  * hwrm_ring_alloc *
42783  *******************/
42784 
42785 
42786 /* hwrm_ring_alloc_input (size:704b/88B) */
42787 
42788 typedef struct hwrm_ring_alloc_input {
42789 	/* The HWRM command request type. */
42790 	uint16_t	req_type;
42791 	/*
42792 	 * The completion ring to send the completion event on. This should
42793 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
42794 	 */
42795 	uint16_t	cmpl_ring;
42796 	/*
42797 	 * The sequence ID is used by the driver for tracking multiple
42798 	 * commands. This ID is treated as opaque data by the firmware and
42799 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
42800 	 */
42801 	uint16_t	seq_id;
42802 	/*
42803 	 * The target ID of the command:
42804 	 * * 0x0-0xFFF8 - The function ID
42805 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42806 	 * * 0xFFFD - Reserved for user-space HWRM interface
42807 	 * * 0xFFFF - HWRM
42808 	 */
42809 	uint16_t	target_id;
42810 	/*
42811 	 * A physical address pointer pointing to a host buffer that the
42812 	 * command's response data will be written. This can be either a host
42813 	 * physical address (HPA) or a guest physical address (GPA) and must
42814 	 * point to a physically contiguous block of memory.
42815 	 */
42816 	uint64_t	resp_addr;
42817 	uint32_t	enables;
42818 	/*
42819 	 * This bit must be '1' for the ring_arb_cfg field to be
42820 	 * configured.
42821 	 */
42822 	#define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG	UINT32_C(0x2)
42823 	/*
42824 	 * This bit must be '1' for the stat_ctx_id_valid field to be
42825 	 * configured.
42826 	 */
42827 	#define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID	UINT32_C(0x8)
42828 	/*
42829 	 * This bit must be '1' for the max_bw_valid field to be
42830 	 * configured.
42831 	 */
42832 	#define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID	UINT32_C(0x20)
42833 	/*
42834 	 * This bit must be '1' for the rx_ring_id field to be
42835 	 * configured.
42836 	 */
42837 	#define HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID	UINT32_C(0x40)
42838 	/*
42839 	 * This bit must be '1' for the nq_ring_id field to be
42840 	 * configured.
42841 	 */
42842 	#define HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID	UINT32_C(0x80)
42843 	/*
42844 	 * This bit must be '1' for the rx_buf_size field to be
42845 	 * configured.
42846 	 */
42847 	#define HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID	UINT32_C(0x100)
42848 	/*
42849 	 * This bit must be '1' for the schq_id field to be
42850 	 * configured.
42851 	 */
42852 	#define HWRM_RING_ALLOC_INPUT_ENABLES_SCHQ_ID		UINT32_C(0x200)
42853 	/*
42854 	 * This bit must be '1' for the mpc_chnls_type field to be
42855 	 * configured.
42856 	 */
42857 	#define HWRM_RING_ALLOC_INPUT_ENABLES_MPC_CHNLS_TYPE	UINT32_C(0x400)
42858 	/*
42859 	 * This bit must be '1' for the steering_tag field to be
42860 	 * configured.
42861 	 */
42862 	#define HWRM_RING_ALLOC_INPUT_ENABLES_STEERING_TAG_VALID	UINT32_C(0x800)
42863 	/* Ring Type. */
42864 	uint8_t	ring_type;
42865 	/* L2 Completion Ring (CR) */
42866 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
42867 	/* TX Ring (TR) */
42868 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX	UINT32_C(0x1)
42869 	/* RX Ring (RR) */
42870 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX	UINT32_C(0x2)
42871 	/* RoCE Notification Completion Ring (ROCE_CR) */
42872 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
42873 	/* RX Aggregation Ring */
42874 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG	UINT32_C(0x4)
42875 	/* Notification Queue */
42876 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ	UINT32_C(0x5)
42877 	#define HWRM_RING_ALLOC_INPUT_RING_TYPE_LAST	HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ
42878 	/*
42879 	 * This field controls the number of packets transmitted before a TX
42880 	 * completion is generated. Non-zero values for the field are only
42881 	 * valid if HWRM_FUNC_QCAPS indicates that the TX coalesced completion
42882 	 * records capability is supported.
42883 	 */
42884 	uint8_t	cmpl_coal_cnt;
42885 	/* Generates a legacy TX completion on every packet. */
42886 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_OFF UINT32_C(0x0)
42887 	/* Generates a TX coalesced completion for up to 4 TX packets. */
42888 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_4   UINT32_C(0x1)
42889 	/* Generates a TX coalesced completion for up to 8 TX packets. */
42890 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_8   UINT32_C(0x2)
42891 	/* Generates a TX coalesced completion for up to 12 TX packets. */
42892 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_12  UINT32_C(0x3)
42893 	/* Generates a TX coalesced completion for up to 16 TX packets. */
42894 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_16  UINT32_C(0x4)
42895 	/* Generates a TX coalesced completion for up to 24 TX packets. */
42896 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_24  UINT32_C(0x5)
42897 	/* Generates a TX coalesced completion for up to 32 TX packets. */
42898 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_32  UINT32_C(0x6)
42899 	/* Generates a TX coalesced completion for up to 48 TX packets. */
42900 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_48  UINT32_C(0x7)
42901 	/* Generates a TX coalesced completion for up to 64 TX packets. */
42902 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_64  UINT32_C(0x8)
42903 	/* Generates a TX coalesced completion for up to 96 TX packets. */
42904 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_96  UINT32_C(0x9)
42905 	/* Generates a TX coalesced completion for up to 128 TX packets. */
42906 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_128 UINT32_C(0xa)
42907 	/* Generates a TX coalesced completion for up to 192 TX packets. */
42908 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_192 UINT32_C(0xb)
42909 	/* Generates a TX coalesced completion for up to 256 TX packets. */
42910 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_256 UINT32_C(0xc)
42911 	/* Generates a TX coalesced completion for up to 320 TX packets. */
42912 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_320 UINT32_C(0xd)
42913 	/* Generates a TX coalesced completion for up to 384 TX packets. */
42914 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_384 UINT32_C(0xe)
42915 	/* Generates a TX coalesced completion up to the last packet. (Maximum coalescing). */
42916 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_MAX UINT32_C(0xf)
42917 	#define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_LAST	HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_MAX
42918 	/* Ring allocation flags. */
42919 	uint16_t	flags;
42920 	/*
42921 	 * For Rx rings, the incoming packet data can be placed at either
42922 	 * a 0B or 2B offset from the start of the Rx packet buffer. When
42923 	 * '1', the received packet will be padded with 2B of zeros at the
42924 	 * front of the packet. Note that this flag is only used for
42925 	 * Rx rings and is ignored for all other rings included Rx
42926 	 * Aggregation rings.
42927 	 */
42928 	#define HWRM_RING_ALLOC_INPUT_FLAGS_RX_SOP_PAD			UINT32_C(0x1)
42929 	/*
42930 	 * When the HW Doorbell Drop Recovery feature is enabled,
42931 	 * HW can flag false CQ overflow when CQ consumer index
42932 	 * doorbells are dropped when there really wasn't any overflow.
42933 	 * The CQE values could have already been processed by the driver,
42934 	 * but HW doesn't know about this because of the doorbell drop.
42935 	 * To avoid false detection of CQ overflow events,
42936 	 * it is recommended that CQ overflow detection is disabled
42937 	 * by the driver when HW based doorbell recovery is enabled.
42938 	 */
42939 	#define HWRM_RING_ALLOC_INPUT_FLAGS_DISABLE_CQ_OVERFLOW_DETECTION	UINT32_C(0x2)
42940 	/*
42941 	 * Used with enhanced Doorbell Pacing feature, when set to '1'
42942 	 * this flag indicates that the NQ id that's allocated should be
42943 	 * used for DBR pacing notifications.
42944 	 */
42945 	#define HWRM_RING_ALLOC_INPUT_FLAGS_NQ_DBR_PACING			UINT32_C(0x4)
42946 	/*
42947 	 * Host driver should set this flag bit to '1' to enable
42948 	 * two-completion TX packet timestamp feature. By enabling this
42949 	 * per QP flag and enabling stamp bit in TX BD lflags, host drivers
42950 	 * expect two completions, one for regular TX completion and the
42951 	 * other completion with timestamp. For a QP with both completion
42952 	 * coalescing and timestamp completion features enabled, completion
42953 	 * coalescing takes place on regular TX completions. The timestamp
42954 	 * completions are not coalesced and a separate timestamp completion
42955 	 * is generated for each packet with stamp bit set in the TX BD
42956 	 * lflags.
42957 	 */
42958 	#define HWRM_RING_ALLOC_INPUT_FLAGS_TX_PKT_TS_CMPL_ENABLE		UINT32_C(0x8)
42959 	/*
42960 	 * This value is a pointer to the page table for the
42961 	 * Ring.
42962 	 */
42963 	uint64_t	page_tbl_addr;
42964 	/* First Byte Offset of the first entry in the first page. */
42965 	uint32_t	fbo;
42966 	/*
42967 	 * Actual page size in 2^page_size. The supported range is increments
42968 	 * in powers of 2 from 16 bytes to 1GB.
42969 	 * - 4 = 16 B
42970 	 *	Page size is 16 B.
42971 	 * - 12 = 4 KB
42972 	 *	Page size is 4 KB.
42973 	 * - 13 = 8 KB
42974 	 *	Page size is 8 KB.
42975 	 * - 16 = 64 KB
42976 	 *	Page size is 64 KB.
42977 	 * - 21 = 2 MB
42978 	 *	Page size is 2 MB.
42979 	 * - 22 = 4 MB
42980 	 *	Page size is 4 MB.
42981 	 * - 30 = 1 GB
42982 	 *	Page size is 1 GB.
42983 	 */
42984 	uint8_t	page_size;
42985 	/*
42986 	 * This value indicates the depth of page table.
42987 	 * For this version of the specification, value other than 0 or
42988 	 * 1 shall be considered as an invalid value.
42989 	 * When the page_tbl_depth = 0, then it is treated as a
42990 	 * special case with the following.
42991 	 * 1. FBO and page size fields are not valid.
42992 	 * 2. page_tbl_addr is the physical address of the first
42993 	 *	element of the ring.
42994 	 */
42995 	uint8_t	page_tbl_depth;
42996 	/* Used by a PF driver to associate a SCHQ with one of its TX rings. */
42997 	uint16_t	schq_id;
42998 	/*
42999 	 * Number of 16B units in the ring. Minimum size for
43000 	 * a ring is 16 16B entries.
43001 	 */
43002 	uint32_t	length;
43003 	/*
43004 	 * Logical ring number for the ring to be allocated.
43005 	 * This value determines the position in the doorbell
43006 	 * area where the update to the ring will be made.
43007 	 *
43008 	 * For completion rings, this value is also the MSI-X
43009 	 * vector number for the function the completion ring is
43010 	 * associated with.
43011 	 */
43012 	uint16_t	logical_id;
43013 	/*
43014 	 * This field is used only when ring_type is a TX ring.
43015 	 * This value indicates what completion ring the TX ring
43016 	 * is associated with.
43017 	 */
43018 	uint16_t	cmpl_ring_id;
43019 	/*
43020 	 * This field is used only when ring_type is a TX ring.
43021 	 * This value indicates what CoS queue the TX ring
43022 	 * is associated with.
43023 	 */
43024 	uint16_t	queue_id;
43025 	/*
43026 	 * When allocating a Rx ring or Rx aggregation ring, this field
43027 	 * specifies the size of the buffer descriptors posted to the ring.
43028 	 */
43029 	uint16_t	rx_buf_size;
43030 	/*
43031 	 * When allocating an Rx aggregation ring, this field
43032 	 * specifies the associated Rx ring ID.
43033 	 */
43034 	uint16_t	rx_ring_id;
43035 	/*
43036 	 * When allocating a completion ring, this field
43037 	 * specifies the associated NQ ring ID.
43038 	 */
43039 	uint16_t	nq_ring_id;
43040 	/*
43041 	 * This field is used only when ring_type is a TX ring.
43042 	 * This field is used to configure arbitration related
43043 	 * parameters for a TX ring.
43044 	 */
43045 	uint16_t	ring_arb_cfg;
43046 	/* Arbitration policy used for the ring. */
43047 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK	UINT32_C(0xf)
43048 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT	0
43049 	/*
43050 	 * Use strict priority for the TX ring.
43051 	 * Priority value is specified in arb_policy_param
43052 	 */
43053 		#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP	UINT32_C(0x1)
43054 	/*
43055 	 * Use weighted fair queue arbitration for the TX ring.
43056 	 * Weight is specified in arb_policy_param
43057 	 */
43058 		#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ	UINT32_C(0x2)
43059 		#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST	HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
43060 	/* Reserved field. */
43061 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK		UINT32_C(0xf0)
43062 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT		4
43063 	/*
43064 	 * Arbitration policy specific parameter.
43065 	 * # For strict priority arbitration policy, this field
43066 	 * represents a priority value. If set to 0, then the priority
43067 	 * is not specified and the HWRM is allowed to select
43068 	 * any priority for this TX ring.
43069 	 * # For weighted fair queue arbitration policy, this field
43070 	 * represents a weight value. If set to 0, then the weight
43071 	 * is not specified and the HWRM is allowed to select
43072 	 * any weight for this TX ring.
43073 	 */
43074 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK UINT32_C(0xff00)
43075 	#define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
43076 	/* Steering tag to use for memory transactions. */
43077 	uint16_t	steering_tag;
43078 	/*
43079 	 * This field is reserved for the future use.
43080 	 * It shall be set to 0.
43081 	 */
43082 	uint32_t	reserved3;
43083 	/*
43084 	 * This field is used only when ring_type is a TX ring.
43085 	 * This input indicates what statistics context this ring
43086 	 * should be associated with.
43087 	 */
43088 	uint32_t	stat_ctx_id;
43089 	/*
43090 	 * This field is reserved for the future use.
43091 	 * It shall be set to 0.
43092 	 */
43093 	uint32_t	reserved4;
43094 	/*
43095 	 * This field is used only when ring_type is a TX ring
43096 	 * to specify maximum BW allocated to the TX ring.
43097 	 * The HWRM will translate this value into byte counter and
43098 	 * time interval used for this ring inside the device.
43099 	 */
43100 	uint32_t	max_bw;
43101 	/* The bandwidth value. */
43102 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK		UINT32_C(0xfffffff)
43103 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT		0
43104 	/* The granularity of the value (bits or bytes). */
43105 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE			UINT32_C(0x10000000)
43106 	/* Value is in bits. */
43107 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS		(UINT32_C(0x0) << 28)
43108 	/* Value is in bytes. */
43109 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES		(UINT32_C(0x1) << 28)
43110 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST		HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
43111 	/* bw_value_unit is 3 b */
43112 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
43113 	#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT	29
43114 	/* Value is in Mb or MB (base 10). */
43115 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
43116 	/* Value is in Kb or KB (base 10). */
43117 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
43118 	/* Value is in bits or bytes. */
43119 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
43120 	/* Value is in Gb or GB (base 10). */
43121 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
43122 	/* Value is in 1/100th of a percentage of total bandwidth. */
43123 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
43124 	/* Invalid unit */
43125 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
43126 		#define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST	HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
43127 	/*
43128 	 * This field is used only when ring_type is a Completion ring.
43129 	 * This value indicates what interrupt mode should be used
43130 	 * on this completion ring.
43131 	 * Note: In the legacy interrupt mode, no more than 16
43132 	 * completion rings are allowed.
43133 	 */
43134 	uint8_t	int_mode;
43135 	/* Legacy INTA (deprecated) */
43136 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
43137 	/* Reserved */
43138 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD   UINT32_C(0x1)
43139 	/* MSI-X */
43140 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX   UINT32_C(0x2)
43141 	/* No Interrupt - Polled mode */
43142 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL   UINT32_C(0x3)
43143 	#define HWRM_RING_ALLOC_INPUT_INT_MODE_LAST  HWRM_RING_ALLOC_INPUT_INT_MODE_POLL
43144 	/* Midpath channel type */
43145 	uint8_t	mpc_chnls_type;
43146 	/*
43147 	 * Indicate the TX ring alloc MPC channel type is a MPC channel
43148 	 * with destination to the TX crypto engine block.
43149 	 */
43150 	#define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_TCE	UINT32_C(0x0)
43151 	/*
43152 	 * Indicate the RX ring alloc MPC channel type is a MPC channel
43153 	 * with destination to the RX crypto engine block.
43154 	 */
43155 	#define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_RCE	UINT32_C(0x1)
43156 	/*
43157 	 * Indicate the RX ring alloc MPC channel type is a MPC channel
43158 	 * with destination to the TX configurable flow processing block.
43159 	 */
43160 	#define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_TE_CFA  UINT32_C(0x2)
43161 	/*
43162 	 * Indicate the RX ring alloc MPC channel type is a MPC channel
43163 	 * with destination to the RX configurable flow processing block.
43164 	 */
43165 	#define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_RE_CFA  UINT32_C(0x3)
43166 	/*
43167 	 * Indicate the RX ring alloc MPC channel type is a MPC channel
43168 	 * with destination to the primate processor block.
43169 	 */
43170 	#define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_PRIMATE UINT32_C(0x4)
43171 	#define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_LAST   HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_PRIMATE
43172 	uint8_t	unused_4[2];
43173 	/*
43174 	 * The cq_handle is specified when allocating a completion ring. For
43175 	 * devices that support NQs, this cq_handle will be included in the
43176 	 * NQE to specify which CQ should be read to retrieve the completion
43177 	 * record.
43178 	 */
43179 	uint64_t	cq_handle;
43180 } hwrm_ring_alloc_input_t, *phwrm_ring_alloc_input_t;
43181 
43182 /* hwrm_ring_alloc_output (size:128b/16B) */
43183 
43184 typedef struct hwrm_ring_alloc_output {
43185 	/* The specific error status for the command. */
43186 	uint16_t	error_code;
43187 	/* The HWRM command request type. */
43188 	uint16_t	req_type;
43189 	/* The sequence ID from the original command. */
43190 	uint16_t	seq_id;
43191 	/* The length of the response data in number of bytes. */
43192 	uint16_t	resp_len;
43193 	/*
43194 	 * Physical number of ring allocated.
43195 	 * This value shall be unique for a ring type.
43196 	 */
43197 	uint16_t	ring_id;
43198 	/* Logical number of ring allocated. */
43199 	uint16_t	logical_ring_id;
43200 	/*
43201 	 * This field will tell whether to use ping or pong buffer
43202 	 * for first push operation.
43203 	 */
43204 	uint8_t	push_buffer_index;
43205 	/* Start push from ping buffer index */
43206 	#define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PING_BUFFER UINT32_C(0x0)
43207 	/* Start push from pong buffer index */
43208 	#define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER UINT32_C(0x1)
43209 	#define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_LAST	HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER
43210 	uint8_t	unused_0[2];
43211 	/*
43212 	 * This field is used in Output records to indicate that the output
43213 	 * is completely written to RAM. This field should be read as '1'
43214 	 * to indicate that the output has been completely written. When
43215 	 * writing a command completion or response to an internal processor,
43216 	 * the order of writes has to be such that this field is written last.
43217 	 */
43218 	uint8_t	valid;
43219 } hwrm_ring_alloc_output_t, *phwrm_ring_alloc_output_t;
43220 
43221 /******************
43222  * hwrm_ring_free *
43223  ******************/
43224 
43225 
43226 /* hwrm_ring_free_input (size:256b/32B) */
43227 
43228 typedef struct hwrm_ring_free_input {
43229 	/* The HWRM command request type. */
43230 	uint16_t	req_type;
43231 	/*
43232 	 * The completion ring to send the completion event on. This should
43233 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43234 	 */
43235 	uint16_t	cmpl_ring;
43236 	/*
43237 	 * The sequence ID is used by the driver for tracking multiple
43238 	 * commands. This ID is treated as opaque data by the firmware and
43239 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43240 	 */
43241 	uint16_t	seq_id;
43242 	/*
43243 	 * The target ID of the command:
43244 	 * * 0x0-0xFFF8 - The function ID
43245 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43246 	 * * 0xFFFD - Reserved for user-space HWRM interface
43247 	 * * 0xFFFF - HWRM
43248 	 */
43249 	uint16_t	target_id;
43250 	/*
43251 	 * A physical address pointer pointing to a host buffer that the
43252 	 * command's response data will be written. This can be either a host
43253 	 * physical address (HPA) or a guest physical address (GPA) and must
43254 	 * point to a physically contiguous block of memory.
43255 	 */
43256 	uint64_t	resp_addr;
43257 	/* Ring Type. */
43258 	uint8_t	ring_type;
43259 	/* L2 Completion Ring (CR) */
43260 	#define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
43261 	/* TX Ring (TR) */
43262 	#define HWRM_RING_FREE_INPUT_RING_TYPE_TX	UINT32_C(0x1)
43263 	/* RX Ring (RR) */
43264 	#define HWRM_RING_FREE_INPUT_RING_TYPE_RX	UINT32_C(0x2)
43265 	/* RoCE Notification Completion Ring (ROCE_CR) */
43266 	#define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
43267 	/* RX Aggregation Ring */
43268 	#define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG	UINT32_C(0x4)
43269 	/* Notification Queue */
43270 	#define HWRM_RING_FREE_INPUT_RING_TYPE_NQ	UINT32_C(0x5)
43271 	#define HWRM_RING_FREE_INPUT_RING_TYPE_LAST	HWRM_RING_FREE_INPUT_RING_TYPE_NQ
43272 	uint8_t	flags;
43273 	/*
43274 	 * If this bit is set to '1', ring_id in this command belongs to
43275 	 * virtio function. prod_idx in this command corresponds to doorbell
43276 	 * producer index. opaque field in this command needs to be inserted
43277 	 * by firmware in VEE_FLUSH completion record.
43278 	 * Firmware will poll the corresponding ring context to reach the
43279 	 * given producer index before sending successful response. It will
43280 	 * finish the completion using VEE_FLUSH completion record.
43281 	 *
43282 	 * If this bit is '0', firmware will not treat ring_id as virtio
43283 	 * ring and ignore prod_idx, opaque fields.
43284 	 *
43285 	 * This feature is not applicable for L2 or RoCE.
43286 	 */
43287 	#define HWRM_RING_FREE_INPUT_FLAGS_VIRTIO_RING_VALID UINT32_C(0x1)
43288 	#define HWRM_RING_FREE_INPUT_FLAGS_LAST		HWRM_RING_FREE_INPUT_FLAGS_VIRTIO_RING_VALID
43289 	/* Physical number of ring allocated. */
43290 	uint16_t	ring_id;
43291 	/*
43292 	 * Ring BD producer index posted by the virtio block.
43293 	 * This field is valid if virtio_ring_valid flag is set.
43294 	 */
43295 	uint32_t	prod_idx;
43296 	/*
43297 	 * User defined opaque field to be inserted into VEE_FLUSH completion
43298 	 * record. This field is valid if virtio_ring_valid flag is set.
43299 	 */
43300 	uint32_t	opaque;
43301 	uint32_t	unused_1;
43302 } hwrm_ring_free_input_t, *phwrm_ring_free_input_t;
43303 
43304 /* hwrm_ring_free_output (size:128b/16B) */
43305 
43306 typedef struct hwrm_ring_free_output {
43307 	/* The specific error status for the command. */
43308 	uint16_t	error_code;
43309 	/* The HWRM command request type. */
43310 	uint16_t	req_type;
43311 	/* The sequence ID from the original command. */
43312 	uint16_t	seq_id;
43313 	/* The length of the response data in number of bytes. */
43314 	uint16_t	resp_len;
43315 	uint8_t	unused_0[7];
43316 	/*
43317 	 * This field is used in Output records to indicate that the output
43318 	 * is completely written to RAM. This field should be read as '1'
43319 	 * to indicate that the output has been completely written. When
43320 	 * writing a command completion or response to an internal processor,
43321 	 * the order of writes has to be such that this field is written last.
43322 	 */
43323 	uint8_t	valid;
43324 } hwrm_ring_free_output_t, *phwrm_ring_free_output_t;
43325 
43326 /*******************
43327  * hwrm_ring_reset *
43328  *******************/
43329 
43330 
43331 /* hwrm_ring_reset_input (size:192b/24B) */
43332 
43333 typedef struct hwrm_ring_reset_input {
43334 	/* The HWRM command request type. */
43335 	uint16_t	req_type;
43336 	/*
43337 	 * The completion ring to send the completion event on. This should
43338 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43339 	 */
43340 	uint16_t	cmpl_ring;
43341 	/*
43342 	 * The sequence ID is used by the driver for tracking multiple
43343 	 * commands. This ID is treated as opaque data by the firmware and
43344 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43345 	 */
43346 	uint16_t	seq_id;
43347 	/*
43348 	 * The target ID of the command:
43349 	 * * 0x0-0xFFF8 - The function ID
43350 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43351 	 * * 0xFFFD - Reserved for user-space HWRM interface
43352 	 * * 0xFFFF - HWRM
43353 	 */
43354 	uint16_t	target_id;
43355 	/*
43356 	 * A physical address pointer pointing to a host buffer that the
43357 	 * command's response data will be written. This can be either a host
43358 	 * physical address (HPA) or a guest physical address (GPA) and must
43359 	 * point to a physically contiguous block of memory.
43360 	 */
43361 	uint64_t	resp_addr;
43362 	/* Ring Type. */
43363 	uint8_t	ring_type;
43364 	/* L2 Completion Ring (CR) */
43365 	#define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL	UINT32_C(0x0)
43366 	/* TX Ring (TR) */
43367 	#define HWRM_RING_RESET_INPUT_RING_TYPE_TX	UINT32_C(0x1)
43368 	/* RX Ring (RR) */
43369 	#define HWRM_RING_RESET_INPUT_RING_TYPE_RX	UINT32_C(0x2)
43370 	/* RoCE Notification Completion Ring (ROCE_CR) */
43371 	#define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL   UINT32_C(0x3)
43372 	/*
43373 	 * Rx Ring Group. This is to reset rx and aggregation in an atomic
43374 	 * operation. Completion ring associated with this ring group is
43375 	 * not reset.
43376 	 */
43377 	#define HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP UINT32_C(0x6)
43378 	#define HWRM_RING_RESET_INPUT_RING_TYPE_LAST	HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP
43379 	uint8_t	unused_0;
43380 	/*
43381 	 * Physical number of the ring. When ring type is rx_ring_grp, ring id
43382 	 * actually refers to ring group id.
43383 	 */
43384 	uint16_t	ring_id;
43385 	uint8_t	unused_1[4];
43386 } hwrm_ring_reset_input_t, *phwrm_ring_reset_input_t;
43387 
43388 /* hwrm_ring_reset_output (size:128b/16B) */
43389 
43390 typedef struct hwrm_ring_reset_output {
43391 	/* The specific error status for the command. */
43392 	uint16_t	error_code;
43393 	/* The HWRM command request type. */
43394 	uint16_t	req_type;
43395 	/* The sequence ID from the original command. */
43396 	uint16_t	seq_id;
43397 	/* The length of the response data in number of bytes. */
43398 	uint16_t	resp_len;
43399 	/*
43400 	 * This field will tell whether to use ping or pong buffer
43401 	 * for first push operation.
43402 	 */
43403 	uint8_t	push_buffer_index;
43404 	/* Start push from ping buffer index */
43405 	#define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PING_BUFFER UINT32_C(0x0)
43406 	/* Start push from pong buffer index */
43407 	#define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER UINT32_C(0x1)
43408 	#define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_LAST	HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER
43409 	uint8_t	unused_0[3];
43410 	/* Position of consumer index after ring reset completes. */
43411 	uint8_t	consumer_idx[3];
43412 	/*
43413 	 * This field is used in Output records to indicate that the output
43414 	 * is completely written to RAM. This field should be read as '1'
43415 	 * to indicate that the output has been completely written. When
43416 	 * writing a command completion or response to an internal processor,
43417 	 * the order of writes has to be such that this field is written last.
43418 	 */
43419 	uint8_t	valid;
43420 } hwrm_ring_reset_output_t, *phwrm_ring_reset_output_t;
43421 
43422 /*****************
43423  * hwrm_ring_cfg *
43424  *****************/
43425 
43426 
43427 /* hwrm_ring_cfg_input (size:320b/40B) */
43428 
43429 typedef struct hwrm_ring_cfg_input {
43430 	/* The HWRM command request type. */
43431 	uint16_t	req_type;
43432 	/*
43433 	 * The completion ring to send the completion event on. This should
43434 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43435 	 */
43436 	uint16_t	cmpl_ring;
43437 	/*
43438 	 * The sequence ID is used by the driver for tracking multiple
43439 	 * commands. This ID is treated as opaque data by the firmware and
43440 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43441 	 */
43442 	uint16_t	seq_id;
43443 	/*
43444 	 * The target ID of the command:
43445 	 * * 0x0-0xFFF8 - The function ID
43446 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43447 	 * * 0xFFFD - Reserved for user-space HWRM interface
43448 	 * * 0xFFFF - HWRM
43449 	 */
43450 	uint16_t	target_id;
43451 	/*
43452 	 * A physical address pointer pointing to a host buffer that the
43453 	 * command's response data will be written. This can be either a host
43454 	 * physical address (HPA) or a guest physical address (GPA) and must
43455 	 * point to a physically contiguous block of memory.
43456 	 */
43457 	uint64_t	resp_addr;
43458 	/* Ring Type. */
43459 	uint8_t	ring_type;
43460 	/* TX Ring (TR) */
43461 	#define HWRM_RING_CFG_INPUT_RING_TYPE_TX UINT32_C(0x1)
43462 	/* RX Ring (RR) */
43463 	#define HWRM_RING_CFG_INPUT_RING_TYPE_RX UINT32_C(0x2)
43464 	#define HWRM_RING_CFG_INPUT_RING_TYPE_LAST HWRM_RING_CFG_INPUT_RING_TYPE_RX
43465 	uint8_t	unused_0;
43466 	/* Physical number of the ring. */
43467 	uint16_t	ring_id;
43468 	/* Ring config enable bits. */
43469 	uint16_t	enables;
43470 	/*
43471 	 * For Rx rings, the incoming packet data can be placed at either
43472 	 * a 0B, 2B, 10B or 12B offset from the start of the Rx packet
43473 	 * buffer.
43474 	 * When '1', the received packet will be padded with 2B, 10B or 12B
43475 	 * of zeros at the front of the packet. The exact offset is specified
43476 	 * by rx_sop_pad_bytes parameter.
43477 	 * When '0', the received packet will not be padded.
43478 	 * Note that this flag is only used for Rx rings and is ignored
43479 	 * for all other rings included Rx Aggregation rings.
43480 	 */
43481 	#define HWRM_RING_CFG_INPUT_ENABLES_RX_SOP_PAD_ENABLE		UINT32_C(0x1)
43482 	/*
43483 	 * Proxy mode enable, for Tx, Rx and Rx aggregation rings only.
43484 	 * When rings are allocated, the PCI function on which driver issues
43485 	 * HWRM_RING_CFG command is assumed to own the rings. Hardware takes
43486 	 * the buffer descriptors (BDs) from those rings is assumed to issue
43487 	 * packet payload DMA using same PCI function. When proxy mode is
43488 	 * enabled, hardware can perform payload DMA using another PCI
43489 	 * function on same or different host.
43490 	 * When set to '0', the PCI function on which driver issues
43491 	 * HWRM_RING_CFG command is used for host payload DMA operation.
43492 	 * When set to '1', the host PCI function specified by proxy_fid is
43493 	 * used for host payload DMA operation.
43494 	 */
43495 	#define HWRM_RING_CFG_INPUT_ENABLES_PROXY_MODE_ENABLE		UINT32_C(0x2)
43496 	/*
43497 	 * Tx ring packet source interface override, for Tx rings only.
43498 	 * When TX rings are allocated, the PCI function on which driver
43499 	 * issues HWRM_RING_CFG is assumed to be source interface of
43500 	 * packets sent from TX ring.
43501 	 * When set to '1', the host PCI function specified by proxy_fid
43502 	 * is used as source interface of the transmitted packets.
43503 	 */
43504 	#define HWRM_RING_CFG_INPUT_ENABLES_TX_PROXY_SRC_INTF_OVERRIDE	UINT32_C(0x4)
43505 	/* The schq_id field is valid */
43506 	#define HWRM_RING_CFG_INPUT_ENABLES_SCHQ_ID			UINT32_C(0x8)
43507 	/* Update completion ring ID associated with Tx or Rx ring. */
43508 	#define HWRM_RING_CFG_INPUT_ENABLES_CMPL_RING_ID_UPDATE		UINT32_C(0x10)
43509 	/*
43510 	 * When set to '1', metadata value provided by tx_metadata
43511 	 * field in this command is inserted in the lb_header_metadata
43512 	 * QP context field. When set to '0', no change done to metadata.
43513 	 * Firmware rejects the tx ring metadata programming with
43514 	 * HWRM_ERR_CODE_UNSUPPORTED error if the per function CFA BD
43515 	 * metadata feature is not disabled.
43516 	 */
43517 	#define HWRM_RING_CFG_INPUT_ENABLES_TX_METADATA			UINT32_C(0x20)
43518 	/*
43519 	 * Proxy function FID value.
43520 	 * This value is only used when either proxy_mode_enable flag or
43521 	 * tx_proxy_svif_override is set to '1'.
43522 	 * When proxy_mode_enable is set to '1', it identifies a host PCI
43523 	 * function used for host payload DMA operations.
43524 	 * When tx_proxy_src_intf is set to '1', it identifies a host PCI
43525 	 * function as source interface for all transmitted packets from
43526 	 * the TX ring.
43527 	 */
43528 	uint16_t	proxy_fid;
43529 	/*
43530 	 * Identifies the new scheduler queue (SCHQ) to associate with the
43531 	 * ring. Only valid for Tx rings.
43532 	 * A value of zero indicates that the Tx ring should be associated
43533 	 * with the default scheduler queue (SCHQ).
43534 	 */
43535 	uint16_t	schq_id;
43536 	/*
43537 	 * This field is valid for TX or Rx rings. This value identifies the
43538 	 * new completion ring ID to associate with the TX or Rx ring.
43539 	 */
43540 	uint16_t	cmpl_ring_id;
43541 	/*
43542 	 * Rx SOP padding amount in bytes.
43543 	 * This value is only used when rx_sop_pad_enable flag is set to '1'.
43544 	 */
43545 	uint8_t	rx_sop_pad_bytes;
43546 	uint8_t	unused_1[3];
43547 	/*
43548 	 * When tx_metadata enable bit is set, value specified in this field
43549 	 * is copied to lb_header_metadata in the QP context.
43550 	 */
43551 	uint32_t	tx_metadata;
43552 	uint8_t	unused_2[4];
43553 } hwrm_ring_cfg_input_t, *phwrm_ring_cfg_input_t;
43554 
43555 /* hwrm_ring_cfg_output (size:128b/16B) */
43556 
43557 typedef struct hwrm_ring_cfg_output {
43558 	/* The specific error status for the command. */
43559 	uint16_t	error_code;
43560 	/* The HWRM command request type. */
43561 	uint16_t	req_type;
43562 	/* The sequence ID from the original command. */
43563 	uint16_t	seq_id;
43564 	/* The length of the response data in number of bytes. */
43565 	uint16_t	resp_len;
43566 	uint8_t	unused_0[7];
43567 	/*
43568 	 * This field is used in Output records to indicate that the output
43569 	 * is completely written to RAM. This field should be read as '1'
43570 	 * to indicate that the output has been completely written.
43571 	 * When writing a command completion or response to an internal
43572 	 * processor, the order of writes has to be such that this field is
43573 	 * written last.
43574 	 */
43575 	uint8_t	valid;
43576 } hwrm_ring_cfg_output_t, *phwrm_ring_cfg_output_t;
43577 
43578 /******************
43579  * hwrm_ring_qcfg *
43580  ******************/
43581 
43582 
43583 /* hwrm_ring_qcfg_input (size:192b/24B) */
43584 
43585 typedef struct hwrm_ring_qcfg_input {
43586 	/* The HWRM command request type. */
43587 	uint16_t	req_type;
43588 	/*
43589 	 * The completion ring to send the completion event on. This should
43590 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43591 	 */
43592 	uint16_t	cmpl_ring;
43593 	/*
43594 	 * The sequence ID is used by the driver for tracking multiple
43595 	 * commands. This ID is treated as opaque data by the firmware and
43596 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43597 	 */
43598 	uint16_t	seq_id;
43599 	/*
43600 	 * The target ID of the command:
43601 	 * * 0x0-0xFFF8 - The function ID
43602 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43603 	 * * 0xFFFD - Reserved for user-space HWRM interface
43604 	 * * 0xFFFF - HWRM
43605 	 */
43606 	uint16_t	target_id;
43607 	/*
43608 	 * A physical address pointer pointing to a host buffer that the
43609 	 * command's response data will be written. This can be either a host
43610 	 * physical address (HPA) or a guest physical address (GPA) and must
43611 	 * point to a physically contiguous block of memory.
43612 	 */
43613 	uint64_t	resp_addr;
43614 	/* Ring Type. */
43615 	uint8_t	ring_type;
43616 	/* TX Ring (TR) */
43617 	#define HWRM_RING_QCFG_INPUT_RING_TYPE_TX UINT32_C(0x1)
43618 	/* RX Ring (RR) */
43619 	#define HWRM_RING_QCFG_INPUT_RING_TYPE_RX UINT32_C(0x2)
43620 	#define HWRM_RING_QCFG_INPUT_RING_TYPE_LAST HWRM_RING_QCFG_INPUT_RING_TYPE_RX
43621 	uint8_t	unused_0[5];
43622 	/* Physical number of the ring. */
43623 	uint16_t	ring_id;
43624 } hwrm_ring_qcfg_input_t, *phwrm_ring_qcfg_input_t;
43625 
43626 /* hwrm_ring_qcfg_output (size:256b/32B) */
43627 
43628 typedef struct hwrm_ring_qcfg_output {
43629 	/* The specific error status for the command. */
43630 	uint16_t	error_code;
43631 	/* The HWRM command request type. */
43632 	uint16_t	req_type;
43633 	/* The sequence ID from the original command. */
43634 	uint16_t	seq_id;
43635 	/* The length of the response data in number of bytes. */
43636 	uint16_t	resp_len;
43637 	/* Ring config enable bits. */
43638 	uint16_t	enables;
43639 	/*
43640 	 * For Rx rings, the incoming packet data can be placed at either
43641 	 * a 0B, 2B, 10B or 12B offset from the start of the Rx packet
43642 	 * buffer.
43643 	 * When '1', the received packet will be padded with 2B, 10B or 12B
43644 	 * of zeros at the front of the packet. The exact offset is specified
43645 	 * by rx_sop_pad_bytes parameter.
43646 	 * When '0', the received packet will not be padded.
43647 	 * Note that this flag is only used for Rx rings and is ignored
43648 	 * for all other rings included Rx Aggregation rings.
43649 	 */
43650 	#define HWRM_RING_QCFG_OUTPUT_ENABLES_RX_SOP_PAD_ENABLE		UINT32_C(0x1)
43651 	/*
43652 	 * Proxy mode enable, for Tx, Rx and Rx aggregation rings only.
43653 	 * When rings are allocated, the PCI function on which driver issues
43654 	 * HWRM_RING_CFG command is assumed to own the rings. Hardware takes
43655 	 * the buffer descriptors (BDs) from those rings is assumed to issue
43656 	 * packet payload DMA using same PCI function. When proxy mode is
43657 	 * enabled, hardware can perform payload DMA using another PCI
43658 	 * function on same or different host.
43659 	 * When set to '0', the PCI function on which driver issues
43660 	 * HWRM_RING_CFG command is used for host payload DMA operation.
43661 	 * When set to '1', the host PCI function specified by proxy_fid is
43662 	 * used for host payload DMA operation.
43663 	 */
43664 	#define HWRM_RING_QCFG_OUTPUT_ENABLES_PROXY_MODE_ENABLE		UINT32_C(0x2)
43665 	/*
43666 	 * Tx ring packet source interface override, for Tx rings only.
43667 	 * When TX rings are allocated, the PCI function on which driver
43668 	 * issues HWRM_RING_CFG is assumed to be source interface of
43669 	 * packets sent from TX ring.
43670 	 * When set to '1', the host PCI function specified by proxy_fid is
43671 	 * used as source interface of the transmitted packets.
43672 	 */
43673 	#define HWRM_RING_QCFG_OUTPUT_ENABLES_TX_PROXY_SRC_INTF_OVERRIDE	UINT32_C(0x4)
43674 	/*
43675 	 * Proxy function FID value.
43676 	 * This value is only used when either proxy_mode_enable flag or
43677 	 * tx_proxy_svif_override is set to '1'.
43678 	 * When proxy_mode_enable is set to '1', it identifies a host PCI
43679 	 * function used for host payload DMA operations.
43680 	 * When tx_proxy_src_intf is set to '1', it identifies a host PCI
43681 	 * function as source interface for all transmitted packets from the TX
43682 	 * ring.
43683 	 */
43684 	uint16_t	proxy_fid;
43685 	/*
43686 	 * Identifies the new scheduler queue (SCHQ) to associate with the
43687 	 * ring. Only valid for Tx rings.
43688 	 * A value of zero indicates that the Tx ring should be associated with
43689 	 * the default scheduler queue (SCHQ).
43690 	 */
43691 	uint16_t	schq_id;
43692 	/*
43693 	 * This field is used when ring_type is a TX or Rx ring.
43694 	 * This value indicates what completion ring the TX or Rx ring
43695 	 * is associated with.
43696 	 */
43697 	uint16_t	cmpl_ring_id;
43698 	/*
43699 	 * Rx SOP padding amount in bytes.
43700 	 * This value is only used when rx_sop_pad_enable flag is set to '1'.
43701 	 */
43702 	uint8_t	rx_sop_pad_bytes;
43703 	uint8_t	unused_0[3];
43704 	/* lb_header_metadata in the QP context is copied to this field. */
43705 	uint32_t	tx_metadata;
43706 	uint8_t	unused_1[7];
43707 	/*
43708 	 * This field is used in Output records to indicate that the output
43709 	 * is completely written to RAM. This field should be read as '1'
43710 	 * to indicate that the output has been completely written.
43711 	 * When writing a command completion or response to an internal
43712 	 * processor, the order of writes has to be such that this field is
43713 	 * written last.
43714 	 */
43715 	uint8_t	valid;
43716 } hwrm_ring_qcfg_output_t, *phwrm_ring_qcfg_output_t;
43717 
43718 /**************************
43719  * hwrm_ring_aggint_qcaps *
43720  **************************/
43721 
43722 
43723 /* hwrm_ring_aggint_qcaps_input (size:128b/16B) */
43724 
43725 typedef struct hwrm_ring_aggint_qcaps_input {
43726 	/* The HWRM command request type. */
43727 	uint16_t	req_type;
43728 	/*
43729 	 * The completion ring to send the completion event on. This should
43730 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43731 	 */
43732 	uint16_t	cmpl_ring;
43733 	/*
43734 	 * The sequence ID is used by the driver for tracking multiple
43735 	 * commands. This ID is treated as opaque data by the firmware and
43736 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43737 	 */
43738 	uint16_t	seq_id;
43739 	/*
43740 	 * The target ID of the command:
43741 	 * * 0x0-0xFFF8 - The function ID
43742 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43743 	 * * 0xFFFD - Reserved for user-space HWRM interface
43744 	 * * 0xFFFF - HWRM
43745 	 */
43746 	uint16_t	target_id;
43747 	/*
43748 	 * A physical address pointer pointing to a host buffer that the
43749 	 * command's response data will be written. This can be either a host
43750 	 * physical address (HPA) or a guest physical address (GPA) and must
43751 	 * point to a physically contiguous block of memory.
43752 	 */
43753 	uint64_t	resp_addr;
43754 } hwrm_ring_aggint_qcaps_input_t, *phwrm_ring_aggint_qcaps_input_t;
43755 
43756 /* hwrm_ring_aggint_qcaps_output (size:384b/48B) */
43757 
43758 typedef struct hwrm_ring_aggint_qcaps_output {
43759 	/* The specific error status for the command. */
43760 	uint16_t	error_code;
43761 	/* The HWRM command request type. */
43762 	uint16_t	req_type;
43763 	/* The sequence ID from the original command. */
43764 	uint16_t	seq_id;
43765 	/* The length of the response data in number of bytes. */
43766 	uint16_t	resp_len;
43767 	uint32_t	cmpl_params;
43768 	/*
43769 	 * When this bit is set to '1', int_lat_tmr_min can be configured
43770 	 * on completion rings.
43771 	 */
43772 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MIN		UINT32_C(0x1)
43773 	/*
43774 	 * When this bit is set to '1', int_lat_tmr_max can be configured
43775 	 * on completion rings.
43776 	 */
43777 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MAX		UINT32_C(0x2)
43778 	/*
43779 	 * When this bit is set to '1', timer_reset can be enabled
43780 	 * on completion rings.
43781 	 */
43782 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_TIMER_RESET			UINT32_C(0x4)
43783 	/*
43784 	 * When this bit is set to '1', ring_idle can be enabled
43785 	 * on completion rings.
43786 	 */
43787 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_RING_IDLE			UINT32_C(0x8)
43788 	/*
43789 	 * When this bit is set to '1', num_cmpl_dma_aggr can be configured
43790 	 * on completion rings.
43791 	 */
43792 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR		UINT32_C(0x10)
43793 	/*
43794 	 * When this bit is set to '1', num_cmpl_dma_aggr_during_int can be
43795 	 * configured on completion rings.
43796 	 */
43797 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR_DURING_INT	UINT32_C(0x20)
43798 	/*
43799 	 * When this bit is set to '1', cmpl_aggr_dma_tmr can be configured
43800 	 * on completion rings.
43801 	 */
43802 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR		UINT32_C(0x40)
43803 	/*
43804 	 * When this bit is set to '1', cmpl_aggr_dma_tmr_during_int can be
43805 	 * configured on completion rings.
43806 	 */
43807 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR_DURING_INT	UINT32_C(0x80)
43808 	/*
43809 	 * When this bit is set to '1', num_cmpl_aggr_int can be configured
43810 	 * on completion rings.
43811 	 */
43812 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_AGGR_INT		UINT32_C(0x100)
43813 	uint32_t	nq_params;
43814 	/*
43815 	 * When this bit is set to '1', int_lat_tmr_min can be configured
43816 	 * on notification queues.
43817 	 */
43818 	#define HWRM_RING_AGGINT_QCAPS_OUTPUT_NQ_PARAMS_INT_LAT_TMR_MIN	UINT32_C(0x1)
43819 	/* Minimum value for num_cmpl_dma_aggr */
43820 	uint16_t	num_cmpl_dma_aggr_min;
43821 	/* Maximum value for num_cmpl_dma_aggr */
43822 	uint16_t	num_cmpl_dma_aggr_max;
43823 	/* Minimum value for num_cmpl_dma_aggr_during_int */
43824 	uint16_t	num_cmpl_dma_aggr_during_int_min;
43825 	/* Maximum value for num_cmpl_dma_aggr_during_int */
43826 	uint16_t	num_cmpl_dma_aggr_during_int_max;
43827 	/* Minimum value for cmpl_aggr_dma_tmr */
43828 	uint16_t	cmpl_aggr_dma_tmr_min;
43829 	/* Maximum value for cmpl_aggr_dma_tmr */
43830 	uint16_t	cmpl_aggr_dma_tmr_max;
43831 	/* Minimum value for cmpl_aggr_dma_tmr_during_int */
43832 	uint16_t	cmpl_aggr_dma_tmr_during_int_min;
43833 	/* Maximum value for cmpl_aggr_dma_tmr_during_int */
43834 	uint16_t	cmpl_aggr_dma_tmr_during_int_max;
43835 	/* Minimum value for int_lat_tmr_min */
43836 	uint16_t	int_lat_tmr_min_min;
43837 	/* Maximum value for int_lat_tmr_min */
43838 	uint16_t	int_lat_tmr_min_max;
43839 	/* Minimum value for int_lat_tmr_max */
43840 	uint16_t	int_lat_tmr_max_min;
43841 	/* Maximum value for int_lat_tmr_max */
43842 	uint16_t	int_lat_tmr_max_max;
43843 	/* Minimum value for num_cmpl_aggr_int */
43844 	uint16_t	num_cmpl_aggr_int_min;
43845 	/* Maximum value for num_cmpl_aggr_int */
43846 	uint16_t	num_cmpl_aggr_int_max;
43847 	/* The units for timer parameters, in nanoseconds. */
43848 	uint16_t	timer_units;
43849 	uint8_t	unused_0[1];
43850 	/*
43851 	 * This field is used in Output records to indicate that the output
43852 	 * is completely written to RAM. This field should be read as '1'
43853 	 * to indicate that the output has been completely written. When
43854 	 * writing a command completion or response to an internal processor,
43855 	 * the order of writes has to be such that this field is written last.
43856 	 */
43857 	uint8_t	valid;
43858 } hwrm_ring_aggint_qcaps_output_t, *phwrm_ring_aggint_qcaps_output_t;
43859 
43860 /**************************************
43861  * hwrm_ring_cmpl_ring_qaggint_params *
43862  **************************************/
43863 
43864 
43865 /* hwrm_ring_cmpl_ring_qaggint_params_input (size:192b/24B) */
43866 
43867 typedef struct hwrm_ring_cmpl_ring_qaggint_params_input {
43868 	/* The HWRM command request type. */
43869 	uint16_t	req_type;
43870 	/*
43871 	 * The completion ring to send the completion event on. This should
43872 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43873 	 */
43874 	uint16_t	cmpl_ring;
43875 	/*
43876 	 * The sequence ID is used by the driver for tracking multiple
43877 	 * commands. This ID is treated as opaque data by the firmware and
43878 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43879 	 */
43880 	uint16_t	seq_id;
43881 	/*
43882 	 * The target ID of the command:
43883 	 * * 0x0-0xFFF8 - The function ID
43884 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43885 	 * * 0xFFFD - Reserved for user-space HWRM interface
43886 	 * * 0xFFFF - HWRM
43887 	 */
43888 	uint16_t	target_id;
43889 	/*
43890 	 * A physical address pointer pointing to a host buffer that the
43891 	 * command's response data will be written. This can be either a host
43892 	 * physical address (HPA) or a guest physical address (GPA) and must
43893 	 * point to a physically contiguous block of memory.
43894 	 */
43895 	uint64_t	resp_addr;
43896 	/* Physical number of completion ring. */
43897 	uint16_t	ring_id;
43898 	uint16_t	flags;
43899 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_MASK UINT32_C(0x3)
43900 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_SFT 0
43901 	/*
43902 	 * Set this flag to 1 when querying parameters on a notification
43903 	 * queue. Set this flag to 0 when querying parameters on a
43904 	 * completion queue or completion ring.
43905 	 */
43906 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_IS_NQ	UINT32_C(0x4)
43907 	uint8_t	unused_0[4];
43908 } hwrm_ring_cmpl_ring_qaggint_params_input_t, *phwrm_ring_cmpl_ring_qaggint_params_input_t;
43909 
43910 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
43911 
43912 typedef struct hwrm_ring_cmpl_ring_qaggint_params_output {
43913 	/* The specific error status for the command. */
43914 	uint16_t	error_code;
43915 	/* The HWRM command request type. */
43916 	uint16_t	req_type;
43917 	/* The sequence ID from the original command. */
43918 	uint16_t	seq_id;
43919 	/* The length of the response data in number of bytes. */
43920 	uint16_t	resp_len;
43921 	uint16_t	flags;
43922 	/*
43923 	 * When this bit is set to '1', interrupt max
43924 	 * timer is reset whenever a completion is received.
43925 	 */
43926 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET	UINT32_C(0x1)
43927 	/*
43928 	 * When this bit is set to '1', ring idle mode
43929 	 * aggregation will be enabled.
43930 	 */
43931 	#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE	UINT32_C(0x2)
43932 	/*
43933 	 * Number of completions to aggregate before DMA
43934 	 * during the normal mode.
43935 	 */
43936 	uint16_t	num_cmpl_dma_aggr;
43937 	/*
43938 	 * Number of completions to aggregate before DMA
43939 	 * during the interrupt mode.
43940 	 */
43941 	uint16_t	num_cmpl_dma_aggr_during_int;
43942 	/*
43943 	 * Timer used to aggregate completions before
43944 	 * DMA during the normal mode (not in interrupt mode).
43945 	 */
43946 	uint16_t	cmpl_aggr_dma_tmr;
43947 	/*
43948 	 * Timer used to aggregate completions before
43949 	 * DMA when in interrupt mode.
43950 	 */
43951 	uint16_t	cmpl_aggr_dma_tmr_during_int;
43952 	/* Minimum time between two interrupts. */
43953 	uint16_t	int_lat_tmr_min;
43954 	/*
43955 	 * Maximum wait time spent aggregating
43956 	 * completions before signaling the interrupt after the
43957 	 * interrupt is enabled.
43958 	 */
43959 	uint16_t	int_lat_tmr_max;
43960 	/*
43961 	 * Minimum number of completions aggregated before signaling
43962 	 * an interrupt.
43963 	 */
43964 	uint16_t	num_cmpl_aggr_int;
43965 	uint8_t	unused_0[7];
43966 	/*
43967 	 * This field is used in Output records to indicate that the output
43968 	 * is completely written to RAM. This field should be read as '1'
43969 	 * to indicate that the output has been completely written. When
43970 	 * writing a command completion or response to an internal processor,
43971 	 * the order of writes has to be such that this field is written last.
43972 	 */
43973 	uint8_t	valid;
43974 } hwrm_ring_cmpl_ring_qaggint_params_output_t, *phwrm_ring_cmpl_ring_qaggint_params_output_t;
43975 
43976 /*****************************************
43977  * hwrm_ring_cmpl_ring_cfg_aggint_params *
43978  *****************************************/
43979 
43980 
43981 /* hwrm_ring_cmpl_ring_cfg_aggint_params_input (size:320b/40B) */
43982 
43983 typedef struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
43984 	/* The HWRM command request type. */
43985 	uint16_t	req_type;
43986 	/*
43987 	 * The completion ring to send the completion event on. This should
43988 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
43989 	 */
43990 	uint16_t	cmpl_ring;
43991 	/*
43992 	 * The sequence ID is used by the driver for tracking multiple
43993 	 * commands. This ID is treated as opaque data by the firmware and
43994 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
43995 	 */
43996 	uint16_t	seq_id;
43997 	/*
43998 	 * The target ID of the command:
43999 	 * * 0x0-0xFFF8 - The function ID
44000 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44001 	 * * 0xFFFD - Reserved for user-space HWRM interface
44002 	 * * 0xFFFF - HWRM
44003 	 */
44004 	uint16_t	target_id;
44005 	/*
44006 	 * A physical address pointer pointing to a host buffer that the
44007 	 * command's response data will be written. This can be either a host
44008 	 * physical address (HPA) or a guest physical address (GPA) and must
44009 	 * point to a physically contiguous block of memory.
44010 	 */
44011 	uint64_t	resp_addr;
44012 	/* Physical number of completion ring. */
44013 	uint16_t	ring_id;
44014 	uint16_t	flags;
44015 	/*
44016 	 * When this bit is set to '1', interrupt latency max
44017 	 * timer is reset whenever a completion is received.
44018 	 */
44019 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET	UINT32_C(0x1)
44020 	/*
44021 	 * When this bit is set to '1', ring idle mode
44022 	 * aggregation will be enabled.
44023 	 */
44024 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE	UINT32_C(0x2)
44025 	/*
44026 	 * Set this flag to 1 when configuring parameters on a
44027 	 * notification queue. Set this flag to 0 when configuring
44028 	 * parameters on a completion queue or completion ring.
44029 	 */
44030 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ	UINT32_C(0x4)
44031 	/*
44032 	 * Number of completions to aggregate before DMA
44033 	 * during the normal mode.
44034 	 */
44035 	uint16_t	num_cmpl_dma_aggr;
44036 	/*
44037 	 * Number of completions to aggregate before DMA
44038 	 * during the interrupt mode.
44039 	 */
44040 	uint16_t	num_cmpl_dma_aggr_during_int;
44041 	/*
44042 	 * Timer used to aggregate completions before
44043 	 * DMA during the normal mode (not in interrupt mode).
44044 	 */
44045 	uint16_t	cmpl_aggr_dma_tmr;
44046 	/*
44047 	 * Timer used to aggregate completions before
44048 	 * DMA while in interrupt mode.
44049 	 */
44050 	uint16_t	cmpl_aggr_dma_tmr_during_int;
44051 	/* Minimum time between two interrupts. */
44052 	uint16_t	int_lat_tmr_min;
44053 	/*
44054 	 * Maximum wait time spent aggregating
44055 	 * completions before signaling the interrupt after the
44056 	 * interrupt is enabled.
44057 	 */
44058 	uint16_t	int_lat_tmr_max;
44059 	/*
44060 	 * Minimum number of completions aggregated before signaling
44061 	 * an interrupt.
44062 	 */
44063 	uint16_t	num_cmpl_aggr_int;
44064 	/*
44065 	 * Bitfield that indicates which parameters are to be applied. Only
44066 	 * required when configuring devices with notification queues, and
44067 	 * used in that case to set certain parameters on completion queues
44068 	 * and others on notification queues.
44069 	 */
44070 	uint16_t	enables;
44071 	/*
44072 	 * This bit must be '1' for the num_cmpl_dma_aggr field to be
44073 	 * configured.
44074 	 */
44075 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR		UINT32_C(0x1)
44076 	/*
44077 	 * This bit must be '1' for the num_cmpl_dma_aggr_during_int field to
44078 	 * be configured.
44079 	 */
44080 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR_DURING_INT	UINT32_C(0x2)
44081 	/*
44082 	 * This bit must be '1' for the cmpl_aggr_dma_tmr field to be
44083 	 * configured.
44084 	 */
44085 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR		UINT32_C(0x4)
44086 	/*
44087 	 * This bit must be '1' for the int_lat_tmr_min field to be
44088 	 * configured.
44089 	 */
44090 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MIN		UINT32_C(0x8)
44091 	/*
44092 	 * This bit must be '1' for the int_lat_tmr_max field to be
44093 	 * configured.
44094 	 */
44095 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MAX		UINT32_C(0x10)
44096 	/*
44097 	 * This bit must be '1' for the num_cmpl_aggr_int field to be
44098 	 * configured.
44099 	 */
44100 	#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT		UINT32_C(0x20)
44101 	uint8_t	unused_0[4];
44102 } hwrm_ring_cmpl_ring_cfg_aggint_params_input_t, *phwrm_ring_cmpl_ring_cfg_aggint_params_input_t;
44103 
44104 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */
44105 
44106 typedef struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
44107 	/* The specific error status for the command. */
44108 	uint16_t	error_code;
44109 	/* The HWRM command request type. */
44110 	uint16_t	req_type;
44111 	/* The sequence ID from the original command. */
44112 	uint16_t	seq_id;
44113 	/* The length of the response data in number of bytes. */
44114 	uint16_t	resp_len;
44115 	uint8_t	unused_0[7];
44116 	/*
44117 	 * This field is used in Output records to indicate that the output
44118 	 * is completely written to RAM. This field should be read as '1'
44119 	 * to indicate that the output has been completely written. When
44120 	 * writing a command completion or response to an internal processor,
44121 	 * the order of writes has to be such that this field is written last.
44122 	 */
44123 	uint8_t	valid;
44124 } hwrm_ring_cmpl_ring_cfg_aggint_params_output_t, *phwrm_ring_cmpl_ring_cfg_aggint_params_output_t;
44125 
44126 /***********************
44127  * hwrm_ring_grp_alloc *
44128  ***********************/
44129 
44130 
44131 /* hwrm_ring_grp_alloc_input (size:192b/24B) */
44132 
44133 typedef struct hwrm_ring_grp_alloc_input {
44134 	/* The HWRM command request type. */
44135 	uint16_t	req_type;
44136 	/*
44137 	 * The completion ring to send the completion event on. This should
44138 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
44139 	 */
44140 	uint16_t	cmpl_ring;
44141 	/*
44142 	 * The sequence ID is used by the driver for tracking multiple
44143 	 * commands. This ID is treated as opaque data by the firmware and
44144 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
44145 	 */
44146 	uint16_t	seq_id;
44147 	/*
44148 	 * The target ID of the command:
44149 	 * * 0x0-0xFFF8 - The function ID
44150 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44151 	 * * 0xFFFD - Reserved for user-space HWRM interface
44152 	 * * 0xFFFF - HWRM
44153 	 */
44154 	uint16_t	target_id;
44155 	/*
44156 	 * A physical address pointer pointing to a host buffer that the
44157 	 * command's response data will be written. This can be either a host
44158 	 * physical address (HPA) or a guest physical address (GPA) and must
44159 	 * point to a physically contiguous block of memory.
44160 	 */
44161 	uint64_t	resp_addr;
44162 	/*
44163 	 * This value identifies the CR associated with the ring
44164 	 * group.
44165 	 */
44166 	uint16_t	cr;
44167 	/*
44168 	 * This value identifies the main RR associated with the ring
44169 	 * group.
44170 	 */
44171 	uint16_t	rr;
44172 	/*
44173 	 * This value identifies the aggregation RR associated with
44174 	 * the ring group. If this value is 0xFF... (All Fs), then no
44175 	 * Aggregation ring will be set.
44176 	 */
44177 	uint16_t	ar;
44178 	/*
44179 	 * This value identifies the statistics context associated
44180 	 * with the ring group.
44181 	 */
44182 	uint16_t	sc;
44183 } hwrm_ring_grp_alloc_input_t, *phwrm_ring_grp_alloc_input_t;
44184 
44185 /* hwrm_ring_grp_alloc_output (size:128b/16B) */
44186 
44187 typedef struct hwrm_ring_grp_alloc_output {
44188 	/* The specific error status for the command. */
44189 	uint16_t	error_code;
44190 	/* The HWRM command request type. */
44191 	uint16_t	req_type;
44192 	/* The sequence ID from the original command. */
44193 	uint16_t	seq_id;
44194 	/* The length of the response data in number of bytes. */
44195 	uint16_t	resp_len;
44196 	/*
44197 	 * This is the ring group ID value. Use this value to program
44198 	 * the default ring group for the VNIC or as table entries
44199 	 * in an RSS/COS context.
44200 	 */
44201 	uint32_t	ring_group_id;
44202 	uint8_t	unused_0[3];
44203 	/*
44204 	 * This field is used in Output records to indicate that the output
44205 	 * is completely written to RAM. This field should be read as '1'
44206 	 * to indicate that the output has been completely written. When
44207 	 * writing a command completion or response to an internal processor,
44208 	 * the order of writes has to be such that this field is written last.
44209 	 */
44210 	uint8_t	valid;
44211 } hwrm_ring_grp_alloc_output_t, *phwrm_ring_grp_alloc_output_t;
44212 
44213 /**********************
44214  * hwrm_ring_grp_free *
44215  **********************/
44216 
44217 
44218 /* hwrm_ring_grp_free_input (size:192b/24B) */
44219 
44220 typedef struct hwrm_ring_grp_free_input {
44221 	/* The HWRM command request type. */
44222 	uint16_t	req_type;
44223 	/*
44224 	 * The completion ring to send the completion event on. This should
44225 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
44226 	 */
44227 	uint16_t	cmpl_ring;
44228 	/*
44229 	 * The sequence ID is used by the driver for tracking multiple
44230 	 * commands. This ID is treated as opaque data by the firmware and
44231 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
44232 	 */
44233 	uint16_t	seq_id;
44234 	/*
44235 	 * The target ID of the command:
44236 	 * * 0x0-0xFFF8 - The function ID
44237 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44238 	 * * 0xFFFD - Reserved for user-space HWRM interface
44239 	 * * 0xFFFF - HWRM
44240 	 */
44241 	uint16_t	target_id;
44242 	/*
44243 	 * A physical address pointer pointing to a host buffer that the
44244 	 * command's response data will be written. This can be either a host
44245 	 * physical address (HPA) or a guest physical address (GPA) and must
44246 	 * point to a physically contiguous block of memory.
44247 	 */
44248 	uint64_t	resp_addr;
44249 	/* This is the ring group ID value. */
44250 	uint32_t	ring_group_id;
44251 	uint8_t	unused_0[4];
44252 } hwrm_ring_grp_free_input_t, *phwrm_ring_grp_free_input_t;
44253 
44254 /* hwrm_ring_grp_free_output (size:128b/16B) */
44255 
44256 typedef struct hwrm_ring_grp_free_output {
44257 	/* The specific error status for the command. */
44258 	uint16_t	error_code;
44259 	/* The HWRM command request type. */
44260 	uint16_t	req_type;
44261 	/* The sequence ID from the original command. */
44262 	uint16_t	seq_id;
44263 	/* The length of the response data in number of bytes. */
44264 	uint16_t	resp_len;
44265 	uint8_t	unused_0[7];
44266 	/*
44267 	 * This field is used in Output records to indicate that the output
44268 	 * is completely written to RAM. This field should be read as '1'
44269 	 * to indicate that the output has been completely written. When
44270 	 * writing a command completion or response to an internal processor,
44271 	 * the order of writes has to be such that this field is written last.
44272 	 */
44273 	uint8_t	valid;
44274 } hwrm_ring_grp_free_output_t, *phwrm_ring_grp_free_output_t;
44275 
44276 /************************
44277  * hwrm_ring_schq_alloc *
44278  ************************/
44279 
44280 
44281 /* hwrm_ring_schq_alloc_input (size:1088b/136B) */
44282 
44283 typedef struct hwrm_ring_schq_alloc_input {
44284 	/* The HWRM command request type. */
44285 	uint16_t	req_type;
44286 	/*
44287 	 * The completion ring to send the completion event on. This should
44288 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
44289 	 */
44290 	uint16_t	cmpl_ring;
44291 	/*
44292 	 * The sequence ID is used by the driver for tracking multiple
44293 	 * commands. This ID is treated as opaque data by the firmware and
44294 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
44295 	 */
44296 	uint16_t	seq_id;
44297 	/*
44298 	 * The target ID of the command:
44299 	 * * 0x0-0xFFF8 - The function ID
44300 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44301 	 * * 0xFFFD - Reserved for user-space HWRM interface
44302 	 * * 0xFFFF - HWRM
44303 	 */
44304 	uint16_t	target_id;
44305 	/*
44306 	 * A physical address pointer pointing to a host buffer that the
44307 	 * command's response data will be written. This can be either a host
44308 	 * physical address (HPA) or a guest physical address (GPA) and must
44309 	 * point to a physically contiguous block of memory.
44310 	 */
44311 	uint64_t	resp_addr;
44312 	uint32_t	enables;
44313 	/*
44314 	 * This bit must be '1' for the tqm_ring0 fields to be
44315 	 * configured.
44316 	 */
44317 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING0	UINT32_C(0x1)
44318 	/*
44319 	 * This bit must be '1' for the tqm_ring1 fields to be
44320 	 * configured.
44321 	 */
44322 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING1	UINT32_C(0x2)
44323 	/*
44324 	 * This bit must be '1' for the tqm_ring2 fields to be
44325 	 * configured.
44326 	 */
44327 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING2	UINT32_C(0x4)
44328 	/*
44329 	 * This bit must be '1' for the tqm_ring3 fields to be
44330 	 * configured.
44331 	 */
44332 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING3	UINT32_C(0x8)
44333 	/*
44334 	 * This bit must be '1' for the tqm_ring4 fields to be
44335 	 * configured.
44336 	 */
44337 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING4	UINT32_C(0x10)
44338 	/*
44339 	 * This bit must be '1' for the tqm_ring5 fields to be
44340 	 * configured.
44341 	 */
44342 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING5	UINT32_C(0x20)
44343 	/*
44344 	 * This bit must be '1' for the tqm_ring6 fields to be
44345 	 * configured.
44346 	 */
44347 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING6	UINT32_C(0x40)
44348 	/*
44349 	 * This bit must be '1' for the tqm_ring7 fields to be
44350 	 * configured.
44351 	 */
44352 	#define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING7	UINT32_C(0x80)
44353 	/* Reserved for future use. */
44354 	uint32_t	reserved;
44355 	/* TQM ring 0 page size and level. */
44356 	uint8_t	tqm_ring0_pg_size_tqm_ring0_lvl;
44357 	/* TQM ring 0 PBL indirect levels. */
44358 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_MASK	UINT32_C(0xf)
44359 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_SFT	0
44360 	/* PBL pointer is physical start address. */
44361 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_0	UINT32_C(0x0)
44362 	/* PBL pointer points to PTE table. */
44363 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_1	UINT32_C(0x1)
44364 	/*
44365 	 * PBL pointer points to PDE table with each entry pointing to PTE
44366 	 * tables.
44367 	 */
44368 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_2	UINT32_C(0x2)
44369 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_2
44370 	/* TQM ring 0 page size. */
44371 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_MASK  UINT32_C(0xf0)
44372 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_SFT   4
44373 	/* 4KB. */
44374 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
44375 	/* 8KB. */
44376 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
44377 	/* 64KB. */
44378 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
44379 	/* 2MB. */
44380 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
44381 	/* 8MB. */
44382 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
44383 	/* 1GB. */
44384 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
44385 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_1G
44386 	/* TQM ring 1 page size and level. */
44387 	uint8_t	tqm_ring1_pg_size_tqm_ring1_lvl;
44388 	/* TQM ring 1 PBL indirect levels. */
44389 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_MASK	UINT32_C(0xf)
44390 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_SFT	0
44391 	/* PBL pointer is physical start address. */
44392 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_0	UINT32_C(0x0)
44393 	/* PBL pointer points to PTE table. */
44394 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_1	UINT32_C(0x1)
44395 	/*
44396 	 * PBL pointer points to PDE table with each entry pointing to PTE
44397 	 * tables.
44398 	 */
44399 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_2	UINT32_C(0x2)
44400 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_2
44401 	/* TQM ring 1 page size. */
44402 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_MASK  UINT32_C(0xf0)
44403 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_SFT   4
44404 	/* 4KB. */
44405 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
44406 	/* 8KB. */
44407 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
44408 	/* 64KB. */
44409 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
44410 	/* 2MB. */
44411 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
44412 	/* 8MB. */
44413 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
44414 	/* 1GB. */
44415 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
44416 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_1G
44417 	/* TQM ring 2 page size and level. */
44418 	uint8_t	tqm_ring2_pg_size_tqm_ring2_lvl;
44419 	/* TQM ring 2 PBL indirect levels. */
44420 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_MASK	UINT32_C(0xf)
44421 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_SFT	0
44422 	/* PBL pointer is physical start address. */
44423 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_0	UINT32_C(0x0)
44424 	/* PBL pointer points to PTE table. */
44425 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_1	UINT32_C(0x1)
44426 	/*
44427 	 * PBL pointer points to PDE table with each entry pointing to PTE
44428 	 * tables.
44429 	 */
44430 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_2	UINT32_C(0x2)
44431 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_2
44432 	/* TQM ring 2 page size. */
44433 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_MASK  UINT32_C(0xf0)
44434 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_SFT   4
44435 	/* 4KB. */
44436 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
44437 	/* 8KB. */
44438 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
44439 	/* 64KB. */
44440 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
44441 	/* 2MB. */
44442 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
44443 	/* 8MB. */
44444 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
44445 	/* 1GB. */
44446 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
44447 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_1G
44448 	/* TQM ring 3 page size and level. */
44449 	uint8_t	tqm_ring3_pg_size_tqm_ring3_lvl;
44450 	/* TQM ring 3 PBL indirect levels. */
44451 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_MASK	UINT32_C(0xf)
44452 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_SFT	0
44453 	/* PBL pointer is physical start address. */
44454 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_0	UINT32_C(0x0)
44455 	/* PBL pointer points to PTE table. */
44456 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_1	UINT32_C(0x1)
44457 	/*
44458 	 * PBL pointer points to PDE table with each entry pointing to PTE
44459 	 * tables.
44460 	 */
44461 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_2	UINT32_C(0x2)
44462 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_2
44463 	/* TQM ring 3 page size. */
44464 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_MASK  UINT32_C(0xf0)
44465 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_SFT   4
44466 	/* 4KB. */
44467 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
44468 	/* 8KB. */
44469 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
44470 	/* 64KB. */
44471 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
44472 	/* 2MB. */
44473 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
44474 	/* 8MB. */
44475 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
44476 	/* 1GB. */
44477 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
44478 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_1G
44479 	/* TQM ring 4 page size and level. */
44480 	uint8_t	tqm_ring4_pg_size_tqm_ring4_lvl;
44481 	/* TQM ring 4 PBL indirect levels. */
44482 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_MASK	UINT32_C(0xf)
44483 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_SFT	0
44484 	/* PBL pointer is physical start address. */
44485 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_0	UINT32_C(0x0)
44486 	/* PBL pointer points to PTE table. */
44487 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_1	UINT32_C(0x1)
44488 	/*
44489 	 * PBL pointer points to PDE table with each entry pointing to PTE
44490 	 * tables.
44491 	 */
44492 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_2	UINT32_C(0x2)
44493 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_2
44494 	/* TQM ring 4 page size. */
44495 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_MASK  UINT32_C(0xf0)
44496 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_SFT   4
44497 	/* 4KB. */
44498 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
44499 	/* 8KB. */
44500 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
44501 	/* 64KB. */
44502 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
44503 	/* 2MB. */
44504 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
44505 	/* 8MB. */
44506 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
44507 	/* 1GB. */
44508 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
44509 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_1G
44510 	/* TQM ring 5 page size and level. */
44511 	uint8_t	tqm_ring5_pg_size_tqm_ring5_lvl;
44512 	/* TQM ring 5 PBL indirect levels. */
44513 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_MASK	UINT32_C(0xf)
44514 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_SFT	0
44515 	/* PBL pointer is physical start address. */
44516 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_0	UINT32_C(0x0)
44517 	/* PBL pointer points to PTE table. */
44518 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_1	UINT32_C(0x1)
44519 	/*
44520 	 * PBL pointer points to PDE table with each entry pointing to PTE
44521 	 * tables.
44522 	 */
44523 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_2	UINT32_C(0x2)
44524 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_2
44525 	/* TQM ring 5 page size. */
44526 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_MASK  UINT32_C(0xf0)
44527 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_SFT   4
44528 	/* 4KB. */
44529 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
44530 	/* 8KB. */
44531 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
44532 	/* 64KB. */
44533 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
44534 	/* 2MB. */
44535 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
44536 	/* 8MB. */
44537 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
44538 	/* 1GB. */
44539 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
44540 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_1G
44541 	/* TQM ring 6 page size and level. */
44542 	uint8_t	tqm_ring6_pg_size_tqm_ring6_lvl;
44543 	/* TQM ring 6 PBL indirect levels. */
44544 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_MASK	UINT32_C(0xf)
44545 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_SFT	0
44546 	/* PBL pointer is physical start address. */
44547 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_0	UINT32_C(0x0)
44548 	/* PBL pointer points to PTE table. */
44549 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_1	UINT32_C(0x1)
44550 	/*
44551 	 * PBL pointer points to PDE table with each entry pointing to PTE
44552 	 * tables.
44553 	 */
44554 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_2	UINT32_C(0x2)
44555 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_2
44556 	/* TQM ring 6 page size. */
44557 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_MASK  UINT32_C(0xf0)
44558 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_SFT   4
44559 	/* 4KB. */
44560 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
44561 	/* 8KB. */
44562 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
44563 	/* 64KB. */
44564 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
44565 	/* 2MB. */
44566 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
44567 	/* 8MB. */
44568 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
44569 	/* 1GB. */
44570 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
44571 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_1G
44572 	/* TQM ring 7 page size and level. */
44573 	uint8_t	tqm_ring7_pg_size_tqm_ring7_lvl;
44574 	/* TQM ring 7 PBL indirect levels. */
44575 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_MASK	UINT32_C(0xf)
44576 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_SFT	0
44577 	/* PBL pointer is physical start address. */
44578 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_0	UINT32_C(0x0)
44579 	/* PBL pointer points to PTE table. */
44580 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_1	UINT32_C(0x1)
44581 	/*
44582 	 * PBL pointer points to PDE table with each entry pointing to PTE
44583 	 * tables.
44584 	 */
44585 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_2	UINT32_C(0x2)
44586 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LAST	HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_2
44587 	/* TQM ring 7 page size. */
44588 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_MASK  UINT32_C(0xf0)
44589 	#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_SFT   4
44590 	/* 4KB. */
44591 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
44592 	/* 8KB. */
44593 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
44594 	/* 64KB. */
44595 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
44596 	/* 2MB. */
44597 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
44598 	/* 8MB. */
44599 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
44600 	/* 1GB. */
44601 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
44602 		#define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_LAST   HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_1G
44603 	/* TQM ring 0 page directory. */
44604 	uint64_t	tqm_ring0_page_dir;
44605 	/* TQM ring 1 page directory. */
44606 	uint64_t	tqm_ring1_page_dir;
44607 	/* TQM ring 2 page directory. */
44608 	uint64_t	tqm_ring2_page_dir;
44609 	/* TQM ring 3 page directory. */
44610 	uint64_t	tqm_ring3_page_dir;
44611 	/* TQM ring 4 page directory. */
44612 	uint64_t	tqm_ring4_page_dir;
44613 	/* TQM ring 5 page directory. */
44614 	uint64_t	tqm_ring5_page_dir;
44615 	/* TQM ring 6 page directory. */
44616 	uint64_t	tqm_ring6_page_dir;
44617 	/* TQM ring 7 page directory. */
44618 	uint64_t	tqm_ring7_page_dir;
44619 	/*
44620 	 * Number of TQM ring 0 entries.
44621 	 *
44622 	 * TQM fastpath rings should be sized large enough to accommodate the
44623 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
44624 	 * that can be enqueued to the TQM ring.
44625 	 *
44626 	 * Note that TQM ring sizes cannot be extended while the system is
44627 	 * operational. If a PF driver needs to extend a TQM ring, it needs
44628 	 * to delete the SCHQ and then reallocate it.
44629 	 */
44630 	uint32_t	tqm_ring0_num_entries;
44631 	/*
44632 	 * Number of TQM ring 1 entries.
44633 	 *
44634 	 * TQM fastpath rings should be sized large enough to accommodate the
44635 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
44636 	 * that can be enqueued to the TQM ring.
44637 	 *
44638 	 * Note that TQM ring sizes cannot be extended while the system is
44639 	 * operational. If a PF driver needs to extend a TQM ring, it needs
44640 	 * to delete the SCHQ and then reallocate it.
44641 	 */
44642 	uint32_t	tqm_ring1_num_entries;
44643 	/*
44644 	 * Number of TQM ring 2 entries.
44645 	 *
44646 	 * TQM fastpath rings should be sized large enough to accommodate the
44647 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
44648 	 * that can be enqueued to the TQM ring.
44649 	 *
44650 	 * Note that TQM ring sizes cannot be extended while the system is
44651 	 * operational. If a PF driver needs to extend a TQM ring, it needs
44652 	 * to delete the SCHQ and then reallocate it.
44653 	 */
44654 	uint32_t	tqm_ring2_num_entries;
44655 	/*
44656 	 * Number of TQM ring 3 entries.
44657 	 *
44658 	 * TQM fastpath rings should be sized large enough to accommodate the
44659 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
44660 	 * that can be enqueued to the TQM ring.
44661 	 *
44662 	 * Note that TQM ring sizes cannot be extended while the system is
44663 	 * operational. If a PF driver needs to extend a TQM ring, it needs
44664 	 * to delete the SCHQ and then reallocate it.
44665 	 */
44666 	uint32_t	tqm_ring3_num_entries;
44667 	/*
44668 	 * Number of TQM ring 4 entries.
44669 	 *
44670 	 * TQM fastpath rings should be sized large enough to accommodate the
44671 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
44672 	 * that can be enqueued to the TQM ring.
44673 	 *
44674 	 * Note that TQM ring sizes cannot be extended while the system is
44675 	 * operational. If a PF driver needs to extend a TQM ring, it needs
44676 	 * to delete the SCHQ and then reallocate it.
44677 	 */
44678 	uint32_t	tqm_ring4_num_entries;
44679 	/*
44680 	 * Number of TQM ring 5 entries.
44681 	 *
44682 	 * TQM fastpath rings should be sized large enough to accommodate the
44683 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
44684 	 * that can be enqueued to the TQM ring.
44685 	 *
44686 	 * Note that TQM ring sizes cannot be extended while the system is
44687 	 * operational. If a PF driver needs to extend a TQM ring, it needs
44688 	 * to delete the SCHQ and then reallocate it.
44689 	 */
44690 	uint32_t	tqm_ring5_num_entries;
44691 	/*
44692 	 * Number of TQM ring 6 entries.
44693 	 *
44694 	 * TQM fastpath rings should be sized large enough to accommodate the
44695 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
44696 	 * that can be enqueued to the TQM ring.
44697 	 *
44698 	 * Note that TQM ring sizes cannot be extended while the system is
44699 	 * operational. If a PF driver needs to extend a TQM ring, it needs
44700 	 * to delete the SCHQ and then reallocate it.
44701 	 */
44702 	uint32_t	tqm_ring6_num_entries;
44703 	/*
44704 	 * Number of TQM ring 7 entries.
44705 	 *
44706 	 * TQM fastpath rings should be sized large enough to accommodate the
44707 	 * maximum number of QPs (either L2 or RoCE, or both if shared)
44708 	 * that can be enqueued to the TQM ring.
44709 	 *
44710 	 * Note that TQM ring sizes cannot be extended while the system is
44711 	 * operational. If a PF driver needs to extend a TQM ring, it needs
44712 	 * to delete the SCHQ and then reallocate it.
44713 	 */
44714 	uint32_t	tqm_ring7_num_entries;
44715 	/* Number of bytes that have been allocated for each context entry. */
44716 	uint16_t	tqm_entry_size;
44717 	uint8_t	unused_0[6];
44718 } hwrm_ring_schq_alloc_input_t, *phwrm_ring_schq_alloc_input_t;
44719 
44720 /* hwrm_ring_schq_alloc_output (size:128b/16B) */
44721 
44722 typedef struct hwrm_ring_schq_alloc_output {
44723 	/* The specific error status for the command. */
44724 	uint16_t	error_code;
44725 	/* The HWRM command request type. */
44726 	uint16_t	req_type;
44727 	/* The sequence ID from the original command. */
44728 	uint16_t	seq_id;
44729 	/* The length of the response data in number of bytes. */
44730 	uint16_t	resp_len;
44731 	/*
44732 	 * This is an identifier for the SCHQ to be used in other HWRM commands
44733 	 * that need to reference this SCHQ. This value is greater than zero
44734 	 * (i.e. a schq_id of zero references the default SCHQ).
44735 	 */
44736 	uint16_t	schq_id;
44737 	uint8_t	unused_0[5];
44738 	/*
44739 	 * This field is used in Output records to indicate that the output
44740 	 * is completely written to RAM. This field should be read as '1'
44741 	 * to indicate that the output has been completely written. When
44742 	 * writing a command completion or response to an internal processor,
44743 	 * the order of writes has to be such that this field is written last.
44744 	 */
44745 	uint8_t	valid;
44746 } hwrm_ring_schq_alloc_output_t, *phwrm_ring_schq_alloc_output_t;
44747 
44748 /**********************
44749  * hwrm_ring_schq_cfg *
44750  **********************/
44751 
44752 
44753 /* hwrm_ring_schq_cfg_input (size:768b/96B) */
44754 
44755 typedef struct hwrm_ring_schq_cfg_input {
44756 	/* The HWRM command request type. */
44757 	uint16_t	req_type;
44758 	/*
44759 	 * The completion ring to send the completion event on. This should
44760 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
44761 	 */
44762 	uint16_t	cmpl_ring;
44763 	/*
44764 	 * The sequence ID is used by the driver for tracking multiple
44765 	 * commands. This ID is treated as opaque data by the firmware and
44766 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
44767 	 */
44768 	uint16_t	seq_id;
44769 	/*
44770 	 * The target ID of the command:
44771 	 * * 0x0-0xFFF8 - The function ID
44772 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44773 	 * * 0xFFFD - Reserved for user-space HWRM interface
44774 	 * * 0xFFFF - HWRM
44775 	 */
44776 	uint16_t	target_id;
44777 	/*
44778 	 * A physical address pointer pointing to a host buffer that the
44779 	 * command's response data will be written. This can be either a host
44780 	 * physical address (HPA) or a guest physical address (GPA) and must
44781 	 * point to a physically contiguous block of memory.
44782 	 */
44783 	uint64_t	resp_addr;
44784 	/*
44785 	 * Identifies the SCHQ being configured. A schq_id of zero refers to
44786 	 * the default SCHQ.
44787 	 */
44788 	uint16_t	schq_id;
44789 	/*
44790 	 * This field is an 8 bit bitmap that indicates which TCs are enabled
44791 	 * in this SCHQ. Bit 0 represents traffic class 0 and bit 7 represents
44792 	 * traffic class 7.
44793 	 */
44794 	uint8_t	tc_enabled;
44795 	uint8_t	unused_0;
44796 	uint32_t	flags;
44797 	/* The tc_max_bw array and the max_bw parameters are valid */
44798 	#define HWRM_RING_SCHQ_CFG_INPUT_FLAGS_TC_MAX_BW_ENABLED	UINT32_C(0x1)
44799 	/* The tc_bw_reservation array is valid */
44800 	#define HWRM_RING_SCHQ_CFG_INPUT_FLAGS_TC_RESERVATION_ENABLED	UINT32_C(0x2)
44801 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
44802 	uint32_t	max_bw_tc0;
44803 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
44804 	uint32_t	max_bw_tc1;
44805 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
44806 	uint32_t	max_bw_tc2;
44807 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
44808 	uint32_t	max_bw_tc3;
44809 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
44810 	uint32_t	max_bw_tc4;
44811 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
44812 	uint32_t	max_bw_tc5;
44813 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
44814 	uint32_t	max_bw_tc6;
44815 	/* Maximum bandwidth of the traffic class, specified in Mbps. */
44816 	uint32_t	max_bw_tc7;
44817 	/*
44818 	 * Bandwidth reservation for the traffic class, specified in percent.
44819 	 * A value of zero signifies that traffic belonging to this class
44820 	 * shares the bandwidth reservation for the same traffic class of
44821 	 * the default SCHQ.
44822 	 */
44823 	uint32_t	tc_bw_reservation0;
44824 	/*
44825 	 * Bandwidth reservation for the traffic class, specified in percent.
44826 	 * A value of zero signifies that traffic belonging to this class
44827 	 * shares the bandwidth reservation for the same traffic class of
44828 	 * the default SCHQ.
44829 	 */
44830 	uint32_t	tc_bw_reservation1;
44831 	/*
44832 	 * Bandwidth reservation for the traffic class, specified in percent.
44833 	 * A value of zero signifies that traffic belonging to this class
44834 	 * shares the bandwidth reservation for the same traffic class of
44835 	 * the default SCHQ.
44836 	 */
44837 	uint32_t	tc_bw_reservation2;
44838 	/*
44839 	 * Bandwidth reservation for the traffic class, specified in percent.
44840 	 * A value of zero signifies that traffic belonging to this class
44841 	 * shares the bandwidth reservation for the same traffic class of
44842 	 * the default SCHQ.
44843 	 */
44844 	uint32_t	tc_bw_reservation3;
44845 	/*
44846 	 * Bandwidth reservation for the traffic class, specified in percent.
44847 	 * A value of zero signifies that traffic belonging to this class
44848 	 * shares the bandwidth reservation for the same traffic class of
44849 	 * the default SCHQ.
44850 	 */
44851 	uint32_t	tc_bw_reservation4;
44852 	/*
44853 	 * Bandwidth reservation for the traffic class, specified in percent.
44854 	 * A value of zero signifies that traffic belonging to this class
44855 	 * shares the bandwidth reservation for the same traffic class of
44856 	 * the default SCHQ.
44857 	 */
44858 	uint32_t	tc_bw_reservation5;
44859 	/*
44860 	 * Bandwidth reservation for the traffic class, specified in percent.
44861 	 * A value of zero signifies that traffic belonging to this class
44862 	 * shares the bandwidth reservation for the same traffic class of
44863 	 * the default SCHQ.
44864 	 */
44865 	uint32_t	tc_bw_reservation6;
44866 	/*
44867 	 * Bandwidth reservation for the traffic class, specified in percent.
44868 	 * A value of zero signifies that traffic belonging to this class
44869 	 * shares the bandwidth reservation for the same traffic class of
44870 	 * the default SCHQ.
44871 	 */
44872 	uint32_t	tc_bw_reservation7;
44873 	/*
44874 	 * Indicates the max bandwidth for all enabled traffic classes in
44875 	 * this SCHQ, specified in Mbps.
44876 	 */
44877 	uint32_t	max_bw;
44878 	uint8_t	unused_1[4];
44879 } hwrm_ring_schq_cfg_input_t, *phwrm_ring_schq_cfg_input_t;
44880 
44881 /* hwrm_ring_schq_cfg_output (size:128b/16B) */
44882 
44883 typedef struct hwrm_ring_schq_cfg_output {
44884 	/* The specific error status for the command. */
44885 	uint16_t	error_code;
44886 	/* The HWRM command request type. */
44887 	uint16_t	req_type;
44888 	/* The sequence ID from the original command. */
44889 	uint16_t	seq_id;
44890 	/* The length of the response data in number of bytes. */
44891 	uint16_t	resp_len;
44892 	uint8_t	unused_0[7];
44893 	/*
44894 	 * This field is used in Output records to indicate that the output
44895 	 * is completely written to RAM. This field should be read as '1'
44896 	 * to indicate that the output has been completely written. When
44897 	 * writing a command completion or response to an internal processor,
44898 	 * the order of writes has to be such that this field is written last.
44899 	 */
44900 	uint8_t	valid;
44901 } hwrm_ring_schq_cfg_output_t, *phwrm_ring_schq_cfg_output_t;
44902 
44903 /***********************
44904  * hwrm_ring_schq_free *
44905  ***********************/
44906 
44907 
44908 /* hwrm_ring_schq_free_input (size:192b/24B) */
44909 
44910 typedef struct hwrm_ring_schq_free_input {
44911 	/* The HWRM command request type. */
44912 	uint16_t	req_type;
44913 	/*
44914 	 * The completion ring to send the completion event on. This should
44915 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
44916 	 */
44917 	uint16_t	cmpl_ring;
44918 	/*
44919 	 * The sequence ID is used by the driver for tracking multiple
44920 	 * commands. This ID is treated as opaque data by the firmware and
44921 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
44922 	 */
44923 	uint16_t	seq_id;
44924 	/*
44925 	 * The target ID of the command:
44926 	 * * 0x0-0xFFF8 - The function ID
44927 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44928 	 * * 0xFFFD - Reserved for user-space HWRM interface
44929 	 * * 0xFFFF - HWRM
44930 	 */
44931 	uint16_t	target_id;
44932 	/*
44933 	 * A physical address pointer pointing to a host buffer that the
44934 	 * command's response data will be written. This can be either a host
44935 	 * physical address (HPA) or a guest physical address (GPA) and must
44936 	 * point to a physically contiguous block of memory.
44937 	 */
44938 	uint64_t	resp_addr;
44939 	/* Identifies the SCHQ being freed. */
44940 	uint16_t	schq_id;
44941 	uint8_t	unused_0[6];
44942 } hwrm_ring_schq_free_input_t, *phwrm_ring_schq_free_input_t;
44943 
44944 /* hwrm_ring_schq_free_output (size:128b/16B) */
44945 
44946 typedef struct hwrm_ring_schq_free_output {
44947 	/* The specific error status for the command. */
44948 	uint16_t	error_code;
44949 	/* The HWRM command request type. */
44950 	uint16_t	req_type;
44951 	/* The sequence ID from the original command. */
44952 	uint16_t	seq_id;
44953 	/* The length of the response data in number of bytes. */
44954 	uint16_t	resp_len;
44955 	uint8_t	unused_0[7];
44956 	/*
44957 	 * This field is used in Output records to indicate that the output
44958 	 * is completely written to RAM. This field should be read as '1'
44959 	 * to indicate that the output has been completely written. When
44960 	 * writing a command completion or response to an internal processor,
44961 	 * the order of writes has to be such that this field is written last.
44962 	 */
44963 	uint8_t	valid;
44964 } hwrm_ring_schq_free_output_t, *phwrm_ring_schq_free_output_t;
44965 
44966 /*
44967  * special reserved flow ID to identify per function default
44968  * flows for vSwitch offload
44969  */
44970 #define DEFAULT_FLOW_ID 0xFFFFFFFFUL
44971 /*
44972  * special reserved flow ID to identify per function RoCEv1
44973  * flows
44974  */
44975 #define ROCEV1_FLOW_ID 0xFFFFFFFEUL
44976 /*
44977  * special reserved flow ID to identify per function RoCEv2
44978  * flows
44979  */
44980 #define ROCEV2_FLOW_ID 0xFFFFFFFDUL
44981 /*
44982  * special reserved flow ID to identify per function RoCEv2
44983  * CNP flows
44984  */
44985 #define ROCEV2_CNP_FLOW_ID 0xFFFFFFFCUL
44986 
44987 /****************************
44988  * hwrm_cfa_l2_filter_alloc *
44989  ****************************/
44990 
44991 
44992 /* hwrm_cfa_l2_filter_alloc_input (size:768b/96B) */
44993 
44994 typedef struct hwrm_cfa_l2_filter_alloc_input {
44995 	/* The HWRM command request type. */
44996 	uint16_t	req_type;
44997 	/*
44998 	 * The completion ring to send the completion event on. This should
44999 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45000 	 */
45001 	uint16_t	cmpl_ring;
45002 	/*
45003 	 * The sequence ID is used by the driver for tracking multiple
45004 	 * commands. This ID is treated as opaque data by the firmware and
45005 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45006 	 */
45007 	uint16_t	seq_id;
45008 	/*
45009 	 * The target ID of the command:
45010 	 * * 0x0-0xFFF8 - The function ID
45011 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45012 	 * * 0xFFFD - Reserved for user-space HWRM interface
45013 	 * * 0xFFFF - HWRM
45014 	 */
45015 	uint16_t	target_id;
45016 	/*
45017 	 * A physical address pointer pointing to a host buffer that the
45018 	 * command's response data will be written. This can be either a host
45019 	 * physical address (HPA) or a guest physical address (GPA) and must
45020 	 * point to a physically contiguous block of memory.
45021 	 */
45022 	uint64_t	resp_addr;
45023 	uint32_t	flags;
45024 	/*
45025 	 * Enumeration denoting the RX, TX type of the resource.
45026 	 * This enumeration is used for resources that are similar for both
45027 	 * TX and RX paths of the chip.
45028 	 */
45029 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH		UINT32_C(0x1)
45030 	/* tx path */
45031 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX		UINT32_C(0x0)
45032 	/* rx path */
45033 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX		UINT32_C(0x1)
45034 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST	HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
45035 	/*
45036 	 * Setting of this flag indicates the applicability to the loopback
45037 	 * path.
45038 	 */
45039 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK	UINT32_C(0x2)
45040 	/*
45041 	 * Setting of this flag indicates drop action. If this flag is not
45042 	 * set, then it should be considered accept action.
45043 	 */
45044 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP		UINT32_C(0x4)
45045 	/*
45046 	 * If this flag is set, all t_l2_* fields are invalid
45047 	 * and they should not be specified.
45048 	 * If this flag is set, then l2_* fields refer to
45049 	 * fields of outermost L2 header.
45050 	 */
45051 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST	UINT32_C(0x8)
45052 	/*
45053 	 * Enumeration denoting NO_ROCE_L2 to support old drivers.
45054 	 * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
45055 	 */
45056 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_MASK	UINT32_C(0x30)
45057 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_SFT	4
45058 	/* To support old drivers */
45059 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2  (UINT32_C(0x0) << 4)
45060 	/* Only L2 traffic */
45061 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_L2	(UINT32_C(0x1) << 4)
45062 	/* Roce & L2 traffic */
45063 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE	(UINT32_C(0x2) << 4)
45064 		#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_LAST	HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE
45065 	/*
45066 	 * Setting of this flag indicates that no XDP filter is created with
45067 	 * L2 filter.
45068 	 * 0 - legacy behavior, XDP filter is created with L2 filter
45069 	 * 1 - XDP filter won't be created with L2 filter
45070 	 */
45071 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_XDP_DISABLE	UINT32_C(0x40)
45072 	/*
45073 	 * Setting this flag to 1 indicate the L2 fields in this command
45074 	 * pertain to source fields. Setting this flag to 0 indicate the
45075 	 * L2 fields in this command pertain to the destination fields
45076 	 * and this is the default/legacy behavior.
45077 	 */
45078 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_SOURCE_VALID	UINT32_C(0x80)
45079 	uint32_t	enables;
45080 	/*
45081 	 * This bit must be '1' for the l2_addr field to be
45082 	 * configured.
45083 	 */
45084 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR		UINT32_C(0x1)
45085 	/*
45086 	 * This bit must be '1' for the l2_addr_mask field to be
45087 	 * configured.
45088 	 */
45089 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK	UINT32_C(0x2)
45090 	/*
45091 	 * This bit must be '1' for the l2_ovlan field to be
45092 	 * configured.
45093 	 */
45094 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN		UINT32_C(0x4)
45095 	/*
45096 	 * This bit must be '1' for the l2_ovlan_mask field to be
45097 	 * configured.
45098 	 */
45099 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK	UINT32_C(0x8)
45100 	/*
45101 	 * This bit must be '1' for the l2_ivlan field to be
45102 	 * configured.
45103 	 */
45104 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN		UINT32_C(0x10)
45105 	/*
45106 	 * This bit must be '1' for the l2_ivlan_mask field to be
45107 	 * configured.
45108 	 */
45109 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK	UINT32_C(0x20)
45110 	/*
45111 	 * This bit must be '1' for the t_l2_addr field to be
45112 	 * configured.
45113 	 */
45114 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR	UINT32_C(0x40)
45115 	/*
45116 	 * This bit must be '1' for the t_l2_addr_mask field to be
45117 	 * configured.
45118 	 */
45119 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK	UINT32_C(0x80)
45120 	/*
45121 	 * This bit must be '1' for the t_l2_ovlan field to be
45122 	 * configured.
45123 	 */
45124 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN	UINT32_C(0x100)
45125 	/*
45126 	 * This bit must be '1' for the t_l2_ovlan_mask field to be
45127 	 * configured.
45128 	 */
45129 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK	UINT32_C(0x200)
45130 	/*
45131 	 * This bit must be '1' for the t_l2_ivlan field to be
45132 	 * configured.
45133 	 */
45134 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN	UINT32_C(0x400)
45135 	/*
45136 	 * This bit must be '1' for the t_l2_ivlan_mask field to be
45137 	 * configured.
45138 	 */
45139 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK	UINT32_C(0x800)
45140 	/*
45141 	 * This bit must be '1' for the src_type field to be
45142 	 * configured.
45143 	 */
45144 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE		UINT32_C(0x1000)
45145 	/*
45146 	 * This bit must be '1' for the src_id field to be
45147 	 * configured.
45148 	 */
45149 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID		UINT32_C(0x2000)
45150 	/*
45151 	 * This bit must be '1' for the tunnel_type field to be
45152 	 * configured.
45153 	 */
45154 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE	UINT32_C(0x4000)
45155 	/*
45156 	 * This bit must be '1' for the dst_id field to be
45157 	 * configured.
45158 	 */
45159 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID		UINT32_C(0x8000)
45160 	/*
45161 	 * This bit must be '1' for the mirror_vnic_id field to be
45162 	 * configured.
45163 	 */
45164 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID	UINT32_C(0x10000)
45165 	/*
45166 	 * This bit must be '1' for the num_vlans field to be
45167 	 * configured.
45168 	 */
45169 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_NUM_VLANS	UINT32_C(0x20000)
45170 	/*
45171 	 * This bit must be '1' for the t_num_vlans field to be
45172 	 * configured.
45173 	 */
45174 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_NUM_VLANS	UINT32_C(0x40000)
45175 	/*
45176 	 * This value sets the match value for the L2 MAC address.
45177 	 * Destination MAC address for RX path.
45178 	 * Source MAC address for TX path.
45179 	 */
45180 	uint8_t	l2_addr[6];
45181 	/* This value sets the match value for the number of VLANs. */
45182 	uint8_t	num_vlans;
45183 	/*
45184 	 * This value sets the match value for the number of VLANs
45185 	 * in the tunnel headers.
45186 	 */
45187 	uint8_t	t_num_vlans;
45188 	/*
45189 	 * This value sets the mask value for the L2 address.
45190 	 * A value of 0 will mask the corresponding bit from
45191 	 * compare.
45192 	 */
45193 	uint8_t	l2_addr_mask[6];
45194 	/* This value sets VLAN ID value for outer VLAN. */
45195 	uint16_t	l2_ovlan;
45196 	/*
45197 	 * This value sets the mask value for the ovlan id.
45198 	 * A value of 0 will mask the corresponding bit from
45199 	 * compare.
45200 	 */
45201 	uint16_t	l2_ovlan_mask;
45202 	/* This value sets VLAN ID value for inner VLAN. */
45203 	uint16_t	l2_ivlan;
45204 	/*
45205 	 * This value sets the mask value for the ivlan id.
45206 	 * A value of 0 will mask the corresponding bit from
45207 	 * compare.
45208 	 */
45209 	uint16_t	l2_ivlan_mask;
45210 	uint8_t	unused_1[2];
45211 	/*
45212 	 * This value sets the match value for the tunnel
45213 	 * L2 MAC address.
45214 	 * Destination MAC address for RX path.
45215 	 * Source MAC address for TX path.
45216 	 */
45217 	uint8_t	t_l2_addr[6];
45218 	uint8_t	unused_2[2];
45219 	/*
45220 	 * This value sets the mask value for the tunnel L2
45221 	 * address.
45222 	 * A value of 0 will mask the corresponding bit from
45223 	 * compare.
45224 	 */
45225 	uint8_t	t_l2_addr_mask[6];
45226 	/* This value sets VLAN ID value for tunnel outer VLAN. */
45227 	uint16_t	t_l2_ovlan;
45228 	/*
45229 	 * This value sets the mask value for the tunnel ovlan id.
45230 	 * A value of 0 will mask the corresponding bit from
45231 	 * compare.
45232 	 */
45233 	uint16_t	t_l2_ovlan_mask;
45234 	/* This value sets VLAN ID value for tunnel inner VLAN. */
45235 	uint16_t	t_l2_ivlan;
45236 	/*
45237 	 * This value sets the mask value for the tunnel ivlan id.
45238 	 * A value of 0 will mask the corresponding bit from
45239 	 * compare.
45240 	 */
45241 	uint16_t	t_l2_ivlan_mask;
45242 	/* This value identifies the type of source of the packet. */
45243 	uint8_t	src_type;
45244 	/* Network port */
45245 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
45246 	/* Physical function */
45247 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF	UINT32_C(0x1)
45248 	/* Virtual function */
45249 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF	UINT32_C(0x2)
45250 	/* Virtual NIC of a function */
45251 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC  UINT32_C(0x3)
45252 	/* Embedded processor for CFA management */
45253 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG  UINT32_C(0x4)
45254 	/* Embedded processor for OOB management */
45255 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE   UINT32_C(0x5)
45256 	/* Embedded processor for RoCE */
45257 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO  UINT32_C(0x6)
45258 	/* Embedded processor for network proxy functions */
45259 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG  UINT32_C(0x7)
45260 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_LAST HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG
45261 	uint8_t	unused_3;
45262 	/*
45263 	 * This value is the id of the source.
45264 	 * For a network port, it represents port_id.
45265 	 * For a physical function, it represents fid.
45266 	 * For a virtual function, it represents vf_id.
45267 	 * For a vnic, it represents vnic_id.
45268 	 * For embedded processors, this id is not valid.
45269 	 *
45270 	 * Notes:
45271 	 * 1. The function ID is implied if it src_id is
45272 	 *	not provided for a src_type that is either
45273 	 */
45274 	uint32_t	src_id;
45275 	/* Tunnel Type. */
45276 	uint8_t	tunnel_type;
45277 	/* Non-tunnel */
45278 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
45279 	/* Virtual eXtensible Local Area Network (VXLAN) */
45280 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
45281 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
45282 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
45283 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
45284 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
45285 	/* IP in IP */
45286 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
45287 	/* Generic Network Virtualization Encapsulation (Geneve) */
45288 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
45289 	/* Multi-Protocol Label Switching (MPLS) */
45290 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
45291 	/* Stateless Transport Tunnel (STT) */
45292 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
45293 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
45294 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
45295 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
45296 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
45297 	/*
45298 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
45299 	 * datagram payload
45300 	 */
45301 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
45302 	/* Use fixed layer 2 ether type of 0xFFFF */
45303 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
45304 	/*
45305 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
45306 	 * (IPV6oVXLANGPE)
45307 	 */
45308 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
45309 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
45310 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
45311 	/* Any tunneled traffic */
45312 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
45313 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
45314 	uint8_t	unused_4;
45315 	/*
45316 	 * If set, this value shall represent the
45317 	 * Logical VNIC ID of the destination VNIC for the RX
45318 	 * path and network port id of the destination port for
45319 	 * the TX path.
45320 	 */
45321 	uint16_t	dst_id;
45322 	/*
45323 	 * Logical VNIC ID of the VNIC where traffic is
45324 	 * mirrored.
45325 	 */
45326 	uint16_t	mirror_vnic_id;
45327 	/*
45328 	 * This hint is provided to help in placing
45329 	 * the filter in the filter table.
45330 	 */
45331 	uint8_t	pri_hint;
45332 	/* No preference */
45333 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER	UINT32_C(0x0)
45334 	/* Above the given filter */
45335 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER UINT32_C(0x1)
45336 	/* Below the given filter */
45337 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER UINT32_C(0x2)
45338 	/* As high as possible */
45339 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX	UINT32_C(0x3)
45340 	/* As low as possible */
45341 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN	UINT32_C(0x4)
45342 	#define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_LAST	HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN
45343 	uint8_t	unused_5;
45344 	uint32_t	unused_6;
45345 	/*
45346 	 * This is the ID of the filter that goes along with
45347 	 * the pri_hint.
45348 	 *
45349 	 * This field is valid only for the following values.
45350 	 * 1 - Above the given filter
45351 	 * 2 - Below the given filter
45352 	 */
45353 	uint64_t	l2_filter_id_hint;
45354 } hwrm_cfa_l2_filter_alloc_input_t, *phwrm_cfa_l2_filter_alloc_input_t;
45355 
45356 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */
45357 
45358 typedef struct hwrm_cfa_l2_filter_alloc_output {
45359 	/* The specific error status for the command. */
45360 	uint16_t	error_code;
45361 	/* The HWRM command request type. */
45362 	uint16_t	req_type;
45363 	/* The sequence ID from the original command. */
45364 	uint16_t	seq_id;
45365 	/* The length of the response data in number of bytes. */
45366 	uint16_t	resp_len;
45367 	/*
45368 	 * This value identifies a set of CFA data structures used for an L2
45369 	 * context.
45370 	 */
45371 	uint64_t	l2_filter_id;
45372 	/*
45373 	 * The flow id value in bit 0-29 is the actual ID of the flow
45374 	 * associated with this filter and it shall be used to match
45375 	 * and associate the flow identifier returned in completion
45376 	 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
45377 	 * shall indicate no valid flow id.
45378 	 */
45379 	uint32_t	flow_id;
45380 	/* Indicate the flow id value. */
45381 	#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
45382 	#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
45383 	/* Indicate type of the flow. */
45384 	#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE	UINT32_C(0x40000000)
45385 	/*
45386 	 * If this bit set to 0, then it indicates that the flow is
45387 	 * internal flow.
45388 	 */
45389 		#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT	(UINT32_C(0x0) << 30)
45390 	/*
45391 	 * If this bit is set to 1, then it indicates that the flow is
45392 	 * external flow.
45393 	 */
45394 		#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT	(UINT32_C(0x1) << 30)
45395 		#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST  HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
45396 	/* Indicate the flow direction. */
45397 	#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR	UINT32_C(0x80000000)
45398 	/* If this bit set to 0, then it indicates rx flow. */
45399 		#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX	(UINT32_C(0x0) << 31)
45400 	/* If this bit is set to 1, then it indicates that tx flow. */
45401 		#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX	(UINT32_C(0x1) << 31)
45402 		#define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST   HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
45403 	uint8_t	unused_0[3];
45404 	/*
45405 	 * This field is used in Output records to indicate that the output
45406 	 * is completely written to RAM. This field should be read as '1'
45407 	 * to indicate that the output has been completely written.
45408 	 * When writing a command completion or response to an internal
45409 	 * processor, the order of writes has to be such that this field is
45410 	 * written last.
45411 	 */
45412 	uint8_t	valid;
45413 } hwrm_cfa_l2_filter_alloc_output_t, *phwrm_cfa_l2_filter_alloc_output_t;
45414 
45415 /***************************
45416  * hwrm_cfa_l2_filter_free *
45417  ***************************/
45418 
45419 
45420 /* hwrm_cfa_l2_filter_free_input (size:192b/24B) */
45421 
45422 typedef struct hwrm_cfa_l2_filter_free_input {
45423 	/* The HWRM command request type. */
45424 	uint16_t	req_type;
45425 	/*
45426 	 * The completion ring to send the completion event on. This should
45427 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45428 	 */
45429 	uint16_t	cmpl_ring;
45430 	/*
45431 	 * The sequence ID is used by the driver for tracking multiple
45432 	 * commands. This ID is treated as opaque data by the firmware and
45433 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45434 	 */
45435 	uint16_t	seq_id;
45436 	/*
45437 	 * The target ID of the command:
45438 	 * * 0x0-0xFFF8 - The function ID
45439 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45440 	 * * 0xFFFD - Reserved for user-space HWRM interface
45441 	 * * 0xFFFF - HWRM
45442 	 */
45443 	uint16_t	target_id;
45444 	/*
45445 	 * A physical address pointer pointing to a host buffer that the
45446 	 * command's response data will be written. This can be either a host
45447 	 * physical address (HPA) or a guest physical address (GPA) and must
45448 	 * point to a physically contiguous block of memory.
45449 	 */
45450 	uint64_t	resp_addr;
45451 	/*
45452 	 * This value identifies a set of CFA data structures used for an L2
45453 	 * context.
45454 	 */
45455 	uint64_t	l2_filter_id;
45456 } hwrm_cfa_l2_filter_free_input_t, *phwrm_cfa_l2_filter_free_input_t;
45457 
45458 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */
45459 
45460 typedef struct hwrm_cfa_l2_filter_free_output {
45461 	/* The specific error status for the command. */
45462 	uint16_t	error_code;
45463 	/* The HWRM command request type. */
45464 	uint16_t	req_type;
45465 	/* The sequence ID from the original command. */
45466 	uint16_t	seq_id;
45467 	/* The length of the response data in number of bytes. */
45468 	uint16_t	resp_len;
45469 	uint8_t	unused_0[7];
45470 	/*
45471 	 * This field is used in Output records to indicate that the output
45472 	 * is completely written to RAM. This field should be read as '1'
45473 	 * to indicate that the output has been completely written.
45474 	 * When writing a command completion or response to an internal
45475 	 * processor, the order of writes has to be such that this field is
45476 	 * written last.
45477 	 */
45478 	uint8_t	valid;
45479 } hwrm_cfa_l2_filter_free_output_t, *phwrm_cfa_l2_filter_free_output_t;
45480 
45481 /**************************
45482  * hwrm_cfa_l2_filter_cfg *
45483  **************************/
45484 
45485 
45486 /* hwrm_cfa_l2_filter_cfg_input (size:384b/48B) */
45487 
45488 typedef struct hwrm_cfa_l2_filter_cfg_input {
45489 	/* The HWRM command request type. */
45490 	uint16_t	req_type;
45491 	/*
45492 	 * The completion ring to send the completion event on. This should
45493 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45494 	 */
45495 	uint16_t	cmpl_ring;
45496 	/*
45497 	 * The sequence ID is used by the driver for tracking multiple
45498 	 * commands. This ID is treated as opaque data by the firmware and
45499 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45500 	 */
45501 	uint16_t	seq_id;
45502 	/*
45503 	 * The target ID of the command:
45504 	 * * 0x0-0xFFF8 - The function ID
45505 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45506 	 * * 0xFFFD - Reserved for user-space HWRM interface
45507 	 * * 0xFFFF - HWRM
45508 	 */
45509 	uint16_t	target_id;
45510 	/*
45511 	 * A physical address pointer pointing to a host buffer that the
45512 	 * command's response data will be written. This can be either a host
45513 	 * physical address (HPA) or a guest physical address (GPA) and must
45514 	 * point to a physically contiguous block of memory.
45515 	 */
45516 	uint64_t	resp_addr;
45517 	uint32_t	flags;
45518 	/*
45519 	 * Enumeration denoting the RX, TX type of the resource.
45520 	 * This enumeration is used for resources that are similar for both
45521 	 * TX and RX paths of the chip.
45522 	 */
45523 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH		UINT32_C(0x1)
45524 	/* tx path */
45525 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX		UINT32_C(0x0)
45526 	/* rx path */
45527 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX		UINT32_C(0x1)
45528 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST		HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
45529 	/*
45530 	 * Setting of this flag indicates drop action. If this flag is not
45531 	 * set, then it should be considered accept action.
45532 	 */
45533 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP		UINT32_C(0x2)
45534 	/*
45535 	 * Enumeration denoting NO_ROCE_L2 to support old drivers.
45536 	 * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
45537 	 */
45538 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_MASK	UINT32_C(0xc)
45539 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_SFT	2
45540 	/* To support old drivers */
45541 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2	(UINT32_C(0x0) << 2)
45542 	/* Only L2 traffic */
45543 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_L2		(UINT32_C(0x1) << 2)
45544 	/* Roce & L2 traffic */
45545 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE		(UINT32_C(0x2) << 2)
45546 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_LAST	HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE
45547 	/*
45548 	 * Enumeration denoting how the L2 Context TCAM remap operation is
45549 	 * updated.
45550 	 */
45551 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_REMAP_OP_MASK	UINT32_C(0x30)
45552 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_REMAP_OP_SFT	4
45553 	/* No change to remap opcode */
45554 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_REMAP_OP_NO_UPDATE	(UINT32_C(0x0) << 4)
45555 	/* Bypass CFA Lookup */
45556 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_REMAP_OP_BYPASS_LKUP	(UINT32_C(0x1) << 4)
45557 	/* Enable CFA Lookup */
45558 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_REMAP_OP_ENABLE_LKUP	(UINT32_C(0x2) << 4)
45559 	/*
45560 	 * Restore the remap opcode originally programmed by firmware flow
45561 	 * manager
45562 	 */
45563 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_REMAP_OP_RESTORE_FW_OP  (UINT32_C(0x3) << 4)
45564 		#define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_REMAP_OP_LAST	HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_REMAP_OP_RESTORE_FW_OP
45565 	uint32_t	enables;
45566 	/*
45567 	 * This bit must be '1' for the dst_id field to be
45568 	 * configured.
45569 	 */
45570 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID		UINT32_C(0x1)
45571 	/*
45572 	 * This bit must be '1' for the new_mirror_vnic_id field to be
45573 	 * configured.
45574 	 */
45575 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID	UINT32_C(0x2)
45576 	/*
45577 	 * This bit must be '1' for the prof_func field to be configured in
45578 	 * the remap entry.
45579 	 */
45580 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_PROF_FUNC		UINT32_C(0x4)
45581 	/*
45582 	 * This bit must be '1' for the l2_context_id field to be configured
45583 	 * in the remap entry.
45584 	 */
45585 	#define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_L2_CONTEXT_ID	UINT32_C(0x8)
45586 	/*
45587 	 * This value identifies a set of CFA data structures used for an L2
45588 	 * context.
45589 	 */
45590 	uint64_t	l2_filter_id;
45591 	/*
45592 	 * If set, this value shall represent the
45593 	 * Logical VNIC ID of the destination VNIC for the RX
45594 	 * path and network port id of the destination port for
45595 	 * the TX path.
45596 	 */
45597 	uint32_t	dst_id;
45598 	/*
45599 	 * New Logical VNIC ID of the VNIC where traffic is
45600 	 * mirrored.
45601 	 */
45602 	uint32_t	new_mirror_vnic_id;
45603 	/*
45604 	 * Profile function value to be programmed into the L2 context entry's
45605 	 * remap. This will be used by the host application to program the CFA
45606 	 * Profile TCAM entry for further classification. A value of 0xFFFFFFFF
45607 	 * indicates that the profile function should be restored to the value
45608 	 * originally programmed by the firmware flow manager.
45609 	 */
45610 	uint32_t	prof_func;
45611 	/*
45612 	 * L2 context ID value to be programmed into the L2 context entry's
45613 	 * remap. This will be used by the host application to program the CFA
45614 	 * Lookup entry for further classification. A value of 0xFFFFFFFF
45615 	 * indicates that the profile function should be restored to the value
45616 	 * originally programmed by the firmware flow manager.
45617 	 */
45618 	uint32_t	l2_context_id;
45619 } hwrm_cfa_l2_filter_cfg_input_t, *phwrm_cfa_l2_filter_cfg_input_t;
45620 
45621 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
45622 
45623 typedef struct hwrm_cfa_l2_filter_cfg_output {
45624 	/* The specific error status for the command. */
45625 	uint16_t	error_code;
45626 	/* The HWRM command request type. */
45627 	uint16_t	req_type;
45628 	/* The sequence ID from the original command. */
45629 	uint16_t	seq_id;
45630 	/* The length of the response data in number of bytes. */
45631 	uint16_t	resp_len;
45632 	uint8_t	unused_0[7];
45633 	/*
45634 	 * This field is used in Output records to indicate that the output
45635 	 * is completely written to RAM. This field should be read as '1'
45636 	 * to indicate that the output has been completely written.
45637 	 * When writing a command completion or response to an internal
45638 	 * processor, the order of writes has to be such that this field is
45639 	 * written last.
45640 	 */
45641 	uint8_t	valid;
45642 } hwrm_cfa_l2_filter_cfg_output_t, *phwrm_cfa_l2_filter_cfg_output_t;
45643 
45644 /***************************
45645  * hwrm_cfa_l2_set_rx_mask *
45646  ***************************/
45647 
45648 
45649 /* hwrm_cfa_l2_set_rx_mask_input (size:448b/56B) */
45650 
45651 typedef struct hwrm_cfa_l2_set_rx_mask_input {
45652 	/* The HWRM command request type. */
45653 	uint16_t	req_type;
45654 	/*
45655 	 * The completion ring to send the completion event on. This should
45656 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45657 	 */
45658 	uint16_t	cmpl_ring;
45659 	/*
45660 	 * The sequence ID is used by the driver for tracking multiple
45661 	 * commands. This ID is treated as opaque data by the firmware and
45662 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45663 	 */
45664 	uint16_t	seq_id;
45665 	/*
45666 	 * The target ID of the command:
45667 	 * * 0x0-0xFFF8 - The function ID
45668 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45669 	 * * 0xFFFD - Reserved for user-space HWRM interface
45670 	 * * 0xFFFF - HWRM
45671 	 */
45672 	uint16_t	target_id;
45673 	/*
45674 	 * A physical address pointer pointing to a host buffer that the
45675 	 * command's response data will be written. This can be either a host
45676 	 * physical address (HPA) or a guest physical address (GPA) and must
45677 	 * point to a physically contiguous block of memory.
45678 	 */
45679 	uint64_t	resp_addr;
45680 	/* VNIC ID */
45681 	uint32_t	vnic_id;
45682 	uint32_t	mask;
45683 	/*
45684 	 * When this bit is '1', the function is requested to accept
45685 	 * multi-cast packets specified by the multicast addr table.
45686 	 */
45687 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST		UINT32_C(0x2)
45688 	/*
45689 	 * When this bit is '1', the function is requested to accept
45690 	 * all multi-cast packets.
45691 	 */
45692 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST	UINT32_C(0x4)
45693 	/*
45694 	 * When this bit is '1', the function is requested to accept
45695 	 * broadcast packets.
45696 	 */
45697 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST		UINT32_C(0x8)
45698 	/*
45699 	 * When this bit is '1', the function is requested to be
45700 	 * put in the promiscuous mode.
45701 	 *
45702 	 * The HWRM should accept any function to set up
45703 	 * promiscuous mode.
45704 	 *
45705 	 * The HWRM shall follow the semantics below for the
45706 	 * promiscuous mode support.
45707 	 * # When partitioning is not enabled on a port
45708 	 * (i.e. single PF on the port), then the PF shall
45709 	 * be allowed to be in the promiscuous mode. When the
45710 	 * PF is in the promiscuous mode, then it shall
45711 	 * receive all host bound traffic on that port.
45712 	 * # When partitioning is enabled on a port
45713 	 * (i.e. multiple PFs per port) and a PF on that
45714 	 * port is in the promiscuous mode, then the PF
45715 	 * receives all traffic within that partition as
45716 	 * identified by a unique identifier for the
45717 	 * PF (e.g. S-Tag). If a unique outer VLAN
45718 	 * for the PF is specified, then the setting of
45719 	 * promiscuous mode on that PF shall result in the
45720 	 * PF receiving all host bound traffic with matching
45721 	 * outer VLAN.
45722 	 * # A VF shall can be set in the promiscuous mode.
45723 	 * In the promiscuous mode, the VF does not receive any
45724 	 * traffic unless a unique outer VLAN for the
45725 	 * VF is specified. If a unique outer VLAN
45726 	 * for the VF is specified, then the setting of
45727 	 * promiscuous mode on that VF shall result in the
45728 	 * VF receiving all host bound traffic with the
45729 	 * matching outer VLAN.
45730 	 * # The HWRM shall allow the setting of promiscuous
45731 	 * mode on a function independently from the
45732 	 * promiscuous mode settings on other functions.
45733 	 */
45734 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS	UINT32_C(0x10)
45735 	/*
45736 	 * If this flag is set, the corresponding RX
45737 	 * filters shall be set up to cover multicast/broadcast
45738 	 * filters for the outermost Layer 2 destination MAC
45739 	 * address field.
45740 	 */
45741 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST	UINT32_C(0x20)
45742 	/*
45743 	 * If this flag is set, the corresponding RX
45744 	 * filters shall be set up to cover multicast/broadcast
45745 	 * filters for the VLAN-tagged packets that match the
45746 	 * TPID and VID fields of VLAN tags in the VLAN tag
45747 	 * table specified in this command.
45748 	 */
45749 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY		UINT32_C(0x40)
45750 	/*
45751 	 * If this flag is set, the corresponding RX
45752 	 * filters shall be set up to cover multicast/broadcast
45753 	 * filters for non-VLAN tagged packets and VLAN-tagged
45754 	 * packets that match the TPID and VID fields of VLAN
45755 	 * tags in the VLAN tag table specified in this command.
45756 	 */
45757 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN	UINT32_C(0x80)
45758 	/*
45759 	 * If this flag is set, the corresponding RX
45760 	 * filters shall be set up to cover multicast/broadcast
45761 	 * filters for non-VLAN tagged packets and VLAN-tagged
45762 	 * packets matching any VLAN tag.
45763 	 *
45764 	 * If this flag is set, then the HWRM shall ignore
45765 	 * VLAN tags specified in vlan_tag_tbl.
45766 	 *
45767 	 * If none of vlanonly, vlan_nonvlan, and anyvlan_nonvlan
45768 	 * flags is set, then the HWRM shall ignore
45769 	 * VLAN tags specified in vlan_tag_tbl.
45770 	 *
45771 	 * The HWRM client shall set at most one flag out of
45772 	 * vlanonly, vlan_nonvlan, and anyvlan_nonvlan.
45773 	 */
45774 	#define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN	UINT32_C(0x100)
45775 	/* This is the address for mcast address tbl. */
45776 	uint64_t	mc_tbl_addr;
45777 	/*
45778 	 * This value indicates how many entries in mc_tbl are valid.
45779 	 * Each entry is 6 bytes.
45780 	 */
45781 	uint32_t	num_mc_entries;
45782 	uint8_t	unused_0[4];
45783 	/*
45784 	 * This is the address for VLAN tag table.
45785 	 * Each VLAN entry in the table is 4 bytes of a VLAN tag
45786 	 * including TPID, PCP, DEI, and VID fields in network byte
45787 	 * order.
45788 	 */
45789 	uint64_t	vlan_tag_tbl_addr;
45790 	/*
45791 	 * This value indicates how many entries in vlan_tag_tbl are
45792 	 * valid. Each entry is 4 bytes.
45793 	 */
45794 	uint32_t	num_vlan_tags;
45795 	uint8_t	unused_1[4];
45796 } hwrm_cfa_l2_set_rx_mask_input_t, *phwrm_cfa_l2_set_rx_mask_input_t;
45797 
45798 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */
45799 
45800 typedef struct hwrm_cfa_l2_set_rx_mask_output {
45801 	/* The specific error status for the command. */
45802 	uint16_t	error_code;
45803 	/* The HWRM command request type. */
45804 	uint16_t	req_type;
45805 	/* The sequence ID from the original command. */
45806 	uint16_t	seq_id;
45807 	/* The length of the response data in number of bytes. */
45808 	uint16_t	resp_len;
45809 	uint8_t	unused_0[7];
45810 	/*
45811 	 * This field is used in Output records to indicate that the output
45812 	 * is completely written to RAM. This field should be read as '1'
45813 	 * to indicate that the output has been completely written.
45814 	 * When writing a command completion or response to an internal
45815 	 * processor, the order of writes has to be such that this field is
45816 	 * written last.
45817 	 */
45818 	uint8_t	valid;
45819 } hwrm_cfa_l2_set_rx_mask_output_t, *phwrm_cfa_l2_set_rx_mask_output_t;
45820 
45821 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */
45822 
45823 typedef struct hwrm_cfa_l2_set_rx_mask_cmd_err {
45824 	/*
45825 	 * command specific error codes that goes to
45826 	 * the cmd_err field in Common HWRM Error Response.
45827 	 */
45828 	uint8_t	code;
45829 	/* Unknown error */
45830 	#define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN			UINT32_C(0x0)
45831 	/* Unable to complete operation due to conflict with Ntuple Filter */
45832 	#define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR UINT32_C(0x1)
45833 	#define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST			HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR
45834 	uint8_t	unused_0[7];
45835 } hwrm_cfa_l2_set_rx_mask_cmd_err_t, *phwrm_cfa_l2_set_rx_mask_cmd_err_t;
45836 
45837 /*******************************
45838  * hwrm_cfa_vlan_antispoof_cfg *
45839  *******************************/
45840 
45841 
45842 /* hwrm_cfa_vlan_antispoof_cfg_input (size:256b/32B) */
45843 
45844 typedef struct hwrm_cfa_vlan_antispoof_cfg_input {
45845 	/* The HWRM command request type. */
45846 	uint16_t	req_type;
45847 	/*
45848 	 * The completion ring to send the completion event on. This should
45849 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45850 	 */
45851 	uint16_t	cmpl_ring;
45852 	/*
45853 	 * The sequence ID is used by the driver for tracking multiple
45854 	 * commands. This ID is treated as opaque data by the firmware and
45855 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45856 	 */
45857 	uint16_t	seq_id;
45858 	/*
45859 	 * The target ID of the command:
45860 	 * * 0x0-0xFFF8 - The function ID
45861 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45862 	 * * 0xFFFD - Reserved for user-space HWRM interface
45863 	 * * 0xFFFF - HWRM
45864 	 */
45865 	uint16_t	target_id;
45866 	/*
45867 	 * A physical address pointer pointing to a host buffer that the
45868 	 * command's response data will be written. This can be either a host
45869 	 * physical address (HPA) or a guest physical address (GPA) and must
45870 	 * point to a physically contiguous block of memory.
45871 	 */
45872 	uint64_t	resp_addr;
45873 	/*
45874 	 * Function ID of the function that is being configured.
45875 	 * Only valid for a VF FID configured by the PF.
45876 	 */
45877 	uint16_t	fid;
45878 	uint8_t	unused_0[2];
45879 	/* Number of VLAN entries in the vlan_tag_mask_tbl. */
45880 	uint32_t	num_vlan_entries;
45881 	/*
45882 	 * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
45883 	 * antispoof table. Each table entry contains the 16-bit TPID
45884 	 * (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit mask,
45885 	 * all in network order to match hwrm_cfa_l2_set_rx_mask.
45886 	 * For an individual VLAN entry, the mask value should be 0xfff
45887 	 * for the 12-bit VLAN ID.
45888 	 */
45889 	uint64_t	vlan_tag_mask_tbl_addr;
45890 } hwrm_cfa_vlan_antispoof_cfg_input_t, *phwrm_cfa_vlan_antispoof_cfg_input_t;
45891 
45892 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */
45893 
45894 typedef struct hwrm_cfa_vlan_antispoof_cfg_output {
45895 	/* The specific error status for the command. */
45896 	uint16_t	error_code;
45897 	/* The HWRM command request type. */
45898 	uint16_t	req_type;
45899 	/* The sequence ID from the original command. */
45900 	uint16_t	seq_id;
45901 	/* The length of the response data in number of bytes. */
45902 	uint16_t	resp_len;
45903 	uint8_t	unused_0[7];
45904 	/*
45905 	 * This field is used in Output records to indicate that the output
45906 	 * is completely written to RAM. This field should be read as '1'
45907 	 * to indicate that the output has been completely written.
45908 	 * When writing a command completion or response to an internal
45909 	 * processor, the order of writes has to be such that this field is
45910 	 * written last.
45911 	 */
45912 	uint8_t	valid;
45913 } hwrm_cfa_vlan_antispoof_cfg_output_t, *phwrm_cfa_vlan_antispoof_cfg_output_t;
45914 
45915 /********************************
45916  * hwrm_cfa_vlan_antispoof_qcfg *
45917  ********************************/
45918 
45919 
45920 /* hwrm_cfa_vlan_antispoof_qcfg_input (size:256b/32B) */
45921 
45922 typedef struct hwrm_cfa_vlan_antispoof_qcfg_input {
45923 	/* The HWRM command request type. */
45924 	uint16_t	req_type;
45925 	/*
45926 	 * The completion ring to send the completion event on. This should
45927 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
45928 	 */
45929 	uint16_t	cmpl_ring;
45930 	/*
45931 	 * The sequence ID is used by the driver for tracking multiple
45932 	 * commands. This ID is treated as opaque data by the firmware and
45933 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
45934 	 */
45935 	uint16_t	seq_id;
45936 	/*
45937 	 * The target ID of the command:
45938 	 * * 0x0-0xFFF8 - The function ID
45939 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45940 	 * * 0xFFFD - Reserved for user-space HWRM interface
45941 	 * * 0xFFFF - HWRM
45942 	 */
45943 	uint16_t	target_id;
45944 	/*
45945 	 * A physical address pointer pointing to a host buffer that the
45946 	 * command's response data will be written. This can be either a host
45947 	 * physical address (HPA) or a guest physical address (GPA) and must
45948 	 * point to a physically contiguous block of memory.
45949 	 */
45950 	uint64_t	resp_addr;
45951 	/*
45952 	 * Function ID of the function that is being queried.
45953 	 * Only valid for a VF FID queried by the PF.
45954 	 */
45955 	uint16_t	fid;
45956 	uint8_t	unused_0[2];
45957 	/*
45958 	 * Maximum number of VLAN entries the firmware is allowed to DMA
45959 	 * to vlan_tag_mask_tbl.
45960 	 */
45961 	uint32_t	max_vlan_entries;
45962 	/*
45963 	 * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
45964 	 * antispoof table to which firmware will DMA to. Each table
45965 	 * entry will contain the 16-bit TPID (0x8100 or 0x88a8 only),
45966 	 * 16-bit VLAN ID, and a 16-bit mask, all in network order to
45967 	 * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry,
45968 	 * the mask value should be 0xfff for the 12-bit VLAN ID.
45969 	 */
45970 	uint64_t	vlan_tag_mask_tbl_addr;
45971 } hwrm_cfa_vlan_antispoof_qcfg_input_t, *phwrm_cfa_vlan_antispoof_qcfg_input_t;
45972 
45973 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */
45974 
45975 typedef struct hwrm_cfa_vlan_antispoof_qcfg_output {
45976 	/* The specific error status for the command. */
45977 	uint16_t	error_code;
45978 	/* The HWRM command request type. */
45979 	uint16_t	req_type;
45980 	/* The sequence ID from the original command. */
45981 	uint16_t	seq_id;
45982 	/* The length of the response data in number of bytes. */
45983 	uint16_t	resp_len;
45984 	/* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */
45985 	uint32_t	num_vlan_entries;
45986 	uint8_t	unused_0[3];
45987 	/*
45988 	 * This field is used in Output records to indicate that the output
45989 	 * is completely written to RAM. This field should be read as '1'
45990 	 * to indicate that the output has been completely written.
45991 	 * When writing a command completion or response to an internal
45992 	 * processor, the order of writes has to be such that this field is
45993 	 * written last.
45994 	 */
45995 	uint8_t	valid;
45996 } hwrm_cfa_vlan_antispoof_qcfg_output_t, *phwrm_cfa_vlan_antispoof_qcfg_output_t;
45997 
45998 /********************************
45999  * hwrm_cfa_tunnel_filter_alloc *
46000  ********************************/
46001 
46002 
46003 /* hwrm_cfa_tunnel_filter_alloc_input (size:704b/88B) */
46004 
46005 typedef struct hwrm_cfa_tunnel_filter_alloc_input {
46006 	/* The HWRM command request type. */
46007 	uint16_t	req_type;
46008 	/*
46009 	 * The completion ring to send the completion event on. This should
46010 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46011 	 */
46012 	uint16_t	cmpl_ring;
46013 	/*
46014 	 * The sequence ID is used by the driver for tracking multiple
46015 	 * commands. This ID is treated as opaque data by the firmware and
46016 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46017 	 */
46018 	uint16_t	seq_id;
46019 	/*
46020 	 * The target ID of the command:
46021 	 * * 0x0-0xFFF8 - The function ID
46022 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46023 	 * * 0xFFFD - Reserved for user-space HWRM interface
46024 	 * * 0xFFFF - HWRM
46025 	 */
46026 	uint16_t	target_id;
46027 	/*
46028 	 * A physical address pointer pointing to a host buffer that the
46029 	 * command's response data will be written. This can be either a host
46030 	 * physical address (HPA) or a guest physical address (GPA) and must
46031 	 * point to a physically contiguous block of memory.
46032 	 */
46033 	uint64_t	resp_addr;
46034 	uint32_t	flags;
46035 	/*
46036 	 * Setting of this flag indicates the applicability to the loopback
46037 	 * path.
46038 	 */
46039 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK	UINT32_C(0x1)
46040 	uint32_t	enables;
46041 	/*
46042 	 * This bit must be '1' for the l2_filter_id field to be
46043 	 * configured.
46044 	 */
46045 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID	UINT32_C(0x1)
46046 	/*
46047 	 * This bit must be '1' for the l2_addr field to be
46048 	 * configured.
46049 	 */
46050 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR		UINT32_C(0x2)
46051 	/*
46052 	 * This bit must be '1' for the l2_ivlan field to be
46053 	 * configured.
46054 	 */
46055 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN	UINT32_C(0x4)
46056 	/*
46057 	 * This bit must be '1' for the l3_addr field to be
46058 	 * configured.
46059 	 */
46060 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR		UINT32_C(0x8)
46061 	/*
46062 	 * This bit must be '1' for the l3_addr_type field to be
46063 	 * configured.
46064 	 */
46065 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR_TYPE	UINT32_C(0x10)
46066 	/*
46067 	 * This bit must be '1' for the t_l3_addr_type field to be
46068 	 * configured.
46069 	 */
46070 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR_TYPE	UINT32_C(0x20)
46071 	/*
46072 	 * This bit must be '1' for the t_l3_addr field to be
46073 	 * configured.
46074 	 */
46075 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR	UINT32_C(0x40)
46076 	/*
46077 	 * This bit must be '1' for the tunnel_type field to be
46078 	 * configured.
46079 	 */
46080 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE	UINT32_C(0x80)
46081 	/*
46082 	 * This bit must be '1' for the vni field to be
46083 	 * configured.
46084 	 */
46085 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_VNI		UINT32_C(0x100)
46086 	/*
46087 	 * This bit must be '1' for the dst_vnic_id field to be
46088 	 * configured.
46089 	 */
46090 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_DST_VNIC_ID	UINT32_C(0x200)
46091 	/*
46092 	 * This bit must be '1' for the mirror_vnic_id field to be
46093 	 * configured.
46094 	 */
46095 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID	UINT32_C(0x400)
46096 	/*
46097 	 * This value identifies a set of CFA data structures used for an L2
46098 	 * context.
46099 	 */
46100 	uint64_t	l2_filter_id;
46101 	/*
46102 	 * This value sets the match value for the inner L2
46103 	 * MAC address.
46104 	 * Destination MAC address for RX path.
46105 	 * Source MAC address for TX path.
46106 	 */
46107 	uint8_t	l2_addr[6];
46108 	/*
46109 	 * This value sets VLAN ID value for inner VLAN.
46110 	 * Only 12-bits of VLAN ID are used in setting the filter.
46111 	 */
46112 	uint16_t	l2_ivlan;
46113 	/*
46114 	 * The value of inner destination IP address to be used in filtering.
46115 	 * For IPv4, first four bytes represent the IP address.
46116 	 */
46117 	uint32_t	l3_addr[4];
46118 	/*
46119 	 * The value of tunnel destination IP address to be used in filtering.
46120 	 * For IPv4, first four bytes represent the IP address.
46121 	 */
46122 	uint32_t	t_l3_addr[4];
46123 	/*
46124 	 * This value indicates the type of inner IP address.
46125 	 * 4 - IPv4
46126 	 * 6 - IPv6
46127 	 * All others are invalid.
46128 	 */
46129 	uint8_t	l3_addr_type;
46130 	/*
46131 	 * This value indicates the type of tunnel IP address.
46132 	 * 4 - IPv4
46133 	 * 6 - IPv6
46134 	 * All others are invalid.
46135 	 */
46136 	uint8_t	t_l3_addr_type;
46137 	/* Tunnel Type. */
46138 	uint8_t	tunnel_type;
46139 	/* Non-tunnel */
46140 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
46141 	/* Virtual eXtensible Local Area Network (VXLAN) */
46142 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
46143 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
46144 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
46145 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
46146 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
46147 	/* IP in IP */
46148 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
46149 	/* Generic Network Virtualization Encapsulation (Geneve) */
46150 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
46151 	/* Multi-Protocol Label Switching (MPLS) */
46152 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
46153 	/* Stateless Transport Tunnel (STT) */
46154 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
46155 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
46156 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
46157 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
46158 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
46159 	/*
46160 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
46161 	 * datagram payload
46162 	 */
46163 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
46164 	/* Use fixed layer 2 ether type of 0xFFFF */
46165 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
46166 	/*
46167 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
46168 	 * (IPV6oVXLANGPE)
46169 	 */
46170 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
46171 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
46172 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
46173 	/* Any tunneled traffic */
46174 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
46175 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
46176 	/*
46177 	 * tunnel_flags allows the user to indicate the tunnel tag detection
46178 	 * for the tunnel type specified in tunnel_type.
46179 	 */
46180 	uint8_t	tunnel_flags;
46181 	/*
46182 	 * If the tunnel_type is geneve, then this bit indicates if we
46183 	 * need to match the geneve OAM packet.
46184 	 * If the tunnel_type is nvgre or gre, then this bit indicates if
46185 	 * we need to detect checksum present bit in geneve header.
46186 	 * If the tunnel_type is mpls, then this bit indicates if we need
46187 	 * to match mpls packet with explicit IPV4/IPV6 null header.
46188 	 */
46189 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_OAM_CHECKSUM_EXPLHDR	UINT32_C(0x1)
46190 	/*
46191 	 * If the tunnel_type is geneve, then this bit indicates if we
46192 	 * need to detect the critical option bit set in the oam packet.
46193 	 * If the tunnel_type is nvgre or gre, then this bit indicates
46194 	 * if we need to match nvgre packets with key present bit set in
46195 	 * gre header.
46196 	 * If the tunnel_type is mpls, then this bit indicates if we
46197 	 * need to match mpls packet with S bit from inner/second label.
46198 	 */
46199 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_CRITICAL_OPT_S1	UINT32_C(0x2)
46200 	/*
46201 	 * If the tunnel_type is geneve, then this bit indicates if we
46202 	 * need to match geneve packet with extended header bit set in
46203 	 * geneve header.
46204 	 * If the tunnel_type is nvgre or gre, then this bit indicates
46205 	 * if we need to match nvgre packets with sequence number
46206 	 * present bit set in gre header.
46207 	 * If the tunnel_type is mpls, then this bit indicates if we
46208 	 * need to match mpls packet with S bit from out/first label.
46209 	 */
46210 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_EXTHDR_SEQNUM_S0	UINT32_C(0x4)
46211 	/*
46212 	 * Virtual Network Identifier (VNI). Only valid with
46213 	 * tunnel_types VXLAN, NVGRE, and Geneve.
46214 	 * Only lower 24-bits of VNI field are used
46215 	 * in setting up the filter.
46216 	 */
46217 	uint32_t	vni;
46218 	/* Logical VNIC ID of the destination VNIC. */
46219 	uint32_t	dst_vnic_id;
46220 	/*
46221 	 * Logical VNIC ID of the VNIC where traffic is
46222 	 * mirrored.
46223 	 */
46224 	uint32_t	mirror_vnic_id;
46225 } hwrm_cfa_tunnel_filter_alloc_input_t, *phwrm_cfa_tunnel_filter_alloc_input_t;
46226 
46227 /* hwrm_cfa_tunnel_filter_alloc_output (size:192b/24B) */
46228 
46229 typedef struct hwrm_cfa_tunnel_filter_alloc_output {
46230 	/* The specific error status for the command. */
46231 	uint16_t	error_code;
46232 	/* The HWRM command request type. */
46233 	uint16_t	req_type;
46234 	/* The sequence ID from the original command. */
46235 	uint16_t	seq_id;
46236 	/* The length of the response data in number of bytes. */
46237 	uint16_t	resp_len;
46238 	/* This value is an opaque id into CFA data structures. */
46239 	uint64_t	tunnel_filter_id;
46240 	/*
46241 	 * The flow id value in bit 0-29 is the actual ID of the flow
46242 	 * associated with this filter and it shall be used to match
46243 	 * and associate the flow identifier returned in completion
46244 	 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
46245 	 * shall indicate no valid flow id.
46246 	 */
46247 	uint32_t	flow_id;
46248 	/* Indicate the flow id value. */
46249 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
46250 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
46251 	/* Indicate type of the flow. */
46252 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE	UINT32_C(0x40000000)
46253 	/*
46254 	 * If this bit set to 0, then it indicates that the flow is
46255 	 * internal flow.
46256 	 */
46257 		#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT	(UINT32_C(0x0) << 30)
46258 	/*
46259 	 * If this bit is set to 1, then it indicates that the flow is
46260 	 * external flow.
46261 	 */
46262 		#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT	(UINT32_C(0x1) << 30)
46263 		#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST  HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
46264 	/* Indicate the flow direction. */
46265 	#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR	UINT32_C(0x80000000)
46266 	/* If this bit set to 0, then it indicates rx flow. */
46267 		#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX	(UINT32_C(0x0) << 31)
46268 	/* If this bit is set to 1, then it indicates that tx flow. */
46269 		#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX	(UINT32_C(0x1) << 31)
46270 		#define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST   HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
46271 	uint8_t	unused_0[3];
46272 	/*
46273 	 * This field is used in Output records to indicate that the output
46274 	 * is completely written to RAM. This field should be read as '1'
46275 	 * to indicate that the output has been completely written.
46276 	 * When writing a command completion or response to an internal
46277 	 * processor, the order of writes has to be such that this field is
46278 	 * written last.
46279 	 */
46280 	uint8_t	valid;
46281 } hwrm_cfa_tunnel_filter_alloc_output_t, *phwrm_cfa_tunnel_filter_alloc_output_t;
46282 
46283 /*******************************
46284  * hwrm_cfa_tunnel_filter_free *
46285  *******************************/
46286 
46287 
46288 /* hwrm_cfa_tunnel_filter_free_input (size:192b/24B) */
46289 
46290 typedef struct hwrm_cfa_tunnel_filter_free_input {
46291 	/* The HWRM command request type. */
46292 	uint16_t	req_type;
46293 	/*
46294 	 * The completion ring to send the completion event on. This should
46295 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46296 	 */
46297 	uint16_t	cmpl_ring;
46298 	/*
46299 	 * The sequence ID is used by the driver for tracking multiple
46300 	 * commands. This ID is treated as opaque data by the firmware and
46301 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46302 	 */
46303 	uint16_t	seq_id;
46304 	/*
46305 	 * The target ID of the command:
46306 	 * * 0x0-0xFFF8 - The function ID
46307 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46308 	 * * 0xFFFD - Reserved for user-space HWRM interface
46309 	 * * 0xFFFF - HWRM
46310 	 */
46311 	uint16_t	target_id;
46312 	/*
46313 	 * A physical address pointer pointing to a host buffer that the
46314 	 * command's response data will be written. This can be either a host
46315 	 * physical address (HPA) or a guest physical address (GPA) and must
46316 	 * point to a physically contiguous block of memory.
46317 	 */
46318 	uint64_t	resp_addr;
46319 	/* This value is an opaque id into CFA data structures. */
46320 	uint64_t	tunnel_filter_id;
46321 } hwrm_cfa_tunnel_filter_free_input_t, *phwrm_cfa_tunnel_filter_free_input_t;
46322 
46323 /* hwrm_cfa_tunnel_filter_free_output (size:128b/16B) */
46324 
46325 typedef struct hwrm_cfa_tunnel_filter_free_output {
46326 	/* The specific error status for the command. */
46327 	uint16_t	error_code;
46328 	/* The HWRM command request type. */
46329 	uint16_t	req_type;
46330 	/* The sequence ID from the original command. */
46331 	uint16_t	seq_id;
46332 	/* The length of the response data in number of bytes. */
46333 	uint16_t	resp_len;
46334 	uint8_t	unused_0[7];
46335 	/*
46336 	 * This field is used in Output records to indicate that the output
46337 	 * is completely written to RAM. This field should be read as '1'
46338 	 * to indicate that the output has been completely written.
46339 	 * When writing a command completion or response to an internal
46340 	 * processor, the order of writes has to be such that this field is
46341 	 * written last.
46342 	 */
46343 	uint8_t	valid;
46344 } hwrm_cfa_tunnel_filter_free_output_t, *phwrm_cfa_tunnel_filter_free_output_t;
46345 
46346 /***************************************
46347  * hwrm_cfa_redirect_tunnel_type_alloc *
46348  ***************************************/
46349 
46350 
46351 /* hwrm_cfa_redirect_tunnel_type_alloc_input (size:192b/24B) */
46352 
46353 typedef struct hwrm_cfa_redirect_tunnel_type_alloc_input {
46354 	/* The HWRM command request type. */
46355 	uint16_t	req_type;
46356 	/*
46357 	 * The completion ring to send the completion event on. This should
46358 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46359 	 */
46360 	uint16_t	cmpl_ring;
46361 	/*
46362 	 * The sequence ID is used by the driver for tracking multiple
46363 	 * commands. This ID is treated as opaque data by the firmware and
46364 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46365 	 */
46366 	uint16_t	seq_id;
46367 	/*
46368 	 * The target ID of the command:
46369 	 * * 0x0-0xFFF8 - The function ID
46370 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46371 	 * * 0xFFFD - Reserved for user-space HWRM interface
46372 	 * * 0xFFFF - HWRM
46373 	 */
46374 	uint16_t	target_id;
46375 	/*
46376 	 * A physical address pointer pointing to a host buffer that the
46377 	 * command's response data will be written. This can be either a host
46378 	 * physical address (HPA) or a guest physical address (GPA) and must
46379 	 * point to a physically contiguous block of memory.
46380 	 */
46381 	uint64_t	resp_addr;
46382 	/* The destination function id, to whom the traffic is redirected. */
46383 	uint16_t	dest_fid;
46384 	/* Tunnel Type. */
46385 	uint8_t	tunnel_type;
46386 	/* Non-tunnel */
46387 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
46388 	/* Virtual eXtensible Local Area Network (VXLAN) */
46389 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
46390 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
46391 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
46392 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
46393 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
46394 	/* IP in IP */
46395 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
46396 	/* Generic Network Virtualization Encapsulation (Geneve) */
46397 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
46398 	/* Multi-Protocol Label Switching (MPLS) */
46399 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
46400 	/* Stateless Transport Tunnel (STT) */
46401 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
46402 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
46403 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
46404 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
46405 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
46406 	/*
46407 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
46408 	 * datagram payload
46409 	 */
46410 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
46411 	/* Use fixed layer 2 ether type of 0xFFFF */
46412 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
46413 	/*
46414 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
46415 	 * (IPV6oVXLANGPE)
46416 	 */
46417 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
46418 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
46419 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
46420 	/* Any tunneled traffic */
46421 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
46422 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
46423 	/* Tunnel alloc flags. */
46424 	uint8_t	flags;
46425 	/*
46426 	 * Setting of this flag indicates modify existing redirect tunnel
46427 	 * to new destination function ID.
46428 	 */
46429 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_FLAGS_MODIFY_DST	UINT32_C(0x1)
46430 	uint8_t	unused_0[4];
46431 } hwrm_cfa_redirect_tunnel_type_alloc_input_t, *phwrm_cfa_redirect_tunnel_type_alloc_input_t;
46432 
46433 /* hwrm_cfa_redirect_tunnel_type_alloc_output (size:128b/16B) */
46434 
46435 typedef struct hwrm_cfa_redirect_tunnel_type_alloc_output {
46436 	/* The specific error status for the command. */
46437 	uint16_t	error_code;
46438 	/* The HWRM command request type. */
46439 	uint16_t	req_type;
46440 	/* The sequence ID from the original command. */
46441 	uint16_t	seq_id;
46442 	/* The length of the response data in number of bytes. */
46443 	uint16_t	resp_len;
46444 	uint8_t	unused_0[7];
46445 	/*
46446 	 * This field is used in Output records to indicate that the output
46447 	 * is completely written to RAM. This field should be read as '1'
46448 	 * to indicate that the output has been completely written.
46449 	 * When writing a command completion or response to an internal
46450 	 * processor, the order of writes has to be such that this field is
46451 	 * written last.
46452 	 */
46453 	uint8_t	valid;
46454 } hwrm_cfa_redirect_tunnel_type_alloc_output_t, *phwrm_cfa_redirect_tunnel_type_alloc_output_t;
46455 
46456 /**************************************
46457  * hwrm_cfa_redirect_tunnel_type_free *
46458  **************************************/
46459 
46460 
46461 /* hwrm_cfa_redirect_tunnel_type_free_input (size:192b/24B) */
46462 
46463 typedef struct hwrm_cfa_redirect_tunnel_type_free_input {
46464 	/* The HWRM command request type. */
46465 	uint16_t	req_type;
46466 	/*
46467 	 * The completion ring to send the completion event on. This should
46468 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46469 	 */
46470 	uint16_t	cmpl_ring;
46471 	/*
46472 	 * The sequence ID is used by the driver for tracking multiple
46473 	 * commands. This ID is treated as opaque data by the firmware and
46474 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46475 	 */
46476 	uint16_t	seq_id;
46477 	/*
46478 	 * The target ID of the command:
46479 	 * * 0x0-0xFFF8 - The function ID
46480 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46481 	 * * 0xFFFD - Reserved for user-space HWRM interface
46482 	 * * 0xFFFF - HWRM
46483 	 */
46484 	uint16_t	target_id;
46485 	/*
46486 	 * A physical address pointer pointing to a host buffer that the
46487 	 * command's response data will be written. This can be either a host
46488 	 * physical address (HPA) or a guest physical address (GPA) and must
46489 	 * point to a physically contiguous block of memory.
46490 	 */
46491 	uint64_t	resp_addr;
46492 	/* The destination function id, to whom the traffic is redirected. */
46493 	uint16_t	dest_fid;
46494 	/* Tunnel Type. */
46495 	uint8_t	tunnel_type;
46496 	/* Non-tunnel */
46497 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
46498 	/* Virtual eXtensible Local Area Network (VXLAN) */
46499 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
46500 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
46501 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
46502 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
46503 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
46504 	/* IP in IP */
46505 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
46506 	/* Generic Network Virtualization Encapsulation (Geneve) */
46507 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
46508 	/* Multi-Protocol Label Switching (MPLS) */
46509 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
46510 	/* Stateless Transport Tunnel (STT) */
46511 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
46512 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
46513 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
46514 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
46515 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
46516 	/*
46517 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
46518 	 * datagram payload
46519 	 */
46520 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
46521 	/* Use fixed layer 2 ether type of 0xFFFF */
46522 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
46523 	/*
46524 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
46525 	 * (IPV6oVXLANGPE)
46526 	 */
46527 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
46528 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
46529 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
46530 	/* Any tunneled traffic */
46531 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
46532 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL
46533 	uint8_t	unused_0[5];
46534 } hwrm_cfa_redirect_tunnel_type_free_input_t, *phwrm_cfa_redirect_tunnel_type_free_input_t;
46535 
46536 /* hwrm_cfa_redirect_tunnel_type_free_output (size:128b/16B) */
46537 
46538 typedef struct hwrm_cfa_redirect_tunnel_type_free_output {
46539 	/* The specific error status for the command. */
46540 	uint16_t	error_code;
46541 	/* The HWRM command request type. */
46542 	uint16_t	req_type;
46543 	/* The sequence ID from the original command. */
46544 	uint16_t	seq_id;
46545 	/* The length of the response data in number of bytes. */
46546 	uint16_t	resp_len;
46547 	uint8_t	unused_0[7];
46548 	/*
46549 	 * This field is used in Output records to indicate that the output
46550 	 * is completely written to RAM. This field should be read as '1'
46551 	 * to indicate that the output has been completely written.
46552 	 * When writing a command completion or response to an internal
46553 	 * processor, the order of writes has to be such that this field is
46554 	 * written last.
46555 	 */
46556 	uint8_t	valid;
46557 } hwrm_cfa_redirect_tunnel_type_free_output_t, *phwrm_cfa_redirect_tunnel_type_free_output_t;
46558 
46559 /**************************************
46560  * hwrm_cfa_redirect_tunnel_type_info *
46561  **************************************/
46562 
46563 
46564 /* hwrm_cfa_redirect_tunnel_type_info_input (size:192b/24B) */
46565 
46566 typedef struct hwrm_cfa_redirect_tunnel_type_info_input {
46567 	/* The HWRM command request type. */
46568 	uint16_t	req_type;
46569 	/*
46570 	 * The completion ring to send the completion event on. This should
46571 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46572 	 */
46573 	uint16_t	cmpl_ring;
46574 	/*
46575 	 * The sequence ID is used by the driver for tracking multiple
46576 	 * commands. This ID is treated as opaque data by the firmware and
46577 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46578 	 */
46579 	uint16_t	seq_id;
46580 	/*
46581 	 * The target ID of the command:
46582 	 * * 0x0-0xFFF8 - The function ID
46583 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46584 	 * * 0xFFFD - Reserved for user-space HWRM interface
46585 	 * * 0xFFFF - HWRM
46586 	 */
46587 	uint16_t	target_id;
46588 	/*
46589 	 * A physical address pointer pointing to a host buffer that the
46590 	 * command's response data will be written. This can be either a host
46591 	 * physical address (HPA) or a guest physical address (GPA) and must
46592 	 * point to a physically contiguous block of memory.
46593 	 */
46594 	uint64_t	resp_addr;
46595 	/* The source function id. */
46596 	uint16_t	src_fid;
46597 	/* Tunnel Type. */
46598 	uint8_t	tunnel_type;
46599 	/* Non-tunnel */
46600 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
46601 	/* Virtual eXtensible Local Area Network (VXLAN) */
46602 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
46603 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
46604 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
46605 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
46606 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
46607 	/* IP in IP */
46608 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
46609 	/* Generic Network Virtualization Encapsulation (Geneve) */
46610 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
46611 	/* Multi-Protocol Label Switching (MPLS) */
46612 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
46613 	/* Stateless Transport Tunnel (STT) */
46614 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
46615 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
46616 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
46617 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
46618 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
46619 	/*
46620 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
46621 	 * datagram payload
46622 	 */
46623 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
46624 	/* Use fixed layer 2 ether type of 0xFFFF */
46625 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
46626 	/*
46627 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
46628 	 * (IPV6oVXLANGPE)
46629 	 */
46630 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
46631 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
46632 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
46633 	/* Any tunneled traffic */
46634 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
46635 	#define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL
46636 	uint8_t	unused_0[5];
46637 } hwrm_cfa_redirect_tunnel_type_info_input_t, *phwrm_cfa_redirect_tunnel_type_info_input_t;
46638 
46639 /* hwrm_cfa_redirect_tunnel_type_info_output (size:128b/16B) */
46640 
46641 typedef struct hwrm_cfa_redirect_tunnel_type_info_output {
46642 	/* The specific error status for the command. */
46643 	uint16_t	error_code;
46644 	/* The HWRM command request type. */
46645 	uint16_t	req_type;
46646 	/* The sequence ID from the original command. */
46647 	uint16_t	seq_id;
46648 	/* The length of the response data in number of bytes. */
46649 	uint16_t	resp_len;
46650 	/* The destination function id, to whom the traffic is redirected. */
46651 	uint16_t	dest_fid;
46652 	uint8_t	unused_0[5];
46653 	/*
46654 	 * This field is used in Output records to indicate that the output
46655 	 * is completely written to RAM. This field should be read as '1'
46656 	 * to indicate that the output has been completely written.
46657 	 * When writing a command completion or response to an internal
46658 	 * processor, the order of writes has to be such that this field is
46659 	 * written last.
46660 	 */
46661 	uint8_t	valid;
46662 } hwrm_cfa_redirect_tunnel_type_info_output_t, *phwrm_cfa_redirect_tunnel_type_info_output_t;
46663 
46664 /* hwrm_vxlan_ipv4_hdr (size:128b/16B) */
46665 
46666 typedef struct hwrm_vxlan_ipv4_hdr {
46667 	/* IPv4 version and header length. */
46668 	uint8_t	ver_hlen;
46669 	/* IPv4 header length */
46670 	#define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_MASK UINT32_C(0xf)
46671 	#define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_SFT 0
46672 	/* Version */
46673 	#define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_MASK	UINT32_C(0xf0)
46674 	#define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_SFT	4
46675 	/* IPv4 type of service. */
46676 	uint8_t	tos;
46677 	/* IPv4 identification. */
46678 	uint16_t	ip_id;
46679 	/* IPv4 flags and offset. */
46680 	uint16_t	flags_frag_offset;
46681 	/* IPv4 TTL. */
46682 	uint8_t	ttl;
46683 	/* IPv4 protocol. */
46684 	uint8_t	protocol;
46685 	/* IPv4 source address. */
46686 	uint32_t	src_ip_addr;
46687 	/* IPv4 destination address. */
46688 	uint32_t	dest_ip_addr;
46689 } hwrm_vxlan_ipv4_hdr_t, *phwrm_vxlan_ipv4_hdr_t;
46690 
46691 /* hwrm_vxlan_ipv6_hdr (size:320b/40B) */
46692 
46693 typedef struct hwrm_vxlan_ipv6_hdr {
46694 	/* IPv6 version, traffic class and flow label. */
46695 	uint32_t	ver_tc_flow_label;
46696 	/* IPv6 version shift */
46697 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_SFT	UINT32_C(0x1c)
46698 	/* IPv6 version mask */
46699 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_MASK	UINT32_C(0xf0000000)
46700 	/* IPv6 TC shift */
46701 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_SFT	UINT32_C(0x14)
46702 	/* IPv6 TC mask */
46703 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_MASK	UINT32_C(0xff00000)
46704 	/* IPv6 flow label shift */
46705 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_SFT  UINT32_C(0x0)
46706 	/* IPv6 flow label mask */
46707 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK UINT32_C(0xfffff)
46708 	#define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_LAST	HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK
46709 	/* IPv6 payload length. */
46710 	uint16_t	payload_len;
46711 	/* IPv6 next header. */
46712 	uint8_t	next_hdr;
46713 	/* IPv6 TTL. */
46714 	uint8_t	ttl;
46715 	/* IPv6 source address. */
46716 	uint32_t	src_ip_addr[4];
46717 	/* IPv6 destination address. */
46718 	uint32_t	dest_ip_addr[4];
46719 } hwrm_vxlan_ipv6_hdr_t, *phwrm_vxlan_ipv6_hdr_t;
46720 
46721 /* hwrm_cfa_encap_data_vxlan (size:640b/80B) */
46722 
46723 typedef struct hwrm_cfa_encap_data_vxlan {
46724 	/* Source MAC address. */
46725 	uint8_t	src_mac_addr[6];
46726 	/* reserved. */
46727 	uint16_t	unused_0;
46728 	/* Destination MAC address. */
46729 	uint8_t	dst_mac_addr[6];
46730 	/* Number of VLAN tags. */
46731 	uint8_t	num_vlan_tags;
46732 	/* reserved. */
46733 	uint8_t	unused_1;
46734 	/* Outer VLAN TPID. */
46735 	uint16_t	ovlan_tpid;
46736 	/* Outer VLAN TCI. */
46737 	uint16_t	ovlan_tci;
46738 	/* Inner VLAN TPID. */
46739 	uint16_t	ivlan_tpid;
46740 	/* Inner VLAN TCI. */
46741 	uint16_t	ivlan_tci;
46742 	/* L3 header fields. */
46743 	uint32_t	l3[10];
46744 	/* IP version mask. */
46745 	#define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_MASK UINT32_C(0xf)
46746 	/* IP version 4. */
46747 	#define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV4 UINT32_C(0x4)
46748 	/* IP version 6. */
46749 	#define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6 UINT32_C(0x6)
46750 	#define HWRM_CFA_ENCAP_DATA_VXLAN_L3_LAST	HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6
46751 	/* UDP source port. */
46752 	uint16_t	src_port;
46753 	/* UDP destination port. */
46754 	uint16_t	dst_port;
46755 	/* VXLAN Network Identifier. */
46756 	uint32_t	vni;
46757 	/*
46758 	 * 3 bytes VXLAN header reserve fields from 1st dword of the VXLAN
46759 	 * header.
46760 	 */
46761 	uint8_t	hdr_rsvd0[3];
46762 	/* 1 byte VXLAN header reserve field from 2nd dword of the VXLAN header. */
46763 	uint8_t	hdr_rsvd1;
46764 	/* VXLAN header flags field. */
46765 	uint8_t	hdr_flags;
46766 	uint8_t	unused[3];
46767 } hwrm_cfa_encap_data_vxlan_t, *phwrm_cfa_encap_data_vxlan_t;
46768 
46769 /*******************************
46770  * hwrm_cfa_encap_record_alloc *
46771  *******************************/
46772 
46773 
46774 /* hwrm_cfa_encap_record_alloc_input (size:832b/104B) */
46775 
46776 typedef struct hwrm_cfa_encap_record_alloc_input {
46777 	/* The HWRM command request type. */
46778 	uint16_t	req_type;
46779 	/*
46780 	 * The completion ring to send the completion event on. This should
46781 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46782 	 */
46783 	uint16_t	cmpl_ring;
46784 	/*
46785 	 * The sequence ID is used by the driver for tracking multiple
46786 	 * commands. This ID is treated as opaque data by the firmware and
46787 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46788 	 */
46789 	uint16_t	seq_id;
46790 	/*
46791 	 * The target ID of the command:
46792 	 * * 0x0-0xFFF8 - The function ID
46793 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46794 	 * * 0xFFFD - Reserved for user-space HWRM interface
46795 	 * * 0xFFFF - HWRM
46796 	 */
46797 	uint16_t	target_id;
46798 	/*
46799 	 * A physical address pointer pointing to a host buffer that the
46800 	 * command's response data will be written. This can be either a host
46801 	 * physical address (HPA) or a guest physical address (GPA) and must
46802 	 * point to a physically contiguous block of memory.
46803 	 */
46804 	uint64_t	resp_addr;
46805 	uint32_t	flags;
46806 	/*
46807 	 * Setting of this flag indicates the applicability to the loopback
46808 	 * path.
46809 	 */
46810 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_LOOPBACK	UINT32_C(0x1)
46811 	/*
46812 	 * Setting of this flag indicates this encap record is external
46813 	 * encap record. Resetting of this flag indicates this flag is
46814 	 * internal encap record and this is the default setting.
46815 	 */
46816 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_EXTERNAL	UINT32_C(0x2)
46817 	/* Encapsulation Type. */
46818 	uint8_t	encap_type;
46819 	/* Virtual eXtensible Local Area Network (VXLAN) */
46820 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN	UINT32_C(0x1)
46821 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
46822 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_NVGRE	UINT32_C(0x2)
46823 	/* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
46824 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2GRE	UINT32_C(0x3)
46825 	/* IP in IP */
46826 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPIP	UINT32_C(0x4)
46827 	/* Generic Network Virtualization Encapsulation (Geneve) */
46828 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_GENEVE	UINT32_C(0x5)
46829 	/* Multi-Protocol Label Switching (MPLS) */
46830 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_MPLS	UINT32_C(0x6)
46831 	/* VLAN */
46832 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VLAN	UINT32_C(0x7)
46833 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
46834 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE	UINT32_C(0x8)
46835 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
46836 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_V4	UINT32_C(0x9)
46837 	/*
46838 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
46839 	 * datagram payload
46840 	 */
46841 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE_V1	UINT32_C(0xa)
46842 	/* Use fixed layer 2 ether type of 0xFFFF */
46843 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2_ETYPE	UINT32_C(0xb)
46844 	/*
46845 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
46846 	 * (IPV6oVXLANGPE)
46847 	 */
46848 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
46849 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
46850 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE	UINT32_C(0x10)
46851 	#define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_LAST	HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE
46852 	uint8_t	unused_0[3];
46853 	/* This value is encap data used for the given encap type. */
46854 	uint32_t	encap_data[20];
46855 } hwrm_cfa_encap_record_alloc_input_t, *phwrm_cfa_encap_record_alloc_input_t;
46856 
46857 /* hwrm_cfa_encap_record_alloc_output (size:128b/16B) */
46858 
46859 typedef struct hwrm_cfa_encap_record_alloc_output {
46860 	/* The specific error status for the command. */
46861 	uint16_t	error_code;
46862 	/* The HWRM command request type. */
46863 	uint16_t	req_type;
46864 	/* The sequence ID from the original command. */
46865 	uint16_t	seq_id;
46866 	/* The length of the response data in number of bytes. */
46867 	uint16_t	resp_len;
46868 	/* This value is an opaque id into CFA data structures. */
46869 	uint32_t	encap_record_id;
46870 	uint8_t	unused_0[3];
46871 	/*
46872 	 * This field is used in Output records to indicate that the output
46873 	 * is completely written to RAM. This field should be read as '1'
46874 	 * to indicate that the output has been completely written.
46875 	 * When writing a command completion or response to an internal
46876 	 * processor, the order of writes has to be such that this field is
46877 	 * written last.
46878 	 */
46879 	uint8_t	valid;
46880 } hwrm_cfa_encap_record_alloc_output_t, *phwrm_cfa_encap_record_alloc_output_t;
46881 
46882 /******************************
46883  * hwrm_cfa_encap_record_free *
46884  ******************************/
46885 
46886 
46887 /* hwrm_cfa_encap_record_free_input (size:192b/24B) */
46888 
46889 typedef struct hwrm_cfa_encap_record_free_input {
46890 	/* The HWRM command request type. */
46891 	uint16_t	req_type;
46892 	/*
46893 	 * The completion ring to send the completion event on. This should
46894 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46895 	 */
46896 	uint16_t	cmpl_ring;
46897 	/*
46898 	 * The sequence ID is used by the driver for tracking multiple
46899 	 * commands. This ID is treated as opaque data by the firmware and
46900 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46901 	 */
46902 	uint16_t	seq_id;
46903 	/*
46904 	 * The target ID of the command:
46905 	 * * 0x0-0xFFF8 - The function ID
46906 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46907 	 * * 0xFFFD - Reserved for user-space HWRM interface
46908 	 * * 0xFFFF - HWRM
46909 	 */
46910 	uint16_t	target_id;
46911 	/*
46912 	 * A physical address pointer pointing to a host buffer that the
46913 	 * command's response data will be written. This can be either a host
46914 	 * physical address (HPA) or a guest physical address (GPA) and must
46915 	 * point to a physically contiguous block of memory.
46916 	 */
46917 	uint64_t	resp_addr;
46918 	/* This value is an opaque id into CFA data structures. */
46919 	uint32_t	encap_record_id;
46920 	uint8_t	unused_0[4];
46921 } hwrm_cfa_encap_record_free_input_t, *phwrm_cfa_encap_record_free_input_t;
46922 
46923 /* hwrm_cfa_encap_record_free_output (size:128b/16B) */
46924 
46925 typedef struct hwrm_cfa_encap_record_free_output {
46926 	/* The specific error status for the command. */
46927 	uint16_t	error_code;
46928 	/* The HWRM command request type. */
46929 	uint16_t	req_type;
46930 	/* The sequence ID from the original command. */
46931 	uint16_t	seq_id;
46932 	/* The length of the response data in number of bytes. */
46933 	uint16_t	resp_len;
46934 	uint8_t	unused_0[7];
46935 	/*
46936 	 * This field is used in Output records to indicate that the output
46937 	 * is completely written to RAM. This field should be read as '1'
46938 	 * to indicate that the output has been completely written.
46939 	 * When writing a command completion or response to an internal
46940 	 * processor, the order of writes has to be such that this field is
46941 	 * written last.
46942 	 */
46943 	uint8_t	valid;
46944 } hwrm_cfa_encap_record_free_output_t, *phwrm_cfa_encap_record_free_output_t;
46945 
46946 /********************************
46947  * hwrm_cfa_ntuple_filter_alloc *
46948  ********************************/
46949 
46950 
46951 /* hwrm_cfa_ntuple_filter_alloc_input (size:1024b/128B) */
46952 
46953 typedef struct hwrm_cfa_ntuple_filter_alloc_input {
46954 	/* The HWRM command request type. */
46955 	uint16_t	req_type;
46956 	/*
46957 	 * The completion ring to send the completion event on. This should
46958 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
46959 	 */
46960 	uint16_t	cmpl_ring;
46961 	/*
46962 	 * The sequence ID is used by the driver for tracking multiple
46963 	 * commands. This ID is treated as opaque data by the firmware and
46964 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
46965 	 */
46966 	uint16_t	seq_id;
46967 	/*
46968 	 * The target ID of the command:
46969 	 * * 0x0-0xFFF8 - The function ID
46970 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46971 	 * * 0xFFFD - Reserved for user-space HWRM interface
46972 	 * * 0xFFFF - HWRM
46973 	 */
46974 	uint16_t	target_id;
46975 	/*
46976 	 * A physical address pointer pointing to a host buffer that the
46977 	 * command's response data will be written. This can be either a host
46978 	 * physical address (HPA) or a guest physical address (GPA) and must
46979 	 * point to a physically contiguous block of memory.
46980 	 */
46981 	uint64_t	resp_addr;
46982 	uint32_t	flags;
46983 	/*
46984 	 * Setting of this flag indicates the applicability to the loopback
46985 	 * path.
46986 	 */
46987 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK		UINT32_C(0x1)
46988 	/*
46989 	 * Setting of this flag indicates drop action. If this flag is not
46990 	 * set, then it should be considered accept action.
46991 	 */
46992 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP		UINT32_C(0x2)
46993 	/*
46994 	 * Setting of this flag indicates that a meter is expected to be
46995 	 * attached to this flow. This hint can be used when choosing the
46996 	 * action record format required for the flow.
46997 	 */
46998 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER		UINT32_C(0x4)
46999 	/*
47000 	 * Setting of this flag indicates that the dst_id field contains
47001 	 * function ID. If this is not set it indicates dest_id is VNIC
47002 	 * or VPORT.
47003 	 */
47004 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_FID		UINT32_C(0x8)
47005 	/*
47006 	 * Setting of this flag indicates match on arp reply when ethertype
47007 	 * is 0x0806. If this is not set it indicates no specific arp opcode
47008 	 * matching.
47009 	 */
47010 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_ARP_REPLY		UINT32_C(0x10)
47011 	/*
47012 	 * Setting of this flag indicates that the dst_id field contains RFS
47013 	 * ring table index. If this is not set it indicates dst_id is VNIC
47014 	 * or VPORT or function ID. Note dest_fid and dest_rfs_ring_idx
47015 	 * can't be set at the same time. Updated drivers should pass ring
47016 	 * idx in the rfs_ring_tbl_idx field if the firmware indicates
47017 	 * support for the new field in the HWRM_CFA_ADV_FLOW_MGMT_QCAPS
47018 	 * response.
47019 	 */
47020 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_RFS_RING_IDX	UINT32_C(0x20)
47021 	/*
47022 	 * Setting of this flag indicates that when the ntuple filter is
47023 	 * created, the L2 context should not be used in the filter. This
47024 	 * allows packet from different L2 contexts to match and be directed
47025 	 * to the same destination.
47026 	 */
47027 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_NO_L2_CONTEXT	UINT32_C(0x40)
47028 	uint32_t	enables;
47029 	/*
47030 	 * This bit must be '1' for the l2_filter_id field to be
47031 	 * configured.
47032 	 */
47033 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID	UINT32_C(0x1)
47034 	/*
47035 	 * This bit must be '1' for the ethertype field to be
47036 	 * configured.
47037 	 */
47038 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE		UINT32_C(0x2)
47039 	/*
47040 	 * This bit must be '1' for the tunnel_type field to be
47041 	 * configured.
47042 	 */
47043 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE	UINT32_C(0x4)
47044 	/*
47045 	 * This bit must be '1' for the src_macaddr field to be
47046 	 * configured.
47047 	 */
47048 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR	UINT32_C(0x8)
47049 	/*
47050 	 * This bit must be '1' for the ipaddr_type field to be
47051 	 * configured.
47052 	 */
47053 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE	UINT32_C(0x10)
47054 	/*
47055 	 * This bit must be '1' for the src_ipaddr field to be
47056 	 * configured.
47057 	 */
47058 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR	UINT32_C(0x20)
47059 	/*
47060 	 * This bit must be '1' for the src_ipaddr_mask field to be
47061 	 * configured.
47062 	 */
47063 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK	UINT32_C(0x40)
47064 	/*
47065 	 * This bit must be '1' for the dst_ipaddr field to be
47066 	 * configured.
47067 	 */
47068 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR	UINT32_C(0x80)
47069 	/*
47070 	 * This bit must be '1' for the dst_ipaddr_mask field to be
47071 	 * configured.
47072 	 */
47073 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK	UINT32_C(0x100)
47074 	/*
47075 	 * This bit must be '1' for the ip_protocol field to be
47076 	 * configured.
47077 	 */
47078 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL	UINT32_C(0x200)
47079 	/*
47080 	 * This bit must be '1' for the src_port field to be
47081 	 * configured.
47082 	 */
47083 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT		UINT32_C(0x400)
47084 	/*
47085 	 * This bit must be '1' for the src_port_mask field to be
47086 	 * configured.
47087 	 */
47088 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK	UINT32_C(0x800)
47089 	/*
47090 	 * This bit must be '1' for the dst_port field to be
47091 	 * configured.
47092 	 */
47093 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT		UINT32_C(0x1000)
47094 	/*
47095 	 * This bit must be '1' for the dst_port_mask field to be
47096 	 * configured.
47097 	 */
47098 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK	UINT32_C(0x2000)
47099 	/*
47100 	 * This bit must be '1' for the pri_hint field to be
47101 	 * configured.
47102 	 */
47103 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT		UINT32_C(0x4000)
47104 	/*
47105 	 * This bit must be '1' for the ntuple_filter_id field to be
47106 	 * configured.
47107 	 */
47108 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID	UINT32_C(0x8000)
47109 	/*
47110 	 * This bit must be '1' for the dst_id field to be
47111 	 * configured.
47112 	 */
47113 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID		UINT32_C(0x10000)
47114 	/* This flag is deprecated. */
47115 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID	UINT32_C(0x20000)
47116 	/*
47117 	 * This bit must be '1' for the dst_macaddr field to be
47118 	 * configured.
47119 	 */
47120 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR	UINT32_C(0x40000)
47121 	/*
47122 	 * This bit must be '1' for the rfs_ring_tbl_idx field to
47123 	 * be configured.
47124 	 */
47125 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_RFS_RING_TBL_IDX	UINT32_C(0x80000)
47126 	/*
47127 	 * This value identifies a set of CFA data structures used for an L2
47128 	 * context.
47129 	 */
47130 	uint64_t	l2_filter_id;
47131 	/*
47132 	 * This value indicates the source MAC address in
47133 	 * the Ethernet header.
47134 	 */
47135 	uint8_t	src_macaddr[6];
47136 	/* This value indicates the ethertype in the Ethernet header. */
47137 	uint16_t	ethertype;
47138 	/*
47139 	 * This value indicates the type of IP address.
47140 	 * 4 - IPv4
47141 	 * 6 - IPv6
47142 	 * All others are invalid.
47143 	 */
47144 	uint8_t	ip_addr_type;
47145 	/* invalid */
47146 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
47147 	/* IPv4 */
47148 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4	UINT32_C(0x4)
47149 	/* IPv6 */
47150 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6	UINT32_C(0x6)
47151 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST   HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
47152 	/*
47153 	 * The value of protocol field in IP header.
47154 	 * Applies to UDP and TCP traffic.
47155 	 * 6 - TCP
47156 	 * 17 - UDP
47157 	 * 1 - ICMP
47158 	 * 58 - ICMPV6
47159 	 * 255 - RSVD
47160 	 */
47161 	uint8_t	ip_protocol;
47162 	/* invalid */
47163 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
47164 	/* TCP */
47165 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP	UINT32_C(0x6)
47166 	/* UDP */
47167 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP	UINT32_C(0x11)
47168 	/* ICMP */
47169 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_ICMP	UINT32_C(0x1)
47170 	/* ICMPV6 */
47171 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_ICMPV6  UINT32_C(0x3a)
47172 	/* RSVD */
47173 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_RSVD	UINT32_C(0xff)
47174 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST   HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_RSVD
47175 	/*
47176 	 * If set, this value shall represent the
47177 	 * Logical VNIC ID of the destination VNIC for the RX
47178 	 * path and network port id of the destination port for
47179 	 * the TX path.
47180 	 */
47181 	uint16_t	dst_id;
47182 	/*
47183 	 * If set, this value shall represent the ring table
47184 	 * index for receive flow steering. Note that this offset
47185 	 * was formerly used for the mirror_vnic_id field, which
47186 	 * is no longer supported.
47187 	 */
47188 	uint16_t	rfs_ring_tbl_idx;
47189 	/*
47190 	 * This value indicates the tunnel type for this filter.
47191 	 * If this field is not specified, then the filter shall
47192 	 * apply to both non-tunneled and tunneled packets.
47193 	 * If this field conflicts with the tunnel_type specified
47194 	 * in the l2_filter_id, then the HWRM shall return an
47195 	 * error for this command.
47196 	 */
47197 	uint8_t	tunnel_type;
47198 	/* Non-tunnel */
47199 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
47200 	/* Virtual eXtensible Local Area Network (VXLAN) */
47201 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
47202 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
47203 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
47204 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
47205 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
47206 	/* IP in IP */
47207 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
47208 	/* Generic Network Virtualization Encapsulation (Geneve) */
47209 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
47210 	/* Multi-Protocol Label Switching (MPLS) */
47211 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
47212 	/* Stateless Transport Tunnel (STT) */
47213 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
47214 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
47215 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
47216 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
47217 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
47218 	/*
47219 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
47220 	 * datagram payload
47221 	 */
47222 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
47223 	/* Use fixed layer 2 ether type of 0xFFFF */
47224 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
47225 	/*
47226 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
47227 	 * (IPV6oVXLANGPE)
47228 	 */
47229 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
47230 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
47231 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
47232 	/* Any tunneled traffic */
47233 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
47234 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
47235 	/*
47236 	 * This hint is provided to help in placing
47237 	 * the filter in the filter table.
47238 	 */
47239 	uint8_t	pri_hint;
47240 	/* No preference */
47241 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER UINT32_C(0x0)
47242 	/* Above the given filter */
47243 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE	UINT32_C(0x1)
47244 	/* Below the given filter */
47245 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW	UINT32_C(0x2)
47246 	/* As high as possible */
47247 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST   UINT32_C(0x3)
47248 	/* As low as possible */
47249 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST	UINT32_C(0x4)
47250 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LAST	HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST
47251 	/*
47252 	 * The value of source IP address to be used in filtering.
47253 	 * For IPv4, first four bytes represent the IP address.
47254 	 */
47255 	uint32_t	src_ipaddr[4];
47256 	/*
47257 	 * The value of source IP address mask to be used in
47258 	 * filtering.
47259 	 * For IPv4, first four bytes represent the IP address mask.
47260 	 */
47261 	uint32_t	src_ipaddr_mask[4];
47262 	/*
47263 	 * The value of destination IP address to be used in filtering.
47264 	 * For IPv4, first four bytes represent the IP address.
47265 	 */
47266 	uint32_t	dst_ipaddr[4];
47267 	/*
47268 	 * The value of destination IP address mask to be used in
47269 	 * filtering.
47270 	 * For IPv4, first four bytes represent the IP address mask.
47271 	 */
47272 	uint32_t	dst_ipaddr_mask[4];
47273 	/*
47274 	 * The value of source port to be used in filtering.
47275 	 * Applies to UDP and TCP traffic.
47276 	 */
47277 	uint16_t	src_port;
47278 	/*
47279 	 * The value of source port mask to be used in filtering.
47280 	 * Applies to UDP and TCP traffic.
47281 	 */
47282 	uint16_t	src_port_mask;
47283 	/*
47284 	 * The value of destination port to be used in filtering.
47285 	 * Applies to UDP and TCP traffic.
47286 	 */
47287 	uint16_t	dst_port;
47288 	/*
47289 	 * The value of destination port mask to be used in
47290 	 * filtering.
47291 	 * Applies to UDP and TCP traffic.
47292 	 */
47293 	uint16_t	dst_port_mask;
47294 	/*
47295 	 * This is the ID of the filter that goes along with
47296 	 * the pri_hint.
47297 	 */
47298 	uint64_t	ntuple_filter_id_hint;
47299 } hwrm_cfa_ntuple_filter_alloc_input_t, *phwrm_cfa_ntuple_filter_alloc_input_t;
47300 
47301 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */
47302 
47303 typedef struct hwrm_cfa_ntuple_filter_alloc_output {
47304 	/* The specific error status for the command. */
47305 	uint16_t	error_code;
47306 	/* The HWRM command request type. */
47307 	uint16_t	req_type;
47308 	/* The sequence ID from the original command. */
47309 	uint16_t	seq_id;
47310 	/* The length of the response data in number of bytes. */
47311 	uint16_t	resp_len;
47312 	/* This value is an opaque id into CFA data structures. */
47313 	uint64_t	ntuple_filter_id;
47314 	/*
47315 	 * The flow id value in bit 0-29 is the actual ID of the flow
47316 	 * associated with this filter and it shall be used to match
47317 	 * and associate the flow identifier returned in completion
47318 	 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
47319 	 * shall indicate no valid flow id.
47320 	 */
47321 	uint32_t	flow_id;
47322 	/* Indicate the flow id value. */
47323 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
47324 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
47325 	/* Indicate type of the flow. */
47326 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE	UINT32_C(0x40000000)
47327 	/*
47328 	 * If this bit set to 0, then it indicates that the flow is
47329 	 * internal flow.
47330 	 */
47331 		#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT	(UINT32_C(0x0) << 30)
47332 	/*
47333 	 * If this bit is set to 1, then it indicates that the flow is
47334 	 * external flow.
47335 	 */
47336 		#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT	(UINT32_C(0x1) << 30)
47337 		#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST  HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
47338 	/* Indicate the flow direction. */
47339 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR	UINT32_C(0x80000000)
47340 	/* If this bit set to 0, then it indicates rx flow. */
47341 		#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX	(UINT32_C(0x0) << 31)
47342 	/* If this bit is set to 1, then it indicates that tx flow. */
47343 		#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX	(UINT32_C(0x1) << 31)
47344 		#define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST   HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
47345 	uint8_t	unused_0[3];
47346 	/*
47347 	 * This field is used in Output records to indicate that the output
47348 	 * is completely written to RAM. This field should be read as '1'
47349 	 * to indicate that the output has been completely written.
47350 	 * When writing a command completion or response to an internal
47351 	 * processor, the order of writes has to be such that this field is
47352 	 * written last.
47353 	 */
47354 	uint8_t	valid;
47355 } hwrm_cfa_ntuple_filter_alloc_output_t, *phwrm_cfa_ntuple_filter_alloc_output_t;
47356 
47357 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */
47358 
47359 typedef struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
47360 	/*
47361 	 * command specific error codes that goes to
47362 	 * the cmd_err field in Common HWRM Error Response.
47363 	 */
47364 	uint8_t	code;
47365 	/* Unknown error */
47366 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN		UINT32_C(0x0)
47367 	/* Unable to complete operation due to conflict with Rx Mask VLAN */
47368 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR UINT32_C(0x1)
47369 	#define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST			HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR
47370 	uint8_t	unused_0[7];
47371 } hwrm_cfa_ntuple_filter_alloc_cmd_err_t, *phwrm_cfa_ntuple_filter_alloc_cmd_err_t;
47372 
47373 /*******************************
47374  * hwrm_cfa_ntuple_filter_free *
47375  *******************************/
47376 
47377 
47378 /* hwrm_cfa_ntuple_filter_free_input (size:192b/24B) */
47379 
47380 typedef struct hwrm_cfa_ntuple_filter_free_input {
47381 	/* The HWRM command request type. */
47382 	uint16_t	req_type;
47383 	/*
47384 	 * The completion ring to send the completion event on. This should
47385 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47386 	 */
47387 	uint16_t	cmpl_ring;
47388 	/*
47389 	 * The sequence ID is used by the driver for tracking multiple
47390 	 * commands. This ID is treated as opaque data by the firmware and
47391 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47392 	 */
47393 	uint16_t	seq_id;
47394 	/*
47395 	 * The target ID of the command:
47396 	 * * 0x0-0xFFF8 - The function ID
47397 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47398 	 * * 0xFFFD - Reserved for user-space HWRM interface
47399 	 * * 0xFFFF - HWRM
47400 	 */
47401 	uint16_t	target_id;
47402 	/*
47403 	 * A physical address pointer pointing to a host buffer that the
47404 	 * command's response data will be written. This can be either a host
47405 	 * physical address (HPA) or a guest physical address (GPA) and must
47406 	 * point to a physically contiguous block of memory.
47407 	 */
47408 	uint64_t	resp_addr;
47409 	/* This value is an opaque id into CFA data structures. */
47410 	uint64_t	ntuple_filter_id;
47411 } hwrm_cfa_ntuple_filter_free_input_t, *phwrm_cfa_ntuple_filter_free_input_t;
47412 
47413 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */
47414 
47415 typedef struct hwrm_cfa_ntuple_filter_free_output {
47416 	/* The specific error status for the command. */
47417 	uint16_t	error_code;
47418 	/* The HWRM command request type. */
47419 	uint16_t	req_type;
47420 	/* The sequence ID from the original command. */
47421 	uint16_t	seq_id;
47422 	/* The length of the response data in number of bytes. */
47423 	uint16_t	resp_len;
47424 	uint8_t	unused_0[7];
47425 	/*
47426 	 * This field is used in Output records to indicate that the output
47427 	 * is completely written to RAM. This field should be read as '1'
47428 	 * to indicate that the output has been completely written.
47429 	 * When writing a command completion or response to an internal
47430 	 * processor, the order of writes has to be such that this field is
47431 	 * written last.
47432 	 */
47433 	uint8_t	valid;
47434 } hwrm_cfa_ntuple_filter_free_output_t, *phwrm_cfa_ntuple_filter_free_output_t;
47435 
47436 /******************************
47437  * hwrm_cfa_ntuple_filter_cfg *
47438  ******************************/
47439 
47440 
47441 /* hwrm_cfa_ntuple_filter_cfg_input (size:384b/48B) */
47442 
47443 typedef struct hwrm_cfa_ntuple_filter_cfg_input {
47444 	/* The HWRM command request type. */
47445 	uint16_t	req_type;
47446 	/*
47447 	 * The completion ring to send the completion event on. This should
47448 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47449 	 */
47450 	uint16_t	cmpl_ring;
47451 	/*
47452 	 * The sequence ID is used by the driver for tracking multiple
47453 	 * commands. This ID is treated as opaque data by the firmware and
47454 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47455 	 */
47456 	uint16_t	seq_id;
47457 	/*
47458 	 * The target ID of the command:
47459 	 * * 0x0-0xFFF8 - The function ID
47460 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47461 	 * * 0xFFFD - Reserved for user-space HWRM interface
47462 	 * * 0xFFFF - HWRM
47463 	 */
47464 	uint16_t	target_id;
47465 	/*
47466 	 * A physical address pointer pointing to a host buffer that the
47467 	 * command's response data will be written. This can be either a host
47468 	 * physical address (HPA) or a guest physical address (GPA) and must
47469 	 * point to a physically contiguous block of memory.
47470 	 */
47471 	uint64_t	resp_addr;
47472 	uint32_t	enables;
47473 	/*
47474 	 * This bit must be '1' for the new_dst_id field to be
47475 	 * configured.
47476 	 */
47477 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID		UINT32_C(0x1)
47478 	/*
47479 	 * This bit must be '1' for the new_mirror_vnic_id field to be
47480 	 * configured.
47481 	 */
47482 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID	UINT32_C(0x2)
47483 	/*
47484 	 * This bit must be '1' for the new_meter_instance_id field to be
47485 	 * configured.
47486 	 */
47487 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID	UINT32_C(0x4)
47488 	uint32_t	flags;
47489 	/*
47490 	 * Setting this bit to 1 indicates that dest_id field contains FID.
47491 	 * Setting this to 0 indicates that dest_id field contains VNIC or
47492 	 * VPORT.
47493 	 */
47494 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_FID		UINT32_C(0x1)
47495 	/*
47496 	 * Setting of this flag indicates that the new_dst_id field contains
47497 	 * RFS ring table index. If this is not set it indicates new_dst_id
47498 	 * is VNIC or VPORT or function ID. Note dest_fid and
47499 	 * dest_rfs_ring_idx can't be set at the same time.
47500 	 */
47501 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_RFS_RING_IDX	UINT32_C(0x2)
47502 	/*
47503 	 * Setting of this flag indicates that when the ntuple filter is
47504 	 * created, the L2 context should not be used in the filter. This
47505 	 * allows packet from different L2 contexts to match and be directed
47506 	 * to the same destination.
47507 	 */
47508 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_NO_L2_CONTEXT	UINT32_C(0x4)
47509 	/* This value is an opaque id into CFA data structures. */
47510 	uint64_t	ntuple_filter_id;
47511 	/*
47512 	 * If set, this value shall represent the new
47513 	 * Logical VNIC ID of the destination VNIC for the RX
47514 	 * path and new network port id of the destination port for
47515 	 * the TX path.
47516 	 */
47517 	uint32_t	new_dst_id;
47518 	/*
47519 	 * New Logical VNIC ID of the VNIC where traffic is
47520 	 * mirrored.
47521 	 */
47522 	uint32_t	new_mirror_vnic_id;
47523 	/*
47524 	 * New meter to attach to the flow. Specifying the
47525 	 * invalid instance ID is used to remove any existing
47526 	 * meter from the flow.
47527 	 */
47528 	uint16_t	new_meter_instance_id;
47529 	/*
47530 	 * A value of 0xfff is considered invalid and implies the
47531 	 * instance is not configured.
47532 	 */
47533 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
47534 	#define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST   HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
47535 	uint8_t	unused_1[6];
47536 } hwrm_cfa_ntuple_filter_cfg_input_t, *phwrm_cfa_ntuple_filter_cfg_input_t;
47537 
47538 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */
47539 
47540 typedef struct hwrm_cfa_ntuple_filter_cfg_output {
47541 	/* The specific error status for the command. */
47542 	uint16_t	error_code;
47543 	/* The HWRM command request type. */
47544 	uint16_t	req_type;
47545 	/* The sequence ID from the original command. */
47546 	uint16_t	seq_id;
47547 	/* The length of the response data in number of bytes. */
47548 	uint16_t	resp_len;
47549 	uint8_t	unused_0[7];
47550 	/*
47551 	 * This field is used in Output records to indicate that the output
47552 	 * is completely written to RAM. This field should be read as '1'
47553 	 * to indicate that the output has been completely written.
47554 	 * When writing a command completion or response to an internal
47555 	 * processor, the order of writes has to be such that this field is
47556 	 * written last.
47557 	 */
47558 	uint8_t	valid;
47559 } hwrm_cfa_ntuple_filter_cfg_output_t, *phwrm_cfa_ntuple_filter_cfg_output_t;
47560 
47561 /**************************
47562  * hwrm_cfa_em_flow_alloc *
47563  **************************/
47564 
47565 
47566 /* hwrm_cfa_em_flow_alloc_input (size:896b/112B) */
47567 
47568 typedef struct hwrm_cfa_em_flow_alloc_input {
47569 	/* The HWRM command request type. */
47570 	uint16_t	req_type;
47571 	/*
47572 	 * The completion ring to send the completion event on. This should
47573 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47574 	 */
47575 	uint16_t	cmpl_ring;
47576 	/*
47577 	 * The sequence ID is used by the driver for tracking multiple
47578 	 * commands. This ID is treated as opaque data by the firmware and
47579 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47580 	 */
47581 	uint16_t	seq_id;
47582 	/*
47583 	 * The target ID of the command:
47584 	 * * 0x0-0xFFF8 - The function ID
47585 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47586 	 * * 0xFFFD - Reserved for user-space HWRM interface
47587 	 * * 0xFFFF - HWRM
47588 	 */
47589 	uint16_t	target_id;
47590 	/*
47591 	 * A physical address pointer pointing to a host buffer that the
47592 	 * command's response data will be written. This can be either a host
47593 	 * physical address (HPA) or a guest physical address (GPA) and must
47594 	 * point to a physically contiguous block of memory.
47595 	 */
47596 	uint64_t	resp_addr;
47597 	uint32_t	flags;
47598 	/*
47599 	 * Enumeration denoting the RX, TX type of the resource.
47600 	 * This enumeration is used for resources that are similar for both
47601 	 * TX and RX paths of the chip.
47602 	 */
47603 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH	UINT32_C(0x1)
47604 	/* tx path */
47605 		#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
47606 	/* rx path */
47607 		#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
47608 		#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST	HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
47609 	/*
47610 	 * Setting of this flag indicates enabling of a byte counter for a
47611 	 * given flow.
47612 	 */
47613 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR	UINT32_C(0x2)
47614 	/*
47615 	 * Setting of this flag indicates enabling of a packet counter for a
47616 	 * given flow.
47617 	 */
47618 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR	UINT32_C(0x4)
47619 	/*
47620 	 * Setting of this flag indicates de-capsulation action for the
47621 	 * given flow.
47622 	 */
47623 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP	UINT32_C(0x8)
47624 	/*
47625 	 * Setting of this flag indicates encapsulation action for the
47626 	 * given flow.
47627 	 */
47628 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP	UINT32_C(0x10)
47629 	/*
47630 	 * Setting of this flag indicates drop action. If this flag is not
47631 	 * set, then it should be considered accept action.
47632 	 */
47633 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP	UINT32_C(0x20)
47634 	/*
47635 	 * Setting of this flag indicates that a meter is expected to be
47636 	 * attached to this flow. This hint can be used when choosing the
47637 	 * action record format required for the flow.
47638 	 */
47639 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER	UINT32_C(0x40)
47640 	uint32_t	enables;
47641 	/*
47642 	 * This bit must be '1' for the l2_filter_id field to be
47643 	 * configured.
47644 	 */
47645 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID	UINT32_C(0x1)
47646 	/*
47647 	 * This bit must be '1' for the tunnel_type field to be
47648 	 * configured.
47649 	 */
47650 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE	UINT32_C(0x2)
47651 	/*
47652 	 * This bit must be '1' for the tunnel_id field to be
47653 	 * configured.
47654 	 */
47655 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID		UINT32_C(0x4)
47656 	/*
47657 	 * This bit must be '1' for the src_macaddr field to be
47658 	 * configured.
47659 	 */
47660 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR	UINT32_C(0x8)
47661 	/*
47662 	 * This bit must be '1' for the dst_macaddr field to be
47663 	 * configured.
47664 	 */
47665 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR	UINT32_C(0x10)
47666 	/*
47667 	 * This bit must be '1' for the ovlan_vid field to be
47668 	 * configured.
47669 	 */
47670 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID		UINT32_C(0x20)
47671 	/*
47672 	 * This bit must be '1' for the ivlan_vid field to be
47673 	 * configured.
47674 	 */
47675 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID		UINT32_C(0x40)
47676 	/*
47677 	 * This bit must be '1' for the ethertype field to be
47678 	 * configured.
47679 	 */
47680 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE		UINT32_C(0x80)
47681 	/*
47682 	 * This bit must be '1' for the src_ipaddr field to be
47683 	 * configured.
47684 	 */
47685 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR		UINT32_C(0x100)
47686 	/*
47687 	 * This bit must be '1' for the dst_ipaddr field to be
47688 	 * configured.
47689 	 */
47690 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR		UINT32_C(0x200)
47691 	/*
47692 	 * This bit must be '1' for the ipaddr_type field to be
47693 	 * configured.
47694 	 */
47695 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE	UINT32_C(0x400)
47696 	/*
47697 	 * This bit must be '1' for the ip_protocol field to be
47698 	 * configured.
47699 	 */
47700 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL	UINT32_C(0x800)
47701 	/*
47702 	 * This bit must be '1' for the src_port field to be
47703 	 * configured.
47704 	 */
47705 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT		UINT32_C(0x1000)
47706 	/*
47707 	 * This bit must be '1' for the dst_port field to be
47708 	 * configured.
47709 	 */
47710 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT		UINT32_C(0x2000)
47711 	/*
47712 	 * This bit must be '1' for the dst_id field to be
47713 	 * configured.
47714 	 */
47715 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID		UINT32_C(0x4000)
47716 	/*
47717 	 * This bit must be '1' for the mirror_vnic_id field to be
47718 	 * configured.
47719 	 */
47720 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID	UINT32_C(0x8000)
47721 	/*
47722 	 * This bit must be '1' for the encap_record_id field to be
47723 	 * configured.
47724 	 */
47725 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID	UINT32_C(0x10000)
47726 	/*
47727 	 * This bit must be '1' for the meter_instance_id field to be
47728 	 * configured.
47729 	 */
47730 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID	UINT32_C(0x20000)
47731 	/*
47732 	 * This value identifies a set of CFA data structures used for an L2
47733 	 * context.
47734 	 */
47735 	uint64_t	l2_filter_id;
47736 	/* Tunnel Type. */
47737 	uint8_t	tunnel_type;
47738 	/* Non-tunnel */
47739 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
47740 	/* Virtual eXtensible Local Area Network (VXLAN) */
47741 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
47742 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
47743 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
47744 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
47745 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
47746 	/* IP in IP */
47747 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
47748 	/* Generic Network Virtualization Encapsulation (Geneve) */
47749 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
47750 	/* Multi-Protocol Label Switching (MPLS) */
47751 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
47752 	/* Stateless Transport Tunnel (STT) */
47753 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
47754 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
47755 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
47756 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
47757 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
47758 	/*
47759 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
47760 	 * datagram payload
47761 	 */
47762 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
47763 	/* Use fixed layer 2 ether type of 0xFFFF */
47764 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
47765 	/*
47766 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
47767 	 * (IPV6oVXLANGPE)
47768 	 */
47769 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
47770 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
47771 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
47772 	/* Any tunneled traffic */
47773 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
47774 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
47775 	uint8_t	unused_0[3];
47776 	/*
47777 	 * Tunnel identifier.
47778 	 * Virtual Network Identifier (VNI). Only valid with
47779 	 * tunnel_types VXLAN, NVGRE, and Geneve.
47780 	 * Only lower 24-bits of VNI field are used
47781 	 * in setting up the filter.
47782 	 */
47783 	uint32_t	tunnel_id;
47784 	/*
47785 	 * This value indicates the source MAC address in
47786 	 * the Ethernet header.
47787 	 */
47788 	uint8_t	src_macaddr[6];
47789 	/* The meter instance to attach to the flow. */
47790 	uint16_t	meter_instance_id;
47791 	/*
47792 	 * A value of 0xfff is considered invalid and implies the
47793 	 * instance is not configured.
47794 	 */
47795 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
47796 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_LAST   HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID
47797 	/*
47798 	 * This value indicates the destination MAC address in
47799 	 * the Ethernet header.
47800 	 */
47801 	uint8_t	dst_macaddr[6];
47802 	/*
47803 	 * This value indicates the VLAN ID of the outer VLAN tag
47804 	 * in the Ethernet header.
47805 	 */
47806 	uint16_t	ovlan_vid;
47807 	/*
47808 	 * This value indicates the VLAN ID of the inner VLAN tag
47809 	 * in the Ethernet header.
47810 	 */
47811 	uint16_t	ivlan_vid;
47812 	/* This value indicates the ethertype in the Ethernet header. */
47813 	uint16_t	ethertype;
47814 	/*
47815 	 * This value indicates the type of IP address.
47816 	 * 4 - IPv4
47817 	 * 6 - IPv6
47818 	 * All others are invalid.
47819 	 */
47820 	uint8_t	ip_addr_type;
47821 	/* invalid */
47822 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
47823 	/* IPv4 */
47824 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4	UINT32_C(0x4)
47825 	/* IPv6 */
47826 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6	UINT32_C(0x6)
47827 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_LAST   HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
47828 	/*
47829 	 * The value of protocol field in IP header.
47830 	 * Applies to UDP and TCP traffic.
47831 	 * 6 - TCP
47832 	 * 17 - UDP
47833 	 */
47834 	uint8_t	ip_protocol;
47835 	/* invalid */
47836 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
47837 	/* TCP */
47838 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP	UINT32_C(0x6)
47839 	/* UDP */
47840 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP	UINT32_C(0x11)
47841 	#define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_LAST   HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP
47842 	uint8_t	unused_1[2];
47843 	/*
47844 	 * The value of source IP address to be used in filtering.
47845 	 * For IPv4, first four bytes represent the IP address.
47846 	 */
47847 	uint32_t	src_ipaddr[4];
47848 	/*
47849 	 * big_endian = True
47850 	 *	The value of destination IP address to be used in filtering.
47851 	 *	For IPv4, first four bytes represent the IP address.
47852 	 */
47853 	uint32_t	dst_ipaddr[4];
47854 	/*
47855 	 * The value of source port to be used in filtering.
47856 	 * Applies to UDP and TCP traffic.
47857 	 */
47858 	uint16_t	src_port;
47859 	/*
47860 	 * The value of destination port to be used in filtering.
47861 	 * Applies to UDP and TCP traffic.
47862 	 */
47863 	uint16_t	dst_port;
47864 	/*
47865 	 * If set, this value shall represent the
47866 	 * Logical VNIC ID of the destination VNIC for the RX
47867 	 * path and network port id of the destination port for
47868 	 * the TX path.
47869 	 */
47870 	uint16_t	dst_id;
47871 	/*
47872 	 * Logical VNIC ID of the VNIC where traffic is
47873 	 * mirrored.
47874 	 */
47875 	uint16_t	mirror_vnic_id;
47876 	/* Logical ID of the encapsulation record. */
47877 	uint32_t	encap_record_id;
47878 	uint8_t	unused_2[4];
47879 } hwrm_cfa_em_flow_alloc_input_t, *phwrm_cfa_em_flow_alloc_input_t;
47880 
47881 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */
47882 
47883 typedef struct hwrm_cfa_em_flow_alloc_output {
47884 	/* The specific error status for the command. */
47885 	uint16_t	error_code;
47886 	/* The HWRM command request type. */
47887 	uint16_t	req_type;
47888 	/* The sequence ID from the original command. */
47889 	uint16_t	seq_id;
47890 	/* The length of the response data in number of bytes. */
47891 	uint16_t	resp_len;
47892 	/* This value is an opaque id into CFA data structures. */
47893 	uint64_t	em_filter_id;
47894 	/*
47895 	 * The flow id value in bit 0-29 is the actual ID of the flow
47896 	 * associated with this filter and it shall be used to match
47897 	 * and associate the flow identifier returned in completion
47898 	 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
47899 	 * shall indicate no valid flow id.
47900 	 */
47901 	uint32_t	flow_id;
47902 	/* Indicate the flow id value. */
47903 	#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
47904 	#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
47905 	/* Indicate type of the flow. */
47906 	#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE	UINT32_C(0x40000000)
47907 	/*
47908 	 * If this bit set to 0, then it indicates that the flow is
47909 	 * internal flow.
47910 	 */
47911 		#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT	(UINT32_C(0x0) << 30)
47912 	/*
47913 	 * If this bit is set to 1, then it indicates that the flow is
47914 	 * external flow.
47915 	 */
47916 		#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT	(UINT32_C(0x1) << 30)
47917 		#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST  HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
47918 	/* Indicate the flow direction. */
47919 	#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR	UINT32_C(0x80000000)
47920 	/* If this bit set to 0, then it indicates rx flow. */
47921 		#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX	(UINT32_C(0x0) << 31)
47922 	/* If this bit is set to 1, then it indicates that tx flow. */
47923 		#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX	(UINT32_C(0x1) << 31)
47924 		#define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST   HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
47925 	uint8_t	unused_0[3];
47926 	/*
47927 	 * This field is used in Output records to indicate that the output
47928 	 * is completely written to RAM. This field should be read as '1'
47929 	 * to indicate that the output has been completely written.
47930 	 * When writing a command completion or response to an internal
47931 	 * processor, the order of writes has to be such that this field is
47932 	 * written last.
47933 	 */
47934 	uint8_t	valid;
47935 } hwrm_cfa_em_flow_alloc_output_t, *phwrm_cfa_em_flow_alloc_output_t;
47936 
47937 /*************************
47938  * hwrm_cfa_em_flow_free *
47939  *************************/
47940 
47941 
47942 /* hwrm_cfa_em_flow_free_input (size:192b/24B) */
47943 
47944 typedef struct hwrm_cfa_em_flow_free_input {
47945 	/* The HWRM command request type. */
47946 	uint16_t	req_type;
47947 	/*
47948 	 * The completion ring to send the completion event on. This should
47949 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
47950 	 */
47951 	uint16_t	cmpl_ring;
47952 	/*
47953 	 * The sequence ID is used by the driver for tracking multiple
47954 	 * commands. This ID is treated as opaque data by the firmware and
47955 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
47956 	 */
47957 	uint16_t	seq_id;
47958 	/*
47959 	 * The target ID of the command:
47960 	 * * 0x0-0xFFF8 - The function ID
47961 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47962 	 * * 0xFFFD - Reserved for user-space HWRM interface
47963 	 * * 0xFFFF - HWRM
47964 	 */
47965 	uint16_t	target_id;
47966 	/*
47967 	 * A physical address pointer pointing to a host buffer that the
47968 	 * command's response data will be written. This can be either a host
47969 	 * physical address (HPA) or a guest physical address (GPA) and must
47970 	 * point to a physically contiguous block of memory.
47971 	 */
47972 	uint64_t	resp_addr;
47973 	/* This value is an opaque id into CFA data structures. */
47974 	uint64_t	em_filter_id;
47975 } hwrm_cfa_em_flow_free_input_t, *phwrm_cfa_em_flow_free_input_t;
47976 
47977 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */
47978 
47979 typedef struct hwrm_cfa_em_flow_free_output {
47980 	/* The specific error status for the command. */
47981 	uint16_t	error_code;
47982 	/* The HWRM command request type. */
47983 	uint16_t	req_type;
47984 	/* The sequence ID from the original command. */
47985 	uint16_t	seq_id;
47986 	/* The length of the response data in number of bytes. */
47987 	uint16_t	resp_len;
47988 	uint8_t	unused_0[7];
47989 	/*
47990 	 * This field is used in Output records to indicate that the output
47991 	 * is completely written to RAM. This field should be read as '1'
47992 	 * to indicate that the output has been completely written.
47993 	 * When writing a command completion or response to an internal
47994 	 * processor, the order of writes has to be such that this field is
47995 	 * written last.
47996 	 */
47997 	uint8_t	valid;
47998 } hwrm_cfa_em_flow_free_output_t, *phwrm_cfa_em_flow_free_output_t;
47999 
48000 /************************
48001  * hwrm_cfa_em_flow_cfg *
48002  ************************/
48003 
48004 
48005 /* hwrm_cfa_em_flow_cfg_input (size:384b/48B) */
48006 
48007 typedef struct hwrm_cfa_em_flow_cfg_input {
48008 	/* The HWRM command request type. */
48009 	uint16_t	req_type;
48010 	/*
48011 	 * The completion ring to send the completion event on. This should
48012 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48013 	 */
48014 	uint16_t	cmpl_ring;
48015 	/*
48016 	 * The sequence ID is used by the driver for tracking multiple
48017 	 * commands. This ID is treated as opaque data by the firmware and
48018 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48019 	 */
48020 	uint16_t	seq_id;
48021 	/*
48022 	 * The target ID of the command:
48023 	 * * 0x0-0xFFF8 - The function ID
48024 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48025 	 * * 0xFFFD - Reserved for user-space HWRM interface
48026 	 * * 0xFFFF - HWRM
48027 	 */
48028 	uint16_t	target_id;
48029 	/*
48030 	 * A physical address pointer pointing to a host buffer that the
48031 	 * command's response data will be written. This can be either a host
48032 	 * physical address (HPA) or a guest physical address (GPA) and must
48033 	 * point to a physically contiguous block of memory.
48034 	 */
48035 	uint64_t	resp_addr;
48036 	uint32_t	enables;
48037 	/*
48038 	 * This bit must be '1' for the new_dst_id field to be
48039 	 * configured.
48040 	 */
48041 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_DST_ID		UINT32_C(0x1)
48042 	/*
48043 	 * This bit must be '1' for the new_mirror_vnic_id field to be
48044 	 * configured.
48045 	 */
48046 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID	UINT32_C(0x2)
48047 	/*
48048 	 * This bit must be '1' for the new_meter_instance_id field to be
48049 	 * configured.
48050 	 */
48051 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID	UINT32_C(0x4)
48052 	uint8_t	unused_0[4];
48053 	/* This value is an opaque id into CFA data structures. */
48054 	uint64_t	em_filter_id;
48055 	/*
48056 	 * If set, this value shall represent the new
48057 	 * Logical VNIC ID of the destination VNIC for the RX
48058 	 * path and network port id of the destination port for
48059 	 * the TX path.
48060 	 */
48061 	uint32_t	new_dst_id;
48062 	/*
48063 	 * New Logical VNIC ID of the VNIC where traffic is
48064 	 * mirrored.
48065 	 */
48066 	uint32_t	new_mirror_vnic_id;
48067 	/*
48068 	 * New meter to attach to the flow. Specifying the
48069 	 * invalid instance ID is used to remove any existing
48070 	 * meter from the flow.
48071 	 */
48072 	uint16_t	new_meter_instance_id;
48073 	/*
48074 	 * A value of 0xfff is considered invalid and implies the
48075 	 * instance is not configured.
48076 	 */
48077 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
48078 	#define HWRM_CFA_EM_FLOW_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST   HWRM_CFA_EM_FLOW_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
48079 	uint8_t	unused_1[6];
48080 } hwrm_cfa_em_flow_cfg_input_t, *phwrm_cfa_em_flow_cfg_input_t;
48081 
48082 /* hwrm_cfa_em_flow_cfg_output (size:128b/16B) */
48083 
48084 typedef struct hwrm_cfa_em_flow_cfg_output {
48085 	/* The specific error status for the command. */
48086 	uint16_t	error_code;
48087 	/* The HWRM command request type. */
48088 	uint16_t	req_type;
48089 	/* The sequence ID from the original command. */
48090 	uint16_t	seq_id;
48091 	/* The length of the response data in number of bytes. */
48092 	uint16_t	resp_len;
48093 	uint8_t	unused_0[7];
48094 	/*
48095 	 * This field is used in Output records to indicate that the output
48096 	 * is completely written to RAM. This field should be read as '1'
48097 	 * to indicate that the output has been completely written.
48098 	 * When writing a command completion or response to an internal
48099 	 * processor, the order of writes has to be such that this field is
48100 	 * written last.
48101 	 */
48102 	uint8_t	valid;
48103 } hwrm_cfa_em_flow_cfg_output_t, *phwrm_cfa_em_flow_cfg_output_t;
48104 
48105 /************************
48106  * hwrm_cfa_meter_qcaps *
48107  ************************/
48108 
48109 
48110 /* hwrm_cfa_meter_qcaps_input (size:128b/16B) */
48111 
48112 typedef struct hwrm_cfa_meter_qcaps_input {
48113 	/* The HWRM command request type. */
48114 	uint16_t	req_type;
48115 	/*
48116 	 * The completion ring to send the completion event on. This should
48117 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48118 	 */
48119 	uint16_t	cmpl_ring;
48120 	/*
48121 	 * The sequence ID is used by the driver for tracking multiple
48122 	 * commands. This ID is treated as opaque data by the firmware and
48123 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48124 	 */
48125 	uint16_t	seq_id;
48126 	/*
48127 	 * The target ID of the command:
48128 	 * * 0x0-0xFFF8 - The function ID
48129 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48130 	 * * 0xFFFD - Reserved for user-space HWRM interface
48131 	 * * 0xFFFF - HWRM
48132 	 */
48133 	uint16_t	target_id;
48134 	/*
48135 	 * A physical address pointer pointing to a host buffer that the
48136 	 * command's response data will be written. This can be either a host
48137 	 * physical address (HPA) or a guest physical address (GPA) and must
48138 	 * point to a physically contiguous block of memory.
48139 	 */
48140 	uint64_t	resp_addr;
48141 } hwrm_cfa_meter_qcaps_input_t, *phwrm_cfa_meter_qcaps_input_t;
48142 
48143 /* hwrm_cfa_meter_qcaps_output (size:320b/40B) */
48144 
48145 typedef struct hwrm_cfa_meter_qcaps_output {
48146 	/* The specific error status for the command. */
48147 	uint16_t	error_code;
48148 	/* The HWRM command request type. */
48149 	uint16_t	req_type;
48150 	/* The sequence ID from the original command. */
48151 	uint16_t	seq_id;
48152 	/* The length of the response data in number of bytes. */
48153 	uint16_t	resp_len;
48154 	uint32_t	flags;
48155 	/*
48156 	 * Enumeration denoting the clock at which the Meter is running
48157 	 * with. This enumeration is used for resources that are similar
48158 	 * for both TX and RX paths of the chip.
48159 	 */
48160 	#define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_MASK  UINT32_C(0xf)
48161 	#define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_SFT   0
48162 	/* 375 MHz */
48163 		#define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_375MHZ  UINT32_C(0x0)
48164 	/* 625 MHz */
48165 		#define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ  UINT32_C(0x1)
48166 		#define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_LAST   HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ
48167 	uint8_t	unused_0[4];
48168 	/*
48169 	 * The minimum guaranteed number of tx meter profiles supported
48170 	 * for this function.
48171 	 */
48172 	uint16_t	min_tx_profile;
48173 	/*
48174 	 * The maximum non-guaranteed number of tx meter profiles supported
48175 	 * for this function.
48176 	 */
48177 	uint16_t	max_tx_profile;
48178 	/*
48179 	 * The minimum guaranteed number of rx meter profiles supported
48180 	 * for this function.
48181 	 */
48182 	uint16_t	min_rx_profile;
48183 	/*
48184 	 * The maximum non-guaranteed number of rx meter profiles supported
48185 	 * for this function.
48186 	 */
48187 	uint16_t	max_rx_profile;
48188 	/*
48189 	 * The minimum guaranteed number of tx meter instances supported
48190 	 * for this function.
48191 	 */
48192 	uint16_t	min_tx_instance;
48193 	/*
48194 	 * The maximum non-guaranteed number of tx meter instances supported
48195 	 * for this function.
48196 	 */
48197 	uint16_t	max_tx_instance;
48198 	/*
48199 	 * The minimum guaranteed number of rx meter instances supported
48200 	 * for this function.
48201 	 */
48202 	uint16_t	min_rx_instance;
48203 	/*
48204 	 * The maximum non-guaranteed number of rx meter instances supported
48205 	 * for this function.
48206 	 */
48207 	uint16_t	max_rx_instance;
48208 	uint8_t	unused_1[7];
48209 	/*
48210 	 * This field is used in Output records to indicate that the output
48211 	 * is completely written to RAM. This field should be read as '1'
48212 	 * to indicate that the output has been completely written.
48213 	 * When writing a command completion or response to an internal
48214 	 * processor, the order of writes has to be such that this field is
48215 	 * written last.
48216 	 */
48217 	uint8_t	valid;
48218 } hwrm_cfa_meter_qcaps_output_t, *phwrm_cfa_meter_qcaps_output_t;
48219 
48220 /********************************
48221  * hwrm_cfa_meter_profile_alloc *
48222  ********************************/
48223 
48224 
48225 /* hwrm_cfa_meter_profile_alloc_input (size:320b/40B) */
48226 
48227 typedef struct hwrm_cfa_meter_profile_alloc_input {
48228 	/* The HWRM command request type. */
48229 	uint16_t	req_type;
48230 	/*
48231 	 * The completion ring to send the completion event on. This should
48232 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48233 	 */
48234 	uint16_t	cmpl_ring;
48235 	/*
48236 	 * The sequence ID is used by the driver for tracking multiple
48237 	 * commands. This ID is treated as opaque data by the firmware and
48238 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48239 	 */
48240 	uint16_t	seq_id;
48241 	/*
48242 	 * The target ID of the command:
48243 	 * * 0x0-0xFFF8 - The function ID
48244 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48245 	 * * 0xFFFD - Reserved for user-space HWRM interface
48246 	 * * 0xFFFF - HWRM
48247 	 */
48248 	uint16_t	target_id;
48249 	/*
48250 	 * A physical address pointer pointing to a host buffer that the
48251 	 * command's response data will be written. This can be either a host
48252 	 * physical address (HPA) or a guest physical address (GPA) and must
48253 	 * point to a physically contiguous block of memory.
48254 	 */
48255 	uint64_t	resp_addr;
48256 	uint8_t	flags;
48257 	/*
48258 	 * Enumeration denoting the RX, TX type of the resource.
48259 	 * This enumeration is used for resources that are similar for both
48260 	 * TX and RX paths of the chip.
48261 	 */
48262 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH	UINT32_C(0x1)
48263 	/* tx path */
48264 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
48265 	/* rx path */
48266 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
48267 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX
48268 	/* The meter algorithm type. */
48269 	uint8_t	meter_type;
48270 	/* RFC 2697 (srTCM) */
48271 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2697 UINT32_C(0x0)
48272 	/* RFC 2698 (trTCM) */
48273 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2698 UINT32_C(0x1)
48274 	/* RFC 4115 (trTCM) */
48275 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115 UINT32_C(0x2)
48276 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_LAST   HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115
48277 	/*
48278 	 * This field is reserved for the future use.
48279 	 * It shall be set to 0.
48280 	 */
48281 	uint16_t	reserved1;
48282 	/*
48283 	 * This field is reserved for the future use.
48284 	 * It shall be set to 0.
48285 	 */
48286 	uint32_t	reserved2;
48287 	/* A meter rate specified in bytes-per-second. */
48288 	uint32_t	commit_rate;
48289 	/* The bandwidth value. */
48290 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_MASK		UINT32_C(0xfffffff)
48291 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_SFT		0
48292 	/* The granularity of the value (bits or bytes). */
48293 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE			UINT32_C(0x10000000)
48294 	/* Value is in bits. */
48295 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BITS		(UINT32_C(0x0) << 28)
48296 	/* Value is in bytes. */
48297 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES		(UINT32_C(0x1) << 28)
48298 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_LAST		HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES
48299 	/* bw_value_unit is 3 b */
48300 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
48301 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT	29
48302 	/* Value is in Mb or MB (base 10). */
48303 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
48304 	/* Value is in Kb or KB (base 10). */
48305 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
48306 	/* Value is in bits or bytes. */
48307 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
48308 	/* Value is in Gb or GB (base 10). */
48309 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
48310 	/* Value is in 1/100th of a percentage of total bandwidth. */
48311 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
48312 	/* Raw value */
48313 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW	(UINT32_C(0x7) << 29)
48314 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST	HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
48315 	/* A meter burst size specified in bytes. */
48316 	uint32_t	commit_burst;
48317 	/* The bandwidth value. */
48318 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_MASK		UINT32_C(0xfffffff)
48319 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_SFT		0
48320 	/* The granularity of the value (bits or bytes). */
48321 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE			UINT32_C(0x10000000)
48322 	/* Value is in bits. */
48323 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BITS		(UINT32_C(0x0) << 28)
48324 	/* Value is in bytes. */
48325 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES		(UINT32_C(0x1) << 28)
48326 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_LAST		HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES
48327 	/* bw_value_unit is 3 b */
48328 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
48329 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT	29
48330 	/* Value is in Mb or MB (base 10). */
48331 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
48332 	/* Value is in Kb or KB (base 10). */
48333 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
48334 	/* Value is in bits or bytes. */
48335 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
48336 	/* Value is in Gb or GB (base 10). */
48337 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
48338 	/* Value is in 1/100th of a percentage of total bandwidth. */
48339 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
48340 	/* Invalid value */
48341 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
48342 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST	HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
48343 	/* A meter rate specified in bytes-per-second. */
48344 	uint32_t	excess_peak_rate;
48345 	/* The bandwidth value. */
48346 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK		UINT32_C(0xfffffff)
48347 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT		0
48348 	/* The granularity of the value (bits or bytes). */
48349 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE			UINT32_C(0x10000000)
48350 	/* Value is in bits. */
48351 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BITS		(UINT32_C(0x0) << 28)
48352 	/* Value is in bytes. */
48353 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES		(UINT32_C(0x1) << 28)
48354 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_LAST		HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
48355 	/* bw_value_unit is 3 b */
48356 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
48357 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT	29
48358 	/* Value is in Mb or MB (base 10). */
48359 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
48360 	/* Value is in Kb or KB (base 10). */
48361 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
48362 	/* Value is in bits or bytes. */
48363 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
48364 	/* Value is in Gb or GB (base 10). */
48365 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
48366 	/* Value is in 1/100th of a percentage of total bandwidth. */
48367 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
48368 	/* Raw unit */
48369 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW	(UINT32_C(0x7) << 29)
48370 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST	HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
48371 	/* A meter burst size specified in bytes. */
48372 	uint32_t	excess_peak_burst;
48373 	/* The bandwidth value. */
48374 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK		UINT32_C(0xfffffff)
48375 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT		0
48376 	/* The granularity of the value (bits or bytes). */
48377 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE			UINT32_C(0x10000000)
48378 	/* Value is in bits. */
48379 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BITS		(UINT32_C(0x0) << 28)
48380 	/* Value is in bytes. */
48381 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES		(UINT32_C(0x1) << 28)
48382 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_LAST		HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
48383 	/* bw_value_unit is 3 b */
48384 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
48385 	#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT	29
48386 	/* Value is in Mb or MB (base 10). */
48387 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
48388 	/* Value is in Kb or KB (base 10). */
48389 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
48390 	/* Value is in bits or bytes. */
48391 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
48392 	/* Value is in Gb or GB (base 10). */
48393 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
48394 	/* Value is in 1/100th of a percentage of total bandwidth. */
48395 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
48396 	/* Invalid unit */
48397 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
48398 		#define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST	HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
48399 } hwrm_cfa_meter_profile_alloc_input_t, *phwrm_cfa_meter_profile_alloc_input_t;
48400 
48401 /* hwrm_cfa_meter_profile_alloc_output (size:128b/16B) */
48402 
48403 typedef struct hwrm_cfa_meter_profile_alloc_output {
48404 	/* The specific error status for the command. */
48405 	uint16_t	error_code;
48406 	/* The HWRM command request type. */
48407 	uint16_t	req_type;
48408 	/* The sequence ID from the original command. */
48409 	uint16_t	seq_id;
48410 	/* The length of the response data in number of bytes. */
48411 	uint16_t	resp_len;
48412 	/* This value identifies a meter profile in CFA. */
48413 	uint16_t	meter_profile_id;
48414 	/*
48415 	 * A value of 0xfff is considered invalid and implies the
48416 	 * profile is not configured.
48417 	 */
48418 	#define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
48419 	#define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_LAST   HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID
48420 	uint8_t	unused_0[5];
48421 	/*
48422 	 * This field is used in Output records to indicate that the output
48423 	 * is completely written to RAM. This field should be read as '1'
48424 	 * to indicate that the output has been completely written.
48425 	 * When writing a command completion or response to an internal
48426 	 * processor, the order of writes has to be such that this field is
48427 	 * written last.
48428 	 */
48429 	uint8_t	valid;
48430 } hwrm_cfa_meter_profile_alloc_output_t, *phwrm_cfa_meter_profile_alloc_output_t;
48431 
48432 /*******************************
48433  * hwrm_cfa_meter_profile_free *
48434  *******************************/
48435 
48436 
48437 /* hwrm_cfa_meter_profile_free_input (size:192b/24B) */
48438 
48439 typedef struct hwrm_cfa_meter_profile_free_input {
48440 	/* The HWRM command request type. */
48441 	uint16_t	req_type;
48442 	/*
48443 	 * The completion ring to send the completion event on. This should
48444 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48445 	 */
48446 	uint16_t	cmpl_ring;
48447 	/*
48448 	 * The sequence ID is used by the driver for tracking multiple
48449 	 * commands. This ID is treated as opaque data by the firmware and
48450 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48451 	 */
48452 	uint16_t	seq_id;
48453 	/*
48454 	 * The target ID of the command:
48455 	 * * 0x0-0xFFF8 - The function ID
48456 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48457 	 * * 0xFFFD - Reserved for user-space HWRM interface
48458 	 * * 0xFFFF - HWRM
48459 	 */
48460 	uint16_t	target_id;
48461 	/*
48462 	 * A physical address pointer pointing to a host buffer that the
48463 	 * command's response data will be written. This can be either a host
48464 	 * physical address (HPA) or a guest physical address (GPA) and must
48465 	 * point to a physically contiguous block of memory.
48466 	 */
48467 	uint64_t	resp_addr;
48468 	uint8_t	flags;
48469 	/*
48470 	 * Enumeration denoting the RX, TX type of the resource.
48471 	 * This enumeration is used for resources that are similar for both
48472 	 * TX and RX paths of the chip.
48473 	 */
48474 	#define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH	UINT32_C(0x1)
48475 	/* tx path */
48476 		#define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
48477 	/* rx path */
48478 		#define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
48479 		#define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX
48480 	uint8_t	unused_0;
48481 	/* This value identifies a meter profile in CFA. */
48482 	uint16_t	meter_profile_id;
48483 	/*
48484 	 * A value of 0xfff is considered invalid and implies the
48485 	 * profile is not configured.
48486 	 */
48487 	#define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
48488 	#define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_LAST   HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID
48489 	uint8_t	unused_1[4];
48490 } hwrm_cfa_meter_profile_free_input_t, *phwrm_cfa_meter_profile_free_input_t;
48491 
48492 /* hwrm_cfa_meter_profile_free_output (size:128b/16B) */
48493 
48494 typedef struct hwrm_cfa_meter_profile_free_output {
48495 	/* The specific error status for the command. */
48496 	uint16_t	error_code;
48497 	/* The HWRM command request type. */
48498 	uint16_t	req_type;
48499 	/* The sequence ID from the original command. */
48500 	uint16_t	seq_id;
48501 	/* The length of the response data in number of bytes. */
48502 	uint16_t	resp_len;
48503 	uint8_t	unused_0[7];
48504 	/*
48505 	 * This field is used in Output records to indicate that the output
48506 	 * is completely written to RAM. This field should be read as '1'
48507 	 * to indicate that the output has been completely written.
48508 	 * When writing a command completion or response to an internal
48509 	 * processor, the order of writes has to be such that this field is
48510 	 * written last.
48511 	 */
48512 	uint8_t	valid;
48513 } hwrm_cfa_meter_profile_free_output_t, *phwrm_cfa_meter_profile_free_output_t;
48514 
48515 /******************************
48516  * hwrm_cfa_meter_profile_cfg *
48517  ******************************/
48518 
48519 
48520 /* hwrm_cfa_meter_profile_cfg_input (size:320b/40B) */
48521 
48522 typedef struct hwrm_cfa_meter_profile_cfg_input {
48523 	/* The HWRM command request type. */
48524 	uint16_t	req_type;
48525 	/*
48526 	 * The completion ring to send the completion event on. This should
48527 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48528 	 */
48529 	uint16_t	cmpl_ring;
48530 	/*
48531 	 * The sequence ID is used by the driver for tracking multiple
48532 	 * commands. This ID is treated as opaque data by the firmware and
48533 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48534 	 */
48535 	uint16_t	seq_id;
48536 	/*
48537 	 * The target ID of the command:
48538 	 * * 0x0-0xFFF8 - The function ID
48539 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48540 	 * * 0xFFFD - Reserved for user-space HWRM interface
48541 	 * * 0xFFFF - HWRM
48542 	 */
48543 	uint16_t	target_id;
48544 	/*
48545 	 * A physical address pointer pointing to a host buffer that the
48546 	 * command's response data will be written. This can be either a host
48547 	 * physical address (HPA) or a guest physical address (GPA) and must
48548 	 * point to a physically contiguous block of memory.
48549 	 */
48550 	uint64_t	resp_addr;
48551 	uint8_t	flags;
48552 	/*
48553 	 * Enumeration denoting the RX, TX type of the resource.
48554 	 * This enumeration is used for resources that are similar for both
48555 	 * TX and RX paths of the chip.
48556 	 */
48557 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
48558 	/* tx path */
48559 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
48560 	/* rx path */
48561 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
48562 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX
48563 	/* The meter algorithm type. */
48564 	uint8_t	meter_type;
48565 	/* RFC 2697 (srTCM) */
48566 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2697 UINT32_C(0x0)
48567 	/* RFC 2698 (trTCM) */
48568 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2698 UINT32_C(0x1)
48569 	/* RFC 4115 (trTCM) */
48570 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115 UINT32_C(0x2)
48571 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_LAST   HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115
48572 	/* This value identifies a meter profile in CFA. */
48573 	uint16_t	meter_profile_id;
48574 	/*
48575 	 * A value of 0xfff is considered invalid and implies the
48576 	 * profile is not configured.
48577 	 */
48578 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
48579 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_LAST   HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID
48580 	/*
48581 	 * This field is reserved for the future use.
48582 	 * It shall be set to 0.
48583 	 */
48584 	uint32_t	reserved;
48585 	/* A meter rate specified in bytes-per-second. */
48586 	uint32_t	commit_rate;
48587 	/* The bandwidth value. */
48588 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_MASK		UINT32_C(0xfffffff)
48589 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_SFT		0
48590 	/* The granularity of the value (bits or bytes). */
48591 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE			UINT32_C(0x10000000)
48592 	/* Value is in bits. */
48593 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BITS		(UINT32_C(0x0) << 28)
48594 	/* Value is in bytes. */
48595 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES		(UINT32_C(0x1) << 28)
48596 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_LAST		HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES
48597 	/* bw_value_unit is 3 b */
48598 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
48599 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT	29
48600 	/* Value is in Mb or MB (base 10). */
48601 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
48602 	/* Value is in Kb or KB (base 10). */
48603 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
48604 	/* Value is in bits or bytes. */
48605 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
48606 	/* Value is in Gb or GB (base 10). */
48607 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
48608 	/* Value is in 1/100th of a percentage of total bandwidth. */
48609 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
48610 	/* Raw value */
48611 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW	(UINT32_C(0x7) << 29)
48612 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST	HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
48613 	/* A meter burst size specified in bytes. */
48614 	uint32_t	commit_burst;
48615 	/* The bandwidth value. */
48616 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_MASK		UINT32_C(0xfffffff)
48617 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_SFT		0
48618 	/* The granularity of the value (bits or bytes). */
48619 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE			UINT32_C(0x10000000)
48620 	/* Value is in bits. */
48621 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BITS		(UINT32_C(0x0) << 28)
48622 	/* Value is in bytes. */
48623 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES		(UINT32_C(0x1) << 28)
48624 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_LAST		HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES
48625 	/* bw_value_unit is 3 b */
48626 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
48627 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT	29
48628 	/* Value is in Mb or MB (base 10). */
48629 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
48630 	/* Value is in Kb or KB (base 10). */
48631 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
48632 	/* Value is in bits or bytes. */
48633 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
48634 	/* Value is in Gb or GB (base 10). */
48635 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
48636 	/* Value is in 1/100th of a percentage of total bandwidth. */
48637 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
48638 	/* Invalid value */
48639 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
48640 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST	HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
48641 	/* A meter rate specified in bytes-per-second. */
48642 	uint32_t	excess_peak_rate;
48643 	/* The bandwidth value. */
48644 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK		UINT32_C(0xfffffff)
48645 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT		0
48646 	/* The granularity of the value (bits or bytes). */
48647 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE			UINT32_C(0x10000000)
48648 	/* Value is in bits. */
48649 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BITS		(UINT32_C(0x0) << 28)
48650 	/* Value is in bytes. */
48651 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES		(UINT32_C(0x1) << 28)
48652 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_LAST		HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
48653 	/* bw_value_unit is 3 b */
48654 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
48655 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT	29
48656 	/* Value is in Mb or MB (base 10). */
48657 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
48658 	/* Value is in Kb or KB (base 10). */
48659 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
48660 	/* Value is in bits or bytes. */
48661 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
48662 	/* Value is in Gb or GB (base 10). */
48663 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
48664 	/* Value is in 1/100th of a percentage of total bandwidth. */
48665 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
48666 	/* Raw unit */
48667 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW	(UINT32_C(0x7) << 29)
48668 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST	HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
48669 	/* A meter burst size specified in bytes. */
48670 	uint32_t	excess_peak_burst;
48671 	/* The bandwidth value. */
48672 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK		UINT32_C(0xfffffff)
48673 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT		0
48674 	/* The granularity of the value (bits or bytes). */
48675 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE			UINT32_C(0x10000000)
48676 	/* Value is in bits. */
48677 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BITS		(UINT32_C(0x0) << 28)
48678 	/* Value is in bytes. */
48679 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES		(UINT32_C(0x1) << 28)
48680 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_LAST		HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
48681 	/* bw_value_unit is 3 b */
48682 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK	UINT32_C(0xe0000000)
48683 	#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT	29
48684 	/* Value is in Mb or MB (base 10). */
48685 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA	(UINT32_C(0x0) << 29)
48686 	/* Value is in Kb or KB (base 10). */
48687 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO	(UINT32_C(0x2) << 29)
48688 	/* Value is in bits or bytes. */
48689 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE	(UINT32_C(0x4) << 29)
48690 	/* Value is in Gb or GB (base 10). */
48691 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA	(UINT32_C(0x6) << 29)
48692 	/* Value is in 1/100th of a percentage of total bandwidth. */
48693 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100  (UINT32_C(0x1) << 29)
48694 	/* Invalid unit */
48695 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID	(UINT32_C(0x7) << 29)
48696 		#define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST	HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
48697 } hwrm_cfa_meter_profile_cfg_input_t, *phwrm_cfa_meter_profile_cfg_input_t;
48698 
48699 /* hwrm_cfa_meter_profile_cfg_output (size:128b/16B) */
48700 
48701 typedef struct hwrm_cfa_meter_profile_cfg_output {
48702 	/* The specific error status for the command. */
48703 	uint16_t	error_code;
48704 	/* The HWRM command request type. */
48705 	uint16_t	req_type;
48706 	/* The sequence ID from the original command. */
48707 	uint16_t	seq_id;
48708 	/* The length of the response data in number of bytes. */
48709 	uint16_t	resp_len;
48710 	uint8_t	unused_0[7];
48711 	/*
48712 	 * This field is used in Output records to indicate that the output
48713 	 * is completely written to RAM. This field should be read as '1'
48714 	 * to indicate that the output has been completely written.
48715 	 * When writing a command completion or response to an internal
48716 	 * processor, the order of writes has to be such that this field is
48717 	 * written last.
48718 	 */
48719 	uint8_t	valid;
48720 } hwrm_cfa_meter_profile_cfg_output_t, *phwrm_cfa_meter_profile_cfg_output_t;
48721 
48722 /*********************************
48723  * hwrm_cfa_meter_instance_alloc *
48724  *********************************/
48725 
48726 
48727 /* hwrm_cfa_meter_instance_alloc_input (size:192b/24B) */
48728 
48729 typedef struct hwrm_cfa_meter_instance_alloc_input {
48730 	/* The HWRM command request type. */
48731 	uint16_t	req_type;
48732 	/*
48733 	 * The completion ring to send the completion event on. This should
48734 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48735 	 */
48736 	uint16_t	cmpl_ring;
48737 	/*
48738 	 * The sequence ID is used by the driver for tracking multiple
48739 	 * commands. This ID is treated as opaque data by the firmware and
48740 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48741 	 */
48742 	uint16_t	seq_id;
48743 	/*
48744 	 * The target ID of the command:
48745 	 * * 0x0-0xFFF8 - The function ID
48746 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48747 	 * * 0xFFFD - Reserved for user-space HWRM interface
48748 	 * * 0xFFFF - HWRM
48749 	 */
48750 	uint16_t	target_id;
48751 	/*
48752 	 * A physical address pointer pointing to a host buffer that the
48753 	 * command's response data will be written. This can be either a host
48754 	 * physical address (HPA) or a guest physical address (GPA) and must
48755 	 * point to a physically contiguous block of memory.
48756 	 */
48757 	uint64_t	resp_addr;
48758 	uint8_t	flags;
48759 	/*
48760 	 * Enumeration denoting the RX, TX type of the resource.
48761 	 * This enumeration is used for resources that are similar for both
48762 	 * TX and RX paths of the chip.
48763 	 */
48764 	#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH	UINT32_C(0x1)
48765 	/* tx path */
48766 		#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
48767 	/* rx path */
48768 		#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
48769 		#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX
48770 	uint8_t	unused_0;
48771 	/* This value identifies a meter profile in CFA. */
48772 	uint16_t	meter_profile_id;
48773 	/*
48774 	 * A value of 0xffff is considered invalid and implies the
48775 	 * profile is not configured.
48776 	 */
48777 	#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
48778 	#define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_LAST   HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID
48779 	uint8_t	unused_1[4];
48780 } hwrm_cfa_meter_instance_alloc_input_t, *phwrm_cfa_meter_instance_alloc_input_t;
48781 
48782 /* hwrm_cfa_meter_instance_alloc_output (size:128b/16B) */
48783 
48784 typedef struct hwrm_cfa_meter_instance_alloc_output {
48785 	/* The specific error status for the command. */
48786 	uint16_t	error_code;
48787 	/* The HWRM command request type. */
48788 	uint16_t	req_type;
48789 	/* The sequence ID from the original command. */
48790 	uint16_t	seq_id;
48791 	/* The length of the response data in number of bytes. */
48792 	uint16_t	resp_len;
48793 	/* This value identifies a meter instance in CFA. */
48794 	uint16_t	meter_instance_id;
48795 	/*
48796 	 * A value of 0xffff is considered invalid and implies the
48797 	 * instance is not configured.
48798 	 */
48799 	#define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
48800 	#define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_LAST   HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID
48801 	uint8_t	unused_0[5];
48802 	/*
48803 	 * This field is used in Output records to indicate that the output
48804 	 * is completely written to RAM. This field should be read as '1'
48805 	 * to indicate that the output has been completely written.
48806 	 * When writing a command completion or response to an internal
48807 	 * processor, the order of writes has to be such that this field is
48808 	 * written last.
48809 	 */
48810 	uint8_t	valid;
48811 } hwrm_cfa_meter_instance_alloc_output_t, *phwrm_cfa_meter_instance_alloc_output_t;
48812 
48813 /*******************************
48814  * hwrm_cfa_meter_instance_cfg *
48815  *******************************/
48816 
48817 
48818 /* hwrm_cfa_meter_instance_cfg_input (size:192b/24B) */
48819 
48820 typedef struct hwrm_cfa_meter_instance_cfg_input {
48821 	/* The HWRM command request type. */
48822 	uint16_t	req_type;
48823 	/*
48824 	 * The completion ring to send the completion event on. This should
48825 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48826 	 */
48827 	uint16_t	cmpl_ring;
48828 	/*
48829 	 * The sequence ID is used by the driver for tracking multiple
48830 	 * commands. This ID is treated as opaque data by the firmware and
48831 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48832 	 */
48833 	uint16_t	seq_id;
48834 	/*
48835 	 * The target ID of the command:
48836 	 * * 0x0-0xFFF8 - The function ID
48837 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48838 	 * * 0xFFFD - Reserved for user-space HWRM interface
48839 	 * * 0xFFFF - HWRM
48840 	 */
48841 	uint16_t	target_id;
48842 	/*
48843 	 * A physical address pointer pointing to a host buffer that the
48844 	 * command's response data will be written. This can be either a host
48845 	 * physical address (HPA) or a guest physical address (GPA) and must
48846 	 * point to a physically contiguous block of memory.
48847 	 */
48848 	uint64_t	resp_addr;
48849 	uint8_t	flags;
48850 	/*
48851 	 * Enumeration denoting the RX, TX type of the resource.
48852 	 * This enumeration is used for resources that are similar for both
48853 	 * TX and RX paths of the chip.
48854 	 */
48855 	#define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
48856 	/* tx path */
48857 		#define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
48858 	/* rx path */
48859 		#define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
48860 		#define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX
48861 	uint8_t	unused_0;
48862 	/*
48863 	 * This value identifies a new meter profile to be associated with
48864 	 * the meter instance specified in this command.
48865 	 */
48866 	uint16_t	meter_profile_id;
48867 	/*
48868 	 * A value of 0xffff is considered invalid and implies the
48869 	 * profile is not configured.
48870 	 */
48871 	#define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID UINT32_C(0xffff)
48872 	#define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_LAST   HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID
48873 	/*
48874 	 * This value identifies the ID of a meter instance that needs to be
48875 	 * updated with a new meter profile specified in this command.
48876 	 */
48877 	uint16_t	meter_instance_id;
48878 	uint8_t	unused_1[2];
48879 } hwrm_cfa_meter_instance_cfg_input_t, *phwrm_cfa_meter_instance_cfg_input_t;
48880 
48881 /* hwrm_cfa_meter_instance_cfg_output (size:128b/16B) */
48882 
48883 typedef struct hwrm_cfa_meter_instance_cfg_output {
48884 	/* The specific error status for the command. */
48885 	uint16_t	error_code;
48886 	/* The HWRM command request type. */
48887 	uint16_t	req_type;
48888 	/* The sequence ID from the original command. */
48889 	uint16_t	seq_id;
48890 	/* The length of the response data in number of bytes. */
48891 	uint16_t	resp_len;
48892 	uint8_t	unused_0[7];
48893 	/*
48894 	 * This field is used in Output records to indicate that the output
48895 	 * is completely written to RAM. This field should be read as '1'
48896 	 * to indicate that the output has been completely written.
48897 	 * When writing a command completion or response to an internal
48898 	 * processor, the order of writes has to be such that this field is
48899 	 * written last.
48900 	 */
48901 	uint8_t	valid;
48902 } hwrm_cfa_meter_instance_cfg_output_t, *phwrm_cfa_meter_instance_cfg_output_t;
48903 
48904 /********************************
48905  * hwrm_cfa_meter_instance_free *
48906  ********************************/
48907 
48908 
48909 /* hwrm_cfa_meter_instance_free_input (size:192b/24B) */
48910 
48911 typedef struct hwrm_cfa_meter_instance_free_input {
48912 	/* The HWRM command request type. */
48913 	uint16_t	req_type;
48914 	/*
48915 	 * The completion ring to send the completion event on. This should
48916 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
48917 	 */
48918 	uint16_t	cmpl_ring;
48919 	/*
48920 	 * The sequence ID is used by the driver for tracking multiple
48921 	 * commands. This ID is treated as opaque data by the firmware and
48922 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
48923 	 */
48924 	uint16_t	seq_id;
48925 	/*
48926 	 * The target ID of the command:
48927 	 * * 0x0-0xFFF8 - The function ID
48928 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48929 	 * * 0xFFFD - Reserved for user-space HWRM interface
48930 	 * * 0xFFFF - HWRM
48931 	 */
48932 	uint16_t	target_id;
48933 	/*
48934 	 * A physical address pointer pointing to a host buffer that the
48935 	 * command's response data will be written. This can be either a host
48936 	 * physical address (HPA) or a guest physical address (GPA) and must
48937 	 * point to a physically contiguous block of memory.
48938 	 */
48939 	uint64_t	resp_addr;
48940 	uint8_t	flags;
48941 	/*
48942 	 * Enumeration denoting the RX, TX type of the resource.
48943 	 * This enumeration is used for resources that are similar for both
48944 	 * TX and RX paths of the chip.
48945 	 */
48946 	#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH	UINT32_C(0x1)
48947 	/* tx path */
48948 		#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
48949 	/* rx path */
48950 		#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
48951 		#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_LAST HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX
48952 	uint8_t	unused_0;
48953 	/* This value identifies a meter instance in CFA. */
48954 	uint16_t	meter_instance_id;
48955 	/*
48956 	 * A value of 0xfff is considered invalid and implies the
48957 	 * instance is not configured.
48958 	 */
48959 	#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID UINT32_C(0xffff)
48960 	#define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_LAST   HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID
48961 	uint8_t	unused_1[4];
48962 } hwrm_cfa_meter_instance_free_input_t, *phwrm_cfa_meter_instance_free_input_t;
48963 
48964 /* hwrm_cfa_meter_instance_free_output (size:128b/16B) */
48965 
48966 typedef struct hwrm_cfa_meter_instance_free_output {
48967 	/* The specific error status for the command. */
48968 	uint16_t	error_code;
48969 	/* The HWRM command request type. */
48970 	uint16_t	req_type;
48971 	/* The sequence ID from the original command. */
48972 	uint16_t	seq_id;
48973 	/* The length of the response data in number of bytes. */
48974 	uint16_t	resp_len;
48975 	uint8_t	unused_0[7];
48976 	/*
48977 	 * This field is used in Output records to indicate that the output
48978 	 * is completely written to RAM. This field should be read as '1'
48979 	 * to indicate that the output has been completely written.
48980 	 * When writing a command completion or response to an internal
48981 	 * processor, the order of writes has to be such that this field is
48982 	 * written last.
48983 	 */
48984 	uint8_t	valid;
48985 } hwrm_cfa_meter_instance_free_output_t, *phwrm_cfa_meter_instance_free_output_t;
48986 
48987 /*******************************
48988  * hwrm_cfa_decap_filter_alloc *
48989  *******************************/
48990 
48991 
48992 /* hwrm_cfa_decap_filter_alloc_input (size:832b/104B) */
48993 
48994 typedef struct hwrm_cfa_decap_filter_alloc_input {
48995 	/* The HWRM command request type. */
48996 	uint16_t	req_type;
48997 	/*
48998 	 * The completion ring to send the completion event on. This should
48999 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49000 	 */
49001 	uint16_t	cmpl_ring;
49002 	/*
49003 	 * The sequence ID is used by the driver for tracking multiple
49004 	 * commands. This ID is treated as opaque data by the firmware and
49005 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49006 	 */
49007 	uint16_t	seq_id;
49008 	/*
49009 	 * The target ID of the command:
49010 	 * * 0x0-0xFFF8 - The function ID
49011 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49012 	 * * 0xFFFD - Reserved for user-space HWRM interface
49013 	 * * 0xFFFF - HWRM
49014 	 */
49015 	uint16_t	target_id;
49016 	/*
49017 	 * A physical address pointer pointing to a host buffer that the
49018 	 * command's response data will be written. This can be either a host
49019 	 * physical address (HPA) or a guest physical address (GPA) and must
49020 	 * point to a physically contiguous block of memory.
49021 	 */
49022 	uint64_t	resp_addr;
49023 	uint32_t	flags;
49024 	/* ovs_tunnel is 1 b */
49025 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_FLAGS_OVS_TUNNEL	UINT32_C(0x1)
49026 	uint32_t	enables;
49027 	/*
49028 	 * This bit must be '1' for the tunnel_type field to be
49029 	 * configured.
49030 	 */
49031 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE	UINT32_C(0x1)
49032 	/*
49033 	 * This bit must be '1' for the tunnel_id field to be
49034 	 * configured.
49035 	 */
49036 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_ID	UINT32_C(0x2)
49037 	/*
49038 	 * This bit must be '1' for the src_macaddr field to be
49039 	 * configured.
49040 	 */
49041 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR	UINT32_C(0x4)
49042 	/*
49043 	 * This bit must be '1' for the dst_macaddr field to be
49044 	 * configured.
49045 	 */
49046 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR	UINT32_C(0x8)
49047 	/*
49048 	 * This bit must be '1' for the ovlan_vid field to be
49049 	 * configured.
49050 	 */
49051 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_OVLAN_VID	UINT32_C(0x10)
49052 	/*
49053 	 * This bit must be '1' for the ivlan_vid field to be
49054 	 * configured.
49055 	 */
49056 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IVLAN_VID	UINT32_C(0x20)
49057 	/*
49058 	 * This bit must be '1' for the t_ovlan_vid field to be
49059 	 * configured.
49060 	 */
49061 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_OVLAN_VID	UINT32_C(0x40)
49062 	/*
49063 	 * This bit must be '1' for the t_ivlan_vid field to be
49064 	 * configured.
49065 	 */
49066 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_IVLAN_VID	UINT32_C(0x80)
49067 	/*
49068 	 * This bit must be '1' for the ethertype field to be
49069 	 * configured.
49070 	 */
49071 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE	UINT32_C(0x100)
49072 	/*
49073 	 * This bit must be '1' for the src_ipaddr field to be
49074 	 * configured.
49075 	 */
49076 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR	UINT32_C(0x200)
49077 	/*
49078 	 * This bit must be '1' for the dst_ipaddr field to be
49079 	 * configured.
49080 	 */
49081 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR	UINT32_C(0x400)
49082 	/*
49083 	 * This bit must be '1' for the ipaddr_type field to be
49084 	 * configured.
49085 	 */
49086 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE	UINT32_C(0x800)
49087 	/*
49088 	 * This bit must be '1' for the ip_protocol field to be
49089 	 * configured.
49090 	 */
49091 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL	UINT32_C(0x1000)
49092 	/*
49093 	 * This bit must be '1' for the src_port field to be
49094 	 * configured.
49095 	 */
49096 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT	UINT32_C(0x2000)
49097 	/*
49098 	 * This bit must be '1' for the dst_port field to be
49099 	 * configured.
49100 	 */
49101 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_PORT	UINT32_C(0x4000)
49102 	/*
49103 	 * This bit must be '1' for the dst_id field to be
49104 	 * configured.
49105 	 */
49106 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_ID		UINT32_C(0x8000)
49107 	/*
49108 	 * This bit must be '1' for the mirror_vnic_id field to be
49109 	 * configured.
49110 	 */
49111 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID	UINT32_C(0x10000)
49112 	/*
49113 	 * Tunnel identifier.
49114 	 * Virtual Network Identifier (VNI). Only valid with
49115 	 * tunnel_types VXLAN, NVGRE, and Geneve.
49116 	 * Only lower 24-bits of VNI field are used
49117 	 * in setting up the filter.
49118 	 */
49119 	uint32_t	tunnel_id;
49120 	/* Tunnel Type. */
49121 	uint8_t	tunnel_type;
49122 	/* Non-tunnel */
49123 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
49124 	/* Virtual eXtensible Local Area Network (VXLAN) */
49125 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
49126 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
49127 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
49128 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
49129 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
49130 	/* IP in IP */
49131 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
49132 	/* Generic Network Virtualization Encapsulation (Geneve) */
49133 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
49134 	/* Multi-Protocol Label Switching (MPLS) */
49135 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
49136 	/* Stateless Transport Tunnel (STT) */
49137 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
49138 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
49139 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
49140 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
49141 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
49142 	/*
49143 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
49144 	 * datagram payload
49145 	 */
49146 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
49147 	/* Use fixed layer 2 ether type of 0xFFFF */
49148 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
49149 	/*
49150 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
49151 	 * (IPV6oVXLANGPE)
49152 	 */
49153 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
49154 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
49155 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
49156 	/* Any tunneled traffic */
49157 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
49158 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
49159 	uint8_t	unused_0;
49160 	uint16_t	unused_1;
49161 	/*
49162 	 * This value indicates the source MAC address in
49163 	 * the Ethernet header.
49164 	 */
49165 	uint8_t	src_macaddr[6];
49166 	uint8_t	unused_2[2];
49167 	/*
49168 	 * This value indicates the destination MAC address in
49169 	 * the Ethernet header.
49170 	 */
49171 	uint8_t	dst_macaddr[6];
49172 	/*
49173 	 * This value indicates the VLAN ID of the outer VLAN tag
49174 	 * in the Ethernet header.
49175 	 */
49176 	uint16_t	ovlan_vid;
49177 	/*
49178 	 * This value indicates the VLAN ID of the inner VLAN tag
49179 	 * in the Ethernet header.
49180 	 */
49181 	uint16_t	ivlan_vid;
49182 	/*
49183 	 * This value indicates the VLAN ID of the outer VLAN tag
49184 	 * in the tunnel Ethernet header.
49185 	 */
49186 	uint16_t	t_ovlan_vid;
49187 	/*
49188 	 * This value indicates the VLAN ID of the inner VLAN tag
49189 	 * in the tunnel Ethernet header.
49190 	 */
49191 	uint16_t	t_ivlan_vid;
49192 	/* This value indicates the ethertype in the Ethernet header. */
49193 	uint16_t	ethertype;
49194 	/*
49195 	 * This value indicates the type of IP address.
49196 	 * 4 - IPv4
49197 	 * 6 - IPv6
49198 	 * All others are invalid.
49199 	 */
49200 	uint8_t	ip_addr_type;
49201 	/* invalid */
49202 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
49203 	/* IPv4 */
49204 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4	UINT32_C(0x4)
49205 	/* IPv6 */
49206 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6	UINT32_C(0x6)
49207 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST   HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
49208 	/*
49209 	 * The value of protocol field in IP header.
49210 	 * Applies to UDP and TCP traffic.
49211 	 * 6 - TCP
49212 	 * 17 - UDP
49213 	 */
49214 	uint8_t	ip_protocol;
49215 	/* invalid */
49216 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
49217 	/* TCP */
49218 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP	UINT32_C(0x6)
49219 	/* UDP */
49220 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP	UINT32_C(0x11)
49221 	#define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST   HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
49222 	uint16_t	unused_3;
49223 	uint32_t	unused_4;
49224 	/*
49225 	 * The value of source IP address to be used in filtering.
49226 	 * For IPv4, first four bytes represent the IP address.
49227 	 */
49228 	uint32_t	src_ipaddr[4];
49229 	/*
49230 	 * The value of destination IP address to be used in filtering.
49231 	 * For IPv4, first four bytes represent the IP address.
49232 	 */
49233 	uint32_t	dst_ipaddr[4];
49234 	/*
49235 	 * The value of source port to be used in filtering.
49236 	 * Applies to UDP and TCP traffic.
49237 	 */
49238 	uint16_t	src_port;
49239 	/*
49240 	 * The value of destination port to be used in filtering.
49241 	 * Applies to UDP and TCP traffic.
49242 	 */
49243 	uint16_t	dst_port;
49244 	/*
49245 	 * If set, this value shall represent the
49246 	 * Logical VNIC ID of the destination VNIC for the RX
49247 	 * path.
49248 	 */
49249 	uint16_t	dst_id;
49250 	/*
49251 	 * If set, this value shall represent the L2 context that matches the
49252 	 * L2 information of the decap filter.
49253 	 */
49254 	uint16_t	l2_ctxt_ref_id;
49255 } hwrm_cfa_decap_filter_alloc_input_t, *phwrm_cfa_decap_filter_alloc_input_t;
49256 
49257 /* hwrm_cfa_decap_filter_alloc_output (size:128b/16B) */
49258 
49259 typedef struct hwrm_cfa_decap_filter_alloc_output {
49260 	/* The specific error status for the command. */
49261 	uint16_t	error_code;
49262 	/* The HWRM command request type. */
49263 	uint16_t	req_type;
49264 	/* The sequence ID from the original command. */
49265 	uint16_t	seq_id;
49266 	/* The length of the response data in number of bytes. */
49267 	uint16_t	resp_len;
49268 	/* This value is an opaque id into CFA data structures. */
49269 	uint32_t	decap_filter_id;
49270 	uint8_t	unused_0[3];
49271 	/*
49272 	 * This field is used in Output records to indicate that the output
49273 	 * is completely written to RAM. This field should be read as '1'
49274 	 * to indicate that the output has been completely written.
49275 	 * When writing a command completion or response to an internal
49276 	 * processor, the order of writes has to be such that this field is
49277 	 * written last.
49278 	 */
49279 	uint8_t	valid;
49280 } hwrm_cfa_decap_filter_alloc_output_t, *phwrm_cfa_decap_filter_alloc_output_t;
49281 
49282 /******************************
49283  * hwrm_cfa_decap_filter_free *
49284  ******************************/
49285 
49286 
49287 /* hwrm_cfa_decap_filter_free_input (size:192b/24B) */
49288 
49289 typedef struct hwrm_cfa_decap_filter_free_input {
49290 	/* The HWRM command request type. */
49291 	uint16_t	req_type;
49292 	/*
49293 	 * The completion ring to send the completion event on. This should
49294 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49295 	 */
49296 	uint16_t	cmpl_ring;
49297 	/*
49298 	 * The sequence ID is used by the driver for tracking multiple
49299 	 * commands. This ID is treated as opaque data by the firmware and
49300 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49301 	 */
49302 	uint16_t	seq_id;
49303 	/*
49304 	 * The target ID of the command:
49305 	 * * 0x0-0xFFF8 - The function ID
49306 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49307 	 * * 0xFFFD - Reserved for user-space HWRM interface
49308 	 * * 0xFFFF - HWRM
49309 	 */
49310 	uint16_t	target_id;
49311 	/*
49312 	 * A physical address pointer pointing to a host buffer that the
49313 	 * command's response data will be written. This can be either a host
49314 	 * physical address (HPA) or a guest physical address (GPA) and must
49315 	 * point to a physically contiguous block of memory.
49316 	 */
49317 	uint64_t	resp_addr;
49318 	/* This value is an opaque id into CFA data structures. */
49319 	uint32_t	decap_filter_id;
49320 	uint8_t	unused_0[4];
49321 } hwrm_cfa_decap_filter_free_input_t, *phwrm_cfa_decap_filter_free_input_t;
49322 
49323 /* hwrm_cfa_decap_filter_free_output (size:128b/16B) */
49324 
49325 typedef struct hwrm_cfa_decap_filter_free_output {
49326 	/* The specific error status for the command. */
49327 	uint16_t	error_code;
49328 	/* The HWRM command request type. */
49329 	uint16_t	req_type;
49330 	/* The sequence ID from the original command. */
49331 	uint16_t	seq_id;
49332 	/* The length of the response data in number of bytes. */
49333 	uint16_t	resp_len;
49334 	uint8_t	unused_0[7];
49335 	/*
49336 	 * This field is used in Output records to indicate that the output
49337 	 * is completely written to RAM. This field should be read as '1'
49338 	 * to indicate that the output has been completely written.
49339 	 * When writing a command completion or response to an internal
49340 	 * processor, the order of writes has to be such that this field is
49341 	 * written last.
49342 	 */
49343 	uint8_t	valid;
49344 } hwrm_cfa_decap_filter_free_output_t, *phwrm_cfa_decap_filter_free_output_t;
49345 
49346 /***********************
49347  * hwrm_cfa_flow_alloc *
49348  ***********************/
49349 
49350 
49351 /* hwrm_cfa_flow_alloc_input (size:1024b/128B) */
49352 
49353 typedef struct hwrm_cfa_flow_alloc_input {
49354 	/* The HWRM command request type. */
49355 	uint16_t	req_type;
49356 	/*
49357 	 * The completion ring to send the completion event on. This should
49358 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49359 	 */
49360 	uint16_t	cmpl_ring;
49361 	/*
49362 	 * The sequence ID is used by the driver for tracking multiple
49363 	 * commands. This ID is treated as opaque data by the firmware and
49364 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49365 	 */
49366 	uint16_t	seq_id;
49367 	/*
49368 	 * The target ID of the command:
49369 	 * * 0x0-0xFFF8 - The function ID
49370 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49371 	 * * 0xFFFD - Reserved for user-space HWRM interface
49372 	 * * 0xFFFF - HWRM
49373 	 */
49374 	uint16_t	target_id;
49375 	/*
49376 	 * A physical address pointer pointing to a host buffer that the
49377 	 * command's response data will be written. This can be either a host
49378 	 * physical address (HPA) or a guest physical address (GPA) and must
49379 	 * point to a physically contiguous block of memory.
49380 	 */
49381 	uint64_t	resp_addr;
49382 	uint16_t	flags;
49383 	/* tunnel is 1 b */
49384 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_TUNNEL		UINT32_C(0x1)
49385 	/* num_vlan is 2 b */
49386 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_MASK	UINT32_C(0x6)
49387 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_SFT	1
49388 	/* no tags */
49389 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_NONE		(UINT32_C(0x0) << 1)
49390 	/* 1 tag */
49391 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_ONE		(UINT32_C(0x1) << 1)
49392 	/* 2 tags */
49393 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO		(UINT32_C(0x2) << 1)
49394 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_LAST	HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO
49395 	/* Enumeration denoting the Flow Type. */
49396 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_MASK	UINT32_C(0x38)
49397 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_SFT	3
49398 	/* L2 flow */
49399 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_L2		(UINT32_C(0x0) << 3)
49400 	/* IPV4 flow */
49401 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV4		(UINT32_C(0x1) << 3)
49402 	/* IPV6 flow */
49403 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6		(UINT32_C(0x2) << 3)
49404 		#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_LAST	HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6
49405 	/*
49406 	 * when set to 1, indicates TX flow offload for function specified
49407 	 * in src_fid and the dst_fid should be set to invalid value. To
49408 	 * indicate a VM to VM flow, both of the path_tx and path_rx flags
49409 	 * need to be set. For virtio vSwitch offload case, the src_fid and
49410 	 * dst_fid is set to the same fid value. For the SRIOV vSwitch
49411 	 * offload case, the src_fid and dst_fid must be set to the same VF
49412 	 * FID belong to the children VFs of the same PF to indicate VM to
49413 	 * VM flow.
49414 	 */
49415 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_TX		UINT32_C(0x40)
49416 	/*
49417 	 * when set to 1, indicates RX flow offload for function specified
49418 	 * in dst_fid and the src_fid should be set to invalid value.
49419 	 */
49420 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_RX		UINT32_C(0x80)
49421 	/*
49422 	 * Set to 1 to indicate matching of VXLAN VNI from the custom vxlan
49423 	 * header is required and the VXLAN VNI value is stored in the first
49424 	 * 24 bits of the dmac field. This flag is only valid when the flow
49425 	 * direction is RX.
49426 	 */
49427 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_MATCH_VXLAN_IP_VNI	UINT32_C(0x100)
49428 	/*
49429 	 * Set to 1 to indicate vhost_id is specified in the outer_vlan_tci
49430 	 * field.
49431 	 */
49432 	#define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_VHOST_ID_USE_VLAN	UINT32_C(0x200)
49433 	/*
49434 	 * Tx Flow: vf fid.
49435 	 * Rx Flow: pf fid.
49436 	 */
49437 	uint16_t	src_fid;
49438 	/* Tunnel handle valid when tunnel flag is set. */
49439 	uint32_t	tunnel_handle;
49440 	uint16_t	action_flags;
49441 	/*
49442 	 * Setting of this flag indicates drop action. If this flag is not
49443 	 * set, then it should be considered accept action.
49444 	 */
49445 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FWD			UINT32_C(0x1)
49446 	/* recycle is 1 b */
49447 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_RECYCLE		UINT32_C(0x2)
49448 	/*
49449 	 * Setting of this flag indicates drop action. If this flag is not
49450 	 * set, then it should be considered accept action.
49451 	 */
49452 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_DROP			UINT32_C(0x4)
49453 	/* meter is 1 b */
49454 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_METER			UINT32_C(0x8)
49455 	/* tunnel is 1 b */
49456 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL			UINT32_C(0x10)
49457 	/* nat_src is 1 b */
49458 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_SRC		UINT32_C(0x20)
49459 	/* nat_dest is 1 b */
49460 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_DEST		UINT32_C(0x40)
49461 	/* nat_ipv4_address is 1 b */
49462 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_IPV4_ADDRESS	UINT32_C(0x80)
49463 	/* l2_header_rewrite is 1 b */
49464 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_L2_HEADER_REWRITE	UINT32_C(0x100)
49465 	/* ttl_decrement is 1 b */
49466 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TTL_DECREMENT		UINT32_C(0x200)
49467 	/*
49468 	 * If set to 1 and flow direction is TX, it indicates decap of L2
49469 	 * header and encap of tunnel header. If set to 1 and flow direction
49470 	 * is RX, it indicates decap of tunnel header and encap L2 header.
49471 	 * The type of tunnel is specified in the tunnel_type field.
49472 	 */
49473 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL_IP		UINT32_C(0x400)
49474 	/* If set to 1, flow aging is enabled for this flow. */
49475 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FLOW_AGING_ENABLED	UINT32_C(0x800)
49476 	/*
49477 	 * If set to 1 an attempt will be made to try to offload this flow
49478 	 * to the most optimal flow table resource. If set to 0, the flow
49479 	 * will be placed to the default flow table resource.
49480 	 */
49481 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_PRI_HINT		UINT32_C(0x1000)
49482 	/*
49483 	 * If set to 1 there will be no attempt to allocate an on-chip try
49484 	 * to offload this flow. If set to 0, which will keep compatibility
49485 	 * with the older drivers, will cause the FW to attempt to allocate
49486 	 * an on-chip flow counter for the newly created flow. This will
49487 	 * keep the existing behavior with EM flows which always had an
49488 	 * associated flow counter.
49489 	 */
49490 	#define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NO_FLOW_COUNTER_ALLOC	UINT32_C(0x2000)
49491 	/*
49492 	 * Tx Flow: pf or vf fid.
49493 	 * Rx Flow: vf fid.
49494 	 */
49495 	uint16_t	dst_fid;
49496 	/* VLAN tpid, valid when push_vlan flag is set. */
49497 	uint16_t	l2_rewrite_vlan_tpid;
49498 	/* VLAN tci, valid when push_vlan flag is set. */
49499 	uint16_t	l2_rewrite_vlan_tci;
49500 	/* Meter id, valid when meter flag is set. */
49501 	uint16_t	act_meter_id;
49502 	/* Flow with the same l2 context tcam key. */
49503 	uint16_t	ref_flow_handle;
49504 	/* This value sets the match value for the ethertype. */
49505 	uint16_t	ethertype;
49506 	/* valid when num tags is 1 or 2. */
49507 	uint16_t	outer_vlan_tci;
49508 	/* This value sets the match value for the Destination MAC address. */
49509 	uint16_t	dmac[3];
49510 	/* valid when num tags is 2. */
49511 	uint16_t	inner_vlan_tci;
49512 	/* This value sets the match value for the Source MAC address. */
49513 	uint16_t	smac[3];
49514 	/* The bit length of destination IP address mask. */
49515 	uint8_t	ip_dst_mask_len;
49516 	/* The bit length of source IP address mask. */
49517 	uint8_t	ip_src_mask_len;
49518 	/* The value of destination IPv4/IPv6 address. */
49519 	uint32_t	ip_dst[4];
49520 	/* The source IPv4/IPv6 address. */
49521 	uint32_t	ip_src[4];
49522 	/*
49523 	 * The value of source port.
49524 	 * Applies to UDP and TCP traffic.
49525 	 */
49526 	uint16_t	l4_src_port;
49527 	/*
49528 	 * The value of source port mask.
49529 	 * Applies to UDP and TCP traffic.
49530 	 */
49531 	uint16_t	l4_src_port_mask;
49532 	/*
49533 	 * The value of destination port.
49534 	 * Applies to UDP and TCP traffic.
49535 	 */
49536 	uint16_t	l4_dst_port;
49537 	/*
49538 	 * The value of destination port mask.
49539 	 * Applies to UDP and TCP traffic.
49540 	 */
49541 	uint16_t	l4_dst_port_mask;
49542 	/*
49543 	 * NAT IPv4/6 address based on address type flag.
49544 	 * 0 values are ignored.
49545 	 */
49546 	uint32_t	nat_ip_address[4];
49547 	/* L2 header re-write Destination MAC address. */
49548 	uint16_t	l2_rewrite_dmac[3];
49549 	/*
49550 	 * The NAT source/destination port based on direction flag.
49551 	 * Applies to UDP and TCP traffic.
49552 	 * 0 values are ignored.
49553 	 */
49554 	uint16_t	nat_port;
49555 	/* L2 header re-write Source MAC address. */
49556 	uint16_t	l2_rewrite_smac[3];
49557 	/* The value of ip protocol. */
49558 	uint8_t	ip_proto;
49559 	/* Tunnel Type. */
49560 	uint8_t	tunnel_type;
49561 	/* Non-tunnel */
49562 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
49563 	/* Virtual eXtensible Local Area Network (VXLAN) */
49564 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
49565 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
49566 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
49567 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
49568 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
49569 	/* IP in IP */
49570 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
49571 	/* Generic Network Virtualization Encapsulation (Geneve) */
49572 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
49573 	/* Multi-Protocol Label Switching (MPLS) */
49574 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
49575 	/* Stateless Transport Tunnel (STT) */
49576 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT	UINT32_C(0x7)
49577 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
49578 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
49579 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
49580 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
49581 	/*
49582 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
49583 	 * datagram payload
49584 	 */
49585 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
49586 	/* Use fixed layer 2 ether type of 0xFFFF */
49587 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
49588 	/*
49589 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
49590 	 * (IPV6oVXLANGPE)
49591 	 */
49592 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
49593 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
49594 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
49595 	/* Any tunneled traffic */
49596 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
49597 	#define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST	HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
49598 } hwrm_cfa_flow_alloc_input_t, *phwrm_cfa_flow_alloc_input_t;
49599 
49600 /* hwrm_cfa_flow_alloc_output (size:256b/32B) */
49601 
49602 typedef struct hwrm_cfa_flow_alloc_output {
49603 	/* The specific error status for the command. */
49604 	uint16_t	error_code;
49605 	/* The HWRM command request type. */
49606 	uint16_t	req_type;
49607 	/* The sequence ID from the original command. */
49608 	uint16_t	seq_id;
49609 	/* The length of the response data in number of bytes. */
49610 	uint16_t	resp_len;
49611 	/* Flow record index. */
49612 	uint16_t	flow_handle;
49613 	uint8_t	unused_0[2];
49614 	/*
49615 	 * The flow id value in bit 0-29 is the actual ID of the flow
49616 	 * associated with this filter and it shall be used to match
49617 	 * and associate the flow identifier returned in completion
49618 	 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
49619 	 * shall indicate no valid flow id.
49620 	 */
49621 	uint32_t	flow_id;
49622 	/* Indicate the flow id value. */
49623 	#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
49624 	#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
49625 	/* Indicate type of the flow. */
49626 	#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE	UINT32_C(0x40000000)
49627 	/*
49628 	 * If this bit set to 0, then it indicates that the flow is
49629 	 * internal flow.
49630 	 */
49631 		#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT	(UINT32_C(0x0) << 30)
49632 	/*
49633 	 * If this bit is set to 1, then it indicates that the flow is
49634 	 * external flow.
49635 	 */
49636 		#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT	(UINT32_C(0x1) << 30)
49637 		#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST  HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
49638 	/* Indicate the flow direction. */
49639 	#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR	UINT32_C(0x80000000)
49640 	/* If this bit set to 0, then it indicates rx flow. */
49641 		#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX	(UINT32_C(0x0) << 31)
49642 	/* If this bit is set to 1, then it indicates that tx flow. */
49643 		#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX	(UINT32_C(0x1) << 31)
49644 		#define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST   HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
49645 	/* This value identifies a set of CFA data structures used for a flow. */
49646 	uint64_t	ext_flow_handle;
49647 	uint32_t	flow_counter_id;
49648 	uint8_t	unused_1[3];
49649 	/*
49650 	 * This field is used in Output records to indicate that the output
49651 	 * is completely written to RAM. This field should be read as '1'
49652 	 * to indicate that the output has been completely written.
49653 	 * When writing a command completion or response to an internal
49654 	 * processor, the order of writes has to be such that this field is
49655 	 * written last.
49656 	 */
49657 	uint8_t	valid;
49658 } hwrm_cfa_flow_alloc_output_t, *phwrm_cfa_flow_alloc_output_t;
49659 
49660 /* hwrm_cfa_flow_alloc_cmd_err (size:64b/8B) */
49661 
49662 typedef struct hwrm_cfa_flow_alloc_cmd_err {
49663 	/*
49664 	 * command specific error codes that goes to
49665 	 * the cmd_err field in Common HWRM Error Response.
49666 	 */
49667 	uint8_t	code;
49668 	/* Unknown error */
49669 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
49670 	/* No more L2 Context TCAM */
49671 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_L2_CONTEXT_TCAM UINT32_C(0x1)
49672 	/* No more action records */
49673 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_ACTION_RECORD   UINT32_C(0x2)
49674 	/* No more flow counters */
49675 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_COUNTER	UINT32_C(0x3)
49676 	/* No more wild-card TCAM */
49677 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_WILD_CARD_TCAM  UINT32_C(0x4)
49678 	/* Hash collision in exact match tables */
49679 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_HASH_COLLISION  UINT32_C(0x5)
49680 	/* Key is already installed */
49681 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_KEY_EXISTS	UINT32_C(0x6)
49682 	/* Flow Context DB is out of resource */
49683 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB	UINT32_C(0x7)
49684 	#define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_LAST	HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB
49685 	uint8_t	unused_0[7];
49686 } hwrm_cfa_flow_alloc_cmd_err_t, *phwrm_cfa_flow_alloc_cmd_err_t;
49687 
49688 /**********************
49689  * hwrm_cfa_flow_free *
49690  **********************/
49691 
49692 
49693 /* hwrm_cfa_flow_free_input (size:256b/32B) */
49694 
49695 typedef struct hwrm_cfa_flow_free_input {
49696 	/* The HWRM command request type. */
49697 	uint16_t	req_type;
49698 	/*
49699 	 * The completion ring to send the completion event on. This should
49700 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49701 	 */
49702 	uint16_t	cmpl_ring;
49703 	/*
49704 	 * The sequence ID is used by the driver for tracking multiple
49705 	 * commands. This ID is treated as opaque data by the firmware and
49706 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49707 	 */
49708 	uint16_t	seq_id;
49709 	/*
49710 	 * The target ID of the command:
49711 	 * * 0x0-0xFFF8 - The function ID
49712 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49713 	 * * 0xFFFD - Reserved for user-space HWRM interface
49714 	 * * 0xFFFF - HWRM
49715 	 */
49716 	uint16_t	target_id;
49717 	/*
49718 	 * A physical address pointer pointing to a host buffer that the
49719 	 * command's response data will be written. This can be either a host
49720 	 * physical address (HPA) or a guest physical address (GPA) and must
49721 	 * point to a physically contiguous block of memory.
49722 	 */
49723 	uint64_t	resp_addr;
49724 	/* Flow record index. */
49725 	uint16_t	flow_handle;
49726 	uint16_t	unused_0;
49727 	/* Flow counter id to be freed. */
49728 	uint32_t	flow_counter_id;
49729 	/* This value identifies a set of CFA data structures used for a flow. */
49730 	uint64_t	ext_flow_handle;
49731 } hwrm_cfa_flow_free_input_t, *phwrm_cfa_flow_free_input_t;
49732 
49733 /* hwrm_cfa_flow_free_output (size:256b/32B) */
49734 
49735 typedef struct hwrm_cfa_flow_free_output {
49736 	/* The specific error status for the command. */
49737 	uint16_t	error_code;
49738 	/* The HWRM command request type. */
49739 	uint16_t	req_type;
49740 	/* The sequence ID from the original command. */
49741 	uint16_t	seq_id;
49742 	/* The length of the response data in number of bytes. */
49743 	uint16_t	resp_len;
49744 	/* packet is 64 b */
49745 	uint64_t	packet;
49746 	/* byte is 64 b */
49747 	uint64_t	byte;
49748 	uint8_t	unused_0[7];
49749 	/*
49750 	 * This field is used in Output records to indicate that the output
49751 	 * is completely written to RAM. This field should be read as '1'
49752 	 * to indicate that the output has been completely written.
49753 	 * When writing a command completion or response to an internal
49754 	 * processor, the order of writes has to be such that this field is
49755 	 * written last.
49756 	 */
49757 	uint8_t	valid;
49758 } hwrm_cfa_flow_free_output_t, *phwrm_cfa_flow_free_output_t;
49759 
49760 /* hwrm_cfa_flow_action_data (size:960b/120B) */
49761 
49762 typedef struct hwrm_cfa_flow_action_data {
49763 	uint16_t	action_flags;
49764 	/* Setting of this flag indicates accept action. */
49765 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FWD			UINT32_C(0x1)
49766 	/* Setting of this flag indicates recycle action. */
49767 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_RECYCLE		UINT32_C(0x2)
49768 	/* Setting of this flag indicates drop action. */
49769 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DROP		UINT32_C(0x4)
49770 	/* Setting of this flag indicates meter action. */
49771 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_METER		UINT32_C(0x8)
49772 	/* Setting of this flag indicates tunnel action. */
49773 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL		UINT32_C(0x10)
49774 	/*
49775 	 * If set to 1 and flow direction is TX, it indicates decap of L2
49776 	 * header and encap of tunnel header. If set to 1 and flow direction
49777 	 * is RX, it indicates decap of tunnel header and encap L2 header.
49778 	 */
49779 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL_IP		UINT32_C(0x20)
49780 	/* Setting of this flag indicates ttl decrement action. */
49781 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TTL_DECREMENT	UINT32_C(0x40)
49782 	/* If set to 1, flow aging is enabled for this flow. */
49783 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FLOW_AGING_ENABLED	UINT32_C(0x80)
49784 	/* Setting of this flag indicates encap action. */
49785 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_ENCAP		UINT32_C(0x100)
49786 	/* Setting of this flag indicates decap action. */
49787 	#define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DECAP		UINT32_C(0x200)
49788 	/* Meter id. */
49789 	uint16_t	act_meter_id;
49790 	/* VNIC id. */
49791 	uint16_t	vnic_id;
49792 	/* vport number. */
49793 	uint16_t	vport_id;
49794 	/* The NAT source/destination. */
49795 	uint16_t	nat_port;
49796 	uint16_t	unused_0[3];
49797 	/* NAT IPv4/IPv6 address. */
49798 	uint32_t	nat_ip_address[4];
49799 	/* Encapsulation Type. */
49800 	uint8_t	encap_type;
49801 	/* Virtual eXtensible Local Area Network (VXLAN) */
49802 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN	UINT32_C(0x1)
49803 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
49804 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_NVGRE	UINT32_C(0x2)
49805 	/* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
49806 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2GRE	UINT32_C(0x3)
49807 	/* IP in IP */
49808 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPIP	UINT32_C(0x4)
49809 	/* Generic Network Virtualization Encapsulation (Geneve) */
49810 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_GENEVE	UINT32_C(0x5)
49811 	/* Multi-Protocol Label Switching (MPLS) */
49812 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_MPLS	UINT32_C(0x6)
49813 	/* VLAN */
49814 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VLAN	UINT32_C(0x7)
49815 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
49816 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE	UINT32_C(0x8)
49817 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
49818 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_V4	UINT32_C(0x9)
49819 	/*
49820 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
49821 	 * datagram payload
49822 	 */
49823 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE_V1	UINT32_C(0xa)
49824 	/* Use fixed layer 2 ether type of 0xFFFF */
49825 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2_ETYPE	UINT32_C(0xb)
49826 	/*
49827 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
49828 	 * (IPV6oVXLANGPE)
49829 	 */
49830 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
49831 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
49832 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE	UINT32_C(0x10)
49833 	#define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_LAST	HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE
49834 	uint8_t	unused[7];
49835 	/* This value is encap data for the associated encap type. */
49836 	uint32_t	encap_data[20];
49837 } hwrm_cfa_flow_action_data_t, *phwrm_cfa_flow_action_data_t;
49838 
49839 /* hwrm_cfa_flow_tunnel_hdr_data (size:64b/8B) */
49840 
49841 typedef struct hwrm_cfa_flow_tunnel_hdr_data {
49842 	/* Tunnel Type. */
49843 	uint8_t	tunnel_type;
49844 	/* Non-tunnel */
49845 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NONTUNNEL	UINT32_C(0x0)
49846 	/* Virtual eXtensible Local Area Network (VXLAN) */
49847 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN	UINT32_C(0x1)
49848 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
49849 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NVGRE	UINT32_C(0x2)
49850 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
49851 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2GRE	UINT32_C(0x3)
49852 	/* IP in IP */
49853 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPIP	UINT32_C(0x4)
49854 	/* Generic Network Virtualization Encapsulation (Geneve) */
49855 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_GENEVE	UINT32_C(0x5)
49856 	/* Multi-Protocol Label Switching (MPLS) */
49857 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_MPLS	UINT32_C(0x6)
49858 	/* Stateless Transport Tunnel (STT) */
49859 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_STT	UINT32_C(0x7)
49860 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
49861 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE	UINT32_C(0x8)
49862 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
49863 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
49864 	/*
49865 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
49866 	 * datagram payload
49867 	 */
49868 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
49869 	/* Use fixed layer 2 ether type of 0xFFFF */
49870 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
49871 	/*
49872 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
49873 	 * (IPV6oVXLANGPE)
49874 	 */
49875 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
49876 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
49877 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
49878 	/* Any tunneled traffic */
49879 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL	UINT32_C(0xff)
49880 	#define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_LAST	HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL
49881 	uint8_t	unused[3];
49882 	/*
49883 	 * Tunnel identifier.
49884 	 * Virtual Network Identifier (VNI).
49885 	 */
49886 	uint32_t	tunnel_id;
49887 } hwrm_cfa_flow_tunnel_hdr_data_t, *phwrm_cfa_flow_tunnel_hdr_data_t;
49888 
49889 /* hwrm_cfa_flow_l4_key_data (size:64b/8B) */
49890 
49891 typedef struct hwrm_cfa_flow_l4_key_data {
49892 	/* The value of source port. */
49893 	uint16_t	l4_src_port;
49894 	/* The value of destination port. */
49895 	uint16_t	l4_dst_port;
49896 	uint32_t	unused;
49897 } hwrm_cfa_flow_l4_key_data_t, *phwrm_cfa_flow_l4_key_data_t;
49898 
49899 /* hwrm_cfa_flow_l3_key_data (size:512b/64B) */
49900 
49901 typedef struct hwrm_cfa_flow_l3_key_data {
49902 	/* The value of ip protocol. */
49903 	uint8_t	ip_protocol;
49904 	uint8_t	unused_0[7];
49905 	/* The value of destination IPv4/IPv6 address. */
49906 	uint32_t	ip_dst[4];
49907 	/* The source IPv4/IPv6 address. */
49908 	uint32_t	ip_src[4];
49909 	/* NAT IPv4/IPv6 address. */
49910 	uint32_t	nat_ip_address[4];
49911 	uint64_t	unused;
49912 } hwrm_cfa_flow_l3_key_data_t, *phwrm_cfa_flow_l3_key_data_t;
49913 
49914 /* hwrm_cfa_flow_l2_key_data (size:448b/56B) */
49915 
49916 typedef struct hwrm_cfa_flow_l2_key_data {
49917 	/* Destination MAC address. */
49918 	uint16_t	dmac[3];
49919 	uint16_t	unused_0;
49920 	/* Source MAC address. */
49921 	uint16_t	smac[3];
49922 	uint16_t	unused_1;
49923 	/* L2 header re-write Destination MAC address. */
49924 	uint16_t	l2_rewrite_dmac[3];
49925 	uint16_t	unused_2;
49926 	/* L2 header re-write Source MAC address. */
49927 	uint16_t	l2_rewrite_smac[3];
49928 	/* Ethertype. */
49929 	uint16_t	ethertype;
49930 	/* Number of VLAN tags. */
49931 	uint16_t	num_vlan_tags;
49932 	/* VLAN tpid. */
49933 	uint16_t	l2_rewrite_vlan_tpid;
49934 	/* VLAN tci. */
49935 	uint16_t	l2_rewrite_vlan_tci;
49936 	uint8_t	unused_3[2];
49937 	/* Outer VLAN TPID. */
49938 	uint16_t	ovlan_tpid;
49939 	/* Outer VLAN TCI. */
49940 	uint16_t	ovlan_tci;
49941 	/* Inner VLAN TPID. */
49942 	uint16_t	ivlan_tpid;
49943 	/* Inner VLAN TCI. */
49944 	uint16_t	ivlan_tci;
49945 	uint8_t	unused[8];
49946 } hwrm_cfa_flow_l2_key_data_t, *phwrm_cfa_flow_l2_key_data_t;
49947 
49948 /* hwrm_cfa_flow_key_data (size:4160b/520B) */
49949 
49950 typedef struct hwrm_cfa_flow_key_data {
49951 	/* Flow associated tunnel L2 header key info. */
49952 	uint32_t	t_l2_key_data[14];
49953 	/* Flow associated tunnel L2 header mask info. */
49954 	uint32_t	t_l2_key_mask[14];
49955 	/* Flow associated tunnel L3 header key info. */
49956 	uint32_t	t_l3_key_data[16];
49957 	/* Flow associated tunnel L3 header mask info. */
49958 	uint32_t	t_l3_key_mask[16];
49959 	/* Flow associated tunnel L4 header key info. */
49960 	uint64_t	t_l4_key_data;
49961 	/* Flow associated tunnel L4 header mask info. */
49962 	uint64_t	t_l4_key_mask;
49963 	/* Flow associated tunnel header info. */
49964 	uint64_t	tunnel_hdr;
49965 	/* Flow associated L2 header key info. */
49966 	uint32_t	l2_key_data[14];
49967 	/* Flow associated L2 header mask info. */
49968 	uint32_t	l2_key_mask[14];
49969 	/* Flow associated L3 header key info. */
49970 	uint32_t	l3_key_data[16];
49971 	/* Flow associated L3 header mask info. */
49972 	uint32_t	l3_key_mask[16];
49973 	/* Flow associated L4 header key info. */
49974 	uint64_t	l4_key_data;
49975 	/* Flow associated L4 header mask info. */
49976 	uint64_t	l4_key_mask;
49977 } hwrm_cfa_flow_key_data_t, *phwrm_cfa_flow_key_data_t;
49978 
49979 /**********************
49980  * hwrm_cfa_flow_info *
49981  **********************/
49982 
49983 
49984 /* hwrm_cfa_flow_info_input (size:256b/32B) */
49985 
49986 typedef struct hwrm_cfa_flow_info_input {
49987 	/* The HWRM command request type. */
49988 	uint16_t	req_type;
49989 	/*
49990 	 * The completion ring to send the completion event on. This should
49991 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
49992 	 */
49993 	uint16_t	cmpl_ring;
49994 	/*
49995 	 * The sequence ID is used by the driver for tracking multiple
49996 	 * commands. This ID is treated as opaque data by the firmware and
49997 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
49998 	 */
49999 	uint16_t	seq_id;
50000 	/*
50001 	 * The target ID of the command:
50002 	 * * 0x0-0xFFF8 - The function ID
50003 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50004 	 * * 0xFFFD - Reserved for user-space HWRM interface
50005 	 * * 0xFFFF - HWRM
50006 	 */
50007 	uint16_t	target_id;
50008 	/*
50009 	 * A physical address pointer pointing to a host buffer that the
50010 	 * command's response data will be written. This can be either a host
50011 	 * physical address (HPA) or a guest physical address (GPA) and must
50012 	 * point to a physically contiguous block of memory.
50013 	 */
50014 	uint64_t	resp_addr;
50015 	/* Flow record index. */
50016 	uint16_t	flow_handle;
50017 	/* Max flow handle */
50018 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_MASK	UINT32_C(0xfff)
50019 	/* CNP flow handle */
50020 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT	UINT32_C(0x1000)
50021 	/* RoCEv1 flow handle */
50022 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV1_CNT	UINT32_C(0x2000)
50023 	/* NIC flow handle */
50024 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_NIC_TX	UINT32_C(0x3000)
50025 	/* RoCEv2 flow handle */
50026 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT	UINT32_C(0x4000)
50027 	/* Direction rx = 1 */
50028 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_DIR_RX	UINT32_C(0x8000)
50029 	/* CNP flow handle */
50030 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT_RX	UINT32_C(0x9000)
50031 	/* RoCEv1 flow handle */
50032 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV1_CNT_RX UINT32_C(0xa000)
50033 	/* NIC flow handle */
50034 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_NIC_RX	UINT32_C(0xb000)
50035 	/* RoCEv2 flow handle */
50036 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT_RX UINT32_C(0xc000)
50037 	#define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_LAST	HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT_RX
50038 	uint8_t	unused_0[6];
50039 	/* This value identifies a set of CFA data structures used for a flow. */
50040 	uint64_t	ext_flow_handle;
50041 } hwrm_cfa_flow_info_input_t, *phwrm_cfa_flow_info_input_t;
50042 
50043 /* hwrm_cfa_flow_info_output (size:5632b/704B) */
50044 
50045 typedef struct hwrm_cfa_flow_info_output {
50046 	/* The specific error status for the command. */
50047 	uint16_t	error_code;
50048 	/* The HWRM command request type. */
50049 	uint16_t	req_type;
50050 	/* The sequence ID from the original command. */
50051 	uint16_t	seq_id;
50052 	/* The length of the response data in number of bytes. */
50053 	uint16_t	resp_len;
50054 	uint8_t	flags;
50055 	/* When set to 1, indicates the configuration is the TX flow. */
50056 	#define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_TX	UINT32_C(0x1)
50057 	/* When set to 1, indicates the configuration is the RX flow. */
50058 	#define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_RX	UINT32_C(0x2)
50059 	/* profile is 8 b */
50060 	uint8_t	profile;
50061 	/* src_fid is 16 b */
50062 	uint16_t	src_fid;
50063 	/* dst_fid is 16 b */
50064 	uint16_t	dst_fid;
50065 	/* l2_ctxt_id is 16 b */
50066 	uint16_t	l2_ctxt_id;
50067 	/* em_info is 64 b */
50068 	uint64_t	em_info;
50069 	/* tcam_info is 64 b */
50070 	uint64_t	tcam_info;
50071 	/* vfp_tcam_info is 64 b */
50072 	uint64_t	vfp_tcam_info;
50073 	/* ar_id is 16 b */
50074 	uint16_t	ar_id;
50075 	/* flow_handle is 16 b */
50076 	uint16_t	flow_handle;
50077 	/* tunnel_handle is 32 b */
50078 	uint32_t	tunnel_handle;
50079 	/* The flow aging timer for the flow, the unit is 100 milliseconds */
50080 	uint16_t	flow_timer;
50081 	uint8_t	unused_0[6];
50082 	/* Flow associated L2, L3 and L4 headers info. */
50083 	uint32_t	flow_key_data[130];
50084 	/* Flow associated action record info. */
50085 	uint32_t	flow_action_info[30];
50086 	uint8_t	unused_1[7];
50087 	/*
50088 	 * This field is used in Output records to indicate that the output
50089 	 * is completely written to RAM. This field should be read as '1'
50090 	 * to indicate that the output has been completely written.
50091 	 * When writing a command completion or response to an internal
50092 	 * processor, the order of writes has to be such that this field is
50093 	 * written last.
50094 	 */
50095 	uint8_t	valid;
50096 } hwrm_cfa_flow_info_output_t, *phwrm_cfa_flow_info_output_t;
50097 
50098 /***********************
50099  * hwrm_cfa_flow_flush *
50100  ***********************/
50101 
50102 
50103 /* hwrm_cfa_flow_flush_input (size:256b/32B) */
50104 
50105 typedef struct hwrm_cfa_flow_flush_input {
50106 	/* The HWRM command request type. */
50107 	uint16_t	req_type;
50108 	/*
50109 	 * The completion ring to send the completion event on. This should
50110 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50111 	 */
50112 	uint16_t	cmpl_ring;
50113 	/*
50114 	 * The sequence ID is used by the driver for tracking multiple
50115 	 * commands. This ID is treated as opaque data by the firmware and
50116 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50117 	 */
50118 	uint16_t	seq_id;
50119 	/*
50120 	 * The target ID of the command:
50121 	 * * 0x0-0xFFF8 - The function ID
50122 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50123 	 * * 0xFFFD - Reserved for user-space HWRM interface
50124 	 * * 0xFFFF - HWRM
50125 	 */
50126 	uint16_t	target_id;
50127 	/*
50128 	 * A physical address pointer pointing to a host buffer that the
50129 	 * command's response data will be written. This can be either a host
50130 	 * physical address (HPA) or a guest physical address (GPA) and must
50131 	 * point to a physically contiguous block of memory.
50132 	 */
50133 	uint64_t	resp_addr;
50134 	/* flags is 32 b */
50135 	uint32_t	flags;
50136 	/*
50137 	 * Set to 1 to indicate the page size, page layers, and
50138 	 * flow_handle_table_dma_addr fields are valid. The flow flush
50139 	 * operation should only flush the flows from the flow table
50140 	 * specified. This flag is set to 0 by older driver. For older
50141 	 * firmware, setting this flag has no effect.
50142 	 */
50143 	#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_TABLE_VALID			UINT32_C(0x1)
50144 	/*
50145 	 * Set to 1 to indicate flow flush operation to cleanup all the
50146 	 * flows, meters, CFA context memory tables etc. This flag is set to
50147 	 * 0 by older driver. For older firmware, setting this flag has no
50148 	 * effect.
50149 	 */
50150 	#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_ALL			UINT32_C(0x2)
50151 	/*
50152 	 * Set to 1 to indicate flow flush operation to cleanup all the
50153 	 * flows by the caller. This flag is set to 0 by older driver. For
50154 	 * older firmware, setting this flag has no effect.
50155 	 */
50156 	#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_PORT			UINT32_C(0x4)
50157 	/*
50158 	 * Set to 1 to indicate the flow counter IDs are included in the
50159 	 * flow table.
50160 	 */
50161 	#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_INCL_FC		UINT32_C(0x8000000)
50162 	/*
50163 	 * This specifies the size of flow handle entries provided by the
50164 	 * driver in the flow table specified below. Only two flow handle
50165 	 * size enums are defined.
50166 	 */
50167 	#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_MASK	UINT32_C(0xc0000000)
50168 	#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_SFT	30
50169 	/* The flow handle is 16bit */
50170 		#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_16BIT  (UINT32_C(0x0) << 30)
50171 	/* The flow handle is 64bit */
50172 		#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT  (UINT32_C(0x1) << 30)
50173 		#define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_LAST	HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT
50174 	/* Specify page size of the flow table memory. */
50175 	uint8_t	page_size;
50176 	/* The page size is 4K */
50177 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
50178 	/* The page size is 8K */
50179 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
50180 	/* The page size is 64K */
50181 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
50182 	/* The page size is 256K */
50183 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
50184 	/* The page size is 1M */
50185 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
50186 	/* The page size is 2M */
50187 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
50188 	/* The page size is 4M */
50189 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
50190 	/* The page size is 1G */
50191 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
50192 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_LAST HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G
50193 	/* FLow table memory indirect levels. */
50194 	uint8_t	page_level;
50195 	/* PBL pointer is physical start address. */
50196 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
50197 	/* PBL pointer points to PTE table. */
50198 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
50199 	/*
50200 	 * PBL pointer points to PDE table with each entry pointing to PTE
50201 	 * tables.
50202 	 */
50203 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
50204 	#define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LAST HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2
50205 	/* number of flows in the flow table */
50206 	uint16_t	num_flows;
50207 	/* Pointer to the PBL, or PDL depending on number of levels */
50208 	uint64_t	page_dir;
50209 } hwrm_cfa_flow_flush_input_t, *phwrm_cfa_flow_flush_input_t;
50210 
50211 /* hwrm_cfa_flow_flush_output (size:128b/16B) */
50212 
50213 typedef struct hwrm_cfa_flow_flush_output {
50214 	/* The specific error status for the command. */
50215 	uint16_t	error_code;
50216 	/* The HWRM command request type. */
50217 	uint16_t	req_type;
50218 	/* The sequence ID from the original command. */
50219 	uint16_t	seq_id;
50220 	/* The length of the response data in number of bytes. */
50221 	uint16_t	resp_len;
50222 	uint8_t	unused_0[7];
50223 	/*
50224 	 * This field is used in Output records to indicate that the output
50225 	 * is completely written to RAM. This field should be read as '1'
50226 	 * to indicate that the output has been completely written.
50227 	 * When writing a command completion or response to an internal
50228 	 * processor, the order of writes has to be such that this field is
50229 	 * written last.
50230 	 */
50231 	uint8_t	valid;
50232 } hwrm_cfa_flow_flush_output_t, *phwrm_cfa_flow_flush_output_t;
50233 
50234 /***********************
50235  * hwrm_cfa_flow_stats *
50236  ***********************/
50237 
50238 
50239 /* hwrm_cfa_flow_stats_input (size:640b/80B) */
50240 
50241 typedef struct hwrm_cfa_flow_stats_input {
50242 	/* The HWRM command request type. */
50243 	uint16_t	req_type;
50244 	/*
50245 	 * The completion ring to send the completion event on. This should
50246 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50247 	 */
50248 	uint16_t	cmpl_ring;
50249 	/*
50250 	 * The sequence ID is used by the driver for tracking multiple
50251 	 * commands. This ID is treated as opaque data by the firmware and
50252 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50253 	 */
50254 	uint16_t	seq_id;
50255 	/*
50256 	 * The target ID of the command:
50257 	 * * 0x0-0xFFF8 - The function ID
50258 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50259 	 * * 0xFFFD - Reserved for user-space HWRM interface
50260 	 * * 0xFFFF - HWRM
50261 	 */
50262 	uint16_t	target_id;
50263 	/*
50264 	 * A physical address pointer pointing to a host buffer that the
50265 	 * command's response data will be written. This can be either a host
50266 	 * physical address (HPA) or a guest physical address (GPA) and must
50267 	 * point to a physically contiguous block of memory.
50268 	 */
50269 	uint64_t	resp_addr;
50270 	/* Number of valid flows in this command. */
50271 	uint16_t	num_flows;
50272 	/*
50273 	 * Flow handle.
50274 	 * For a listing of applicable flow_handle_0 values, see enumeration
50275 	 * in hwrm_cfa_flow_info_input.
50276 	 */
50277 	uint16_t	flow_handle_0;
50278 	/*
50279 	 * Flow handle.
50280 	 * For a listing of applicable flow_handle_1 values, see enumeration
50281 	 * in hwrm_cfa_flow_info_input.
50282 	 */
50283 	uint16_t	flow_handle_1;
50284 	/*
50285 	 * Flow handle.
50286 	 * For a listing of applicable flow_handle_2 values, see enumeration
50287 	 * in hwrm_cfa_flow_info_input.
50288 	 */
50289 	uint16_t	flow_handle_2;
50290 	/*
50291 	 * Flow handle.
50292 	 * For a listing of applicable flow_handle_3 values, see enumeration
50293 	 * in hwrm_cfa_flow_info_input.
50294 	 */
50295 	uint16_t	flow_handle_3;
50296 	/*
50297 	 * Flow handle.
50298 	 * For a listing of applicable flow_handle_4 values, see enumeration
50299 	 * in hwrm_cfa_flow_info_input.
50300 	 */
50301 	uint16_t	flow_handle_4;
50302 	/*
50303 	 * Flow handle.
50304 	 * For a listing of applicable flow_handle_5 values, see enumeration
50305 	 * in hwrm_cfa_flow_info_input.
50306 	 */
50307 	uint16_t	flow_handle_5;
50308 	/*
50309 	 * Flow handle.
50310 	 * For a listing of applicable flow_handle_6 values, see enumeration
50311 	 * in hwrm_cfa_flow_info_input.
50312 	 */
50313 	uint16_t	flow_handle_6;
50314 	/*
50315 	 * Flow handle.
50316 	 * For a listing of applicable flow_handle_7 values, see enumeration
50317 	 * in hwrm_cfa_flow_info_input.
50318 	 */
50319 	uint16_t	flow_handle_7;
50320 	/*
50321 	 * Flow handle.
50322 	 * For a listing of applicable flow_handle_8 values, see enumeration
50323 	 * in hwrm_cfa_flow_info_input.
50324 	 */
50325 	uint16_t	flow_handle_8;
50326 	/*
50327 	 * Flow handle.
50328 	 * For a listing of applicable flow_handle_9 values, see enumeration
50329 	 * in hwrm_cfa_flow_info_input.
50330 	 */
50331 	uint16_t	flow_handle_9;
50332 	uint8_t	unused_0[2];
50333 	/* Flow ID of a flow. */
50334 	uint32_t	flow_id_0;
50335 	/* Flow ID of a flow. */
50336 	uint32_t	flow_id_1;
50337 	/* Flow ID of a flow. */
50338 	uint32_t	flow_id_2;
50339 	/* Flow ID of a flow. */
50340 	uint32_t	flow_id_3;
50341 	/* Flow ID of a flow. */
50342 	uint32_t	flow_id_4;
50343 	/* Flow ID of a flow. */
50344 	uint32_t	flow_id_5;
50345 	/* Flow ID of a flow. */
50346 	uint32_t	flow_id_6;
50347 	/* Flow ID of a flow. */
50348 	uint32_t	flow_id_7;
50349 	/* Flow ID of a flow. */
50350 	uint32_t	flow_id_8;
50351 	/* Flow ID of a flow. */
50352 	uint32_t	flow_id_9;
50353 } hwrm_cfa_flow_stats_input_t, *phwrm_cfa_flow_stats_input_t;
50354 
50355 /* hwrm_cfa_flow_stats_output (size:1408b/176B) */
50356 
50357 typedef struct hwrm_cfa_flow_stats_output {
50358 	/* The specific error status for the command. */
50359 	uint16_t	error_code;
50360 	/* The HWRM command request type. */
50361 	uint16_t	req_type;
50362 	/* The sequence ID from the original command. */
50363 	uint16_t	seq_id;
50364 	/* The length of the response data in number of bytes. */
50365 	uint16_t	resp_len;
50366 	/* packet_0 is 64 b */
50367 	uint64_t	packet_0;
50368 	/* packet_1 is 64 b */
50369 	uint64_t	packet_1;
50370 	/* packet_2 is 64 b */
50371 	uint64_t	packet_2;
50372 	/* packet_3 is 64 b */
50373 	uint64_t	packet_3;
50374 	/* packet_4 is 64 b */
50375 	uint64_t	packet_4;
50376 	/* packet_5 is 64 b */
50377 	uint64_t	packet_5;
50378 	/* packet_6 is 64 b */
50379 	uint64_t	packet_6;
50380 	/* packet_7 is 64 b */
50381 	uint64_t	packet_7;
50382 	/* packet_8 is 64 b */
50383 	uint64_t	packet_8;
50384 	/* packet_9 is 64 b */
50385 	uint64_t	packet_9;
50386 	/* byte_0 is 64 b */
50387 	uint64_t	byte_0;
50388 	/* byte_1 is 64 b */
50389 	uint64_t	byte_1;
50390 	/* byte_2 is 64 b */
50391 	uint64_t	byte_2;
50392 	/* byte_3 is 64 b */
50393 	uint64_t	byte_3;
50394 	/* byte_4 is 64 b */
50395 	uint64_t	byte_4;
50396 	/* byte_5 is 64 b */
50397 	uint64_t	byte_5;
50398 	/* byte_6 is 64 b */
50399 	uint64_t	byte_6;
50400 	/* byte_7 is 64 b */
50401 	uint64_t	byte_7;
50402 	/* byte_8 is 64 b */
50403 	uint64_t	byte_8;
50404 	/* byte_9 is 64 b */
50405 	uint64_t	byte_9;
50406 	/*
50407 	 * If a flow has been hit, the bit representing the flow will be 1.
50408 	 * Likewise, if a flow has not, the bit representing the flow
50409 	 * will be 0. Mapping will match flow numbers where bitX is for flowX
50410 	 * (ex: bit 0 is flow0). This only applies for NIC flows. Upon
50411 	 * reading of the flow, the bit will be cleared for the flow and only
50412 	 * set again when traffic is received by the flow.
50413 	 */
50414 	uint16_t	flow_hits;
50415 	uint8_t	unused_0[5];
50416 	/*
50417 	 * This field is used in Output records to indicate that the output
50418 	 * is completely written to RAM. This field should be read as '1'
50419 	 * to indicate that the output has been completely written.
50420 	 * When writing a command completion or response to an internal
50421 	 * processor, the order of writes has to be such that this field is
50422 	 * written last.
50423 	 */
50424 	uint8_t	valid;
50425 } hwrm_cfa_flow_stats_output_t, *phwrm_cfa_flow_stats_output_t;
50426 
50427 /***********************************
50428  * hwrm_cfa_flow_aging_timer_reset *
50429  ***********************************/
50430 
50431 
50432 /* hwrm_cfa_flow_aging_timer_reset_input (size:256b/32B) */
50433 
50434 typedef struct hwrm_cfa_flow_aging_timer_reset_input {
50435 	/* The HWRM command request type. */
50436 	uint16_t	req_type;
50437 	/*
50438 	 * The completion ring to send the completion event on. This should
50439 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50440 	 */
50441 	uint16_t	cmpl_ring;
50442 	/*
50443 	 * The sequence ID is used by the driver for tracking multiple
50444 	 * commands. This ID is treated as opaque data by the firmware and
50445 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50446 	 */
50447 	uint16_t	seq_id;
50448 	/*
50449 	 * The target ID of the command:
50450 	 * * 0x0-0xFFF8 - The function ID
50451 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50452 	 * * 0xFFFD - Reserved for user-space HWRM interface
50453 	 * * 0xFFFF - HWRM
50454 	 */
50455 	uint16_t	target_id;
50456 	/*
50457 	 * A physical address pointer pointing to a host buffer that the
50458 	 * command's response data will be written. This can be either a host
50459 	 * physical address (HPA) or a guest physical address (GPA) and must
50460 	 * point to a physically contiguous block of memory.
50461 	 */
50462 	uint64_t	resp_addr;
50463 	/* Flow record index. */
50464 	uint16_t	flow_handle;
50465 	uint8_t	unused_0[2];
50466 	/*
50467 	 * New flow timer value for the flow specified in the ext_flow_handle.
50468 	 * The flow timer unit is 100ms.
50469 	 */
50470 	uint32_t	flow_timer;
50471 	/* This value identifies a set of CFA data structures used for a flow. */
50472 	uint64_t	ext_flow_handle;
50473 } hwrm_cfa_flow_aging_timer_reset_input_t, *phwrm_cfa_flow_aging_timer_reset_input_t;
50474 
50475 /* hwrm_cfa_flow_aging_timer_reset_output (size:128b/16B) */
50476 
50477 typedef struct hwrm_cfa_flow_aging_timer_reset_output {
50478 	/* The specific error status for the command. */
50479 	uint16_t	error_code;
50480 	/* The HWRM command request type. */
50481 	uint16_t	req_type;
50482 	/* The sequence ID from the original command. */
50483 	uint16_t	seq_id;
50484 	/* The length of the response data in number of bytes. */
50485 	uint16_t	resp_len;
50486 	uint8_t	unused_0[7];
50487 	/*
50488 	 * This field is used in Output records to indicate that the output
50489 	 * is completely written to RAM. This field should be read as '1'
50490 	 * to indicate that the output has been completely written.
50491 	 * When writing a command completion or response to an internal
50492 	 * processor, the order of writes has to be such that this field is
50493 	 * written last.
50494 	 */
50495 	uint8_t	valid;
50496 } hwrm_cfa_flow_aging_timer_reset_output_t, *phwrm_cfa_flow_aging_timer_reset_output_t;
50497 
50498 /***************************
50499  * hwrm_cfa_flow_aging_cfg *
50500  ***************************/
50501 
50502 
50503 /* hwrm_cfa_flow_aging_cfg_input (size:384b/48B) */
50504 
50505 typedef struct hwrm_cfa_flow_aging_cfg_input {
50506 	/* The HWRM command request type. */
50507 	uint16_t	req_type;
50508 	/*
50509 	 * The completion ring to send the completion event on. This should
50510 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50511 	 */
50512 	uint16_t	cmpl_ring;
50513 	/*
50514 	 * The sequence ID is used by the driver for tracking multiple
50515 	 * commands. This ID is treated as opaque data by the firmware and
50516 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50517 	 */
50518 	uint16_t	seq_id;
50519 	/*
50520 	 * The target ID of the command:
50521 	 * * 0x0-0xFFF8 - The function ID
50522 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50523 	 * * 0xFFFD - Reserved for user-space HWRM interface
50524 	 * * 0xFFFF - HWRM
50525 	 */
50526 	uint16_t	target_id;
50527 	/*
50528 	 * A physical address pointer pointing to a host buffer that the
50529 	 * command's response data will be written. This can be either a host
50530 	 * physical address (HPA) or a guest physical address (GPA) and must
50531 	 * point to a physically contiguous block of memory.
50532 	 */
50533 	uint64_t	resp_addr;
50534 	/* The bit field to enable per flow aging configuration. */
50535 	uint16_t	enables;
50536 	/*
50537 	 * This bit must be '1' for the tcp flow timer field to be
50538 	 * configured
50539 	 */
50540 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FLOW_TIMER	UINT32_C(0x1)
50541 	/*
50542 	 * This bit must be '1' for the tcp finish timer field to be
50543 	 * configured
50544 	 */
50545 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FIN_TIMER	UINT32_C(0x2)
50546 	/*
50547 	 * This bit must be '1' for the udp flow timer field to be
50548 	 * configured
50549 	 */
50550 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_UDP_FLOW_TIMER	UINT32_C(0x4)
50551 	/*
50552 	 * This bit must be '1' for the eem dma interval field to be
50553 	 * configured
50554 	 */
50555 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_DMA_INTERVAL	UINT32_C(0x8)
50556 	/*
50557 	 * This bit must be '1' for the eem notice interval field to be
50558 	 * configured
50559 	 */
50560 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_NOTICE_INTERVAL	UINT32_C(0x10)
50561 	/*
50562 	 * This bit must be '1' for the eem context memory maximum entries
50563 	 * field to be configured
50564 	 */
50565 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MAX_ENTRIES	UINT32_C(0x20)
50566 	/*
50567 	 * This bit must be '1' for the eem context memory ID field to be
50568 	 * configured
50569 	 */
50570 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_ID		UINT32_C(0x40)
50571 	/*
50572 	 * This bit must be '1' for the eem context memory type field to be
50573 	 * configured
50574 	 */
50575 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MEM_TYPE	UINT32_C(0x80)
50576 	uint8_t	flags;
50577 	/* Enumeration denoting the RX, TX type of the resource. */
50578 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
50579 	/* tx path */
50580 		#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
50581 	/* rx path */
50582 		#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
50583 		#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_LAST   HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX
50584 	/*
50585 	 * Enumeration denoting the enable, disable eem flow aging
50586 	 * configuration.
50587 	 */
50588 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM	UINT32_C(0x2)
50589 	/* tx path */
50590 		#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_DISABLE  (UINT32_C(0x0) << 1)
50591 	/* rx path */
50592 		#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE   (UINT32_C(0x1) << 1)
50593 		#define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_LAST	HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE
50594 	uint8_t	unused_0;
50595 	/*
50596 	 * The flow aging timer for all TCP flows, the unit is 100
50597 	 * milliseconds.
50598 	 */
50599 	uint32_t	tcp_flow_timer;
50600 	/*
50601 	 * The TCP finished timer for all TCP flows, the unit is 100
50602 	 * milliseconds.
50603 	 */
50604 	uint32_t	tcp_fin_timer;
50605 	/*
50606 	 * The flow aging timer for all UDP flows, the unit is 100
50607 	 * milliseconds.
50608 	 */
50609 	uint32_t	udp_flow_timer;
50610 	/*
50611 	 * The interval to dma eem ejection data to host memory, the unit is
50612 	 * milliseconds.
50613 	 */
50614 	uint16_t	eem_dma_interval;
50615 	/*
50616 	 * The interval to notify driver to read the eem ejection data, the
50617 	 * unit is milliseconds.
50618 	 */
50619 	uint16_t	eem_notice_interval;
50620 	/* The maximum entries number in the eem context memory. */
50621 	uint32_t	eem_ctx_max_entries;
50622 	/* The context memory ID for eem flow aging. */
50623 	uint16_t	eem_ctx_id;
50624 	uint16_t	eem_ctx_mem_type;
50625 	/*
50626 	 * The content of context memory is eem ejection data, the size of
50627 	 * each entry is 4 bytes.
50628 	 */
50629 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA UINT32_C(0x0)
50630 	#define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_LAST	HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA
50631 	uint8_t	unused_1[4];
50632 } hwrm_cfa_flow_aging_cfg_input_t, *phwrm_cfa_flow_aging_cfg_input_t;
50633 
50634 /* hwrm_cfa_flow_aging_cfg_output (size:128b/16B) */
50635 
50636 typedef struct hwrm_cfa_flow_aging_cfg_output {
50637 	/* The specific error status for the command. */
50638 	uint16_t	error_code;
50639 	/* The HWRM command request type. */
50640 	uint16_t	req_type;
50641 	/* The sequence ID from the original command. */
50642 	uint16_t	seq_id;
50643 	/* The length of the response data in number of bytes. */
50644 	uint16_t	resp_len;
50645 	uint8_t	unused_0[7];
50646 	/*
50647 	 * This field is used in Output records to indicate that the output
50648 	 * is completely written to RAM. This field should be read as '1'
50649 	 * to indicate that the output has been completely written.
50650 	 * When writing a command completion or response to an internal
50651 	 * processor, the order of writes has to be such that this field is
50652 	 * written last.
50653 	 */
50654 	uint8_t	valid;
50655 } hwrm_cfa_flow_aging_cfg_output_t, *phwrm_cfa_flow_aging_cfg_output_t;
50656 
50657 /****************************
50658  * hwrm_cfa_flow_aging_qcfg *
50659  ****************************/
50660 
50661 
50662 /* hwrm_cfa_flow_aging_qcfg_input (size:192b/24B) */
50663 
50664 typedef struct hwrm_cfa_flow_aging_qcfg_input {
50665 	/* The HWRM command request type. */
50666 	uint16_t	req_type;
50667 	/*
50668 	 * The completion ring to send the completion event on. This should
50669 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50670 	 */
50671 	uint16_t	cmpl_ring;
50672 	/*
50673 	 * The sequence ID is used by the driver for tracking multiple
50674 	 * commands. This ID is treated as opaque data by the firmware and
50675 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50676 	 */
50677 	uint16_t	seq_id;
50678 	/*
50679 	 * The target ID of the command:
50680 	 * * 0x0-0xFFF8 - The function ID
50681 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50682 	 * * 0xFFFD - Reserved for user-space HWRM interface
50683 	 * * 0xFFFF - HWRM
50684 	 */
50685 	uint16_t	target_id;
50686 	/*
50687 	 * A physical address pointer pointing to a host buffer that the
50688 	 * command's response data will be written. This can be either a host
50689 	 * physical address (HPA) or a guest physical address (GPA) and must
50690 	 * point to a physically contiguous block of memory.
50691 	 */
50692 	uint64_t	resp_addr;
50693 	/*
50694 	 * The direction for the flow aging configuration, 1 is rx path, 2 is
50695 	 * tx path.
50696 	 */
50697 	uint8_t	flags;
50698 	/* Enumeration denoting the RX, TX type of the resource. */
50699 	#define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
50700 	/* tx path */
50701 		#define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
50702 	/* rx path */
50703 		#define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
50704 		#define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_LAST HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX
50705 	uint8_t	unused_0[7];
50706 } hwrm_cfa_flow_aging_qcfg_input_t, *phwrm_cfa_flow_aging_qcfg_input_t;
50707 
50708 /* hwrm_cfa_flow_aging_qcfg_output (size:320b/40B) */
50709 
50710 typedef struct hwrm_cfa_flow_aging_qcfg_output {
50711 	/* The specific error status for the command. */
50712 	uint16_t	error_code;
50713 	/* The HWRM command request type. */
50714 	uint16_t	req_type;
50715 	/* The sequence ID from the original command. */
50716 	uint16_t	seq_id;
50717 	/* The length of the response data in number of bytes. */
50718 	uint16_t	resp_len;
50719 	/*
50720 	 * The current flow aging timer for all TCP flows, the unit is 100
50721 	 * millisecond.
50722 	 */
50723 	uint32_t	tcp_flow_timer;
50724 	/*
50725 	 * The current TCP finished timer for all TCP flows, the unit is 100
50726 	 * millisecond.
50727 	 */
50728 	uint32_t	tcp_fin_timer;
50729 	/*
50730 	 * The current flow aging timer for all UDP flows, the unit is 100
50731 	 * millisecond.
50732 	 */
50733 	uint32_t	udp_flow_timer;
50734 	/*
50735 	 * The interval to dma eem ejection data to host memory, the unit is
50736 	 * milliseconds.
50737 	 */
50738 	uint16_t	eem_dma_interval;
50739 	/*
50740 	 * The interval to notify driver to read the eem ejection data, the
50741 	 * unit is milliseconds.
50742 	 */
50743 	uint16_t	eem_notice_interval;
50744 	/* The maximum entries number in the eem context memory. */
50745 	uint32_t	eem_ctx_max_entries;
50746 	/* The context memory ID for eem flow aging. */
50747 	uint16_t	eem_ctx_id;
50748 	/* The context memory type for eem flow aging. */
50749 	uint16_t	eem_ctx_mem_type;
50750 	uint8_t	unused_0[7];
50751 	/*
50752 	 * This field is used in Output records to indicate that the output
50753 	 * is completely written to RAM. This field should be read as '1'
50754 	 * to indicate that the output has been completely written.
50755 	 * When writing a command completion or response to an internal
50756 	 * processor, the order of writes has to be such that this field is
50757 	 * written last.
50758 	 */
50759 	uint8_t	valid;
50760 } hwrm_cfa_flow_aging_qcfg_output_t, *phwrm_cfa_flow_aging_qcfg_output_t;
50761 
50762 /*****************************
50763  * hwrm_cfa_flow_aging_qcaps *
50764  *****************************/
50765 
50766 
50767 /* hwrm_cfa_flow_aging_qcaps_input (size:192b/24B) */
50768 
50769 typedef struct hwrm_cfa_flow_aging_qcaps_input {
50770 	/* The HWRM command request type. */
50771 	uint16_t	req_type;
50772 	/*
50773 	 * The completion ring to send the completion event on. This should
50774 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50775 	 */
50776 	uint16_t	cmpl_ring;
50777 	/*
50778 	 * The sequence ID is used by the driver for tracking multiple
50779 	 * commands. This ID is treated as opaque data by the firmware and
50780 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50781 	 */
50782 	uint16_t	seq_id;
50783 	/*
50784 	 * The target ID of the command:
50785 	 * * 0x0-0xFFF8 - The function ID
50786 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50787 	 * * 0xFFFD - Reserved for user-space HWRM interface
50788 	 * * 0xFFFF - HWRM
50789 	 */
50790 	uint16_t	target_id;
50791 	/*
50792 	 * A physical address pointer pointing to a host buffer that the
50793 	 * command's response data will be written. This can be either a host
50794 	 * physical address (HPA) or a guest physical address (GPA) and must
50795 	 * point to a physically contiguous block of memory.
50796 	 */
50797 	uint64_t	resp_addr;
50798 	/*
50799 	 * The direction for the flow aging configuration, 1 is rx path, 2 is
50800 	 * tx path.
50801 	 */
50802 	uint8_t	flags;
50803 	/* Enumeration denoting the RX, TX type of the resource. */
50804 	#define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH	UINT32_C(0x1)
50805 	/* tx path */
50806 		#define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
50807 	/* rx path */
50808 		#define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
50809 		#define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_LAST HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX
50810 	uint8_t	unused_0[7];
50811 } hwrm_cfa_flow_aging_qcaps_input_t, *phwrm_cfa_flow_aging_qcaps_input_t;
50812 
50813 /* hwrm_cfa_flow_aging_qcaps_output (size:256b/32B) */
50814 
50815 typedef struct hwrm_cfa_flow_aging_qcaps_output {
50816 	/* The specific error status for the command. */
50817 	uint16_t	error_code;
50818 	/* The HWRM command request type. */
50819 	uint16_t	req_type;
50820 	/* The sequence ID from the original command. */
50821 	uint16_t	seq_id;
50822 	/* The length of the response data in number of bytes. */
50823 	uint16_t	resp_len;
50824 	/*
50825 	 * The maximum flow aging timer for all TCP flows, the unit is 100
50826 	 * millisecond.
50827 	 */
50828 	uint32_t	max_tcp_flow_timer;
50829 	/*
50830 	 * The maximum TCP finished timer for all TCP flows, the unit is 100
50831 	 * millisecond.
50832 	 */
50833 	uint32_t	max_tcp_fin_timer;
50834 	/*
50835 	 * The maximum flow aging timer for all UDP flows, the unit is 100
50836 	 * millisecond.
50837 	 */
50838 	uint32_t	max_udp_flow_timer;
50839 	/* The maximum aging flows that HW can support. */
50840 	uint32_t	max_aging_flows;
50841 	uint8_t	unused_0[7];
50842 	/*
50843 	 * This field is used in Output records to indicate that the output
50844 	 * is completely written to RAM. This field should be read as '1'
50845 	 * to indicate that the output has been completely written.
50846 	 * When writing a command completion or response to an internal
50847 	 * processor, the order of writes has to be such that this field is
50848 	 * written last.
50849 	 */
50850 	uint8_t	valid;
50851 } hwrm_cfa_flow_aging_qcaps_output_t, *phwrm_cfa_flow_aging_qcaps_output_t;
50852 
50853 /**********************************
50854  * hwrm_cfa_tcp_flag_process_qcfg *
50855  **********************************/
50856 
50857 
50858 /* hwrm_cfa_tcp_flag_process_qcfg_input (size:128b/16B) */
50859 
50860 typedef struct hwrm_cfa_tcp_flag_process_qcfg_input {
50861 	/* The HWRM command request type. */
50862 	uint16_t	req_type;
50863 	/*
50864 	 * The completion ring to send the completion event on. This should
50865 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50866 	 */
50867 	uint16_t	cmpl_ring;
50868 	/*
50869 	 * The sequence ID is used by the driver for tracking multiple
50870 	 * commands. This ID is treated as opaque data by the firmware and
50871 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50872 	 */
50873 	uint16_t	seq_id;
50874 	/*
50875 	 * The target ID of the command:
50876 	 * * 0x0-0xFFF8 - The function ID
50877 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50878 	 * * 0xFFFD - Reserved for user-space HWRM interface
50879 	 * * 0xFFFF - HWRM
50880 	 */
50881 	uint16_t	target_id;
50882 	/*
50883 	 * A physical address pointer pointing to a host buffer that the
50884 	 * command's response data will be written. This can be either a host
50885 	 * physical address (HPA) or a guest physical address (GPA) and must
50886 	 * point to a physically contiguous block of memory.
50887 	 */
50888 	uint64_t	resp_addr;
50889 } hwrm_cfa_tcp_flag_process_qcfg_input_t, *phwrm_cfa_tcp_flag_process_qcfg_input_t;
50890 
50891 /* hwrm_cfa_tcp_flag_process_qcfg_output (size:192b/24B) */
50892 
50893 typedef struct hwrm_cfa_tcp_flag_process_qcfg_output {
50894 	/* The specific error status for the command. */
50895 	uint16_t	error_code;
50896 	/* The HWRM command request type. */
50897 	uint16_t	req_type;
50898 	/* The sequence ID from the original command. */
50899 	uint16_t	seq_id;
50900 	/* The length of the response data in number of bytes. */
50901 	uint16_t	resp_len;
50902 	/* The port 0 RX mirror action record ID. */
50903 	uint16_t	rx_ar_id_port0;
50904 	/* The port 1 RX mirror action record ID. */
50905 	uint16_t	rx_ar_id_port1;
50906 	/*
50907 	 * The port 0 RX action record ID for TX TCP flag packets from
50908 	 * loopback path.
50909 	 */
50910 	uint16_t	tx_ar_id_port0;
50911 	/*
50912 	 * The port 1 RX action record ID for TX TCP flag packets from
50913 	 * loopback path.
50914 	 */
50915 	uint16_t	tx_ar_id_port1;
50916 	uint8_t	unused_0[7];
50917 	/*
50918 	 * This field is used in Output records to indicate that the output
50919 	 * is completely written to RAM. This field should be read as '1'
50920 	 * to indicate that the output has been completely written.
50921 	 * When writing a command completion or response to an internal
50922 	 * processor, the order of writes has to be such that this field is
50923 	 * written last.
50924 	 */
50925 	uint8_t	valid;
50926 } hwrm_cfa_tcp_flag_process_qcfg_output_t, *phwrm_cfa_tcp_flag_process_qcfg_output_t;
50927 
50928 /**************************
50929  * hwrm_cfa_vf_pair_alloc *
50930  **************************/
50931 
50932 
50933 /* hwrm_cfa_vf_pair_alloc_input (size:448b/56B) */
50934 
50935 typedef struct hwrm_cfa_vf_pair_alloc_input {
50936 	/* The HWRM command request type. */
50937 	uint16_t	req_type;
50938 	/*
50939 	 * The completion ring to send the completion event on. This should
50940 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
50941 	 */
50942 	uint16_t	cmpl_ring;
50943 	/*
50944 	 * The sequence ID is used by the driver for tracking multiple
50945 	 * commands. This ID is treated as opaque data by the firmware and
50946 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
50947 	 */
50948 	uint16_t	seq_id;
50949 	/*
50950 	 * The target ID of the command:
50951 	 * * 0x0-0xFFF8 - The function ID
50952 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50953 	 * * 0xFFFD - Reserved for user-space HWRM interface
50954 	 * * 0xFFFF - HWRM
50955 	 */
50956 	uint16_t	target_id;
50957 	/*
50958 	 * A physical address pointer pointing to a host buffer that the
50959 	 * command's response data will be written. This can be either a host
50960 	 * physical address (HPA) or a guest physical address (GPA) and must
50961 	 * point to a physically contiguous block of memory.
50962 	 */
50963 	uint64_t	resp_addr;
50964 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
50965 	uint16_t	vf_a_id;
50966 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
50967 	uint16_t	vf_b_id;
50968 	uint8_t	unused_0[4];
50969 	/* VF Pair name (32 byte string). */
50970 	char	pair_name[32];
50971 } hwrm_cfa_vf_pair_alloc_input_t, *phwrm_cfa_vf_pair_alloc_input_t;
50972 
50973 /* hwrm_cfa_vf_pair_alloc_output (size:128b/16B) */
50974 
50975 typedef struct hwrm_cfa_vf_pair_alloc_output {
50976 	/* The specific error status for the command. */
50977 	uint16_t	error_code;
50978 	/* The HWRM command request type. */
50979 	uint16_t	req_type;
50980 	/* The sequence ID from the original command. */
50981 	uint16_t	seq_id;
50982 	/* The length of the response data in number of bytes. */
50983 	uint16_t	resp_len;
50984 	uint8_t	unused_0[7];
50985 	/*
50986 	 * This field is used in Output records to indicate that the output
50987 	 * is completely written to RAM. This field should be read as '1'
50988 	 * to indicate that the output has been completely written.
50989 	 * When writing a command completion or response to an internal
50990 	 * processor, the order of writes has to be such that this field is
50991 	 * written last.
50992 	 */
50993 	uint8_t	valid;
50994 } hwrm_cfa_vf_pair_alloc_output_t, *phwrm_cfa_vf_pair_alloc_output_t;
50995 
50996 /*************************
50997  * hwrm_cfa_vf_pair_free *
50998  *************************/
50999 
51000 
51001 /* hwrm_cfa_vf_pair_free_input (size:384b/48B) */
51002 
51003 typedef struct hwrm_cfa_vf_pair_free_input {
51004 	/* The HWRM command request type. */
51005 	uint16_t	req_type;
51006 	/*
51007 	 * The completion ring to send the completion event on. This should
51008 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51009 	 */
51010 	uint16_t	cmpl_ring;
51011 	/*
51012 	 * The sequence ID is used by the driver for tracking multiple
51013 	 * commands. This ID is treated as opaque data by the firmware and
51014 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51015 	 */
51016 	uint16_t	seq_id;
51017 	/*
51018 	 * The target ID of the command:
51019 	 * * 0x0-0xFFF8 - The function ID
51020 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51021 	 * * 0xFFFD - Reserved for user-space HWRM interface
51022 	 * * 0xFFFF - HWRM
51023 	 */
51024 	uint16_t	target_id;
51025 	/*
51026 	 * A physical address pointer pointing to a host buffer that the
51027 	 * command's response data will be written. This can be either a host
51028 	 * physical address (HPA) or a guest physical address (GPA) and must
51029 	 * point to a physically contiguous block of memory.
51030 	 */
51031 	uint64_t	resp_addr;
51032 	/* VF Pair name (32 byte string). */
51033 	char	pair_name[32];
51034 } hwrm_cfa_vf_pair_free_input_t, *phwrm_cfa_vf_pair_free_input_t;
51035 
51036 /* hwrm_cfa_vf_pair_free_output (size:128b/16B) */
51037 
51038 typedef struct hwrm_cfa_vf_pair_free_output {
51039 	/* The specific error status for the command. */
51040 	uint16_t	error_code;
51041 	/* The HWRM command request type. */
51042 	uint16_t	req_type;
51043 	/* The sequence ID from the original command. */
51044 	uint16_t	seq_id;
51045 	/* The length of the response data in number of bytes. */
51046 	uint16_t	resp_len;
51047 	uint8_t	unused_0[7];
51048 	/*
51049 	 * This field is used in Output records to indicate that the output
51050 	 * is completely written to RAM. This field should be read as '1'
51051 	 * to indicate that the output has been completely written.
51052 	 * When writing a command completion or response to an internal
51053 	 * processor, the order of writes has to be such that this field is
51054 	 * written last.
51055 	 */
51056 	uint8_t	valid;
51057 } hwrm_cfa_vf_pair_free_output_t, *phwrm_cfa_vf_pair_free_output_t;
51058 
51059 /*************************
51060  * hwrm_cfa_vf_pair_info *
51061  *************************/
51062 
51063 
51064 /* hwrm_cfa_vf_pair_info_input (size:448b/56B) */
51065 
51066 typedef struct hwrm_cfa_vf_pair_info_input {
51067 	/* The HWRM command request type. */
51068 	uint16_t	req_type;
51069 	/*
51070 	 * The completion ring to send the completion event on. This should
51071 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51072 	 */
51073 	uint16_t	cmpl_ring;
51074 	/*
51075 	 * The sequence ID is used by the driver for tracking multiple
51076 	 * commands. This ID is treated as opaque data by the firmware and
51077 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51078 	 */
51079 	uint16_t	seq_id;
51080 	/*
51081 	 * The target ID of the command:
51082 	 * * 0x0-0xFFF8 - The function ID
51083 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51084 	 * * 0xFFFD - Reserved for user-space HWRM interface
51085 	 * * 0xFFFF - HWRM
51086 	 */
51087 	uint16_t	target_id;
51088 	/*
51089 	 * A physical address pointer pointing to a host buffer that the
51090 	 * command's response data will be written. This can be either a host
51091 	 * physical address (HPA) or a guest physical address (GPA) and must
51092 	 * point to a physically contiguous block of memory.
51093 	 */
51094 	uint64_t	resp_addr;
51095 	uint32_t	flags;
51096 	/* If this flag is set, lookup by name else lookup by index. */
51097 	#define HWRM_CFA_VF_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE	UINT32_C(0x1)
51098 	/* vf pair table index. */
51099 	uint16_t	vf_pair_index;
51100 	uint8_t	unused_0[2];
51101 	/* VF Pair name (32 byte string). */
51102 	char	vf_pair_name[32];
51103 } hwrm_cfa_vf_pair_info_input_t, *phwrm_cfa_vf_pair_info_input_t;
51104 
51105 /* hwrm_cfa_vf_pair_info_output (size:512b/64B) */
51106 
51107 typedef struct hwrm_cfa_vf_pair_info_output {
51108 	/* The specific error status for the command. */
51109 	uint16_t	error_code;
51110 	/* The HWRM command request type. */
51111 	uint16_t	req_type;
51112 	/* The sequence ID from the original command. */
51113 	uint16_t	seq_id;
51114 	/* The length of the response data in number of bytes. */
51115 	uint16_t	resp_len;
51116 	/* vf pair table index. */
51117 	uint16_t	next_vf_pair_index;
51118 	/* vf pair member a's vf_fid. */
51119 	uint16_t	vf_a_fid;
51120 	/* vf pair member a's Linux logical VF number. */
51121 	uint16_t	vf_a_index;
51122 	/* vf pair member b's vf_fid. */
51123 	uint16_t	vf_b_fid;
51124 	/* vf pair member a's Linux logical VF number. */
51125 	uint16_t	vf_b_index;
51126 	/* vf pair state. */
51127 	uint8_t	pair_state;
51128 	/* Pair has been allocated */
51129 	#define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
51130 	/* Both pair members are active */
51131 	#define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE	UINT32_C(0x2)
51132 	#define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_LAST	HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
51133 	uint8_t	unused_0[5];
51134 	/* VF Pair name (32 byte string). */
51135 	char	pair_name[32];
51136 	uint8_t	unused_1[7];
51137 	/*
51138 	 * This field is used in Output records to indicate that the output
51139 	 * is completely written to RAM. This field should be read as '1'
51140 	 * to indicate that the output has been completely written.
51141 	 * When writing a command completion or response to an internal
51142 	 * processor, the order of writes has to be such that this field is
51143 	 * written last.
51144 	 */
51145 	uint8_t	valid;
51146 } hwrm_cfa_vf_pair_info_output_t, *phwrm_cfa_vf_pair_info_output_t;
51147 
51148 /***********************
51149  * hwrm_cfa_pair_alloc *
51150  ***********************/
51151 
51152 
51153 /* hwrm_cfa_pair_alloc_input (size:576b/72B) */
51154 
51155 typedef struct hwrm_cfa_pair_alloc_input {
51156 	/* The HWRM command request type. */
51157 	uint16_t	req_type;
51158 	/*
51159 	 * The completion ring to send the completion event on. This should
51160 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51161 	 */
51162 	uint16_t	cmpl_ring;
51163 	/*
51164 	 * The sequence ID is used by the driver for tracking multiple
51165 	 * commands. This ID is treated as opaque data by the firmware and
51166 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51167 	 */
51168 	uint16_t	seq_id;
51169 	/*
51170 	 * The target ID of the command:
51171 	 * * 0x0-0xFFF8 - The function ID
51172 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51173 	 * * 0xFFFD - Reserved for user-space HWRM interface
51174 	 * * 0xFFFF - HWRM
51175 	 */
51176 	uint16_t	target_id;
51177 	/*
51178 	 * A physical address pointer pointing to a host buffer that the
51179 	 * command's response data will be written. This can be either a host
51180 	 * physical address (HPA) or a guest physical address (GPA) and must
51181 	 * point to a physically contiguous block of memory.
51182 	 */
51183 	uint64_t	resp_addr;
51184 	/*
51185 	 * Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair,
51186 	 *		5-rep2fn_mod, 6-rep2fn_modall, 7-rep2fn_truflow).
51187 	 */
51188 	uint16_t	pair_mode;
51189 	/*
51190 	 * Pair between VF on local host with PF or VF on specified host.
51191 	 * (deprecated)
51192 	 */
51193 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_VF2FN	UINT32_C(0x0)
51194 	/*
51195 	 * Pair between REP on local host with PF or VF on specified host.
51196 	 * (deprecated)
51197 	 */
51198 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN	UINT32_C(0x1)
51199 	/*
51200 	 * Pair between REP on local host with REP on specified host.
51201 	 * (deprecated)
51202 	 */
51203 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2REP	UINT32_C(0x2)
51204 	/* Pair for the proxy interface. (deprecated) */
51205 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_PROXY	UINT32_C(0x3)
51206 	/* Pair for the PF interface. (deprecated) */
51207 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_PFPAIR	UINT32_C(0x4)
51208 	/* Modify existing rep2fn pair and move pair to new PF. (deprecated) */
51209 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_MOD	UINT32_C(0x5)
51210 	/*
51211 	 * Modify existing rep2fn pairs paired with same PF and move pairs
51212 	 * to new PF. (deprecated)
51213 	 */
51214 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_MODALL  UINT32_C(0x6)
51215 	/*
51216 	 * Truflow pair between REP on local host with PF or VF on specified
51217 	 * host.
51218 	 */
51219 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_TRUFLOW UINT32_C(0x7)
51220 	#define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_LAST	HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_TRUFLOW
51221 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
51222 	uint16_t	vf_a_id;
51223 	/* Logical Host (0xff-local host). */
51224 	uint8_t	host_b_id;
51225 	/* Logical PF (0xff-PF for command channel). */
51226 	uint8_t	pf_b_id;
51227 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
51228 	uint16_t	vf_b_id;
51229 	/* Loopback port (0xff-internal loopback), valid for mode-3. */
51230 	uint8_t	port_id;
51231 	/* Priority used for encap of loopback packets valid for mode-3. */
51232 	uint8_t	pri;
51233 	/* New PF for rep2fn modify, valid for mode 5. */
51234 	uint16_t	new_pf_fid;
51235 	uint32_t	enables;
51236 	/*
51237 	 * This bit must be '1' for the q_ab field to be
51238 	 * configured.
51239 	 */
51240 	#define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_Q_AB_VALID	UINT32_C(0x1)
51241 	/*
51242 	 * This bit must be '1' for the q_ba field to be
51243 	 * configured.
51244 	 */
51245 	#define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_Q_BA_VALID	UINT32_C(0x2)
51246 	/*
51247 	 * This bit must be '1' for the fc_ab field to be
51248 	 * configured.
51249 	 */
51250 	#define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_FC_AB_VALID	UINT32_C(0x4)
51251 	/*
51252 	 * This bit must be '1' for the fc_ba field to be
51253 	 * configured.
51254 	 */
51255 	#define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_FC_BA_VALID	UINT32_C(0x8)
51256 	/* VF Pair name (32 byte string). */
51257 	char	pair_name[32];
51258 	/*
51259 	 * The q_ab value specifies the logical index of the TX/RX CoS
51260 	 * queue to be assigned for traffic in the A to B direction of
51261 	 * the interface pair. The default value is 0.
51262 	 */
51263 	uint8_t	q_ab;
51264 	/*
51265 	 * The q_ba value specifies the logical index of the TX/RX CoS
51266 	 * queue to be assigned for traffic in the B to A direction of
51267 	 * the interface pair. The default value is 1.
51268 	 */
51269 	uint8_t	q_ba;
51270 	/*
51271 	 * Specifies whether RX ring flow control is disabled (0) or enabled
51272 	 * (1) in the A to B direction. The default value is 0, meaning that
51273 	 * packets will be dropped when the B-side RX rings are full.
51274 	 */
51275 	uint8_t	fc_ab;
51276 	/*
51277 	 * Specifies whether RX ring flow control is disabled (0) or enabled
51278 	 * (1) in the B to A direction. The default value is 1, meaning that
51279 	 * the RX CoS queue will be flow controlled when the A-side RX rings
51280 	 * are full.
51281 	 */
51282 	uint8_t	fc_ba;
51283 	uint8_t	unused_1[4];
51284 } hwrm_cfa_pair_alloc_input_t, *phwrm_cfa_pair_alloc_input_t;
51285 
51286 /* hwrm_cfa_pair_alloc_output (size:192b/24B) */
51287 
51288 typedef struct hwrm_cfa_pair_alloc_output {
51289 	/* The specific error status for the command. */
51290 	uint16_t	error_code;
51291 	/* The HWRM command request type. */
51292 	uint16_t	req_type;
51293 	/* The sequence ID from the original command. */
51294 	uint16_t	seq_id;
51295 	/* The length of the response data in number of bytes. */
51296 	uint16_t	resp_len;
51297 	/* Only valid for modes 1 and 2. */
51298 	uint16_t	rx_cfa_code_a;
51299 	/* Only valid for modes 1 and 2. */
51300 	uint16_t	tx_cfa_action_a;
51301 	/* Only valid for mode 2. */
51302 	uint16_t	rx_cfa_code_b;
51303 	/* Only valid for mode 2. */
51304 	uint16_t	tx_cfa_action_b;
51305 	uint8_t	unused_0[7];
51306 	/*
51307 	 * This field is used in Output records to indicate that the output
51308 	 * is completely written to RAM. This field should be read as '1'
51309 	 * to indicate that the output has been completely written.
51310 	 * When writing a command completion or response to an internal
51311 	 * processor, the order of writes has to be such that this field is
51312 	 * written last.
51313 	 */
51314 	uint8_t	valid;
51315 } hwrm_cfa_pair_alloc_output_t, *phwrm_cfa_pair_alloc_output_t;
51316 
51317 /**********************
51318  * hwrm_cfa_pair_free *
51319  **********************/
51320 
51321 
51322 /* hwrm_cfa_pair_free_input (size:448b/56B) */
51323 
51324 typedef struct hwrm_cfa_pair_free_input {
51325 	/* The HWRM command request type. */
51326 	uint16_t	req_type;
51327 	/*
51328 	 * The completion ring to send the completion event on. This should
51329 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51330 	 */
51331 	uint16_t	cmpl_ring;
51332 	/*
51333 	 * The sequence ID is used by the driver for tracking multiple
51334 	 * commands. This ID is treated as opaque data by the firmware and
51335 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51336 	 */
51337 	uint16_t	seq_id;
51338 	/*
51339 	 * The target ID of the command:
51340 	 * * 0x0-0xFFF8 - The function ID
51341 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51342 	 * * 0xFFFD - Reserved for user-space HWRM interface
51343 	 * * 0xFFFF - HWRM
51344 	 */
51345 	uint16_t	target_id;
51346 	/*
51347 	 * A physical address pointer pointing to a host buffer that the
51348 	 * command's response data will be written. This can be either a host
51349 	 * physical address (HPA) or a guest physical address (GPA) and must
51350 	 * point to a physically contiguous block of memory.
51351 	 */
51352 	uint64_t	resp_addr;
51353 	/* VF Pair name (32 byte string). */
51354 	char	pair_name[32];
51355 	/* Logical PF (0xff-PF for command channel). */
51356 	uint8_t	pf_b_id;
51357 	uint8_t	unused_0[3];
51358 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
51359 	uint16_t	vf_id;
51360 	/*
51361 	 * Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair,
51362 	 *		5-rep2fn_mod, 6-rep2fn_modall, 7-rep2fn_truflow).
51363 	 */
51364 	uint16_t	pair_mode;
51365 	/*
51366 	 * Pair between VF on local host with PF or VF on specified host.
51367 	 * (deprecated)
51368 	 */
51369 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_VF2FN	UINT32_C(0x0)
51370 	/*
51371 	 * Pair between REP on local host with PF or VF on specified host.
51372 	 * (deprecated)
51373 	 */
51374 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN	UINT32_C(0x1)
51375 	/*
51376 	 * Pair between REP on local host with REP on specified host.
51377 	 * (deprecated)
51378 	 */
51379 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2REP	UINT32_C(0x2)
51380 	/* Pair for the proxy interface. (deprecated) */
51381 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_PROXY	UINT32_C(0x3)
51382 	/* Pair for the PF interface. (deprecated) */
51383 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_PFPAIR	UINT32_C(0x4)
51384 	/* Modify existing rep2fn pair and move pair to new PF. (deprecated) */
51385 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_MOD	UINT32_C(0x5)
51386 	/*
51387 	 * Modify existing rep2fn pairs paired with same PF and move pairs
51388 	 * to new PF. (deprecated)
51389 	 */
51390 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_MODALL  UINT32_C(0x6)
51391 	/*
51392 	 * Truflow pair between REP on local host with PF or VF on
51393 	 * specified host.
51394 	 */
51395 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_TRUFLOW UINT32_C(0x7)
51396 	#define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_LAST	HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_TRUFLOW
51397 } hwrm_cfa_pair_free_input_t, *phwrm_cfa_pair_free_input_t;
51398 
51399 /* hwrm_cfa_pair_free_output (size:128b/16B) */
51400 
51401 typedef struct hwrm_cfa_pair_free_output {
51402 	/* The specific error status for the command. */
51403 	uint16_t	error_code;
51404 	/* The HWRM command request type. */
51405 	uint16_t	req_type;
51406 	/* The sequence ID from the original command. */
51407 	uint16_t	seq_id;
51408 	/* The length of the response data in number of bytes. */
51409 	uint16_t	resp_len;
51410 	uint8_t	unused_0[7];
51411 	/*
51412 	 * This field is used in Output records to indicate that the output
51413 	 * is completely written to RAM. This field should be read as '1'
51414 	 * to indicate that the output has been completely written.
51415 	 * When writing a command completion or response to an internal
51416 	 * processor, the order of writes has to be such that this field is
51417 	 * written last.
51418 	 */
51419 	uint8_t	valid;
51420 } hwrm_cfa_pair_free_output_t, *phwrm_cfa_pair_free_output_t;
51421 
51422 /**********************
51423  * hwrm_cfa_pair_info *
51424  **********************/
51425 
51426 
51427 /* hwrm_cfa_pair_info_input (size:448b/56B) */
51428 
51429 typedef struct hwrm_cfa_pair_info_input {
51430 	/* The HWRM command request type. */
51431 	uint16_t	req_type;
51432 	/*
51433 	 * The completion ring to send the completion event on. This should
51434 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51435 	 */
51436 	uint16_t	cmpl_ring;
51437 	/*
51438 	 * The sequence ID is used by the driver for tracking multiple
51439 	 * commands. This ID is treated as opaque data by the firmware and
51440 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51441 	 */
51442 	uint16_t	seq_id;
51443 	/*
51444 	 * The target ID of the command:
51445 	 * * 0x0-0xFFF8 - The function ID
51446 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51447 	 * * 0xFFFD - Reserved for user-space HWRM interface
51448 	 * * 0xFFFF - HWRM
51449 	 */
51450 	uint16_t	target_id;
51451 	/*
51452 	 * A physical address pointer pointing to a host buffer that the
51453 	 * command's response data will be written. This can be either a host
51454 	 * physical address (HPA) or a guest physical address (GPA) and must
51455 	 * point to a physically contiguous block of memory.
51456 	 */
51457 	uint64_t	resp_addr;
51458 	uint32_t	flags;
51459 	/* If this flag is set, lookup by name else lookup by index. */
51460 	#define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE	UINT32_C(0x1)
51461 	/* If this flag is set, lookup by PF id and VF id. */
51462 	#define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_REPRE	UINT32_C(0x2)
51463 	/* Pair table index. */
51464 	uint16_t	pair_index;
51465 	/* Pair pf index. */
51466 	uint8_t	pair_pfid;
51467 	/* Pair vf index. */
51468 	uint8_t	pair_vfid;
51469 	/* Pair name (32 byte string). */
51470 	char	pair_name[32];
51471 } hwrm_cfa_pair_info_input_t, *phwrm_cfa_pair_info_input_t;
51472 
51473 /* hwrm_cfa_pair_info_output (size:576b/72B) */
51474 
51475 typedef struct hwrm_cfa_pair_info_output {
51476 	/* The specific error status for the command. */
51477 	uint16_t	error_code;
51478 	/* The HWRM command request type. */
51479 	uint16_t	req_type;
51480 	/* The sequence ID from the original command. */
51481 	uint16_t	seq_id;
51482 	/* The length of the response data in number of bytes. */
51483 	uint16_t	resp_len;
51484 	/* Pair table index. */
51485 	uint16_t	next_pair_index;
51486 	/* Pair member a's fid. */
51487 	uint16_t	a_fid;
51488 	/* Logical host number. */
51489 	uint8_t	host_a_index;
51490 	/* Logical PF number. */
51491 	uint8_t	pf_a_index;
51492 	/* Pair member a's Linux logical VF number. */
51493 	uint16_t	vf_a_index;
51494 	/* Rx CFA code. */
51495 	uint16_t	rx_cfa_code_a;
51496 	/* Tx CFA action. */
51497 	uint16_t	tx_cfa_action_a;
51498 	/* Pair member b's fid. */
51499 	uint16_t	b_fid;
51500 	/* Logical host number. */
51501 	uint8_t	host_b_index;
51502 	/* Logical PF number. */
51503 	uint8_t	pf_b_index;
51504 	/* Pair member a's Linux logical VF number. */
51505 	uint16_t	vf_b_index;
51506 	/* Rx CFA code. */
51507 	uint16_t	rx_cfa_code_b;
51508 	/* Tx CFA action. */
51509 	uint16_t	tx_cfa_action_b;
51510 	/* Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair). */
51511 	uint8_t	pair_mode;
51512 	/*
51513 	 * Pair between VF on local host with PF or VF on specified host.
51514 	 * (deprecated)
51515 	 */
51516 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_VF2FN   UINT32_C(0x0)
51517 	/*
51518 	 * Pair between REP on local host with PF or VF on specified host.
51519 	 * (deprecated)
51520 	 */
51521 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2FN  UINT32_C(0x1)
51522 	/*
51523 	 * Pair between REP on local host with REP on specified host.
51524 	 * (deprecated)
51525 	 */
51526 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2REP UINT32_C(0x2)
51527 	/* Pair for the proxy interface. (deprecated) */
51528 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PROXY   UINT32_C(0x3)
51529 	/* Pair for the PF interface. (deprecated) */
51530 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR  UINT32_C(0x4)
51531 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_LAST   HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR
51532 	/* Pair state. */
51533 	uint8_t	pair_state;
51534 	/* Pair has been allocated */
51535 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
51536 	/* Both pair members are active */
51537 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE	UINT32_C(0x2)
51538 	#define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_LAST	HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
51539 	/* Pair name (32 byte string). */
51540 	char	pair_name[32];
51541 	uint8_t	unused_0[7];
51542 	/*
51543 	 * This field is used in Output records to indicate that the output
51544 	 * is completely written to RAM. This field should be read as '1'
51545 	 * to indicate that the output has been completely written.
51546 	 * When writing a command completion or response to an internal
51547 	 * processor, the order of writes has to be such that this field is
51548 	 * written last.
51549 	 */
51550 	uint8_t	valid;
51551 } hwrm_cfa_pair_info_output_t, *phwrm_cfa_pair_info_output_t;
51552 
51553 /**********************
51554  * hwrm_cfa_vfr_alloc *
51555  **********************/
51556 
51557 
51558 /* hwrm_cfa_vfr_alloc_input (size:448b/56B) */
51559 
51560 typedef struct hwrm_cfa_vfr_alloc_input {
51561 	/* The HWRM command request type. */
51562 	uint16_t	req_type;
51563 	/*
51564 	 * The completion ring to send the completion event on. This should
51565 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51566 	 */
51567 	uint16_t	cmpl_ring;
51568 	/*
51569 	 * The sequence ID is used by the driver for tracking multiple
51570 	 * commands. This ID is treated as opaque data by the firmware and
51571 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51572 	 */
51573 	uint16_t	seq_id;
51574 	/*
51575 	 * The target ID of the command:
51576 	 * * 0x0-0xFFF8 - The function ID
51577 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51578 	 * * 0xFFFD - Reserved for user-space HWRM interface
51579 	 * * 0xFFFF - HWRM
51580 	 */
51581 	uint16_t	target_id;
51582 	/*
51583 	 * A physical address pointer pointing to a host buffer that the
51584 	 * command's response data will be written. This can be either a host
51585 	 * physical address (HPA) or a guest physical address (GPA) and must
51586 	 * point to a physically contiguous block of memory.
51587 	 */
51588 	uint64_t	resp_addr;
51589 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
51590 	uint16_t	vf_id;
51591 	/*
51592 	 * This field is reserved for the future use.
51593 	 * It shall be set to 0.
51594 	 */
51595 	uint16_t	reserved;
51596 	uint8_t	unused_0[4];
51597 	/* VF Representor name (32 byte string). */
51598 	char	vfr_name[32];
51599 } hwrm_cfa_vfr_alloc_input_t, *phwrm_cfa_vfr_alloc_input_t;
51600 
51601 /* hwrm_cfa_vfr_alloc_output (size:128b/16B) */
51602 
51603 typedef struct hwrm_cfa_vfr_alloc_output {
51604 	/* The specific error status for the command. */
51605 	uint16_t	error_code;
51606 	/* The HWRM command request type. */
51607 	uint16_t	req_type;
51608 	/* The sequence ID from the original command. */
51609 	uint16_t	seq_id;
51610 	/* The length of the response data in number of bytes. */
51611 	uint16_t	resp_len;
51612 	/* Rx CFA code. */
51613 	uint16_t	rx_cfa_code;
51614 	/* Tx CFA action. */
51615 	uint16_t	tx_cfa_action;
51616 	uint8_t	unused_0[3];
51617 	/*
51618 	 * This field is used in Output records to indicate that the output
51619 	 * is completely written to RAM. This field should be read as '1'
51620 	 * to indicate that the output has been completely written.
51621 	 * When writing a command completion or response to an internal
51622 	 * processor, the order of writes has to be such that this field is
51623 	 * written last.
51624 	 */
51625 	uint8_t	valid;
51626 } hwrm_cfa_vfr_alloc_output_t, *phwrm_cfa_vfr_alloc_output_t;
51627 
51628 /*********************
51629  * hwrm_cfa_vfr_free *
51630  *********************/
51631 
51632 
51633 /* hwrm_cfa_vfr_free_input (size:448b/56B) */
51634 
51635 typedef struct hwrm_cfa_vfr_free_input {
51636 	/* The HWRM command request type. */
51637 	uint16_t	req_type;
51638 	/*
51639 	 * The completion ring to send the completion event on. This should
51640 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51641 	 */
51642 	uint16_t	cmpl_ring;
51643 	/*
51644 	 * The sequence ID is used by the driver for tracking multiple
51645 	 * commands. This ID is treated as opaque data by the firmware and
51646 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51647 	 */
51648 	uint16_t	seq_id;
51649 	/*
51650 	 * The target ID of the command:
51651 	 * * 0x0-0xFFF8 - The function ID
51652 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51653 	 * * 0xFFFD - Reserved for user-space HWRM interface
51654 	 * * 0xFFFF - HWRM
51655 	 */
51656 	uint16_t	target_id;
51657 	/*
51658 	 * A physical address pointer pointing to a host buffer that the
51659 	 * command's response data will be written. This can be either a host
51660 	 * physical address (HPA) or a guest physical address (GPA) and must
51661 	 * point to a physically contiguous block of memory.
51662 	 */
51663 	uint64_t	resp_addr;
51664 	/* VF Representor name (32 byte string). */
51665 	char	vfr_name[32];
51666 	/* Logical VF number (range: 0 -> MAX_VFS -1). */
51667 	uint16_t	vf_id;
51668 	/*
51669 	 * This field is reserved for the future use.
51670 	 * It shall be set to 0.
51671 	 */
51672 	uint16_t	reserved;
51673 	uint8_t	unused_0[4];
51674 } hwrm_cfa_vfr_free_input_t, *phwrm_cfa_vfr_free_input_t;
51675 
51676 /* hwrm_cfa_vfr_free_output (size:128b/16B) */
51677 
51678 typedef struct hwrm_cfa_vfr_free_output {
51679 	/* The specific error status for the command. */
51680 	uint16_t	error_code;
51681 	/* The HWRM command request type. */
51682 	uint16_t	req_type;
51683 	/* The sequence ID from the original command. */
51684 	uint16_t	seq_id;
51685 	/* The length of the response data in number of bytes. */
51686 	uint16_t	resp_len;
51687 	uint8_t	unused_0[7];
51688 	/*
51689 	 * This field is used in Output records to indicate that the output
51690 	 * is completely written to RAM. This field should be read as '1'
51691 	 * to indicate that the output has been completely written.
51692 	 * When writing a command completion or response to an internal
51693 	 * processor, the order of writes has to be such that this field is
51694 	 * written last.
51695 	 */
51696 	uint8_t	valid;
51697 } hwrm_cfa_vfr_free_output_t, *phwrm_cfa_vfr_free_output_t;
51698 
51699 /***************************************
51700  * hwrm_cfa_redirect_query_tunnel_type *
51701  ***************************************/
51702 
51703 
51704 /* hwrm_cfa_redirect_query_tunnel_type_input (size:192b/24B) */
51705 
51706 typedef struct hwrm_cfa_redirect_query_tunnel_type_input {
51707 	/* The HWRM command request type. */
51708 	uint16_t	req_type;
51709 	/*
51710 	 * The completion ring to send the completion event on. This should
51711 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51712 	 */
51713 	uint16_t	cmpl_ring;
51714 	/*
51715 	 * The sequence ID is used by the driver for tracking multiple
51716 	 * commands. This ID is treated as opaque data by the firmware and
51717 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51718 	 */
51719 	uint16_t	seq_id;
51720 	/*
51721 	 * The target ID of the command:
51722 	 * * 0x0-0xFFF8 - The function ID
51723 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51724 	 * * 0xFFFD - Reserved for user-space HWRM interface
51725 	 * * 0xFFFF - HWRM
51726 	 */
51727 	uint16_t	target_id;
51728 	/*
51729 	 * A physical address pointer pointing to a host buffer that the
51730 	 * command's response data will be written. This can be either a host
51731 	 * physical address (HPA) or a guest physical address (GPA) and must
51732 	 * point to a physically contiguous block of memory.
51733 	 */
51734 	uint64_t	resp_addr;
51735 	/* The source function id. */
51736 	uint16_t	src_fid;
51737 	uint8_t	unused_0[6];
51738 } hwrm_cfa_redirect_query_tunnel_type_input_t, *phwrm_cfa_redirect_query_tunnel_type_input_t;
51739 
51740 /* hwrm_cfa_redirect_query_tunnel_type_output (size:128b/16B) */
51741 
51742 typedef struct hwrm_cfa_redirect_query_tunnel_type_output {
51743 	/* The specific error status for the command. */
51744 	uint16_t	error_code;
51745 	/* The HWRM command request type. */
51746 	uint16_t	req_type;
51747 	/* The sequence ID from the original command. */
51748 	uint16_t	seq_id;
51749 	/* The length of the response data in number of bytes. */
51750 	uint16_t	resp_len;
51751 	/* Tunnel Mask. */
51752 	uint32_t	tunnel_mask;
51753 	/* Non-tunnel */
51754 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NONTUNNEL	UINT32_C(0x1)
51755 	/* Virtual eXtensible Local Area Network (VXLAN) */
51756 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN		UINT32_C(0x2)
51757 	/* Network Virtualization Generic Routing Encapsulation (NVGRE) */
51758 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NVGRE		UINT32_C(0x4)
51759 	/* Generic Routing Encapsulation (GRE) inside Ethernet payload */
51760 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2GRE		UINT32_C(0x8)
51761 	/* IP in IP */
51762 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPIP		UINT32_C(0x10)
51763 	/* Generic Network Virtualization Encapsulation (Geneve) */
51764 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_GENEVE	UINT32_C(0x20)
51765 	/* Multi-Protocol Label Switching (MPLS) */
51766 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_MPLS		UINT32_C(0x40)
51767 	/* Stateless Transport Tunnel (STT) */
51768 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_STT		UINT32_C(0x80)
51769 	/* Generic Routing Encapsulation (GRE) inside IP datagram payload */
51770 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE		UINT32_C(0x100)
51771 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
51772 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_V4	UINT32_C(0x200)
51773 	/*
51774 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
51775 	 * datagram payload
51776 	 */
51777 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE_V1	UINT32_C(0x400)
51778 	/* Any tunneled traffic */
51779 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_ANYTUNNEL	UINT32_C(0x800)
51780 	/* Use fixed layer 2 ether type of 0xFFFF */
51781 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2_ETYPE	UINT32_C(0x1000)
51782 	/*
51783 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
51784 	 * (IPV6oVXLANGPE)
51785 	 */
51786 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_GPE_V6	UINT32_C(0x2000)
51787 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
51788 	#define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_GPE	UINT32_C(0x4000)
51789 	uint8_t	unused_0[3];
51790 	/*
51791 	 * This field is used in Output records to indicate that the output
51792 	 * is completely written to RAM. This field should be read as '1'
51793 	 * to indicate that the output has been completely written.
51794 	 * When writing a command completion or response to an internal
51795 	 * processor, the order of writes has to be such that this field is
51796 	 * written last.
51797 	 */
51798 	uint8_t	valid;
51799 } hwrm_cfa_redirect_query_tunnel_type_output_t, *phwrm_cfa_redirect_query_tunnel_type_output_t;
51800 
51801 /*************************
51802  * hwrm_cfa_ctx_mem_rgtr *
51803  *************************/
51804 
51805 
51806 /* hwrm_cfa_ctx_mem_rgtr_input (size:256b/32B) */
51807 
51808 typedef struct hwrm_cfa_ctx_mem_rgtr_input {
51809 	/* The HWRM command request type. */
51810 	uint16_t	req_type;
51811 	/*
51812 	 * The completion ring to send the completion event on. This should
51813 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51814 	 */
51815 	uint16_t	cmpl_ring;
51816 	/*
51817 	 * The sequence ID is used by the driver for tracking multiple
51818 	 * commands. This ID is treated as opaque data by the firmware and
51819 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51820 	 */
51821 	uint16_t	seq_id;
51822 	/*
51823 	 * The target ID of the command:
51824 	 * * 0x0-0xFFF8 - The function ID
51825 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51826 	 * * 0xFFFD - Reserved for user-space HWRM interface
51827 	 * * 0xFFFF - HWRM
51828 	 */
51829 	uint16_t	target_id;
51830 	/*
51831 	 * A physical address pointer pointing to a host buffer that the
51832 	 * command's response data will be written. This can be either a host
51833 	 * physical address (HPA) or a guest physical address (GPA) and must
51834 	 * point to a physically contiguous block of memory.
51835 	 */
51836 	uint64_t	resp_addr;
51837 	uint16_t	flags;
51838 	/* Counter PBL indirect levels. */
51839 	uint8_t	page_level;
51840 	/* PBL pointer is physical start address. */
51841 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
51842 	/* PBL pointer points to PTE table. */
51843 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
51844 	/*
51845 	 * PBL pointer points to PDE table with each entry pointing to PTE
51846 	 * tables.
51847 	 */
51848 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
51849 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LAST HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
51850 	/* Page size. */
51851 	uint8_t	page_size;
51852 	/* 4KB page size. */
51853 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
51854 	/* 8KB page size. */
51855 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
51856 	/* 64KB page size. */
51857 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
51858 	/* 256KB page size. */
51859 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
51860 	/* 1MB page size. */
51861 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
51862 	/* 2MB page size. */
51863 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
51864 	/* 4MB page size. */
51865 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
51866 	/* 1GB page size. */
51867 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
51868 	#define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_LAST HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G
51869 	uint32_t	unused_0;
51870 	/* Pointer to the PBL, or PDL depending on number of levels */
51871 	uint64_t	page_dir;
51872 } hwrm_cfa_ctx_mem_rgtr_input_t, *phwrm_cfa_ctx_mem_rgtr_input_t;
51873 
51874 /* hwrm_cfa_ctx_mem_rgtr_output (size:128b/16B) */
51875 
51876 typedef struct hwrm_cfa_ctx_mem_rgtr_output {
51877 	/* The specific error status for the command. */
51878 	uint16_t	error_code;
51879 	/* The HWRM command request type. */
51880 	uint16_t	req_type;
51881 	/* The sequence ID from the original command. */
51882 	uint16_t	seq_id;
51883 	/* The length of the response data in number of bytes. */
51884 	uint16_t	resp_len;
51885 	/*
51886 	 * Id/Handle to the recently register context memory. This handle is
51887 	 * passed to the CFA feature.
51888 	 */
51889 	uint16_t	ctx_id;
51890 	uint8_t	unused_0[5];
51891 	/*
51892 	 * This field is used in Output records to indicate that the output
51893 	 * is completely written to RAM. This field should be read as '1'
51894 	 * to indicate that the output has been completely written.
51895 	 * When writing a command completion or response to an internal
51896 	 * processor, the order of writes has to be such that this field is
51897 	 * written last.
51898 	 */
51899 	uint8_t	valid;
51900 } hwrm_cfa_ctx_mem_rgtr_output_t, *phwrm_cfa_ctx_mem_rgtr_output_t;
51901 
51902 /***************************
51903  * hwrm_cfa_ctx_mem_unrgtr *
51904  ***************************/
51905 
51906 
51907 /* hwrm_cfa_ctx_mem_unrgtr_input (size:192b/24B) */
51908 
51909 typedef struct hwrm_cfa_ctx_mem_unrgtr_input {
51910 	/* The HWRM command request type. */
51911 	uint16_t	req_type;
51912 	/*
51913 	 * The completion ring to send the completion event on. This should
51914 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51915 	 */
51916 	uint16_t	cmpl_ring;
51917 	/*
51918 	 * The sequence ID is used by the driver for tracking multiple
51919 	 * commands. This ID is treated as opaque data by the firmware and
51920 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51921 	 */
51922 	uint16_t	seq_id;
51923 	/*
51924 	 * The target ID of the command:
51925 	 * * 0x0-0xFFF8 - The function ID
51926 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51927 	 * * 0xFFFD - Reserved for user-space HWRM interface
51928 	 * * 0xFFFF - HWRM
51929 	 */
51930 	uint16_t	target_id;
51931 	/*
51932 	 * A physical address pointer pointing to a host buffer that the
51933 	 * command's response data will be written. This can be either a host
51934 	 * physical address (HPA) or a guest physical address (GPA) and must
51935 	 * point to a physically contiguous block of memory.
51936 	 */
51937 	uint64_t	resp_addr;
51938 	/*
51939 	 * Id/Handle to the recently register context memory. This handle is
51940 	 * passed to the CFA feature.
51941 	 */
51942 	uint16_t	ctx_id;
51943 	uint8_t	unused_0[6];
51944 } hwrm_cfa_ctx_mem_unrgtr_input_t, *phwrm_cfa_ctx_mem_unrgtr_input_t;
51945 
51946 /* hwrm_cfa_ctx_mem_unrgtr_output (size:128b/16B) */
51947 
51948 typedef struct hwrm_cfa_ctx_mem_unrgtr_output {
51949 	/* The specific error status for the command. */
51950 	uint16_t	error_code;
51951 	/* The HWRM command request type. */
51952 	uint16_t	req_type;
51953 	/* The sequence ID from the original command. */
51954 	uint16_t	seq_id;
51955 	/* The length of the response data in number of bytes. */
51956 	uint16_t	resp_len;
51957 	uint8_t	unused_0[7];
51958 	/*
51959 	 * This field is used in Output records to indicate that the output
51960 	 * is completely written to RAM. This field should be read as '1'
51961 	 * to indicate that the output has been completely written.
51962 	 * When writing a command completion or response to an internal
51963 	 * processor, the order of writes has to be such that this field is
51964 	 * written last.
51965 	 */
51966 	uint8_t	valid;
51967 } hwrm_cfa_ctx_mem_unrgtr_output_t, *phwrm_cfa_ctx_mem_unrgtr_output_t;
51968 
51969 /*************************
51970  * hwrm_cfa_ctx_mem_qctx *
51971  *************************/
51972 
51973 
51974 /* hwrm_cfa_ctx_mem_qctx_input (size:192b/24B) */
51975 
51976 typedef struct hwrm_cfa_ctx_mem_qctx_input {
51977 	/* The HWRM command request type. */
51978 	uint16_t	req_type;
51979 	/*
51980 	 * The completion ring to send the completion event on. This should
51981 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
51982 	 */
51983 	uint16_t	cmpl_ring;
51984 	/*
51985 	 * The sequence ID is used by the driver for tracking multiple
51986 	 * commands. This ID is treated as opaque data by the firmware and
51987 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
51988 	 */
51989 	uint16_t	seq_id;
51990 	/*
51991 	 * The target ID of the command:
51992 	 * * 0x0-0xFFF8 - The function ID
51993 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51994 	 * * 0xFFFD - Reserved for user-space HWRM interface
51995 	 * * 0xFFFF - HWRM
51996 	 */
51997 	uint16_t	target_id;
51998 	/*
51999 	 * A physical address pointer pointing to a host buffer that the
52000 	 * command's response data will be written. This can be either a host
52001 	 * physical address (HPA) or a guest physical address (GPA) and must
52002 	 * point to a physically contiguous block of memory.
52003 	 */
52004 	uint64_t	resp_addr;
52005 	/*
52006 	 * Id/Handle to the recently register context memory. This handle is
52007 	 * passed to the CFA feature.
52008 	 */
52009 	uint16_t	ctx_id;
52010 	uint8_t	unused_0[6];
52011 } hwrm_cfa_ctx_mem_qctx_input_t, *phwrm_cfa_ctx_mem_qctx_input_t;
52012 
52013 /* hwrm_cfa_ctx_mem_qctx_output (size:256b/32B) */
52014 
52015 typedef struct hwrm_cfa_ctx_mem_qctx_output {
52016 	/* The specific error status for the command. */
52017 	uint16_t	error_code;
52018 	/* The HWRM command request type. */
52019 	uint16_t	req_type;
52020 	/* The sequence ID from the original command. */
52021 	uint16_t	seq_id;
52022 	/* The length of the response data in number of bytes. */
52023 	uint16_t	resp_len;
52024 	uint16_t	flags;
52025 	/* Counter PBL indirect levels. */
52026 	uint8_t	page_level;
52027 	/* PBL pointer is physical start address. */
52028 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
52029 	/* PBL pointer points to PTE table. */
52030 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
52031 	/*
52032 	 * PBL pointer points to PDE table with each entry pointing to PTE
52033 	 * tables.
52034 	 */
52035 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
52036 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LAST HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2
52037 	/* Page size. */
52038 	uint8_t	page_size;
52039 	/* 4KB page size. */
52040 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4K   UINT32_C(0x0)
52041 	/* 8KB page size. */
52042 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_8K   UINT32_C(0x1)
52043 	/* 64KB page size. */
52044 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_64K  UINT32_C(0x4)
52045 	/* 256KB page size. */
52046 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
52047 	/* 1MB page size. */
52048 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1M   UINT32_C(0x8)
52049 	/* 2MB page size. */
52050 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_2M   UINT32_C(0x9)
52051 	/* 4MB page size. */
52052 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4M   UINT32_C(0xa)
52053 	/* 1GB page size. */
52054 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G   UINT32_C(0x12)
52055 	#define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_LAST HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G
52056 	uint8_t	unused_0[4];
52057 	/* Pointer to the PBL, or PDL depending on number of levels */
52058 	uint64_t	page_dir;
52059 	uint8_t	unused_1[7];
52060 	/*
52061 	 * This field is used in Output records to indicate that the output
52062 	 * is completely written to RAM. This field should be read as '1'
52063 	 * to indicate that the output has been completely written.
52064 	 * When writing a command completion or response to an internal
52065 	 * processor, the order of writes has to be such that this field is
52066 	 * written last.
52067 	 */
52068 	uint8_t	valid;
52069 } hwrm_cfa_ctx_mem_qctx_output_t, *phwrm_cfa_ctx_mem_qctx_output_t;
52070 
52071 /**************************
52072  * hwrm_cfa_ctx_mem_qcaps *
52073  **************************/
52074 
52075 
52076 /* hwrm_cfa_ctx_mem_qcaps_input (size:128b/16B) */
52077 
52078 typedef struct hwrm_cfa_ctx_mem_qcaps_input {
52079 	/* The HWRM command request type. */
52080 	uint16_t	req_type;
52081 	/*
52082 	 * The completion ring to send the completion event on. This should
52083 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52084 	 */
52085 	uint16_t	cmpl_ring;
52086 	/*
52087 	 * The sequence ID is used by the driver for tracking multiple
52088 	 * commands. This ID is treated as opaque data by the firmware and
52089 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52090 	 */
52091 	uint16_t	seq_id;
52092 	/*
52093 	 * The target ID of the command:
52094 	 * * 0x0-0xFFF8 - The function ID
52095 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52096 	 * * 0xFFFD - Reserved for user-space HWRM interface
52097 	 * * 0xFFFF - HWRM
52098 	 */
52099 	uint16_t	target_id;
52100 	/*
52101 	 * A physical address pointer pointing to a host buffer that the
52102 	 * command's response data will be written. This can be either a host
52103 	 * physical address (HPA) or a guest physical address (GPA) and must
52104 	 * point to a physically contiguous block of memory.
52105 	 */
52106 	uint64_t	resp_addr;
52107 } hwrm_cfa_ctx_mem_qcaps_input_t, *phwrm_cfa_ctx_mem_qcaps_input_t;
52108 
52109 /* hwrm_cfa_ctx_mem_qcaps_output (size:128b/16B) */
52110 
52111 typedef struct hwrm_cfa_ctx_mem_qcaps_output {
52112 	/* The specific error status for the command. */
52113 	uint16_t	error_code;
52114 	/* The HWRM command request type. */
52115 	uint16_t	req_type;
52116 	/* The sequence ID from the original command. */
52117 	uint16_t	seq_id;
52118 	/* The length of the response data in number of bytes. */
52119 	uint16_t	resp_len;
52120 	/*
52121 	 * Indicates the maximum number of context memory which can be
52122 	 * registered.
52123 	 */
52124 	uint16_t	max_entries;
52125 	uint8_t	unused_0[5];
52126 	/*
52127 	 * This field is used in Output records to indicate that the output
52128 	 * is completely written to RAM. This field should be read as '1'
52129 	 * to indicate that the output has been completely written.
52130 	 * When writing a command completion or response to an internal
52131 	 * processor, the order of writes has to be such that this field is
52132 	 * written last.
52133 	 */
52134 	uint8_t	valid;
52135 } hwrm_cfa_ctx_mem_qcaps_output_t, *phwrm_cfa_ctx_mem_qcaps_output_t;
52136 
52137 /**************************
52138  * hwrm_cfa_counter_qcaps *
52139  **************************/
52140 
52141 
52142 /* hwrm_cfa_counter_qcaps_input (size:128b/16B) */
52143 
52144 typedef struct hwrm_cfa_counter_qcaps_input {
52145 	/* The HWRM command request type. */
52146 	uint16_t	req_type;
52147 	/*
52148 	 * The completion ring to send the completion event on. This should
52149 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52150 	 */
52151 	uint16_t	cmpl_ring;
52152 	/*
52153 	 * The sequence ID is used by the driver for tracking multiple
52154 	 * commands. This ID is treated as opaque data by the firmware and
52155 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52156 	 */
52157 	uint16_t	seq_id;
52158 	/*
52159 	 * The target ID of the command:
52160 	 * * 0x0-0xFFF8 - The function ID
52161 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52162 	 * * 0xFFFD - Reserved for user-space HWRM interface
52163 	 * * 0xFFFF - HWRM
52164 	 */
52165 	uint16_t	target_id;
52166 	/*
52167 	 * A physical address pointer pointing to a host buffer that the
52168 	 * command's response data will be written. This can be either a host
52169 	 * physical address (HPA) or a guest physical address (GPA) and must
52170 	 * point to a physically contiguous block of memory.
52171 	 */
52172 	uint64_t	resp_addr;
52173 } hwrm_cfa_counter_qcaps_input_t, *phwrm_cfa_counter_qcaps_input_t;
52174 
52175 /* hwrm_cfa_counter_qcaps_output (size:576b/72B) */
52176 
52177 typedef struct hwrm_cfa_counter_qcaps_output {
52178 	/* The specific error status for the command. */
52179 	uint16_t	error_code;
52180 	/* The HWRM command request type. */
52181 	uint16_t	req_type;
52182 	/* The sequence ID from the original command. */
52183 	uint16_t	seq_id;
52184 	/* The length of the response data in number of bytes. */
52185 	uint16_t	resp_len;
52186 	uint32_t	flags;
52187 	/* Enumeration denoting the supported CFA counter format. */
52188 	#define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT	UINT32_C(0x1)
52189 	/* CFA counter types are not supported. */
52190 		#define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_NONE	UINT32_C(0x0)
52191 	/* 64-bit packet counters followed by 64-bit byte counters format. */
52192 		#define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_64_BIT  UINT32_C(0x1)
52193 		#define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_LAST   HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_64_BIT
52194 	uint32_t	unused_0;
52195 	/*
52196 	 * Minimum guaranteed number of flow counters supported for this
52197 	 * function, in RX direction.
52198 	 */
52199 	uint32_t	min_rx_fc;
52200 	/*
52201 	 * Maximum non-guaranteed number of flow counters supported for this
52202 	 * function, in RX direction.
52203 	 */
52204 	uint32_t	max_rx_fc;
52205 	/*
52206 	 * Minimum guaranteed number of flow counters supported for this
52207 	 * function, in TX direction.
52208 	 */
52209 	uint32_t	min_tx_fc;
52210 	/*
52211 	 * Maximum non-guaranteed number of flow counters supported for this
52212 	 * function, in TX direction.
52213 	 */
52214 	uint32_t	max_tx_fc;
52215 	/*
52216 	 * Minimum guaranteed number of extension flow counters supported for
52217 	 * this function, in RX direction.
52218 	 */
52219 	uint32_t	min_rx_efc;
52220 	/*
52221 	 * Maximum non-guaranteed number of extension flow counters supported
52222 	 * for this function, in RX direction.
52223 	 */
52224 	uint32_t	max_rx_efc;
52225 	/*
52226 	 * Minimum guaranteed number of extension flow counters supported for
52227 	 * this function, in TX direction.
52228 	 */
52229 	uint32_t	min_tx_efc;
52230 	/*
52231 	 * Maximum non-guaranteed number of extension flow counters supported
52232 	 * for this function, in TX direction.
52233 	 */
52234 	uint32_t	max_tx_efc;
52235 	/*
52236 	 * Minimum guaranteed number of meter drop counters supported for
52237 	 * this function, in RX direction.
52238 	 */
52239 	uint32_t	min_rx_mdc;
52240 	/*
52241 	 * Maximum non-guaranteed number of meter drop counters supported for
52242 	 * this function, in RX direction.
52243 	 */
52244 	uint32_t	max_rx_mdc;
52245 	/*
52246 	 * Minimum guaranteed number of meter drop counters supported for this
52247 	 * function, in TX direction.
52248 	 */
52249 	uint32_t	min_tx_mdc;
52250 	/*
52251 	 * Maximum non-guaranteed number of meter drop counters supported for
52252 	 * this function, in TX direction.
52253 	 */
52254 	uint32_t	max_tx_mdc;
52255 	/*
52256 	 * Maximum guaranteed number of flow counters which can be used during
52257 	 * flow alloc.
52258 	 */
52259 	uint32_t	max_flow_alloc_fc;
52260 	uint8_t	unused_1[3];
52261 	/*
52262 	 * This field is used in Output records to indicate that the output
52263 	 * is completely written to RAM. This field should be read as '1'
52264 	 * to indicate that the output has been completely written.
52265 	 * When writing a command completion or response to an internal
52266 	 * processor, the order of writes has to be such that this field is
52267 	 * written last.
52268 	 */
52269 	uint8_t	valid;
52270 } hwrm_cfa_counter_qcaps_output_t, *phwrm_cfa_counter_qcaps_output_t;
52271 
52272 /************************
52273  * hwrm_cfa_counter_cfg *
52274  ************************/
52275 
52276 
52277 /* hwrm_cfa_counter_cfg_input (size:256b/32B) */
52278 
52279 typedef struct hwrm_cfa_counter_cfg_input {
52280 	/* The HWRM command request type. */
52281 	uint16_t	req_type;
52282 	/*
52283 	 * The completion ring to send the completion event on. This should
52284 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52285 	 */
52286 	uint16_t	cmpl_ring;
52287 	/*
52288 	 * The sequence ID is used by the driver for tracking multiple
52289 	 * commands. This ID is treated as opaque data by the firmware and
52290 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52291 	 */
52292 	uint16_t	seq_id;
52293 	/*
52294 	 * The target ID of the command:
52295 	 * * 0x0-0xFFF8 - The function ID
52296 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52297 	 * * 0xFFFD - Reserved for user-space HWRM interface
52298 	 * * 0xFFFF - HWRM
52299 	 */
52300 	uint16_t	target_id;
52301 	/*
52302 	 * A physical address pointer pointing to a host buffer that the
52303 	 * command's response data will be written. This can be either a host
52304 	 * physical address (HPA) or a guest physical address (GPA) and must
52305 	 * point to a physically contiguous block of memory.
52306 	 */
52307 	uint64_t	resp_addr;
52308 	uint16_t	flags;
52309 	/* Enumeration denoting the configuration mode. */
52310 	#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE			UINT32_C(0x1)
52311 	/* Disable the configuration mode. */
52312 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_DISABLE		UINT32_C(0x0)
52313 	/* Enable the configuration mode. */
52314 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_ENABLE		UINT32_C(0x1)
52315 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_LAST		HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_ENABLE
52316 	/* Enumeration denoting the RX, TX type of the resource. */
52317 	#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH			UINT32_C(0x2)
52318 	/* Tx path. */
52319 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_TX			(UINT32_C(0x0) << 1)
52320 	/* Rx path. */
52321 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_RX			(UINT32_C(0x1) << 1)
52322 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_LAST			HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_RX
52323 	/* Enumeration denoting the data transfer mode. */
52324 	#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_MASK	UINT32_C(0xc)
52325 	#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_SFT	2
52326 	/* Push mode. */
52327 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PUSH	(UINT32_C(0x0) << 2)
52328 	/* Pull mode. */
52329 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL	(UINT32_C(0x1) << 2)
52330 	/* Pull on async update. */
52331 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC  (UINT32_C(0x2) << 2)
52332 		#define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_LAST	HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC
52333 	uint16_t	counter_type;
52334 	/* Flow counters. */
52335 	#define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_FC  UINT32_C(0x0)
52336 	/* Extended flow counters. */
52337 	#define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_EFC UINT32_C(0x1)
52338 	/* Meter drop counters. */
52339 	#define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_MDC UINT32_C(0x2)
52340 	#define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_LAST HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_MDC
52341 	/* Ctx memory handle to be used for the counter. */
52342 	uint16_t	ctx_id;
52343 	/* Counter update cadence hint (only in Push mode). */
52344 	uint16_t	update_tmr_ms;
52345 	/* Total number of entries. */
52346 	uint32_t	num_entries;
52347 	uint32_t	unused_0;
52348 } hwrm_cfa_counter_cfg_input_t, *phwrm_cfa_counter_cfg_input_t;
52349 
52350 /* hwrm_cfa_counter_cfg_output (size:128b/16B) */
52351 
52352 typedef struct hwrm_cfa_counter_cfg_output {
52353 	/* The specific error status for the command. */
52354 	uint16_t	error_code;
52355 	/* The HWRM command request type. */
52356 	uint16_t	req_type;
52357 	/* The sequence ID from the original command. */
52358 	uint16_t	seq_id;
52359 	/* The length of the response data in number of bytes. */
52360 	uint16_t	resp_len;
52361 	uint8_t	unused_0[7];
52362 	/*
52363 	 * This field is used in Output records to indicate that the output
52364 	 * is completely written to RAM. This field should be read as '1'
52365 	 * to indicate that the output has been completely written.
52366 	 * When writing a command completion or response to an internal
52367 	 * processor, the order of writes has to be such that this field is
52368 	 * written last.
52369 	 */
52370 	uint8_t	valid;
52371 } hwrm_cfa_counter_cfg_output_t, *phwrm_cfa_counter_cfg_output_t;
52372 
52373 /*************************
52374  * hwrm_cfa_counter_qcfg *
52375  *************************/
52376 
52377 
52378 /* hwrm_cfa_counter_qcfg_input (size:192b/24B) */
52379 
52380 typedef struct hwrm_cfa_counter_qcfg_input {
52381 	/* The HWRM command request type. */
52382 	uint16_t	req_type;
52383 	/*
52384 	 * The completion ring to send the completion event on. This should
52385 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52386 	 */
52387 	uint16_t	cmpl_ring;
52388 	/*
52389 	 * The sequence ID is used by the driver for tracking multiple
52390 	 * commands. This ID is treated as opaque data by the firmware and
52391 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52392 	 */
52393 	uint16_t	seq_id;
52394 	/*
52395 	 * The target ID of the command:
52396 	 * * 0x0-0xFFF8 - The function ID
52397 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52398 	 * * 0xFFFD - Reserved for user-space HWRM interface
52399 	 * * 0xFFFF - HWRM
52400 	 */
52401 	uint16_t	target_id;
52402 	/*
52403 	 * A physical address pointer pointing to a host buffer that the
52404 	 * command's response data will be written. This can be either a host
52405 	 * physical address (HPA) or a guest physical address (GPA) and must
52406 	 * point to a physically contiguous block of memory.
52407 	 */
52408 	uint64_t	resp_addr;
52409 	uint16_t	flags;
52410 	/* Enumeration denoting the RX, TX type of the resource. */
52411 	#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_PATH			UINT32_C(0x1)
52412 	/* Tx path. */
52413 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_PATH_TX			UINT32_C(0x0)
52414 	/* Rx path. */
52415 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_PATH_RX			UINT32_C(0x1)
52416 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_PATH_LAST			HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_PATH_RX
52417 	/* Enumeration denoting the data transfer mode. */
52418 	#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_MASK	UINT32_C(0x6)
52419 	#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_SFT	1
52420 	/* Push mode. */
52421 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PUSH	(UINT32_C(0x0) << 1)
52422 	/* Pull mode. */
52423 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL	(UINT32_C(0x1) << 1)
52424 	/* Pull on async update. */
52425 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC  (UINT32_C(0x2) << 1)
52426 		#define HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_LAST	HWRM_CFA_COUNTER_QCFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC
52427 	uint16_t	counter_type;
52428 	uint32_t	unused_0;
52429 } hwrm_cfa_counter_qcfg_input_t, *phwrm_cfa_counter_qcfg_input_t;
52430 
52431 /* hwrm_cfa_counter_qcfg_output (size:192b/24B) */
52432 
52433 typedef struct hwrm_cfa_counter_qcfg_output {
52434 	/* The specific error status for the command. */
52435 	uint16_t	error_code;
52436 	/* The HWRM command request type. */
52437 	uint16_t	req_type;
52438 	/* The sequence ID from the original command. */
52439 	uint16_t	seq_id;
52440 	/* The length of the response data in number of bytes. */
52441 	uint16_t	resp_len;
52442 	uint16_t	ctx_id;
52443 	uint16_t	update_tmr_ms;
52444 	uint32_t	num_entries;
52445 	uint8_t	unused_0[7];
52446 	/*
52447 	 * This field is used in Output records to indicate that the output
52448 	 * is completely written to RAM. This field should be read as '1'
52449 	 * to indicate that the output has been completely written.
52450 	 * When writing a command completion or response to an internal
52451 	 * processor, the order of writes has to be such that this field is
52452 	 * written last.
52453 	 */
52454 	uint8_t	valid;
52455 } hwrm_cfa_counter_qcfg_output_t, *phwrm_cfa_counter_qcfg_output_t;
52456 
52457 /***************************
52458  * hwrm_cfa_counter_qstats *
52459  ***************************/
52460 
52461 
52462 /* hwrm_cfa_counter_qstats_input (size:320b/40B) */
52463 
52464 typedef struct hwrm_cfa_counter_qstats_input {
52465 	/* The HWRM command request type. */
52466 	uint16_t	req_type;
52467 	/*
52468 	 * The completion ring to send the completion event on. This should
52469 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52470 	 */
52471 	uint16_t	cmpl_ring;
52472 	/*
52473 	 * The sequence ID is used by the driver for tracking multiple
52474 	 * commands. This ID is treated as opaque data by the firmware and
52475 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52476 	 */
52477 	uint16_t	seq_id;
52478 	/*
52479 	 * The target ID of the command:
52480 	 * * 0x0-0xFFF8 - The function ID
52481 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52482 	 * * 0xFFFD - Reserved for user-space HWRM interface
52483 	 * * 0xFFFF - HWRM
52484 	 */
52485 	uint16_t	target_id;
52486 	/*
52487 	 * A physical address pointer pointing to a host buffer that the
52488 	 * command's response data will be written. This can be either a host
52489 	 * physical address (HPA) or a guest physical address (GPA) and must
52490 	 * point to a physically contiguous block of memory.
52491 	 */
52492 	uint64_t	resp_addr;
52493 	uint16_t	flags;
52494 	/* Enumeration denoting the RX, TX type of the resource. */
52495 	#define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH	UINT32_C(0x1)
52496 	/* Tx path. */
52497 		#define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
52498 	/* Rx path. */
52499 		#define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
52500 		#define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_LAST HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_RX
52501 	uint16_t	counter_type;
52502 	uint16_t	input_flow_ctx_id;
52503 	uint16_t	num_entries;
52504 	uint16_t	delta_time_ms;
52505 	uint16_t	meter_instance_id;
52506 	uint16_t	mdc_ctx_id;
52507 	uint8_t	unused_0[2];
52508 	uint64_t	expected_count;
52509 } hwrm_cfa_counter_qstats_input_t, *phwrm_cfa_counter_qstats_input_t;
52510 
52511 /* hwrm_cfa_counter_qstats_output (size:128b/16B) */
52512 
52513 typedef struct hwrm_cfa_counter_qstats_output {
52514 	/* The specific error status for the command. */
52515 	uint16_t	error_code;
52516 	/* The HWRM command request type. */
52517 	uint16_t	req_type;
52518 	/* The sequence ID from the original command. */
52519 	uint16_t	seq_id;
52520 	/* The length of the response data in number of bytes. */
52521 	uint16_t	resp_len;
52522 	uint8_t	unused_0[7];
52523 	/*
52524 	 * This field is used in Output records to indicate that the output
52525 	 * is completely written to RAM. This field should be read as '1'
52526 	 * to indicate that the output has been completely written.
52527 	 * When writing a command completion or response to an internal
52528 	 * processor, the order of writes has to be such that this field is
52529 	 * written last.
52530 	 */
52531 	uint8_t	valid;
52532 } hwrm_cfa_counter_qstats_output_t, *phwrm_cfa_counter_qstats_output_t;
52533 
52534 /**********************
52535  * hwrm_cfa_eem_qcaps *
52536  **********************/
52537 
52538 
52539 /* hwrm_cfa_eem_qcaps_input (size:192b/24B) */
52540 
52541 typedef struct hwrm_cfa_eem_qcaps_input {
52542 	/* The HWRM command request type. */
52543 	uint16_t	req_type;
52544 	/*
52545 	 * The completion ring to send the completion event on. This should
52546 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52547 	 */
52548 	uint16_t	cmpl_ring;
52549 	/*
52550 	 * The sequence ID is used by the driver for tracking multiple
52551 	 * commands. This ID is treated as opaque data by the firmware and
52552 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52553 	 */
52554 	uint16_t	seq_id;
52555 	/*
52556 	 * The target ID of the command:
52557 	 * * 0x0-0xFFF8 - The function ID
52558 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52559 	 * * 0xFFFD - Reserved for user-space HWRM interface
52560 	 * * 0xFFFF - HWRM
52561 	 */
52562 	uint16_t	target_id;
52563 	/*
52564 	 * A physical address pointer pointing to a host buffer that the
52565 	 * command's response data will be written. This can be either a host
52566 	 * physical address (HPA) or a guest physical address (GPA) and must
52567 	 * point to a physically contiguous block of memory.
52568 	 */
52569 	uint64_t	resp_addr;
52570 	uint32_t	flags;
52571 	/*
52572 	 * When set to 1, indicates the configuration will apply to TX flows
52573 	 * which are to be offloaded.
52574 	 * Note if this bit is set then the path_rx bit can't be set.
52575 	 */
52576 	#define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_TX		UINT32_C(0x1)
52577 	/*
52578 	 * When set to 1, indicates the configuration will apply to RX flows
52579 	 * which are to be offloaded.
52580 	 * Note if this bit is set then the path_tx bit can't be set.
52581 	 */
52582 	#define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_RX		UINT32_C(0x2)
52583 	/* When set to 1, all offloaded flows will be sent to EEM. */
52584 	#define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD	UINT32_C(0x4)
52585 	uint32_t	unused_0;
52586 } hwrm_cfa_eem_qcaps_input_t, *phwrm_cfa_eem_qcaps_input_t;
52587 
52588 /* hwrm_cfa_eem_qcaps_output (size:320b/40B) */
52589 
52590 typedef struct hwrm_cfa_eem_qcaps_output {
52591 	/* The specific error status for the command. */
52592 	uint16_t	error_code;
52593 	/* The HWRM command request type. */
52594 	uint16_t	req_type;
52595 	/* The sequence ID from the original command. */
52596 	uint16_t	seq_id;
52597 	/* The length of the response data in number of bytes. */
52598 	uint16_t	resp_len;
52599 	uint32_t	flags;
52600 	/*
52601 	 * When set to 1, indicates the configuration will apply to TX flows
52602 	 * which are to be offloaded.
52603 	 * Note if this bit is set then the path_rx bit can't be set.
52604 	 */
52605 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_TX					UINT32_C(0x1)
52606 	/*
52607 	 * When set to 1, indicates the configuration will apply to RX flows
52608 	 * which are to be offloaded.
52609 	 * Note if this bit is set then the path_tx bit can't be set.
52610 	 */
52611 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_RX					UINT32_C(0x2)
52612 	/*
52613 	 * When set to 1, indicates the FW supports the Centralized
52614 	 * Memory Model. The concept designates one entity for the
52615 	 * memory allocation while all others 'subscribe' to it.
52616 	 */
52617 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED		UINT32_C(0x4)
52618 	/*
52619 	 * When set to 1, indicates the FW supports the Detached
52620 	 * Centralized Memory Model. The memory is allocated and managed
52621 	 * as a separate entity. All PFs and VFs will be granted direct
52622 	 * or semi-direct access to the allocated memory while none of
52623 	 * which can interfere with the management of the memory.
52624 	 */
52625 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED	UINT32_C(0x8)
52626 	uint32_t	unused_0;
52627 	uint32_t	supported;
52628 	/*
52629 	 * If set to 1, then EEM KEY0 table is supported using crc32 hash.
52630 	 * If set to 0, EEM KEY0 table is not supported.
52631 	 */
52632 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE			UINT32_C(0x1)
52633 	/*
52634 	 * If set to 1, then EEM KEY1 table is supported using lookup3 hash.
52635 	 * If set to 0, EEM KEY1 table is not supported.
52636 	 */
52637 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE			UINT32_C(0x2)
52638 	/*
52639 	 * If set to 1, then EEM External Record table is supported.
52640 	 * If set to 0, EEM External Record table is not supported.
52641 	 * (This table includes action record, EFC pointers, encap pointers)
52642 	 */
52643 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE		UINT32_C(0x4)
52644 	/*
52645 	 * If set to 1, then EEM External Flow Counters table is supported.
52646 	 * If set to 0, EEM External Flow Counters table is not supported.
52647 	 */
52648 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE	UINT32_C(0x8)
52649 	/*
52650 	 * If set to 1, then FID table used for implicit flow flush is
52651 	 * supported.
52652 	 * If set to 0, then FID table used for implicit flow flush is
52653 	 * not supported.
52654 	 */
52655 	#define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE			UINT32_C(0x10)
52656 	/*
52657 	 * The maximum number of entries supported by EEM. When configuring
52658 	 * the host memory, the number of numbers of entries that can
52659 	 * supported are:
52660 	 *	32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M, 128M
52661 	 *	entries.
52662 	 * Any value that are not these values, the FW will round down to the
52663 	 * closest support number of entries.
52664 	 */
52665 	uint32_t	max_entries_supported;
52666 	/* The entry size in bytes of each entry in the EEM KEY0/KEY1 tables. */
52667 	uint16_t	key_entry_size;
52668 	/* The entry size in bytes of each entry in the EEM RECORD tables. */
52669 	uint16_t	record_entry_size;
52670 	/* The entry size in bytes of each entry in the EEM EFC tables. */
52671 	uint16_t	efc_entry_size;
52672 	/* The FID size in bytes of each entry in the EEM FID tables. */
52673 	uint16_t	fid_entry_size;
52674 	uint8_t	unused_1[7];
52675 	/*
52676 	 * This field is used in Output records to indicate that the output
52677 	 * is completely written to RAM. This field should be read as '1'
52678 	 * to indicate that the output has been completely written.
52679 	 * When writing a command completion or response to an internal
52680 	 * processor, the order of writes has to be such that this field is
52681 	 * written last.
52682 	 */
52683 	uint8_t	valid;
52684 } hwrm_cfa_eem_qcaps_output_t, *phwrm_cfa_eem_qcaps_output_t;
52685 
52686 /********************
52687  * hwrm_cfa_eem_cfg *
52688  ********************/
52689 
52690 
52691 /* hwrm_cfa_eem_cfg_input (size:384b/48B) */
52692 
52693 typedef struct hwrm_cfa_eem_cfg_input {
52694 	/* The HWRM command request type. */
52695 	uint16_t	req_type;
52696 	/*
52697 	 * The completion ring to send the completion event on. This should
52698 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52699 	 */
52700 	uint16_t	cmpl_ring;
52701 	/*
52702 	 * The sequence ID is used by the driver for tracking multiple
52703 	 * commands. This ID is treated as opaque data by the firmware and
52704 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52705 	 */
52706 	uint16_t	seq_id;
52707 	/*
52708 	 * The target ID of the command:
52709 	 * * 0x0-0xFFF8 - The function ID
52710 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52711 	 * * 0xFFFD - Reserved for user-space HWRM interface
52712 	 * * 0xFFFF - HWRM
52713 	 */
52714 	uint16_t	target_id;
52715 	/*
52716 	 * A physical address pointer pointing to a host buffer that the
52717 	 * command's response data will be written. This can be either a host
52718 	 * physical address (HPA) or a guest physical address (GPA) and must
52719 	 * point to a physically contiguous block of memory.
52720 	 */
52721 	uint64_t	resp_addr;
52722 	uint32_t	flags;
52723 	/*
52724 	 * When set to 1, indicates the configuration will apply to TX flows
52725 	 * which are to be offloaded.
52726 	 * Note if this bit is set then the path_rx bit can't be set.
52727 	 */
52728 	#define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_TX		UINT32_C(0x1)
52729 	/*
52730 	 * When set to 1, indicates the configuration will apply to RX flows
52731 	 * which are to be offloaded.
52732 	 * Note if this bit is set then the path_tx bit can't be set.
52733 	 */
52734 	#define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_RX		UINT32_C(0x2)
52735 	/* When set to 1, all offloaded flows will be sent to EEM. */
52736 	#define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD	UINT32_C(0x4)
52737 	/* When set to 1, secondary, 0 means primary. */
52738 	#define HWRM_CFA_EEM_CFG_INPUT_FLAGS_SECONDARY_PF	UINT32_C(0x8)
52739 	/*
52740 	 * Group_id which used by Firmware to identify memory pools belonging
52741 	 * to certain group.
52742 	 */
52743 	uint16_t	group_id;
52744 	uint16_t	unused_0;
52745 	/*
52746 	 * Configured EEM with the given number of entries. All the EEM tables
52747 	 * KEY0, KEY1, RECORD, EFC all have the same number of entries and all
52748 	 * tables will be configured using this value. Current minimum value
52749 	 * is 32k. Current maximum value is 128M.
52750 	 */
52751 	uint32_t	num_entries;
52752 	uint32_t	unused_1;
52753 	/* Configured EEM with the given context if for KEY0 table. */
52754 	uint16_t	key0_ctx_id;
52755 	/* Configured EEM with the given context if for KEY1 table. */
52756 	uint16_t	key1_ctx_id;
52757 	/* Configured EEM with the given context if for RECORD table. */
52758 	uint16_t	record_ctx_id;
52759 	/* Configured EEM with the given context if for EFC table. */
52760 	uint16_t	efc_ctx_id;
52761 	/* Configured EEM with the given context if for EFC table. */
52762 	uint16_t	fid_ctx_id;
52763 	uint16_t	unused_2;
52764 	uint32_t	unused_3;
52765 } hwrm_cfa_eem_cfg_input_t, *phwrm_cfa_eem_cfg_input_t;
52766 
52767 /* hwrm_cfa_eem_cfg_output (size:128b/16B) */
52768 
52769 typedef struct hwrm_cfa_eem_cfg_output {
52770 	/* The specific error status for the command. */
52771 	uint16_t	error_code;
52772 	/* The HWRM command request type. */
52773 	uint16_t	req_type;
52774 	/* The sequence ID from the original command. */
52775 	uint16_t	seq_id;
52776 	/* The length of the response data in number of bytes. */
52777 	uint16_t	resp_len;
52778 	uint8_t	unused_0[7];
52779 	/*
52780 	 * This field is used in Output records to indicate that the output
52781 	 * is completely written to RAM. This field should be read as '1'
52782 	 * to indicate that the output has been completely written.
52783 	 * When writing a command completion or response to an internal
52784 	 * processor, the order of writes has to be such that this field is
52785 	 * written last.
52786 	 */
52787 	uint8_t	valid;
52788 } hwrm_cfa_eem_cfg_output_t, *phwrm_cfa_eem_cfg_output_t;
52789 
52790 /*********************
52791  * hwrm_cfa_eem_qcfg *
52792  *********************/
52793 
52794 
52795 /* hwrm_cfa_eem_qcfg_input (size:192b/24B) */
52796 
52797 typedef struct hwrm_cfa_eem_qcfg_input {
52798 	/* The HWRM command request type. */
52799 	uint16_t	req_type;
52800 	/*
52801 	 * The completion ring to send the completion event on. This should
52802 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52803 	 */
52804 	uint16_t	cmpl_ring;
52805 	/*
52806 	 * The sequence ID is used by the driver for tracking multiple
52807 	 * commands. This ID is treated as opaque data by the firmware and
52808 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52809 	 */
52810 	uint16_t	seq_id;
52811 	/*
52812 	 * The target ID of the command:
52813 	 * * 0x0-0xFFF8 - The function ID
52814 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52815 	 * * 0xFFFD - Reserved for user-space HWRM interface
52816 	 * * 0xFFFF - HWRM
52817 	 */
52818 	uint16_t	target_id;
52819 	/*
52820 	 * A physical address pointer pointing to a host buffer that the
52821 	 * command's response data will be written. This can be either a host
52822 	 * physical address (HPA) or a guest physical address (GPA) and must
52823 	 * point to a physically contiguous block of memory.
52824 	 */
52825 	uint64_t	resp_addr;
52826 	uint32_t	flags;
52827 	/* When set to 1, indicates the configuration is the TX flow. */
52828 	#define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x1)
52829 	/* When set to 1, indicates the configuration is the RX flow. */
52830 	#define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x2)
52831 	uint32_t	unused_0;
52832 } hwrm_cfa_eem_qcfg_input_t, *phwrm_cfa_eem_qcfg_input_t;
52833 
52834 /* hwrm_cfa_eem_qcfg_output (size:256b/32B) */
52835 
52836 typedef struct hwrm_cfa_eem_qcfg_output {
52837 	/* The specific error status for the command. */
52838 	uint16_t	error_code;
52839 	/* The HWRM command request type. */
52840 	uint16_t	req_type;
52841 	/* The sequence ID from the original command. */
52842 	uint16_t	seq_id;
52843 	/* The length of the response data in number of bytes. */
52844 	uint16_t	resp_len;
52845 	uint32_t	flags;
52846 	/* When set to 1, indicates the configuration is the TX flow. */
52847 	#define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_TX		UINT32_C(0x1)
52848 	/* When set to 1, indicates the configuration is the RX flow. */
52849 	#define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_RX		UINT32_C(0x2)
52850 	/* When set to 1, all offloaded flows will be sent to EEM. */
52851 	#define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD	UINT32_C(0x4)
52852 	/* The number of entries the FW has configured for EEM. */
52853 	uint32_t	num_entries;
52854 	/* Configured EEM with the given context if for KEY0 table. */
52855 	uint16_t	key0_ctx_id;
52856 	/* Configured EEM with the given context if for KEY1 table. */
52857 	uint16_t	key1_ctx_id;
52858 	/* Configured EEM with the given context if for RECORD table. */
52859 	uint16_t	record_ctx_id;
52860 	/* Configured EEM with the given context if for EFC table. */
52861 	uint16_t	efc_ctx_id;
52862 	/* Configured EEM with the given context if for EFC table. */
52863 	uint16_t	fid_ctx_id;
52864 	uint8_t	unused_2[5];
52865 	/*
52866 	 * This field is used in Output records to indicate that the output
52867 	 * is completely written to RAM. This field should be read as '1'
52868 	 * to indicate that the output has been completely written.
52869 	 * When writing a command completion or response to an internal
52870 	 * processor, the order of writes has to be such that this field is
52871 	 * written last.
52872 	 */
52873 	uint8_t	valid;
52874 } hwrm_cfa_eem_qcfg_output_t, *phwrm_cfa_eem_qcfg_output_t;
52875 
52876 /*******************
52877  * hwrm_cfa_eem_op *
52878  *******************/
52879 
52880 
52881 /* hwrm_cfa_eem_op_input (size:192b/24B) */
52882 
52883 typedef struct hwrm_cfa_eem_op_input {
52884 	/* The HWRM command request type. */
52885 	uint16_t	req_type;
52886 	/*
52887 	 * The completion ring to send the completion event on. This should
52888 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52889 	 */
52890 	uint16_t	cmpl_ring;
52891 	/*
52892 	 * The sequence ID is used by the driver for tracking multiple
52893 	 * commands. This ID is treated as opaque data by the firmware and
52894 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52895 	 */
52896 	uint16_t	seq_id;
52897 	/*
52898 	 * The target ID of the command:
52899 	 * * 0x0-0xFFF8 - The function ID
52900 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52901 	 * * 0xFFFD - Reserved for user-space HWRM interface
52902 	 * * 0xFFFF - HWRM
52903 	 */
52904 	uint16_t	target_id;
52905 	/*
52906 	 * A physical address pointer pointing to a host buffer that the
52907 	 * command's response data will be written. This can be either a host
52908 	 * physical address (HPA) or a guest physical address (GPA) and must
52909 	 * point to a physically contiguous block of memory.
52910 	 */
52911 	uint64_t	resp_addr;
52912 	uint32_t	flags;
52913 	/*
52914 	 * When set to 1, indicates the host memory which is passed will be
52915 	 * used for the TX flow offload function specified in fid.
52916 	 * Note if this bit is set then the path_rx bit can't be set.
52917 	 */
52918 	#define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_TX	UINT32_C(0x1)
52919 	/*
52920 	 * When set to 1, indicates the host memory which is passed will be
52921 	 * used for the RX flow offload function specified in fid.
52922 	 * Note if this bit is set then the path_tx bit can't be set.
52923 	 */
52924 	#define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_RX	UINT32_C(0x2)
52925 	uint16_t	unused_0;
52926 	/* The number of EEM key table entries to be configured. */
52927 	uint16_t	op;
52928 	/* This value is reserved and should not be used. */
52929 	#define HWRM_CFA_EEM_OP_INPUT_OP_RESERVED	UINT32_C(0x0)
52930 	/*
52931 	 * To properly stop EEM and ensure there are no DMA's, the caller
52932 	 * must disable EEM for the given PF, using this call. This will
52933 	 * safely disable EEM and ensure that all DMA'ed to the
52934 	 * keys/records/efc have been completed.
52935 	 */
52936 	#define HWRM_CFA_EEM_OP_INPUT_OP_EEM_DISABLE UINT32_C(0x1)
52937 	/*
52938 	 * Once the EEM host memory has been configured, EEM options have
52939 	 * been configured. Then the caller should enable EEM for the given
52940 	 * PF. Note once this call has been made, then the EEM mechanism
52941 	 * will be active and DMA's will occur as packets are processed.
52942 	 */
52943 	#define HWRM_CFA_EEM_OP_INPUT_OP_EEM_ENABLE  UINT32_C(0x2)
52944 	/*
52945 	 * Clear EEM settings for the given PF so that the register values
52946 	 * are reset back to there initial state.
52947 	 */
52948 	#define HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP UINT32_C(0x3)
52949 	#define HWRM_CFA_EEM_OP_INPUT_OP_LAST	HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP
52950 } hwrm_cfa_eem_op_input_t, *phwrm_cfa_eem_op_input_t;
52951 
52952 /* hwrm_cfa_eem_op_output (size:128b/16B) */
52953 
52954 typedef struct hwrm_cfa_eem_op_output {
52955 	/* The specific error status for the command. */
52956 	uint16_t	error_code;
52957 	/* The HWRM command request type. */
52958 	uint16_t	req_type;
52959 	/* The sequence ID from the original command. */
52960 	uint16_t	seq_id;
52961 	/* The length of the response data in number of bytes. */
52962 	uint16_t	resp_len;
52963 	uint8_t	unused_0[7];
52964 	/*
52965 	 * This field is used in Output records to indicate that the output
52966 	 * is completely written to RAM. This field should be read as '1'
52967 	 * to indicate that the output has been completely written.
52968 	 * When writing a command completion or response to an internal
52969 	 * processor, the order of writes has to be such that this field is
52970 	 * written last.
52971 	 */
52972 	uint8_t	valid;
52973 } hwrm_cfa_eem_op_output_t, *phwrm_cfa_eem_op_output_t;
52974 
52975 /********************************
52976  * hwrm_cfa_adv_flow_mgnt_qcaps *
52977  ********************************/
52978 
52979 
52980 /* hwrm_cfa_adv_flow_mgnt_qcaps_input (size:256b/32B) */
52981 
52982 typedef struct hwrm_cfa_adv_flow_mgnt_qcaps_input {
52983 	/* The HWRM command request type. */
52984 	uint16_t	req_type;
52985 	/*
52986 	 * The completion ring to send the completion event on. This should
52987 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
52988 	 */
52989 	uint16_t	cmpl_ring;
52990 	/*
52991 	 * The sequence ID is used by the driver for tracking multiple
52992 	 * commands. This ID is treated as opaque data by the firmware and
52993 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
52994 	 */
52995 	uint16_t	seq_id;
52996 	/*
52997 	 * The target ID of the command:
52998 	 * * 0x0-0xFFF8 - The function ID
52999 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53000 	 * * 0xFFFD - Reserved for user-space HWRM interface
53001 	 * * 0xFFFF - HWRM
53002 	 */
53003 	uint16_t	target_id;
53004 	/*
53005 	 * A physical address pointer pointing to a host buffer that the
53006 	 * command's response data will be written. This can be either a host
53007 	 * physical address (HPA) or a guest physical address (GPA) and must
53008 	 * point to a physically contiguous block of memory.
53009 	 */
53010 	uint64_t	resp_addr;
53011 	uint32_t	unused_0[4];
53012 } hwrm_cfa_adv_flow_mgnt_qcaps_input_t, *phwrm_cfa_adv_flow_mgnt_qcaps_input_t;
53013 
53014 /* hwrm_cfa_adv_flow_mgnt_qcaps_output (size:128b/16B) */
53015 
53016 typedef struct hwrm_cfa_adv_flow_mgnt_qcaps_output {
53017 	/* The specific error status for the command. */
53018 	uint16_t	error_code;
53019 	/* The HWRM command request type. */
53020 	uint16_t	req_type;
53021 	/* The sequence ID from the original command. */
53022 	uint16_t	seq_id;
53023 	/* The length of the response data in number of bytes. */
53024 	uint16_t	resp_len;
53025 	uint32_t	flags;
53026 	/*
53027 	 * Value of 1 to indicate firmware support 16-bit flow handle.
53028 	 * Value of 0 to indicate firmware not support 16-bit flow handle.
53029 	 */
53030 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_16BIT_SUPPORTED			UINT32_C(0x1)
53031 	/*
53032 	 * Value of 1 to indicate firmware support 64-bit flow handle.
53033 	 * Value of 0 to indicate firmware not support 64-bit flow handle.
53034 	 */
53035 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_64BIT_SUPPORTED			UINT32_C(0x2)
53036 	/*
53037 	 * Value of 1 to indicate firmware support flow batch delete
53038 	 * operation through HWRM_CFA_FLOW_FLUSH command.
53039 	 * Value of 0 to indicate that the firmware does not support flow
53040 	 * batch delete operation. (deprecated)
53041 	 */
53042 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_BATCH_DELETE_SUPPORTED		UINT32_C(0x4)
53043 	/*
53044 	 * Value of 1 to indicate that the firmware support flow reset all
53045 	 * operation through HWRM_CFA_FLOW_FLUSH command.
53046 	 * Value of 0 indicates firmware does not support flow reset all
53047 	 * operation. (deprecated)
53048 	 */
53049 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_RESET_ALL_SUPPORTED			UINT32_C(0x8)
53050 	/*
53051 	 * Value of 1 to indicate that firmware supports use of FID as
53052 	 * dest_id in HWRM_CFA_NTUPLE_ALLOC/CFG commands.
53053 	 * Value of 0 indicates firmware does not support use of FID as
53054 	 * dest_id.
53055 	 */
53056 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_DEST_FUNC_SUPPORTED		UINT32_C(0x10)
53057 	/*
53058 	 * Value of 1 to indicate that firmware supports TX EEM flows.
53059 	 * Value of 0 indicates firmware does not support TX EEM flows.
53060 	 * (deprecated)
53061 	 */
53062 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TX_EEM_FLOW_SUPPORTED			UINT32_C(0x20)
53063 	/*
53064 	 * Value of 1 to indicate that firmware supports RX EEM flows.
53065 	 * Value of 0 indicates firmware does not support RX EEM flows.
53066 	 * (deprecated)
53067 	 */
53068 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RX_EEM_FLOW_SUPPORTED			UINT32_C(0x40)
53069 	/*
53070 	 * Value of 1 to indicate that firmware supports the dynamic
53071 	 * allocation of an on-chip flow counter which can be used for EEM
53072 	 * flows. Value of 0 indicates firmware does not support the dynamic
53073 	 * allocation of an on-chip flow counter.
53074 	 * (deprecated)
53075 	 */
53076 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_COUNTER_ALLOC_SUPPORTED		UINT32_C(0x80)
53077 	/*
53078 	 * Value of 1 to indicate that firmware supports setting of
53079 	 * rfs_ring_tbl_idx in HWRM_CFA_NTUPLE_ALLOC command.
53080 	 * Value of 0 indicates firmware does not support rfs_ring_tbl_idx.
53081 	 */
53082 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_SUPPORTED		UINT32_C(0x100)
53083 	/*
53084 	 * Value of 1 to indicate that firmware supports untagged matching
53085 	 * criteria on HWRM_CFA_L2_FILTER_ALLOC command. Value of 0
53086 	 * indicates firmware does not support untagged matching.
53087 	 */
53088 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_UNTAGGED_VLAN_SUPPORTED			UINT32_C(0x200)
53089 	/*
53090 	 * Value of 1 to indicate that firmware supports XDP filter. Value
53091 	 * of 0 indicates firmware does not support XDP filter.
53092 	 */
53093 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_XDP_SUPPORTED				UINT32_C(0x400)
53094 	/*
53095 	 * Value of 1 to indicate that the firmware support L2 header source
53096 	 * fields matching criteria on HWRM_CFA_L2_FILTER_ALLOC command.
53097 	 * Value of 0 indicates firmware does not support L2 header source
53098 	 * fields matching.
53099 	 */
53100 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_HEADER_SOURCE_FIELDS_SUPPORTED		UINT32_C(0x800)
53101 	/*
53102 	 * If set to 1, firmware is capable of supporting ARP ethertype as
53103 	 * matching criteria for HWRM_CFA_NTUPLE_FILTER_ALLOC command on the
53104 	 * RX direction. By default, this flag should be 0 for older version
53105 	 * of firmware.
53106 	 */
53107 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_ARP_SUPPORTED		UINT32_C(0x1000)
53108 	/*
53109 	 * Value of 1 to indicate that firmware supports setting of
53110 	 * rfs_ring_tbl_idx in dst_id field of the HWRM_CFA_NTUPLE_ALLOC
53111 	 * command. Value of 0 indicates firmware does not support
53112 	 * rfs_ring_tbl_idx in dst_id field.
53113 	 */
53114 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_V2_SUPPORTED		UINT32_C(0x2000)
53115 	/*
53116 	 * If set to 1, firmware is capable of supporting IPv4/IPv6 as
53117 	 * ethertype in HWRM_CFA_NTUPLE_FILTER_ALLOC command on the RX
53118 	 * direction. By default, this flag should be 0 for older version
53119 	 * of firmware.
53120 	 */
53121 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_ETHERTYPE_IP_SUPPORTED	UINT32_C(0x4000)
53122 	/*
53123 	 * When this bit is '1', it indicates that core firmware is
53124 	 * capable of TruFlow. Driver can restrict sending HWRM CFA_FLOW_XXX
53125 	 * and CFA_ENCAP_XXX, CFA_DECAP_XXX commands.
53126 	 */
53127 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TRUFLOW_CAPABLE				UINT32_C(0x8000)
53128 	/*
53129 	 * If set to 1, firmware is capable of supporting L2/ROCE as
53130 	 * traffic type in flags field of HWRM_CFA_L2_FILTER_ALLOC command.
53131 	 * By default, this flag should be 0 for older version of firmware.
53132 	 */
53133 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_FILTER_TRAFFIC_TYPE_L2_ROCE_SUPPORTED	UINT32_C(0x10000)
53134 	/*
53135 	 * If set to 1, firmware is capable of HW LAG. This bit is only
53136 	 * advertised if the calling function is a PAXC function.
53137 	 */
53138 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_LAG_SUPPORTED				UINT32_C(0x20000)
53139 	/*
53140 	 * If set to 1, firmware is capable installing ntuple rules without
53141 	 * additional classification on the L2 Context.
53142 	 */
53143 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_NO_L2CTX_SUPPORTED		UINT32_C(0x40000)
53144 	/*
53145 	 * If set to 1, firmware is capable returning stats for nic flows
53146 	 * in cfa_flow_stats command where flow_handle value 0xF000.
53147 	 */
53148 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NIC_FLOW_STATS_SUPPORTED			UINT32_C(0x80000)
53149 	/*
53150 	 * If set to 1, firmware is capable of supporting these additional
53151 	 * ip_protocols: ICMP, ICMPV6, RSVD for ntuple rules. By default,
53152 	 * this flag should be 0 for older version of firmware.
53153 	 */
53154 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_EXT_IP_PROTO_SUPPORTED	UINT32_C(0x100000)
53155 	/*
53156 	 * Value of 1 to indicate that firmware supports setting of
53157 	 * rfs_ring_tbl_idx (new offset) in HWRM_CFA_NTUPLE_ALLOC command.
53158 	 * Value of 0 indicates ring tbl idx should be passed using dst_id.
53159 	 */
53160 	#define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_V3_SUPPORTED		UINT32_C(0x200000)
53161 	uint8_t	unused_0[3];
53162 	/*
53163 	 * This field is used in Output records to indicate that the output
53164 	 * is completely written to RAM. This field should be read as '1'
53165 	 * to indicate that the output has been completely written.
53166 	 * When writing a command completion or response to an internal
53167 	 * processor, the order of writes has to be such that this field is
53168 	 * written last.
53169 	 */
53170 	uint8_t	valid;
53171 } hwrm_cfa_adv_flow_mgnt_qcaps_output_t, *phwrm_cfa_adv_flow_mgnt_qcaps_output_t;
53172 
53173 /******************
53174  * hwrm_cfa_tflib *
53175  ******************/
53176 
53177 
53178 /* hwrm_cfa_tflib_input (size:1024b/128B) */
53179 
53180 typedef struct hwrm_cfa_tflib_input {
53181 	/* The HWRM command request type. */
53182 	uint16_t	req_type;
53183 	/*
53184 	 * The completion ring to send the completion event on. This should
53185 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53186 	 */
53187 	uint16_t	cmpl_ring;
53188 	/*
53189 	 * The sequence ID is used by the driver for tracking multiple
53190 	 * commands. This ID is treated as opaque data by the firmware and
53191 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53192 	 */
53193 	uint16_t	seq_id;
53194 	/*
53195 	 * The target ID of the command:
53196 	 * * 0x0-0xFFF8 - The function ID
53197 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53198 	 * * 0xFFFD - Reserved for user-space HWRM interface
53199 	 * * 0xFFFF - HWRM
53200 	 */
53201 	uint16_t	target_id;
53202 	/*
53203 	 * A physical address pointer pointing to a host buffer that the
53204 	 * command's response data will be written. This can be either a host
53205 	 * physical address (HPA) or a guest physical address (GPA) and must
53206 	 * point to a physically contiguous block of memory.
53207 	 */
53208 	uint64_t	resp_addr;
53209 	/* TFLIB message type. */
53210 	uint16_t	tf_type;
53211 	/* TFLIB message subtype. */
53212 	uint16_t	tf_subtype;
53213 	/* unused. */
53214 	uint8_t	unused0[4];
53215 	/* TFLIB request data. */
53216 	uint32_t	tf_req[26];
53217 } hwrm_cfa_tflib_input_t, *phwrm_cfa_tflib_input_t;
53218 
53219 /* hwrm_cfa_tflib_output (size:5632b/704B) */
53220 
53221 typedef struct hwrm_cfa_tflib_output {
53222 	/* The specific error status for the command. */
53223 	uint16_t	error_code;
53224 	/* The HWRM command request type. */
53225 	uint16_t	req_type;
53226 	/* The sequence ID from the original command. */
53227 	uint16_t	seq_id;
53228 	/* The length of the response data in number of bytes. */
53229 	uint16_t	resp_len;
53230 	/* TFLIB message type. */
53231 	uint16_t	tf_type;
53232 	/* TFLIB message subtype. */
53233 	uint16_t	tf_subtype;
53234 	/* TFLIB response code */
53235 	uint32_t	tf_resp_code;
53236 	/* TFLIB response data. */
53237 	uint32_t	tf_resp[170];
53238 	/* unused. */
53239 	uint8_t	unused1[7];
53240 	/*
53241 	 * This field is used in Output records to indicate that the output
53242 	 * is completely written to RAM. This field should be read as '1'
53243 	 * to indicate that the output has been completely written.
53244 	 * When writing a command completion or response to an internal
53245 	 * processor, the order of writes has to be such that this field is
53246 	 * written last.
53247 	 */
53248 	uint8_t	valid;
53249 } hwrm_cfa_tflib_output_t, *phwrm_cfa_tflib_output_t;
53250 
53251 /**********************************
53252  * hwrm_cfa_lag_group_member_rgtr *
53253  **********************************/
53254 
53255 
53256 /* hwrm_cfa_lag_group_member_rgtr_input (size:192b/24B) */
53257 
53258 typedef struct hwrm_cfa_lag_group_member_rgtr_input {
53259 	/* The HWRM command request type. */
53260 	uint16_t	req_type;
53261 	/*
53262 	 * The completion ring to send the completion event on. This should
53263 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53264 	 */
53265 	uint16_t	cmpl_ring;
53266 	/*
53267 	 * The sequence ID is used by the driver for tracking multiple
53268 	 * commands. This ID is treated as opaque data by the firmware and
53269 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53270 	 */
53271 	uint16_t	seq_id;
53272 	/*
53273 	 * The target ID of the command:
53274 	 * * 0x0-0xFFF8 - The function ID
53275 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53276 	 * * 0xFFFD - Reserved for user-space HWRM interface
53277 	 * * 0xFFFF - HWRM
53278 	 */
53279 	uint16_t	target_id;
53280 	/*
53281 	 * A physical address pointer pointing to a host buffer that the
53282 	 * command's response data will be written. This can be either a host
53283 	 * physical address (HPA) or a guest physical address (GPA) and must
53284 	 * point to a physically contiguous block of memory.
53285 	 */
53286 	uint64_t	resp_addr;
53287 	uint8_t	mode;
53288 	/*
53289 	 * Transmit only on the active port. Automatically failover
53290 	 * to backup port.
53291 	 */
53292 	#define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_ACTIVE_BACKUP UINT32_C(0x1)
53293 	/*
53294 	 * Transmit based on packet header ntuple hash. Packet with only
53295 	 * layer 2 headers will hash using the destination MAC, source MAC
53296 	 * and Ethertype fields. Packets with layer 3 (IP) headers will
53297 	 * hash using the destination MAC, source MAC, IP protocol/next
53298 	 * header, source IP address and destination IP address. Packets
53299 	 * with layer 4 (TCP/UDP) headers will hash using the destination
53300 	 * MAC, source MAC, IP protocol/next header, source IP address,
53301 	 * destination IP address, source port and destination port fields.
53302 	 */
53303 	#define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_BALANCE_XOR   UINT32_C(0x2)
53304 	/* Transmit packets on all specified ports. */
53305 	#define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_BROADCAST	UINT32_C(0x3)
53306 	#define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_LAST	HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_BROADCAST
53307 	/*
53308 	 * Supports up to 5 ports. bit0 = port 0, bit1 = port 1,
53309 	 * bit2 = port 2, bit3 = port 4, bit4 = loopback port
53310 	 */
53311 	uint8_t	port_bitmap;
53312 	/* Specify the active port when active-backup mode is specified */
53313 	uint8_t	active_port;
53314 	uint8_t	unused_0[5];
53315 } hwrm_cfa_lag_group_member_rgtr_input_t, *phwrm_cfa_lag_group_member_rgtr_input_t;
53316 
53317 /* hwrm_cfa_lag_group_member_rgtr_output (size:128b/16B) */
53318 
53319 typedef struct hwrm_cfa_lag_group_member_rgtr_output {
53320 	/* The specific error status for the command. */
53321 	uint16_t	error_code;
53322 	/* The HWRM command request type. */
53323 	uint16_t	req_type;
53324 	/* The sequence ID from the original command. */
53325 	uint16_t	seq_id;
53326 	/* The length of the response data in number of bytes. */
53327 	uint16_t	resp_len;
53328 	/* lag group ID configured for the function */
53329 	uint16_t	lag_id;
53330 	uint8_t	unused_0[5];
53331 	/*
53332 	 * This field is used in Output records to indicate that the output
53333 	 * is completely written to RAM. This field should be read as '1'
53334 	 * to indicate that the output has been completely written.
53335 	 * When writing a command completion or response to an internal
53336 	 * processor, the order of writes has to be such that this field is
53337 	 * written last.
53338 	 */
53339 	uint8_t	valid;
53340 } hwrm_cfa_lag_group_member_rgtr_output_t, *phwrm_cfa_lag_group_member_rgtr_output_t;
53341 
53342 /************************************
53343  * hwrm_cfa_lag_group_member_unrgtr *
53344  ************************************/
53345 
53346 
53347 /* hwrm_cfa_lag_group_member_unrgtr_input (size:192b/24B) */
53348 
53349 typedef struct hwrm_cfa_lag_group_member_unrgtr_input {
53350 	/* The HWRM command request type. */
53351 	uint16_t	req_type;
53352 	/*
53353 	 * The completion ring to send the completion event on. This should
53354 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53355 	 */
53356 	uint16_t	cmpl_ring;
53357 	/*
53358 	 * The sequence ID is used by the driver for tracking multiple
53359 	 * commands. This ID is treated as opaque data by the firmware and
53360 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53361 	 */
53362 	uint16_t	seq_id;
53363 	/*
53364 	 * The target ID of the command:
53365 	 * * 0x0-0xFFF8 - The function ID
53366 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53367 	 * * 0xFFFD - Reserved for user-space HWRM interface
53368 	 * * 0xFFFF - HWRM
53369 	 */
53370 	uint16_t	target_id;
53371 	/*
53372 	 * A physical address pointer pointing to a host buffer that the
53373 	 * command's response data will be written. This can be either a host
53374 	 * physical address (HPA) or a guest physical address (GPA) and must
53375 	 * point to a physically contiguous block of memory.
53376 	 */
53377 	uint64_t	resp_addr;
53378 	/* lag group ID configured for the function */
53379 	uint16_t	lag_id;
53380 	uint8_t	unused_0[6];
53381 } hwrm_cfa_lag_group_member_unrgtr_input_t, *phwrm_cfa_lag_group_member_unrgtr_input_t;
53382 
53383 /* hwrm_cfa_lag_group_member_unrgtr_output (size:128b/16B) */
53384 
53385 typedef struct hwrm_cfa_lag_group_member_unrgtr_output {
53386 	/* The specific error status for the command. */
53387 	uint16_t	error_code;
53388 	/* The HWRM command request type. */
53389 	uint16_t	req_type;
53390 	/* The sequence ID from the original command. */
53391 	uint16_t	seq_id;
53392 	/* The length of the response data in number of bytes. */
53393 	uint16_t	resp_len;
53394 	uint8_t	unused_0[7];
53395 	/*
53396 	 * This field is used in Output records to indicate that the output
53397 	 * is completely written to RAM. This field should be read as '1'
53398 	 * to indicate that the output has been completely written.
53399 	 * When writing a command completion or response to an internal
53400 	 * processor, the order of writes has to be such that this field is
53401 	 * written last.
53402 	 */
53403 	uint8_t	valid;
53404 } hwrm_cfa_lag_group_member_unrgtr_output_t, *phwrm_cfa_lag_group_member_unrgtr_output_t;
53405 
53406 /*****************************
53407  * hwrm_cfa_tls_filter_alloc *
53408  *****************************/
53409 
53410 
53411 /* hwrm_cfa_tls_filter_alloc_input (size:768b/96B) */
53412 
53413 typedef struct hwrm_cfa_tls_filter_alloc_input {
53414 	/* The HWRM command request type. */
53415 	uint16_t	req_type;
53416 	/*
53417 	 * The completion ring to send the completion event on. This should
53418 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53419 	 */
53420 	uint16_t	cmpl_ring;
53421 	/*
53422 	 * The sequence ID is used by the driver for tracking multiple
53423 	 * commands. This ID is treated as opaque data by the firmware and
53424 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53425 	 */
53426 	uint16_t	seq_id;
53427 	/*
53428 	 * The target ID of the command:
53429 	 * * 0x0-0xFFF8 - The function ID
53430 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53431 	 * * 0xFFFD - Reserved for user-space HWRM interface
53432 	 * * 0xFFFF - HWRM
53433 	 */
53434 	uint16_t	target_id;
53435 	/*
53436 	 * A physical address pointer pointing to a host buffer that the
53437 	 * command's response data will be written. This can be either a host
53438 	 * physical address (HPA) or a guest physical address (GPA) and must
53439 	 * point to a physically contiguous block of memory.
53440 	 */
53441 	uint64_t	resp_addr;
53442 	uint32_t	unused_0;
53443 	uint32_t	enables;
53444 	/*
53445 	 * This bit must be '1' for the l2_filter_id field to be
53446 	 * configured.
53447 	 */
53448 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID		UINT32_C(0x1)
53449 	/*
53450 	 * This bit must be '1' for the ethertype field to be
53451 	 * configured.
53452 	 */
53453 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE		UINT32_C(0x2)
53454 	/*
53455 	 * This bit must be '1' for the ipaddr_type field to be
53456 	 * configured.
53457 	 */
53458 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE		UINT32_C(0x4)
53459 	/*
53460 	 * This bit must be '1' for the src_ipaddr field to be
53461 	 * configured.
53462 	 */
53463 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR		UINT32_C(0x8)
53464 	/*
53465 	 * This bit must be '1' for the dst_ipaddr field to be
53466 	 * configured.
53467 	 */
53468 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR		UINT32_C(0x10)
53469 	/*
53470 	 * This bit must be '1' for the ip_protocol field to be
53471 	 * configured.
53472 	 */
53473 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL		UINT32_C(0x20)
53474 	/*
53475 	 * This bit must be '1' for the src_port field to be
53476 	 * configured.
53477 	 */
53478 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT		UINT32_C(0x40)
53479 	/*
53480 	 * This bit must be '1' for the dst_port field to be
53481 	 * configured.
53482 	 */
53483 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_DST_PORT		UINT32_C(0x80)
53484 	/*
53485 	 * This bit must be '1' for the kid field to be
53486 	 * configured.
53487 	 */
53488 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_KID			UINT32_C(0x100)
53489 	/*
53490 	 * This bit must be '1' for the dst_id field to be
53491 	 * configured.
53492 	 */
53493 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_DST_ID		UINT32_C(0x200)
53494 	/*
53495 	 * This bit must be '1' for the mirror_vnic_id field to be
53496 	 * configured.
53497 	 */
53498 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID	UINT32_C(0x400)
53499 	/*
53500 	 * This bit must be '1' for the quic_dst_connect_id field to be
53501 	 * configured.
53502 	 */
53503 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_QUIC_DST_CONNECT_ID	UINT32_C(0x800)
53504 	/*
53505 	 * This value identifies a set of CFA data structures used for an L2
53506 	 * context.
53507 	 */
53508 	uint64_t	l2_filter_id;
53509 	uint8_t	unused_1[6];
53510 	/* This value indicates the ethertype in the Ethernet header. */
53511 	uint16_t	ethertype;
53512 	/*
53513 	 * This value indicates the type of IP address.
53514 	 * 4 - IPv4
53515 	 * 6 - IPv6
53516 	 * All others are invalid.
53517 	 */
53518 	uint8_t	ip_addr_type;
53519 	/* invalid */
53520 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
53521 	/* IPv4 */
53522 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4	UINT32_C(0x4)
53523 	/* IPv6 */
53524 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6	UINT32_C(0x6)
53525 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST   HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
53526 	/*
53527 	 * The value of protocol field in IP header.
53528 	 * Applies to UDP and TCP traffic.
53529 	 * 6 - TCP
53530 	 * 17 - UDP
53531 	 */
53532 	uint8_t	ip_protocol;
53533 	/* invalid */
53534 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
53535 	/* TCP */
53536 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP	UINT32_C(0x6)
53537 	/* UDP */
53538 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP	UINT32_C(0x11)
53539 	#define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST   HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
53540 	/*
53541 	 * If set, this value shall represent the
53542 	 * Logical VNIC ID of the destination VNIC for the RX
53543 	 * path and network port id of the destination port for
53544 	 * the TX path.
53545 	 */
53546 	uint16_t	dst_id;
53547 	/*
53548 	 * Logical VNIC ID of the VNIC where traffic is
53549 	 * mirrored.
53550 	 */
53551 	uint16_t	mirror_vnic_id;
53552 	uint8_t	unused_2[2];
53553 	/*
53554 	 * The value of source IP address to be used in filtering.
53555 	 * For IPv4, first four bytes represent the IP address.
53556 	 */
53557 	uint32_t	src_ipaddr[4];
53558 	/*
53559 	 * The value of destination IP address to be used in filtering.
53560 	 * For IPv4, first four bytes represent the IP address.
53561 	 */
53562 	uint32_t	dst_ipaddr[4];
53563 	/*
53564 	 * The value of source port to be used in filtering.
53565 	 * Applies to UDP and TCP traffic.
53566 	 */
53567 	uint16_t	src_port;
53568 	/*
53569 	 * The value of destination port to be used in filtering.
53570 	 * Applies to UDP and TCP traffic.
53571 	 */
53572 	uint16_t	dst_port;
53573 	/*
53574 	 * The Key Context Identifier (KID) for use with KTLS or QUIC.
53575 	 * KID is limited to 20-bits.
53576 	 */
53577 	uint32_t	kid;
53578 	/* The Destination Connection ID of QUIC. */
53579 	uint64_t	quic_dst_connect_id;
53580 } hwrm_cfa_tls_filter_alloc_input_t, *phwrm_cfa_tls_filter_alloc_input_t;
53581 
53582 /* hwrm_cfa_tls_filter_alloc_output (size:192b/24B) */
53583 
53584 typedef struct hwrm_cfa_tls_filter_alloc_output {
53585 	/* The specific error status for the command. */
53586 	uint16_t	error_code;
53587 	/* The HWRM command request type. */
53588 	uint16_t	req_type;
53589 	/* The sequence ID from the original command. */
53590 	uint16_t	seq_id;
53591 	/* The length of the response data in number of bytes. */
53592 	uint16_t	resp_len;
53593 	/* This value is an opaque id into CFA data structures. */
53594 	uint64_t	tls_filter_id;
53595 	/*
53596 	 * The flow id value in bit 0-29 is the actual ID of the flow
53597 	 * associated with this filter and it shall be used to match
53598 	 * and associate the flow identifier returned in completion
53599 	 * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
53600 	 * shall indicate no valid flow id.
53601 	 */
53602 	uint32_t	flow_id;
53603 	/* Indicate the flow id value. */
53604 	#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK UINT32_C(0x3fffffff)
53605 	#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
53606 	/* Indicate type of the flow. */
53607 	#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE	UINT32_C(0x40000000)
53608 	/*
53609 	 * If this bit set to 0, then it indicates that the flow is
53610 	 * internal flow.
53611 	 */
53612 		#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT	(UINT32_C(0x0) << 30)
53613 	/*
53614 	 * If this bit is set to 1, then it indicates that the flow is
53615 	 * external flow.
53616 	 */
53617 		#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT	(UINT32_C(0x1) << 30)
53618 		#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST  HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
53619 	/* Indicate the flow direction. */
53620 	#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR	UINT32_C(0x80000000)
53621 	/* If this bit set to 0, then it indicates rx flow. */
53622 		#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX	(UINT32_C(0x0) << 31)
53623 	/* If this bit is set to 1, then it indicates that tx flow. */
53624 		#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX	(UINT32_C(0x1) << 31)
53625 		#define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST   HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
53626 	uint8_t	unused_0[3];
53627 	/*
53628 	 * This field is used in Output records to indicate that the output
53629 	 * is completely written to RAM. This field should be read as '1'
53630 	 * to indicate that the output has been completely written.
53631 	 * When writing a command completion or response to an internal
53632 	 * processor, the order of writes has to be such that this field is
53633 	 * written last.
53634 	 */
53635 	uint8_t	valid;
53636 } hwrm_cfa_tls_filter_alloc_output_t, *phwrm_cfa_tls_filter_alloc_output_t;
53637 
53638 /****************************
53639  * hwrm_cfa_tls_filter_free *
53640  ****************************/
53641 
53642 
53643 /* hwrm_cfa_tls_filter_free_input (size:192b/24B) */
53644 
53645 typedef struct hwrm_cfa_tls_filter_free_input {
53646 	/* The HWRM command request type. */
53647 	uint16_t	req_type;
53648 	/*
53649 	 * The completion ring to send the completion event on. This should
53650 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53651 	 */
53652 	uint16_t	cmpl_ring;
53653 	/*
53654 	 * The sequence ID is used by the driver for tracking multiple
53655 	 * commands. This ID is treated as opaque data by the firmware and
53656 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53657 	 */
53658 	uint16_t	seq_id;
53659 	/*
53660 	 * The target ID of the command:
53661 	 * * 0x0-0xFFF8 - The function ID
53662 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53663 	 * * 0xFFFD - Reserved for user-space HWRM interface
53664 	 * * 0xFFFF - HWRM
53665 	 */
53666 	uint16_t	target_id;
53667 	/*
53668 	 * A physical address pointer pointing to a host buffer that the
53669 	 * command's response data will be written. This can be either a host
53670 	 * physical address (HPA) or a guest physical address (GPA) and must
53671 	 * point to a physically contiguous block of memory.
53672 	 */
53673 	uint64_t	resp_addr;
53674 	/* This value is an opaque id into CFA data structures. */
53675 	uint64_t	tls_filter_id;
53676 } hwrm_cfa_tls_filter_free_input_t, *phwrm_cfa_tls_filter_free_input_t;
53677 
53678 /* hwrm_cfa_tls_filter_free_output (size:128b/16B) */
53679 
53680 typedef struct hwrm_cfa_tls_filter_free_output {
53681 	/* The specific error status for the command. */
53682 	uint16_t	error_code;
53683 	/* The HWRM command request type. */
53684 	uint16_t	req_type;
53685 	/* The sequence ID from the original command. */
53686 	uint16_t	seq_id;
53687 	/* The length of the response data in number of bytes. */
53688 	uint16_t	resp_len;
53689 	uint8_t	unused_0[7];
53690 	/*
53691 	 * This field is used in Output records to indicate that the output
53692 	 * is completely written to RAM. This field should be read as '1'
53693 	 * to indicate that the output has been completely written.
53694 	 * When writing a command completion or response to an internal
53695 	 * processor, the order of writes has to be such that this field is
53696 	 * written last.
53697 	 */
53698 	uint8_t	valid;
53699 } hwrm_cfa_tls_filter_free_output_t, *phwrm_cfa_tls_filter_free_output_t;
53700 
53701 /*****************************
53702  * hwrm_cfa_release_afm_func *
53703  *****************************/
53704 
53705 
53706 /* hwrm_cfa_release_afm_func_input (size:256b/32B) */
53707 
53708 typedef struct hwrm_cfa_release_afm_func_input {
53709 	/* The HWRM command request type. */
53710 	uint16_t	req_type;
53711 	/*
53712 	 * The completion ring to send the completion event on. This should
53713 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53714 	 */
53715 	uint16_t	cmpl_ring;
53716 	/*
53717 	 * The sequence ID is used by the driver for tracking multiple
53718 	 * commands. This ID is treated as opaque data by the firmware and
53719 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53720 	 */
53721 	uint16_t	seq_id;
53722 	/*
53723 	 * The target ID of the command:
53724 	 * * 0x0-0xFFF8 - The function ID
53725 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53726 	 * * 0xFFFD - Reserved for user-space HWRM interface
53727 	 * * 0xFFFF - HWRM
53728 	 */
53729 	uint16_t	target_id;
53730 	/*
53731 	 * A physical address pointer pointing to a host buffer that the
53732 	 * command's response data will be written. This can be either a host
53733 	 * physical address (HPA) or a guest physical address (GPA) and must
53734 	 * point to a physically contiguous block of memory.
53735 	 */
53736 	uint64_t	resp_addr;
53737 	/* Function identifier, may be of type efid, rfid or dfid. */
53738 	uint16_t	fid;
53739 	/* Representor function identifier. */
53740 	uint16_t	rfid;
53741 	/* Fid type. */
53742 	uint8_t	type;
53743 	/* Endpoint fid. */
53744 	#define HWRM_CFA_RELEASE_AFM_FUNC_INPUT_TYPE_EFID UINT32_C(0x1)
53745 	/* Representor fid. */
53746 	#define HWRM_CFA_RELEASE_AFM_FUNC_INPUT_TYPE_RFID UINT32_C(0x2)
53747 	/* Redirect fid. */
53748 	#define HWRM_CFA_RELEASE_AFM_FUNC_INPUT_TYPE_DFID UINT32_C(0x3)
53749 	#define HWRM_CFA_RELEASE_AFM_FUNC_INPUT_TYPE_LAST HWRM_CFA_RELEASE_AFM_FUNC_INPUT_TYPE_DFID
53750 	uint8_t	unused_0[3];
53751 	/*
53752 	 * Flags used to control AFMs actions when releasing the function.
53753 	 * Only used when type is dfid.
53754 	 */
53755 	uint32_t	flags;
53756 	/* Remove broadcast. */
53757 	#define HWRM_CFA_RELEASE_AFM_FUNC_INPUT_FLAGS_BC_REM	UINT32_C(0x1)
53758 	/* Remove multicast. */
53759 	#define HWRM_CFA_RELEASE_AFM_FUNC_INPUT_FLAGS_MC_REM	UINT32_C(0x2)
53760 	/* Remove promiscuous. */
53761 	#define HWRM_CFA_RELEASE_AFM_FUNC_INPUT_FLAGS_PROMISC_REM	UINT32_C(0x4)
53762 	uint32_t	unused_1;
53763 } hwrm_cfa_release_afm_func_input_t, *phwrm_cfa_release_afm_func_input_t;
53764 
53765 /* hwrm_cfa_release_afm_func_output (size:128b/16B) */
53766 
53767 typedef struct hwrm_cfa_release_afm_func_output {
53768 	/* The specific error status for the command. */
53769 	uint16_t	error_code;
53770 	/* The HWRM command request type. */
53771 	uint16_t	req_type;
53772 	/* The sequence ID from the original command. */
53773 	uint16_t	seq_id;
53774 	/* The length of the response data in number of bytes. */
53775 	uint16_t	resp_len;
53776 	uint8_t	unused_0[7];
53777 	/*
53778 	 * This field is used in Output records to indicate that the output
53779 	 * is completely written to RAM. This field should be read as '1'
53780 	 * to indicate that the output has been completely written.
53781 	 * When writing a command completion or response to an internal
53782 	 * processor, the order of writes has to be such that this field is
53783 	 * written last.
53784 	 */
53785 	uint8_t	valid;
53786 } hwrm_cfa_release_afm_func_output_t, *phwrm_cfa_release_afm_func_output_t;
53787 
53788 /***********
53789  * hwrm_tf *
53790  ***********/
53791 
53792 
53793 /* hwrm_tf_input (size:1024b/128B) */
53794 
53795 typedef struct hwrm_tf_input {
53796 	/* The HWRM command request type. */
53797 	uint16_t	req_type;
53798 	/*
53799 	 * The completion ring to send the completion event on. This should
53800 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53801 	 */
53802 	uint16_t	cmpl_ring;
53803 	/*
53804 	 * The sequence ID is used by the driver for tracking multiple
53805 	 * commands. This ID is treated as opaque data by the firmware and
53806 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53807 	 */
53808 	uint16_t	seq_id;
53809 	/*
53810 	 * The target ID of the command:
53811 	 * * 0x0-0xFFF8 - The function ID
53812 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53813 	 * * 0xFFFD - Reserved for user-space HWRM interface
53814 	 * * 0xFFFF - HWRM
53815 	 */
53816 	uint16_t	target_id;
53817 	/*
53818 	 * A physical address pointer pointing to a host buffer that the
53819 	 * command's response data will be written. This can be either a host
53820 	 * physical address (HPA) or a guest physical address (GPA) and must
53821 	 * point to a physically contiguous block of memory.
53822 	 */
53823 	uint64_t	resp_addr;
53824 	/* TF message type. */
53825 	uint16_t	type;
53826 	/* TF message subtype. */
53827 	uint16_t	subtype;
53828 	/* unused. */
53829 	uint8_t	unused0[4];
53830 	/* TF request data. */
53831 	uint32_t	req[26];
53832 } hwrm_tf_input_t, *phwrm_tf_input_t;
53833 
53834 /* hwrm_tf_output (size:5632b/704B) */
53835 
53836 typedef struct hwrm_tf_output {
53837 	/* The specific error status for the command. */
53838 	uint16_t	error_code;
53839 	/* The HWRM command request type. */
53840 	uint16_t	req_type;
53841 	/* The sequence ID from the original command. */
53842 	uint16_t	seq_id;
53843 	/* The length of the response data in number of bytes. */
53844 	uint16_t	resp_len;
53845 	/* TF message type. */
53846 	uint16_t	type;
53847 	/* TF message subtype. */
53848 	uint16_t	subtype;
53849 	/* TF response code */
53850 	uint32_t	resp_code;
53851 	/* TF response data. */
53852 	uint32_t	resp[170];
53853 	/* unused. */
53854 	uint8_t	unused1[7];
53855 	/*
53856 	 * This field is used in Output records to indicate that the
53857 	 * output is completely written to RAM. This field should be
53858 	 * read as '1' to indicate that the output has been
53859 	 * completely written. When writing a command completion or
53860 	 * response to an internal processor, the order of writes has
53861 	 * to be such that this field is written last.
53862 	 */
53863 	uint8_t	valid;
53864 } hwrm_tf_output_t, *phwrm_tf_output_t;
53865 
53866 /***********************
53867  * hwrm_tf_version_get *
53868  ***********************/
53869 
53870 
53871 /* hwrm_tf_version_get_input (size:128b/16B) */
53872 
53873 typedef struct hwrm_tf_version_get_input {
53874 	/* The HWRM command request type. */
53875 	uint16_t	req_type;
53876 	/*
53877 	 * The completion ring to send the completion event on. This should
53878 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53879 	 */
53880 	uint16_t	cmpl_ring;
53881 	/*
53882 	 * The sequence ID is used by the driver for tracking multiple
53883 	 * commands. This ID is treated as opaque data by the firmware and
53884 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53885 	 */
53886 	uint16_t	seq_id;
53887 	/*
53888 	 * The target ID of the command:
53889 	 * * 0x0-0xFFF8 - The function ID
53890 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53891 	 * * 0xFFFD - Reserved for user-space HWRM interface
53892 	 * * 0xFFFF - HWRM
53893 	 */
53894 	uint16_t	target_id;
53895 	/*
53896 	 * A physical address pointer pointing to a host buffer that the
53897 	 * command's response data will be written. This can be either a host
53898 	 * physical address (HPA) or a guest physical address (GPA) and must
53899 	 * point to a physically contiguous block of memory.
53900 	 */
53901 	uint64_t	resp_addr;
53902 } hwrm_tf_version_get_input_t, *phwrm_tf_version_get_input_t;
53903 
53904 /* hwrm_tf_version_get_output (size:256b/32B) */
53905 
53906 typedef struct hwrm_tf_version_get_output {
53907 	/* The specific error status for the command. */
53908 	uint16_t	error_code;
53909 	/* The HWRM command request type. */
53910 	uint16_t	req_type;
53911 	/* The sequence ID from the original command. */
53912 	uint16_t	seq_id;
53913 	/* The length of the response data in number of bytes. */
53914 	uint16_t	resp_len;
53915 	/* Version Major number. */
53916 	uint8_t	major;
53917 	/* Version Minor number. */
53918 	uint8_t	minor;
53919 	/* Version Update number. */
53920 	uint8_t	update;
53921 	/* unused. */
53922 	uint8_t	unused0[5];
53923 	/*
53924 	 * This field is used to indicate device's capabilities and
53925 	 * configurations.
53926 	 */
53927 	uint64_t	dev_caps_cfg;
53928 	/* unused. */
53929 	uint8_t	unused1[7];
53930 	/*
53931 	 * This field is used in Output records to indicate that the output
53932 	 * is completely written to RAM. This field should be read as '1'
53933 	 * to indicate that the output has been completely written.
53934 	 * When writing a command completion or response to an internal
53935 	 * processor, the order of writes has to be such that this field is
53936 	 * written last.
53937 	 */
53938 	uint8_t	valid;
53939 } hwrm_tf_version_get_output_t, *phwrm_tf_version_get_output_t;
53940 
53941 /************************
53942  * hwrm_tf_session_open *
53943  ************************/
53944 
53945 
53946 /* hwrm_tf_session_open_input (size:640b/80B) */
53947 
53948 typedef struct hwrm_tf_session_open_input {
53949 	/* The HWRM command request type. */
53950 	uint16_t	req_type;
53951 	/*
53952 	 * The completion ring to send the completion event on. This should
53953 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
53954 	 */
53955 	uint16_t	cmpl_ring;
53956 	/*
53957 	 * The sequence ID is used by the driver for tracking multiple
53958 	 * commands. This ID is treated as opaque data by the firmware and
53959 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
53960 	 */
53961 	uint16_t	seq_id;
53962 	/*
53963 	 * The target ID of the command:
53964 	 * * 0x0-0xFFF8 - The function ID
53965 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53966 	 * * 0xFFFD - Reserved for user-space HWRM interface
53967 	 * * 0xFFFF - HWRM
53968 	 */
53969 	uint16_t	target_id;
53970 	/*
53971 	 * A physical address pointer pointing to a host buffer that the
53972 	 * command's response data will be written. This can be either a host
53973 	 * physical address (HPA) or a guest physical address (GPA) and must
53974 	 * point to a physically contiguous block of memory.
53975 	 */
53976 	uint64_t	resp_addr;
53977 	/* Name of the session. */
53978 	uint8_t	session_name[64];
53979 } hwrm_tf_session_open_input_t, *phwrm_tf_session_open_input_t;
53980 
53981 /* hwrm_tf_session_open_output (size:192b/24B) */
53982 
53983 typedef struct hwrm_tf_session_open_output {
53984 	/* The specific error status for the command. */
53985 	uint16_t	error_code;
53986 	/* The HWRM command request type. */
53987 	uint16_t	req_type;
53988 	/* The sequence ID from the original command. */
53989 	uint16_t	seq_id;
53990 	/* The length of the response data in number of bytes. */
53991 	uint16_t	resp_len;
53992 	/*
53993 	 * Unique session identifier for the session created by the
53994 	 * firmware.
53995 	 */
53996 	uint32_t	fw_session_id;
53997 	/*
53998 	 * Unique session client identifier for the first client on
53999 	 * the newly created session.
54000 	 */
54001 	uint32_t	fw_session_client_id;
54002 	/* This field is used to return the status of fw session to host. */
54003 	uint32_t	flags;
54004 	/*
54005 	 * Indicates if the shared session has been created. Shared session
54006 	 * should be the first session created ever. Its fw_rm_client_id
54007 	 * should be 1. The AFM session's fw_rm_client_id is 0.
54008 	 */
54009 	#define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION		UINT32_C(0x1)
54010 	/*
54011 	 * If this bit set to 0, then it indicates the shared session
54012 	 * has been created by another session.
54013 	 */
54014 		#define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_NOT_CREATOR  UINT32_C(0x0)
54015 	/*
54016 	 * If this bit is set to 1, then it indicates the shared session
54017 	 * is created by this session.
54018 	 */
54019 		#define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_CREATOR	UINT32_C(0x1)
54020 		#define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_LAST	HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_CREATOR
54021 	/* unused. */
54022 	uint8_t	unused1[3];
54023 	/*
54024 	 * This field is used in Output records to indicate that the output
54025 	 * is completely written to RAM. This field should be read as '1'
54026 	 * to indicate that the output has been completely written.
54027 	 * When writing a command completion or response to an internal
54028 	 * processor, the order of writes has to be such that this field is
54029 	 * written last.
54030 	 */
54031 	uint8_t	valid;
54032 } hwrm_tf_session_open_output_t, *phwrm_tf_session_open_output_t;
54033 
54034 /****************************
54035  * hwrm_tf_session_register *
54036  ****************************/
54037 
54038 
54039 /* hwrm_tf_session_register_input (size:704b/88B) */
54040 
54041 typedef struct hwrm_tf_session_register_input {
54042 	/* The HWRM command request type. */
54043 	uint16_t	req_type;
54044 	/*
54045 	 * The completion ring to send the completion event on. This should
54046 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54047 	 */
54048 	uint16_t	cmpl_ring;
54049 	/*
54050 	 * The sequence ID is used by the driver for tracking multiple
54051 	 * commands. This ID is treated as opaque data by the firmware and
54052 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54053 	 */
54054 	uint16_t	seq_id;
54055 	/*
54056 	 * The target ID of the command:
54057 	 * * 0x0-0xFFF8 - The function ID
54058 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54059 	 * * 0xFFFD - Reserved for user-space HWRM interface
54060 	 * * 0xFFFF - HWRM
54061 	 */
54062 	uint16_t	target_id;
54063 	/*
54064 	 * A physical address pointer pointing to a host buffer that the
54065 	 * command's response data will be written. This can be either a host
54066 	 * physical address (HPA) or a guest physical address (GPA) and must
54067 	 * point to a physically contiguous block of memory.
54068 	 */
54069 	uint64_t	resp_addr;
54070 	/*
54071 	 * Unique session identifier for the session that the
54072 	 * register request want to create a new client on. This
54073 	 * value originates from the first open request.
54074 	 * The fw_session_id of the attach session includes PCIe bus
54075 	 * info to distinguish the PF and session info to identify
54076 	 * the associated TruFlow session.
54077 	 */
54078 	uint32_t	fw_session_id;
54079 	/* unused. */
54080 	uint32_t	unused0;
54081 	/* Name of the session client. */
54082 	uint8_t	session_client_name[64];
54083 } hwrm_tf_session_register_input_t, *phwrm_tf_session_register_input_t;
54084 
54085 /* hwrm_tf_session_register_output (size:128b/16B) */
54086 
54087 typedef struct hwrm_tf_session_register_output {
54088 	/* The specific error status for the command. */
54089 	uint16_t	error_code;
54090 	/* The HWRM command request type. */
54091 	uint16_t	req_type;
54092 	/* The sequence ID from the original command. */
54093 	uint16_t	seq_id;
54094 	/* The length of the response data in number of bytes. */
54095 	uint16_t	resp_len;
54096 	/*
54097 	 * Unique session client identifier for the session created
54098 	 * by the firmware. It includes the session the client it
54099 	 * attached to and session client info.
54100 	 */
54101 	uint32_t	fw_session_client_id;
54102 	/* unused. */
54103 	uint8_t	unused0[3];
54104 	/*
54105 	 * This field is used in Output records to indicate that the output
54106 	 * is completely written to RAM. This field should be read as '1'
54107 	 * to indicate that the output has been completely written.
54108 	 * When writing a command completion or response to an internal
54109 	 * processor, the order of writes has to be such that this field is
54110 	 * written last.
54111 	 */
54112 	uint8_t	valid;
54113 } hwrm_tf_session_register_output_t, *phwrm_tf_session_register_output_t;
54114 
54115 /******************************
54116  * hwrm_tf_session_unregister *
54117  ******************************/
54118 
54119 
54120 /* hwrm_tf_session_unregister_input (size:192b/24B) */
54121 
54122 typedef struct hwrm_tf_session_unregister_input {
54123 	/* The HWRM command request type. */
54124 	uint16_t	req_type;
54125 	/*
54126 	 * The completion ring to send the completion event on. This should
54127 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54128 	 */
54129 	uint16_t	cmpl_ring;
54130 	/*
54131 	 * The sequence ID is used by the driver for tracking multiple
54132 	 * commands. This ID is treated as opaque data by the firmware and
54133 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54134 	 */
54135 	uint16_t	seq_id;
54136 	/*
54137 	 * The target ID of the command:
54138 	 * * 0x0-0xFFF8 - The function ID
54139 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54140 	 * * 0xFFFD - Reserved for user-space HWRM interface
54141 	 * * 0xFFFF - HWRM
54142 	 */
54143 	uint16_t	target_id;
54144 	/*
54145 	 * A physical address pointer pointing to a host buffer that the
54146 	 * command's response data will be written. This can be either a host
54147 	 * physical address (HPA) or a guest physical address (GPA) and must
54148 	 * point to a physically contiguous block of memory.
54149 	 */
54150 	uint64_t	resp_addr;
54151 	/*
54152 	 * Unique session identifier for the session that the
54153 	 * unregister request want to close a session client on.
54154 	 */
54155 	uint32_t	fw_session_id;
54156 	/*
54157 	 * Unique session client identifier for the session that the
54158 	 * unregister request want to close.
54159 	 */
54160 	uint32_t	fw_session_client_id;
54161 } hwrm_tf_session_unregister_input_t, *phwrm_tf_session_unregister_input_t;
54162 
54163 /* hwrm_tf_session_unregister_output (size:128b/16B) */
54164 
54165 typedef struct hwrm_tf_session_unregister_output {
54166 	/* The specific error status for the command. */
54167 	uint16_t	error_code;
54168 	/* The HWRM command request type. */
54169 	uint16_t	req_type;
54170 	/* The sequence ID from the original command. */
54171 	uint16_t	seq_id;
54172 	/* The length of the response data in number of bytes. */
54173 	uint16_t	resp_len;
54174 	/* unused. */
54175 	uint8_t	unused0[7];
54176 	/*
54177 	 * This field is used in Output records to indicate that the output
54178 	 * is completely written to RAM. This field should be read as '1'
54179 	 * to indicate that the output has been completely written.
54180 	 * When writing a command completion or response to an internal
54181 	 * processor, the order of writes has to be such that this field is
54182 	 * written last.
54183 	 */
54184 	uint8_t	valid;
54185 } hwrm_tf_session_unregister_output_t, *phwrm_tf_session_unregister_output_t;
54186 
54187 /*************************
54188  * hwrm_tf_session_close *
54189  *************************/
54190 
54191 
54192 /* hwrm_tf_session_close_input (size:192b/24B) */
54193 
54194 typedef struct hwrm_tf_session_close_input {
54195 	/* The HWRM command request type. */
54196 	uint16_t	req_type;
54197 	/*
54198 	 * The completion ring to send the completion event on. This should
54199 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54200 	 */
54201 	uint16_t	cmpl_ring;
54202 	/*
54203 	 * The sequence ID is used by the driver for tracking multiple
54204 	 * commands. This ID is treated as opaque data by the firmware and
54205 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54206 	 */
54207 	uint16_t	seq_id;
54208 	/*
54209 	 * The target ID of the command:
54210 	 * * 0x0-0xFFF8 - The function ID
54211 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54212 	 * * 0xFFFD - Reserved for user-space HWRM interface
54213 	 * * 0xFFFF - HWRM
54214 	 */
54215 	uint16_t	target_id;
54216 	/*
54217 	 * A physical address pointer pointing to a host buffer that the
54218 	 * command's response data will be written. This can be either a host
54219 	 * physical address (HPA) or a guest physical address (GPA) and must
54220 	 * point to a physically contiguous block of memory.
54221 	 */
54222 	uint64_t	resp_addr;
54223 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
54224 	uint32_t	fw_session_id;
54225 	/* unused. */
54226 	uint8_t	unused0[4];
54227 } hwrm_tf_session_close_input_t, *phwrm_tf_session_close_input_t;
54228 
54229 /* hwrm_tf_session_close_output (size:128b/16B) */
54230 
54231 typedef struct hwrm_tf_session_close_output {
54232 	/* The specific error status for the command. */
54233 	uint16_t	error_code;
54234 	/* The HWRM command request type. */
54235 	uint16_t	req_type;
54236 	/* The sequence ID from the original command. */
54237 	uint16_t	seq_id;
54238 	/* The length of the response data in number of bytes. */
54239 	uint16_t	resp_len;
54240 	/* unused. */
54241 	uint8_t	unused0[7];
54242 	/*
54243 	 * This field is used in Output records to indicate that the output
54244 	 * is completely written to RAM. This field should be read as '1'
54245 	 * to indicate that the output has been completely written.
54246 	 * When writing a command completion or response to an internal
54247 	 * processor, the order of writes has to be such that this field
54248 	 * is written last.
54249 	 */
54250 	uint8_t	valid;
54251 } hwrm_tf_session_close_output_t, *phwrm_tf_session_close_output_t;
54252 
54253 /************************
54254  * hwrm_tf_session_qcfg *
54255  ************************/
54256 
54257 
54258 /* hwrm_tf_session_qcfg_input (size:192b/24B) */
54259 
54260 typedef struct hwrm_tf_session_qcfg_input {
54261 	/* The HWRM command request type. */
54262 	uint16_t	req_type;
54263 	/*
54264 	 * The completion ring to send the completion event on. This should
54265 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54266 	 */
54267 	uint16_t	cmpl_ring;
54268 	/*
54269 	 * The sequence ID is used by the driver for tracking multiple
54270 	 * commands. This ID is treated as opaque data by the firmware and
54271 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54272 	 */
54273 	uint16_t	seq_id;
54274 	/*
54275 	 * The target ID of the command:
54276 	 * * 0x0-0xFFF8 - The function ID
54277 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54278 	 * * 0xFFFD - Reserved for user-space HWRM interface
54279 	 * * 0xFFFF - HWRM
54280 	 */
54281 	uint16_t	target_id;
54282 	/*
54283 	 * A physical address pointer pointing to a host buffer that the
54284 	 * command's response data will be written. This can be either a host
54285 	 * physical address (HPA) or a guest physical address (GPA) and must
54286 	 * point to a physically contiguous block of memory.
54287 	 */
54288 	uint64_t	resp_addr;
54289 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
54290 	uint32_t	fw_session_id;
54291 	/* unused. */
54292 	uint8_t	unused0[4];
54293 } hwrm_tf_session_qcfg_input_t, *phwrm_tf_session_qcfg_input_t;
54294 
54295 /* hwrm_tf_session_qcfg_output (size:128b/16B) */
54296 
54297 typedef struct hwrm_tf_session_qcfg_output {
54298 	/* The specific error status for the command. */
54299 	uint16_t	error_code;
54300 	/* The HWRM command request type. */
54301 	uint16_t	req_type;
54302 	/* The sequence ID from the original command. */
54303 	uint16_t	seq_id;
54304 	/* The length of the response data in number of bytes. */
54305 	uint16_t	resp_len;
54306 	/* RX action control settings flags. */
54307 	uint8_t	rx_act_flags;
54308 	/*
54309 	 * A value of 1 in this field indicates that Global Flow ID
54310 	 * reporting into cfa_code and cfa_metadata is enabled.
54311 	 */
54312 	#define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_ABCR_GFID_EN		UINT32_C(0x1)
54313 	/*
54314 	 * A value of 1 in this field indicates that both inner and outer
54315 	 * are stripped and inner tag is passed.
54316 	 * Enabled.
54317 	 */
54318 	#define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_ABCR_VTAG_DLT_BOTH	UINT32_C(0x2)
54319 	/*
54320 	 * A value of 1 in this field indicates that the re-use of
54321 	 * existing tunnel L2 header SMAC is enabled for
54322 	 * Non-tunnel L2, L2-L3 and IP-IP tunnel.
54323 	 */
54324 	#define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_TECT_SMAC_OVR_RUTNSL2	UINT32_C(0x4)
54325 	/* TX Action control settings flags. */
54326 	uint8_t	tx_act_flags;
54327 	/* Disabled. */
54328 	#define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_ABCR_VEB_EN	UINT32_C(0x1)
54329 	/*
54330 	 * When set to 1 any GRE tunnels will include the
54331 	 * optional Key field.
54332 	 */
54333 	#define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_GRE_SET_K	UINT32_C(0x2)
54334 	/*
54335 	 * When set to 1, for GRE tunnels, the IPV6 Traffic Class (TC)
54336 	 * field of the outer header is inherited from the inner header
54337 	 * (if present) or the fixed value as taken from the encap
54338 	 * record.
54339 	 */
54340 	#define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_IPV6_TC_IH	UINT32_C(0x4)
54341 	/*
54342 	 * When set to 1, for GRE tunnels, the IPV4 Type Of Service (TOS)
54343 	 * field of the outer header is inherited from the inner header
54344 	 * (if present) or the fixed value as taken from the encap record.
54345 	 */
54346 	#define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_IPV4_TOS_IH	UINT32_C(0x8)
54347 	/* unused. */
54348 	uint8_t	unused0[5];
54349 	/*
54350 	 * This field is used in Output records to indicate that the output
54351 	 * is completely written to RAM. This field should be read as '1'
54352 	 * to indicate that the output has been completely written.
54353 	 * When writing a command completion or response to an internal
54354 	 * processor, the order of writes has to be such that this field
54355 	 * is written last.
54356 	 */
54357 	uint8_t	valid;
54358 } hwrm_tf_session_qcfg_output_t, *phwrm_tf_session_qcfg_output_t;
54359 
54360 /******************************
54361  * hwrm_tf_session_resc_qcaps *
54362  ******************************/
54363 
54364 
54365 /* hwrm_tf_session_resc_qcaps_input (size:256b/32B) */
54366 
54367 typedef struct hwrm_tf_session_resc_qcaps_input {
54368 	/* The HWRM command request type. */
54369 	uint16_t	req_type;
54370 	/*
54371 	 * The completion ring to send the completion event on. This should
54372 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54373 	 */
54374 	uint16_t	cmpl_ring;
54375 	/*
54376 	 * The sequence ID is used by the driver for tracking multiple
54377 	 * commands. This ID is treated as opaque data by the firmware and
54378 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54379 	 */
54380 	uint16_t	seq_id;
54381 	/*
54382 	 * The target ID of the command:
54383 	 * * 0x0-0xFFF8 - The function ID
54384 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54385 	 * * 0xFFFD - Reserved for user-space HWRM interface
54386 	 * * 0xFFFF - HWRM
54387 	 */
54388 	uint16_t	target_id;
54389 	/*
54390 	 * A physical address pointer pointing to a host buffer that the
54391 	 * command's response data will be written. This can be either a host
54392 	 * physical address (HPA) or a guest physical address (GPA) and must
54393 	 * point to a physically contiguous block of memory.
54394 	 */
54395 	uint64_t	resp_addr;
54396 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
54397 	uint32_t	fw_session_id;
54398 	/* Control flags. */
54399 	uint16_t	flags;
54400 	/* Indicates the flow direction. */
54401 	#define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR	UINT32_C(0x1)
54402 	/* If this bit set to 0, then it indicates rx flow. */
54403 		#define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
54404 	/* If this bit is set to 1, then it indicates tx flow. */
54405 		#define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
54406 		#define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX
54407 	/*
54408 	 * Defines the size of the provided qcaps_addr array
54409 	 * buffer. The size should be set to the Resource Manager
54410 	 * provided max number of qcaps entries which is device
54411 	 * specific. Resource Manager gets the max size from HCAPI
54412 	 * RM.
54413 	 */
54414 	uint16_t	qcaps_size;
54415 	/*
54416 	 * This is the DMA address for the qcaps output data array
54417 	 * buffer. Array is of tf_rm_resc_req_entry type and is
54418 	 * device specific.
54419 	 */
54420 	uint64_t	qcaps_addr;
54421 } hwrm_tf_session_resc_qcaps_input_t, *phwrm_tf_session_resc_qcaps_input_t;
54422 
54423 /* hwrm_tf_session_resc_qcaps_output (size:192b/24B) */
54424 
54425 typedef struct hwrm_tf_session_resc_qcaps_output {
54426 	/* The specific error status for the command. */
54427 	uint16_t	error_code;
54428 	/* The HWRM command request type. */
54429 	uint16_t	req_type;
54430 	/* The sequence ID from the original command. */
54431 	uint16_t	seq_id;
54432 	/* The length of the response data in number of bytes. */
54433 	uint16_t	resp_len;
54434 	/* Control flags. */
54435 	uint32_t	flags;
54436 	/* Session reservation strategy. */
54437 	#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_MASK  UINT32_C(0x3)
54438 	#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_SFT   0
54439 	/* Static partitioning. */
54440 		#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_STATIC  UINT32_C(0x0)
54441 	/* Strategy 1. */
54442 		#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_1	UINT32_C(0x1)
54443 	/* Strategy 2. */
54444 		#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_2	UINT32_C(0x2)
54445 	/* Strategy 3. */
54446 		#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3	UINT32_C(0x3)
54447 		#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_LAST   HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3
54448 	/*
54449 	 * Size of the returned qcaps_addr data array buffer. The
54450 	 * value cannot exceed the size defined by the input msg,
54451 	 * qcaps_size.
54452 	 */
54453 	uint16_t	size;
54454 	/*
54455 	 * SRAM profile number that sets the partition of SRAM memory
54456 	 * between TF and AFM within the 4 internal memory banks (Thor).
54457 	 */
54458 	uint8_t	sram_profile;
54459 	/* unused. */
54460 	uint8_t	unused0;
54461 	/* unused. */
54462 	uint8_t	unused1[7];
54463 	/*
54464 	 * This field is used in Output records to indicate that the output
54465 	 * is completely written to RAM. This field should be read as '1'
54466 	 * to indicate that the output has been completely written.
54467 	 * When writing a command completion or response to an internal
54468 	 * processor, the order of writes has to be such that this field is
54469 	 * written last.
54470 	 */
54471 	uint8_t	valid;
54472 } hwrm_tf_session_resc_qcaps_output_t, *phwrm_tf_session_resc_qcaps_output_t;
54473 
54474 /******************************
54475  * hwrm_tf_session_resc_alloc *
54476  ******************************/
54477 
54478 
54479 /* hwrm_tf_session_resc_alloc_input (size:320b/40B) */
54480 
54481 typedef struct hwrm_tf_session_resc_alloc_input {
54482 	/* The HWRM command request type. */
54483 	uint16_t	req_type;
54484 	/*
54485 	 * The completion ring to send the completion event on. This should
54486 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54487 	 */
54488 	uint16_t	cmpl_ring;
54489 	/*
54490 	 * The sequence ID is used by the driver for tracking multiple
54491 	 * commands. This ID is treated as opaque data by the firmware and
54492 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54493 	 */
54494 	uint16_t	seq_id;
54495 	/*
54496 	 * The target ID of the command:
54497 	 * * 0x0-0xFFF8 - The function ID
54498 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54499 	 * * 0xFFFD - Reserved for user-space HWRM interface
54500 	 * * 0xFFFF - HWRM
54501 	 */
54502 	uint16_t	target_id;
54503 	/*
54504 	 * A physical address pointer pointing to a host buffer that the
54505 	 * command's response data will be written. This can be either a host
54506 	 * physical address (HPA) or a guest physical address (GPA) and must
54507 	 * point to a physically contiguous block of memory.
54508 	 */
54509 	uint64_t	resp_addr;
54510 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
54511 	uint32_t	fw_session_id;
54512 	/* Control flags. */
54513 	uint16_t	flags;
54514 	/* Indicates the flow direction. */
54515 	#define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR	UINT32_C(0x1)
54516 	/* If this bit set to 0, then it indicates rx flow. */
54517 		#define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
54518 	/* If this bit is set to 1, then it indicates tx flow. */
54519 		#define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
54520 		#define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX
54521 	/*
54522 	 * Defines the array size of the provided req_addr and
54523 	 * resv_addr array buffers. Should be set to the number of
54524 	 * request entries.
54525 	 */
54526 	uint16_t	req_size;
54527 	/*
54528 	 * This is the DMA address for the request input data array
54529 	 * buffer. Array is of tf_rm_resc_req_entry type. Size of the
54530 	 * array buffer is provided by the 'req_size' field in this
54531 	 * message.
54532 	 */
54533 	uint64_t	req_addr;
54534 	/*
54535 	 * This is the DMA address for the resc output data array
54536 	 * buffer. Array is of tf_rm_resc_entry type. Size of the array
54537 	 * buffer is provided by the 'req_size' field in this
54538 	 * message.
54539 	 */
54540 	uint64_t	resc_addr;
54541 } hwrm_tf_session_resc_alloc_input_t, *phwrm_tf_session_resc_alloc_input_t;
54542 
54543 /* hwrm_tf_session_resc_alloc_output (size:128b/16B) */
54544 
54545 typedef struct hwrm_tf_session_resc_alloc_output {
54546 	/* The specific error status for the command. */
54547 	uint16_t	error_code;
54548 	/* The HWRM command request type. */
54549 	uint16_t	req_type;
54550 	/* The sequence ID from the original command. */
54551 	uint16_t	seq_id;
54552 	/* The length of the response data in number of bytes. */
54553 	uint16_t	resp_len;
54554 	/*
54555 	 * Size of the returned tf_rm_resc_entry data array. The value
54556 	 * cannot exceed the req_size defined by the input msg. The data
54557 	 * array is returned using the resv_addr specified DMA
54558 	 * address also provided by the input msg.
54559 	 */
54560 	uint16_t	size;
54561 	/* unused. */
54562 	uint8_t	unused0[5];
54563 	/*
54564 	 * This field is used in Output records to indicate that the output
54565 	 * is completely written to RAM. This field should be read as '1'
54566 	 * to indicate that the output has been completely written.
54567 	 * When writing a command completion or response to an internal
54568 	 * processor, the order of writes has to be such that this field is
54569 	 * written last.
54570 	 */
54571 	uint8_t	valid;
54572 } hwrm_tf_session_resc_alloc_output_t, *phwrm_tf_session_resc_alloc_output_t;
54573 
54574 /******************************
54575  * hwrm_tf_session_resc_flush *
54576  ******************************/
54577 
54578 
54579 /* hwrm_tf_session_resc_flush_input (size:256b/32B) */
54580 
54581 typedef struct hwrm_tf_session_resc_flush_input {
54582 	/* The HWRM command request type. */
54583 	uint16_t	req_type;
54584 	/*
54585 	 * The completion ring to send the completion event on. This should
54586 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54587 	 */
54588 	uint16_t	cmpl_ring;
54589 	/*
54590 	 * The sequence ID is used by the driver for tracking multiple
54591 	 * commands. This ID is treated as opaque data by the firmware and
54592 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54593 	 */
54594 	uint16_t	seq_id;
54595 	/*
54596 	 * The target ID of the command:
54597 	 * * 0x0-0xFFF8 - The function ID
54598 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54599 	 * * 0xFFFD - Reserved for user-space HWRM interface
54600 	 * * 0xFFFF - HWRM
54601 	 */
54602 	uint16_t	target_id;
54603 	/*
54604 	 * A physical address pointer pointing to a host buffer that the
54605 	 * command's response data will be written. This can be either a host
54606 	 * physical address (HPA) or a guest physical address (GPA) and must
54607 	 * point to a physically contiguous block of memory.
54608 	 */
54609 	uint64_t	resp_addr;
54610 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
54611 	uint32_t	fw_session_id;
54612 	/* Control flags. */
54613 	uint16_t	flags;
54614 	/* Indicates the flow direction. */
54615 	#define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR	UINT32_C(0x1)
54616 	/* If this bit set to 0, then it indicates rx flow. */
54617 		#define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
54618 	/* If this bit is set to 1, then it indicates tx flow. */
54619 		#define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
54620 		#define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_TX
54621 	/*
54622 	 * Defines the size, in bytes, of the provided flush_addr
54623 	 * buffer.
54624 	 */
54625 	uint16_t	flush_size;
54626 	/*
54627 	 * This is the DMA address for the flush input data array
54628 	 * buffer. Array of tf_rm_resc_entry type. Size of the
54629 	 * buffer is provided by the 'flush_size' field in this
54630 	 * message.
54631 	 */
54632 	uint64_t	flush_addr;
54633 } hwrm_tf_session_resc_flush_input_t, *phwrm_tf_session_resc_flush_input_t;
54634 
54635 /* hwrm_tf_session_resc_flush_output (size:128b/16B) */
54636 
54637 typedef struct hwrm_tf_session_resc_flush_output {
54638 	/* The specific error status for the command. */
54639 	uint16_t	error_code;
54640 	/* The HWRM command request type. */
54641 	uint16_t	req_type;
54642 	/* The sequence ID from the original command. */
54643 	uint16_t	seq_id;
54644 	/* The length of the response data in number of bytes. */
54645 	uint16_t	resp_len;
54646 	/* unused. */
54647 	uint8_t	unused0[7];
54648 	/*
54649 	 * This field is used in Output records to indicate that the output
54650 	 * is completely written to RAM. This field should be read as '1'
54651 	 * to indicate that the output has been completely written.
54652 	 * When writing a command completion or response to an internal
54653 	 * processor, the order of writes has to be such that this field is
54654 	 * written last.
54655 	 */
54656 	uint8_t	valid;
54657 } hwrm_tf_session_resc_flush_output_t, *phwrm_tf_session_resc_flush_output_t;
54658 
54659 /*****************************
54660  * hwrm_tf_session_resc_info *
54661  *****************************/
54662 
54663 
54664 /* hwrm_tf_session_resc_info_input (size:320b/40B) */
54665 
54666 typedef struct hwrm_tf_session_resc_info_input {
54667 	/* The HWRM command request type. */
54668 	uint16_t	req_type;
54669 	/*
54670 	 * The completion ring to send the completion event on. This should
54671 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54672 	 */
54673 	uint16_t	cmpl_ring;
54674 	/*
54675 	 * The sequence ID is used by the driver for tracking multiple
54676 	 * commands. This ID is treated as opaque data by the firmware and
54677 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54678 	 */
54679 	uint16_t	seq_id;
54680 	/*
54681 	 * The target ID of the command:
54682 	 * * 0x0-0xFFF8 - The function ID
54683 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54684 	 * * 0xFFFD - Reserved for user-space HWRM interface
54685 	 * * 0xFFFF - HWRM
54686 	 */
54687 	uint16_t	target_id;
54688 	/*
54689 	 * A physical address pointer pointing to a host buffer that the
54690 	 * command's response data will be written. This can be either a host
54691 	 * physical address (HPA) or a guest physical address (GPA) and must
54692 	 * point to a physically contiguous block of memory.
54693 	 */
54694 	uint64_t	resp_addr;
54695 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
54696 	uint32_t	fw_session_id;
54697 	/* Control flags. */
54698 	uint16_t	flags;
54699 	/* Indicates the flow direction. */
54700 	#define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR	UINT32_C(0x1)
54701 	/* If this bit set to 0, then it indicates rx flow. */
54702 		#define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
54703 	/* If this bit is set to 1, then it indicates tx flow. */
54704 		#define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
54705 		#define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_TX
54706 	/*
54707 	 * Defines the array size of the provided req_addr and
54708 	 * resv_addr array buffers. Should be set to the number of
54709 	 * request entries.
54710 	 */
54711 	uint16_t	req_size;
54712 	/*
54713 	 * This is the DMA address for the request input data array
54714 	 * buffer. Array is of tf_rm_resc_req_entry type. Size of the
54715 	 * array buffer is provided by the 'req_size' field in this
54716 	 * message.
54717 	 */
54718 	uint64_t	req_addr;
54719 	/*
54720 	 * This is the DMA address for the resc output data array
54721 	 * buffer. Array is of tf_rm_resc_entry type. Size of the array
54722 	 * buffer is provided by the 'req_size' field in this
54723 	 * message.
54724 	 */
54725 	uint64_t	resc_addr;
54726 } hwrm_tf_session_resc_info_input_t, *phwrm_tf_session_resc_info_input_t;
54727 
54728 /* hwrm_tf_session_resc_info_output (size:128b/16B) */
54729 
54730 typedef struct hwrm_tf_session_resc_info_output {
54731 	/* The specific error status for the command. */
54732 	uint16_t	error_code;
54733 	/* The HWRM command request type. */
54734 	uint16_t	req_type;
54735 	/* The sequence ID from the original command. */
54736 	uint16_t	seq_id;
54737 	/* The length of the response data in number of bytes. */
54738 	uint16_t	resp_len;
54739 	/*
54740 	 * Size of the returned tf_rm_resc_entry data array. The value
54741 	 * cannot exceed the req_size defined by the input msg. The data
54742 	 * array is returned using the resv_addr specified DMA
54743 	 * address also provided by the input msg.
54744 	 */
54745 	uint16_t	size;
54746 	/* unused. */
54747 	uint8_t	unused0[5];
54748 	/*
54749 	 * This field is used in Output records to indicate that the output
54750 	 * is completely written to RAM. This field should be read as '1'
54751 	 * to indicate that the output has been completely written.
54752 	 * When writing a command completion or response to an internal
54753 	 * processor, the order of writes has to be such that this field is
54754 	 * written last.
54755 	 */
54756 	uint8_t	valid;
54757 } hwrm_tf_session_resc_info_output_t, *phwrm_tf_session_resc_info_output_t;
54758 
54759 /* TruFlow RM capability of a resource. */
54760 /* tf_rm_resc_req_entry (size:64b/8B) */
54761 
54762 typedef struct tf_rm_resc_req_entry {
54763 	/* Type of the resource, defined globally in HCAPI RM. */
54764 	uint32_t	type;
54765 	/* Minimum value. */
54766 	uint16_t	min;
54767 	/* Maximum value. */
54768 	uint16_t	max;
54769 } tf_rm_resc_req_entry_t, *ptf_rm_resc_req_entry_t;
54770 
54771 /* TruFlow RM reservation information. */
54772 /* tf_rm_resc_entry (size:64b/8B) */
54773 
54774 typedef struct tf_rm_resc_entry {
54775 	/* Type of the resource, defined globally in HCAPI RM. */
54776 	uint32_t	type;
54777 	/* Start offset. */
54778 	uint16_t	start;
54779 	/* Number of resources. */
54780 	uint16_t	stride;
54781 } tf_rm_resc_entry_t, *ptf_rm_resc_entry_t;
54782 
54783 /**************************
54784  * hwrm_tf_tbl_type_alloc *
54785  **************************/
54786 
54787 
54788 /* hwrm_tf_tbl_type_alloc_input (size:192b/24B) */
54789 
54790 typedef struct hwrm_tf_tbl_type_alloc_input {
54791 	/* The HWRM command request type. */
54792 	uint16_t	req_type;
54793 	/*
54794 	 * The completion ring to send the completion event on. This should
54795 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54796 	 */
54797 	uint16_t	cmpl_ring;
54798 	/*
54799 	 * The sequence ID is used by the driver for tracking multiple
54800 	 * commands. This ID is treated as opaque data by the firmware and
54801 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54802 	 */
54803 	uint16_t	seq_id;
54804 	/*
54805 	 * The target ID of the command:
54806 	 * * 0x0-0xFFF8 - The function ID
54807 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54808 	 * * 0xFFFD - Reserved for user-space HWRM interface
54809 	 * * 0xFFFF - HWRM
54810 	 */
54811 	uint16_t	target_id;
54812 	/*
54813 	 * A physical address pointer pointing to a host buffer that the
54814 	 * command's response data will be written. This can be either a host
54815 	 * physical address (HPA) or a guest physical address (GPA) and must
54816 	 * point to a physically contiguous block of memory.
54817 	 */
54818 	uint64_t	resp_addr;
54819 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
54820 	uint32_t	fw_session_id;
54821 	/* Control flags. */
54822 	uint16_t	flags;
54823 	/* Indicates the flow direction. */
54824 	#define HWRM_TF_TBL_TYPE_ALLOC_INPUT_FLAGS_DIR	UINT32_C(0x1)
54825 	/* If this bit set to 0, then it indicates rx flow. */
54826 		#define HWRM_TF_TBL_TYPE_ALLOC_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
54827 	/* If this bit is set to 1, then it indicates tx flow. */
54828 		#define HWRM_TF_TBL_TYPE_ALLOC_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
54829 		#define HWRM_TF_TBL_TYPE_ALLOC_INPUT_FLAGS_DIR_LAST HWRM_TF_TBL_TYPE_ALLOC_INPUT_FLAGS_DIR_TX
54830 	/* Specifies which block this idx table alloc request is for */
54831 	uint8_t	blktype;
54832 	/* CFA block type */
54833 	#define HWRM_TF_TBL_TYPE_ALLOC_INPUT_BLKTYPE_BLKTYPE_CFA	UINT32_C(0x0)
54834 	/* RXP gparse block type */
54835 	#define HWRM_TF_TBL_TYPE_ALLOC_INPUT_BLKTYPE_BLKTYPE_RXP	UINT32_C(0x1)
54836 	/* RE gparse block type */
54837 	#define HWRM_TF_TBL_TYPE_ALLOC_INPUT_BLKTYPE_BLKTYPE_RE_GPARSE UINT32_C(0x2)
54838 	/* TE gparse block type */
54839 	#define HWRM_TF_TBL_TYPE_ALLOC_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE UINT32_C(0x3)
54840 	#define HWRM_TF_TBL_TYPE_ALLOC_INPUT_BLKTYPE_LAST		HWRM_TF_TBL_TYPE_ALLOC_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE
54841 	/*
54842 	 * This field is blktype specific. For any of the UPAR types it is
54843 	 * set to a non-zero value in case of a re-alloc, specifies a
54844 	 * tunnel-type of dynamic UPAR tunnel.
54845 	 */
54846 	uint8_t	type;
54847 } hwrm_tf_tbl_type_alloc_input_t, *phwrm_tf_tbl_type_alloc_input_t;
54848 
54849 /* hwrm_tf_tbl_type_alloc_output (size:128b/16B) */
54850 
54851 typedef struct hwrm_tf_tbl_type_alloc_output {
54852 	/* The specific error status for the command. */
54853 	uint16_t	error_code;
54854 	/* The HWRM command request type. */
54855 	uint16_t	req_type;
54856 	/* The sequence ID from the original command. */
54857 	uint16_t	seq_id;
54858 	/* The length of the response data in number of bytes. */
54859 	uint16_t	resp_len;
54860 	/* Response code. */
54861 	uint32_t	resp_code;
54862 	/*
54863 	 * Table entry allocated by the firmware using the
54864 	 * parameters above.
54865 	 */
54866 	uint16_t	idx_tbl_id;
54867 	/* unused */
54868 	uint8_t	unused0;
54869 	/*
54870 	 * This field is used in Output records to indicate that the output
54871 	 * is completely written to RAM. This field should be read as '1'
54872 	 * to indicate that the output has been completely written.
54873 	 * When writing a command completion or response to an internal
54874 	 * processor, the order of writes has to be such that this field
54875 	 * is written last.
54876 	 */
54877 	uint8_t	valid;
54878 } hwrm_tf_tbl_type_alloc_output_t, *phwrm_tf_tbl_type_alloc_output_t;
54879 
54880 /************************
54881  * hwrm_tf_tbl_type_get *
54882  ************************/
54883 
54884 
54885 /* hwrm_tf_tbl_type_get_input (size:256b/32B) */
54886 
54887 typedef struct hwrm_tf_tbl_type_get_input {
54888 	/* The HWRM command request type. */
54889 	uint16_t	req_type;
54890 	/*
54891 	 * The completion ring to send the completion event on. This should
54892 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54893 	 */
54894 	uint16_t	cmpl_ring;
54895 	/*
54896 	 * The sequence ID is used by the driver for tracking multiple
54897 	 * commands. This ID is treated as opaque data by the firmware and
54898 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
54899 	 */
54900 	uint16_t	seq_id;
54901 	/*
54902 	 * The target ID of the command:
54903 	 * * 0x0-0xFFF8 - The function ID
54904 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54905 	 * * 0xFFFD - Reserved for user-space HWRM interface
54906 	 * * 0xFFFF - HWRM
54907 	 */
54908 	uint16_t	target_id;
54909 	/*
54910 	 * A physical address pointer pointing to a host buffer that the
54911 	 * command's response data will be written. This can be either a host
54912 	 * physical address (HPA) or a guest physical address (GPA) and must
54913 	 * point to a physically contiguous block of memory.
54914 	 */
54915 	uint64_t	resp_addr;
54916 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
54917 	uint32_t	fw_session_id;
54918 	/* Control flags. */
54919 	uint16_t	flags;
54920 	/* Indicates the flow direction. */
54921 	#define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR		UINT32_C(0x1)
54922 	/* If this bit set to 0, then it indicates rx flow. */
54923 		#define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_RX		UINT32_C(0x0)
54924 	/* If this bit is set to 1, then it indicates tx flow. */
54925 		#define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX		UINT32_C(0x1)
54926 		#define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_LAST	HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX
54927 	/*
54928 	 * When set use the special access register access to clear
54929 	 * the table entry on read.
54930 	 */
54931 	#define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_CLEAR_ON_READ	UINT32_C(0x2)
54932 	/* Specifies which block this idx table alloc request is for */
54933 	uint8_t	blktype;
54934 	/* CFA block type */
54935 	#define HWRM_TF_TBL_TYPE_GET_INPUT_BLKTYPE_BLKTYPE_CFA	UINT32_C(0x0)
54936 	/* RXP gparse block type */
54937 	#define HWRM_TF_TBL_TYPE_GET_INPUT_BLKTYPE_BLKTYPE_RXP	UINT32_C(0x1)
54938 	/* RE gparse block type */
54939 	#define HWRM_TF_TBL_TYPE_GET_INPUT_BLKTYPE_BLKTYPE_RE_GPARSE UINT32_C(0x2)
54940 	/* TE gparse block type */
54941 	#define HWRM_TF_TBL_TYPE_GET_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE UINT32_C(0x3)
54942 	#define HWRM_TF_TBL_TYPE_GET_INPUT_BLKTYPE_LAST		HWRM_TF_TBL_TYPE_GET_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE
54943 	/* unused. */
54944 	uint8_t	unused0;
54945 	/*
54946 	 * Type of the resource, defined globally in the
54947 	 * hwrm_tf_resc_type enum.
54948 	 */
54949 	uint32_t	type;
54950 	/* Index of the type to retrieve. */
54951 	uint32_t	index;
54952 } hwrm_tf_tbl_type_get_input_t, *phwrm_tf_tbl_type_get_input_t;
54953 
54954 /* hwrm_tf_tbl_type_get_output (size:2240b/280B) */
54955 
54956 typedef struct hwrm_tf_tbl_type_get_output {
54957 	/* The specific error status for the command. */
54958 	uint16_t	error_code;
54959 	/* The HWRM command request type. */
54960 	uint16_t	req_type;
54961 	/* The sequence ID from the original command. */
54962 	uint16_t	seq_id;
54963 	/* The length of the response data in number of bytes. */
54964 	uint16_t	resp_len;
54965 	/* Response code. */
54966 	uint32_t	resp_code;
54967 	/* Response size. */
54968 	uint16_t	size;
54969 	/* unused */
54970 	uint16_t	unused0;
54971 	/* Response data. */
54972 	uint8_t	data[256];
54973 	/* unused */
54974 	uint8_t	unused1[7];
54975 	/*
54976 	 * This field is used in Output records to indicate that the output
54977 	 * is completely written to RAM. This field should be read as '1'
54978 	 * to indicate that the output has been completely written.
54979 	 * When writing a command completion or response to an internal
54980 	 * processor, the order of writes has to be such that this field
54981 	 * is written last.
54982 	 */
54983 	uint8_t	valid;
54984 } hwrm_tf_tbl_type_get_output_t, *phwrm_tf_tbl_type_get_output_t;
54985 
54986 /************************
54987  * hwrm_tf_tbl_type_set *
54988  ************************/
54989 
54990 
54991 /* hwrm_tf_tbl_type_set_input (size:1024b/128B) */
54992 
54993 typedef struct hwrm_tf_tbl_type_set_input {
54994 	/* The HWRM command request type. */
54995 	uint16_t	req_type;
54996 	/*
54997 	 * The completion ring to send the completion event on. This should
54998 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
54999 	 */
55000 	uint16_t	cmpl_ring;
55001 	/*
55002 	 * The sequence ID is used by the driver for tracking multiple
55003 	 * commands. This ID is treated as opaque data by the firmware and
55004 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55005 	 */
55006 	uint16_t	seq_id;
55007 	/*
55008 	 * The target ID of the command:
55009 	 * * 0x0-0xFFF8 - The function ID
55010 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55011 	 * * 0xFFFD - Reserved for user-space HWRM interface
55012 	 * * 0xFFFF - HWRM
55013 	 */
55014 	uint16_t	target_id;
55015 	/*
55016 	 * A physical address pointer pointing to a host buffer that the
55017 	 * command's response data will be written. This can be either a host
55018 	 * physical address (HPA) or a guest physical address (GPA) and must
55019 	 * point to a physically contiguous block of memory.
55020 	 */
55021 	uint64_t	resp_addr;
55022 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
55023 	uint32_t	fw_session_id;
55024 	/* Control flags. */
55025 	uint16_t	flags;
55026 	/* Indicates the flow direction. */
55027 	#define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
55028 	/* If this bit set to 0, then it indicates rx flow. */
55029 		#define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
55030 	/* If this bit is set to 1, then it indicates tx flow. */
55031 		#define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
55032 		#define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX
55033 	/* Indicate table data is being sent via DMA. */
55034 	#define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
55035 	/* Specifies which block this idx table alloc request is for */
55036 	uint8_t	blktype;
55037 	/* CFA block type */
55038 	#define HWRM_TF_TBL_TYPE_SET_INPUT_BLKTYPE_BLKTYPE_CFA	UINT32_C(0x0)
55039 	/* RXP gparse block type */
55040 	#define HWRM_TF_TBL_TYPE_SET_INPUT_BLKTYPE_BLKTYPE_RXP	UINT32_C(0x1)
55041 	/* RE gparse block type */
55042 	#define HWRM_TF_TBL_TYPE_SET_INPUT_BLKTYPE_BLKTYPE_RE_GPARSE UINT32_C(0x2)
55043 	/* TE gparse block type */
55044 	#define HWRM_TF_TBL_TYPE_SET_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE UINT32_C(0x3)
55045 	#define HWRM_TF_TBL_TYPE_SET_INPUT_BLKTYPE_LAST		HWRM_TF_TBL_TYPE_SET_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE
55046 	/* unused. */
55047 	uint8_t	unused0;
55048 	/*
55049 	 * Type of the resource, defined globally in the
55050 	 * hwrm_tf_resc_type enum.
55051 	 */
55052 	uint32_t	type;
55053 	/* Index of the type to retrieve. */
55054 	uint32_t	index;
55055 	/* Size of the data to set. */
55056 	uint16_t	size;
55057 	/* unused */
55058 	uint8_t	unused1[6];
55059 	/* Data to be set. */
55060 	uint8_t	data[88];
55061 } hwrm_tf_tbl_type_set_input_t, *phwrm_tf_tbl_type_set_input_t;
55062 
55063 /* hwrm_tf_tbl_type_set_output (size:128b/16B) */
55064 
55065 typedef struct hwrm_tf_tbl_type_set_output {
55066 	/* The specific error status for the command. */
55067 	uint16_t	error_code;
55068 	/* The HWRM command request type. */
55069 	uint16_t	req_type;
55070 	/* The sequence ID from the original command. */
55071 	uint16_t	seq_id;
55072 	/* The length of the response data in number of bytes. */
55073 	uint16_t	resp_len;
55074 	/* unused. */
55075 	uint8_t	unused0[7];
55076 	/*
55077 	 * This field is used in Output records to indicate that the output
55078 	 * is completely written to RAM. This field should be read as '1'
55079 	 * to indicate that the output has been completely written.
55080 	 * When writing a command completion or response to an internal
55081 	 * processor, the order of writes has to be such that this field
55082 	 * is written last.
55083 	 */
55084 	uint8_t	valid;
55085 } hwrm_tf_tbl_type_set_output_t, *phwrm_tf_tbl_type_set_output_t;
55086 
55087 /*************************
55088  * hwrm_tf_tbl_type_free *
55089  *************************/
55090 
55091 
55092 /* hwrm_tf_tbl_type_free_input (size:256b/32B) */
55093 
55094 typedef struct hwrm_tf_tbl_type_free_input {
55095 	/* The HWRM command request type. */
55096 	uint16_t	req_type;
55097 	/*
55098 	 * The completion ring to send the completion event on. This should
55099 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55100 	 */
55101 	uint16_t	cmpl_ring;
55102 	/*
55103 	 * The sequence ID is used by the driver for tracking multiple
55104 	 * commands. This ID is treated as opaque data by the firmware and
55105 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55106 	 */
55107 	uint16_t	seq_id;
55108 	/*
55109 	 * The target ID of the command:
55110 	 * * 0x0-0xFFF8 - The function ID
55111 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55112 	 * * 0xFFFD - Reserved for user-space HWRM interface
55113 	 * * 0xFFFF - HWRM
55114 	 */
55115 	uint16_t	target_id;
55116 	/*
55117 	 * A physical address pointer pointing to a host buffer that the
55118 	 * command's response data will be written. This can be either a host
55119 	 * physical address (HPA) or a guest physical address (GPA) and must
55120 	 * point to a physically contiguous block of memory.
55121 	 */
55122 	uint64_t	resp_addr;
55123 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
55124 	uint32_t	fw_session_id;
55125 	/* Control flags. */
55126 	uint16_t	flags;
55127 	/* Indicates the flow direction. */
55128 	#define HWRM_TF_TBL_TYPE_FREE_INPUT_FLAGS_DIR	UINT32_C(0x1)
55129 	/* If this bit set to 0, then it indicates rx flow. */
55130 		#define HWRM_TF_TBL_TYPE_FREE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
55131 	/* If this bit is set to 1, then it indicates tx flow. */
55132 		#define HWRM_TF_TBL_TYPE_FREE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
55133 		#define HWRM_TF_TBL_TYPE_FREE_INPUT_FLAGS_DIR_LAST HWRM_TF_TBL_TYPE_FREE_INPUT_FLAGS_DIR_TX
55134 	/* Specifies which block this idx table alloc request is for */
55135 	uint8_t	blktype;
55136 	/* CFA block type */
55137 	#define HWRM_TF_TBL_TYPE_FREE_INPUT_BLKTYPE_BLKTYPE_CFA	UINT32_C(0x0)
55138 	/* RXP gparse block type */
55139 	#define HWRM_TF_TBL_TYPE_FREE_INPUT_BLKTYPE_BLKTYPE_RXP	UINT32_C(0x1)
55140 	/* RE gparse block type */
55141 	#define HWRM_TF_TBL_TYPE_FREE_INPUT_BLKTYPE_BLKTYPE_RE_GPARSE UINT32_C(0x2)
55142 	/* TE gparse block type */
55143 	#define HWRM_TF_TBL_TYPE_FREE_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE UINT32_C(0x3)
55144 	#define HWRM_TF_TBL_TYPE_FREE_INPUT_BLKTYPE_LAST		HWRM_TF_TBL_TYPE_FREE_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE
55145 	/* Unused */
55146 	uint8_t	unused0;
55147 	/*
55148 	 * Table entry to be freed by the firmware using the parameters
55149 	 * above.
55150 	 */
55151 	uint16_t	idx_tbl_id;
55152 	/* Unused */
55153 	uint8_t	unused1[6];
55154 } hwrm_tf_tbl_type_free_input_t, *phwrm_tf_tbl_type_free_input_t;
55155 
55156 /* hwrm_tf_tbl_type_free_output (size:128b/16B) */
55157 
55158 typedef struct hwrm_tf_tbl_type_free_output {
55159 	/* The specific error status for the command. */
55160 	uint16_t	error_code;
55161 	/* The HWRM command request type. */
55162 	uint16_t	req_type;
55163 	/* The sequence ID from the original command. */
55164 	uint16_t	seq_id;
55165 	/* The length of the response data in number of bytes. */
55166 	uint16_t	resp_len;
55167 	/* Response code. */
55168 	uint32_t	resp_code;
55169 	/* unused */
55170 	uint8_t	unused0[3];
55171 	/*
55172 	 * This field is used in Output records to indicate that the output
55173 	 * is completely written to RAM. This field should be read as '1'
55174 	 * to indicate that the output has been completely written.
55175 	 * When writing a command completion or response to an internal
55176 	 * processor, the order of writes has to be such that this field
55177 	 * is written last.
55178 	 */
55179 	uint8_t	valid;
55180 } hwrm_tf_tbl_type_free_output_t, *phwrm_tf_tbl_type_free_output_t;
55181 
55182 /*********************
55183  * hwrm_tf_em_insert *
55184  *********************/
55185 
55186 
55187 /* hwrm_tf_em_insert_input (size:832b/104B) */
55188 
55189 typedef struct hwrm_tf_em_insert_input {
55190 	/* The HWRM command request type. */
55191 	uint16_t	req_type;
55192 	/*
55193 	 * The completion ring to send the completion event on. This should
55194 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55195 	 */
55196 	uint16_t	cmpl_ring;
55197 	/*
55198 	 * The sequence ID is used by the driver for tracking multiple
55199 	 * commands. This ID is treated as opaque data by the firmware and
55200 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55201 	 */
55202 	uint16_t	seq_id;
55203 	/*
55204 	 * The target ID of the command:
55205 	 * * 0x0-0xFFF8 - The function ID
55206 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55207 	 * * 0xFFFD - Reserved for user-space HWRM interface
55208 	 * * 0xFFFF - HWRM
55209 	 */
55210 	uint16_t	target_id;
55211 	/*
55212 	 * A physical address pointer pointing to a host buffer that the
55213 	 * command's response data will be written. This can be either a host
55214 	 * physical address (HPA) or a guest physical address (GPA) and must
55215 	 * point to a physically contiguous block of memory.
55216 	 */
55217 	uint64_t	resp_addr;
55218 	/* Firmware Session Id. */
55219 	uint32_t	fw_session_id;
55220 	/* Control Flags. */
55221 	uint16_t	flags;
55222 	/* Indicates the flow direction. */
55223 	#define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR	UINT32_C(0x1)
55224 	/* If this bit set to 0, then it indicates rx flow. */
55225 		#define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
55226 	/* If this bit is set to 1, then it indicates tx flow. */
55227 		#define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
55228 		#define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_LAST HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX
55229 	/* Reported match strength. */
55230 	uint16_t	strength;
55231 	/* Index to action. */
55232 	uint32_t	action_ptr;
55233 	/* Index of EM record. */
55234 	uint32_t	em_record_idx;
55235 	/* EM Key value. */
55236 	uint64_t	em_key[8];
55237 	/* Number of bits in em_key. */
55238 	uint16_t	em_key_bitlen;
55239 	/* unused. */
55240 	uint16_t	unused0[3];
55241 } hwrm_tf_em_insert_input_t, *phwrm_tf_em_insert_input_t;
55242 
55243 /* hwrm_tf_em_insert_output (size:128b/16B) */
55244 
55245 typedef struct hwrm_tf_em_insert_output {
55246 	/* The specific error status for the command. */
55247 	uint16_t	error_code;
55248 	/* The HWRM command request type. */
55249 	uint16_t	req_type;
55250 	/* The sequence ID from the original command. */
55251 	uint16_t	seq_id;
55252 	/* The length of the response data in number of bytes. */
55253 	uint16_t	resp_len;
55254 	/* EM record pointer index. */
55255 	uint16_t	rptr_index;
55256 	/* EM record offset 0~3. */
55257 	uint8_t	rptr_entry;
55258 	/* Number of word entries consumed by the key. */
55259 	uint8_t	num_of_entries;
55260 	/* unused. */
55261 	uint8_t	unused0[3];
55262 	/*
55263 	 * This field is used in Output records to indicate that the output
55264 	 * is completely written to RAM. This field should be read as '1'
55265 	 * to indicate that the output has been completely written.
55266 	 * When writing a command completion or response to an internal
55267 	 * processor, the order of writes has to be such that this field
55268 	 * is written last.
55269 	 */
55270 	uint8_t	valid;
55271 } hwrm_tf_em_insert_output_t, *phwrm_tf_em_insert_output_t;
55272 
55273 /**************************
55274  * hwrm_tf_em_hash_insert *
55275  **************************/
55276 
55277 
55278 /* hwrm_tf_em_hash_insert_input (size:1024b/128B) */
55279 
55280 typedef struct hwrm_tf_em_hash_insert_input {
55281 	/* The HWRM command request type. */
55282 	uint16_t	req_type;
55283 	/*
55284 	 * The completion ring to send the completion event on. This should
55285 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55286 	 */
55287 	uint16_t	cmpl_ring;
55288 	/*
55289 	 * The sequence ID is used by the driver for tracking multiple
55290 	 * commands. This ID is treated as opaque data by the firmware and
55291 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55292 	 */
55293 	uint16_t	seq_id;
55294 	/*
55295 	 * The target ID of the command:
55296 	 * * 0x0-0xFFF8 - The function ID
55297 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55298 	 * * 0xFFFD - Reserved for user-space HWRM interface
55299 	 * * 0xFFFF - HWRM
55300 	 */
55301 	uint16_t	target_id;
55302 	/*
55303 	 * A physical address pointer pointing to a host buffer that the
55304 	 * command's response data will be written. This can be either a host
55305 	 * physical address (HPA) or a guest physical address (GPA) and must
55306 	 * point to a physically contiguous block of memory.
55307 	 */
55308 	uint64_t	resp_addr;
55309 	/* Firmware Session Id. */
55310 	uint32_t	fw_session_id;
55311 	/* Control Flags. */
55312 	uint16_t	flags;
55313 	/* Indicates the flow direction. */
55314 	#define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR	UINT32_C(0x1)
55315 	/* If this bit set to 0, then it indicates rx flow. */
55316 		#define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
55317 	/* If this bit is set to 1, then it indicates tx flow. */
55318 		#define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
55319 		#define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_LAST HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_TX
55320 	/* Indicates table data is being sent via DMA. */
55321 	#define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DMA	UINT32_C(0x2)
55322 	/* Number of bits in the EM record. */
55323 	uint16_t	em_record_size_bits;
55324 	/* CRC32 hash of key. */
55325 	uint32_t	key0_hash;
55326 	/* Lookup3 hash of key. */
55327 	uint32_t	key1_hash;
55328 	/* Index of EM record. */
55329 	uint32_t	em_record_idx;
55330 	/* Unused. */
55331 	uint32_t	unused0;
55332 	/* EM record. */
55333 	uint64_t	em_record[11];
55334 } hwrm_tf_em_hash_insert_input_t, *phwrm_tf_em_hash_insert_input_t;
55335 
55336 /* hwrm_tf_em_hash_insert_output (size:128b/16B) */
55337 
55338 typedef struct hwrm_tf_em_hash_insert_output {
55339 	/* The specific error status for the command. */
55340 	uint16_t	error_code;
55341 	/* The HWRM command request type. */
55342 	uint16_t	req_type;
55343 	/* The sequence ID from the original command. */
55344 	uint16_t	seq_id;
55345 	/* The length of the response data in number of bytes. */
55346 	uint16_t	resp_len;
55347 	/* EM record pointer index. */
55348 	uint16_t	rptr_index;
55349 	/* EM record offset 0~3. */
55350 	uint8_t	rptr_entry;
55351 	/* Number of word entries consumed by the key. */
55352 	uint8_t	num_of_entries;
55353 	/* unused. */
55354 	uint8_t	unused0[3];
55355 	/*
55356 	 * This field is used in Output records to indicate that the output
55357 	 * is completely written to RAM. This field should be read as '1'
55358 	 * to indicate that the output has been completely written.
55359 	 * When writing a command completion or response to an internal
55360 	 * processor, the order of writes has to be such that this field
55361 	 * is written last.
55362 	 */
55363 	uint8_t	valid;
55364 } hwrm_tf_em_hash_insert_output_t, *phwrm_tf_em_hash_insert_output_t;
55365 
55366 /*********************
55367  * hwrm_tf_em_delete *
55368  *********************/
55369 
55370 
55371 /* hwrm_tf_em_delete_input (size:832b/104B) */
55372 
55373 typedef struct hwrm_tf_em_delete_input {
55374 	/* The HWRM command request type. */
55375 	uint16_t	req_type;
55376 	/*
55377 	 * The completion ring to send the completion event on. This should
55378 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55379 	 */
55380 	uint16_t	cmpl_ring;
55381 	/*
55382 	 * The sequence ID is used by the driver for tracking multiple
55383 	 * commands. This ID is treated as opaque data by the firmware and
55384 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55385 	 */
55386 	uint16_t	seq_id;
55387 	/*
55388 	 * The target ID of the command:
55389 	 * * 0x0-0xFFF8 - The function ID
55390 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55391 	 * * 0xFFFD - Reserved for user-space HWRM interface
55392 	 * * 0xFFFF - HWRM
55393 	 */
55394 	uint16_t	target_id;
55395 	/*
55396 	 * A physical address pointer pointing to a host buffer that the
55397 	 * command's response data will be written. This can be either a host
55398 	 * physical address (HPA) or a guest physical address (GPA) and must
55399 	 * point to a physically contiguous block of memory.
55400 	 */
55401 	uint64_t	resp_addr;
55402 	/* Session Id. */
55403 	uint32_t	fw_session_id;
55404 	/* Control flags. */
55405 	uint16_t	flags;
55406 	/* Indicates the flow direction. */
55407 	#define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR	UINT32_C(0x1)
55408 	/* If this bit set to 0, then it indicates rx flow. */
55409 		#define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
55410 	/* If this bit is set to 1, then it indicates tx flow. */
55411 		#define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
55412 		#define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_LAST HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_TX
55413 	/* Unused0 */
55414 	uint16_t	unused0;
55415 	/* EM internal flow handle. */
55416 	uint64_t	flow_handle;
55417 	/* EM Key value */
55418 	uint64_t	em_key[8];
55419 	/* Number of bits in em_key. */
55420 	uint16_t	em_key_bitlen;
55421 	/* unused. */
55422 	uint16_t	unused1[3];
55423 } hwrm_tf_em_delete_input_t, *phwrm_tf_em_delete_input_t;
55424 
55425 /* hwrm_tf_em_delete_output (size:128b/16B) */
55426 
55427 typedef struct hwrm_tf_em_delete_output {
55428 	/* The specific error status for the command. */
55429 	uint16_t	error_code;
55430 	/* The HWRM command request type. */
55431 	uint16_t	req_type;
55432 	/* The sequence ID from the original command. */
55433 	uint16_t	seq_id;
55434 	/* The length of the response data in number of bytes. */
55435 	uint16_t	resp_len;
55436 	/* Original stack allocation index. */
55437 	uint16_t	em_index;
55438 	/* unused. */
55439 	uint8_t	unused0[5];
55440 	/*
55441 	 * This field is used in Output records to indicate that the output
55442 	 * is completely written to RAM. This field should be read as '1'
55443 	 * to indicate that the output has been completely written.
55444 	 * When writing a command completion or response to an internal
55445 	 * processor, the order of writes has to be such that this field
55446 	 * is written last.
55447 	 */
55448 	uint8_t	valid;
55449 } hwrm_tf_em_delete_output_t, *phwrm_tf_em_delete_output_t;
55450 
55451 /*******************
55452  * hwrm_tf_em_move *
55453  *******************/
55454 
55455 
55456 /* hwrm_tf_em_move_input (size:320b/40B) */
55457 
55458 typedef struct hwrm_tf_em_move_input {
55459 	/* The HWRM command request type. */
55460 	uint16_t	req_type;
55461 	/*
55462 	 * The completion ring to send the completion event on. This should
55463 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55464 	 */
55465 	uint16_t	cmpl_ring;
55466 	/*
55467 	 * The sequence ID is used by the driver for tracking multiple
55468 	 * commands. This ID is treated as opaque data by the firmware and
55469 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55470 	 */
55471 	uint16_t	seq_id;
55472 	/*
55473 	 * The target ID of the command:
55474 	 * * 0x0-0xFFF8 - The function ID
55475 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55476 	 * * 0xFFFD - Reserved for user-space HWRM interface
55477 	 * * 0xFFFF - HWRM
55478 	 */
55479 	uint16_t	target_id;
55480 	/*
55481 	 * A physical address pointer pointing to a host buffer that the
55482 	 * command's response data will be written. This can be either a host
55483 	 * physical address (HPA) or a guest physical address (GPA) and must
55484 	 * point to a physically contiguous block of memory.
55485 	 */
55486 	uint64_t	resp_addr;
55487 	/* Session Id. */
55488 	uint32_t	fw_session_id;
55489 	/* Control flags. */
55490 	uint16_t	flags;
55491 	/* Indicates the flow direction. */
55492 	#define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR	UINT32_C(0x1)
55493 	/* If this bit set to 0, then it indicates rx flow. */
55494 		#define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
55495 	/* If this bit is set to 1, then it indicates tx flow. */
55496 		#define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
55497 		#define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_LAST HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_TX
55498 	/* Number of EM entry blocks */
55499 	uint16_t	num_blocks;
55500 	/* New index for entry */
55501 	uint32_t	new_index;
55502 	/* Unused */
55503 	uint32_t	unused0;
55504 	/* EM internal flow handle. */
55505 	uint64_t	flow_handle;
55506 } hwrm_tf_em_move_input_t, *phwrm_tf_em_move_input_t;
55507 
55508 /* hwrm_tf_em_move_output (size:128b/16B) */
55509 
55510 typedef struct hwrm_tf_em_move_output {
55511 	/* The specific error status for the command. */
55512 	uint16_t	error_code;
55513 	/* The HWRM command request type. */
55514 	uint16_t	req_type;
55515 	/* The sequence ID from the original command. */
55516 	uint16_t	seq_id;
55517 	/* The length of the response data in number of bytes. */
55518 	uint16_t	resp_len;
55519 	/* Index of old entry. */
55520 	uint16_t	em_index;
55521 	/* unused. */
55522 	uint8_t	unused0[5];
55523 	/*
55524 	 * This field is used in Output records to indicate that the output
55525 	 * is completely written to RAM. This field should be read as '1'
55526 	 * to indicate that the output has been completely written.
55527 	 * When writing a command completion or response to an internal
55528 	 * processor, the order of writes has to be such that this field
55529 	 * is written last.
55530 	 */
55531 	uint8_t	valid;
55532 } hwrm_tf_em_move_output_t, *phwrm_tf_em_move_output_t;
55533 
55534 /********************
55535  * hwrm_tf_tcam_set *
55536  ********************/
55537 
55538 
55539 /* hwrm_tf_tcam_set_input (size:1024b/128B) */
55540 
55541 typedef struct hwrm_tf_tcam_set_input {
55542 	/* The HWRM command request type. */
55543 	uint16_t	req_type;
55544 	/*
55545 	 * The completion ring to send the completion event on. This should
55546 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55547 	 */
55548 	uint16_t	cmpl_ring;
55549 	/*
55550 	 * The sequence ID is used by the driver for tracking multiple
55551 	 * commands. This ID is treated as opaque data by the firmware and
55552 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55553 	 */
55554 	uint16_t	seq_id;
55555 	/*
55556 	 * The target ID of the command:
55557 	 * * 0x0-0xFFF8 - The function ID
55558 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55559 	 * * 0xFFFD - Reserved for user-space HWRM interface
55560 	 * * 0xFFFF - HWRM
55561 	 */
55562 	uint16_t	target_id;
55563 	/*
55564 	 * A physical address pointer pointing to a host buffer that the
55565 	 * command's response data will be written. This can be either a host
55566 	 * physical address (HPA) or a guest physical address (GPA) and must
55567 	 * point to a physically contiguous block of memory.
55568 	 */
55569 	uint64_t	resp_addr;
55570 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
55571 	uint32_t	fw_session_id;
55572 	/* Control flags. */
55573 	uint32_t	flags;
55574 	/* Indicates the flow direction. */
55575 	#define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
55576 	/* If this bit set to 0, then it indicates rx flow. */
55577 		#define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
55578 	/* If this bit is set to 1, then it indicates tx flow. */
55579 		#define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
55580 		#define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_TX
55581 	/*
55582 	 * Indicate device data is being sent via DMA, the device
55583 	 * data is packing does not change.
55584 	 */
55585 	#define HWRM_TF_TCAM_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
55586 	/*
55587 	 * TCAM type of the resource, defined globally in the
55588 	 * hwrm_tf_resc_type enum.
55589 	 */
55590 	uint32_t	type;
55591 	/* Index of TCAM entry. */
55592 	uint16_t	idx;
55593 	/* Number of bytes in the TCAM key. */
55594 	uint8_t	key_size;
55595 	/* Number of bytes in the TCAM result. */
55596 	uint8_t	result_size;
55597 	/*
55598 	 * Offset from which the mask bytes start in the device data
55599 	 * array, key offset is always 0.
55600 	 */
55601 	uint8_t	mask_offset;
55602 	/* Offset from which the result bytes start in the device data array. */
55603 	uint8_t	result_offset;
55604 	/* unused. */
55605 	uint8_t	unused0[6];
55606 	/*
55607 	 * TCAM key located at offset 0, mask located at mask_offset
55608 	 * and result at result_offset for the device.
55609 	 */
55610 	uint8_t	dev_data[88];
55611 } hwrm_tf_tcam_set_input_t, *phwrm_tf_tcam_set_input_t;
55612 
55613 /* hwrm_tf_tcam_set_output (size:128b/16B) */
55614 
55615 typedef struct hwrm_tf_tcam_set_output {
55616 	/* The specific error status for the command. */
55617 	uint16_t	error_code;
55618 	/* The HWRM command request type. */
55619 	uint16_t	req_type;
55620 	/* The sequence ID from the original command. */
55621 	uint16_t	seq_id;
55622 	/* The length of the response data in number of bytes. */
55623 	uint16_t	resp_len;
55624 	/* unused. */
55625 	uint8_t	unused0[7];
55626 	/*
55627 	 * This field is used in Output records to indicate that the
55628 	 * output is completely written to RAM. This field should be
55629 	 * read as '1' to indicate that the output has been
55630 	 * completely written. When writing a command completion or
55631 	 * response to an internal processor, the order of writes has
55632 	 * to be such that this field is written last.
55633 	 */
55634 	uint8_t	valid;
55635 } hwrm_tf_tcam_set_output_t, *phwrm_tf_tcam_set_output_t;
55636 
55637 /********************
55638  * hwrm_tf_tcam_get *
55639  ********************/
55640 
55641 
55642 /* hwrm_tf_tcam_get_input (size:256b/32B) */
55643 
55644 typedef struct hwrm_tf_tcam_get_input {
55645 	/* The HWRM command request type. */
55646 	uint16_t	req_type;
55647 	/*
55648 	 * The completion ring to send the completion event on. This should
55649 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55650 	 */
55651 	uint16_t	cmpl_ring;
55652 	/*
55653 	 * The sequence ID is used by the driver for tracking multiple
55654 	 * commands. This ID is treated as opaque data by the firmware and
55655 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55656 	 */
55657 	uint16_t	seq_id;
55658 	/*
55659 	 * The target ID of the command:
55660 	 * * 0x0-0xFFF8 - The function ID
55661 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55662 	 * * 0xFFFD - Reserved for user-space HWRM interface
55663 	 * * 0xFFFF - HWRM
55664 	 */
55665 	uint16_t	target_id;
55666 	/*
55667 	 * A physical address pointer pointing to a host buffer that the
55668 	 * command's response data will be written. This can be either a host
55669 	 * physical address (HPA) or a guest physical address (GPA) and must
55670 	 * point to a physically contiguous block of memory.
55671 	 */
55672 	uint64_t	resp_addr;
55673 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
55674 	uint32_t	fw_session_id;
55675 	/* Control flags. */
55676 	uint32_t	flags;
55677 	/* Indicates the flow direction. */
55678 	#define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR	UINT32_C(0x1)
55679 	/* If this bit set to 0, then it indicates rx flow. */
55680 		#define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
55681 	/* If this bit is set to 1, then it indicates tx flow. */
55682 		#define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
55683 		#define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_TX
55684 	/*
55685 	 * TCAM type of the resource, defined globally in the
55686 	 * hwrm_tf_resc_type enum.
55687 	 */
55688 	uint32_t	type;
55689 	/* Index of a TCAM entry. */
55690 	uint16_t	idx;
55691 	/* unused. */
55692 	uint16_t	unused0;
55693 } hwrm_tf_tcam_get_input_t, *phwrm_tf_tcam_get_input_t;
55694 
55695 /* hwrm_tf_tcam_get_output (size:2368b/296B) */
55696 
55697 typedef struct hwrm_tf_tcam_get_output {
55698 	/* The specific error status for the command. */
55699 	uint16_t	error_code;
55700 	/* The HWRM command request type. */
55701 	uint16_t	req_type;
55702 	/* The sequence ID from the original command. */
55703 	uint16_t	seq_id;
55704 	/* The length of the response data in number of bytes. */
55705 	uint16_t	resp_len;
55706 	/* Number of bytes in the TCAM key. */
55707 	uint8_t	key_size;
55708 	/* Number of bytes in the TCAM entry. */
55709 	uint8_t	result_size;
55710 	/* Offset from which the mask bytes start in the device data array. */
55711 	uint8_t	mask_offset;
55712 	/* Offset from which the result bytes start in the device data array. */
55713 	uint8_t	result_offset;
55714 	/* unused. */
55715 	uint8_t	unused0[4];
55716 	/*
55717 	 * TCAM key located at offset 0, mask located at mask_offset
55718 	 * and result at result_offset for the device.
55719 	 */
55720 	uint8_t	dev_data[272];
55721 	/* unused. */
55722 	uint8_t	unused1[7];
55723 	/*
55724 	 * This field is used in Output records to indicate that the
55725 	 * output is completely written to RAM. This field should be
55726 	 * read as '1' to indicate that the output has been
55727 	 * completely written. When writing a command completion or
55728 	 * response to an internal processor, the order of writes has
55729 	 * to be such that this field is written last.
55730 	 */
55731 	uint8_t	valid;
55732 } hwrm_tf_tcam_get_output_t, *phwrm_tf_tcam_get_output_t;
55733 
55734 /*********************
55735  * hwrm_tf_tcam_move *
55736  *********************/
55737 
55738 
55739 /* hwrm_tf_tcam_move_input (size:1024b/128B) */
55740 
55741 typedef struct hwrm_tf_tcam_move_input {
55742 	/* The HWRM command request type. */
55743 	uint16_t	req_type;
55744 	/*
55745 	 * The completion ring to send the completion event on. This should
55746 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55747 	 */
55748 	uint16_t	cmpl_ring;
55749 	/*
55750 	 * The sequence ID is used by the driver for tracking multiple
55751 	 * commands. This ID is treated as opaque data by the firmware and
55752 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55753 	 */
55754 	uint16_t	seq_id;
55755 	/*
55756 	 * The target ID of the command:
55757 	 * * 0x0-0xFFF8 - The function ID
55758 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55759 	 * * 0xFFFD - Reserved for user-space HWRM interface
55760 	 * * 0xFFFF - HWRM
55761 	 */
55762 	uint16_t	target_id;
55763 	/*
55764 	 * A physical address pointer pointing to a host buffer that the
55765 	 * command's response data will be written. This can be either a host
55766 	 * physical address (HPA) or a guest physical address (GPA) and must
55767 	 * point to a physically contiguous block of memory.
55768 	 */
55769 	uint64_t	resp_addr;
55770 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
55771 	uint32_t	fw_session_id;
55772 	/* Control flags. */
55773 	uint32_t	flags;
55774 	/* Indicates the flow direction. */
55775 	#define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR	UINT32_C(0x1)
55776 	/* If this bit set to 0, then it indicates rx flow. */
55777 		#define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
55778 	/* If this bit is set to 1, then it indicates tx flow. */
55779 		#define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
55780 		#define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_LAST HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_TX
55781 	/*
55782 	 * TCAM type of the resource, defined globally in the
55783 	 * hwrm_tf_resc_type enum.
55784 	 */
55785 	uint32_t	type;
55786 	/* Number of TCAM index pairs to be swapped for the device. */
55787 	uint16_t	count;
55788 	/* unused. */
55789 	uint16_t	unused0;
55790 	/* TCAM index pairs to be swapped for the device. */
55791 	uint16_t	idx_pairs[48];
55792 } hwrm_tf_tcam_move_input_t, *phwrm_tf_tcam_move_input_t;
55793 
55794 /* hwrm_tf_tcam_move_output (size:128b/16B) */
55795 
55796 typedef struct hwrm_tf_tcam_move_output {
55797 	/* The specific error status for the command. */
55798 	uint16_t	error_code;
55799 	/* The HWRM command request type. */
55800 	uint16_t	req_type;
55801 	/* The sequence ID from the original command. */
55802 	uint16_t	seq_id;
55803 	/* The length of the response data in number of bytes. */
55804 	uint16_t	resp_len;
55805 	/* unused. */
55806 	uint8_t	unused0[7];
55807 	/*
55808 	 * This field is used in Output records to indicate that the
55809 	 * output is completely written to RAM. This field should be
55810 	 * read as '1' to indicate that the output has been
55811 	 * completely written. When writing a command completion or
55812 	 * response to an internal processor, the order of writes has
55813 	 * to be such that this field is written last.
55814 	 */
55815 	uint8_t	valid;
55816 } hwrm_tf_tcam_move_output_t, *phwrm_tf_tcam_move_output_t;
55817 
55818 /*********************
55819  * hwrm_tf_tcam_free *
55820  *********************/
55821 
55822 
55823 /* hwrm_tf_tcam_free_input (size:1024b/128B) */
55824 
55825 typedef struct hwrm_tf_tcam_free_input {
55826 	/* The HWRM command request type. */
55827 	uint16_t	req_type;
55828 	/*
55829 	 * The completion ring to send the completion event on. This should
55830 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55831 	 */
55832 	uint16_t	cmpl_ring;
55833 	/*
55834 	 * The sequence ID is used by the driver for tracking multiple
55835 	 * commands. This ID is treated as opaque data by the firmware and
55836 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55837 	 */
55838 	uint16_t	seq_id;
55839 	/*
55840 	 * The target ID of the command:
55841 	 * * 0x0-0xFFF8 - The function ID
55842 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55843 	 * * 0xFFFD - Reserved for user-space HWRM interface
55844 	 * * 0xFFFF - HWRM
55845 	 */
55846 	uint16_t	target_id;
55847 	/*
55848 	 * A physical address pointer pointing to a host buffer that the
55849 	 * command's response data will be written. This can be either a host
55850 	 * physical address (HPA) or a guest physical address (GPA) and must
55851 	 * point to a physically contiguous block of memory.
55852 	 */
55853 	uint64_t	resp_addr;
55854 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
55855 	uint32_t	fw_session_id;
55856 	/* Control flags. */
55857 	uint32_t	flags;
55858 	/* Indicates the flow direction. */
55859 	#define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR	UINT32_C(0x1)
55860 	/* If this bit set to 0, then it indicates rx flow. */
55861 		#define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
55862 	/* If this bit is set to 1, then it indicates tx flow. */
55863 		#define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
55864 		#define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_LAST HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_TX
55865 	/*
55866 	 * TCAM type of the resource, defined globally in the
55867 	 * hwrm_tf_resc_type enum.
55868 	 */
55869 	uint32_t	type;
55870 	/* Number of TCAM index to be deleted for the device. */
55871 	uint16_t	count;
55872 	/* unused. */
55873 	uint16_t	unused0;
55874 	/* TCAM index list to be deleted for the device. */
55875 	uint16_t	idx_list[48];
55876 } hwrm_tf_tcam_free_input_t, *phwrm_tf_tcam_free_input_t;
55877 
55878 /* hwrm_tf_tcam_free_output (size:128b/16B) */
55879 
55880 typedef struct hwrm_tf_tcam_free_output {
55881 	/* The specific error status for the command. */
55882 	uint16_t	error_code;
55883 	/* The HWRM command request type. */
55884 	uint16_t	req_type;
55885 	/* The sequence ID from the original command. */
55886 	uint16_t	seq_id;
55887 	/* The length of the response data in number of bytes. */
55888 	uint16_t	resp_len;
55889 	/* unused. */
55890 	uint8_t	unused0[7];
55891 	/*
55892 	 * This field is used in Output records to indicate that the
55893 	 * output is completely written to RAM. This field should be
55894 	 * read as '1' to indicate that the output has been
55895 	 * completely written. When writing a command completion or
55896 	 * response to an internal processor, the order of writes has
55897 	 * to be such that this field is written last.
55898 	 */
55899 	uint8_t	valid;
55900 } hwrm_tf_tcam_free_output_t, *phwrm_tf_tcam_free_output_t;
55901 
55902 /**************************
55903  * hwrm_tf_global_cfg_set *
55904  **************************/
55905 
55906 
55907 /* hwrm_tf_global_cfg_set_input (size:448b/56B) */
55908 
55909 typedef struct hwrm_tf_global_cfg_set_input {
55910 	/* The HWRM command request type. */
55911 	uint16_t	req_type;
55912 	/*
55913 	 * The completion ring to send the completion event on. This should
55914 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
55915 	 */
55916 	uint16_t	cmpl_ring;
55917 	/*
55918 	 * The sequence ID is used by the driver for tracking multiple
55919 	 * commands. This ID is treated as opaque data by the firmware and
55920 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
55921 	 */
55922 	uint16_t	seq_id;
55923 	/*
55924 	 * The target ID of the command:
55925 	 * * 0x0-0xFFF8 - The function ID
55926 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55927 	 * * 0xFFFD - Reserved for user-space HWRM interface
55928 	 * * 0xFFFF - HWRM
55929 	 */
55930 	uint16_t	target_id;
55931 	/*
55932 	 * A physical address pointer pointing to a host buffer that the
55933 	 * command's response data will be written. This can be either a host
55934 	 * physical address (HPA) or a guest physical address (GPA) and must
55935 	 * point to a physically contiguous block of memory.
55936 	 */
55937 	uint64_t	resp_addr;
55938 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
55939 	uint32_t	fw_session_id;
55940 	/* Control flags. */
55941 	uint32_t	flags;
55942 	/* Indicates the flow direction. */
55943 	#define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
55944 	/* If this bit set to 0, then it indicates rx flow. */
55945 		#define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
55946 	/* If this bit is set to 1, then it indicates tx flow. */
55947 		#define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
55948 		#define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_TX
55949 	/* Indicate device data is being sent via DMA. */
55950 	#define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
55951 	/* Global Cfg type */
55952 	uint32_t	type;
55953 	/* Offset of the type */
55954 	uint32_t	offset;
55955 	/* Size of the data to set in bytes */
55956 	uint16_t	size;
55957 	/* unused. */
55958 	uint8_t	unused0[6];
55959 	/* Data to set */
55960 	uint8_t	data[8];
55961 	/* Mask of data to set, 0 indicates no mask */
55962 	uint8_t	mask[8];
55963 } hwrm_tf_global_cfg_set_input_t, *phwrm_tf_global_cfg_set_input_t;
55964 
55965 /* hwrm_tf_global_cfg_set_output (size:128b/16B) */
55966 
55967 typedef struct hwrm_tf_global_cfg_set_output {
55968 	/* The specific error status for the command. */
55969 	uint16_t	error_code;
55970 	/* The HWRM command request type. */
55971 	uint16_t	req_type;
55972 	/* The sequence ID from the original command. */
55973 	uint16_t	seq_id;
55974 	/* The length of the response data in number of bytes. */
55975 	uint16_t	resp_len;
55976 	/* unused. */
55977 	uint8_t	unused0[7];
55978 	/*
55979 	 * This field is used in Output records to indicate that the
55980 	 * output is completely written to RAM. This field should be
55981 	 * read as '1' to indicate that the output has been
55982 	 * completely written. When writing a command completion or
55983 	 * response to an internal processor, the order of writes has
55984 	 * to be such that this field is written last.
55985 	 */
55986 	uint8_t	valid;
55987 } hwrm_tf_global_cfg_set_output_t, *phwrm_tf_global_cfg_set_output_t;
55988 
55989 /**************************
55990  * hwrm_tf_global_cfg_get *
55991  **************************/
55992 
55993 
55994 /* hwrm_tf_global_cfg_get_input (size:320b/40B) */
55995 
55996 typedef struct hwrm_tf_global_cfg_get_input {
55997 	/* The HWRM command request type. */
55998 	uint16_t	req_type;
55999 	/*
56000 	 * The completion ring to send the completion event on. This should
56001 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56002 	 */
56003 	uint16_t	cmpl_ring;
56004 	/*
56005 	 * The sequence ID is used by the driver for tracking multiple
56006 	 * commands. This ID is treated as opaque data by the firmware and
56007 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56008 	 */
56009 	uint16_t	seq_id;
56010 	/*
56011 	 * The target ID of the command:
56012 	 * * 0x0-0xFFF8 - The function ID
56013 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56014 	 * * 0xFFFD - Reserved for user-space HWRM interface
56015 	 * * 0xFFFF - HWRM
56016 	 */
56017 	uint16_t	target_id;
56018 	/*
56019 	 * A physical address pointer pointing to a host buffer that the
56020 	 * command's response data will be written. This can be either a host
56021 	 * physical address (HPA) or a guest physical address (GPA) and must
56022 	 * point to a physically contiguous block of memory.
56023 	 */
56024 	uint64_t	resp_addr;
56025 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
56026 	uint32_t	fw_session_id;
56027 	/* Control flags. */
56028 	uint32_t	flags;
56029 	/* Indicates the flow direction. */
56030 	#define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR	UINT32_C(0x1)
56031 	/* If this bit set to 0, then it indicates rx flow. */
56032 		#define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
56033 	/* If this bit is set to 1, then it indicates tx flow. */
56034 		#define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
56035 		#define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_TX
56036 	/* Global Cfg type */
56037 	uint32_t	type;
56038 	/* Offset of the type */
56039 	uint32_t	offset;
56040 	/* Size of the data to set in bytes */
56041 	uint16_t	size;
56042 	/* unused. */
56043 	uint8_t	unused0[6];
56044 } hwrm_tf_global_cfg_get_input_t, *phwrm_tf_global_cfg_get_input_t;
56045 
56046 /* hwrm_tf_global_cfg_get_output (size:2240b/280B) */
56047 
56048 typedef struct hwrm_tf_global_cfg_get_output {
56049 	/* The specific error status for the command. */
56050 	uint16_t	error_code;
56051 	/* The HWRM command request type. */
56052 	uint16_t	req_type;
56053 	/* The sequence ID from the original command. */
56054 	uint16_t	seq_id;
56055 	/* The length of the response data in number of bytes. */
56056 	uint16_t	resp_len;
56057 	/* Size of the data read in bytes */
56058 	uint16_t	size;
56059 	/* unused. */
56060 	uint8_t	unused0[6];
56061 	/* Data to set */
56062 	uint8_t	data[256];
56063 	/* unused. */
56064 	uint8_t	unused1[7];
56065 	/*
56066 	 * This field is used in Output records to indicate that the output
56067 	 * is completely written to RAM. This field should be read as '1'
56068 	 * to indicate that the output has been completely written.
56069 	 * When writing a command completion or response to an internal
56070 	 * processor, the order of writes has to be such that this field is
56071 	 * written last.
56072 	 */
56073 	uint8_t	valid;
56074 } hwrm_tf_global_cfg_get_output_t, *phwrm_tf_global_cfg_get_output_t;
56075 
56076 /**********************
56077  * hwrm_tf_if_tbl_get *
56078  **********************/
56079 
56080 
56081 /* hwrm_tf_if_tbl_get_input (size:256b/32B) */
56082 
56083 typedef struct hwrm_tf_if_tbl_get_input {
56084 	/* The HWRM command request type. */
56085 	uint16_t	req_type;
56086 	/*
56087 	 * The completion ring to send the completion event on. This should
56088 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56089 	 */
56090 	uint16_t	cmpl_ring;
56091 	/*
56092 	 * The sequence ID is used by the driver for tracking multiple
56093 	 * commands. This ID is treated as opaque data by the firmware and
56094 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56095 	 */
56096 	uint16_t	seq_id;
56097 	/*
56098 	 * The target ID of the command:
56099 	 * * 0x0-0xFFF8 - The function ID
56100 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56101 	 * * 0xFFFD - Reserved for user-space HWRM interface
56102 	 * * 0xFFFF - HWRM
56103 	 */
56104 	uint16_t	target_id;
56105 	/*
56106 	 * A physical address pointer pointing to a host buffer that the
56107 	 * command's response data will be written. This can be either a host
56108 	 * physical address (HPA) or a guest physical address (GPA) and must
56109 	 * point to a physically contiguous block of memory.
56110 	 */
56111 	uint64_t	resp_addr;
56112 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
56113 	uint32_t	fw_session_id;
56114 	/* Control flags. */
56115 	uint16_t	flags;
56116 	/* Indicates the flow direction. */
56117 	#define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR	UINT32_C(0x1)
56118 	/* If this bit set to 0, then it indicates rx flow. */
56119 		#define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
56120 	/* If this bit is set to 1, then it indicates tx flow. */
56121 		#define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
56122 		#define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX
56123 	/* Size of the data to set. */
56124 	uint16_t	size;
56125 	/*
56126 	 * Type of the resource, defined globally in the
56127 	 * hwrm_tf_resc_type enum.
56128 	 */
56129 	uint32_t	type;
56130 	/* Index of the type to retrieve. */
56131 	uint32_t	index;
56132 } hwrm_tf_if_tbl_get_input_t, *phwrm_tf_if_tbl_get_input_t;
56133 
56134 /* hwrm_tf_if_tbl_get_output (size:1216b/152B) */
56135 
56136 typedef struct hwrm_tf_if_tbl_get_output {
56137 	/* The specific error status for the command. */
56138 	uint16_t	error_code;
56139 	/* The HWRM command request type. */
56140 	uint16_t	req_type;
56141 	/* The sequence ID from the original command. */
56142 	uint16_t	seq_id;
56143 	/* The length of the response data in number of bytes. */
56144 	uint16_t	resp_len;
56145 	/* Response code. */
56146 	uint32_t	resp_code;
56147 	/* Response size. */
56148 	uint16_t	size;
56149 	/* unused */
56150 	uint16_t	unused0;
56151 	/* Response data. */
56152 	uint8_t	data[128];
56153 	/* unused */
56154 	uint8_t	unused1[7];
56155 	/*
56156 	 * This field is used in Output records to indicate that the output
56157 	 * is completely written to RAM. This field should be read as '1'
56158 	 * to indicate that the output has been completely written.
56159 	 * When writing a command completion or response to an internal
56160 	 * processor, the order of writes has to be such that this field
56161 	 * is written last.
56162 	 */
56163 	uint8_t	valid;
56164 } hwrm_tf_if_tbl_get_output_t, *phwrm_tf_if_tbl_get_output_t;
56165 
56166 /***************************
56167  * hwrm_tf_if_tbl_type_set *
56168  ***************************/
56169 
56170 
56171 /* hwrm_tf_if_tbl_set_input (size:1024b/128B) */
56172 
56173 typedef struct hwrm_tf_if_tbl_set_input {
56174 	/* The HWRM command request type. */
56175 	uint16_t	req_type;
56176 	/*
56177 	 * The completion ring to send the completion event on. This should
56178 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56179 	 */
56180 	uint16_t	cmpl_ring;
56181 	/*
56182 	 * The sequence ID is used by the driver for tracking multiple
56183 	 * commands. This ID is treated as opaque data by the firmware and
56184 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56185 	 */
56186 	uint16_t	seq_id;
56187 	/*
56188 	 * The target ID of the command:
56189 	 * * 0x0-0xFFF8 - The function ID
56190 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56191 	 * * 0xFFFD - Reserved for user-space HWRM interface
56192 	 * * 0xFFFF - HWRM
56193 	 */
56194 	uint16_t	target_id;
56195 	/*
56196 	 * A physical address pointer pointing to a host buffer that the
56197 	 * command's response data will be written. This can be either a host
56198 	 * physical address (HPA) or a guest physical address (GPA) and must
56199 	 * point to a physically contiguous block of memory.
56200 	 */
56201 	uint64_t	resp_addr;
56202 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
56203 	uint32_t	fw_session_id;
56204 	/* Control flags. */
56205 	uint16_t	flags;
56206 	/* Indicates the flow direction. */
56207 	#define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
56208 	/* If this bit set to 0, then it indicates rx flow. */
56209 		#define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
56210 	/* If this bit is set to 1, then it indicates tx flow. */
56211 		#define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
56212 		#define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX
56213 	/* unused. */
56214 	uint8_t	unused0[2];
56215 	/*
56216 	 * Type of the resource, defined globally in the
56217 	 * hwrm_tf_resc_type enum.
56218 	 */
56219 	uint32_t	type;
56220 	/* Index of the type to set. */
56221 	uint32_t	index;
56222 	/* Size of the data to set. */
56223 	uint16_t	size;
56224 	/* unused */
56225 	uint8_t	unused1[6];
56226 	/* Data to be set. */
56227 	uint8_t	data[88];
56228 } hwrm_tf_if_tbl_set_input_t, *phwrm_tf_if_tbl_set_input_t;
56229 
56230 /* hwrm_tf_if_tbl_set_output (size:128b/16B) */
56231 
56232 typedef struct hwrm_tf_if_tbl_set_output {
56233 	/* The specific error status for the command. */
56234 	uint16_t	error_code;
56235 	/* The HWRM command request type. */
56236 	uint16_t	req_type;
56237 	/* The sequence ID from the original command. */
56238 	uint16_t	seq_id;
56239 	/* The length of the response data in number of bytes. */
56240 	uint16_t	resp_len;
56241 	/* unused. */
56242 	uint8_t	unused0[7];
56243 	/*
56244 	 * This field is used in Output records to indicate that the output
56245 	 * is completely written to RAM. This field should be read as '1'
56246 	 * to indicate that the output has been completely written.
56247 	 * When writing a command completion or response to an internal
56248 	 * processor, the order of writes has to be such that this field
56249 	 * is written last.
56250 	 */
56251 	uint8_t	valid;
56252 } hwrm_tf_if_tbl_set_output_t, *phwrm_tf_if_tbl_set_output_t;
56253 
56254 /*****************************
56255  * hwrm_tf_tbl_type_bulk_get *
56256  *****************************/
56257 
56258 
56259 /* hwrm_tf_tbl_type_bulk_get_input (size:384b/48B) */
56260 
56261 typedef struct hwrm_tf_tbl_type_bulk_get_input {
56262 	/* The HWRM command request type. */
56263 	uint16_t	req_type;
56264 	/*
56265 	 * The completion ring to send the completion event on. This should
56266 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56267 	 */
56268 	uint16_t	cmpl_ring;
56269 	/*
56270 	 * The sequence ID is used by the driver for tracking multiple
56271 	 * commands. This ID is treated as opaque data by the firmware and
56272 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56273 	 */
56274 	uint16_t	seq_id;
56275 	/*
56276 	 * The target ID of the command:
56277 	 * * 0x0-0xFFF8 - The function ID
56278 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56279 	 * * 0xFFFD - Reserved for user-space HWRM interface
56280 	 * * 0xFFFF - HWRM
56281 	 */
56282 	uint16_t	target_id;
56283 	/*
56284 	 * A physical address pointer pointing to a host buffer that the
56285 	 * command's response data will be written. This can be either a host
56286 	 * physical address (HPA) or a guest physical address (GPA) and must
56287 	 * point to a physically contiguous block of memory.
56288 	 */
56289 	uint64_t	resp_addr;
56290 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
56291 	uint32_t	fw_session_id;
56292 	/* Control flags. */
56293 	uint16_t	flags;
56294 	/* Indicates the flow direction. */
56295 	#define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR		UINT32_C(0x1)
56296 	/* If this bit set to 0, then it indicates rx flow. */
56297 		#define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_RX		UINT32_C(0x0)
56298 	/* If this bit is set to 1, then it indicates tx flow. */
56299 		#define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX		UINT32_C(0x1)
56300 		#define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_LAST	HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX
56301 	/*
56302 	 * When set use the special access register access to clear
56303 	 * the table entries on read.
56304 	 */
56305 	#define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_CLEAR_ON_READ	UINT32_C(0x2)
56306 	/* unused. */
56307 	uint8_t	unused0[2];
56308 	/*
56309 	 * Type of the resource, defined globally in the
56310 	 * hwrm_tf_resc_type enum.
56311 	 */
56312 	uint32_t	type;
56313 	/* Starting index of the type to retrieve. */
56314 	uint32_t	start_index;
56315 	/* Number of entries to retrieve. */
56316 	uint32_t	num_entries;
56317 	/* Number of entries to retrieve. */
56318 	uint32_t	unused1;
56319 	/* Host memory where data will be stored. */
56320 	uint64_t	host_addr;
56321 } hwrm_tf_tbl_type_bulk_get_input_t, *phwrm_tf_tbl_type_bulk_get_input_t;
56322 
56323 /* hwrm_tf_tbl_type_bulk_get_output (size:128b/16B) */
56324 
56325 typedef struct hwrm_tf_tbl_type_bulk_get_output {
56326 	/* The specific error status for the command. */
56327 	uint16_t	error_code;
56328 	/* The HWRM command request type. */
56329 	uint16_t	req_type;
56330 	/* The sequence ID from the original command. */
56331 	uint16_t	seq_id;
56332 	/* The length of the response data in number of bytes. */
56333 	uint16_t	resp_len;
56334 	/* Response code. */
56335 	uint32_t	resp_code;
56336 	/* Response size. */
56337 	uint16_t	size;
56338 	/* unused */
56339 	uint8_t	unused0;
56340 	/*
56341 	 * This field is used in Output records to indicate that the output
56342 	 * is completely written to RAM. This field should be read as '1'
56343 	 * to indicate that the output has been completely written.
56344 	 * When writing a command completion or response to an internal
56345 	 * processor, the order of writes has to be such that this field
56346 	 * is written last.
56347 	 */
56348 	uint8_t	valid;
56349 } hwrm_tf_tbl_type_bulk_get_output_t, *phwrm_tf_tbl_type_bulk_get_output_t;
56350 
56351 /***********************************
56352  * hwrm_tf_session_hotup_state_set *
56353  ***********************************/
56354 
56355 
56356 /* hwrm_tf_session_hotup_state_set_input (size:192b/24B) */
56357 
56358 typedef struct hwrm_tf_session_hotup_state_set_input {
56359 	/* The HWRM command request type. */
56360 	uint16_t	req_type;
56361 	/*
56362 	 * The completion ring to send the completion event on. This should
56363 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56364 	 */
56365 	uint16_t	cmpl_ring;
56366 	/*
56367 	 * The sequence ID is used by the driver for tracking multiple
56368 	 * commands. This ID is treated as opaque data by the firmware and
56369 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56370 	 */
56371 	uint16_t	seq_id;
56372 	/*
56373 	 * The target ID of the command:
56374 	 * * 0x0-0xFFF8 - The function ID
56375 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56376 	 * * 0xFFFD - Reserved for user-space HWRM interface
56377 	 * * 0xFFFF - HWRM
56378 	 */
56379 	uint16_t	target_id;
56380 	/*
56381 	 * A physical address pointer pointing to a host buffer that the
56382 	 * command's response data will be written. This can be either a host
56383 	 * physical address (HPA) or a guest physical address (GPA) and must
56384 	 * point to a physically contiguous block of memory.
56385 	 */
56386 	uint64_t	resp_addr;
56387 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
56388 	uint32_t	fw_session_id;
56389 	/* Shared session state. */
56390 	uint16_t	state;
56391 	/* Control flags. */
56392 	uint16_t	flags;
56393 	/* Indicates the flow direction. */
56394 	#define HWRM_TF_SESSION_HOTUP_STATE_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
56395 	/* If this bit set to 0, then it indicates rx flow. */
56396 		#define HWRM_TF_SESSION_HOTUP_STATE_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
56397 	/* If this bit is set to 1, then it indicates tx flow. */
56398 		#define HWRM_TF_SESSION_HOTUP_STATE_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
56399 		#define HWRM_TF_SESSION_HOTUP_STATE_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_HOTUP_STATE_SET_INPUT_FLAGS_DIR_TX
56400 } hwrm_tf_session_hotup_state_set_input_t, *phwrm_tf_session_hotup_state_set_input_t;
56401 
56402 /* hwrm_tf_session_hotup_state_set_output (size:128b/16B) */
56403 
56404 typedef struct hwrm_tf_session_hotup_state_set_output {
56405 	/* The specific error status for the command. */
56406 	uint16_t	error_code;
56407 	/* The HWRM command request type. */
56408 	uint16_t	req_type;
56409 	/* The sequence ID from the original command. */
56410 	uint16_t	seq_id;
56411 	/* The length of the response data in number of bytes. */
56412 	uint16_t	resp_len;
56413 	/* unused. */
56414 	uint8_t	unused0[7];
56415 	/*
56416 	 * This field is used in Output records to indicate that the output
56417 	 * is completely written to RAM. This field should be read as '1'
56418 	 * to indicate that the output has been completely written.
56419 	 * When writing a command completion or response to an internal
56420 	 * processor, the order of writes has to be such that this field
56421 	 * is written last.
56422 	 */
56423 	uint8_t	valid;
56424 } hwrm_tf_session_hotup_state_set_output_t, *phwrm_tf_session_hotup_state_set_output_t;
56425 
56426 /***********************************
56427  * hwrm_tf_session_hotup_state_get *
56428  ***********************************/
56429 
56430 
56431 /* hwrm_tf_session_hotup_state_get_input (size:192b/24B) */
56432 
56433 typedef struct hwrm_tf_session_hotup_state_get_input {
56434 	/* The HWRM command request type. */
56435 	uint16_t	req_type;
56436 	/*
56437 	 * The completion ring to send the completion event on. This should
56438 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56439 	 */
56440 	uint16_t	cmpl_ring;
56441 	/*
56442 	 * The sequence ID is used by the driver for tracking multiple
56443 	 * commands. This ID is treated as opaque data by the firmware and
56444 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56445 	 */
56446 	uint16_t	seq_id;
56447 	/*
56448 	 * The target ID of the command:
56449 	 * * 0x0-0xFFF8 - The function ID
56450 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56451 	 * * 0xFFFD - Reserved for user-space HWRM interface
56452 	 * * 0xFFFF - HWRM
56453 	 */
56454 	uint16_t	target_id;
56455 	/*
56456 	 * A physical address pointer pointing to a host buffer that the
56457 	 * command's response data will be written. This can be either a host
56458 	 * physical address (HPA) or a guest physical address (GPA) and must
56459 	 * point to a physically contiguous block of memory.
56460 	 */
56461 	uint64_t	resp_addr;
56462 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
56463 	uint32_t	fw_session_id;
56464 	/* Control flags. */
56465 	uint16_t	flags;
56466 	/* Indicates the flow direction. */
56467 	#define HWRM_TF_SESSION_HOTUP_STATE_GET_INPUT_FLAGS_DIR	UINT32_C(0x1)
56468 	/* If this bit set to 0, then it indicates rx flow. */
56469 		#define HWRM_TF_SESSION_HOTUP_STATE_GET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
56470 	/* If this bit is set to 1, then it indicates tx flow. */
56471 		#define HWRM_TF_SESSION_HOTUP_STATE_GET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
56472 		#define HWRM_TF_SESSION_HOTUP_STATE_GET_INPUT_FLAGS_DIR_LAST HWRM_TF_SESSION_HOTUP_STATE_GET_INPUT_FLAGS_DIR_TX
56473 	/* unused. */
56474 	uint8_t	unused0[2];
56475 } hwrm_tf_session_hotup_state_get_input_t, *phwrm_tf_session_hotup_state_get_input_t;
56476 
56477 /* hwrm_tf_session_hotup_state_get_output (size:128b/16B) */
56478 
56479 typedef struct hwrm_tf_session_hotup_state_get_output {
56480 	/* The specific error status for the command. */
56481 	uint16_t	error_code;
56482 	/* The HWRM command request type. */
56483 	uint16_t	req_type;
56484 	/* The sequence ID from the original command. */
56485 	uint16_t	seq_id;
56486 	/* The length of the response data in number of bytes. */
56487 	uint16_t	resp_len;
56488 	/* Shared session HA state. */
56489 	uint16_t	state;
56490 	/* Shared session HA reference count. */
56491 	uint16_t	ref_cnt;
56492 	/* unused. */
56493 	uint8_t	unused0[3];
56494 	/*
56495 	 * This field is used in Output records to indicate that the output
56496 	 * is completely written to RAM. This field should be read as '1'
56497 	 * to indicate that the output has been completely written.
56498 	 * When writing a command completion or response to an internal
56499 	 * processor, the order of writes has to be such that this field
56500 	 * is written last.
56501 	 */
56502 	uint8_t	valid;
56503 } hwrm_tf_session_hotup_state_get_output_t, *phwrm_tf_session_hotup_state_get_output_t;
56504 
56505 /**************************
56506  * hwrm_tf_resc_usage_set *
56507  **************************/
56508 
56509 
56510 /* hwrm_tf_resc_usage_set_input (size:1024b/128B) */
56511 
56512 typedef struct hwrm_tf_resc_usage_set_input {
56513 	/* The HWRM command request type. */
56514 	uint16_t	req_type;
56515 	/*
56516 	 * The completion ring to send the completion event on. This should
56517 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56518 	 */
56519 	uint16_t	cmpl_ring;
56520 	/*
56521 	 * The sequence ID is used by the driver for tracking multiple
56522 	 * commands. This ID is treated as opaque data by the firmware and
56523 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56524 	 */
56525 	uint16_t	seq_id;
56526 	/*
56527 	 * The target ID of the command:
56528 	 * * 0x0-0xFFF8 - The function ID
56529 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56530 	 * * 0xFFFD - Reserved for user-space HWRM interface
56531 	 * * 0xFFFF - HWRM
56532 	 */
56533 	uint16_t	target_id;
56534 	/*
56535 	 * A physical address pointer pointing to a host buffer that the
56536 	 * command's response data will be written. This can be either a host
56537 	 * physical address (HPA) or a guest physical address (GPA) and must
56538 	 * point to a physically contiguous block of memory.
56539 	 */
56540 	uint64_t	resp_addr;
56541 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
56542 	uint32_t	fw_session_id;
56543 	/* Control flags. */
56544 	uint16_t	flags;
56545 	/* Indicates the flow direction. */
56546 	#define HWRM_TF_RESC_USAGE_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
56547 	/* If this bit set to 0, then it indicates rx flow. */
56548 		#define HWRM_TF_RESC_USAGE_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
56549 	/* If this bit is set to 1, then it indicates tx flow. */
56550 		#define HWRM_TF_RESC_USAGE_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
56551 		#define HWRM_TF_RESC_USAGE_SET_INPUT_FLAGS_DIR_LAST HWRM_TF_RESC_USAGE_SET_INPUT_FLAGS_DIR_TX
56552 	/* Indicate table data is being sent via DMA. */
56553 	#define HWRM_TF_RESC_USAGE_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
56554 	/* Types of the resource to set their usage state. */
56555 	uint16_t	types;
56556 	/* WC TCAM Pool */
56557 	#define HWRM_TF_RESC_USAGE_SET_INPUT_TYPES_WC_TCAM	UINT32_C(0x1)
56558 	/* EM Internal Memory Pool */
56559 	#define HWRM_TF_RESC_USAGE_SET_INPUT_TYPES_EM		UINT32_C(0x2)
56560 	/* Meter Instance */
56561 	#define HWRM_TF_RESC_USAGE_SET_INPUT_TYPES_METER		UINT32_C(0x4)
56562 	/* Counter Record Table */
56563 	#define HWRM_TF_RESC_USAGE_SET_INPUT_TYPES_COUNTER	UINT32_C(0x8)
56564 	/* Action Record Table */
56565 	#define HWRM_TF_RESC_USAGE_SET_INPUT_TYPES_ACTION		UINT32_C(0x10)
56566 	/* ACT MODIFY/ENCAP Record Table */
56567 	#define HWRM_TF_RESC_USAGE_SET_INPUT_TYPES_ACT_MOD_ENCAP	UINT32_C(0x20)
56568 	/* Source Property SMAC Record Table */
56569 	#define HWRM_TF_RESC_USAGE_SET_INPUT_TYPES_SP_SMAC	UINT32_C(0x40)
56570 	/* All Resource Types */
56571 	#define HWRM_TF_RESC_USAGE_SET_INPUT_TYPES_ALL		UINT32_C(0x80)
56572 	/* Size of the data to set. */
56573 	uint16_t	size;
56574 	/* unused */
56575 	uint8_t	unused1[6];
56576 	/* Data to be set. */
56577 	uint8_t	data[96];
56578 } hwrm_tf_resc_usage_set_input_t, *phwrm_tf_resc_usage_set_input_t;
56579 
56580 /* hwrm_tf_resc_usage_set_output (size:128b/16B) */
56581 
56582 typedef struct hwrm_tf_resc_usage_set_output {
56583 	/* The specific error status for the command. */
56584 	uint16_t	error_code;
56585 	/* The HWRM command request type. */
56586 	uint16_t	req_type;
56587 	/* The sequence ID from the original command. */
56588 	uint16_t	seq_id;
56589 	/* The length of the response data in number of bytes. */
56590 	uint16_t	resp_len;
56591 	/* unused. */
56592 	uint8_t	unused0[7];
56593 	/*
56594 	 * This field is used in Output records to indicate that the output
56595 	 * is completely written to RAM. This field should be read as '1'
56596 	 * to indicate that the output has been completely written.
56597 	 * When writing a command completion or response to an internal
56598 	 * processor, the order of writes has to be such that this field
56599 	 * is written last.
56600 	 */
56601 	uint8_t	valid;
56602 } hwrm_tf_resc_usage_set_output_t, *phwrm_tf_resc_usage_set_output_t;
56603 
56604 /****************************
56605  * hwrm_tf_resc_usage_query *
56606  ****************************/
56607 
56608 
56609 /* hwrm_tf_resc_usage_query_input (size:256b/32B) */
56610 
56611 typedef struct hwrm_tf_resc_usage_query_input {
56612 	/* The HWRM command request type. */
56613 	uint16_t	req_type;
56614 	/*
56615 	 * The completion ring to send the completion event on. This should
56616 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56617 	 */
56618 	uint16_t	cmpl_ring;
56619 	/*
56620 	 * The sequence ID is used by the driver for tracking multiple
56621 	 * commands. This ID is treated as opaque data by the firmware and
56622 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56623 	 */
56624 	uint16_t	seq_id;
56625 	/*
56626 	 * The target ID of the command:
56627 	 * * 0x0-0xFFF8 - The function ID
56628 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56629 	 * * 0xFFFD - Reserved for user-space HWRM interface
56630 	 * * 0xFFFF - HWRM
56631 	 */
56632 	uint16_t	target_id;
56633 	/*
56634 	 * A physical address pointer pointing to a host buffer that the
56635 	 * command's response data will be written. This can be either a host
56636 	 * physical address (HPA) or a guest physical address (GPA) and must
56637 	 * point to a physically contiguous block of memory.
56638 	 */
56639 	uint64_t	resp_addr;
56640 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
56641 	uint32_t	fw_session_id;
56642 	/* Control flags. */
56643 	uint16_t	flags;
56644 	/* Indicates the flow direction. */
56645 	#define HWRM_TF_RESC_USAGE_QUERY_INPUT_FLAGS_DIR	UINT32_C(0x1)
56646 	/* If this bit set to 0, then it indicates rx flow. */
56647 		#define HWRM_TF_RESC_USAGE_QUERY_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
56648 	/* If this bit is set to 1, then it indicates tx flow. */
56649 		#define HWRM_TF_RESC_USAGE_QUERY_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
56650 		#define HWRM_TF_RESC_USAGE_QUERY_INPUT_FLAGS_DIR_LAST HWRM_TF_RESC_USAGE_QUERY_INPUT_FLAGS_DIR_TX
56651 	/* unused. */
56652 	uint8_t	unused0[2];
56653 	/* Types of the resource to retrieve their usage state. */
56654 	uint16_t	types;
56655 	/* WC TCAM Pool */
56656 	#define HWRM_TF_RESC_USAGE_QUERY_INPUT_TYPES_WC_TCAM	UINT32_C(0x1)
56657 	/* EM Internal Memory Pool */
56658 	#define HWRM_TF_RESC_USAGE_QUERY_INPUT_TYPES_EM		UINT32_C(0x2)
56659 	/* Meter Instance */
56660 	#define HWRM_TF_RESC_USAGE_QUERY_INPUT_TYPES_METER		UINT32_C(0x4)
56661 	/* Counter Record Table */
56662 	#define HWRM_TF_RESC_USAGE_QUERY_INPUT_TYPES_COUNTER	UINT32_C(0x8)
56663 	/* Action Record Table */
56664 	#define HWRM_TF_RESC_USAGE_QUERY_INPUT_TYPES_ACTION		UINT32_C(0x10)
56665 	/* ACT MODIFY/ENCAP Record Table */
56666 	#define HWRM_TF_RESC_USAGE_QUERY_INPUT_TYPES_ACT_MOD_ENCAP	UINT32_C(0x20)
56667 	/* Source Property SMAC Record Table */
56668 	#define HWRM_TF_RESC_USAGE_QUERY_INPUT_TYPES_SP_SMAC	UINT32_C(0x40)
56669 	/* All Resource Types */
56670 	#define HWRM_TF_RESC_USAGE_QUERY_INPUT_TYPES_ALL		UINT32_C(0x80)
56671 	/* unused */
56672 	uint8_t	unused1[6];
56673 } hwrm_tf_resc_usage_query_input_t, *phwrm_tf_resc_usage_query_input_t;
56674 
56675 /* hwrm_tf_resc_usage_query_output (size:960b/120B) */
56676 
56677 typedef struct hwrm_tf_resc_usage_query_output {
56678 	/* The specific error status for the command. */
56679 	uint16_t	error_code;
56680 	/* The HWRM command request type. */
56681 	uint16_t	req_type;
56682 	/* The sequence ID from the original command. */
56683 	uint16_t	seq_id;
56684 	/* The length of the response data in number of bytes. */
56685 	uint16_t	resp_len;
56686 	/* Response code. */
56687 	uint32_t	resp_code;
56688 	/* Response size. */
56689 	uint16_t	size;
56690 	/* unused */
56691 	uint16_t	unused0;
56692 	/* Response data. */
56693 	uint8_t	data[96];
56694 	/* unused */
56695 	uint8_t	unused1[7];
56696 	/*
56697 	 * This field is used in Output records to indicate that the output
56698 	 * is completely written to RAM. This field should be read as '1'
56699 	 * to indicate that the output has been completely written.
56700 	 * When writing a command completion or response to an internal
56701 	 * processor, the order of writes has to be such that this field
56702 	 * is written last.
56703 	 */
56704 	uint8_t	valid;
56705 } hwrm_tf_resc_usage_query_output_t, *phwrm_tf_resc_usage_query_output_t;
56706 
56707 /****************************
56708  * hwrm_tfc_tbl_scope_qcaps *
56709  ****************************/
56710 
56711 
56712 /*
56713  * TruFlow command to check if firmware is capable of
56714  * supporting table scopes.
56715  */
56716 /* hwrm_tfc_tbl_scope_qcaps_input (size:128b/16B) */
56717 
56718 typedef struct hwrm_tfc_tbl_scope_qcaps_input {
56719 	/* The HWRM command request type. */
56720 	uint16_t	req_type;
56721 	/*
56722 	 * The completion ring to send the completion event on. This should
56723 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56724 	 */
56725 	uint16_t	cmpl_ring;
56726 	/*
56727 	 * The sequence ID is used by the driver for tracking multiple
56728 	 * commands. This ID is treated as opaque data by the firmware and
56729 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56730 	 */
56731 	uint16_t	seq_id;
56732 	/*
56733 	 * The target ID of the command:
56734 	 * * 0x0-0xFFF8 - The function ID
56735 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56736 	 * * 0xFFFD - Reserved for user-space HWRM interface
56737 	 * * 0xFFFF - HWRM
56738 	 */
56739 	uint16_t	target_id;
56740 	/*
56741 	 * A physical address pointer pointing to a host buffer that the
56742 	 * command's response data will be written. This can be either a host
56743 	 * physical address (HPA) or a guest physical address (GPA) and must
56744 	 * point to a physically contiguous block of memory.
56745 	 */
56746 	uint64_t	resp_addr;
56747 } hwrm_tfc_tbl_scope_qcaps_input_t, *phwrm_tfc_tbl_scope_qcaps_input_t;
56748 
56749 /* hwrm_tfc_tbl_scope_qcaps_output (size:192b/24B) */
56750 
56751 typedef struct hwrm_tfc_tbl_scope_qcaps_output {
56752 	/* The specific error status for the command. */
56753 	uint16_t	error_code;
56754 	/* The HWRM command request type. */
56755 	uint16_t	req_type;
56756 	/* The sequence ID from the original command. */
56757 	uint16_t	seq_id;
56758 	/* The length of the response data in number of bytes. */
56759 	uint16_t	resp_len;
56760 	/*
56761 	 * The maximum number of lookup records that a table scope can support.
56762 	 * This field is only valid if tbl_scope_capable is not zero.
56763 	 */
56764 	uint32_t	max_lkup_rec_cnt;
56765 	/*
56766 	 * The maximum number of action records that a table scope can support.
56767 	 * This field is only valid if tbl_scope_capable is not zero.
56768 	 */
56769 	uint32_t	max_act_rec_cnt;
56770 	/* Not zero if firmware capable of table scopes. */
56771 	uint8_t	tbl_scope_capable;
56772 	/*
56773 	 * log2 of the number of lookup static buckets that a table scope can
56774 	 * support. This field is only valid if tbl_scope_capable is not zero.
56775 	 */
56776 	uint8_t	max_lkup_static_buckets_exp;
56777 	/* unused. */
56778 	uint8_t	unused0[5];
56779 	/*
56780 	 * This field is used in Output records to indicate that the output
56781 	 * is completely written to RAM. This field should be read as '1'
56782 	 * to indicate that the output has been completely written.
56783 	 * When writing a command completion or response to an internal
56784 	 * processor, the order of writes has to be such that this field
56785 	 * is written last.
56786 	 */
56787 	uint8_t	valid;
56788 } hwrm_tfc_tbl_scope_qcaps_output_t, *phwrm_tfc_tbl_scope_qcaps_output_t;
56789 
56790 /*******************************
56791  * hwrm_tfc_tbl_scope_id_alloc *
56792  *******************************/
56793 
56794 
56795 /*
56796  * TruFlow command to allocate a table scope ID and create the pools.
56797  *
56798  * There is no corresponding free command since a table scope
56799  * ID will automatically be freed once the last FID is removed.
56800  * That is, when the hwrm_tfc_tbl_scope_fid_rem command returns
56801  * a fid_cnt of 0 that also means that the table scope ID has
56802  * been freed.
56803  */
56804 /* hwrm_tfc_tbl_scope_id_alloc_input (size:256b/32B) */
56805 
56806 typedef struct hwrm_tfc_tbl_scope_id_alloc_input {
56807 	/* The HWRM command request type. */
56808 	uint16_t	req_type;
56809 	/*
56810 	 * The completion ring to send the completion event on. This should
56811 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56812 	 */
56813 	uint16_t	cmpl_ring;
56814 	/*
56815 	 * The sequence ID is used by the driver for tracking multiple
56816 	 * commands. This ID is treated as opaque data by the firmware and
56817 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56818 	 */
56819 	uint16_t	seq_id;
56820 	/*
56821 	 * The target ID of the command:
56822 	 * * 0x0-0xFFF8 - The function ID
56823 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56824 	 * * 0xFFFD - Reserved for user-space HWRM interface
56825 	 * * 0xFFFF - HWRM
56826 	 */
56827 	uint16_t	target_id;
56828 	/*
56829 	 * A physical address pointer pointing to a host buffer that the
56830 	 * command's response data will be written. This can be either a host
56831 	 * physical address (HPA) or a guest physical address (GPA) and must
56832 	 * point to a physically contiguous block of memory.
56833 	 */
56834 	uint64_t	resp_addr;
56835 	/*
56836 	 * Function ID.
56837 	 * If running on a trusted VF or PF, the fid field can be used to
56838 	 * specify that the function is a non-trusted VF of the parent PF.
56839 	 * If this command is used for the target_id itself, this field is
56840 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
56841 	 * field.
56842 	 */
56843 	uint16_t	fid;
56844 	/* The maximum number of pools for this table scope. */
56845 	uint16_t	max_pools;
56846 	/* Non-zero if this table scope is shared. */
56847 	uint8_t	shared;
56848 	/*
56849 	 * The size of the lookup pools per direction expressed as
56850 	 * log2(max_records/max_pools). That is, size=2^exp.
56851 	 *
56852 	 * Array is indexed by enum cfa_dir.
56853 	 */
56854 	uint8_t	lkup_pool_sz_exp[2];
56855 	/*
56856 	 * The size of the action pools per direction expressed as
56857 	 * log2(max_records/max_pools). That is, size=2^exp.
56858 	 *
56859 	 * Array is indexed by enum cfa_dir.
56860 	 */
56861 	uint8_t	act_pool_sz_exp[2];
56862 	/* Application type. 0 (AFM), 1 (TF) */
56863 	uint8_t	app_type;
56864 	/* unused. */
56865 	uint8_t	unused0[6];
56866 } hwrm_tfc_tbl_scope_id_alloc_input_t, *phwrm_tfc_tbl_scope_id_alloc_input_t;
56867 
56868 /* hwrm_tfc_tbl_scope_id_alloc_output (size:128b/16B) */
56869 
56870 typedef struct hwrm_tfc_tbl_scope_id_alloc_output {
56871 	/* The specific error status for the command. */
56872 	uint16_t	error_code;
56873 	/* The HWRM command request type. */
56874 	uint16_t	req_type;
56875 	/* The sequence ID from the original command. */
56876 	uint16_t	seq_id;
56877 	/* The length of the response data in number of bytes. */
56878 	uint16_t	resp_len;
56879 	/* The table scope ID that was allocated. */
56880 	uint8_t	tsid;
56881 	/*
56882 	 * Non-zero if this is the first FID associated with this table scope
56883 	 * ID.
56884 	 */
56885 	uint8_t	first;
56886 	/* unused. */
56887 	uint8_t	unused0[5];
56888 	/*
56889 	 * This field is used in Output records to indicate that the output
56890 	 * is completely written to RAM. This field should be read as '1'
56891 	 * to indicate that the output has been completely written.
56892 	 * When writing a command completion or response to an internal
56893 	 * processor, the order of writes has to be such that this field
56894 	 * is written last.
56895 	 */
56896 	uint8_t	valid;
56897 } hwrm_tfc_tbl_scope_id_alloc_output_t, *phwrm_tfc_tbl_scope_id_alloc_output_t;
56898 
56899 /*****************************
56900  * hwrm_tfc_tbl_scope_config *
56901  *****************************/
56902 
56903 
56904 /* TruFlow command to configure the table scope memory. */
56905 /* hwrm_tfc_tbl_scope_config_input (size:704b/88B) */
56906 
56907 typedef struct hwrm_tfc_tbl_scope_config_input {
56908 	/* The HWRM command request type. */
56909 	uint16_t	req_type;
56910 	/*
56911 	 * The completion ring to send the completion event on. This should
56912 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
56913 	 */
56914 	uint16_t	cmpl_ring;
56915 	/*
56916 	 * The sequence ID is used by the driver for tracking multiple
56917 	 * commands. This ID is treated as opaque data by the firmware and
56918 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
56919 	 */
56920 	uint16_t	seq_id;
56921 	/*
56922 	 * The target ID of the command:
56923 	 * * 0x0-0xFFF8 - The function ID
56924 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56925 	 * * 0xFFFD - Reserved for user-space HWRM interface
56926 	 * * 0xFFFF - HWRM
56927 	 */
56928 	uint16_t	target_id;
56929 	/*
56930 	 * A physical address pointer pointing to a host buffer that the
56931 	 * command's response data will be written. This can be either a host
56932 	 * physical address (HPA) or a guest physical address (GPA) and must
56933 	 * point to a physically contiguous block of memory.
56934 	 */
56935 	uint64_t	resp_addr;
56936 	/*
56937 	 * The base addresses for lookup memory.
56938 	 * Array is indexed by enum cfa_dir.
56939 	 */
56940 	uint64_t	lkup_base_addr[2];
56941 	/*
56942 	 * The base addresses for action memory.
56943 	 * Array is indexed by enum cfa_dir.
56944 	 */
56945 	uint64_t	act_base_addr[2];
56946 	/*
56947 	 * The number of minimum sized lkup records per direction.
56948 	 * In this usage, records are the minimum lookup memory
56949 	 * allocation unit in a table scope. This value is the total
56950 	 * memory required for buckets and entries.
56951 	 *
56952 	 * Array is indexed by enum cfa_dir.
56953 	 */
56954 	uint64_t	lkup_rec_cnt;
56955 	/*
56956 	 * The number of minimum sized action records per direction.
56957 	 * Similar to the lkup_rec_cnt, records are the minimum
56958 	 * action memory allocation unit in a table scope.
56959 	 *
56960 	 * Array is indexed by enum cfa_dir.
56961 	 */
56962 	uint64_t	act_rec_cnt;
56963 	/*
56964 	 * The number of static lookup buckets in the table scope.
56965 	 * Array is indexed by enum cfa_dir.
56966 	 */
56967 	uint64_t	lkup_static_bucket_cnt;
56968 	/* The page size of the table scope. */
56969 	uint32_t	pbl_page_sz;
56970 	/*
56971 	 * The PBL level for lookup memory.
56972 	 * Array is indexed by enum cfa_dir.
56973 	 */
56974 	uint8_t	lkup_pbl_level[2];
56975 	/*
56976 	 * The PBL level for action memory.
56977 	 * Array is indexed by enum cfa_dir.
56978 	 */
56979 	uint8_t	act_pbl_level[2];
56980 	/* The table scope ID. */
56981 	uint8_t	tsid;
56982 	/* unused. */
56983 	uint8_t	unused0[7];
56984 } hwrm_tfc_tbl_scope_config_input_t, *phwrm_tfc_tbl_scope_config_input_t;
56985 
56986 /* hwrm_tfc_tbl_scope_config_output (size:128b/16B) */
56987 
56988 typedef struct hwrm_tfc_tbl_scope_config_output {
56989 	/* The specific error status for the command. */
56990 	uint16_t	error_code;
56991 	/* The HWRM command request type. */
56992 	uint16_t	req_type;
56993 	/* The sequence ID from the original command. */
56994 	uint16_t	seq_id;
56995 	/* The length of the response data in number of bytes. */
56996 	uint16_t	resp_len;
56997 	/* unused. */
56998 	uint8_t	unused0[7];
56999 	/*
57000 	 * This field is used in Output records to indicate that the output
57001 	 * is completely written to RAM. This field should be read as '1'
57002 	 * to indicate that the output has been completely written.
57003 	 * When writing a command completion or response to an internal
57004 	 * processor, the order of writes has to be such that this field
57005 	 * is written last.
57006 	 */
57007 	uint8_t	valid;
57008 } hwrm_tfc_tbl_scope_config_output_t, *phwrm_tfc_tbl_scope_config_output_t;
57009 
57010 /*******************************
57011  * hwrm_tfc_tbl_scope_deconfig *
57012  *******************************/
57013 
57014 
57015 /* TruFlow command to deconfigure the table scope memory. */
57016 /* hwrm_tfc_tbl_scope_deconfig_input (size:192b/24B) */
57017 
57018 typedef struct hwrm_tfc_tbl_scope_deconfig_input {
57019 	/* The HWRM command request type. */
57020 	uint16_t	req_type;
57021 	/*
57022 	 * The completion ring to send the completion event on. This should
57023 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57024 	 */
57025 	uint16_t	cmpl_ring;
57026 	/*
57027 	 * The sequence ID is used by the driver for tracking multiple
57028 	 * commands. This ID is treated as opaque data by the firmware and
57029 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57030 	 */
57031 	uint16_t	seq_id;
57032 	/*
57033 	 * The target ID of the command:
57034 	 * * 0x0-0xFFF8 - The function ID
57035 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57036 	 * * 0xFFFD - Reserved for user-space HWRM interface
57037 	 * * 0xFFFF - HWRM
57038 	 */
57039 	uint16_t	target_id;
57040 	/*
57041 	 * A physical address pointer pointing to a host buffer that the
57042 	 * command's response data will be written. This can be either a host
57043 	 * physical address (HPA) or a guest physical address (GPA) and must
57044 	 * point to a physically contiguous block of memory.
57045 	 */
57046 	uint64_t	resp_addr;
57047 	/* The table scope ID. */
57048 	uint8_t	tsid;
57049 	/* unused. */
57050 	uint8_t	unused0[7];
57051 } hwrm_tfc_tbl_scope_deconfig_input_t, *phwrm_tfc_tbl_scope_deconfig_input_t;
57052 
57053 /* hwrm_tfc_tbl_scope_deconfig_output (size:128b/16B) */
57054 
57055 typedef struct hwrm_tfc_tbl_scope_deconfig_output {
57056 	/* The specific error status for the command. */
57057 	uint16_t	error_code;
57058 	/* The HWRM command request type. */
57059 	uint16_t	req_type;
57060 	/* The sequence ID from the original command. */
57061 	uint16_t	seq_id;
57062 	/* The length of the response data in number of bytes. */
57063 	uint16_t	resp_len;
57064 	/* unused. */
57065 	uint8_t	unused0[7];
57066 	/*
57067 	 * This field is used in Output records to indicate that the output
57068 	 * is completely written to RAM. This field should be read as '1'
57069 	 * to indicate that the output has been completely written.
57070 	 * When writing a command completion or response to an internal
57071 	 * processor, the order of writes has to be such that this field
57072 	 * is written last.
57073 	 */
57074 	uint8_t	valid;
57075 } hwrm_tfc_tbl_scope_deconfig_output_t, *phwrm_tfc_tbl_scope_deconfig_output_t;
57076 
57077 /******************************
57078  * hwrm_tfc_tbl_scope_fid_add *
57079  ******************************/
57080 
57081 
57082 /* TruFlow command to add a FID to a table scope. */
57083 /* hwrm_tfc_tbl_scope_fid_add_input (size:192b/24B) */
57084 
57085 typedef struct hwrm_tfc_tbl_scope_fid_add_input {
57086 	/* The HWRM command request type. */
57087 	uint16_t	req_type;
57088 	/*
57089 	 * The completion ring to send the completion event on. This should
57090 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57091 	 */
57092 	uint16_t	cmpl_ring;
57093 	/*
57094 	 * The sequence ID is used by the driver for tracking multiple
57095 	 * commands. This ID is treated as opaque data by the firmware and
57096 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57097 	 */
57098 	uint16_t	seq_id;
57099 	/*
57100 	 * The target ID of the command:
57101 	 * * 0x0-0xFFF8 - The function ID
57102 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57103 	 * * 0xFFFD - Reserved for user-space HWRM interface
57104 	 * * 0xFFFF - HWRM
57105 	 */
57106 	uint16_t	target_id;
57107 	/*
57108 	 * A physical address pointer pointing to a host buffer that the
57109 	 * command's response data will be written. This can be either a host
57110 	 * physical address (HPA) or a guest physical address (GPA) and must
57111 	 * point to a physically contiguous block of memory.
57112 	 */
57113 	uint64_t	resp_addr;
57114 	/*
57115 	 * Function ID.
57116 	 * If running on a trusted VF or PF, the fid field can be used to
57117 	 * specify that the function is a non-trusted VF of the parent PF.
57118 	 * If this command is used for the target_id itself, this field is
57119 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
57120 	 * field.
57121 	 */
57122 	uint16_t	fid;
57123 	/* The table scope ID. */
57124 	uint8_t	tsid;
57125 	/* unused. */
57126 	uint8_t	unused0[5];
57127 } hwrm_tfc_tbl_scope_fid_add_input_t, *phwrm_tfc_tbl_scope_fid_add_input_t;
57128 
57129 /* hwrm_tfc_tbl_scope_fid_add_output (size:128b/16B) */
57130 
57131 typedef struct hwrm_tfc_tbl_scope_fid_add_output {
57132 	/* The specific error status for the command. */
57133 	uint16_t	error_code;
57134 	/* The HWRM command request type. */
57135 	uint16_t	req_type;
57136 	/* The sequence ID from the original command. */
57137 	uint16_t	seq_id;
57138 	/* The length of the response data in number of bytes. */
57139 	uint16_t	resp_len;
57140 	/* The number of FIDs currently in the table scope ID. */
57141 	uint8_t	fid_cnt;
57142 	/* unused. */
57143 	uint8_t	unused0[6];
57144 	/*
57145 	 * This field is used in Output records to indicate that the output
57146 	 * is completely written to RAM. This field should be read as '1'
57147 	 * to indicate that the output has been completely written.
57148 	 * When writing a command completion or response to an internal
57149 	 * processor, the order of writes has to be such that this field
57150 	 * is written last.
57151 	 */
57152 	uint8_t	valid;
57153 } hwrm_tfc_tbl_scope_fid_add_output_t, *phwrm_tfc_tbl_scope_fid_add_output_t;
57154 
57155 /******************************
57156  * hwrm_tfc_tbl_scope_fid_rem *
57157  ******************************/
57158 
57159 
57160 /* TruFlow command to remove a FID from a table scope. */
57161 /* hwrm_tfc_tbl_scope_fid_rem_input (size:192b/24B) */
57162 
57163 typedef struct hwrm_tfc_tbl_scope_fid_rem_input {
57164 	/* The HWRM command request type. */
57165 	uint16_t	req_type;
57166 	/*
57167 	 * The completion ring to send the completion event on. This should
57168 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57169 	 */
57170 	uint16_t	cmpl_ring;
57171 	/*
57172 	 * The sequence ID is used by the driver for tracking multiple
57173 	 * commands. This ID is treated as opaque data by the firmware and
57174 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57175 	 */
57176 	uint16_t	seq_id;
57177 	/*
57178 	 * The target ID of the command:
57179 	 * * 0x0-0xFFF8 - The function ID
57180 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57181 	 * * 0xFFFD - Reserved for user-space HWRM interface
57182 	 * * 0xFFFF - HWRM
57183 	 */
57184 	uint16_t	target_id;
57185 	/*
57186 	 * A physical address pointer pointing to a host buffer that the
57187 	 * command's response data will be written. This can be either a host
57188 	 * physical address (HPA) or a guest physical address (GPA) and must
57189 	 * point to a physically contiguous block of memory.
57190 	 */
57191 	uint64_t	resp_addr;
57192 	/*
57193 	 * Function ID.
57194 	 * If running on a trusted VF or PF, the fid field can be used to
57195 	 * specify that the function is a non-trusted VF of the parent PF.
57196 	 * If this command is used for the target_id itself, this field is
57197 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
57198 	 * field.
57199 	 */
57200 	uint16_t	fid;
57201 	/* The table scope ID. */
57202 	uint8_t	tsid;
57203 	/* unused. */
57204 	uint8_t	unused0[5];
57205 } hwrm_tfc_tbl_scope_fid_rem_input_t, *phwrm_tfc_tbl_scope_fid_rem_input_t;
57206 
57207 /* hwrm_tfc_tbl_scope_fid_rem_output (size:128b/16B) */
57208 
57209 typedef struct hwrm_tfc_tbl_scope_fid_rem_output {
57210 	/* The specific error status for the command. */
57211 	uint16_t	error_code;
57212 	/* The HWRM command request type. */
57213 	uint16_t	req_type;
57214 	/* The sequence ID from the original command. */
57215 	uint16_t	seq_id;
57216 	/* The length of the response data in number of bytes. */
57217 	uint16_t	resp_len;
57218 	/* The number of FIDs remaining in the table scope ID. */
57219 	uint16_t	fid_cnt;
57220 	/* unused. */
57221 	uint8_t	unused0[5];
57222 	/*
57223 	 * This field is used in Output records to indicate that the output
57224 	 * is completely written to RAM. This field should be read as '1'
57225 	 * to indicate that the output has been completely written.
57226 	 * When writing a command completion or response to an internal
57227 	 * processor, the order of writes has to be such that this field
57228 	 * is written last.
57229 	 */
57230 	uint8_t	valid;
57231 } hwrm_tfc_tbl_scope_fid_rem_output_t, *phwrm_tfc_tbl_scope_fid_rem_output_t;
57232 
57233 /*****************************
57234  * hwrm_tfc_session_id_alloc *
57235  *****************************/
57236 
57237 
57238 /*
57239  * Allocate a TFC session. Requests the firmware to allocate a TFC
57240  * session identifier and associate a forwarding function with the
57241  * session. Though there's not an explicit matching free for a session
57242  * id alloc, dis-associating the last fid from a session id (fid_cnt goes
57243  * to 0), will result in this session id being freed automatically.
57244  */
57245 /* hwrm_tfc_session_id_alloc_input (size:192b/24B) */
57246 
57247 typedef struct hwrm_tfc_session_id_alloc_input {
57248 	/* The HWRM command request type. */
57249 	uint16_t	req_type;
57250 	/*
57251 	 * The completion ring to send the completion event on. This should
57252 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57253 	 */
57254 	uint16_t	cmpl_ring;
57255 	/*
57256 	 * The sequence ID is used by the driver for tracking multiple
57257 	 * commands. This ID is treated as opaque data by the firmware and
57258 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57259 	 */
57260 	uint16_t	seq_id;
57261 	/*
57262 	 * The target ID of the command:
57263 	 * * 0x0-0xFFF8 - The function ID
57264 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57265 	 * * 0xFFFD - Reserved for user-space HWRM interface
57266 	 * * 0xFFFF - HWRM
57267 	 */
57268 	uint16_t	target_id;
57269 	/*
57270 	 * A physical address pointer pointing to a host buffer that the
57271 	 * command's response data will be written. This can be either a host
57272 	 * physical address (HPA) or a guest physical address (GPA) and must
57273 	 * point to a physically contiguous block of memory.
57274 	 */
57275 	uint64_t	resp_addr;
57276 	/*
57277 	 * Function ID.
57278 	 * If running on a trusted VF or PF, the fid field can be used to
57279 	 * specify that the function is a non-trusted VF of the parent PF.
57280 	 * If this command is used for the target_id itself, this field is
57281 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
57282 	 * field.
57283 	 */
57284 	uint16_t	fid;
57285 	/* Unused field */
57286 	uint8_t	unused0[6];
57287 } hwrm_tfc_session_id_alloc_input_t, *phwrm_tfc_session_id_alloc_input_t;
57288 
57289 /* hwrm_tfc_session_id_alloc_output (size:128b/16B) */
57290 
57291 typedef struct hwrm_tfc_session_id_alloc_output {
57292 	/* The specific error status for the command. */
57293 	uint16_t	error_code;
57294 	/* The HWRM command request type. */
57295 	uint16_t	req_type;
57296 	/* The sequence ID from the original command. */
57297 	uint16_t	seq_id;
57298 	/* The length of the response data in number of bytes. */
57299 	uint16_t	resp_len;
57300 	/*
57301 	 * Unique session identifier for the session created by the
57302 	 * firmware.
57303 	 */
57304 	uint16_t	sid;
57305 	/* Unused field */
57306 	uint8_t	unused0[5];
57307 	/*
57308 	 * This field is used in Output records to indicate that the output
57309 	 * is completely written to RAM. This field should be read as '1'
57310 	 * to indicate that the output has been completely written.
57311 	 * When writing a command completion or response to an internal
57312 	 * processor, the order of writes has to be such that this field is
57313 	 * written last.
57314 	 */
57315 	uint8_t	valid;
57316 } hwrm_tfc_session_id_alloc_output_t, *phwrm_tfc_session_id_alloc_output_t;
57317 
57318 /****************************
57319  * hwrm_tfc_session_fid_add *
57320  ****************************/
57321 
57322 
57323 /*
57324  * Associate a TFC session id with a forwarding function. The target_fid
57325  * will be associated with the passed in sid.
57326  */
57327 /* hwrm_tfc_session_fid_add_input (size:192b/24B) */
57328 
57329 typedef struct hwrm_tfc_session_fid_add_input {
57330 	/* The HWRM command request type. */
57331 	uint16_t	req_type;
57332 	/*
57333 	 * The completion ring to send the completion event on. This should
57334 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57335 	 */
57336 	uint16_t	cmpl_ring;
57337 	/*
57338 	 * The sequence ID is used by the driver for tracking multiple
57339 	 * commands. This ID is treated as opaque data by the firmware and
57340 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57341 	 */
57342 	uint16_t	seq_id;
57343 	/*
57344 	 * The target ID of the command:
57345 	 * * 0x0-0xFFF8 - The function ID
57346 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57347 	 * * 0xFFFD - Reserved for user-space HWRM interface
57348 	 * * 0xFFFF - HWRM
57349 	 */
57350 	uint16_t	target_id;
57351 	/*
57352 	 * A physical address pointer pointing to a host buffer that the
57353 	 * command's response data will be written. This can be either a host
57354 	 * physical address (HPA) or a guest physical address (GPA) and must
57355 	 * point to a physically contiguous block of memory.
57356 	 */
57357 	uint64_t	resp_addr;
57358 	/*
57359 	 * Function ID.
57360 	 * If running on a trusted VF or PF, the fid field can be used to
57361 	 * specify that the function is a non-trusted VF of the parent PF.
57362 	 * If this command is used for the target_id itself, this field is
57363 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
57364 	 * field.
57365 	 */
57366 	uint16_t	fid;
57367 	/*
57368 	 * Unique session identifier for the session created by the
57369 	 * firmware.
57370 	 */
57371 	uint16_t	sid;
57372 	/* Unused field */
57373 	uint8_t	unused0[4];
57374 } hwrm_tfc_session_fid_add_input_t, *phwrm_tfc_session_fid_add_input_t;
57375 
57376 /* hwrm_tfc_session_fid_add_output (size:128b/16B) */
57377 
57378 typedef struct hwrm_tfc_session_fid_add_output {
57379 	/* The specific error status for the command. */
57380 	uint16_t	error_code;
57381 	/* The HWRM command request type. */
57382 	uint16_t	req_type;
57383 	/* The sequence ID from the original command. */
57384 	uint16_t	seq_id;
57385 	/* The length of the response data in number of bytes. */
57386 	uint16_t	resp_len;
57387 	/* The number of FIDs that share this session. */
57388 	uint16_t	fid_cnt;
57389 	/* Unused field */
57390 	uint8_t	unused0[5];
57391 	/*
57392 	 * This field is used in Output records to indicate that the output
57393 	 * is completely written to RAM. This field should be read as '1'
57394 	 * to indicate that the output has been completely written.
57395 	 * When writing a command completion or response to an internal
57396 	 * processor, the order of writes has to be such that this field is
57397 	 * written last.
57398 	 */
57399 	uint8_t	valid;
57400 } hwrm_tfc_session_fid_add_output_t, *phwrm_tfc_session_fid_add_output_t;
57401 
57402 /****************************
57403  * hwrm_tfc_session_fid_rem *
57404  ****************************/
57405 
57406 
57407 /*
57408  * Dis-associate a TFC session from the target_fid.
57409  * Though there's not an explicit matching free for a
57410  * session id alloc, dis-associating the last fid from a session id
57411  * (fid_cnt goes to 0), will result in this session id being freed
57412  * automatically.
57413  */
57414 /* hwrm_tfc_session_fid_rem_input (size:192b/24B) */
57415 
57416 typedef struct hwrm_tfc_session_fid_rem_input {
57417 	/* The HWRM command request type. */
57418 	uint16_t	req_type;
57419 	/*
57420 	 * The completion ring to send the completion event on. This should
57421 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57422 	 */
57423 	uint16_t	cmpl_ring;
57424 	/*
57425 	 * The sequence ID is used by the driver for tracking multiple
57426 	 * commands. This ID is treated as opaque data by the firmware and
57427 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57428 	 */
57429 	uint16_t	seq_id;
57430 	/*
57431 	 * The target ID of the command:
57432 	 * * 0x0-0xFFF8 - The function ID
57433 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57434 	 * * 0xFFFD - Reserved for user-space HWRM interface
57435 	 * * 0xFFFF - HWRM
57436 	 */
57437 	uint16_t	target_id;
57438 	/*
57439 	 * A physical address pointer pointing to a host buffer that the
57440 	 * command's response data will be written. This can be either a host
57441 	 * physical address (HPA) or a guest physical address (GPA) and must
57442 	 * point to a physically contiguous block of memory.
57443 	 */
57444 	uint64_t	resp_addr;
57445 	/*
57446 	 * Function ID.
57447 	 * If running on a trusted VF or PF, the fid field can be used to
57448 	 * specify that the function is a non-trusted VF of the parent PF.
57449 	 * If this command is used for the target_id itself, this field is
57450 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
57451 	 * field.
57452 	 */
57453 	uint16_t	fid;
57454 	/*
57455 	 * Unique session identifier for the session created by the
57456 	 * firmware.
57457 	 */
57458 	uint16_t	sid;
57459 	/* Unused field */
57460 	uint8_t	unused0[4];
57461 } hwrm_tfc_session_fid_rem_input_t, *phwrm_tfc_session_fid_rem_input_t;
57462 
57463 /* hwrm_tfc_session_fid_rem_output (size:128b/16B) */
57464 
57465 typedef struct hwrm_tfc_session_fid_rem_output {
57466 	/* The specific error status for the command. */
57467 	uint16_t	error_code;
57468 	/* The HWRM command request type. */
57469 	uint16_t	req_type;
57470 	/* The sequence ID from the original command. */
57471 	uint16_t	seq_id;
57472 	/* The length of the response data in number of bytes. */
57473 	uint16_t	resp_len;
57474 	/* The number of FIDs that share this session. */
57475 	uint16_t	fid_cnt;
57476 	/* Unused field */
57477 	uint8_t	unused0[5];
57478 	/*
57479 	 * This field is used in Output records to indicate that the output
57480 	 * is completely written to RAM. This field should be read as '1'
57481 	 * to indicate that the output has been completely written.
57482 	 * When writing a command completion or response to an internal
57483 	 * processor, the order of writes has to be such that this field is
57484 	 * written last.
57485 	 */
57486 	uint8_t	valid;
57487 } hwrm_tfc_session_fid_rem_output_t, *phwrm_tfc_session_fid_rem_output_t;
57488 
57489 /************************
57490  * hwrm_tfc_ident_alloc *
57491  ************************/
57492 
57493 
57494 /*
57495  * Allocate a TFC identifier. Requests the firmware to
57496  * allocate a TFC identifier. The session id and track_type are passed
57497  * in. The tracking_id is either the sid or target_fid depends on the
57498  * track_type. The resource subtype is passed in, an id corresponding
57499  * to all these is allocated and returned in the HWRM response.
57500  */
57501 /* hwrm_tfc_ident_alloc_input (size:192b/24B) */
57502 
57503 typedef struct hwrm_tfc_ident_alloc_input {
57504 	/* The HWRM command request type. */
57505 	uint16_t	req_type;
57506 	/*
57507 	 * The completion ring to send the completion event on. This should
57508 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57509 	 */
57510 	uint16_t	cmpl_ring;
57511 	/*
57512 	 * The sequence ID is used by the driver for tracking multiple
57513 	 * commands. This ID is treated as opaque data by the firmware and
57514 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57515 	 */
57516 	uint16_t	seq_id;
57517 	/*
57518 	 * The target ID of the command:
57519 	 * * 0x0-0xFFF8 - The function ID
57520 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57521 	 * * 0xFFFD - Reserved for user-space HWRM interface
57522 	 * * 0xFFFF - HWRM
57523 	 */
57524 	uint16_t	target_id;
57525 	/*
57526 	 * A physical address pointer pointing to a host buffer that the
57527 	 * command's response data will be written. This can be either a host
57528 	 * physical address (HPA) or a guest physical address (GPA) and must
57529 	 * point to a physically contiguous block of memory.
57530 	 */
57531 	uint64_t	resp_addr;
57532 	/*
57533 	 * Function ID.
57534 	 * If running on a trusted VF or PF, the fid field can be used to
57535 	 * specify that the function is a non-trusted VF of the parent PF.
57536 	 * If this command is used for the target_id itself, this field is
57537 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
57538 	 * field.
57539 	 */
57540 	uint16_t	fid;
57541 	/*
57542 	 * Unique session identifier for the session created by the
57543 	 * firmware. Will be used to track this identifier.
57544 	 */
57545 	uint16_t	sid;
57546 	/* Control flags. Direction. */
57547 	uint8_t	flags;
57548 	/* Indicates the flow direction. */
57549 	#define HWRM_TFC_IDENT_ALLOC_INPUT_FLAGS_DIR	UINT32_C(0x1)
57550 	/* If this bit set to 0, then it indicates rx flow. */
57551 		#define HWRM_TFC_IDENT_ALLOC_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
57552 	/* If this bit is set to 1, then it indicates tx flow. */
57553 		#define HWRM_TFC_IDENT_ALLOC_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
57554 		#define HWRM_TFC_IDENT_ALLOC_INPUT_FLAGS_DIR_LAST HWRM_TFC_IDENT_ALLOC_INPUT_FLAGS_DIR_TX
57555 	/*
57556 	 * CFA resource subtype. For definitions, please see
57557 	 * cfa_v3/include/cfa_resources.h.
57558 	 */
57559 	uint8_t	subtype;
57560 	/* Describes the type of tracking tag to be used */
57561 	uint8_t	track_type;
57562 	/* Invalid track type */
57563 	#define HWRM_TFC_IDENT_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_INVALID UINT32_C(0x0)
57564 	/* Tracked by session id */
57565 	#define HWRM_TFC_IDENT_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_SID	UINT32_C(0x1)
57566 	/* Tracked by function id */
57567 	#define HWRM_TFC_IDENT_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_FID	UINT32_C(0x2)
57568 	#define HWRM_TFC_IDENT_ALLOC_INPUT_TRACK_TYPE_LAST		HWRM_TFC_IDENT_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_FID
57569 	/* Unused field */
57570 	uint8_t	unused0;
57571 } hwrm_tfc_ident_alloc_input_t, *phwrm_tfc_ident_alloc_input_t;
57572 
57573 /* hwrm_tfc_ident_alloc_output (size:128b/16B) */
57574 
57575 typedef struct hwrm_tfc_ident_alloc_output {
57576 	/* The specific error status for the command. */
57577 	uint16_t	error_code;
57578 	/* The HWRM command request type. */
57579 	uint16_t	req_type;
57580 	/* The sequence ID from the original command. */
57581 	uint16_t	seq_id;
57582 	/* The length of the response data in number of bytes. */
57583 	uint16_t	resp_len;
57584 	/*
57585 	 * Resource identifier allocated by the firmware using
57586 	 * parameters above.
57587 	 */
57588 	uint16_t	ident_id;
57589 	/* Unused field */
57590 	uint8_t	unused0[5];
57591 	/*
57592 	 * This field is used in Output records to indicate that the output
57593 	 * is completely written to RAM. This field should be read as '1'
57594 	 * to indicate that the output has been completely written.
57595 	 * When writing a command completion or response to an internal
57596 	 * processor, the order of writes has to be such that this field is
57597 	 * written last.
57598 	 */
57599 	uint8_t	valid;
57600 } hwrm_tfc_ident_alloc_output_t, *phwrm_tfc_ident_alloc_output_t;
57601 
57602 /***********************
57603  * hwrm_tfc_ident_free *
57604  ***********************/
57605 
57606 
57607 /*
57608  * Requests the firmware to free a TFC resource identifier.
57609  * A resource subtype and session id are passed in.
57610  * An identifier (previously allocated) corresponding to all these is
57611  * freed, only after various sanity checks are completed.
57612  */
57613 /* hwrm_tfc_ident_free_input (size:192b/24B) */
57614 
57615 typedef struct hwrm_tfc_ident_free_input {
57616 	/* The HWRM command request type. */
57617 	uint16_t	req_type;
57618 	/*
57619 	 * The completion ring to send the completion event on. This should
57620 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57621 	 */
57622 	uint16_t	cmpl_ring;
57623 	/*
57624 	 * The sequence ID is used by the driver for tracking multiple
57625 	 * commands. This ID is treated as opaque data by the firmware and
57626 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57627 	 */
57628 	uint16_t	seq_id;
57629 	/*
57630 	 * The target ID of the command:
57631 	 * * 0x0-0xFFF8 - The function ID
57632 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57633 	 * * 0xFFFD - Reserved for user-space HWRM interface
57634 	 * * 0xFFFF - HWRM
57635 	 */
57636 	uint16_t	target_id;
57637 	/*
57638 	 * A physical address pointer pointing to a host buffer that the
57639 	 * command's response data will be written. This can be either a host
57640 	 * physical address (HPA) or a guest physical address (GPA) and must
57641 	 * point to a physically contiguous block of memory.
57642 	 */
57643 	uint64_t	resp_addr;
57644 	/*
57645 	 * Function ID.
57646 	 * If running on a trusted VF or PF, the fid field can be used to
57647 	 * specify that the function is a non-trusted VF of the parent PF.
57648 	 * If this command is used for the target_id itself, this field is
57649 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
57650 	 * field.
57651 	 */
57652 	uint16_t	fid;
57653 	/*
57654 	 * Unique session identifier for the session created by the
57655 	 * firmware. Will be used to validate this request.
57656 	 */
57657 	uint16_t	sid;
57658 	/*
57659 	 * CFA resource subtype. For definitions, please see
57660 	 * cfa_v3/include/cfa_resources.h.
57661 	 */
57662 	uint8_t	subtype;
57663 	/* Control flags. Direction. */
57664 	uint8_t	flags;
57665 	/* Indicates the flow direction. */
57666 	#define HWRM_TFC_IDENT_FREE_INPUT_FLAGS_DIR	UINT32_C(0x1)
57667 	/* If this bit set to 0, then it indicates rx flow. */
57668 		#define HWRM_TFC_IDENT_FREE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
57669 	/* If this bit is set to 1, then it indicates tx flow. */
57670 		#define HWRM_TFC_IDENT_FREE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
57671 		#define HWRM_TFC_IDENT_FREE_INPUT_FLAGS_DIR_LAST HWRM_TFC_IDENT_FREE_INPUT_FLAGS_DIR_TX
57672 	/* The resource identifier to be freed */
57673 	uint16_t	ident_id;
57674 } hwrm_tfc_ident_free_input_t, *phwrm_tfc_ident_free_input_t;
57675 
57676 /* hwrm_tfc_ident_free_output (size:128b/16B) */
57677 
57678 typedef struct hwrm_tfc_ident_free_output {
57679 	/* The specific error status for the command. */
57680 	uint16_t	error_code;
57681 	/* The HWRM command request type. */
57682 	uint16_t	req_type;
57683 	/* The sequence ID from the original command. */
57684 	uint16_t	seq_id;
57685 	/* The length of the response data in number of bytes. */
57686 	uint16_t	resp_len;
57687 	/* Reserved */
57688 	uint8_t	unused0[7];
57689 	/*
57690 	 * This field is used in Output records to indicate that the output
57691 	 * is completely written to RAM. This field should be read as '1'
57692 	 * to indicate that the output has been completely written.
57693 	 * When writing a command completion or response to an internal
57694 	 * processor, the order of writes has to be such that this field is
57695 	 * written last.
57696 	 */
57697 	uint8_t	valid;
57698 } hwrm_tfc_ident_free_output_t, *phwrm_tfc_ident_free_output_t;
57699 
57700 /**************************
57701  * hwrm_tfc_idx_tbl_alloc *
57702  **************************/
57703 
57704 
57705 /* hwrm_tfc_idx_tbl_alloc_input (size:192b/24B) */
57706 
57707 typedef struct hwrm_tfc_idx_tbl_alloc_input {
57708 	/* The HWRM command request type. */
57709 	uint16_t	req_type;
57710 	/*
57711 	 * The completion ring to send the completion event on. This should
57712 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57713 	 */
57714 	uint16_t	cmpl_ring;
57715 	/*
57716 	 * The sequence ID is used by the driver for tracking multiple
57717 	 * commands. This ID is treated as opaque data by the firmware and
57718 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57719 	 */
57720 	uint16_t	seq_id;
57721 	/*
57722 	 * The target ID of the command:
57723 	 * * 0x0-0xFFF8 - The function ID
57724 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57725 	 * * 0xFFFD - Reserved for user-space HWRM interface
57726 	 * * 0xFFFF - HWRM
57727 	 */
57728 	uint16_t	target_id;
57729 	/*
57730 	 * A physical address pointer pointing to a host buffer that the
57731 	 * command's response data will be written. This can be either a host
57732 	 * physical address (HPA) or a guest physical address (GPA) and must
57733 	 * point to a physically contiguous block of memory.
57734 	 */
57735 	uint64_t	resp_addr;
57736 	/*
57737 	 * Function ID.
57738 	 * If running on a trusted VF or PF, the fid field can be used to
57739 	 * specify that the function is a non-trusted VF of the parent PF.
57740 	 * If this command is used for the target_id itself, this field is
57741 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
57742 	 * field.
57743 	 */
57744 	uint16_t	fid;
57745 	/*
57746 	 * Unique session id for the session created by the
57747 	 * firmware. Will be used to track this index table entry
57748 	 * only if track type is track_type_sid.
57749 	 */
57750 	uint16_t	sid;
57751 	/* Control flags. */
57752 	uint8_t	flags;
57753 	/* Indicates the flow direction. */
57754 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_FLAGS_DIR	UINT32_C(0x1)
57755 	/* If this bit set to 0, then it indicates rx flow. */
57756 		#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
57757 	/* If this bit is set to 1, then it indicates tx flow. */
57758 		#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
57759 		#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_FLAGS_DIR_LAST HWRM_TFC_IDX_TBL_ALLOC_INPUT_FLAGS_DIR_TX
57760 	/*
57761 	 * This field is blktype specific.
57762 	 * For blktype CFA - CFA resource subtype. For definitions,
57763 	 * please see cfa_v3/include/cfa_resources.h.
57764 	 * For blktype rxp, re_gparse, te_gparse -
57765 	 * Tunnel Type. A value of zero (or unknown) means alloc. A known
57766 	 * value (previously allocated dynamic UPAR for tunnel_type) means
57767 	 * realloc. Will fail if a realloc is for previously allocated FID,
57768 	 */
57769 	uint8_t	subtype;
57770 	/* Describes the type of tracking id to be used */
57771 	uint8_t	track_type;
57772 	/* Invalid track type */
57773 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_INVALID UINT32_C(0x0)
57774 	/* Tracked by session id */
57775 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_SID	UINT32_C(0x1)
57776 	/* Tracked by function id */
57777 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_FID	UINT32_C(0x2)
57778 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_TRACK_TYPE_LAST		HWRM_TFC_IDX_TBL_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_FID
57779 	/* Specifies which block this idx table alloc request is for */
57780 	uint8_t	blktype;
57781 	/* CFA block type */
57782 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_BLKTYPE_BLKTYPE_CFA	UINT32_C(0x0)
57783 	/* RXP gparse block type */
57784 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_BLKTYPE_BLKTYPE_RXP	UINT32_C(0x1)
57785 	/* RE gparse block type */
57786 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_BLKTYPE_BLKTYPE_RE_GPARSE UINT32_C(0x2)
57787 	/* TE gparse block type */
57788 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE UINT32_C(0x3)
57789 	#define HWRM_TFC_IDX_TBL_ALLOC_INPUT_BLKTYPE_LAST		HWRM_TFC_IDX_TBL_ALLOC_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE
57790 } hwrm_tfc_idx_tbl_alloc_input_t, *phwrm_tfc_idx_tbl_alloc_input_t;
57791 
57792 /* hwrm_tfc_idx_tbl_alloc_output (size:128b/16B) */
57793 
57794 typedef struct hwrm_tfc_idx_tbl_alloc_output {
57795 	/* The specific error status for the command. */
57796 	uint16_t	error_code;
57797 	/* The HWRM command request type. */
57798 	uint16_t	req_type;
57799 	/* The sequence ID from the original command. */
57800 	uint16_t	seq_id;
57801 	/* The length of the response data in number of bytes. */
57802 	uint16_t	resp_len;
57803 	/*
57804 	 * Index table entry allocated by the firmware using the
57805 	 * parameters above.
57806 	 */
57807 	uint16_t	idx_tbl_id;
57808 	/* Reserved */
57809 	uint8_t	unused0[5];
57810 	/*
57811 	 * This field is used in Output records to indicate that the output
57812 	 * is completely written to RAM. This field should be read as '1'
57813 	 * to indicate that the output has been completely written.
57814 	 * When writing a command completion or response to an internal
57815 	 * processor, the order of writes has to be such that this field
57816 	 * is written last.
57817 	 */
57818 	uint8_t	valid;
57819 } hwrm_tfc_idx_tbl_alloc_output_t, *phwrm_tfc_idx_tbl_alloc_output_t;
57820 
57821 /******************************
57822  * hwrm_tfc_idx_tbl_alloc_set *
57823  ******************************/
57824 
57825 
57826 /* hwrm_tfc_idx_tbl_alloc_set_input (size:1088b/136B) */
57827 
57828 typedef struct hwrm_tfc_idx_tbl_alloc_set_input {
57829 	/* The HWRM command request type. */
57830 	uint16_t	req_type;
57831 	/*
57832 	 * The completion ring to send the completion event on. This should
57833 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57834 	 */
57835 	uint16_t	cmpl_ring;
57836 	/*
57837 	 * The sequence ID is used by the driver for tracking multiple
57838 	 * commands. This ID is treated as opaque data by the firmware and
57839 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57840 	 */
57841 	uint16_t	seq_id;
57842 	/*
57843 	 * The target ID of the command:
57844 	 * * 0x0-0xFFF8 - The function ID
57845 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57846 	 * * 0xFFFD - Reserved for user-space HWRM interface
57847 	 * * 0xFFFF - HWRM
57848 	 */
57849 	uint16_t	target_id;
57850 	/*
57851 	 * A physical address pointer pointing to a host buffer that the
57852 	 * command's response data will be written. This can be either a host
57853 	 * physical address (HPA) or a guest physical address (GPA) and must
57854 	 * point to a physically contiguous block of memory.
57855 	 */
57856 	uint64_t	resp_addr;
57857 	/*
57858 	 * Function ID.
57859 	 * If running on a trusted VF or PF, the fid field can be used to
57860 	 * specify that the function is a non-trusted VF of the parent PF.
57861 	 * If this command is used for the target_id itself, this field is
57862 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
57863 	 * field.
57864 	 */
57865 	uint16_t	fid;
57866 	/*
57867 	 * Unique session id for the session created by the
57868 	 * firmware. Will be used to track this index table entry
57869 	 * only if track type is track_type_sid.
57870 	 */
57871 	uint16_t	sid;
57872 	/* Control flags. */
57873 	uint8_t	flags;
57874 	/* Indicates the flow direction. */
57875 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
57876 	/* If this bit set to 0, then it indicates rx flow. */
57877 		#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
57878 	/* If this bit is set to 1, then it indicates tx flow. */
57879 		#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
57880 		#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DIR_LAST HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DIR_TX
57881 	/*
57882 	 * Indicate device data is being sent via DMA, the device
57883 	 * data packing does not change.
57884 	 */
57885 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
57886 	/*
57887 	 * This field is blktype specific.
57888 	 * For blktype CFA - CFA resource subtype. For definitions,
57889 	 * please see cfa_v3/include/cfa_resources.h.
57890 	 * For blktype rxp, re_gparse, te_gparse -
57891 	 * Tunnel Type. A value of zero (or unknown) means alloc. A known
57892 	 * value (previously allocated dynamic UPAR for tunnel_type) means
57893 	 * realloc. Will fail if a realloc is for previously allocated FID,
57894 	 */
57895 	uint8_t	subtype;
57896 	/* Describes the type of tracking id to be used */
57897 	uint8_t	track_type;
57898 	/* Invalid track type */
57899 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_INVALID UINT32_C(0x0)
57900 	/* Tracked by session id */
57901 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_SID	UINT32_C(0x1)
57902 	/* Tracked by function id */
57903 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_FID	UINT32_C(0x2)
57904 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_TRACK_TYPE_LAST		HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_FID
57905 	/* Specifies which block this idx table alloc request is for */
57906 	uint8_t	blktype;
57907 	/* CFA block type */
57908 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_BLKTYPE_BLKTYPE_CFA	UINT32_C(0x0)
57909 	/* RXP gparse block type */
57910 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_BLKTYPE_BLKTYPE_RXP	UINT32_C(0x1)
57911 	/* RE gparse block type */
57912 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_BLKTYPE_BLKTYPE_RE_GPARSE UINT32_C(0x2)
57913 	/* TE gparse block type */
57914 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE UINT32_C(0x3)
57915 	#define HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_BLKTYPE_LAST		HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE
57916 	/* The size of the index table entry in bytes. */
57917 	uint16_t	data_size;
57918 	/* Reserved */
57919 	uint8_t	unused1[6];
57920 	/* The location of the dma buffer */
57921 	uint64_t	dma_addr;
57922 	/*
57923 	 * Index table data located at offset 0. If dma bit is set,
57924 	 * then this field contains the DMA buffer pointer.
57925 	 */
57926 	uint8_t	dev_data[96];
57927 } hwrm_tfc_idx_tbl_alloc_set_input_t, *phwrm_tfc_idx_tbl_alloc_set_input_t;
57928 
57929 /* hwrm_tfc_idx_tbl_alloc_set_output (size:128b/16B) */
57930 
57931 typedef struct hwrm_tfc_idx_tbl_alloc_set_output {
57932 	/* The specific error status for the command. */
57933 	uint16_t	error_code;
57934 	/* The HWRM command request type. */
57935 	uint16_t	req_type;
57936 	/* The sequence ID from the original command. */
57937 	uint16_t	seq_id;
57938 	/* The length of the response data in number of bytes. */
57939 	uint16_t	resp_len;
57940 	/*
57941 	 * Index table entry allocated by the firmware using the
57942 	 * parameters above.
57943 	 */
57944 	uint16_t	idx_tbl_id;
57945 	/* Reserved */
57946 	uint8_t	unused0[5];
57947 	/*
57948 	 * This field is used in Output records to indicate that the output
57949 	 * is completely written to RAM. This field should be read as '1'
57950 	 * to indicate that the output has been completely written.
57951 	 * When writing a command completion or response to an internal
57952 	 * processor, the order of writes has to be such that this field
57953 	 * is written last.
57954 	 */
57955 	uint8_t	valid;
57956 } hwrm_tfc_idx_tbl_alloc_set_output_t, *phwrm_tfc_idx_tbl_alloc_set_output_t;
57957 
57958 /************************
57959  * hwrm_tfc_idx_tbl_set *
57960  ************************/
57961 
57962 
57963 /* hwrm_tfc_idx_tbl_set_input (size:1088b/136B) */
57964 
57965 typedef struct hwrm_tfc_idx_tbl_set_input {
57966 	/* The HWRM command request type. */
57967 	uint16_t	req_type;
57968 	/*
57969 	 * The completion ring to send the completion event on. This should
57970 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
57971 	 */
57972 	uint16_t	cmpl_ring;
57973 	/*
57974 	 * The sequence ID is used by the driver for tracking multiple
57975 	 * commands. This ID is treated as opaque data by the firmware and
57976 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
57977 	 */
57978 	uint16_t	seq_id;
57979 	/*
57980 	 * The target ID of the command:
57981 	 * * 0x0-0xFFF8 - The function ID
57982 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
57983 	 * * 0xFFFD - Reserved for user-space HWRM interface
57984 	 * * 0xFFFF - HWRM
57985 	 */
57986 	uint16_t	target_id;
57987 	/*
57988 	 * A physical address pointer pointing to a host buffer that the
57989 	 * command's response data will be written. This can be either a host
57990 	 * physical address (HPA) or a guest physical address (GPA) and must
57991 	 * point to a physically contiguous block of memory.
57992 	 */
57993 	uint64_t	resp_addr;
57994 	/* Control flags. */
57995 	uint8_t	flags;
57996 	/* Indicates the flow direction. */
57997 	#define HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
57998 	/* If this bit set to 0, then it indicates rx flow. */
57999 		#define HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
58000 	/* If this bit is set to 1, then it indicates tx flow. */
58001 		#define HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
58002 		#define HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DIR_LAST HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DIR_TX
58003 	/*
58004 	 * Indicate device data is being sent via DMA, the device
58005 	 * data packing does not change.
58006 	 */
58007 	#define HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
58008 	/*
58009 	 * CFA resource subtype. For definitions, please see
58010 	 * cfa_v3/include/cfa_resources.h.
58011 	 */
58012 	uint8_t	subtype;
58013 	/*
58014 	 * Function ID.
58015 	 * If running on a trusted VF or PF, the fid field can be used to
58016 	 * specify that the function is a non-trusted VF of the parent PF.
58017 	 * If this command is used for the target_id itself, this field is
58018 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
58019 	 * field.
58020 	 */
58021 	uint16_t	fid;
58022 	/*
58023 	 * Session id associated with the firmware. Will be used
58024 	 * for validation if the track type matches.
58025 	 */
58026 	uint16_t	sid;
58027 	/*
58028 	 * Index table index returned during alloc by the
58029 	 * firmware.
58030 	 */
58031 	uint16_t	idx_tbl_id;
58032 	/* The size of the index table entry in bytes. */
58033 	uint16_t	data_size;
58034 	/* Specifies which block this idx table alloc request is for */
58035 	uint8_t	blktype;
58036 	/* CFA block type */
58037 	#define HWRM_TFC_IDX_TBL_SET_INPUT_BLKTYPE_BLKTYPE_CFA	UINT32_C(0x0)
58038 	/* RXP gparse block type */
58039 	#define HWRM_TFC_IDX_TBL_SET_INPUT_BLKTYPE_BLKTYPE_RXP	UINT32_C(0x1)
58040 	/* RE gparse block type */
58041 	#define HWRM_TFC_IDX_TBL_SET_INPUT_BLKTYPE_BLKTYPE_RE_GPARSE UINT32_C(0x2)
58042 	/* TE gparse block type */
58043 	#define HWRM_TFC_IDX_TBL_SET_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE UINT32_C(0x3)
58044 	#define HWRM_TFC_IDX_TBL_SET_INPUT_BLKTYPE_LAST		HWRM_TFC_IDX_TBL_SET_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE
58045 	/* unused. */
58046 	uint8_t	unused0[5];
58047 	/* The location of the dma buffer */
58048 	uint64_t	dma_addr;
58049 	/*
58050 	 * Index table data located at offset 0. If dma bit is set,
58051 	 * then this field contains the DMA buffer pointer.
58052 	 */
58053 	uint8_t	dev_data[96];
58054 } hwrm_tfc_idx_tbl_set_input_t, *phwrm_tfc_idx_tbl_set_input_t;
58055 
58056 /* hwrm_tfc_idx_tbl_set_output (size:128b/16B) */
58057 
58058 typedef struct hwrm_tfc_idx_tbl_set_output {
58059 	/* The specific error status for the command. */
58060 	uint16_t	error_code;
58061 	/* The HWRM command request type. */
58062 	uint16_t	req_type;
58063 	/* The sequence ID from the original command. */
58064 	uint16_t	seq_id;
58065 	/* The length of the response data in number of bytes. */
58066 	uint16_t	resp_len;
58067 	/* unused. */
58068 	uint8_t	unused0[7];
58069 	/*
58070 	 * This field is used in Output records to indicate that the output
58071 	 * is completely written to RAM. This field should be read as '1'
58072 	 * to indicate that the output has been completely written.
58073 	 * When writing a command completion or response to an internal
58074 	 * processor, the order of writes has to be such that this field
58075 	 * is written last.
58076 	 */
58077 	uint8_t	valid;
58078 } hwrm_tfc_idx_tbl_set_output_t, *phwrm_tfc_idx_tbl_set_output_t;
58079 
58080 /************************
58081  * hwrm_tfc_idx_tbl_get *
58082  ************************/
58083 
58084 
58085 /* hwrm_tfc_idx_tbl_get_input (size:320b/40B) */
58086 
58087 typedef struct hwrm_tfc_idx_tbl_get_input {
58088 	/* The HWRM command request type. */
58089 	uint16_t	req_type;
58090 	/*
58091 	 * The completion ring to send the completion event on. This should
58092 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58093 	 */
58094 	uint16_t	cmpl_ring;
58095 	/*
58096 	 * The sequence ID is used by the driver for tracking multiple
58097 	 * commands. This ID is treated as opaque data by the firmware and
58098 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58099 	 */
58100 	uint16_t	seq_id;
58101 	/*
58102 	 * The target ID of the command:
58103 	 * * 0x0-0xFFF8 - The function ID
58104 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58105 	 * * 0xFFFD - Reserved for user-space HWRM interface
58106 	 * * 0xFFFF - HWRM
58107 	 */
58108 	uint16_t	target_id;
58109 	/*
58110 	 * A physical address pointer pointing to a host buffer that the
58111 	 * command's response data will be written. This can be either a host
58112 	 * physical address (HPA) or a guest physical address (GPA) and must
58113 	 * point to a physically contiguous block of memory.
58114 	 */
58115 	uint64_t	resp_addr;
58116 	/* Control flags. */
58117 	uint8_t	flags;
58118 	/* Indicates the flow direction. */
58119 	#define HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_DIR		UINT32_C(0x1)
58120 	/* If this bit set to 0, then it indicates rx flow. */
58121 		#define HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_DIR_RX		UINT32_C(0x0)
58122 	/* If this bit is set to 1, then it indicates tx flow. */
58123 		#define HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_DIR_TX		UINT32_C(0x1)
58124 		#define HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_DIR_LAST	HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_DIR_TX
58125 	/*
58126 	 * When set use the special access register access to clear
58127 	 * the table entry on read.
58128 	 */
58129 	#define HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_CLEAR_ON_READ	UINT32_C(0x2)
58130 	/*
58131 	 * CFA resource subtype. For definitions, please see
58132 	 * cfa_v3/include/cfa_resources.h.
58133 	 */
58134 	uint8_t	subtype;
58135 	/*
58136 	 * Function ID.
58137 	 * If running on a trusted VF or PF, the fid field can be used to
58138 	 * specify that the function is a non-trusted VF of the parent PF.
58139 	 * If this command is used for the target_id itself, this field is
58140 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
58141 	 * field.
58142 	 */
58143 	uint16_t	fid;
58144 	/*
58145 	 * Session id associated with the firmware. Will be used
58146 	 * for validation if the track type matches.
58147 	 */
58148 	uint16_t	sid;
58149 	/*
58150 	 * Index table index returned during alloc by the
58151 	 * firmware.
58152 	 */
58153 	uint16_t	idx_tbl_id;
58154 	/* The size of the index table entry buffer in bytes. */
58155 	uint16_t	buffer_size;
58156 	/* Specifies which block this idx table alloc request is for */
58157 	uint8_t	blktype;
58158 	/* CFA block type */
58159 	#define HWRM_TFC_IDX_TBL_GET_INPUT_BLKTYPE_BLKTYPE_CFA	UINT32_C(0x0)
58160 	/* RXP block type */
58161 	#define HWRM_TFC_IDX_TBL_GET_INPUT_BLKTYPE_BLKTYPE_RXP	UINT32_C(0x1)
58162 	/* RE gparse block type */
58163 	#define HWRM_TFC_IDX_TBL_GET_INPUT_BLKTYPE_BLKTYPE_RE_GPARSE UINT32_C(0x2)
58164 	/* TE gparse block type */
58165 	#define HWRM_TFC_IDX_TBL_GET_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE UINT32_C(0x3)
58166 	#define HWRM_TFC_IDX_TBL_GET_INPUT_BLKTYPE_LAST		HWRM_TFC_IDX_TBL_GET_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE
58167 	/* unused. */
58168 	uint8_t	unused0[5];
58169 	/* The location of the response dma buffer */
58170 	uint64_t	dma_addr;
58171 } hwrm_tfc_idx_tbl_get_input_t, *phwrm_tfc_idx_tbl_get_input_t;
58172 
58173 /* hwrm_tfc_idx_tbl_get_output (size:128b/16B) */
58174 
58175 typedef struct hwrm_tfc_idx_tbl_get_output {
58176 	/* The specific error status for the command. */
58177 	uint16_t	error_code;
58178 	/* The HWRM command request type. */
58179 	uint16_t	req_type;
58180 	/* The sequence ID from the original command. */
58181 	uint16_t	seq_id;
58182 	/* The length of the response data in number of bytes. */
58183 	uint16_t	resp_len;
58184 	/* The size of the index table buffer returned in device size bytes. */
58185 	uint16_t	data_size;
58186 	/* unused */
58187 	uint8_t	unused1[5];
58188 	/*
58189 	 * This field is used in Output records to indicate that the output
58190 	 * is completely written to RAM. This field should be read as '1'
58191 	 * to indicate that the output has been completely written.
58192 	 * When writing a command completion or response to an internal
58193 	 * processor, the order of writes has to be such that this field
58194 	 * is written last.
58195 	 */
58196 	uint8_t	valid;
58197 } hwrm_tfc_idx_tbl_get_output_t, *phwrm_tfc_idx_tbl_get_output_t;
58198 
58199 /*************************
58200  * hwrm_tfc_idx_tbl_free *
58201  *************************/
58202 
58203 
58204 /* hwrm_tfc_idx_tbl_free_input (size:256b/32B) */
58205 
58206 typedef struct hwrm_tfc_idx_tbl_free_input {
58207 	/* The HWRM command request type. */
58208 	uint16_t	req_type;
58209 	/*
58210 	 * The completion ring to send the completion event on. This should
58211 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58212 	 */
58213 	uint16_t	cmpl_ring;
58214 	/*
58215 	 * The sequence ID is used by the driver for tracking multiple
58216 	 * commands. This ID is treated as opaque data by the firmware and
58217 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58218 	 */
58219 	uint16_t	seq_id;
58220 	/*
58221 	 * The target ID of the command:
58222 	 * * 0x0-0xFFF8 - The function ID
58223 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58224 	 * * 0xFFFD - Reserved for user-space HWRM interface
58225 	 * * 0xFFFF - HWRM
58226 	 */
58227 	uint16_t	target_id;
58228 	/*
58229 	 * A physical address pointer pointing to a host buffer that the
58230 	 * command's response data will be written. This can be either a host
58231 	 * physical address (HPA) or a guest physical address (GPA) and must
58232 	 * point to a physically contiguous block of memory.
58233 	 */
58234 	uint64_t	resp_addr;
58235 	/* Control flags. */
58236 	uint8_t	flags;
58237 	/* Indicates the flow direction. */
58238 	#define HWRM_TFC_IDX_TBL_FREE_INPUT_FLAGS_DIR	UINT32_C(0x1)
58239 	/* If this bit set to 0, then it indicates rx flow. */
58240 		#define HWRM_TFC_IDX_TBL_FREE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
58241 	/* If this bit is set to 1, then it indicates tx flow. */
58242 		#define HWRM_TFC_IDX_TBL_FREE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
58243 		#define HWRM_TFC_IDX_TBL_FREE_INPUT_FLAGS_DIR_LAST HWRM_TFC_IDX_TBL_FREE_INPUT_FLAGS_DIR_TX
58244 	/*
58245 	 * CFA resource subtype. For definitions, please see
58246 	 * cfa_v3/include/cfa_resources.h.
58247 	 */
58248 	uint8_t	subtype;
58249 	/*
58250 	 * Function ID.
58251 	 * If running on a trusted VF or PF, the fid field can be used to
58252 	 * specify that the function is a non-trusted VF of the parent PF.
58253 	 * If this command is used for the target_id itself, this field is
58254 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
58255 	 * field.
58256 	 */
58257 	uint16_t	fid;
58258 	/*
58259 	 * Session id associated with the firmware. Will be used
58260 	 * for validation if the track type matches.
58261 	 */
58262 	uint16_t	sid;
58263 	/* Index table id to be freed by the firmware. */
58264 	uint16_t	idx_tbl_id;
58265 	/* Specifies which block this idx table alloc request is for */
58266 	uint8_t	blktype;
58267 	/* CFA block type */
58268 	#define HWRM_TFC_IDX_TBL_FREE_INPUT_BLKTYPE_BLKTYPE_CFA	UINT32_C(0x0)
58269 	/* RXP block type */
58270 	#define HWRM_TFC_IDX_TBL_FREE_INPUT_BLKTYPE_BLKTYPE_RXP	UINT32_C(0x1)
58271 	/* RE parse block type */
58272 	#define HWRM_TFC_IDX_TBL_FREE_INPUT_BLKTYPE_BLKTYPE_RE_GPARSE UINT32_C(0x2)
58273 	/* TE parse block type */
58274 	#define HWRM_TFC_IDX_TBL_FREE_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE UINT32_C(0x3)
58275 	#define HWRM_TFC_IDX_TBL_FREE_INPUT_BLKTYPE_LAST		HWRM_TFC_IDX_TBL_FREE_INPUT_BLKTYPE_BLKTYPE_TE_GPARSE
58276 	/* unused. */
58277 	uint8_t	unused0[7];
58278 } hwrm_tfc_idx_tbl_free_input_t, *phwrm_tfc_idx_tbl_free_input_t;
58279 
58280 /* hwrm_tfc_idx_tbl_free_output (size:128b/16B) */
58281 
58282 typedef struct hwrm_tfc_idx_tbl_free_output {
58283 	/* The specific error status for the command. */
58284 	uint16_t	error_code;
58285 	/* The HWRM command request type. */
58286 	uint16_t	req_type;
58287 	/* The sequence ID from the original command. */
58288 	uint16_t	seq_id;
58289 	/* The length of the response data in number of bytes. */
58290 	uint16_t	resp_len;
58291 	/* Reserved */
58292 	uint8_t	unused0[7];
58293 	/*
58294 	 * This field is used in Output records to indicate that the output
58295 	 * is completely written to RAM. This field should be read as '1'
58296 	 * to indicate that the output has been completely written.
58297 	 * When writing a command completion or response to an internal
58298 	 * processor, the order of writes has to be such that this field
58299 	 * is written last.
58300 	 */
58301 	uint8_t	valid;
58302 } hwrm_tfc_idx_tbl_free_output_t, *phwrm_tfc_idx_tbl_free_output_t;
58303 
58304 /* TruFlow resources request for a global id. */
58305 /* tfc_global_id_hwrm_req (size:64b/8B) */
58306 
58307 typedef struct tfc_global_id_hwrm_req {
58308 	/* Type of the resource, defined in enum cfa_resource_type HCAPI RM. */
58309 	uint16_t	rtype;
58310 	/* Indicates the flow direction in type of cfa_dir. */
58311 	uint16_t	dir;
58312 	/* Subtype of the resource type. */
58313 	uint16_t	subtype;
58314 	/* Number of the type of resources. */
58315 	uint16_t	cnt;
58316 } tfc_global_id_hwrm_req_t, *ptfc_global_id_hwrm_req_t;
58317 
58318 /* The reserved resources for the global id. */
58319 /* tfc_global_id_hwrm_rsp (size:64b/8B) */
58320 
58321 typedef struct tfc_global_id_hwrm_rsp {
58322 	/* Type of the resource, defined in enum cfa_resource_type HCAPI RM. */
58323 	uint16_t	rtype;
58324 	/* Indicates the flow direction in type of cfa_dir. */
58325 	uint16_t	dir;
58326 	/* Subtype of the resource type. */
58327 	uint16_t	subtype;
58328 	/* The global id that the resources reserved for. */
58329 	uint16_t	id;
58330 } tfc_global_id_hwrm_rsp_t, *ptfc_global_id_hwrm_rsp_t;
58331 
58332 /****************************
58333  * hwrm_tfc_global_id_alloc *
58334  ****************************/
58335 
58336 
58337 /* hwrm_tfc_global_id_alloc_input (size:320b/40B) */
58338 
58339 typedef struct hwrm_tfc_global_id_alloc_input {
58340 	/* The HWRM command request type. */
58341 	uint16_t	req_type;
58342 	/*
58343 	 * The completion ring to send the completion event on. This should
58344 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58345 	 */
58346 	uint16_t	cmpl_ring;
58347 	/*
58348 	 * The sequence ID is used by the driver for tracking multiple
58349 	 * commands. This ID is treated as opaque data by the firmware and
58350 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58351 	 */
58352 	uint16_t	seq_id;
58353 	/*
58354 	 * The target ID of the command:
58355 	 * * 0x0-0xFFF8 - The function ID
58356 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58357 	 * * 0xFFFD - Reserved for user-space HWRM interface
58358 	 * * 0xFFFF - HWRM
58359 	 */
58360 	uint16_t	target_id;
58361 	/*
58362 	 * A physical address pointer pointing to a host buffer that the
58363 	 * command's response data will be written. This can be either a host
58364 	 * physical address (HPA) or a guest physical address (GPA) and must
58365 	 * point to a physically contiguous block of memory.
58366 	 */
58367 	uint64_t	resp_addr;
58368 	/*
58369 	 * Function ID.
58370 	 * If running on a trusted VF or PF, the fid field can be used to
58371 	 * specify that the function is a non-trusted VF of the parent PF.
58372 	 * If this command is used for the target_id itself, this field is
58373 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
58374 	 * field.
58375 	 */
58376 	uint16_t	fid;
58377 	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
58378 	uint16_t	sid;
58379 	/* Global domain id. */
58380 	uint16_t	global_id;
58381 	/*
58382 	 * Defines the array size of the provided req_addr and
58383 	 * resv_addr array buffers. Should be set to the number of
58384 	 * request entries.
58385 	 */
58386 	uint16_t	req_cnt;
58387 	/*
58388 	 * This is the DMA address for the request input data array
58389 	 * buffer. Array is of tfc_global_id_hwrm_req type. Size of the
58390 	 * array buffer is provided by the 'req_cnt' field in this
58391 	 * message.
58392 	 */
58393 	uint64_t	req_addr;
58394 	/*
58395 	 * This is the DMA address for the resc output data array
58396 	 * buffer. Array is of tfc_global_id_hwrm_rsp type. Size of the array
58397 	 * buffer is provided by the 'req_cnt' field in this
58398 	 * message.
58399 	 */
58400 	uint64_t	resc_addr;
58401 } hwrm_tfc_global_id_alloc_input_t, *phwrm_tfc_global_id_alloc_input_t;
58402 
58403 /* hwrm_tfc_global_id_alloc_output (size:128b/16B) */
58404 
58405 typedef struct hwrm_tfc_global_id_alloc_output {
58406 	/* The specific error status for the command. */
58407 	uint16_t	error_code;
58408 	/* The HWRM command request type. */
58409 	uint16_t	req_type;
58410 	/* The sequence ID from the original command. */
58411 	uint16_t	seq_id;
58412 	/* The length of the response data in number of bytes. */
58413 	uint16_t	resp_len;
58414 	/*
58415 	 * Size of the returned hwrm_tfc_global_id_req data array. The value
58416 	 * cannot exceed the req_cnt defined by the input msg. The data
58417 	 * array is returned using the resv_addr specified DMA
58418 	 * address also provided by the input msg.
58419 	 */
58420 	uint16_t	rsp_cnt;
58421 	/* Non-zero if this is the first allocation for the global ID. */
58422 	uint8_t	first;
58423 	/* unused. */
58424 	uint8_t	unused0[4];
58425 	/*
58426 	 * This field is used in Output records to indicate that the output
58427 	 * is completely written to RAM. This field should be read as '1'
58428 	 * to indicate that the output has been completely written.
58429 	 * When writing a command completion or response to an internal
58430 	 * processor, the order of writes has to be such that this field
58431 	 * is written last.
58432 	 */
58433 	uint8_t	valid;
58434 } hwrm_tfc_global_id_alloc_output_t, *phwrm_tfc_global_id_alloc_output_t;
58435 
58436 /*********************
58437  * hwrm_tfc_tcam_set *
58438  *********************/
58439 
58440 
58441 /* hwrm_tfc_tcam_set_input (size:1088b/136B) */
58442 
58443 typedef struct hwrm_tfc_tcam_set_input {
58444 	/* The HWRM command request type. */
58445 	uint16_t	req_type;
58446 	/*
58447 	 * The completion ring to send the completion event on. This should
58448 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58449 	 */
58450 	uint16_t	cmpl_ring;
58451 	/*
58452 	 * The sequence ID is used by the driver for tracking multiple
58453 	 * commands. This ID is treated as opaque data by the firmware and
58454 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58455 	 */
58456 	uint16_t	seq_id;
58457 	/*
58458 	 * The target ID of the command:
58459 	 * * 0x0-0xFFF8 - The function ID
58460 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58461 	 * * 0xFFFD - Reserved for user-space HWRM interface
58462 	 * * 0xFFFF - HWRM
58463 	 */
58464 	uint16_t	target_id;
58465 	/*
58466 	 * A physical address pointer pointing to a host buffer that the
58467 	 * command's response data will be written. This can be either a host
58468 	 * physical address (HPA) or a guest physical address (GPA) and must
58469 	 * point to a physically contiguous block of memory.
58470 	 */
58471 	uint64_t	resp_addr;
58472 	/*
58473 	 * Function ID.
58474 	 * If running on a trusted VF or PF, the fid field can be used to
58475 	 * specify that the function is a non-trusted VF of the parent PF.
58476 	 * If this command is used for the target_id itself, this field is
58477 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
58478 	 * field.
58479 	 */
58480 	uint16_t	fid;
58481 	/*
58482 	 * Session id associated with the firmware. Will be used
58483 	 * for validation if the track type matches.
58484 	 */
58485 	uint16_t	sid;
58486 	/* Logical TCAM ID. */
58487 	uint16_t	tcam_id;
58488 	/* Number of bytes in the TCAM key. */
58489 	uint16_t	key_size;
58490 	/* Number of bytes in the TCAM result. */
58491 	uint16_t	result_size;
58492 	/* Control flags. */
58493 	uint8_t	flags;
58494 	/* Indicates the flow direction. */
58495 	#define HWRM_TFC_TCAM_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
58496 	/* If this bit set to 0, then it indicates rx flow. */
58497 		#define HWRM_TFC_TCAM_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
58498 	/* If this bit is set to 1, then it indicates tx flow. */
58499 		#define HWRM_TFC_TCAM_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
58500 		#define HWRM_TFC_TCAM_SET_INPUT_FLAGS_DIR_LAST HWRM_TFC_TCAM_SET_INPUT_FLAGS_DIR_TX
58501 	/* Indicate device data is being sent via DMA. */
58502 	#define HWRM_TFC_TCAM_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
58503 	/*
58504 	 * Subtype of TCAM resource. See
58505 	 * cfa_v3/include/cfa_resources.h.
58506 	 */
58507 	uint8_t	subtype;
58508 	/* unused. */
58509 	uint8_t	unused0[4];
58510 	/* The location of the response dma buffer */
58511 	uint64_t	dma_addr;
58512 	/*
58513 	 * TCAM key located at offset 0, mask located at mask_offset
58514 	 * and result at result_offset for the device.
58515 	 */
58516 	uint8_t	dev_data[96];
58517 } hwrm_tfc_tcam_set_input_t, *phwrm_tfc_tcam_set_input_t;
58518 
58519 /* hwrm_tfc_tcam_set_output (size:128b/16B) */
58520 
58521 typedef struct hwrm_tfc_tcam_set_output {
58522 	/* The specific error status for the command. */
58523 	uint16_t	error_code;
58524 	/* The HWRM command request type. */
58525 	uint16_t	req_type;
58526 	/* The sequence ID from the original command. */
58527 	uint16_t	seq_id;
58528 	/* The length of the response data in number of bytes. */
58529 	uint16_t	resp_len;
58530 	/* unused. */
58531 	uint8_t	unused0[7];
58532 	/*
58533 	 * This field is used in Output records to indicate that the
58534 	 * output is completely written to RAM. This field should be
58535 	 * read as '1' to indicate that the output has been
58536 	 * completely written. When writing a command completion or
58537 	 * response to an internal processor, the order of writes has
58538 	 * to be such that this field is written last.
58539 	 */
58540 	uint8_t	valid;
58541 } hwrm_tfc_tcam_set_output_t, *phwrm_tfc_tcam_set_output_t;
58542 
58543 /*********************
58544  * hwrm_tfc_tcam_get *
58545  *********************/
58546 
58547 
58548 /* hwrm_tfc_tcam_get_input (size:192b/24B) */
58549 
58550 typedef struct hwrm_tfc_tcam_get_input {
58551 	/* The HWRM command request type. */
58552 	uint16_t	req_type;
58553 	/*
58554 	 * The completion ring to send the completion event on. This should
58555 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58556 	 */
58557 	uint16_t	cmpl_ring;
58558 	/*
58559 	 * The sequence ID is used by the driver for tracking multiple
58560 	 * commands. This ID is treated as opaque data by the firmware and
58561 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58562 	 */
58563 	uint16_t	seq_id;
58564 	/*
58565 	 * The target ID of the command:
58566 	 * * 0x0-0xFFF8 - The function ID
58567 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58568 	 * * 0xFFFD - Reserved for user-space HWRM interface
58569 	 * * 0xFFFF - HWRM
58570 	 */
58571 	uint16_t	target_id;
58572 	/*
58573 	 * A physical address pointer pointing to a host buffer that the
58574 	 * command's response data will be written. This can be either a host
58575 	 * physical address (HPA) or a guest physical address (GPA) and must
58576 	 * point to a physically contiguous block of memory.
58577 	 */
58578 	uint64_t	resp_addr;
58579 	/* Control flags. */
58580 	uint8_t	flags;
58581 	/* Indicates the flow direction. */
58582 	#define HWRM_TFC_TCAM_GET_INPUT_FLAGS_DIR	UINT32_C(0x1)
58583 	/* If this bit set to 0, then it indicates rx flow. */
58584 		#define HWRM_TFC_TCAM_GET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
58585 	/* If this bit is set to 1, then it indicates tx flow. */
58586 		#define HWRM_TFC_TCAM_GET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
58587 		#define HWRM_TFC_TCAM_GET_INPUT_FLAGS_DIR_LAST HWRM_TFC_TCAM_GET_INPUT_FLAGS_DIR_TX
58588 	/*
58589 	 * Subtype of TCAM resource See
58590 	 * cfa_v3/include/cfa_resources.h.
58591 	 */
58592 	uint8_t	subtype;
58593 	/*
58594 	 * Function ID.
58595 	 * If running on a trusted VF or PF, the fid field can be used to
58596 	 * specify that the function is a non-trusted VF of the parent PF.
58597 	 * If this command is used for the target_id itself, this field is
58598 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
58599 	 * field.
58600 	 */
58601 	uint16_t	fid;
58602 	/*
58603 	 * Session id associated with the firmware. Will be used
58604 	 * for validation if the track type matches.
58605 	 */
58606 	uint16_t	sid;
58607 	/* Logical TCAM ID. */
58608 	uint16_t	tcam_id;
58609 } hwrm_tfc_tcam_get_input_t, *phwrm_tfc_tcam_get_input_t;
58610 
58611 /* hwrm_tfc_tcam_get_output (size:2368b/296B) */
58612 
58613 typedef struct hwrm_tfc_tcam_get_output {
58614 	/* The specific error status for the command. */
58615 	uint16_t	error_code;
58616 	/* The HWRM command request type. */
58617 	uint16_t	req_type;
58618 	/* The sequence ID from the original command. */
58619 	uint16_t	seq_id;
58620 	/* The length of the response data in number of bytes. */
58621 	uint16_t	resp_len;
58622 	/* Number of bytes in the TCAM key. */
58623 	uint16_t	key_size;
58624 	/* Number of bytes in the TCAM result. */
58625 	uint16_t	result_size;
58626 	/* unused. */
58627 	uint8_t	unused0[4];
58628 	/*
58629 	 * TCAM key located at offset 0, mask located at key_size
58630 	 * and result at 2 * key_size for the device.
58631 	 */
58632 	uint8_t	dev_data[272];
58633 	/* unused. */
58634 	uint8_t	unused1[7];
58635 	/*
58636 	 * This field is used in Output records to indicate that the
58637 	 * output is completely written to RAM. This field should be
58638 	 * read as '1' to indicate that the output has been
58639 	 * completely written. When writing a command completion or
58640 	 * response to an internal processor, the order of writes has
58641 	 * to be such that this field is written last.
58642 	 */
58643 	uint8_t	valid;
58644 } hwrm_tfc_tcam_get_output_t, *phwrm_tfc_tcam_get_output_t;
58645 
58646 /***********************
58647  * hwrm_tfc_tcam_alloc *
58648  ***********************/
58649 
58650 
58651 /* hwrm_tfc_tcam_alloc_input (size:256b/32B) */
58652 
58653 typedef struct hwrm_tfc_tcam_alloc_input {
58654 	/* The HWRM command request type. */
58655 	uint16_t	req_type;
58656 	/*
58657 	 * The completion ring to send the completion event on. This should
58658 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58659 	 */
58660 	uint16_t	cmpl_ring;
58661 	/*
58662 	 * The sequence ID is used by the driver for tracking multiple
58663 	 * commands. This ID is treated as opaque data by the firmware and
58664 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58665 	 */
58666 	uint16_t	seq_id;
58667 	/*
58668 	 * The target ID of the command:
58669 	 * * 0x0-0xFFF8 - The function ID
58670 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58671 	 * * 0xFFFD - Reserved for user-space HWRM interface
58672 	 * * 0xFFFF - HWRM
58673 	 */
58674 	uint16_t	target_id;
58675 	/*
58676 	 * A physical address pointer pointing to a host buffer that the
58677 	 * command's response data will be written. This can be either a host
58678 	 * physical address (HPA) or a guest physical address (GPA) and must
58679 	 * point to a physically contiguous block of memory.
58680 	 */
58681 	uint64_t	resp_addr;
58682 	/* Control flags. */
58683 	uint8_t	flags;
58684 	/* Indicates the flow direction. */
58685 	#define HWRM_TFC_TCAM_ALLOC_INPUT_FLAGS_DIR	UINT32_C(0x1)
58686 	/* If this bit set to 0, then it indicates rx flow. */
58687 		#define HWRM_TFC_TCAM_ALLOC_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
58688 	/* If this bit is set to 1, then it indicates tx flow. */
58689 		#define HWRM_TFC_TCAM_ALLOC_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
58690 		#define HWRM_TFC_TCAM_ALLOC_INPUT_FLAGS_DIR_LAST HWRM_TFC_TCAM_ALLOC_INPUT_FLAGS_DIR_TX
58691 	/*
58692 	 * Subtype of TCAM resource. See
58693 	 * cfa_v3/include/cfa_resources.h.
58694 	 */
58695 	uint8_t	subtype;
58696 	/*
58697 	 * Function ID.
58698 	 * If running on a trusted VF or PF, the fid field can be used to
58699 	 * specify that the function is a non-trusted VF of the parent PF.
58700 	 * If this command is used for the target_id itself, this field is
58701 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
58702 	 * field.
58703 	 */
58704 	uint16_t	fid;
58705 	/*
58706 	 * Unique session id for the session created by the
58707 	 * firmware. Will be used to track this index table entry
58708 	 * only if track type is track_type_sid.
58709 	 */
58710 	uint16_t	sid;
58711 	/* Number of bytes in the TCAM key. */
58712 	uint16_t	key_size;
58713 	/* Entry priority. */
58714 	uint16_t	priority;
58715 	/* Describes the type of tracking id to be used */
58716 	uint8_t	track_type;
58717 	/* Invalid track type */
58718 	#define HWRM_TFC_TCAM_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_INVALID UINT32_C(0x0)
58719 	/* Tracked by session id */
58720 	#define HWRM_TFC_TCAM_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_SID	UINT32_C(0x1)
58721 	/* Tracked by function id */
58722 	#define HWRM_TFC_TCAM_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_FID	UINT32_C(0x2)
58723 	#define HWRM_TFC_TCAM_ALLOC_INPUT_TRACK_TYPE_LAST		HWRM_TFC_TCAM_ALLOC_INPUT_TRACK_TYPE_TRACK_TYPE_FID
58724 	/* Unused. */
58725 	uint8_t	unused0[5];
58726 } hwrm_tfc_tcam_alloc_input_t, *phwrm_tfc_tcam_alloc_input_t;
58727 
58728 /* hwrm_tfc_tcam_alloc_output (size:128b/16B) */
58729 
58730 typedef struct hwrm_tfc_tcam_alloc_output {
58731 	/* The specific error status for the command. */
58732 	uint16_t	error_code;
58733 	/* The HWRM command request type. */
58734 	uint16_t	req_type;
58735 	/* The sequence ID from the original command. */
58736 	uint16_t	seq_id;
58737 	/* The length of the response data in number of bytes. */
58738 	uint16_t	resp_len;
58739 	/*
58740 	 * Index table entry allocated by the firmware using the
58741 	 * parameters above.
58742 	 */
58743 	uint16_t	idx;
58744 	/* Reserved */
58745 	uint8_t	unused0[5];
58746 	/*
58747 	 * This field is used in Output records to indicate that the output
58748 	 * is completely written to RAM. This field should be read as '1'
58749 	 * to indicate that the output has been completely written.
58750 	 * When writing a command completion or response to an internal
58751 	 * processor, the order of writes has to be such that this field
58752 	 * is written last.
58753 	 */
58754 	uint8_t	valid;
58755 } hwrm_tfc_tcam_alloc_output_t, *phwrm_tfc_tcam_alloc_output_t;
58756 
58757 /***************************
58758  * hwrm_tfc_tcam_alloc_set *
58759  ***************************/
58760 
58761 
58762 /* hwrm_tfc_tcam_alloc_set_input (size:1088b/136B) */
58763 
58764 typedef struct hwrm_tfc_tcam_alloc_set_input {
58765 	/* The HWRM command request type. */
58766 	uint16_t	req_type;
58767 	/*
58768 	 * The completion ring to send the completion event on. This should
58769 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58770 	 */
58771 	uint16_t	cmpl_ring;
58772 	/*
58773 	 * The sequence ID is used by the driver for tracking multiple
58774 	 * commands. This ID is treated as opaque data by the firmware and
58775 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58776 	 */
58777 	uint16_t	seq_id;
58778 	/*
58779 	 * The target ID of the command:
58780 	 * * 0x0-0xFFF8 - The function ID
58781 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58782 	 * * 0xFFFD - Reserved for user-space HWRM interface
58783 	 * * 0xFFFF - HWRM
58784 	 */
58785 	uint16_t	target_id;
58786 	/*
58787 	 * A physical address pointer pointing to a host buffer that the
58788 	 * command's response data will be written. This can be either a host
58789 	 * physical address (HPA) or a guest physical address (GPA) and must
58790 	 * point to a physically contiguous block of memory.
58791 	 */
58792 	uint64_t	resp_addr;
58793 	/* Control flags. */
58794 	uint8_t	flags;
58795 	/* Indicates the flow direction. */
58796 	#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
58797 	/* If this bit set to 0, then it indicates rx flow. */
58798 		#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
58799 	/* If this bit is set to 1, then it indicates tx flow. */
58800 		#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
58801 		#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_FLAGS_DIR_LAST HWRM_TFC_TCAM_ALLOC_SET_INPUT_FLAGS_DIR_TX
58802 	/* Indicate device data is being sent via DMA. */
58803 	#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_FLAGS_DMA	UINT32_C(0x2)
58804 	/*
58805 	 * Subtype of TCAM resource. See
58806 	 * cfa_v3/include/cfa_resources.h.
58807 	 */
58808 	uint8_t	subtype;
58809 	/*
58810 	 * Function ID.
58811 	 * If running on a trusted VF or PF, the fid field can be used to
58812 	 * specify that the function is a non-trusted VF of the parent PF.
58813 	 * If this command is used for the target_id itself, this field is
58814 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
58815 	 * field.
58816 	 */
58817 	uint16_t	fid;
58818 	/*
58819 	 * Unique session id for the session created by the
58820 	 * firmware. Will be used to track this index table entry
58821 	 * only if track type is track_type_sid.
58822 	 */
58823 	uint16_t	sid;
58824 	/* Number of bytes in the TCAM key. */
58825 	uint16_t	key_size;
58826 	/* The size of the TCAM table entry in bytes. */
58827 	uint16_t	result_size;
58828 	/* Entry priority. */
58829 	uint16_t	priority;
58830 	/* Describes the type of tracking id to be used */
58831 	uint8_t	track_type;
58832 	/* Invalid track type */
58833 	#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_INVALID UINT32_C(0x0)
58834 	/* Tracked by session id */
58835 	#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_SID	UINT32_C(0x1)
58836 	/* Tracked by function id */
58837 	#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_FID	UINT32_C(0x2)
58838 	#define HWRM_TFC_TCAM_ALLOC_SET_INPUT_TRACK_TYPE_LAST		HWRM_TFC_TCAM_ALLOC_SET_INPUT_TRACK_TYPE_TRACK_TYPE_FID
58839 	/* Unused */
58840 	uint8_t	unused[3];
58841 	/* The location of the response dma buffer */
58842 	uint64_t	dma_addr;
58843 	/*
58844 	 * Index table data located at offset 0. If dma bit is set,
58845 	 * then this field contains the DMA buffer pointer.
58846 	 */
58847 	uint8_t	dev_data[96];
58848 } hwrm_tfc_tcam_alloc_set_input_t, *phwrm_tfc_tcam_alloc_set_input_t;
58849 
58850 /* hwrm_tfc_tcam_alloc_set_output (size:128b/16B) */
58851 
58852 typedef struct hwrm_tfc_tcam_alloc_set_output {
58853 	/* The specific error status for the command. */
58854 	uint16_t	error_code;
58855 	/* The HWRM command request type. */
58856 	uint16_t	req_type;
58857 	/* The sequence ID from the original command. */
58858 	uint16_t	seq_id;
58859 	/* The length of the response data in number of bytes. */
58860 	uint16_t	resp_len;
58861 	/* Logical TCAM ID. */
58862 	uint16_t	tcam_id;
58863 	/* Reserved */
58864 	uint8_t	unused0[5];
58865 	/*
58866 	 * This field is used in Output records to indicate that the output
58867 	 * is completely written to RAM. This field should be read as '1'
58868 	 * to indicate that the output has been completely written.
58869 	 * When writing a command completion or response to an internal
58870 	 * processor, the order of writes has to be such that this field
58871 	 * is written last.
58872 	 */
58873 	uint8_t	valid;
58874 } hwrm_tfc_tcam_alloc_set_output_t, *phwrm_tfc_tcam_alloc_set_output_t;
58875 
58876 /**********************
58877  * hwrm_tfc_tcam_free *
58878  **********************/
58879 
58880 
58881 /* hwrm_tfc_tcam_free_input (size:192b/24B) */
58882 
58883 typedef struct hwrm_tfc_tcam_free_input {
58884 	/* The HWRM command request type. */
58885 	uint16_t	req_type;
58886 	/*
58887 	 * The completion ring to send the completion event on. This should
58888 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58889 	 */
58890 	uint16_t	cmpl_ring;
58891 	/*
58892 	 * The sequence ID is used by the driver for tracking multiple
58893 	 * commands. This ID is treated as opaque data by the firmware and
58894 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58895 	 */
58896 	uint16_t	seq_id;
58897 	/*
58898 	 * The target ID of the command:
58899 	 * * 0x0-0xFFF8 - The function ID
58900 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58901 	 * * 0xFFFD - Reserved for user-space HWRM interface
58902 	 * * 0xFFFF - HWRM
58903 	 */
58904 	uint16_t	target_id;
58905 	/*
58906 	 * A physical address pointer pointing to a host buffer that the
58907 	 * command's response data will be written. This can be either a host
58908 	 * physical address (HPA) or a guest physical address (GPA) and must
58909 	 * point to a physically contiguous block of memory.
58910 	 */
58911 	uint64_t	resp_addr;
58912 	/* Control flags. */
58913 	uint8_t	flags;
58914 	/* Indicates the flow direction. */
58915 	#define HWRM_TFC_TCAM_FREE_INPUT_FLAGS_DIR	UINT32_C(0x1)
58916 	/* If this bit set to 0, then it indicates rx flow. */
58917 		#define HWRM_TFC_TCAM_FREE_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
58918 	/* If this bit is set to 1, then it indicates tx flow. */
58919 		#define HWRM_TFC_TCAM_FREE_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
58920 		#define HWRM_TFC_TCAM_FREE_INPUT_FLAGS_DIR_LAST HWRM_TFC_TCAM_FREE_INPUT_FLAGS_DIR_TX
58921 	/*
58922 	 * Subtype of TCAM resource. See
58923 	 * cfa_v3/include/cfa_resources.h.
58924 	 */
58925 	uint8_t	subtype;
58926 	/*
58927 	 * Function ID.
58928 	 * If running on a trusted VF or PF, the fid field can be used to
58929 	 * specify that the function is a non-trusted VF of the parent PF.
58930 	 * If this command is used for the target_id itself, this field is
58931 	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
58932 	 * field.
58933 	 */
58934 	uint16_t	fid;
58935 	/*
58936 	 * Session id associated with the firmware. Will be used
58937 	 * for validation if the track type matches.
58938 	 */
58939 	uint16_t	sid;
58940 	/* Logical TCAM ID. */
58941 	uint16_t	tcam_id;
58942 } hwrm_tfc_tcam_free_input_t, *phwrm_tfc_tcam_free_input_t;
58943 
58944 /* hwrm_tfc_tcam_free_output (size:128b/16B) */
58945 
58946 typedef struct hwrm_tfc_tcam_free_output {
58947 	/* The specific error status for the command. */
58948 	uint16_t	error_code;
58949 	/* The HWRM command request type. */
58950 	uint16_t	req_type;
58951 	/* The sequence ID from the original command. */
58952 	uint16_t	seq_id;
58953 	/* The length of the response data in number of bytes. */
58954 	uint16_t	resp_len;
58955 	/* Reserved */
58956 	uint8_t	unused0[7];
58957 	/*
58958 	 * This field is used in Output records to indicate that the output
58959 	 * is completely written to RAM. This field should be read as '1'
58960 	 * to indicate that the output has been completely written.
58961 	 * When writing a command completion or response to an internal
58962 	 * processor, the order of writes has to be such that this field
58963 	 * is written last.
58964 	 */
58965 	uint8_t	valid;
58966 } hwrm_tfc_tcam_free_output_t, *phwrm_tfc_tcam_free_output_t;
58967 
58968 /***********************
58969  * hwrm_tfc_if_tbl_set *
58970  ***********************/
58971 
58972 
58973 /* hwrm_tfc_if_tbl_set_input (size:960b/120B) */
58974 
58975 typedef struct hwrm_tfc_if_tbl_set_input {
58976 	/* The HWRM command request type. */
58977 	uint16_t	req_type;
58978 	/*
58979 	 * The completion ring to send the completion event on. This should
58980 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
58981 	 */
58982 	uint16_t	cmpl_ring;
58983 	/*
58984 	 * The sequence ID is used by the driver for tracking multiple
58985 	 * commands. This ID is treated as opaque data by the firmware and
58986 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
58987 	 */
58988 	uint16_t	seq_id;
58989 	/*
58990 	 * The target ID of the command:
58991 	 * * 0x0-0xFFF8 - The function ID
58992 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
58993 	 * * 0xFFFD - Reserved for user-space HWRM interface
58994 	 * * 0xFFFF - HWRM
58995 	 */
58996 	uint16_t	target_id;
58997 	/*
58998 	 * A physical address pointer pointing to a host buffer that the
58999 	 * command's response data will be written. This can be either a host
59000 	 * physical address (HPA) or a guest physical address (GPA) and must
59001 	 * point to a physically contiguous block of memory.
59002 	 */
59003 	uint64_t	resp_addr;
59004 	/* Session identifier. */
59005 	uint16_t	sid;
59006 	/* Function identifier. */
59007 	uint16_t	fid;
59008 	/*
59009 	 * Subtype identifying IF table type. See
59010 	 * cfa_v3/include/cfa_resources.h.
59011 	 */
59012 	uint8_t	subtype;
59013 	/* Control flags. */
59014 	uint8_t	flags;
59015 	/* Indicates the flow direction. */
59016 	#define HWRM_TFC_IF_TBL_SET_INPUT_FLAGS_DIR	UINT32_C(0x1)
59017 	/* If this bit set to 0, then it indicates rx flow. */
59018 		#define HWRM_TFC_IF_TBL_SET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
59019 	/* If this bit is set to 1, then it indicates tx flow. */
59020 		#define HWRM_TFC_IF_TBL_SET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
59021 		#define HWRM_TFC_IF_TBL_SET_INPUT_FLAGS_DIR_LAST HWRM_TFC_IF_TBL_SET_INPUT_FLAGS_DIR_TX
59022 	/* Table entry index. */
59023 	uint16_t	index;
59024 	/* Size of data in data field. */
59025 	uint8_t	data_size;
59026 	/* Reserved */
59027 	uint8_t	unused0[7];
59028 	/* Table data. */
59029 	uint8_t	data[88];
59030 } hwrm_tfc_if_tbl_set_input_t, *phwrm_tfc_if_tbl_set_input_t;
59031 
59032 /* hwrm_tfc_if_tbl_set_output (size:128b/16B) */
59033 
59034 typedef struct hwrm_tfc_if_tbl_set_output {
59035 	/* The specific error status for the command. */
59036 	uint16_t	error_code;
59037 	/* The HWRM command request type. */
59038 	uint16_t	req_type;
59039 	/* The sequence ID from the original command. */
59040 	uint16_t	seq_id;
59041 	/* The length of the response data in number of bytes. */
59042 	uint16_t	resp_len;
59043 	/* Reserved */
59044 	uint8_t	unused0[7];
59045 	/*
59046 	 * This field is used in Output records to indicate that the output
59047 	 * is completely written to RAM. This field should be read as '1'
59048 	 * to indicate that the output has been completely written.
59049 	 * When writing a command completion or response to an internal
59050 	 * processor, the order of writes has to be such that this field
59051 	 * is written last.
59052 	 */
59053 	uint8_t	valid;
59054 } hwrm_tfc_if_tbl_set_output_t, *phwrm_tfc_if_tbl_set_output_t;
59055 
59056 /***********************
59057  * hwrm_tfc_if_tbl_get *
59058  ***********************/
59059 
59060 
59061 /* hwrm_tfc_if_tbl_get_input (size:256b/32B) */
59062 
59063 typedef struct hwrm_tfc_if_tbl_get_input {
59064 	/* The HWRM command request type. */
59065 	uint16_t	req_type;
59066 	/*
59067 	 * The completion ring to send the completion event on. This should
59068 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59069 	 */
59070 	uint16_t	cmpl_ring;
59071 	/*
59072 	 * The sequence ID is used by the driver for tracking multiple
59073 	 * commands. This ID is treated as opaque data by the firmware and
59074 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59075 	 */
59076 	uint16_t	seq_id;
59077 	/*
59078 	 * The target ID of the command:
59079 	 * * 0x0-0xFFF8 - The function ID
59080 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59081 	 * * 0xFFFD - Reserved for user-space HWRM interface
59082 	 * * 0xFFFF - HWRM
59083 	 */
59084 	uint16_t	target_id;
59085 	/*
59086 	 * A physical address pointer pointing to a host buffer that the
59087 	 * command's response data will be written. This can be either a host
59088 	 * physical address (HPA) or a guest physical address (GPA) and must
59089 	 * point to a physically contiguous block of memory.
59090 	 */
59091 	uint64_t	resp_addr;
59092 	/* Session identifier. */
59093 	uint16_t	sid;
59094 	/* Function identifier. */
59095 	uint16_t	fid;
59096 	/*
59097 	 * Subtype identifying IF table type. See
59098 	 * cfa_v3/include/cfa_resources.h.
59099 	 */
59100 	uint8_t	subtype;
59101 	/* Control flags. */
59102 	uint8_t	flags;
59103 	/* Indicates the flow direction. */
59104 	#define HWRM_TFC_IF_TBL_GET_INPUT_FLAGS_DIR	UINT32_C(0x1)
59105 	/* If this bit set to 0, then it indicates rx flow. */
59106 		#define HWRM_TFC_IF_TBL_GET_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
59107 	/* If this bit is set to 1, then it indicates tx flow. */
59108 		#define HWRM_TFC_IF_TBL_GET_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
59109 		#define HWRM_TFC_IF_TBL_GET_INPUT_FLAGS_DIR_LAST HWRM_TFC_IF_TBL_GET_INPUT_FLAGS_DIR_TX
59110 	/* Table entry index. */
59111 	uint16_t	index;
59112 	/* Size of data in data field. */
59113 	uint8_t	data_size;
59114 	/* Reserved */
59115 	uint8_t	unused0[7];
59116 } hwrm_tfc_if_tbl_get_input_t, *phwrm_tfc_if_tbl_get_input_t;
59117 
59118 /* hwrm_tfc_if_tbl_get_output (size:960b/120B) */
59119 
59120 typedef struct hwrm_tfc_if_tbl_get_output {
59121 	/* The specific error status for the command. */
59122 	uint16_t	error_code;
59123 	/* The HWRM command request type. */
59124 	uint16_t	req_type;
59125 	/* The sequence ID from the original command. */
59126 	uint16_t	seq_id;
59127 	/* The length of the response data in number of bytes. */
59128 	uint16_t	resp_len;
59129 	/* Session identifier. */
59130 	uint16_t	sid;
59131 	/* Function identifier. */
59132 	uint16_t	fid;
59133 	/*
59134 	 * Subtype identifying IF table type. See
59135 	 * cfa_v3/include/cfa_resources.h.
59136 	 */
59137 	uint8_t	subtype;
59138 	/* Control flags. */
59139 	uint8_t	flags;
59140 	/* Indicates the flow direction. */
59141 	#define HWRM_TFC_IF_TBL_GET_OUTPUT_FLAGS_DIR	UINT32_C(0x1)
59142 	/* If this bit set to 0, then it indicates rx flow. */
59143 		#define HWRM_TFC_IF_TBL_GET_OUTPUT_FLAGS_DIR_RX	UINT32_C(0x0)
59144 	/* If this bit is set to 1, then it indicates tx flow. */
59145 		#define HWRM_TFC_IF_TBL_GET_OUTPUT_FLAGS_DIR_TX	UINT32_C(0x1)
59146 		#define HWRM_TFC_IF_TBL_GET_OUTPUT_FLAGS_DIR_LAST HWRM_TFC_IF_TBL_GET_OUTPUT_FLAGS_DIR_TX
59147 	/* Table entry index. */
59148 	uint16_t	index;
59149 	/* Size of data in data field. */
59150 	uint8_t	data_size;
59151 	/* Reserved */
59152 	uint8_t	unused0[7];
59153 	/* Table data. */
59154 	uint8_t	data[88];
59155 	/* Reserved */
59156 	uint8_t	unused1[7];
59157 	/*
59158 	 * This field is used in Output records to indicate that the output
59159 	 * is completely written to RAM. This field should be read as '1'
59160 	 * to indicate that the output has been completely written.
59161 	 * When writing a command completion or response to an internal
59162 	 * processor, the order of writes has to be such that this field
59163 	 * is written last.
59164 	 */
59165 	uint8_t	valid;
59166 } hwrm_tfc_if_tbl_get_output_t, *phwrm_tfc_if_tbl_get_output_t;
59167 
59168 /*********************************
59169  * hwrm_tfc_tbl_scope_config_get *
59170  *********************************/
59171 
59172 
59173 /* TruFlow command to return whether the table scope is fully configured. */
59174 /* hwrm_tfc_tbl_scope_config_get_input (size:192b/24B) */
59175 
59176 typedef struct hwrm_tfc_tbl_scope_config_get_input {
59177 	/* The HWRM command request type. */
59178 	uint16_t	req_type;
59179 	/*
59180 	 * The completion ring to send the completion event on. This should
59181 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59182 	 */
59183 	uint16_t	cmpl_ring;
59184 	/*
59185 	 * The sequence ID is used by the driver for tracking multiple
59186 	 * commands. This ID is treated as opaque data by the firmware and
59187 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59188 	 */
59189 	uint16_t	seq_id;
59190 	/*
59191 	 * The target ID of the command:
59192 	 * * 0x0-0xFFF8 - The function ID
59193 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59194 	 * * 0xFFFD - Reserved for user-space HWRM interface
59195 	 * * 0xFFFF - HWRM
59196 	 */
59197 	uint16_t	target_id;
59198 	/*
59199 	 * A physical address pointer pointing to a host buffer that the
59200 	 * command's response data will be written. This can be either a host
59201 	 * physical address (HPA) or a guest physical address (GPA) and must
59202 	 * point to a physically contiguous block of memory.
59203 	 */
59204 	uint64_t	resp_addr;
59205 	/* The table scope ID. */
59206 	uint8_t	tsid;
59207 	/* unused. */
59208 	uint8_t	unused0[7];
59209 } hwrm_tfc_tbl_scope_config_get_input_t, *phwrm_tfc_tbl_scope_config_get_input_t;
59210 
59211 /* hwrm_tfc_tbl_scope_config_get_output (size:128b/16B) */
59212 
59213 typedef struct hwrm_tfc_tbl_scope_config_get_output {
59214 	/* The specific error status for the command. */
59215 	uint16_t	error_code;
59216 	/* The HWRM command request type. */
59217 	uint16_t	req_type;
59218 	/* The sequence ID from the original command. */
59219 	uint16_t	seq_id;
59220 	/* The length of the response data in number of bytes. */
59221 	uint16_t	resp_len;
59222 	/* If set to 1, the table scope is configured. */
59223 	uint8_t	configured;
59224 	/* unused. */
59225 	uint8_t	unused0[6];
59226 	/*
59227 	 * This field is used in Output records to indicate that the output
59228 	 * is completely written to RAM. This field should be read as '1'
59229 	 * to indicate that the output has been completely written.
59230 	 * When writing a command completion or response to an internal
59231 	 * processor, the order of writes has to be such that this field
59232 	 * is written last.
59233 	 */
59234 	uint8_t	valid;
59235 } hwrm_tfc_tbl_scope_config_get_output_t, *phwrm_tfc_tbl_scope_config_get_output_t;
59236 
59237 /*****************************
59238  * hwrm_tfc_resc_usage_query *
59239  *****************************/
59240 
59241 
59242 /* hwrm_tfc_resc_usage_query_input (size:256b/32B) */
59243 
59244 typedef struct hwrm_tfc_resc_usage_query_input {
59245 	/* The HWRM command request type. */
59246 	uint16_t	req_type;
59247 	/*
59248 	 * The completion ring to send the completion event on. This should
59249 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59250 	 */
59251 	uint16_t	cmpl_ring;
59252 	/*
59253 	 * The sequence ID is used by the driver for tracking multiple
59254 	 * commands. This ID is treated as opaque data by the firmware and
59255 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59256 	 */
59257 	uint16_t	seq_id;
59258 	/*
59259 	 * The target ID of the command:
59260 	 * * 0x0-0xFFF8 - The function ID
59261 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59262 	 * * 0xFFFD - Reserved for user-space HWRM interface
59263 	 * * 0xFFFF - HWRM
59264 	 */
59265 	uint16_t	target_id;
59266 	/*
59267 	 * A physical address pointer pointing to a host buffer that the
59268 	 * command's response data will be written. This can be either a host
59269 	 * physical address (HPA) or a guest physical address (GPA) and must
59270 	 * point to a physically contiguous block of memory.
59271 	 */
59272 	uint64_t	resp_addr;
59273 	/* Session identifier. */
59274 	uint16_t	sid;
59275 	/* Function identifier. */
59276 	uint16_t	fid;
59277 	/* Control flags. */
59278 	uint8_t	flags;
59279 	/* Indicates the flow direction. */
59280 	#define HWRM_TFC_RESC_USAGE_QUERY_INPUT_FLAGS_DIR	UINT32_C(0x1)
59281 	/* If this bit set to 0, then it indicates rx flow. */
59282 		#define HWRM_TFC_RESC_USAGE_QUERY_INPUT_FLAGS_DIR_RX	UINT32_C(0x0)
59283 	/* If this bit is set to 1, then it indicates tx flow. */
59284 		#define HWRM_TFC_RESC_USAGE_QUERY_INPUT_FLAGS_DIR_TX	UINT32_C(0x1)
59285 		#define HWRM_TFC_RESC_USAGE_QUERY_INPUT_FLAGS_DIR_LAST HWRM_TFC_RESC_USAGE_QUERY_INPUT_FLAGS_DIR_TX
59286 	/* Describes the type of tracking id to be used */
59287 	uint8_t	track_type;
59288 	/* Invalid track type */
59289 	#define HWRM_TFC_RESC_USAGE_QUERY_INPUT_TRACK_TYPE_TRACK_TYPE_INVALID UINT32_C(0x0)
59290 	/* Tracked by session id */
59291 	#define HWRM_TFC_RESC_USAGE_QUERY_INPUT_TRACK_TYPE_TRACK_TYPE_SID	UINT32_C(0x1)
59292 	/* Tracked by function id */
59293 	#define HWRM_TFC_RESC_USAGE_QUERY_INPUT_TRACK_TYPE_TRACK_TYPE_FID	UINT32_C(0x2)
59294 	#define HWRM_TFC_RESC_USAGE_QUERY_INPUT_TRACK_TYPE_LAST		HWRM_TFC_RESC_USAGE_QUERY_INPUT_TRACK_TYPE_TRACK_TYPE_FID
59295 	/* Size of data in data field. */
59296 	uint16_t	data_size;
59297 	/* unused */
59298 	uint8_t	unused1[8];
59299 } hwrm_tfc_resc_usage_query_input_t, *phwrm_tfc_resc_usage_query_input_t;
59300 
59301 /* hwrm_tfc_resc_usage_query_output (size:960b/120B) */
59302 
59303 typedef struct hwrm_tfc_resc_usage_query_output {
59304 	/* The specific error status for the command. */
59305 	uint16_t	error_code;
59306 	/* The HWRM command request type. */
59307 	uint16_t	req_type;
59308 	/* The sequence ID from the original command. */
59309 	uint16_t	seq_id;
59310 	/* The length of the response data in number of bytes. */
59311 	uint16_t	resp_len;
59312 	/* Response code. */
59313 	uint32_t	resp_code;
59314 	/* Size of data in data field. */
59315 	uint16_t	data_size;
59316 	/* unused */
59317 	uint16_t	unused0;
59318 	/* Response data. */
59319 	uint8_t	data[96];
59320 	/* unused */
59321 	uint8_t	unused1[7];
59322 	/*
59323 	 * This field is used in Output records to indicate that the output
59324 	 * is completely written to RAM. This field should be read as '1'
59325 	 * to indicate that the output has been completely written.
59326 	 * When writing a command completion or response to an internal
59327 	 * processor, the order of writes has to be such that this field
59328 	 * is written last.
59329 	 */
59330 	uint8_t	valid;
59331 } hwrm_tfc_resc_usage_query_output_t, *phwrm_tfc_resc_usage_query_output_t;
59332 
59333 /******************************
59334  * hwrm_tunnel_dst_port_query *
59335  ******************************/
59336 
59337 
59338 /* hwrm_tunnel_dst_port_query_input (size:192b/24B) */
59339 
59340 typedef struct hwrm_tunnel_dst_port_query_input {
59341 	/* The HWRM command request type. */
59342 	uint16_t	req_type;
59343 	/*
59344 	 * The completion ring to send the completion event on. This should
59345 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59346 	 */
59347 	uint16_t	cmpl_ring;
59348 	/*
59349 	 * The sequence ID is used by the driver for tracking multiple
59350 	 * commands. This ID is treated as opaque data by the firmware and
59351 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59352 	 */
59353 	uint16_t	seq_id;
59354 	/*
59355 	 * The target ID of the command:
59356 	 * * 0x0-0xFFF8 - The function ID
59357 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59358 	 * * 0xFFFD - Reserved for user-space HWRM interface
59359 	 * * 0xFFFF - HWRM
59360 	 */
59361 	uint16_t	target_id;
59362 	/*
59363 	 * A physical address pointer pointing to a host buffer that the
59364 	 * command's response data will be written. This can be either a host
59365 	 * physical address (HPA) or a guest physical address (GPA) and must
59366 	 * point to a physically contiguous block of memory.
59367 	 */
59368 	uint64_t	resp_addr;
59369 	/* Tunnel Type. */
59370 	uint8_t	tunnel_type;
59371 	/* Virtual eXtensible Local Area Network (VXLAN) */
59372 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN		UINT32_C(0x1)
59373 	/* Generic Network Virtualization Encapsulation (Geneve) */
59374 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE		UINT32_C(0x5)
59375 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
59376 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
59377 	/*
59378 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
59379 	 * datagram payload
59380 	 */
59381 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
59382 	/* Use fixed layer 2 ether type of 0xFFFF */
59383 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
59384 	/*
59385 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
59386 	 * (IPV6oVXLANGPE)
59387 	 */
59388 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6	UINT32_C(0xc)
59389 	/* Custom GRE uses UPAR to parse customized GRE packets */
59390 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_CUSTOM_GRE	UINT32_C(0xd)
59391 	/* Enhanced Common Packet Radio Interface (eCPRI) */
59392 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_ECPRI		UINT32_C(0xe)
59393 	/* IPv6 Segment Routing (SRv6) */
59394 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_SRV6		UINT32_C(0xf)
59395 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
59396 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
59397 	/* Generic Routing Encapsulation */
59398 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GRE		UINT32_C(0x11)
59399 	/* ULP Dynamic UPAR tunnel */
59400 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR	UINT32_C(0x12)
59401 	/* ULP Dynamic UPAR tunnel reserved 1 */
59402 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES01 UINT32_C(0x13)
59403 	/* ULP Dynamic UPAR tunnel reserved 2 */
59404 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES02 UINT32_C(0x14)
59405 	/* ULP Dynamic UPAR tunnel reserved 3 */
59406 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES03 UINT32_C(0x15)
59407 	/* ULP Dynamic UPAR tunnel reserved 4 */
59408 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES04 UINT32_C(0x16)
59409 	/* ULP Dynamic UPAR tunnel reserved 5 */
59410 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES05 UINT32_C(0x17)
59411 	/* ULP Dynamic UPAR tunnel reserved 6 */
59412 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES06 UINT32_C(0x18)
59413 	/* ULP Dynamic UPAR tunnel reserved 7 */
59414 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES07 UINT32_C(0x19)
59415 	#define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST		HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES07
59416 	/*
59417 	 * This field is used to specify the next protocol value defined in the
59418 	 * corresponding RFC spec for the applicable tunnel type.
59419 	 */
59420 	uint8_t	tunnel_next_proto;
59421 	uint8_t	unused_0[6];
59422 } hwrm_tunnel_dst_port_query_input_t, *phwrm_tunnel_dst_port_query_input_t;
59423 
59424 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
59425 
59426 typedef struct hwrm_tunnel_dst_port_query_output {
59427 	/* The specific error status for the command. */
59428 	uint16_t	error_code;
59429 	/* The HWRM command request type. */
59430 	uint16_t	req_type;
59431 	/* The sequence ID from the original command. */
59432 	uint16_t	seq_id;
59433 	/* The length of the response data in number of bytes. */
59434 	uint16_t	resp_len;
59435 	/*
59436 	 * This field represents the identifier of L4 destination port
59437 	 * used for the given tunnel type. This field is valid for
59438 	 * specific tunnel types that use layer 4 (e.g. UDP)
59439 	 * transports for tunneling.
59440 	 */
59441 	uint16_t	tunnel_dst_port_id;
59442 	/*
59443 	 * This field represents the value of L4 destination port
59444 	 * identified by tunnel_dst_port_id. This field is valid for
59445 	 * specific tunnel types that use layer 4 (e.g. UDP)
59446 	 * transports for tunneling.
59447 	 * This field is in network byte order.
59448 	 *
59449 	 * A value of 0 means that the destination port is not
59450 	 * configured.
59451 	 */
59452 	uint16_t	tunnel_dst_port_val;
59453 	/*
59454 	 * This field represents the UPAR usage status.
59455 	 * Available UPARs on wh+ are UPAR0 and UPAR1
59456 	 * Available UPARs on Thor are UPAR0 to UPAR3
59457 	 * Available UPARs on Thor2 are UPAR0 to UPAR7
59458 	 */
59459 	uint8_t	upar_in_use;
59460 	/* This bit will be '1' when UPAR0 is IN_USE */
59461 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR0	UINT32_C(0x1)
59462 	/* This bit will be '1' when UPAR1 is IN_USE */
59463 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR1	UINT32_C(0x2)
59464 	/* This bit will be '1' when UPAR2 is IN_USE */
59465 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR2	UINT32_C(0x4)
59466 	/* This bit will be '1' when UPAR3 is IN_USE */
59467 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR3	UINT32_C(0x8)
59468 	/* This bit will be '1' when UPAR4 is IN_USE */
59469 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR4	UINT32_C(0x10)
59470 	/* This bit will be '1' when UPAR5 is IN_USE */
59471 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR5	UINT32_C(0x20)
59472 	/* This bit will be '1' when UPAR6 is IN_USE */
59473 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR6	UINT32_C(0x40)
59474 	/* This bit will be '1' when UPAR7 is IN_USE */
59475 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_UPAR_IN_USE_UPAR7	UINT32_C(0x80)
59476 	/*
59477 	 * This field is used to convey the status of non udp port based
59478 	 * tunnel parsing at chip level and at function level.
59479 	 */
59480 	uint8_t	status;
59481 	/* This bit will be '1' when tunnel parsing is enabled globally. */
59482 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_STATUS_CHIP_LEVEL	UINT32_C(0x1)
59483 	/*
59484 	 * This bit will be '1' when tunnel parsing is enabled
59485 	 * on the corresponding function.
59486 	 */
59487 	#define HWRM_TUNNEL_DST_PORT_QUERY_OUTPUT_STATUS_FUNC_LEVEL	UINT32_C(0x2)
59488 	uint8_t	unused_0;
59489 	/*
59490 	 * This field is used in Output records to indicate that the output
59491 	 * is completely written to RAM. This field should be read as '1'
59492 	 * to indicate that the output has been completely written. When
59493 	 * writing a command completion or response to an internal processor,
59494 	 * the order of writes has to be such that this field is written last.
59495 	 */
59496 	uint8_t	valid;
59497 } hwrm_tunnel_dst_port_query_output_t, *phwrm_tunnel_dst_port_query_output_t;
59498 
59499 /******************************
59500  * hwrm_tunnel_dst_port_alloc *
59501  ******************************/
59502 
59503 
59504 /* hwrm_tunnel_dst_port_alloc_input (size:192b/24B) */
59505 
59506 typedef struct hwrm_tunnel_dst_port_alloc_input {
59507 	/* The HWRM command request type. */
59508 	uint16_t	req_type;
59509 	/*
59510 	 * The completion ring to send the completion event on. This should
59511 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59512 	 */
59513 	uint16_t	cmpl_ring;
59514 	/*
59515 	 * The sequence ID is used by the driver for tracking multiple
59516 	 * commands. This ID is treated as opaque data by the firmware and
59517 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59518 	 */
59519 	uint16_t	seq_id;
59520 	/*
59521 	 * The target ID of the command:
59522 	 * * 0x0-0xFFF8 - The function ID
59523 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59524 	 * * 0xFFFD - Reserved for user-space HWRM interface
59525 	 * * 0xFFFF - HWRM
59526 	 */
59527 	uint16_t	target_id;
59528 	/*
59529 	 * A physical address pointer pointing to a host buffer that the
59530 	 * command's response data will be written. This can be either a host
59531 	 * physical address (HPA) or a guest physical address (GPA) and must
59532 	 * point to a physically contiguous block of memory.
59533 	 */
59534 	uint64_t	resp_addr;
59535 	/* Tunnel Type. */
59536 	uint8_t	tunnel_type;
59537 	/* Virtual eXtensible Local Area Network (VXLAN) */
59538 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN		UINT32_C(0x1)
59539 	/* Generic Network Virtualization Encapsulation (Geneve) */
59540 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE		UINT32_C(0x5)
59541 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
59542 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
59543 	/*
59544 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
59545 	 * datagram payload
59546 	 */
59547 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
59548 	/* Use fixed layer 2 ether type of 0xFFFF */
59549 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
59550 	/*
59551 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
59552 	 * (IPV6oVXLANGPE)
59553 	 */
59554 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6	UINT32_C(0xc)
59555 	/*
59556 	 * Custom GRE uses UPAR to parse customized GRE packets. This is not
59557 	 * supported.
59558 	 */
59559 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_CUSTOM_GRE	UINT32_C(0xd)
59560 	/* Enhanced Common Packet Radio Interface (eCPRI) */
59561 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_ECPRI		UINT32_C(0xe)
59562 	/* IPv6 Segment Routing (SRv6) */
59563 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_SRV6		UINT32_C(0xf)
59564 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
59565 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
59566 	/* Generic Routing Encapsulation */
59567 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GRE		UINT32_C(0x11)
59568 	/* ULP Dynamic UPAR tunnel */
59569 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR	UINT32_C(0x12)
59570 	/* ULP Dynamic UPAR tunnel reserved 1 */
59571 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES01 UINT32_C(0x13)
59572 	/* ULP Dynamic UPAR tunnel reserved 2 */
59573 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES02 UINT32_C(0x14)
59574 	/* ULP Dynamic UPAR tunnel reserved 3 */
59575 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES03 UINT32_C(0x15)
59576 	/* ULP Dynamic UPAR tunnel reserved 4 */
59577 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES04 UINT32_C(0x16)
59578 	/* ULP Dynamic UPAR tunnel reserved 5 */
59579 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES05 UINT32_C(0x17)
59580 	/* ULP Dynamic UPAR tunnel reserved 6 */
59581 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES06 UINT32_C(0x18)
59582 	/* ULP Dynamic UPAR tunnel reserved 7 */
59583 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES07 UINT32_C(0x19)
59584 	#define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_LAST		HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES07
59585 	/*
59586 	 * This field is used to specify the next protocol value defined in the
59587 	 * corresponding RFC spec for the applicable tunnel type.
59588 	 */
59589 	uint8_t	tunnel_next_proto;
59590 	/*
59591 	 * This field represents the value of L4 destination port used
59592 	 * for the given tunnel type. This field is valid for
59593 	 * specific tunnel types that use layer 4 (e.g. UDP)
59594 	 * transports for tunneling.
59595 	 *
59596 	 * This field is in network byte order.
59597 	 *
59598 	 * A value of 0 shall fail the command.
59599 	 */
59600 	uint16_t	tunnel_dst_port_val;
59601 	uint8_t	unused_0[4];
59602 } hwrm_tunnel_dst_port_alloc_input_t, *phwrm_tunnel_dst_port_alloc_input_t;
59603 
59604 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
59605 
59606 typedef struct hwrm_tunnel_dst_port_alloc_output {
59607 	/* The specific error status for the command. */
59608 	uint16_t	error_code;
59609 	/* The HWRM command request type. */
59610 	uint16_t	req_type;
59611 	/* The sequence ID from the original command. */
59612 	uint16_t	seq_id;
59613 	/* The length of the response data in number of bytes. */
59614 	uint16_t	resp_len;
59615 	/*
59616 	 * Identifier of a tunnel L4 destination port value. Only applies to
59617 	 * tunnel types that has l4 destination port parameters.
59618 	 */
59619 	uint16_t	tunnel_dst_port_id;
59620 	/* Error information */
59621 	uint8_t	error_info;
59622 	/* No error */
59623 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_SUCCESS	UINT32_C(0x0)
59624 	/* Tunnel port is already allocated */
59625 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_ALLOCATED   UINT32_C(0x1)
59626 	/* Out of resources error */
59627 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_NO_RESOURCE UINT32_C(0x2)
59628 	/* Tunnel type is already enabled */
59629 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_ENABLED	UINT32_C(0x3)
59630 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_LAST	HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_ERROR_INFO_ERR_ENABLED
59631 	/*
59632 	 * This field represents the UPAR usage status.
59633 	 * Available UPARs on wh+ are UPAR0 and UPAR1
59634 	 * Available UPARs on Thor are UPAR0 to UPAR3
59635 	 * Available UPARs on Thor2 are UPAR0 to UPAR7
59636 	 */
59637 	uint8_t	upar_in_use;
59638 	/* This bit will be '1' when UPAR0 is IN_USE */
59639 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR0	UINT32_C(0x1)
59640 	/* This bit will be '1' when UPAR1 is IN_USE */
59641 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR1	UINT32_C(0x2)
59642 	/* This bit will be '1' when UPAR2 is IN_USE */
59643 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR2	UINT32_C(0x4)
59644 	/* This bit will be '1' when UPAR3 is IN_USE */
59645 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR3	UINT32_C(0x8)
59646 	/* This bit will be '1' when UPAR4 is IN_USE */
59647 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR4	UINT32_C(0x10)
59648 	/* This bit will be '1' when UPAR5 is IN_USE */
59649 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR5	UINT32_C(0x20)
59650 	/* This bit will be '1' when UPAR6 is IN_USE */
59651 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR6	UINT32_C(0x40)
59652 	/* This bit will be '1' when UPAR7 is IN_USE */
59653 	#define HWRM_TUNNEL_DST_PORT_ALLOC_OUTPUT_UPAR_IN_USE_UPAR7	UINT32_C(0x80)
59654 	uint8_t	unused_0[3];
59655 	/*
59656 	 * This field is used in Output records to indicate that the output
59657 	 * is completely written to RAM. This field should be read as '1'
59658 	 * to indicate that the output has been completely written. When
59659 	 * writing a command completion or response to an internal processor,
59660 	 * the order of writes has to be such that this field is written last.
59661 	 */
59662 	uint8_t	valid;
59663 } hwrm_tunnel_dst_port_alloc_output_t, *phwrm_tunnel_dst_port_alloc_output_t;
59664 
59665 /*****************************
59666  * hwrm_tunnel_dst_port_free *
59667  *****************************/
59668 
59669 
59670 /* hwrm_tunnel_dst_port_free_input (size:192b/24B) */
59671 
59672 typedef struct hwrm_tunnel_dst_port_free_input {
59673 	/* The HWRM command request type. */
59674 	uint16_t	req_type;
59675 	/*
59676 	 * The completion ring to send the completion event on. This should
59677 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59678 	 */
59679 	uint16_t	cmpl_ring;
59680 	/*
59681 	 * The sequence ID is used by the driver for tracking multiple
59682 	 * commands. This ID is treated as opaque data by the firmware and
59683 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59684 	 */
59685 	uint16_t	seq_id;
59686 	/*
59687 	 * The target ID of the command:
59688 	 * * 0x0-0xFFF8 - The function ID
59689 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59690 	 * * 0xFFFD - Reserved for user-space HWRM interface
59691 	 * * 0xFFFF - HWRM
59692 	 */
59693 	uint16_t	target_id;
59694 	/*
59695 	 * A physical address pointer pointing to a host buffer that the
59696 	 * command's response data will be written. This can be either a host
59697 	 * physical address (HPA) or a guest physical address (GPA) and must
59698 	 * point to a physically contiguous block of memory.
59699 	 */
59700 	uint64_t	resp_addr;
59701 	/* Tunnel Type. */
59702 	uint8_t	tunnel_type;
59703 	/* Virtual eXtensible Local Area Network (VXLAN) */
59704 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN		UINT32_C(0x1)
59705 	/* Generic Network Virtualization Encapsulation (Geneve) */
59706 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE		UINT32_C(0x5)
59707 	/* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
59708 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4	UINT32_C(0x9)
59709 	/*
59710 	 * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
59711 	 * datagram payload
59712 	 */
59713 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1	UINT32_C(0xa)
59714 	/* Use fixed layer 2 ether type of 0xFFFF */
59715 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE	UINT32_C(0xb)
59716 	/*
59717 	 * IPV6 over virtual eXtensible Local Area Network with GPE header
59718 	 * (IPV6oVXLANGPE)
59719 	 */
59720 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6	UINT32_C(0xc)
59721 	/*
59722 	 * Custom GRE uses UPAR to parse customized GRE packets. This is not
59723 	 * supported.
59724 	 */
59725 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_CUSTOM_GRE	UINT32_C(0xd)
59726 	/* Enhanced Common Packet Radio Interface (eCPRI) */
59727 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_ECPRI		UINT32_C(0xe)
59728 	/* IPv6 Segment Routing (SRv6) */
59729 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_SRV6		UINT32_C(0xf)
59730 	/* Generic Protocol Extension for VXLAN (VXLAN-GPE) */
59731 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE	UINT32_C(0x10)
59732 	/* Generic Routing Encapsulation */
59733 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GRE		UINT32_C(0x11)
59734 	/* ULP Dynamic UPAR tunnel */
59735 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR	UINT32_C(0x12)
59736 	/* ULP Dynamic UPAR tunnel reserved 1 */
59737 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES01 UINT32_C(0x13)
59738 	/* ULP Dynamic UPAR tunnel reserved 2 */
59739 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES02 UINT32_C(0x14)
59740 	/* ULP Dynamic UPAR tunnel reserved 3 */
59741 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES03 UINT32_C(0x15)
59742 	/* ULP Dynamic UPAR tunnel reserved 4 */
59743 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES04 UINT32_C(0x16)
59744 	/* ULP Dynamic UPAR tunnel reserved 5 */
59745 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES05 UINT32_C(0x17)
59746 	/* ULP Dynamic UPAR tunnel reserved 6 */
59747 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES06 UINT32_C(0x18)
59748 	/* ULP Dynamic UPAR tunnel reserved 7 */
59749 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES07 UINT32_C(0x19)
59750 	#define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_LAST		HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_ULP_DYN_UPAR_RES07
59751 	/*
59752 	 * This field is used to specify the next protocol value defined in the
59753 	 * corresponding RFC spec for the applicable tunnel type.
59754 	 */
59755 	uint8_t	tunnel_next_proto;
59756 	/*
59757 	 * Identifier of a tunnel L4 destination port value. Only applies to
59758 	 * tunnel types that has l4 destination port parameters.
59759 	 */
59760 	uint16_t	tunnel_dst_port_id;
59761 	uint8_t	unused_0[4];
59762 } hwrm_tunnel_dst_port_free_input_t, *phwrm_tunnel_dst_port_free_input_t;
59763 
59764 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
59765 
59766 typedef struct hwrm_tunnel_dst_port_free_output {
59767 	/* The specific error status for the command. */
59768 	uint16_t	error_code;
59769 	/* The HWRM command request type. */
59770 	uint16_t	req_type;
59771 	/* The sequence ID from the original command. */
59772 	uint16_t	seq_id;
59773 	/* The length of the response data in number of bytes. */
59774 	uint16_t	resp_len;
59775 	/* Error information */
59776 	uint8_t	error_info;
59777 	/* No error */
59778 	#define HWRM_TUNNEL_DST_PORT_FREE_OUTPUT_ERROR_INFO_SUCCESS	UINT32_C(0x0)
59779 	/* Not owner error */
59780 	#define HWRM_TUNNEL_DST_PORT_FREE_OUTPUT_ERROR_INFO_ERR_NOT_OWNER	UINT32_C(0x1)
59781 	/* Not allocated error */
59782 	#define HWRM_TUNNEL_DST_PORT_FREE_OUTPUT_ERROR_INFO_ERR_NOT_ALLOCATED UINT32_C(0x2)
59783 	#define HWRM_TUNNEL_DST_PORT_FREE_OUTPUT_ERROR_INFO_LAST		HWRM_TUNNEL_DST_PORT_FREE_OUTPUT_ERROR_INFO_ERR_NOT_ALLOCATED
59784 	uint8_t	unused_1[6];
59785 	/*
59786 	 * This field is used in Output records to indicate that the output
59787 	 * is completely written to RAM. This field should be read as '1'
59788 	 * to indicate that the output has been completely written. When
59789 	 * writing a command completion or response to an internal processor,
59790 	 * the order of writes has to be such that this field is written last.
59791 	 */
59792 	uint8_t	valid;
59793 } hwrm_tunnel_dst_port_free_output_t, *phwrm_tunnel_dst_port_free_output_t;
59794 
59795 /* Periodic statistics context DMA to host. */
59796 /* ctx_hw_stats (size:1280b/160B) */
59797 
59798 typedef struct ctx_hw_stats {
59799 	/* Number of received unicast packets */
59800 	uint64_t	rx_ucast_pkts;
59801 	/* Number of received multicast packets */
59802 	uint64_t	rx_mcast_pkts;
59803 	/* Number of received broadcast packets */
59804 	uint64_t	rx_bcast_pkts;
59805 	/* Number of discarded packets on receive path */
59806 	uint64_t	rx_discard_pkts;
59807 	/* Number of packets on receive path with error */
59808 	uint64_t	rx_error_pkts;
59809 	/* Number of received bytes for unicast traffic */
59810 	uint64_t	rx_ucast_bytes;
59811 	/* Number of received bytes for multicast traffic */
59812 	uint64_t	rx_mcast_bytes;
59813 	/* Number of received bytes for broadcast traffic */
59814 	uint64_t	rx_bcast_bytes;
59815 	/* Number of transmitted unicast packets */
59816 	uint64_t	tx_ucast_pkts;
59817 	/* Number of transmitted multicast packets */
59818 	uint64_t	tx_mcast_pkts;
59819 	/* Number of transmitted broadcast packets */
59820 	uint64_t	tx_bcast_pkts;
59821 	/* Number of packets on transmit path with error */
59822 	uint64_t	tx_error_pkts;
59823 	/* Number of discarded packets on transmit path */
59824 	uint64_t	tx_discard_pkts;
59825 	/* Number of transmitted bytes for unicast traffic */
59826 	uint64_t	tx_ucast_bytes;
59827 	/* Number of transmitted bytes for multicast traffic */
59828 	uint64_t	tx_mcast_bytes;
59829 	/* Number of transmitted bytes for broadcast traffic */
59830 	uint64_t	tx_bcast_bytes;
59831 	/* Number of TPA packets */
59832 	uint64_t	tpa_pkts;
59833 	/* Number of TPA bytes */
59834 	uint64_t	tpa_bytes;
59835 	/* Number of TPA events */
59836 	uint64_t	tpa_events;
59837 	/* Number of TPA aborts */
59838 	uint64_t	tpa_aborts;
59839 } ctx_hw_stats_t, *pctx_hw_stats_t;
59840 
59841 /*
59842  * Extended periodic statistics context DMA to host. On cards that
59843  * support TPA v2, additional TPA related stats exist and can be retrieved
59844  * by DMA of ctx_hw_stats_ext, rather than legacy ctx_hw_stats structure.
59845  */
59846 /* ctx_hw_stats_ext (size:1408b/176B) */
59847 
59848 typedef struct ctx_hw_stats_ext {
59849 	/* Number of received unicast packets */
59850 	uint64_t	rx_ucast_pkts;
59851 	/* Number of received multicast packets */
59852 	uint64_t	rx_mcast_pkts;
59853 	/* Number of received broadcast packets */
59854 	uint64_t	rx_bcast_pkts;
59855 	/* Number of discarded packets on receive path */
59856 	uint64_t	rx_discard_pkts;
59857 	/* Number of packets on receive path with error */
59858 	uint64_t	rx_error_pkts;
59859 	/* Number of received bytes for unicast traffic */
59860 	uint64_t	rx_ucast_bytes;
59861 	/* Number of received bytes for multicast traffic */
59862 	uint64_t	rx_mcast_bytes;
59863 	/* Number of received bytes for broadcast traffic */
59864 	uint64_t	rx_bcast_bytes;
59865 	/* Number of transmitted unicast packets */
59866 	uint64_t	tx_ucast_pkts;
59867 	/* Number of transmitted multicast packets */
59868 	uint64_t	tx_mcast_pkts;
59869 	/* Number of transmitted broadcast packets */
59870 	uint64_t	tx_bcast_pkts;
59871 	/* Number of packets on transmit path with error */
59872 	uint64_t	tx_error_pkts;
59873 	/* Number of discarded packets on transmit path */
59874 	uint64_t	tx_discard_pkts;
59875 	/* Number of transmitted bytes for unicast traffic */
59876 	uint64_t	tx_ucast_bytes;
59877 	/* Number of transmitted bytes for multicast traffic */
59878 	uint64_t	tx_mcast_bytes;
59879 	/* Number of transmitted bytes for broadcast traffic */
59880 	uint64_t	tx_bcast_bytes;
59881 	/* Number of TPA eligible packets */
59882 	uint64_t	rx_tpa_eligible_pkt;
59883 	/* Number of TPA eligible bytes */
59884 	uint64_t	rx_tpa_eligible_bytes;
59885 	/* Number of TPA packets */
59886 	uint64_t	rx_tpa_pkt;
59887 	/* Number of TPA bytes */
59888 	uint64_t	rx_tpa_bytes;
59889 	/* Number of TPA errors */
59890 	uint64_t	rx_tpa_errors;
59891 	/* Number of TPA events */
59892 	uint64_t	rx_tpa_events;
59893 } ctx_hw_stats_ext_t, *pctx_hw_stats_ext_t;
59894 
59895 /* Periodic Engine statistics context DMA to host. */
59896 /* ctx_eng_stats (size:512b/64B) */
59897 
59898 typedef struct ctx_eng_stats {
59899 	/*
59900 	 * Count of data bytes into the Engine.
59901 	 * This includes any user supplied prefix,
59902 	 * but does not include any predefined
59903 	 * prefix data.
59904 	 */
59905 	uint64_t	eng_bytes_in;
59906 	/* Count of data bytes out of the Engine. */
59907 	uint64_t	eng_bytes_out;
59908 	/*
59909 	 * Count, in 4-byte (dword) units, of bytes
59910 	 * that are input as auxiliary data.
59911 	 * This includes the aux_cmd data.
59912 	 */
59913 	uint64_t	aux_bytes_in;
59914 	/*
59915 	 * Count, in 4-byte (dword) units, of bytes
59916 	 * that are output as auxiliary data.
59917 	 * This count is the buffer space for aux_data
59918 	 * output provided in the RQE, not the actual
59919 	 * aux_data written
59920 	 */
59921 	uint64_t	aux_bytes_out;
59922 	/* Count of number of commands executed. */
59923 	uint64_t	commands;
59924 	/*
59925 	 * Count of number of error commands.
59926 	 * These are the commands with a
59927 	 * non-zero status value.
59928 	 */
59929 	uint64_t	error_commands;
59930 	/*
59931 	 * Compression/Encryption Engine usage,
59932 	 * the unit is count of clock cycles
59933 	 */
59934 	uint64_t	cce_engine_usage;
59935 	/*
59936 	 * De-Compression/De-cryption Engine usage,
59937 	 * the unit is count of clock cycles
59938 	 */
59939 	uint64_t	cdd_engine_usage;
59940 } ctx_eng_stats_t, *pctx_eng_stats_t;
59941 
59942 /***********************
59943  * hwrm_stat_ctx_alloc *
59944  ***********************/
59945 
59946 
59947 /* hwrm_stat_ctx_alloc_input (size:384b/48B) */
59948 
59949 typedef struct hwrm_stat_ctx_alloc_input {
59950 	/* The HWRM command request type. */
59951 	uint16_t	req_type;
59952 	/*
59953 	 * The completion ring to send the completion event on. This should
59954 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
59955 	 */
59956 	uint16_t	cmpl_ring;
59957 	/*
59958 	 * The sequence ID is used by the driver for tracking multiple
59959 	 * commands. This ID is treated as opaque data by the firmware and
59960 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
59961 	 */
59962 	uint16_t	seq_id;
59963 	/*
59964 	 * The target ID of the command:
59965 	 * * 0x0-0xFFF8 - The function ID
59966 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
59967 	 * * 0xFFFD - Reserved for user-space HWRM interface
59968 	 * * 0xFFFF - HWRM
59969 	 */
59970 	uint16_t	target_id;
59971 	/*
59972 	 * A physical address pointer pointing to a host buffer that the
59973 	 * command's response data will be written. This can be either a host
59974 	 * physical address (HPA) or a guest physical address (GPA) and must
59975 	 * point to a physically contiguous block of memory.
59976 	 */
59977 	uint64_t	resp_addr;
59978 	/*
59979 	 * This is the address for statistic block.
59980 	 * > For new versions of the chip, this address should be 128B
59981 	 * > aligned.
59982 	 */
59983 	uint64_t	stats_dma_addr;
59984 	/*
59985 	 * The statistic block update period in ms.
59986 	 * e.g. 250ms, 500ms, 750ms, 1000ms.
59987 	 * If update_period_ms is 0, then the stats update
59988 	 * shall be never done and the DMA address shall not be used.
59989 	 * In this case, the stat block can only be read by
59990 	 * hwrm_stat_ctx_query command.
59991 	 * On Ethernet/L2 based devices:
59992 	 *   if tpa v2 supported (hwrm_vnic_qcaps[max_aggs_supported]>0),
59993 	 *	ctx_hw_stats_ext is used for DMA,
59994 	 *   else
59995 	 *	ctx_hw_stats is used for DMA.
59996 	 */
59997 	uint32_t	update_period_ms;
59998 	/*
59999 	 * This field is used to specify statistics context specific
60000 	 * configuration flags.
60001 	 */
60002 	uint8_t	stat_ctx_flags;
60003 	/*
60004 	 * When this bit is set to '1', the statistics context shall be
60005 	 * allocated for RoCE traffic only. In this case, traffic other
60006 	 * than offloaded RoCE traffic shall not be included in this
60007 	 * statistic context.
60008 	 * When this bit is set to '0', the statistics context shall be
60009 	 * used for network traffic or engine traffic.
60010 	 */
60011 	#define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE		UINT32_C(0x1)
60012 	/*
60013 	 * When this bit is set to '1', the PF is requesting a duplicate
60014 	 * host buffer used for VF statistics. The stat_ctx_id and
60015 	 * alloc_seq_id fields must be populated when this bit is set to
60016 	 * '1'. The stat_ctx_id indicates the VF statistics context that
60017 	 * should be copied to this host buffer. The stat_ctx_id and
60018 	 * alloc_seq_id should be copied from the vf_stat_change event
60019 	 * received by the PF. This bit can only be set for a PF. An error
60020 	 * is returned if a VF sets this bit. This bit is only supported if
60021 	 * vf_stat_ejection_supported is '1' in func_qcaps.
60022 	 */
60023 	#define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_DUP_HOST_BUF	UINT32_C(0x2)
60024 	uint8_t	unused_0;
60025 	/*
60026 	 * This is the size of the structure (ctx_hw_stats or
60027 	 * ctx_hw_stats_ext) that the driver has allocated to be used
60028 	 * for the periodic DMA updates.
60029 	 */
60030 	uint16_t	stats_dma_length;
60031 	uint16_t	flags;
60032 	/* This stats context uses the steering tag specified in the command. */
60033 	#define HWRM_STAT_CTX_ALLOC_INPUT_FLAGS_STEERING_TAG_VALID	UINT32_C(0x1)
60034 	/*
60035 	 * Steering tag to use for memory transactions from the periodic DMA
60036 	 * updates. 'steering_tag_valid' should be set and 'steering_tag'
60037 	 * should be specified, when the 'steering_tag_supported' bit is set
60038 	 * under the 'flags_ext2' field of the hwrm_func_qcaps_output.
60039 	 */
60040 	uint16_t	steering_tag;
60041 	/*
60042 	 * Only valid when dup_host_buf is '1'. This value should be copied
60043 	 * from the vf_stat_change event.
60044 	 */
60045 	uint32_t	stat_ctx_id;
60046 	/*
60047 	 * Only valid when dup_host_buf is '1'. This value should be copied
60048 	 * from the vf_stat_change event.
60049 	 */
60050 	uint16_t	alloc_seq_id;
60051 	uint8_t	unused_1[6];
60052 } hwrm_stat_ctx_alloc_input_t, *phwrm_stat_ctx_alloc_input_t;
60053 
60054 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */
60055 
60056 typedef struct hwrm_stat_ctx_alloc_output {
60057 	/* The specific error status for the command. */
60058 	uint16_t	error_code;
60059 	/* The HWRM command request type. */
60060 	uint16_t	req_type;
60061 	/* The sequence ID from the original command. */
60062 	uint16_t	seq_id;
60063 	/* The length of the response data in number of bytes. */
60064 	uint16_t	resp_len;
60065 	/* This is the statistics context ID value. */
60066 	uint32_t	stat_ctx_id;
60067 	uint8_t	unused_0[3];
60068 	/*
60069 	 * This field is used in Output records to indicate that the output
60070 	 * is completely written to RAM. This field should be read as '1'
60071 	 * to indicate that the output has been completely written. When
60072 	 * writing a command completion or response to an internal processor,
60073 	 * the order of writes has to be such that this field is written last.
60074 	 */
60075 	uint8_t	valid;
60076 } hwrm_stat_ctx_alloc_output_t, *phwrm_stat_ctx_alloc_output_t;
60077 
60078 /**********************
60079  * hwrm_stat_ctx_free *
60080  **********************/
60081 
60082 
60083 /* hwrm_stat_ctx_free_input (size:192b/24B) */
60084 
60085 typedef struct hwrm_stat_ctx_free_input {
60086 	/* The HWRM command request type. */
60087 	uint16_t	req_type;
60088 	/*
60089 	 * The completion ring to send the completion event on. This should
60090 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60091 	 */
60092 	uint16_t	cmpl_ring;
60093 	/*
60094 	 * The sequence ID is used by the driver for tracking multiple
60095 	 * commands. This ID is treated as opaque data by the firmware and
60096 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60097 	 */
60098 	uint16_t	seq_id;
60099 	/*
60100 	 * The target ID of the command:
60101 	 * * 0x0-0xFFF8 - The function ID
60102 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60103 	 * * 0xFFFD - Reserved for user-space HWRM interface
60104 	 * * 0xFFFF - HWRM
60105 	 */
60106 	uint16_t	target_id;
60107 	/*
60108 	 * A physical address pointer pointing to a host buffer that the
60109 	 * command's response data will be written. This can be either a host
60110 	 * physical address (HPA) or a guest physical address (GPA) and must
60111 	 * point to a physically contiguous block of memory.
60112 	 */
60113 	uint64_t	resp_addr;
60114 	/* ID of the statistics context that is being queried. */
60115 	uint32_t	stat_ctx_id;
60116 	uint8_t	unused_0[4];
60117 } hwrm_stat_ctx_free_input_t, *phwrm_stat_ctx_free_input_t;
60118 
60119 /* hwrm_stat_ctx_free_output (size:128b/16B) */
60120 
60121 typedef struct hwrm_stat_ctx_free_output {
60122 	/* The specific error status for the command. */
60123 	uint16_t	error_code;
60124 	/* The HWRM command request type. */
60125 	uint16_t	req_type;
60126 	/* The sequence ID from the original command. */
60127 	uint16_t	seq_id;
60128 	/* The length of the response data in number of bytes. */
60129 	uint16_t	resp_len;
60130 	/* This is the statistics context ID value. */
60131 	uint32_t	stat_ctx_id;
60132 	uint8_t	unused_0[3];
60133 	/*
60134 	 * This field is used in Output records to indicate that the output
60135 	 * is completely written to RAM. This field should be read as '1'
60136 	 * to indicate that the output has been completely written. When
60137 	 * writing a command completion or response to an internal processor,
60138 	 * the order of writes has to be such that this field is written last.
60139 	 */
60140 	uint8_t	valid;
60141 } hwrm_stat_ctx_free_output_t, *phwrm_stat_ctx_free_output_t;
60142 
60143 /***********************
60144  * hwrm_stat_ctx_query *
60145  ***********************/
60146 
60147 
60148 /* hwrm_stat_ctx_query_input (size:192b/24B) */
60149 
60150 typedef struct hwrm_stat_ctx_query_input {
60151 	/* The HWRM command request type. */
60152 	uint16_t	req_type;
60153 	/*
60154 	 * The completion ring to send the completion event on. This should
60155 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60156 	 */
60157 	uint16_t	cmpl_ring;
60158 	/*
60159 	 * The sequence ID is used by the driver for tracking multiple
60160 	 * commands. This ID is treated as opaque data by the firmware and
60161 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60162 	 */
60163 	uint16_t	seq_id;
60164 	/*
60165 	 * The target ID of the command:
60166 	 * * 0x0-0xFFF8 - The function ID
60167 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60168 	 * * 0xFFFD - Reserved for user-space HWRM interface
60169 	 * * 0xFFFF - HWRM
60170 	 */
60171 	uint16_t	target_id;
60172 	/*
60173 	 * A physical address pointer pointing to a host buffer that the
60174 	 * command's response data will be written. This can be either a host
60175 	 * physical address (HPA) or a guest physical address (GPA) and must
60176 	 * point to a physically contiguous block of memory.
60177 	 */
60178 	uint64_t	resp_addr;
60179 	/* ID of the statistics context that is being queried. */
60180 	uint32_t	stat_ctx_id;
60181 	uint8_t	flags;
60182 	/*
60183 	 * This bit is set to 1 when request is for a counter mask,
60184 	 * representing the width of each of the stats counters, rather
60185 	 * than counters themselves.
60186 	 */
60187 	#define HWRM_STAT_CTX_QUERY_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
60188 	uint8_t	unused_0[3];
60189 } hwrm_stat_ctx_query_input_t, *phwrm_stat_ctx_query_input_t;
60190 
60191 /* hwrm_stat_ctx_query_output (size:1408b/176B) */
60192 
60193 typedef struct hwrm_stat_ctx_query_output {
60194 	/* The specific error status for the command. */
60195 	uint16_t	error_code;
60196 	/* The HWRM command request type. */
60197 	uint16_t	req_type;
60198 	/* The sequence ID from the original command. */
60199 	uint16_t	seq_id;
60200 	/* The length of the response data in number of bytes. */
60201 	uint16_t	resp_len;
60202 	/* Number of transmitted unicast packets */
60203 	uint64_t	tx_ucast_pkts;
60204 	/* Number of transmitted multicast packets */
60205 	uint64_t	tx_mcast_pkts;
60206 	/* Number of transmitted broadcast packets */
60207 	uint64_t	tx_bcast_pkts;
60208 	/* Number of packets discarded in transmit path */
60209 	uint64_t	tx_discard_pkts;
60210 	/* Number of packets in transmit path with error */
60211 	uint64_t	tx_error_pkts;
60212 	/* Number of transmitted bytes for unicast traffic */
60213 	uint64_t	tx_ucast_bytes;
60214 	/* Number of transmitted bytes for multicast traffic */
60215 	uint64_t	tx_mcast_bytes;
60216 	/* Number of transmitted bytes for broadcast traffic */
60217 	uint64_t	tx_bcast_bytes;
60218 	/* Number of received unicast packets */
60219 	uint64_t	rx_ucast_pkts;
60220 	/* Number of received multicast packets */
60221 	uint64_t	rx_mcast_pkts;
60222 	/* Number of received broadcast packets */
60223 	uint64_t	rx_bcast_pkts;
60224 	/* Number of packets discarded in receive path */
60225 	uint64_t	rx_discard_pkts;
60226 	/* Number of packets in receive path with errors */
60227 	uint64_t	rx_error_pkts;
60228 	/* Number of received bytes for unicast traffic */
60229 	uint64_t	rx_ucast_bytes;
60230 	/* Number of received bytes for multicast traffic */
60231 	uint64_t	rx_mcast_bytes;
60232 	/* Number of received bytes for broadcast traffic */
60233 	uint64_t	rx_bcast_bytes;
60234 	/* Number of aggregated unicast packets */
60235 	uint64_t	rx_agg_pkts;
60236 	/* Number of aggregated unicast bytes */
60237 	uint64_t	rx_agg_bytes;
60238 	/* Number of aggregation events */
60239 	uint64_t	rx_agg_events;
60240 	/* Number of aborted aggregations */
60241 	uint64_t	rx_agg_aborts;
60242 	uint8_t	unused_0[7];
60243 	/*
60244 	 * This field is used in Output records to indicate that the output
60245 	 * is completely written to RAM. This field should be read as '1'
60246 	 * to indicate that the output has been completely written. When
60247 	 * writing a command completion or response to an internal processor,
60248 	 * the order of writes has to be such that this field is written last.
60249 	 */
60250 	uint8_t	valid;
60251 } hwrm_stat_ctx_query_output_t, *phwrm_stat_ctx_query_output_t;
60252 
60253 /***************************
60254  * hwrm_stat_ext_ctx_query *
60255  ***************************/
60256 
60257 
60258 /* hwrm_stat_ext_ctx_query_input (size:192b/24B) */
60259 
60260 typedef struct hwrm_stat_ext_ctx_query_input {
60261 	/* The HWRM command request type. */
60262 	uint16_t	req_type;
60263 	/*
60264 	 * The completion ring to send the completion event on. This should
60265 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60266 	 */
60267 	uint16_t	cmpl_ring;
60268 	/*
60269 	 * The sequence ID is used by the driver for tracking multiple
60270 	 * commands. This ID is treated as opaque data by the firmware and
60271 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60272 	 */
60273 	uint16_t	seq_id;
60274 	/*
60275 	 * The target ID of the command:
60276 	 * * 0x0-0xFFF8 - The function ID
60277 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60278 	 * * 0xFFFD - Reserved for user-space HWRM interface
60279 	 * * 0xFFFF - HWRM
60280 	 */
60281 	uint16_t	target_id;
60282 	/*
60283 	 * A physical address pointer pointing to a host buffer that the
60284 	 * command's response data will be written. This can be either a host
60285 	 * physical address (HPA) or a guest physical address (GPA) and must
60286 	 * point to a physically contiguous block of memory.
60287 	 */
60288 	uint64_t	resp_addr;
60289 	/* ID of the extended statistics context that is being queried. */
60290 	uint32_t	stat_ctx_id;
60291 	uint8_t	flags;
60292 	/*
60293 	 * This bit is set to 1 when request is for a counter mask,
60294 	 * representing the width of each of the stats counters, rather
60295 	 * than counters themselves.
60296 	 */
60297 	#define HWRM_STAT_EXT_CTX_QUERY_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
60298 	uint8_t	unused_0[3];
60299 } hwrm_stat_ext_ctx_query_input_t, *phwrm_stat_ext_ctx_query_input_t;
60300 
60301 /* hwrm_stat_ext_ctx_query_output (size:1536b/192B) */
60302 
60303 typedef struct hwrm_stat_ext_ctx_query_output {
60304 	/* The specific error status for the command. */
60305 	uint16_t	error_code;
60306 	/* The HWRM command request type. */
60307 	uint16_t	req_type;
60308 	/* The sequence ID from the original command. */
60309 	uint16_t	seq_id;
60310 	/* The length of the response data in number of bytes. */
60311 	uint16_t	resp_len;
60312 	/* Number of received unicast packets */
60313 	uint64_t	rx_ucast_pkts;
60314 	/* Number of received multicast packets */
60315 	uint64_t	rx_mcast_pkts;
60316 	/* Number of received broadcast packets */
60317 	uint64_t	rx_bcast_pkts;
60318 	/* Number of discarded packets on receive path */
60319 	uint64_t	rx_discard_pkts;
60320 	/* Number of packets on receive path with error */
60321 	uint64_t	rx_error_pkts;
60322 	/* Number of received bytes for unicast traffic */
60323 	uint64_t	rx_ucast_bytes;
60324 	/* Number of received bytes for multicast traffic */
60325 	uint64_t	rx_mcast_bytes;
60326 	/* Number of received bytes for broadcast traffic */
60327 	uint64_t	rx_bcast_bytes;
60328 	/* Number of transmitted unicast packets */
60329 	uint64_t	tx_ucast_pkts;
60330 	/* Number of transmitted multicast packets */
60331 	uint64_t	tx_mcast_pkts;
60332 	/* Number of transmitted broadcast packets */
60333 	uint64_t	tx_bcast_pkts;
60334 	/* Number of packets on transmit path with error */
60335 	uint64_t	tx_error_pkts;
60336 	/* Number of discarded packets on transmit path */
60337 	uint64_t	tx_discard_pkts;
60338 	/* Number of transmitted bytes for unicast traffic */
60339 	uint64_t	tx_ucast_bytes;
60340 	/* Number of transmitted bytes for multicast traffic */
60341 	uint64_t	tx_mcast_bytes;
60342 	/* Number of transmitted bytes for broadcast traffic */
60343 	uint64_t	tx_bcast_bytes;
60344 	/* Number of TPA eligible packets */
60345 	uint64_t	rx_tpa_eligible_pkt;
60346 	/* Number of TPA eligible bytes */
60347 	uint64_t	rx_tpa_eligible_bytes;
60348 	/* Number of TPA packets */
60349 	uint64_t	rx_tpa_pkt;
60350 	/* Number of TPA bytes */
60351 	uint64_t	rx_tpa_bytes;
60352 	/* Number of TPA errors */
60353 	uint64_t	rx_tpa_errors;
60354 	/* Number of TPA events */
60355 	uint64_t	rx_tpa_events;
60356 	uint8_t	unused_0[7];
60357 	/*
60358 	 * This field is used in Output records to indicate that the output
60359 	 * is completely written to RAM. This field should be read as '1'
60360 	 * to indicate that the output has been completely written. When
60361 	 * writing a command completion or response to an internal processor,
60362 	 * the order of writes has to be such that this field is written last.
60363 	 */
60364 	uint8_t	valid;
60365 } hwrm_stat_ext_ctx_query_output_t, *phwrm_stat_ext_ctx_query_output_t;
60366 
60367 /***************************
60368  * hwrm_stat_ctx_eng_query *
60369  ***************************/
60370 
60371 
60372 /* hwrm_stat_ctx_eng_query_input (size:192b/24B) */
60373 
60374 typedef struct hwrm_stat_ctx_eng_query_input {
60375 	/* The HWRM command request type. */
60376 	uint16_t	req_type;
60377 	/*
60378 	 * The completion ring to send the completion event on. This should
60379 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60380 	 */
60381 	uint16_t	cmpl_ring;
60382 	/*
60383 	 * The sequence ID is used by the driver for tracking multiple
60384 	 * commands. This ID is treated as opaque data by the firmware and
60385 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60386 	 */
60387 	uint16_t	seq_id;
60388 	/*
60389 	 * The target ID of the command:
60390 	 * * 0x0-0xFFF8 - The function ID
60391 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60392 	 * * 0xFFFD - Reserved for user-space HWRM interface
60393 	 * * 0xFFFF - HWRM
60394 	 */
60395 	uint16_t	target_id;
60396 	/*
60397 	 * A physical address pointer pointing to a host buffer that the
60398 	 * command's response data will be written. This can be either a host
60399 	 * physical address (HPA) or a guest physical address (GPA) and must
60400 	 * point to a physically contiguous block of memory.
60401 	 */
60402 	uint64_t	resp_addr;
60403 	/* ID of the statistics context that is being queried. */
60404 	uint32_t	stat_ctx_id;
60405 	uint8_t	unused_0[4];
60406 } hwrm_stat_ctx_eng_query_input_t, *phwrm_stat_ctx_eng_query_input_t;
60407 
60408 /* hwrm_stat_ctx_eng_query_output (size:640b/80B) */
60409 
60410 typedef struct hwrm_stat_ctx_eng_query_output {
60411 	/* The specific error status for the command. */
60412 	uint16_t	error_code;
60413 	/* The HWRM command request type. */
60414 	uint16_t	req_type;
60415 	/* The sequence ID from the original command. */
60416 	uint16_t	seq_id;
60417 	/* The length of the response data in number of bytes. */
60418 	uint16_t	resp_len;
60419 	/*
60420 	 * Count of data bytes into the Engine.
60421 	 * This includes any user supplied prefix,
60422 	 * but does not include any predefined
60423 	 * prefix data.
60424 	 */
60425 	uint64_t	eng_bytes_in;
60426 	/* Count of data bytes out of the Engine. */
60427 	uint64_t	eng_bytes_out;
60428 	/*
60429 	 * Count, in 4-byte (dword) units, of bytes
60430 	 * that are input as auxiliary data.
60431 	 * This includes the aux_cmd data.
60432 	 */
60433 	uint64_t	aux_bytes_in;
60434 	/*
60435 	 * Count, in 4-byte (dword) units, of bytes
60436 	 * that are output as auxiliary data.
60437 	 * This count is the buffer space for aux_data
60438 	 * output provided in the RQE, not the actual
60439 	 * aux_data written
60440 	 */
60441 	uint64_t	aux_bytes_out;
60442 	/* Count of number of commands executed. */
60443 	uint64_t	commands;
60444 	/*
60445 	 * Count of number of error commands.
60446 	 * These are the commands with a
60447 	 * non-zero status value.
60448 	 */
60449 	uint64_t	error_commands;
60450 	/*
60451 	 * Compression/Encryption Engine usage,
60452 	 * the unit is count of clock cycles
60453 	 */
60454 	uint64_t	cce_engine_usage;
60455 	/*
60456 	 * De-Compression/De-cryption Engine usage,
60457 	 * the unit is count of clock cycles
60458 	 */
60459 	uint64_t	cdd_engine_usage;
60460 	uint8_t	unused_0[7];
60461 	/*
60462 	 * This field is used in Output records to indicate that the output
60463 	 * is completely written to RAM. This field should be read as '1'
60464 	 * to indicate that the output has been completely written. When
60465 	 * writing a command completion or response to an internal processor,
60466 	 * the order of writes has to be such that this field is written last.
60467 	 */
60468 	uint8_t	valid;
60469 } hwrm_stat_ctx_eng_query_output_t, *phwrm_stat_ctx_eng_query_output_t;
60470 
60471 /***************************
60472  * hwrm_stat_ctx_clr_stats *
60473  ***************************/
60474 
60475 
60476 /* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */
60477 
60478 typedef struct hwrm_stat_ctx_clr_stats_input {
60479 	/* The HWRM command request type. */
60480 	uint16_t	req_type;
60481 	/*
60482 	 * The completion ring to send the completion event on. This should
60483 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60484 	 */
60485 	uint16_t	cmpl_ring;
60486 	/*
60487 	 * The sequence ID is used by the driver for tracking multiple
60488 	 * commands. This ID is treated as opaque data by the firmware and
60489 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60490 	 */
60491 	uint16_t	seq_id;
60492 	/*
60493 	 * The target ID of the command:
60494 	 * * 0x0-0xFFF8 - The function ID
60495 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60496 	 * * 0xFFFD - Reserved for user-space HWRM interface
60497 	 * * 0xFFFF - HWRM
60498 	 */
60499 	uint16_t	target_id;
60500 	/*
60501 	 * A physical address pointer pointing to a host buffer that the
60502 	 * command's response data will be written. This can be either a host
60503 	 * physical address (HPA) or a guest physical address (GPA) and must
60504 	 * point to a physically contiguous block of memory.
60505 	 */
60506 	uint64_t	resp_addr;
60507 	/* ID of the statistics context that is being queried. */
60508 	uint32_t	stat_ctx_id;
60509 	uint8_t	unused_0[4];
60510 } hwrm_stat_ctx_clr_stats_input_t, *phwrm_stat_ctx_clr_stats_input_t;
60511 
60512 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */
60513 
60514 typedef struct hwrm_stat_ctx_clr_stats_output {
60515 	/* The specific error status for the command. */
60516 	uint16_t	error_code;
60517 	/* The HWRM command request type. */
60518 	uint16_t	req_type;
60519 	/* The sequence ID from the original command. */
60520 	uint16_t	seq_id;
60521 	/* The length of the response data in number of bytes. */
60522 	uint16_t	resp_len;
60523 	uint8_t	unused_0[7];
60524 	/*
60525 	 * This field is used in Output records to indicate that the output
60526 	 * is completely written to RAM. This field should be read as '1'
60527 	 * to indicate that the output has been completely written. When
60528 	 * writing a command completion or response to an internal processor,
60529 	 * the order of writes has to be such that this field is written last.
60530 	 */
60531 	uint8_t	valid;
60532 } hwrm_stat_ctx_clr_stats_output_t, *phwrm_stat_ctx_clr_stats_output_t;
60533 
60534 /********************
60535  * hwrm_pcie_qstats *
60536  ********************/
60537 
60538 
60539 /* hwrm_pcie_qstats_input (size:256b/32B) */
60540 
60541 typedef struct hwrm_pcie_qstats_input {
60542 	/* The HWRM command request type. */
60543 	uint16_t	req_type;
60544 	/*
60545 	 * The completion ring to send the completion event on. This should
60546 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60547 	 */
60548 	uint16_t	cmpl_ring;
60549 	/*
60550 	 * The sequence ID is used by the driver for tracking multiple
60551 	 * commands. This ID is treated as opaque data by the firmware and
60552 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60553 	 */
60554 	uint16_t	seq_id;
60555 	/*
60556 	 * The target ID of the command:
60557 	 * * 0x0-0xFFF8 - The function ID
60558 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60559 	 * * 0xFFFD - Reserved for user-space HWRM interface
60560 	 * * 0xFFFF - HWRM
60561 	 */
60562 	uint16_t	target_id;
60563 	/*
60564 	 * A physical address pointer pointing to a host buffer that the
60565 	 * command's response data will be written. This can be either a host
60566 	 * physical address (HPA) or a guest physical address (GPA) and must
60567 	 * point to a physically contiguous block of memory.
60568 	 */
60569 	uint64_t	resp_addr;
60570 	/*
60571 	 * The size of PCIe statistics block in bytes.
60572 	 * Firmware will DMA the PCIe statistics to
60573 	 * the host with this field size in the response.
60574 	 */
60575 	uint16_t	pcie_stat_size;
60576 	uint8_t	unused_0[6];
60577 	/*
60578 	 * This is the host address where
60579 	 * PCIe statistics will be stored
60580 	 */
60581 	uint64_t	pcie_stat_host_addr;
60582 } hwrm_pcie_qstats_input_t, *phwrm_pcie_qstats_input_t;
60583 
60584 /* hwrm_pcie_qstats_output (size:128b/16B) */
60585 
60586 typedef struct hwrm_pcie_qstats_output {
60587 	/* The specific error status for the command. */
60588 	uint16_t	error_code;
60589 	/* The HWRM command request type. */
60590 	uint16_t	req_type;
60591 	/* The sequence ID from the original command. */
60592 	uint16_t	seq_id;
60593 	/* The length of the response data in number of bytes. */
60594 	uint16_t	resp_len;
60595 	/* The size of PCIe statistics block in bytes. */
60596 	uint16_t	pcie_stat_size;
60597 	uint8_t	unused_0[5];
60598 	/*
60599 	 * This field is used in Output records to indicate that the output
60600 	 * is completely written to RAM. This field should be read as '1'
60601 	 * to indicate that the output has been completely written. When
60602 	 * writing a command completion or response to an internal processor,
60603 	 * the order of writes has to be such that this field is written last.
60604 	 */
60605 	uint8_t	valid;
60606 } hwrm_pcie_qstats_output_t, *phwrm_pcie_qstats_output_t;
60607 
60608 /* PCIe Statistics Formats */
60609 /* pcie_ctx_hw_stats (size:768b/96B) */
60610 
60611 typedef struct pcie_ctx_hw_stats {
60612 	/* Number of physical layer receiver errors */
60613 	uint64_t	pcie_pl_signal_integrity;
60614 	/* Number of DLLP CRC errors detected by Data Link Layer */
60615 	uint64_t	pcie_dl_signal_integrity;
60616 	/*
60617 	 * Number of TLP LCRC and sequence number errors detected
60618 	 * by Data Link Layer
60619 	 */
60620 	uint64_t	pcie_tl_signal_integrity;
60621 	/* Number of times LTSSM entered Recovery state */
60622 	uint64_t	pcie_link_integrity;
60623 	/* Report number of TLP bits that have been transmitted in Mbps */
60624 	uint64_t	pcie_tx_traffic_rate;
60625 	/* Report number of TLP bits that have been received in Mbps */
60626 	uint64_t	pcie_rx_traffic_rate;
60627 	/* Number of DLLP bytes that have been transmitted */
60628 	uint64_t	pcie_tx_dllp_statistics;
60629 	/* Number of DLLP bytes that have been received */
60630 	uint64_t	pcie_rx_dllp_statistics;
60631 	/*
60632 	 * Number of times spent in each phase of gen3
60633 	 * equalization
60634 	 */
60635 	uint64_t	pcie_equalization_time;
60636 	/* Records the last 16 transitions of the LTSSM */
60637 	uint32_t	pcie_ltssm_histogram[4];
60638 	/*
60639 	 * Record the last 8 reasons on why LTSSM transitioned
60640 	 * to Recovery
60641 	 */
60642 	uint64_t	pcie_recovery_histogram;
60643 } pcie_ctx_hw_stats_t, *ppcie_ctx_hw_stats_t;
60644 
60645 /****************************
60646  * hwrm_stat_generic_qstats *
60647  ****************************/
60648 
60649 
60650 /* hwrm_stat_generic_qstats_input (size:256b/32B) */
60651 
60652 typedef struct hwrm_stat_generic_qstats_input {
60653 	/* The HWRM command request type. */
60654 	uint16_t	req_type;
60655 	/*
60656 	 * The completion ring to send the completion event on. This should
60657 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60658 	 */
60659 	uint16_t	cmpl_ring;
60660 	/*
60661 	 * The sequence ID is used by the driver for tracking multiple
60662 	 * commands. This ID is treated as opaque data by the firmware and
60663 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60664 	 */
60665 	uint16_t	seq_id;
60666 	/*
60667 	 * The target ID of the command:
60668 	 * * 0x0-0xFFF8 - The function ID
60669 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60670 	 * * 0xFFFD - Reserved for user-space HWRM interface
60671 	 * * 0xFFFF - HWRM
60672 	 */
60673 	uint16_t	target_id;
60674 	/*
60675 	 * A physical address pointer pointing to a host buffer that the
60676 	 * command's response data will be written. This can be either a host
60677 	 * physical address (HPA) or a guest physical address (GPA) and must
60678 	 * point to a physically contiguous block of memory.
60679 	 */
60680 	uint64_t	resp_addr;
60681 	/*
60682 	 * The size of the generic statistics buffer passed in the
60683 	 * generic_stat_host_addr in bytes.
60684 	 * Firmware will not exceed this size when it DMAs the
60685 	 * statistics structure to the host. The actual DMA size
60686 	 * will be returned in the response.
60687 	 */
60688 	uint16_t	generic_stat_size;
60689 	uint8_t	flags;
60690 	/*
60691 	 * The bit should be set to 1 when request is for the counter mask
60692 	 * representing the width of each of the stats counters, rather
60693 	 * than counters themselves.
60694 	 */
60695 	#define HWRM_STAT_GENERIC_QSTATS_INPUT_FLAGS_COUNTER_MASK	UINT32_C(0x1)
60696 	uint8_t	unused_0[5];
60697 	/*
60698 	 * This is the host address where
60699 	 * generic statistics will be stored
60700 	 */
60701 	uint64_t	generic_stat_host_addr;
60702 } hwrm_stat_generic_qstats_input_t, *phwrm_stat_generic_qstats_input_t;
60703 
60704 /* hwrm_stat_generic_qstats_output (size:128b/16B) */
60705 
60706 typedef struct hwrm_stat_generic_qstats_output {
60707 	/* The specific error status for the command. */
60708 	uint16_t	error_code;
60709 	/* The HWRM command request type. */
60710 	uint16_t	req_type;
60711 	/* The sequence ID from the original command. */
60712 	uint16_t	seq_id;
60713 	/* The length of the response data in number of bytes. */
60714 	uint16_t	resp_len;
60715 	/* The size of Generic Statistics block in bytes. */
60716 	uint16_t	generic_stat_size;
60717 	uint8_t	unused_0[5];
60718 	/*
60719 	 * This field is used in Output records to indicate that the output
60720 	 * is completely written to RAM. This field should be read as '1'
60721 	 * to indicate that the output has been completely written.
60722 	 * When writing a command completion or response to an internal
60723 	 * processor, the order of writes has to be such that this field is
60724 	 * written last.
60725 	 */
60726 	uint8_t	valid;
60727 } hwrm_stat_generic_qstats_output_t, *phwrm_stat_generic_qstats_output_t;
60728 
60729 /* Generic Statistic Format */
60730 /* generic_sw_hw_stats (size:1472b/184B) */
60731 
60732 typedef struct generic_sw_hw_stats {
60733 	/*
60734 	 * This is the number of TLP bytes that have been transmitted for
60735 	 * the caller PF.
60736 	 */
60737 	uint64_t	pcie_statistics_tx_tlp;
60738 	/*
60739 	 * This is the number of TLP bytes that have been received
60740 	 * for the caller PF.
60741 	 */
60742 	uint64_t	pcie_statistics_rx_tlp;
60743 	/* Posted Header Flow Control credits available for the caller PF. */
60744 	uint64_t	pcie_credit_fc_hdr_posted;
60745 	/* Non-posted Header Flow Control credits available for the caller PF. */
60746 	uint64_t	pcie_credit_fc_hdr_nonposted;
60747 	/* Completion Header Flow Control credits available for the caller PF. */
60748 	uint64_t	pcie_credit_fc_hdr_cmpl;
60749 	/* Posted Data Flow Control credits available for the caller PF. */
60750 	uint64_t	pcie_credit_fc_data_posted;
60751 	/* Non-Posted Data Flow Control credits available for the caller PF. */
60752 	uint64_t	pcie_credit_fc_data_nonposted;
60753 	/* Completion Data Flow Control credits available for the caller PF. */
60754 	uint64_t	pcie_credit_fc_data_cmpl;
60755 	/*
60756 	 * Available Non-posted credit for target flow control reads or
60757 	 * config for the caller PF.
60758 	 */
60759 	uint64_t	pcie_credit_fc_tgt_nonposted;
60760 	/*
60761 	 * Available posted data credit for target flow control writes
60762 	 * for the caller PF.
60763 	 */
60764 	uint64_t	pcie_credit_fc_tgt_data_posted;
60765 	/*
60766 	 * Available posted header credit for target flow control writes
60767 	 * for the caller PF.
60768 	 */
60769 	uint64_t	pcie_credit_fc_tgt_hdr_posted;
60770 	/* Available completion flow control header credits for the caller PF. */
60771 	uint64_t	pcie_credit_fc_cmpl_hdr_posted;
60772 	/* Available completion flow control data credits. */
60773 	uint64_t	pcie_credit_fc_cmpl_data_posted;
60774 	/*
60775 	 * Displays Time information of the longest completion time from any of
60776 	 * the 4 tags for the caller PF. The unit of time recorded is in
60777 	 * microseconds.
60778 	 */
60779 	uint64_t	pcie_cmpl_longest;
60780 	/*
60781 	 * Displays Time information of the shortest completion time from any
60782 	 * of the 4 tags for the caller PF. The unit of time recorded is in
60783 	 * microseconds.
60784 	 */
60785 	uint64_t	pcie_cmpl_shortest;
60786 	/*
60787 	 * This field contains the total number of CFCQ 'misses' observed for
60788 	 * all the PF's.
60789 	 */
60790 	uint64_t	cache_miss_count_cfcq;
60791 	/*
60792 	 * This field contains the total number of CFCS 'misses' observed for
60793 	 * all the PF's.
60794 	 */
60795 	uint64_t	cache_miss_count_cfcs;
60796 	/*
60797 	 * This field contains the total number of CFCC 'misses' observed for
60798 	 * all the PF's.
60799 	 */
60800 	uint64_t	cache_miss_count_cfcc;
60801 	/*
60802 	 * This field contains the total number of CFCM 'misses' observed
60803 	 * for all the PF's.
60804 	 */
60805 	uint64_t	cache_miss_count_cfcm;
60806 	/*
60807 	 * Total number of Doorbell messages dropped from the DB FIFO.
60808 	 * This counter is only applicable for devices that support
60809 	 * the hardware based doorbell drop recovery feature.
60810 	 */
60811 	uint64_t	hw_db_recov_dbs_dropped;
60812 	/*
60813 	 * Total number of doorbell drops serviced.
60814 	 * This counter is only applicable for devices that support
60815 	 * the hardware based doorbell drop recovery feature.
60816 	 */
60817 	uint64_t	hw_db_recov_drops_serviced;
60818 	/*
60819 	 * Total number of dropped doorbells recovered.
60820 	 * This counter is only applicable for devices that support
60821 	 * the hardware based doorbell drop recovery feature.
60822 	 */
60823 	uint64_t	hw_db_recov_dbs_recovered;
60824 	/*
60825 	 * Total number of out of order doorbell messages dropped.
60826 	 * This counter is only applicable for devices that support
60827 	 * the hardware based doorbell drop recovery feature.
60828 	 */
60829 	uint64_t	hw_db_recov_oo_drop_count;
60830 } generic_sw_hw_stats_t, *pgeneric_sw_hw_stats_t;
60831 
60832 /*****************************
60833  * hwrm_stat_db_error_qstats *
60834  *****************************/
60835 
60836 
60837 /* hwrm_stat_db_error_qstats_input (size:128b/16B) */
60838 
60839 typedef struct hwrm_stat_db_error_qstats_input {
60840 	/* The HWRM command request type. */
60841 	uint16_t	req_type;
60842 	/*
60843 	 * The completion ring to send the completion event on. This should
60844 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60845 	 */
60846 	uint16_t	cmpl_ring;
60847 	/*
60848 	 * The sequence ID is used by the driver for tracking multiple
60849 	 * commands. This ID is treated as opaque data by the firmware and
60850 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60851 	 */
60852 	uint16_t	seq_id;
60853 	/*
60854 	 * The target ID of the command:
60855 	 * * 0x0-0xFFF8 - The function ID
60856 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60857 	 * * 0xFFFD - Reserved for user-space HWRM interface
60858 	 * * 0xFFFF - HWRM
60859 	 */
60860 	uint16_t	target_id;
60861 	/*
60862 	 * A physical address pointer pointing to a host buffer that the
60863 	 * command's response data will be written. This can be either a host
60864 	 * physical address (HPA) or a guest physical address (GPA) and must
60865 	 * point to a physically contiguous block of memory.
60866 	 */
60867 	uint64_t	resp_addr;
60868 } hwrm_stat_db_error_qstats_input_t, *phwrm_stat_db_error_qstats_input_t;
60869 
60870 /* hwrm_stat_db_error_qstats_output (size:320b/40B) */
60871 
60872 typedef struct hwrm_stat_db_error_qstats_output {
60873 	/* The specific error status for the command. */
60874 	uint16_t	error_code;
60875 	/* The HWRM command request type. */
60876 	uint16_t	req_type;
60877 	/* The sequence ID from the original command. */
60878 	uint16_t	seq_id;
60879 	/* The length of the response data in number of bytes. */
60880 	uint16_t	resp_len;
60881 	/*
60882 	 * Specifies count of doorbells dropped due to RoCE SQs or L2
60883 	 * Tx Rings being in invalid state.
60884 	 */
60885 	uint32_t	tx_db_drop_invalid_qp_state;
60886 	/*
60887 	 * Specifies count of doorbells dropped due to RoCE RQs/SRQs or
60888 	 * L2 Rx Rings being used in invalid state.
60889 	 */
60890 	uint32_t	rx_db_drop_invalid_rq_state;
60891 	/*
60892 	 * Specifies count of doorbells dropped for any doorbell type
60893 	 * due to formatting errors such as illegal doorbell message
60894 	 * type, index out of range etc.
60895 	 */
60896 	uint32_t	tx_db_drop_format_error;
60897 	/*
60898 	 * Specifies count of express mode doorbells dropped for any
60899 	 * doorbell type due to error conditions such as DPI check,
60900 	 * context load error etc.
60901 	 */
60902 	uint32_t	express_db_dropped_misc_error;
60903 	/*
60904 	 * Specifies count of express mode doorbells dropped due to
60905 	 * RoCE SQ overflow.
60906 	 */
60907 	uint32_t	express_db_dropped_sq_overflow;
60908 	/*
60909 	 * Specifies count of express mode doorbells dropped due to
60910 	 * RoCE RQ overflow.
60911 	 */
60912 	uint32_t	express_db_dropped_rq_overflow;
60913 	uint8_t	unused_0[7];
60914 	/*
60915 	 * This field is used in Output records to indicate that the output
60916 	 * is completely written to RAM. This field should be read as '1'
60917 	 * to indicate that the output has been completely written.
60918 	 * When writing a command completion or response to an internal
60919 	 * processor, the order of writes has to be such that this field is
60920 	 * written last.
60921 	 */
60922 	uint8_t	valid;
60923 } hwrm_stat_db_error_qstats_output_t, *phwrm_stat_db_error_qstats_output_t;
60924 
60925 /*****************
60926  * hwrm_fw_reset *
60927  *****************/
60928 
60929 
60930 /* hwrm_fw_reset_input (size:192b/24B) */
60931 
60932 typedef struct hwrm_fw_reset_input {
60933 	/* The HWRM command request type. */
60934 	uint16_t	req_type;
60935 	/*
60936 	 * The completion ring to send the completion event on. This should
60937 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
60938 	 */
60939 	uint16_t	cmpl_ring;
60940 	/*
60941 	 * The sequence ID is used by the driver for tracking multiple
60942 	 * commands. This ID is treated as opaque data by the firmware and
60943 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
60944 	 */
60945 	uint16_t	seq_id;
60946 	/*
60947 	 * The target ID of the command:
60948 	 * * 0x0-0xFFF8 - The function ID
60949 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
60950 	 * * 0xFFFD - Reserved for user-space HWRM interface
60951 	 * * 0xFFFF - HWRM
60952 	 */
60953 	uint16_t	target_id;
60954 	/*
60955 	 * A physical address pointer pointing to a host buffer that the
60956 	 * command's response data will be written. This can be either a host
60957 	 * physical address (HPA) or a guest physical address (GPA) and must
60958 	 * point to a physically contiguous block of memory.
60959 	 */
60960 	uint64_t	resp_addr;
60961 	/* Type of embedded processor. */
60962 	uint8_t	embedded_proc_type;
60963 	/* Boot Processor */
60964 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_BOOT		UINT32_C(0x0)
60965 	/* Management Processor */
60966 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_MGMT		UINT32_C(0x1)
60967 	/* Network control processor */
60968 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_NETCTRL		UINT32_C(0x2)
60969 	/* RoCE control processor */
60970 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_ROCE		UINT32_C(0x3)
60971 	/*
60972 	 * Host (in multi-host environment): This is only valid if requester
60973 	 * is IPC. Reinit host hardware resources and PCIe.
60974 	 */
60975 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST		UINT32_C(0x4)
60976 	/*
60977 	 * AP processor complex (in multi-host environment).
60978 	 * Use host_idx to control which core is reset.
60979 	 */
60980 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_AP			UINT32_C(0x5)
60981 	/* Reset all blocks of the chip (including all processors) */
60982 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_CHIP		UINT32_C(0x6)
60983 	/*
60984 	 * Host (in multi-host environment): This is only valid if requester
60985 	 * is IPC. Reinit host hardware resources.
60986 	 */
60987 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT  UINT32_C(0x7)
60988 	/*
60989 	 * Activate firmware that has been programmed to NVM. The
60990 	 * activation is done in an impactless manner as part of the scheme
60991 	 * where hwrm_fw_state_backup precedes the call, and
60992 	 * hwrm_fw_state_restore follows it. Before this call returns, FW
60993 	 * status is set to a non-0x8000 value to disambiguate reset pending
60994 	 * from reset complete. The reset process begins after this call
60995 	 * returns to ensure this HWRM has completed before reset begins.
60996 	 */
60997 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_IMPACTLESS_ACTIVATION UINT32_C(0x8)
60998 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_LAST		HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_IMPACTLESS_ACTIVATION
60999 	/* Type of self reset. */
61000 	uint8_t	selfrst_status;
61001 	/* No Self Reset */
61002 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTNONE	UINT32_C(0x0)
61003 	/* Self Reset as soon as possible to do so safely */
61004 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTASAP	UINT32_C(0x1)
61005 	/* Self Reset on PCIe Reset */
61006 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTPCIERST   UINT32_C(0x2)
61007 	/* Self Reset immediately after notification to all clients. */
61008 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE UINT32_C(0x3)
61009 	#define HWRM_FW_RESET_INPUT_SELFRST_STATUS_LAST		HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
61010 	/*
61011 	 * Indicate which host is being reset. 0 means first host.
61012 	 * Only valid when embedded_proc_type is host in multihost
61013 	 * environment
61014 	 */
61015 	uint8_t	host_idx;
61016 	uint8_t	flags;
61017 	/*
61018 	 * When this bit is '1', then the core firmware initiates
61019 	 * the reset only after graceful shut down of all registered
61020 	 * instances. If not, the device will continue with the existing
61021 	 * firmware.
61022 	 */
61023 	#define HWRM_FW_RESET_INPUT_FLAGS_RESET_GRACEFUL	UINT32_C(0x1)
61024 	/*
61025 	 * When this bit is '1', then drivers will be notified that
61026 	 * that the purpose of the reset was a firmware activation.
61027 	 * Such notifications are delivered via the RESET_NOTIFY async
61028 	 * event (reason_code: fw_activation).
61029 	 */
61030 	#define HWRM_FW_RESET_INPUT_FLAGS_FW_ACTIVATION	UINT32_C(0x2)
61031 	uint8_t	unused_0[4];
61032 } hwrm_fw_reset_input_t, *phwrm_fw_reset_input_t;
61033 
61034 /* hwrm_fw_reset_output (size:128b/16B) */
61035 
61036 typedef struct hwrm_fw_reset_output {
61037 	/* The specific error status for the command. */
61038 	uint16_t	error_code;
61039 	/* The HWRM command request type. */
61040 	uint16_t	req_type;
61041 	/* The sequence ID from the original command. */
61042 	uint16_t	seq_id;
61043 	/* The length of the response data in number of bytes. */
61044 	uint16_t	resp_len;
61045 	/* Type of self reset. */
61046 	uint8_t	selfrst_status;
61047 	/* No Self Reset */
61048 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTNONE	UINT32_C(0x0)
61049 	/* Self Reset as soon as possible to do so safely */
61050 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTASAP	UINT32_C(0x1)
61051 	/* Self Reset on PCIe Reset */
61052 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST   UINT32_C(0x2)
61053 	/* Self Reset immediately after notification to all clients. */
61054 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE UINT32_C(0x3)
61055 	#define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_LAST		HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
61056 	uint8_t	unused_0[6];
61057 	/*
61058 	 * This field is used in Output records to indicate that the output
61059 	 * is completely written to RAM. This field should be read as '1'
61060 	 * to indicate that the output has been completely written. When
61061 	 * writing a command completion or response to an internal processor,
61062 	 * the order of writes has to be such that this field is written last.
61063 	 */
61064 	uint8_t	valid;
61065 } hwrm_fw_reset_output_t, *phwrm_fw_reset_output_t;
61066 
61067 /*******************
61068  * hwrm_fw_qstatus *
61069  *******************/
61070 
61071 
61072 /* hwrm_fw_qstatus_input (size:192b/24B) */
61073 
61074 typedef struct hwrm_fw_qstatus_input {
61075 	/* The HWRM command request type. */
61076 	uint16_t	req_type;
61077 	/*
61078 	 * The completion ring to send the completion event on. This should
61079 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61080 	 */
61081 	uint16_t	cmpl_ring;
61082 	/*
61083 	 * The sequence ID is used by the driver for tracking multiple
61084 	 * commands. This ID is treated as opaque data by the firmware and
61085 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61086 	 */
61087 	uint16_t	seq_id;
61088 	/*
61089 	 * The target ID of the command:
61090 	 * * 0x0-0xFFF8 - The function ID
61091 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61092 	 * * 0xFFFD - Reserved for user-space HWRM interface
61093 	 * * 0xFFFF - HWRM
61094 	 */
61095 	uint16_t	target_id;
61096 	/*
61097 	 * A physical address pointer pointing to a host buffer that the
61098 	 * command's response data will be written. This can be either a host
61099 	 * physical address (HPA) or a guest physical address (GPA) and must
61100 	 * point to a physically contiguous block of memory.
61101 	 */
61102 	uint64_t	resp_addr;
61103 	/* Type of embedded processor. */
61104 	uint8_t	embedded_proc_type;
61105 	/* Boot Processor */
61106 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_BOOT	UINT32_C(0x0)
61107 	/* Management Processor */
61108 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_MGMT	UINT32_C(0x1)
61109 	/* Network control processor */
61110 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_NETCTRL UINT32_C(0x2)
61111 	/* RoCE control processor */
61112 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_ROCE	UINT32_C(0x3)
61113 	/*
61114 	 * Host (in multi-host environment): This is only valid if requester
61115 	 * is IPC
61116 	 */
61117 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_HOST	UINT32_C(0x4)
61118 	/*
61119 	 * AP processor complex (in multi-host environment). Use host_idx to
61120 	 * control which core is reset
61121 	 */
61122 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_AP	UINT32_C(0x5)
61123 	/* Reset all blocks of the chip (including all processors) */
61124 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_CHIP	UINT32_C(0x6)
61125 	#define HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_LAST   HWRM_FW_QSTATUS_INPUT_EMBEDDED_PROC_TYPE_CHIP
61126 	uint8_t	unused_0[7];
61127 } hwrm_fw_qstatus_input_t, *phwrm_fw_qstatus_input_t;
61128 
61129 /* hwrm_fw_qstatus_output (size:128b/16B) */
61130 
61131 typedef struct hwrm_fw_qstatus_output {
61132 	/* The specific error status for the command. */
61133 	uint16_t	error_code;
61134 	/* The HWRM command request type. */
61135 	uint16_t	req_type;
61136 	/* The sequence ID from the original command. */
61137 	uint16_t	seq_id;
61138 	/* The length of the response data in number of bytes. */
61139 	uint16_t	resp_len;
61140 	/* Type of self reset. */
61141 	uint8_t	selfrst_status;
61142 	/* No Self Reset */
61143 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTNONE	UINT32_C(0x0)
61144 	/* Self Reset as soon as possible to do so safely */
61145 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTASAP	UINT32_C(0x1)
61146 	/* Self Reset on PCIe Reset */
61147 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST UINT32_C(0x2)
61148 	/* NIC power cycle (system cold boot) required */
61149 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTPOWER   UINT32_C(0x3)
61150 	#define HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_LAST	HWRM_FW_QSTATUS_OUTPUT_SELFRST_STATUS_SELFRSTPOWER
61151 	/*
61152 	 * The action needed to apply any pend nvm option changes.
61153 	 * If multiple options have been set the highest level
61154 	 * action is reported.
61155 	 */
61156 	uint8_t	nvm_option_action_status;
61157 	/* No Action needed */
61158 	#define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_NONE	UINT32_C(0x0)
61159 	/* Hot reset needed to apply nvm options */
61160 	#define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_HOTRESET UINT32_C(0x1)
61161 	/* Warm boot needed to apply nvm options */
61162 	#define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_WARMBOOT UINT32_C(0x2)
61163 	/* Cold boot needed to apply nvm options */
61164 	#define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_COLDBOOT UINT32_C(0x3)
61165 	#define HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_LAST		HWRM_FW_QSTATUS_OUTPUT_NVM_OPTION_ACTION_STATUS_NVMOPT_ACTION_COLDBOOT
61166 	uint8_t	unused_0[5];
61167 	/*
61168 	 * This field is used in Output records to indicate that the output
61169 	 * is completely written to RAM. This field should be read as '1'
61170 	 * to indicate that the output has been completely written. When
61171 	 * writing a command completion or response to an internal processor,
61172 	 * the order of writes has to be such that this field is written last.
61173 	 */
61174 	uint8_t	valid;
61175 } hwrm_fw_qstatus_output_t, *phwrm_fw_qstatus_output_t;
61176 
61177 /********************
61178  * hwrm_fw_set_time *
61179  ********************/
61180 
61181 
61182 /* hwrm_fw_set_time_input (size:256b/32B) */
61183 
61184 typedef struct hwrm_fw_set_time_input {
61185 	/* The HWRM command request type. */
61186 	uint16_t	req_type;
61187 	/*
61188 	 * The completion ring to send the completion event on. This should
61189 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61190 	 */
61191 	uint16_t	cmpl_ring;
61192 	/*
61193 	 * The sequence ID is used by the driver for tracking multiple
61194 	 * commands. This ID is treated as opaque data by the firmware and
61195 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61196 	 */
61197 	uint16_t	seq_id;
61198 	/*
61199 	 * The target ID of the command:
61200 	 * * 0x0-0xFFF8 - The function ID
61201 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61202 	 * * 0xFFFD - Reserved for user-space HWRM interface
61203 	 * * 0xFFFF - HWRM
61204 	 */
61205 	uint16_t	target_id;
61206 	/*
61207 	 * A physical address pointer pointing to a host buffer that the
61208 	 * command's response data will be written. This can be either a host
61209 	 * physical address (HPA) or a guest physical address (GPA) and must
61210 	 * point to a physically contiguous block of memory.
61211 	 */
61212 	uint64_t	resp_addr;
61213 	/* Current year */
61214 	uint16_t	year;
61215 	/* Date/time is not known */
61216 	#define HWRM_FW_SET_TIME_INPUT_YEAR_UNKNOWN UINT32_C(0x0)
61217 	#define HWRM_FW_SET_TIME_INPUT_YEAR_LAST   HWRM_FW_SET_TIME_INPUT_YEAR_UNKNOWN
61218 	/* Current month of year (1-12) */
61219 	uint8_t	month;
61220 	/* Current day of month (1-31) */
61221 	uint8_t	day;
61222 	/* Current hour (0-23) */
61223 	uint8_t	hour;
61224 	/* Current minute (0-59) */
61225 	uint8_t	minute;
61226 	/* Current second (0-59) */
61227 	uint8_t	second;
61228 	uint8_t	unused_0;
61229 	/* Current millisecond (0-999) */
61230 	uint16_t	millisecond;
61231 	/* Minutes east of UTC, 0xffff if TZ is not known */
61232 	int16_t	zone;
61233 	/* Time zone is Coordinated Universal Time (UTC) */
61234 	#define HWRM_FW_SET_TIME_INPUT_ZONE_UTC	0
61235 	/* Time zone is not known */
61236 	#define HWRM_FW_SET_TIME_INPUT_ZONE_UNKNOWN 65535
61237 	#define HWRM_FW_SET_TIME_INPUT_ZONE_LAST   HWRM_FW_SET_TIME_INPUT_ZONE_UNKNOWN
61238 	uint8_t	unused_1[4];
61239 } hwrm_fw_set_time_input_t, *phwrm_fw_set_time_input_t;
61240 
61241 /* hwrm_fw_set_time_output (size:128b/16B) */
61242 
61243 typedef struct hwrm_fw_set_time_output {
61244 	/* The specific error status for the command. */
61245 	uint16_t	error_code;
61246 	/* The HWRM command request type. */
61247 	uint16_t	req_type;
61248 	/* The sequence ID from the original command. */
61249 	uint16_t	seq_id;
61250 	/* The length of the response data in number of bytes. */
61251 	uint16_t	resp_len;
61252 	uint8_t	unused_0[7];
61253 	/*
61254 	 * This field is used in Output records to indicate that the output
61255 	 * is completely written to RAM. This field should be read as '1'
61256 	 * to indicate that the output has been completely written. When
61257 	 * writing a command completion or response to an internal processor,
61258 	 * the order of writes has to be such that this field is written last.
61259 	 */
61260 	uint8_t	valid;
61261 } hwrm_fw_set_time_output_t, *phwrm_fw_set_time_output_t;
61262 
61263 /********************
61264  * hwrm_fw_get_time *
61265  ********************/
61266 
61267 
61268 /* hwrm_fw_get_time_input (size:128b/16B) */
61269 
61270 typedef struct hwrm_fw_get_time_input {
61271 	/* The HWRM command request type. */
61272 	uint16_t	req_type;
61273 	/*
61274 	 * The completion ring to send the completion event on. This should
61275 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61276 	 */
61277 	uint16_t	cmpl_ring;
61278 	/*
61279 	 * The sequence ID is used by the driver for tracking multiple
61280 	 * commands. This ID is treated as opaque data by the firmware and
61281 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61282 	 */
61283 	uint16_t	seq_id;
61284 	/*
61285 	 * The target ID of the command:
61286 	 * * 0x0-0xFFF8 - The function ID
61287 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61288 	 * * 0xFFFD - Reserved for user-space HWRM interface
61289 	 * * 0xFFFF - HWRM
61290 	 */
61291 	uint16_t	target_id;
61292 	/*
61293 	 * A physical address pointer pointing to a host buffer that the
61294 	 * command's response data will be written. This can be either a host
61295 	 * physical address (HPA) or a guest physical address (GPA) and must
61296 	 * point to a physically contiguous block of memory.
61297 	 */
61298 	uint64_t	resp_addr;
61299 } hwrm_fw_get_time_input_t, *phwrm_fw_get_time_input_t;
61300 
61301 /* hwrm_fw_get_time_output (size:192b/24B) */
61302 
61303 typedef struct hwrm_fw_get_time_output {
61304 	/* The specific error status for the command. */
61305 	uint16_t	error_code;
61306 	/* The HWRM command request type. */
61307 	uint16_t	req_type;
61308 	/* The sequence ID from the original command. */
61309 	uint16_t	seq_id;
61310 	/* The length of the response data in number of bytes. */
61311 	uint16_t	resp_len;
61312 	/* Current year */
61313 	uint16_t	year;
61314 	/* Date/time is not known */
61315 	#define HWRM_FW_GET_TIME_OUTPUT_YEAR_UNKNOWN UINT32_C(0x0)
61316 	#define HWRM_FW_GET_TIME_OUTPUT_YEAR_LAST   HWRM_FW_GET_TIME_OUTPUT_YEAR_UNKNOWN
61317 	/* Current month of year (1-12) */
61318 	uint8_t	month;
61319 	/* Current day of month (1-31) */
61320 	uint8_t	day;
61321 	/* Current hour (0-23) */
61322 	uint8_t	hour;
61323 	/* Current minute (0-59) */
61324 	uint8_t	minute;
61325 	/* Current second (0-59) */
61326 	uint8_t	second;
61327 	uint8_t	unused_0;
61328 	/* Current millisecond (0-999) */
61329 	uint16_t	millisecond;
61330 	/* Minutes east of UTC, 0xffff if TZ is not known */
61331 	int16_t	zone;
61332 	/* Time zone is Coordinated Universal Time (UTC) */
61333 	#define HWRM_FW_GET_TIME_OUTPUT_ZONE_UTC	0
61334 	/* Time zone is not known */
61335 	#define HWRM_FW_GET_TIME_OUTPUT_ZONE_UNKNOWN 65535
61336 	#define HWRM_FW_GET_TIME_OUTPUT_ZONE_LAST   HWRM_FW_GET_TIME_OUTPUT_ZONE_UNKNOWN
61337 	uint8_t	unused_1[3];
61338 	/*
61339 	 * This field is used in Output records to indicate that the output
61340 	 * is completely written to RAM. This field should be read as '1'
61341 	 * to indicate that the output has been completely written. When
61342 	 * writing a command completion or response to an internal processor,
61343 	 * the order of writes has to be such that this field is written last.
61344 	 */
61345 	uint8_t	valid;
61346 } hwrm_fw_get_time_output_t, *phwrm_fw_get_time_output_t;
61347 
61348 /* hwrm_struct_hdr (size:128b/16B) */
61349 
61350 typedef struct hwrm_struct_hdr {
61351 	/* This value indicates the structured data ID. */
61352 	uint16_t	struct_id;
61353 	/* LLDP configuration structured data ID. */
61354 	#define HWRM_STRUCT_HDR_STRUCT_ID_LLDP_CFG	UINT32_C(0x41b)
61355 	/* DCBX ETS configuration structured data ID. */
61356 	#define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_ETS	UINT32_C(0x41d)
61357 	/* DCBX PFC configuration structured data ID. */
61358 	#define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_PFC	UINT32_C(0x41f)
61359 	/* DCBX APP configuration structured data ID. */
61360 	#define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_APP	UINT32_C(0x421)
61361 	/* DCBX state configuration structured data ID for all DCBX features. */
61362 	#define HWRM_STRUCT_HDR_STRUCT_ID_DCBX_FEATURE_STATE UINT32_C(0x422)
61363 	/*
61364 	 * LLDP generic structured data ID. This is used with
61365 	 * GET_STRUCTURED_DATA only.
61366 	 */
61367 	#define HWRM_STRUCT_HDR_STRUCT_ID_LLDP_GENERIC	UINT32_C(0x424)
61368 	/*
61369 	 * LLDP device structured data ID. This is used with
61370 	 * GET_STRUCTURED_DATA only.
61371 	 */
61372 	#define HWRM_STRUCT_HDR_STRUCT_ID_LLDP_DEVICE	UINT32_C(0x426)
61373 	/* Power Backup info */
61374 	#define HWRM_STRUCT_HDR_STRUCT_ID_POWER_BKUP	UINT32_C(0x427)
61375 	/* Guest physical address to Host physical address mapping */
61376 	#define HWRM_STRUCT_HDR_STRUCT_ID_PEER_MMAP	UINT32_C(0x429)
61377 	/* reserved for AFM usage. */
61378 	#define HWRM_STRUCT_HDR_STRUCT_ID_AFM_OPAQUE	UINT32_C(0x1)
61379 	/* Port description. */
61380 	#define HWRM_STRUCT_HDR_STRUCT_ID_PORT_DESCRIPTION   UINT32_C(0xa)
61381 	/* RSSv2 Configuration. */
61382 	#define HWRM_STRUCT_HDR_STRUCT_ID_RSS_V2		UINT32_C(0x64)
61383 	/* MSI-X vectors per VF table. */
61384 	#define HWRM_STRUCT_HDR_STRUCT_ID_MSIX_PER_VF	UINT32_C(0xc8)
61385 	#define HWRM_STRUCT_HDR_STRUCT_ID_LAST		HWRM_STRUCT_HDR_STRUCT_ID_MSIX_PER_VF
61386 	/* This value indicates the length of structured data. */
61387 	uint16_t	len;
61388 	/* This value indicates the version of structured data. */
61389 	uint8_t	version;
61390 	/* This value indicates the number of structured data elements. */
61391 	uint8_t	count;
61392 	/* This value indicates the subtype. */
61393 	uint16_t	subtype;
61394 	/*
61395 	 * This value indicates the count of 64-bit values that point to the next
61396 	 * header. A value of 0 means that this is the last element. The value is
61397 	 * a count of 64-bit words from the beginning of the current header.
61398 	 */
61399 	uint16_t	next_offset;
61400 	/* This value indicates this is the last element */
61401 	#define HWRM_STRUCT_HDR_NEXT_OFFSET_LAST UINT32_C(0x0)
61402 	uint8_t	unused_0[6];
61403 } hwrm_struct_hdr_t, *phwrm_struct_hdr_t;
61404 
61405 /* hwrm_struct_data_dcbx_ets (size:256b/32B) */
61406 
61407 typedef struct hwrm_struct_data_dcbx_ets {
61408 	/*
61409 	 * This field indicates if this configuration is ETS recommendation or
61410 	 * ETS configuration. A value 1 means it is ETS configuration, A value of
61411 	 * 2 means it is a ETS recommendation.
61412 	 */
61413 	uint8_t	destination;
61414 	/* ETS configuration */
61415 	#define HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_CONFIGURATION   UINT32_C(0x1)
61416 	/* ETS recommendation */
61417 	#define HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_RECOMMMENDATION UINT32_C(0x2)
61418 	#define HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_LAST	HWRM_STRUCT_DATA_DCBX_ETS_DESTINATION_RECOMMMENDATION
61419 	/* This value indicates maximum ETS TCs supported. */
61420 	uint8_t	max_tcs;
61421 	/* unused. */
61422 	uint16_t	unused1;
61423 	/* ETS priority 0 to TC map. */
61424 	uint8_t	pri0_to_tc_map;
61425 	/* ETS priority 1 to TC map. */
61426 	uint8_t	pri1_to_tc_map;
61427 	/* ETS priority 2 to TC map. */
61428 	uint8_t	pri2_to_tc_map;
61429 	/* ETS priority 3 to TC map. */
61430 	uint8_t	pri3_to_tc_map;
61431 	/* ETS priority 4 to TC map. */
61432 	uint8_t	pri4_to_tc_map;
61433 	/* ETS priority 5 to TC map. */
61434 	uint8_t	pri5_to_tc_map;
61435 	/* ETS priority 6 to TC map. */
61436 	uint8_t	pri6_to_tc_map;
61437 	/* ETS priority 7 to TC map. */
61438 	uint8_t	pri7_to_tc_map;
61439 	/* ETS TC 0 to bandwidth map. */
61440 	uint8_t	tc0_to_bw_map;
61441 	/* ETS TC 1 to bandwidth map. */
61442 	uint8_t	tc1_to_bw_map;
61443 	/* ETS TC 2 to bandwidth map. */
61444 	uint8_t	tc2_to_bw_map;
61445 	/* ETS TC 3 to bandwidth map. */
61446 	uint8_t	tc3_to_bw_map;
61447 	/* ETS TC 4 to bandwidth map. */
61448 	uint8_t	tc4_to_bw_map;
61449 	/* ETS TC 5 to bandwidth map. */
61450 	uint8_t	tc5_to_bw_map;
61451 	/* ETS TC 6 to bandwidth map. */
61452 	uint8_t	tc6_to_bw_map;
61453 	/* ETS TC 7 to bandwidth map. */
61454 	uint8_t	tc7_to_bw_map;
61455 	/* ETS TC 0 to TSA map. */
61456 	uint8_t	tc0_to_tsa_map;
61457 	/* strict priority */
61458 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_SP		UINT32_C(0x0)
61459 	/* credit based shaper */
61460 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_CBS		UINT32_C(0x1)
61461 	/* ETS */
61462 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_ETS		UINT32_C(0x2)
61463 	/* vendor specific */
61464 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_VENDOR_SPECIFIC UINT32_C(0xff)
61465 	#define HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_LAST			HWRM_STRUCT_DATA_DCBX_ETS_TC0_TO_TSA_MAP_TSA_TYPE_VENDOR_SPECIFIC
61466 	/* ETS TC 1 to TSA map. */
61467 	uint8_t	tc1_to_tsa_map;
61468 	/* ETS TC 2 to TSA map. */
61469 	uint8_t	tc2_to_tsa_map;
61470 	/* ETS TC 3 to TSA map. */
61471 	uint8_t	tc3_to_tsa_map;
61472 	/* ETS TC 4 to TSA map. */
61473 	uint8_t	tc4_to_tsa_map;
61474 	/* ETS TC 5 to TSA map. */
61475 	uint8_t	tc5_to_tsa_map;
61476 	/* ETS TC 6 to TSA map. */
61477 	uint8_t	tc6_to_tsa_map;
61478 	/* ETS TC 7 to TSA map. */
61479 	uint8_t	tc7_to_tsa_map;
61480 	uint8_t	unused_0[4];
61481 } hwrm_struct_data_dcbx_ets_t, *phwrm_struct_data_dcbx_ets_t;
61482 
61483 /* hwrm_struct_data_dcbx_pfc (size:64b/8B) */
61484 
61485 typedef struct hwrm_struct_data_dcbx_pfc {
61486 	/*
61487 	 * This field indicates PFC priority bit map. A value of '0' indicates
61488 	 * PFC is disabled. A value of '1' indicates PFC is enabled on that
61489 	 * priority.
61490 	 */
61491 	uint8_t	pfc_priority_bitmap;
61492 	/*
61493 	 * This field indicates max PFC TCs supported. Each PFC TC will map to
61494 	 * a lossless CoS queue.
61495 	 */
61496 	uint8_t	max_pfc_tcs;
61497 	/*
61498 	 * This field indicates if MACSec bypass capability is enabled. A value
61499 	 * of '1' indicates MBC is enabled. A value of '0' indicates MBC is
61500 	 * disabled.
61501 	 */
61502 	uint8_t	mbc;
61503 	uint8_t	unused_0[5];
61504 } hwrm_struct_data_dcbx_pfc_t, *phwrm_struct_data_dcbx_pfc_t;
61505 
61506 /* hwrm_struct_data_dcbx_app (size:64b/8B) */
61507 
61508 typedef struct hwrm_struct_data_dcbx_app {
61509 	/*
61510 	 * This field indicates the protocol identifier. This should be specified
61511 	 *		in big endian format.
61512 	 */
61513 	uint16_t	protocol_id;
61514 	/*
61515 	 * This field indicates the protocol selector. The valid values are
61516 	 *		mentioned below.
61517 	 */
61518 	uint8_t	protocol_selector;
61519 	/* ether type */
61520 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_ETHER_TYPE   UINT32_C(0x1)
61521 	/* TCP port */
61522 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_TCP_PORT	UINT32_C(0x2)
61523 	/* UDP port */
61524 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_UDP_PORT	UINT32_C(0x3)
61525 	/* TCP & UDP port */
61526 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_TCP_UDP_PORT UINT32_C(0x4)
61527 	#define HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_LAST	HWRM_STRUCT_DATA_DCBX_APP_PROTOCOL_SELECTOR_TCP_UDP_PORT
61528 	/* This field indicates application priority. */
61529 	uint8_t	priority;
61530 	/* This field indicates this entry is valid. */
61531 	uint8_t	valid;
61532 	uint8_t	unused_0[3];
61533 } hwrm_struct_data_dcbx_app_t, *phwrm_struct_data_dcbx_app_t;
61534 
61535 /* hwrm_struct_data_dcbx_feature_state (size:64b/8B) */
61536 
61537 typedef struct hwrm_struct_data_dcbx_feature_state {
61538 	/* DCBX mode - IEEE or CEE. This is read only field. */
61539 	uint8_t	dcbx_mode;
61540 	/* DCBX disabled mode. */
61541 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_DISABLED UINT32_C(0x0)
61542 	/* DCBX IEEE mode. */
61543 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_IEEE	UINT32_C(0x1)
61544 	/* DCBX CEE mode. */
61545 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_CEE	UINT32_C(0x2)
61546 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_LAST	HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_DCBX_MODE_DCBX_CEE
61547 	/* ETS TLV state. */
61548 	uint8_t	ets_state;
61549 	/* PFC TLV state. */
61550 	uint8_t	pfc_state;
61551 	/* App TLV state. */
61552 	uint8_t	app_state;
61553 	/* Feature enable bit position. */
61554 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_ENABLE_BIT_POS	UINT32_C(0x7)
61555 	/* Feature willing bit position. */
61556 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_WILLING_BIT_POS   UINT32_C(0x6)
61557 	/* Feature advertise bit position. */
61558 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_ADVERTISE_BIT_POS UINT32_C(0x5)
61559 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_LAST		HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_APP_STATE_ADVERTISE_BIT_POS
61560 	/* unused. */
61561 	uint8_t	unused[3];
61562 	/*
61563 	 * This field is used to reset the DCBX configuration to factory
61564 	 * defaults.
61565 	 */
61566 	uint8_t	resets;
61567 	/* reset ETS configuration. */
61568 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_ETS   UINT32_C(0x1)
61569 	/* reset PFC configuration. */
61570 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_PFC   UINT32_C(0x2)
61571 	/* reset application configuration. */
61572 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_APP   UINT32_C(0x4)
61573 	/* reset DCBX state configuration. */
61574 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_STATE UINT32_C(0x8)
61575 	#define HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_LAST	HWRM_STRUCT_DATA_DCBX_FEATURE_STATE_RESETS_RESET_STATE
61576 } hwrm_struct_data_dcbx_feature_state_t, *phwrm_struct_data_dcbx_feature_state_t;
61577 
61578 /* hwrm_struct_data_lldp (size:64b/8B) */
61579 
61580 typedef struct hwrm_struct_data_lldp {
61581 	/* Port admin state */
61582 	uint8_t	admin_state;
61583 	/* Disable both Tx and Rx */
61584 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_DISABLE UINT32_C(0x0)
61585 	/* Enable Tx only */
61586 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_TX	UINT32_C(0x1)
61587 	/* Enable Rx only */
61588 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_RX	UINT32_C(0x2)
61589 	/* Enable both Tx and Rx */
61590 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_ENABLE  UINT32_C(0x3)
61591 	#define HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_LAST   HWRM_STRUCT_DATA_LLDP_ADMIN_STATE_ENABLE
61592 	/* Port description TLV transmit state (enable(1)/disable(0)). */
61593 	uint8_t	port_description_state;
61594 	/* Disable */
61595 	#define HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_DISABLE UINT32_C(0x0)
61596 	/* Enable. */
61597 	#define HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_ENABLE  UINT32_C(0x1)
61598 	#define HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_LAST   HWRM_STRUCT_DATA_LLDP_PORT_DESCRIPTION_STATE_ENABLE
61599 	/* System name TLV transmit state (enable(1)/disable(0)). */
61600 	uint8_t	system_name_state;
61601 	/* Disable */
61602 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_DISABLE UINT32_C(0x0)
61603 	/* Enable. */
61604 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_ENABLE  UINT32_C(0x1)
61605 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_LAST   HWRM_STRUCT_DATA_LLDP_SYSTEM_NAME_STATE_ENABLE
61606 	/* System description TLV transmit state (enable(1)/disable(0)). */
61607 	uint8_t	system_desc_state;
61608 	/* Disable */
61609 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_DISABLE UINT32_C(0x0)
61610 	/* Enable. */
61611 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_ENABLE  UINT32_C(0x1)
61612 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_LAST   HWRM_STRUCT_DATA_LLDP_SYSTEM_DESC_STATE_ENABLE
61613 	/* System capabilities TLV transmit state (enable(1)/disable(0)). */
61614 	uint8_t	system_cap_state;
61615 	/* Disable */
61616 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_DISABLE UINT32_C(0x0)
61617 	/* Enable. */
61618 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_ENABLE  UINT32_C(0x1)
61619 	#define HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_LAST   HWRM_STRUCT_DATA_LLDP_SYSTEM_CAP_STATE_ENABLE
61620 	/* Management address TLV transmit state (enable(1)/disable(0)). */
61621 	uint8_t	mgmt_addr_state;
61622 	/* Disable */
61623 	#define HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_DISABLE UINT32_C(0x0)
61624 	/* Enable. */
61625 	#define HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_ENABLE  UINT32_C(0x1)
61626 	#define HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_LAST   HWRM_STRUCT_DATA_LLDP_MGMT_ADDR_STATE_ENABLE
61627 	/* Async event notification state (enable(1)/disable(0)). */
61628 	uint8_t	async_event_notification_state;
61629 	/* Disable */
61630 	#define HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_DISABLE UINT32_C(0x0)
61631 	/* Enable. */
61632 	#define HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_ENABLE  UINT32_C(0x1)
61633 	#define HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_LAST   HWRM_STRUCT_DATA_LLDP_ASYNC_EVENT_NOTIFICATION_STATE_ENABLE
61634 	uint8_t	unused_0;
61635 } hwrm_struct_data_lldp_t, *phwrm_struct_data_lldp_t;
61636 
61637 /* hwrm_struct_data_lldp_generic (size:2112b/264B) */
61638 
61639 typedef struct hwrm_struct_data_lldp_generic {
61640 	/* TLV type. */
61641 	uint8_t	tlv_type;
61642 	/* Chassis ID TLV */
61643 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_CHASSIS		UINT32_C(0x1)
61644 	/* Port ID TLV */
61645 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT		UINT32_C(0x2)
61646 	/* System name TLV */
61647 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_SYSTEM_NAME	UINT32_C(0x3)
61648 	/* System description TLV */
61649 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_SYSTEM_DESCRIPTION UINT32_C(0x4)
61650 	/* Port name TLV */
61651 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT_NAME	UINT32_C(0x5)
61652 	/* Port description TLV */
61653 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT_DESCRIPTION   UINT32_C(0x6)
61654 	#define HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_LAST		HWRM_STRUCT_DATA_LLDP_GENERIC_TLV_TYPE_PORT_DESCRIPTION
61655 	/* TLV sub-type. */
61656 	uint8_t	subtype;
61657 	/* Length. */
61658 	uint8_t	length;
61659 	/* unused. */
61660 	uint8_t	unused1[5];
61661 	/* TLV value. */
61662 	uint32_t	tlv_value[64];
61663 } hwrm_struct_data_lldp_generic_t, *phwrm_struct_data_lldp_generic_t;
61664 
61665 /* hwrm_struct_data_lldp_device (size:1472b/184B) */
61666 
61667 typedef struct hwrm_struct_data_lldp_device {
61668 	/* Time to Live. */
61669 	uint16_t	ttl;
61670 	/* Management address length. */
61671 	uint8_t	mgmt_addr_len;
61672 	/* Management address type. */
61673 	uint8_t	mgmt_addr_type;
61674 	uint8_t	unused_3[4];
61675 	/* Management address. */
61676 	uint32_t	mgmt_addr[8];
61677 	/* System capabilities. */
61678 	uint32_t	system_caps;
61679 	/* Interface number type. */
61680 	uint8_t	intf_num_type;
61681 	/* Management address OID length. */
61682 	uint8_t	mgmt_addr_oid_length;
61683 	uint8_t	unused_4[2];
61684 	/* Interface number. */
61685 	uint32_t	intf_num;
61686 	uint8_t	unused_5[4];
61687 	/* Management address OID. */
61688 	uint32_t	mgmt_addr_oid[32];
61689 } hwrm_struct_data_lldp_device_t, *phwrm_struct_data_lldp_device_t;
61690 
61691 /* hwrm_struct_data_port_description (size:64b/8B) */
61692 
61693 typedef struct hwrm_struct_data_port_description {
61694 	/*
61695 	 * Port #. Port number starts at 0 and anything greater than number of
61696 	 * ports minus 1 is an error.
61697 	 */
61698 	uint8_t	port_id;
61699 	uint8_t	unused_0[7];
61700 } hwrm_struct_data_port_description_t, *phwrm_struct_data_port_description_t;
61701 
61702 /* hwrm_struct_data_rss_v2 (size:128b/16B) */
61703 
61704 typedef struct hwrm_struct_data_rss_v2 {
61705 	uint16_t	flags;
61706 	/* When this bit is '1', the hash type and hash key are included. */
61707 	#define HWRM_STRUCT_DATA_RSS_V2_FLAGS_HASH_VALID	UINT32_C(0x1)
61708 	/* RSS Context index. */
61709 	uint16_t	rss_ctx_id;
61710 	/* Number ring group IDs. */
61711 	uint16_t	num_ring_groups;
61712 	uint16_t	hash_type;
61713 	/*
61714 	 * When this bit is '1', the RSS hash shall be computed
61715 	 * over source and destination IPv4 addresses of IPv4
61716 	 * packets.
61717 	 */
61718 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_IPV4	UINT32_C(0x1)
61719 	/*
61720 	 * When this bit is '1', the RSS hash shall be computed
61721 	 * over source/destination IPv4 addresses and
61722 	 * source/destination ports of TCP/IPv4 packets.
61723 	 */
61724 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_TCP_IPV4	UINT32_C(0x2)
61725 	/*
61726 	 * When this bit is '1', the RSS hash shall be computed
61727 	 * over source/destination IPv4 addresses and
61728 	 * source/destination ports of UDP/IPv4 packets.
61729 	 */
61730 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_UDP_IPV4	UINT32_C(0x4)
61731 	/*
61732 	 * When this bit is '1', the RSS hash shall be computed
61733 	 * over source and destination IPv4 addresses of IPv6
61734 	 * packets.
61735 	 */
61736 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_IPV6	UINT32_C(0x8)
61737 	/*
61738 	 * When this bit is '1', the RSS hash shall be computed
61739 	 * over source/destination IPv6 addresses and
61740 	 * source/destination ports of TCP/IPv6 packets.
61741 	 */
61742 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_TCP_IPV6	UINT32_C(0x10)
61743 	/*
61744 	 * When this bit is '1', the RSS hash shall be computed
61745 	 * over source/destination IPv6 addresses and
61746 	 * source/destination ports of UDP/IPv6 packets.
61747 	 */
61748 	#define HWRM_STRUCT_DATA_RSS_V2_HASH_TYPE_UDP_IPV6	UINT32_C(0x20)
61749 	/* Hash key. This field is optional. */
61750 	uint64_t	hash_key_ring_group_ids;
61751 } hwrm_struct_data_rss_v2_t, *phwrm_struct_data_rss_v2_t;
61752 
61753 /* hwrm_struct_data_power_information (size:192b/24B) */
61754 
61755 typedef struct hwrm_struct_data_power_information {
61756 	/* Backup power information version */
61757 	uint32_t	bkup_power_info_ver;
61758 	/* Platform backup power count */
61759 	uint32_t	platform_bkup_power_count;
61760 	/* Load in milliwatts */
61761 	uint32_t	load_milli_watt;
61762 	/* Backup time in milliseconds */
61763 	uint32_t	bkup_time_milli_seconds;
61764 	/* Backup power status */
61765 	uint32_t	bkup_power_status;
61766 	/* Backup power charge time */
61767 	uint32_t	bkup_power_charge_time;
61768 } hwrm_struct_data_power_information_t, *phwrm_struct_data_power_information_t;
61769 
61770 /*
61771  * All mappings (upto 8) for a function will be sent down
61772  * at the same time. If entries are sent down for the same
61773  * function again, the existing saved entries will be
61774  * overwritten.
61775  */
61776 /* hwrm_struct_data_peer_mmap (size:1600b/200B) */
61777 
61778 typedef struct hwrm_struct_data_peer_mmap {
61779 	/*
61780 	 * Target function ID for the mappings. The fid should
61781 	 * be 0xffff for current PF or a valid VF fid for child
61782 	 * VF of the current PF.
61783 	 */
61784 	uint16_t	fid;
61785 	/*
61786 	 * Number of mappings for this function. The count has to
61787 	 * be > 0 and <= 8. Maximum of 8 mappings are supported.
61788 	 */
61789 	uint16_t	count;
61790 	uint32_t	unused_0;
61791 	/* Host Physical Address for mapping 0. */
61792 	uint64_t	hpa_0;
61793 	/* Guest Physical Address for mapping 0. */
61794 	uint64_t	gpa_0;
61795 	/* Size in Kilobytes for mapping 0. */
61796 	uint64_t	size_0;
61797 	/* Host Physical Address for mapping 1. */
61798 	uint64_t	hpa_1;
61799 	/* Guest Physical Address for mapping 1. */
61800 	uint64_t	gpa_1;
61801 	/* Size in Kilobytes for mapping 1. */
61802 	uint64_t	size_1;
61803 	/* Host Physical Address for mapping 2. */
61804 	uint64_t	hpa_2;
61805 	/* Guest Physical Address for mapping 2. */
61806 	uint64_t	gpa_2;
61807 	/* Size in Kilobytes for mapping 2. */
61808 	uint64_t	size_2;
61809 	/* Host Physical Address for mapping 3. */
61810 	uint64_t	hpa_3;
61811 	/* Guest Physical Address for mapping 3. */
61812 	uint64_t	gpa_3;
61813 	/* Size in Kilobytes for mapping 3. */
61814 	uint64_t	size_3;
61815 	/* Host Physical Address for mapping 4. */
61816 	uint64_t	hpa_4;
61817 	/* Guest Physical Address for mapping 4. */
61818 	uint64_t	gpa_4;
61819 	/* Size in Kilobytes for mapping 4. */
61820 	uint64_t	size_4;
61821 	/* Host Physical Address for mapping 5. */
61822 	uint64_t	hpa_5;
61823 	/* Guest Physical Address for mapping 5. */
61824 	uint64_t	gpa_5;
61825 	/* Size in Kilobytes for mapping 5. */
61826 	uint64_t	size_5;
61827 	/* Host Physical Address for mapping 6. */
61828 	uint64_t	hpa_6;
61829 	/* Guest Physical Address for mapping 6. */
61830 	uint64_t	gpa_6;
61831 	/* Size in Kilobytes for mapping 6. */
61832 	uint64_t	size_6;
61833 	/* Host Physical Address for mapping 7. */
61834 	uint64_t	hpa_7;
61835 	/* Guest Physical Address for mapping 7. */
61836 	uint64_t	gpa_7;
61837 	/* Size in Kilobytes for mapping 7. */
61838 	uint64_t	size_7;
61839 } hwrm_struct_data_peer_mmap_t, *phwrm_struct_data_peer_mmap_t;
61840 
61841 /* hwrm_struct_data_msix_per_vf (size:320b/40B) */
61842 
61843 typedef struct hwrm_struct_data_msix_per_vf {
61844 	/* PF ID */
61845 	uint16_t	pf_id;
61846 	/* Number of rows in table. */
61847 	uint16_t	count;
61848 	uint32_t	unused_0;
61849 	/* Starting VF for row 0 */
61850 	uint16_t	start_vf_0;
61851 	/* MSI-X vectors per VF for row 0 */
61852 	uint16_t	msix_0;
61853 	/* Starting VF for row 1 */
61854 	uint16_t	start_vf_1;
61855 	/* MSI-X vectors per VF for row 1 */
61856 	uint16_t	msix_1;
61857 	/* Starting VF for row 2 */
61858 	uint16_t	start_vf_2;
61859 	/* MSI-X vectors per VF for row 2 */
61860 	uint16_t	msix_2;
61861 	/* Starting VF for row 3 */
61862 	uint16_t	start_vf_3;
61863 	/* MSI-X vectors per VF for row 3 */
61864 	uint16_t	msix_3;
61865 	/* Starting VF for row 4 */
61866 	uint16_t	start_vf_4;
61867 	/* MSI-X vectors per VF for row 4 */
61868 	uint16_t	msix_4;
61869 	/* Starting VF for row 5 */
61870 	uint16_t	start_vf_5;
61871 	/* MSI-X vectors per VF for row 5 */
61872 	uint16_t	msix_5;
61873 	/* Starting VF for row 6 */
61874 	uint16_t	start_vf_6;
61875 	/* MSI-X vectors per VF for row 6 */
61876 	uint16_t	msix_6;
61877 	/* Starting VF for row 7 */
61878 	uint16_t	start_vf_7;
61879 	/* MSI-X vectors per VF for row 7 */
61880 	uint16_t	msix_7;
61881 } hwrm_struct_data_msix_per_vf_t, *phwrm_struct_data_msix_per_vf_t;
61882 
61883 /*******************************
61884  * hwrm_fw_set_structured_data *
61885  *******************************/
61886 
61887 
61888 /* hwrm_fw_set_structured_data_input (size:256b/32B) */
61889 
61890 typedef struct hwrm_fw_set_structured_data_input {
61891 	/* The HWRM command request type. */
61892 	uint16_t	req_type;
61893 	/*
61894 	 * The completion ring to send the completion event on. This should
61895 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61896 	 */
61897 	uint16_t	cmpl_ring;
61898 	/*
61899 	 * The sequence ID is used by the driver for tracking multiple
61900 	 * commands. This ID is treated as opaque data by the firmware and
61901 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61902 	 */
61903 	uint16_t	seq_id;
61904 	/*
61905 	 * The target ID of the command:
61906 	 * * 0x0-0xFFF8 - The function ID
61907 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
61908 	 * * 0xFFFD - Reserved for user-space HWRM interface
61909 	 * * 0xFFFF - HWRM
61910 	 */
61911 	uint16_t	target_id;
61912 	/*
61913 	 * A physical address pointer pointing to a host buffer that the
61914 	 * command's response data will be written. This can be either a host
61915 	 * physical address (HPA) or a guest physical address (GPA) and must
61916 	 * point to a physically contiguous block of memory.
61917 	 */
61918 	uint64_t	resp_addr;
61919 	/*
61920 	 * This is the host address where
61921 	 * structured data will be copied from
61922 	 */
61923 	uint64_t	src_data_addr;
61924 	/* size of data in bytes */
61925 	uint16_t	data_len;
61926 	/*
61927 	 * a count of the number of Structured Data Headers in the data
61928 	 * pointed by src_data_addr.
61929 	 */
61930 	uint8_t	hdr_cnt;
61931 	uint8_t	unused_0[5];
61932 } hwrm_fw_set_structured_data_input_t, *phwrm_fw_set_structured_data_input_t;
61933 
61934 /* hwrm_fw_set_structured_data_output (size:128b/16B) */
61935 
61936 typedef struct hwrm_fw_set_structured_data_output {
61937 	/* The specific error status for the command. */
61938 	uint16_t	error_code;
61939 	/* The HWRM command request type. */
61940 	uint16_t	req_type;
61941 	/* The sequence ID from the original command. */
61942 	uint16_t	seq_id;
61943 	/* The length of the response data in number of bytes. */
61944 	uint16_t	resp_len;
61945 	uint8_t	unused_0[7];
61946 	/*
61947 	 * This field is used in Output records to indicate that the output
61948 	 * is completely written to RAM. This field should be read as '1'
61949 	 * to indicate that the output has been completely written. When
61950 	 * writing a command completion or response to an internal processor,
61951 	 * the order of writes has to be such that this field is written last.
61952 	 */
61953 	uint8_t	valid;
61954 } hwrm_fw_set_structured_data_output_t, *phwrm_fw_set_structured_data_output_t;
61955 
61956 /* hwrm_fw_set_structured_data_cmd_err (size:64b/8B) */
61957 
61958 typedef struct hwrm_fw_set_structured_data_cmd_err {
61959 	/*
61960 	 * command specific error codes that goes to
61961 	 * the cmd_err field in Common HWRM Error Response.
61962 	 */
61963 	uint8_t	code;
61964 	/* Unknown error */
61965 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
61966 	/* count_of_headers is incorrect */
61967 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_HDR_CNT UINT32_C(0x1)
61968 	/* data improperly formatted */
61969 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_FMT	UINT32_C(0x2)
61970 	/* unknown structure ID(s) */
61971 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_ID	UINT32_C(0x3)
61972 	#define HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_LAST	HWRM_FW_SET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_ID
61973 	uint8_t	unused_0[7];
61974 } hwrm_fw_set_structured_data_cmd_err_t, *phwrm_fw_set_structured_data_cmd_err_t;
61975 
61976 /*******************************
61977  * hwrm_fw_get_structured_data *
61978  *******************************/
61979 
61980 
61981 /* hwrm_fw_get_structured_data_input (size:256b/32B) */
61982 
61983 typedef struct hwrm_fw_get_structured_data_input {
61984 	/* The HWRM command request type. */
61985 	uint16_t	req_type;
61986 	/*
61987 	 * The completion ring to send the completion event on. This should
61988 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
61989 	 */
61990 	uint16_t	cmpl_ring;
61991 	/*
61992 	 * The sequence ID is used by the driver for tracking multiple
61993 	 * commands. This ID is treated as opaque data by the firmware and
61994 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
61995 	 */
61996 	uint16_t	seq_id;
61997 	/*
61998 	 * The target ID of the command:
61999 	 * * 0x0-0xFFF8 - The function ID
62000 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62001 	 * * 0xFFFD - Reserved for user-space HWRM interface
62002 	 * * 0xFFFF - HWRM
62003 	 */
62004 	uint16_t	target_id;
62005 	/*
62006 	 * A physical address pointer pointing to a host buffer that the
62007 	 * command's response data will be written. This can be either a host
62008 	 * physical address (HPA) or a guest physical address (GPA) and must
62009 	 * point to a physically contiguous block of memory.
62010 	 */
62011 	uint64_t	resp_addr;
62012 	/*
62013 	 * This is the host address where
62014 	 * structured data will be copied to
62015 	 */
62016 	uint64_t	dest_data_addr;
62017 	/* size of data in bytes */
62018 	uint16_t	data_len;
62019 	/*
62020 	 * Structure_id is the id of the structure data requesting and count is
62021 	 * a requested number of instances of this data requested. The actual
62022 	 * number will be returned in count_of_headers
62023 	 */
62024 	uint16_t	structure_id;
62025 	/*
62026 	 * Subtype is an optional field used to specify additional information
62027 	 * of the data being retrieved. For example, if data can be categorized
62028 	 * as "live" vs "saved" then this field can be used to provide an
62029 	 * indication of "saved" vs "live" data. Not all structured data
62030 	 * supports subtypes and if they are supported then the structured data
62031 	 * will specify the valid values. If structured data is requested that
62032 	 * supports subtypes but no subtype is given then it is implementation
62033 	 * specific what will be returned. Some structure data can support a
62034 	 * subtype of "All" which would cause a list of structures to be
62035 	 * returned for all supported subtypes. "All" is only used on the
62036 	 * hwrm_get_structured_data command.
62037 	 */
62038 	uint16_t	subtype;
62039 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_UNUSED		UINT32_C(0x0)
62040 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_ALL			UINT32_C(0xffff)
62041 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NEAR_BRIDGE_ADMIN	UINT32_C(0x100)
62042 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NEAR_BRIDGE_PEER	UINT32_C(0x101)
62043 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NEAR_BRIDGE_OPERATIONAL UINT32_C(0x102)
62044 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NON_TPMR_ADMIN	UINT32_C(0x200)
62045 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NON_TPMR_PEER	UINT32_C(0x201)
62046 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_NON_TPMR_OPERATIONAL	UINT32_C(0x202)
62047 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_HOST_OPERATIONAL	UINT32_C(0x300)
62048 	#define HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_LAST		HWRM_FW_GET_STRUCTURED_DATA_INPUT_SUBTYPE_HOST_OPERATIONAL
62049 	/* Number of elements. This allows support of arrayed data */
62050 	uint8_t	count;
62051 	uint8_t	unused_0;
62052 } hwrm_fw_get_structured_data_input_t, *phwrm_fw_get_structured_data_input_t;
62053 
62054 /* hwrm_fw_get_structured_data_output (size:128b/16B) */
62055 
62056 typedef struct hwrm_fw_get_structured_data_output {
62057 	/* The specific error status for the command. */
62058 	uint16_t	error_code;
62059 	/* The HWRM command request type. */
62060 	uint16_t	req_type;
62061 	/* The sequence ID from the original command. */
62062 	uint16_t	seq_id;
62063 	/* The length of the response data in number of bytes. */
62064 	uint16_t	resp_len;
62065 	/*
62066 	 * a count of the number of Structured Data Headers in the data
62067 	 * pointed by dest_data_addr.
62068 	 */
62069 	uint8_t	hdr_cnt;
62070 	uint8_t	unused_0[6];
62071 	/*
62072 	 * This field is used in Output records to indicate that the output
62073 	 * is completely written to RAM. This field should be read as '1'
62074 	 * to indicate that the output has been completely written. When
62075 	 * writing a command completion or response to an internal processor,
62076 	 * the order of writes has to be such that this field is written last.
62077 	 */
62078 	uint8_t	valid;
62079 } hwrm_fw_get_structured_data_output_t, *phwrm_fw_get_structured_data_output_t;
62080 
62081 /* hwrm_fw_get_structured_data_cmd_err (size:64b/8B) */
62082 
62083 typedef struct hwrm_fw_get_structured_data_cmd_err {
62084 	/*
62085 	 * command specific error codes that goes to
62086 	 * the cmd_err field in Common HWRM Error Response.
62087 	 */
62088 	uint8_t	code;
62089 	/* Unknown error */
62090 	#define HWRM_FW_GET_STRUCTURED_DATA_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
62091 	/* unknown structure ID(s) */
62092 	#define HWRM_FW_GET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_ID  UINT32_C(0x3)
62093 	#define HWRM_FW_GET_STRUCTURED_DATA_CMD_ERR_CODE_LAST   HWRM_FW_GET_STRUCTURED_DATA_CMD_ERR_CODE_BAD_ID
62094 	uint8_t	unused_0[7];
62095 } hwrm_fw_get_structured_data_cmd_err_t, *phwrm_fw_get_structured_data_cmd_err_t;
62096 
62097 /*******************
62098  * hwrm_fw_ipc_msg *
62099  *******************/
62100 
62101 
62102 /* hwrm_fw_ipc_msg_input (size:320b/40B) */
62103 
62104 typedef struct hwrm_fw_ipc_msg_input {
62105 	/* The HWRM command request type. */
62106 	uint16_t	req_type;
62107 	/*
62108 	 * The completion ring to send the completion event on. This should
62109 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62110 	 */
62111 	uint16_t	cmpl_ring;
62112 	/*
62113 	 * The sequence ID is used by the driver for tracking multiple
62114 	 * commands. This ID is treated as opaque data by the firmware and
62115 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62116 	 */
62117 	uint16_t	seq_id;
62118 	/*
62119 	 * The target ID of the command:
62120 	 * * 0x0-0xFFF8 - The function ID
62121 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62122 	 * * 0xFFFD - Reserved for user-space HWRM interface
62123 	 * * 0xFFFF - HWRM
62124 	 */
62125 	uint16_t	target_id;
62126 	/*
62127 	 * A physical address pointer pointing to a host buffer that the
62128 	 * command's response data will be written. This can be either a host
62129 	 * physical address (HPA) or a guest physical address (GPA) and must
62130 	 * point to a physically contiguous block of memory.
62131 	 */
62132 	uint64_t	resp_addr;
62133 	uint32_t	enables;
62134 	/*
62135 	 * This bit must be '1' for the command_id field to be
62136 	 * configured.
62137 	 */
62138 	#define HWRM_FW_IPC_MSG_INPUT_ENABLES_COMMAND_ID	UINT32_C(0x1)
62139 	/*
62140 	 * This bit must be '1' for the src_processor field to be
62141 	 * configured.
62142 	 */
62143 	#define HWRM_FW_IPC_MSG_INPUT_ENABLES_SRC_PROCESSOR	UINT32_C(0x2)
62144 	/*
62145 	 * This bit must be '1' for the data_offset field to be
62146 	 * configured.
62147 	 */
62148 	#define HWRM_FW_IPC_MSG_INPUT_ENABLES_DATA_OFFSET	UINT32_C(0x4)
62149 	/*
62150 	 * This bit must be '1' for the length field to be
62151 	 * configured.
62152 	 */
62153 	#define HWRM_FW_IPC_MSG_INPUT_ENABLES_LENGTH		UINT32_C(0x8)
62154 	/* Command ID */
62155 	uint16_t	command_id;
62156 	/* RoCE LAG message */
62157 	#define HWRM_FW_IPC_MSG_INPUT_COMMAND_ID_ROCE_LAG	UINT32_C(0x1)
62158 	/* Query information on PF mapping for x86 and MAIA. */
62159 	#define HWRM_FW_IPC_MSG_INPUT_COMMAND_ID_MHB_HOST	UINT32_C(0x2)
62160 	/* RoCE driver version details to be sent to chimp */
62161 	#define HWRM_FW_IPC_MSG_INPUT_COMMAND_ID_ROCE_DRVR_VERSION UINT32_C(0x3)
62162 	#define HWRM_FW_IPC_MSG_INPUT_COMMAND_ID_LAST		HWRM_FW_IPC_MSG_INPUT_COMMAND_ID_ROCE_DRVR_VERSION
62163 	/* Source processor for this command. */
62164 	uint8_t	src_processor;
62165 	/* Chimp processor */
62166 	#define HWRM_FW_IPC_MSG_INPUT_SRC_PROCESSOR_CFW  UINT32_C(0x1)
62167 	/* BONO processor */
62168 	#define HWRM_FW_IPC_MSG_INPUT_SRC_PROCESSOR_BONO UINT32_C(0x2)
62169 	/* APE processor */
62170 	#define HWRM_FW_IPC_MSG_INPUT_SRC_PROCESSOR_APE  UINT32_C(0x3)
62171 	/* KONG processor */
62172 	#define HWRM_FW_IPC_MSG_INPUT_SRC_PROCESSOR_KONG UINT32_C(0x4)
62173 	#define HWRM_FW_IPC_MSG_INPUT_SRC_PROCESSOR_LAST HWRM_FW_IPC_MSG_INPUT_SRC_PROCESSOR_KONG
62174 	uint8_t	unused_0;
62175 	/* Offset of the data in the source processor memory. */
62176 	uint32_t	data_offset;
62177 	/* Length of the data in source processor. */
62178 	uint16_t	length;
62179 	uint8_t	unused_1[2];
62180 	/* This is for storing FW opaque data. */
62181 	uint64_t	opaque;
62182 } hwrm_fw_ipc_msg_input_t, *phwrm_fw_ipc_msg_input_t;
62183 
62184 /* hwrm_fw_ipc_msg_output (size:256b/32B) */
62185 
62186 typedef struct hwrm_fw_ipc_msg_output {
62187 	/* The specific error status for the command. */
62188 	uint16_t	error_code;
62189 	/* The HWRM command request type. */
62190 	uint16_t	req_type;
62191 	/* The sequence ID from the original command. */
62192 	uint16_t	seq_id;
62193 	/* The length of the response data in number of bytes. */
62194 	uint16_t	resp_len;
62195 	uint32_t	msg_data_1;
62196 	uint32_t	msg_data_2;
62197 	uint64_t	reserved64;
62198 	uint8_t	reserved48[7];
62199 	/*
62200 	 * This field is used in Output records to indicate that the output
62201 	 * is completely written to RAM. This field should be read as '1'
62202 	 * to indicate that the output has been completely written. When
62203 	 * writing a command completion or response to an internal processor,
62204 	 * the order of writes has to be such that this field is written last.
62205 	 */
62206 	uint8_t	valid;
62207 } hwrm_fw_ipc_msg_output_t, *phwrm_fw_ipc_msg_output_t;
62208 
62209 /***********************
62210  * hwrm_fw_ipc_mailbox *
62211  ***********************/
62212 
62213 
62214 /* hwrm_fw_ipc_mailbox_input (size:256b/32B) */
62215 
62216 typedef struct hwrm_fw_ipc_mailbox_input {
62217 	/* The HWRM command request type. */
62218 	uint16_t	req_type;
62219 	/*
62220 	 * The completion ring to send the completion event on. This should
62221 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62222 	 */
62223 	uint16_t	cmpl_ring;
62224 	/*
62225 	 * The sequence ID is used by the driver for tracking multiple
62226 	 * commands. This ID is treated as opaque data by the firmware and
62227 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62228 	 */
62229 	uint16_t	seq_id;
62230 	/*
62231 	 * The target ID of the command:
62232 	 * * 0x0-0xFFF8 - The function ID
62233 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62234 	 * * 0xFFFD - Reserved for user-space HWRM interface
62235 	 * * 0xFFFF - HWRM
62236 	 */
62237 	uint16_t	target_id;
62238 	/*
62239 	 * A physical address pointer pointing to a host buffer that the
62240 	 * command's response data will be written. This can be either a host
62241 	 * physical address (HPA) or a guest physical address (GPA) and must
62242 	 * point to a physically contiguous block of memory.
62243 	 */
62244 	uint64_t	resp_addr;
62245 	uint8_t	flags;
62246 	/* unused is 8 b */
62247 	uint8_t	unused;
62248 	/* asynchronous event to hosts. */
62249 	uint8_t	event_id;
62250 	/* PORT ID */
62251 	uint8_t	port_id;
62252 	/* event data1 of asynchronous event */
62253 	uint32_t	event_data1;
62254 	/* event data2 of asynchronous event */
62255 	uint32_t	event_data2;
62256 	uint8_t	unused_0[4];
62257 } hwrm_fw_ipc_mailbox_input_t, *phwrm_fw_ipc_mailbox_input_t;
62258 
62259 /* hwrm_fw_ipc_mailbox_output (size:128b/16B) */
62260 
62261 typedef struct hwrm_fw_ipc_mailbox_output {
62262 	/* The specific error status for the command. */
62263 	uint16_t	error_code;
62264 	/* The HWRM command request type. */
62265 	uint16_t	req_type;
62266 	/* The sequence ID from the original command. */
62267 	uint16_t	seq_id;
62268 	/* The length of the response data in number of bytes. */
62269 	uint16_t	resp_len;
62270 	uint8_t	unused_0[7];
62271 	/*
62272 	 * This field is used in Output records to indicate that the output
62273 	 * is completely written to RAM. This field should be read as '1'
62274 	 * to indicate that the output has been completely written. When
62275 	 * writing a command completion or response to an internal processor,
62276 	 * the order of writes has to be such that this field is written last.
62277 	 */
62278 	uint8_t	valid;
62279 } hwrm_fw_ipc_mailbox_output_t, *phwrm_fw_ipc_mailbox_output_t;
62280 
62281 /* hwrm_fw_ipc_mailbox_cmd_err (size:64b/8B) */
62282 
62283 typedef struct hwrm_fw_ipc_mailbox_cmd_err {
62284 	/*
62285 	 * command specific error codes that goes to
62286 	 * the cmd_err field in Common HWRM Error Response.
62287 	 */
62288 	uint8_t	code;
62289 	/* Unknown error */
62290 	#define HWRM_FW_IPC_MAILBOX_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
62291 	/* invalid event */
62292 	#define HWRM_FW_IPC_MAILBOX_CMD_ERR_CODE_BAD_ID  UINT32_C(0x3)
62293 	#define HWRM_FW_IPC_MAILBOX_CMD_ERR_CODE_LAST   HWRM_FW_IPC_MAILBOX_CMD_ERR_CODE_BAD_ID
62294 	uint8_t	unused_0[7];
62295 } hwrm_fw_ipc_mailbox_cmd_err_t, *phwrm_fw_ipc_mailbox_cmd_err_t;
62296 
62297 /*******************
62298  * hwrm_fw_ecn_cfg *
62299  *******************/
62300 
62301 
62302 /* hwrm_fw_ecn_cfg_input (size:192b/24B) */
62303 
62304 typedef struct hwrm_fw_ecn_cfg_input {
62305 	/* The HWRM command request type. */
62306 	uint16_t	req_type;
62307 	/*
62308 	 * The completion ring to send the completion event on. This should
62309 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62310 	 */
62311 	uint16_t	cmpl_ring;
62312 	/*
62313 	 * The sequence ID is used by the driver for tracking multiple
62314 	 * commands. This ID is treated as opaque data by the firmware and
62315 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62316 	 */
62317 	uint16_t	seq_id;
62318 	/*
62319 	 * The target ID of the command:
62320 	 * * 0x0-0xFFF8 - The function ID
62321 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62322 	 * * 0xFFFD - Reserved for user-space HWRM interface
62323 	 * * 0xFFFF - HWRM
62324 	 */
62325 	uint16_t	target_id;
62326 	/*
62327 	 * A physical address pointer pointing to a host buffer that the
62328 	 * command's response data will be written. This can be either a host
62329 	 * physical address (HPA) or a guest physical address (GPA) and must
62330 	 * point to a physically contiguous block of memory.
62331 	 */
62332 	uint64_t	resp_addr;
62333 	uint16_t	flags;
62334 	/*
62335 	 * When this bit is '1', Explicit Congestion Notification (ECN) is
62336 	 * enabled device-wide. When ECN is enabled on a multi-host system,
62337 	 * it is enabled for all hosts. This setting takes effect
62338 	 * immediately. When ECN is enabled, the firmware activates
62339 	 * additional receive Class of Service (CoS) queues that are enabled
62340 	 * for ECN marking and steers ECN-capable packets to those queues.
62341 	 * This setting is not saved persistently. To enable ECN
62342 	 * persistently, set NVM option 173, ENABLE_ECN.
62343 	 * Setting this bit to '0' disables ECN immediately.
62344 	 */
62345 	#define HWRM_FW_ECN_CFG_INPUT_FLAGS_ENABLE_ECN	UINT32_C(0x1)
62346 	uint8_t	unused_0[6];
62347 } hwrm_fw_ecn_cfg_input_t, *phwrm_fw_ecn_cfg_input_t;
62348 
62349 /* hwrm_fw_ecn_cfg_output (size:128b/16B) */
62350 
62351 typedef struct hwrm_fw_ecn_cfg_output {
62352 	/* The specific error status for the command. */
62353 	uint16_t	error_code;
62354 	/* The HWRM command request type. */
62355 	uint16_t	req_type;
62356 	/* The sequence ID from the original command. */
62357 	uint16_t	seq_id;
62358 	/* The length of the response data in number of bytes. */
62359 	uint16_t	resp_len;
62360 	uint8_t	unused_0[7];
62361 	/*
62362 	 * This field is used in Output records to indicate that the output
62363 	 * is completely written to RAM. This field should be read as '1'
62364 	 * to indicate that the output has been completely written. When
62365 	 * writing a command completion or response to an internal processor,
62366 	 * the order of writes has to be such that this field is written last.
62367 	 */
62368 	uint8_t	valid;
62369 } hwrm_fw_ecn_cfg_output_t, *phwrm_fw_ecn_cfg_output_t;
62370 
62371 /********************
62372  * hwrm_fw_ecn_qcfg *
62373  ********************/
62374 
62375 
62376 /* hwrm_fw_ecn_qcfg_input (size:128b/16B) */
62377 
62378 typedef struct hwrm_fw_ecn_qcfg_input {
62379 	/* The HWRM command request type. */
62380 	uint16_t	req_type;
62381 	/*
62382 	 * The completion ring to send the completion event on. This should
62383 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62384 	 */
62385 	uint16_t	cmpl_ring;
62386 	/*
62387 	 * The sequence ID is used by the driver for tracking multiple
62388 	 * commands. This ID is treated as opaque data by the firmware and
62389 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62390 	 */
62391 	uint16_t	seq_id;
62392 	/*
62393 	 * The target ID of the command:
62394 	 * * 0x0-0xFFF8 - The function ID
62395 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62396 	 * * 0xFFFD - Reserved for user-space HWRM interface
62397 	 * * 0xFFFF - HWRM
62398 	 */
62399 	uint16_t	target_id;
62400 	/*
62401 	 * A physical address pointer pointing to a host buffer that the
62402 	 * command's response data will be written. This can be either a host
62403 	 * physical address (HPA) or a guest physical address (GPA) and must
62404 	 * point to a physically contiguous block of memory.
62405 	 */
62406 	uint64_t	resp_addr;
62407 } hwrm_fw_ecn_qcfg_input_t, *phwrm_fw_ecn_qcfg_input_t;
62408 
62409 /* hwrm_fw_ecn_qcfg_output (size:128b/16B) */
62410 
62411 typedef struct hwrm_fw_ecn_qcfg_output {
62412 	/* The specific error status for the command. */
62413 	uint16_t	error_code;
62414 	/* The HWRM command request type. */
62415 	uint16_t	req_type;
62416 	/* The sequence ID from the original command. */
62417 	uint16_t	seq_id;
62418 	/* The length of the response data in number of bytes. */
62419 	uint16_t	resp_len;
62420 	uint16_t	flags;
62421 	/* When this bit is '1', ECN is enabled device-wide. */
62422 	#define HWRM_FW_ECN_QCFG_OUTPUT_FLAGS_ENABLE_ECN	UINT32_C(0x1)
62423 	uint8_t	unused_0[5];
62424 	/*
62425 	 * This field is used in Output records to indicate that the output
62426 	 * is completely written to RAM. This field should be read as '1'
62427 	 * to indicate that the output has been completely written. When
62428 	 * writing a command completion or response to an internal processor,
62429 	 * the order of writes has to be such that this field is written last.
62430 	 */
62431 	uint8_t	valid;
62432 } hwrm_fw_ecn_qcfg_output_t, *phwrm_fw_ecn_qcfg_output_t;
62433 
62434 /************************
62435  * hwrm_fw_health_check *
62436  ************************/
62437 
62438 
62439 /* hwrm_fw_health_check_input (size:128b/16B) */
62440 
62441 typedef struct hwrm_fw_health_check_input {
62442 	/* The HWRM command request type. */
62443 	uint16_t	req_type;
62444 	/*
62445 	 * The completion ring to send the completion event on. This should
62446 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62447 	 */
62448 	uint16_t	cmpl_ring;
62449 	/*
62450 	 * The sequence ID is used by the driver for tracking multiple
62451 	 * commands. This ID is treated as opaque data by the firmware and
62452 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62453 	 */
62454 	uint16_t	seq_id;
62455 	/*
62456 	 * The target ID of the command:
62457 	 * * 0x0-0xFFF8 - The function ID
62458 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62459 	 * * 0xFFFD - Reserved for user-space HWRM interface
62460 	 * * 0xFFFF - HWRM
62461 	 */
62462 	uint16_t	target_id;
62463 	/*
62464 	 * A physical address pointer pointing to a host buffer that the
62465 	 * command's response data will be written. This can be either a host
62466 	 * physical address (HPA) or a guest physical address (GPA) and must
62467 	 * point to a physically contiguous block of memory.
62468 	 */
62469 	uint64_t	resp_addr;
62470 } hwrm_fw_health_check_input_t, *phwrm_fw_health_check_input_t;
62471 
62472 /* hwrm_fw_health_check_output (size:128b/16B) */
62473 
62474 typedef struct hwrm_fw_health_check_output {
62475 	/* The specific error status for the command. */
62476 	uint16_t	error_code;
62477 	/* The HWRM command request type. */
62478 	uint16_t	req_type;
62479 	/* The sequence ID from the original command. */
62480 	uint16_t	seq_id;
62481 	/* The length of the response data in number of bytes. */
62482 	uint16_t	resp_len;
62483 	uint32_t	fw_status;
62484 	/*
62485 	 * This bit is '0' if the primary SBI was used this boot,
62486 	 * or '1' if the secondary SBI was used.
62487 	 */
62488 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SBI_BOOTED	UINT32_C(0x1)
62489 	/*
62490 	 * This bit is '0' if the primary and secondary SBI images
62491 	 * match, or '1' if they do not match.
62492 	 */
62493 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SBI_MISMATCH	UINT32_C(0x2)
62494 	/*
62495 	 * This bit is '0' if the primary SRT was used this boot,
62496 	 * or '1' if the secondary SRT was used.
62497 	 */
62498 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SRT_BOOTED	UINT32_C(0x4)
62499 	/*
62500 	 * This bit is '0' if the primary and secondary SRT images
62501 	 * match, or '1' if they do not match.
62502 	 */
62503 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SRT_MISMATCH	UINT32_C(0x8)
62504 	/*
62505 	 * This bit is '0' if the primary CRT (or second stage SRT)
62506 	 * was used this boot, or '1' if the secondary CRT (or
62507 	 * second stage SRT) was used.
62508 	 */
62509 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_CRT_BOOTED	UINT32_C(0x10)
62510 	/*
62511 	 * This bit is '0' if the primary and secondary CRT images
62512 	 * (or second stage SRT images) match, or '1' if they do not
62513 	 * match.
62514 	 */
62515 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_CRT_MISMATCH	UINT32_C(0x20)
62516 	/*
62517 	 * This bit is '0' if the second stage RT image is a CRT,
62518 	 * or '1' if the second stage RT image is an SRT.
62519 	 */
62520 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SECOND_RT		UINT32_C(0x40)
62521 	/*
62522 	 * This bit is '0' if the image was loaded from flash,
62523 	 * or '1' if the image was fastbooted.
62524 	 */
62525 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_FASTBOOTED	UINT32_C(0x80)
62526 	/*
62527 	 * This bit is '0' if the primary dir_hdr was used to locate
62528 	 * the firmware, or '1' if the secondary dir_hdr was used.
62529 	 */
62530 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_DIR_HDR_BOOTED	UINT32_C(0x100)
62531 	/*
62532 	 * This bit is '0' if the primary and secondary dir_hdr match,
62533 	 * or '1' if they do not match.
62534 	 */
62535 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_DIR_HDR_MISMATCH	UINT32_C(0x200)
62536 	/*
62537 	 * This bit is '0' if the Master Boot Record is in good condition,
62538 	 * or '1' if it is corrupted.
62539 	 */
62540 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_MBR_CORRUPT	UINT32_C(0x400)
62541 	/*
62542 	 * This bit is '0' if the configuration is in good condition,
62543 	 * or '1' if it is corrupted.
62544 	 */
62545 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_CFG_MISMATCH	UINT32_C(0x800)
62546 	/*
62547 	 * This bit is '0' if both FRU entries match,
62548 	 * or '1' if they do not match.
62549 	 */
62550 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_FRU_MISMATCH	UINT32_C(0x1000)
62551 	/*
62552 	 * This bit is '0' if the primary CRT2 was used this boot,
62553 	 * or '1' if the secondary CRT2 was used.
62554 	 */
62555 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_CRT2_BOOTED	UINT32_C(0x2000)
62556 	/*
62557 	 * This bit is '0' if the primary and secondary CRT2 images
62558 	 * match, or '1' if they do not match.
62559 	 */
62560 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_CRT2_MISMATCH	UINT32_C(0x4000)
62561 	/*
62562 	 * This bit is '0' if the primary GXRT was used this boot,
62563 	 * or '1' if the secondary GXRT was used.
62564 	 */
62565 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_GXRT_BOOTED	UINT32_C(0x8000)
62566 	/*
62567 	 * This bit is '0' if the primary and secondary GXRT images
62568 	 * match, or '1' if they do not match.
62569 	 */
62570 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_GXRT_MISMATCH	UINT32_C(0x10000)
62571 	/*
62572 	 * This bit is '0' if the primary SRT2 was used this boot,
62573 	 * or '1' if the secondary SRT2 was used.
62574 	 */
62575 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SRT2_BOOTED	UINT32_C(0x20000)
62576 	/*
62577 	 * This bit is '0' if the primary and secondary SRT2 images
62578 	 * match, or '1' if they do not match.
62579 	 */
62580 	#define HWRM_FW_HEALTH_CHECK_OUTPUT_FW_STATUS_SRT2_MISMATCH	UINT32_C(0x40000)
62581 	uint8_t	unused_0[3];
62582 	/*
62583 	 * This field is used in Output records to indicate that the output
62584 	 * is completely written to RAM. This field should be read as '1'
62585 	 * to indicate that the output has been completely written. When
62586 	 * writing a command completion or response to an internal processor,
62587 	 * the order of writes has to be such that this field is written last.
62588 	 */
62589 	uint8_t	valid;
62590 } hwrm_fw_health_check_output_t, *phwrm_fw_health_check_output_t;
62591 
62592 /***************************
62593  * hwrm_fw_livepatch_query *
62594  ***************************/
62595 
62596 
62597 /* hwrm_fw_livepatch_query_input (size:192b/24B) */
62598 
62599 typedef struct hwrm_fw_livepatch_query_input {
62600 	/* The HWRM command request type. */
62601 	uint16_t	req_type;
62602 	/*
62603 	 * The completion ring to send the completion event on. This should
62604 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62605 	 */
62606 	uint16_t	cmpl_ring;
62607 	/*
62608 	 * The sequence ID is used by the driver for tracking multiple
62609 	 * commands. This ID is treated as opaque data by the firmware and
62610 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62611 	 */
62612 	uint16_t	seq_id;
62613 	/*
62614 	 * The target ID of the command:
62615 	 * * 0x0-0xFFF8 - The function ID
62616 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62617 	 * * 0xFFFD - Reserved for user-space HWRM interface
62618 	 * * 0xFFFF - HWRM
62619 	 */
62620 	uint16_t	target_id;
62621 	/*
62622 	 * A physical address pointer pointing to a host buffer that the
62623 	 * command's response data will be written. This can be either a host
62624 	 * physical address (HPA) or a guest physical address (GPA) and must
62625 	 * point to a physically contiguous block of memory.
62626 	 */
62627 	uint64_t	resp_addr;
62628 	/* Firmware target to which to apply the livepatch query */
62629 	uint8_t	fw_target;
62630 	/* Common firmware livepatch query. */
62631 	#define HWRM_FW_LIVEPATCH_QUERY_INPUT_FW_TARGET_COMMON_FW UINT32_C(0x1)
62632 	/* Secure firmware livepatch query. */
62633 	#define HWRM_FW_LIVEPATCH_QUERY_INPUT_FW_TARGET_SECURE_FW UINT32_C(0x2)
62634 	#define HWRM_FW_LIVEPATCH_QUERY_INPUT_FW_TARGET_LAST	HWRM_FW_LIVEPATCH_QUERY_INPUT_FW_TARGET_SECURE_FW
62635 	uint8_t	unused_0[7];
62636 } hwrm_fw_livepatch_query_input_t, *phwrm_fw_livepatch_query_input_t;
62637 
62638 /* hwrm_fw_livepatch_query_output (size:640b/80B) */
62639 
62640 typedef struct hwrm_fw_livepatch_query_output {
62641 	/* The specific error status for the command. */
62642 	uint16_t	error_code;
62643 	/* The HWRM command request type. */
62644 	uint16_t	req_type;
62645 	/* The sequence ID from the original command. */
62646 	uint16_t	seq_id;
62647 	/* The length of the response data in number of bytes. */
62648 	uint16_t	resp_len;
62649 	/*
62650 	 * This field represents the patch version string of the NVM installed
62651 	 * livepatch. (ASCII chars with NULL at the end).
62652 	 */
62653 	char	install_ver[32];
62654 	/*
62655 	 * This field represents the patch version string of the active
62656 	 * livepatch. (ASCII chars with NULL at the end).
62657 	 */
62658 	char	active_ver[32];
62659 	uint16_t	status_flags;
62660 	/* This bit is '1' if a livepatch image is installed to NVM. */
62661 	#define HWRM_FW_LIVEPATCH_QUERY_OUTPUT_STATUS_FLAGS_INSTALL	UINT32_C(0x1)
62662 	/* This bit is '1' if firmware livepatch is active. */
62663 	#define HWRM_FW_LIVEPATCH_QUERY_OUTPUT_STATUS_FLAGS_ACTIVE	UINT32_C(0x2)
62664 	uint8_t	unused_0[5];
62665 	/*
62666 	 * This field is used in Output records to indicate that the output
62667 	 * is completely written to RAM. This field should be read as '1'
62668 	 * to indicate that the output has been completely written. When
62669 	 * writing a command completion or response to an internal processor,
62670 	 * the order of writes has to be such that this field is written last.
62671 	 */
62672 	uint8_t	valid;
62673 } hwrm_fw_livepatch_query_output_t, *phwrm_fw_livepatch_query_output_t;
62674 
62675 /*********************
62676  * hwrm_fw_livepatch *
62677  *********************/
62678 
62679 
62680 /* hwrm_fw_livepatch_input (size:256b/32B) */
62681 
62682 typedef struct hwrm_fw_livepatch_input {
62683 	/* The HWRM command request type. */
62684 	uint16_t	req_type;
62685 	/*
62686 	 * The completion ring to send the completion event on. This should
62687 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62688 	 */
62689 	uint16_t	cmpl_ring;
62690 	/*
62691 	 * The sequence ID is used by the driver for tracking multiple
62692 	 * commands. This ID is treated as opaque data by the firmware and
62693 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62694 	 */
62695 	uint16_t	seq_id;
62696 	/*
62697 	 * The target ID of the command:
62698 	 * * 0x0-0xFFF8 - The function ID
62699 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62700 	 * * 0xFFFD - Reserved for user-space HWRM interface
62701 	 * * 0xFFFF - HWRM
62702 	 */
62703 	uint16_t	target_id;
62704 	/*
62705 	 * A physical address pointer pointing to a host buffer that the
62706 	 * command's response data will be written. This can be either a host
62707 	 * physical address (HPA) or a guest physical address (GPA) and must
62708 	 * point to a physically contiguous block of memory.
62709 	 */
62710 	uint64_t	resp_addr;
62711 	/* Livepatch operation */
62712 	uint8_t	opcode;
62713 	/*
62714 	 * Activate a livepatch that is NVM installed or via direct load
62715 	 * from host memory. Activate will authenticate a signed patch,
62716 	 * verify the patch version for compatibility and apply the
62717 	 * livepatch to existing firmware at run-time.
62718 	 */
62719 	#define HWRM_FW_LIVEPATCH_INPUT_OPCODE_ACTIVATE   UINT32_C(0x1)
62720 	/*
62721 	 * Deactivate a livepatch and restore to the original firmware
62722 	 * operation state.
62723 	 */
62724 	#define HWRM_FW_LIVEPATCH_INPUT_OPCODE_DEACTIVATE UINT32_C(0x2)
62725 	#define HWRM_FW_LIVEPATCH_INPUT_OPCODE_LAST	HWRM_FW_LIVEPATCH_INPUT_OPCODE_DEACTIVATE
62726 	/* Firmware target to which to apply the livepatch operation. */
62727 	uint8_t	fw_target;
62728 	/* Common firmware livepatch. */
62729 	#define HWRM_FW_LIVEPATCH_INPUT_FW_TARGET_COMMON_FW UINT32_C(0x1)
62730 	/* Secure firmware livepatch. */
62731 	#define HWRM_FW_LIVEPATCH_INPUT_FW_TARGET_SECURE_FW UINT32_C(0x2)
62732 	#define HWRM_FW_LIVEPATCH_INPUT_FW_TARGET_LAST	HWRM_FW_LIVEPATCH_INPUT_FW_TARGET_SECURE_FW
62733 	/* Load method for livepatch. */
62734 	uint8_t	loadtype;
62735 	/* Load a livepatch currently installed on NVM. */
62736 	#define HWRM_FW_LIVEPATCH_INPUT_LOADTYPE_NVM_INSTALL   UINT32_C(0x1)
62737 	/*
62738 	 * Load a livepatch directly from host memory. The livepatch image
62739 	 * is available at host_addr.
62740 	 */
62741 	#define HWRM_FW_LIVEPATCH_INPUT_LOADTYPE_MEMORY_DIRECT UINT32_C(0x2)
62742 	#define HWRM_FW_LIVEPATCH_INPUT_LOADTYPE_LAST	HWRM_FW_LIVEPATCH_INPUT_LOADTYPE_MEMORY_DIRECT
62743 	/* Reserved for future use. */
62744 	uint8_t	flags;
62745 	/* Length of livepatch image for memory direct loading, in bytes. */
62746 	uint32_t	patch_len;
62747 	/* 64-bit Host address of livepatch image for memory direct loading. */
62748 	uint64_t	host_addr;
62749 } hwrm_fw_livepatch_input_t, *phwrm_fw_livepatch_input_t;
62750 
62751 /* hwrm_fw_livepatch_output (size:128b/16B) */
62752 
62753 typedef struct hwrm_fw_livepatch_output {
62754 	/* The specific error status for the command. */
62755 	uint16_t	error_code;
62756 	/* The HWRM command request type. */
62757 	uint16_t	req_type;
62758 	/* The sequence ID from the original command. */
62759 	uint16_t	seq_id;
62760 	/* The length of the response data in number of bytes. */
62761 	uint16_t	resp_len;
62762 	uint8_t	unused_0[7];
62763 	/*
62764 	 * This field is used in Output records to indicate that the output
62765 	 * is completely written to RAM. This field should be read as '1'
62766 	 * to indicate that the output has been completely written. When
62767 	 * writing a command completion or response to an internal processor,
62768 	 * the order of writes has to be such that this field is written last.
62769 	 */
62770 	uint8_t	valid;
62771 } hwrm_fw_livepatch_output_t, *phwrm_fw_livepatch_output_t;
62772 
62773 /* hwrm_fw_livepatch_cmd_err (size:64b/8B) */
62774 
62775 typedef struct hwrm_fw_livepatch_cmd_err {
62776 	/*
62777 	 * command specific error codes that goes to
62778 	 * the cmd_err field in Common HWRM Error Response.
62779 	 */
62780 	uint8_t	code;
62781 	/* Unknown error. */
62782 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
62783 	/* Opcode invalid. */
62784 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_INVALID_OPCODE  UINT32_C(0x1)
62785 	/* Firmware target invalid. */
62786 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_INVALID_TARGET  UINT32_C(0x2)
62787 	/* Livepatch operation not supported. */
62788 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_NOT_SUPPORTED   UINT32_C(0x3)
62789 	/* Livepatch image is not installed in NVRAM. */
62790 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_NOT_INSTALLED   UINT32_C(0x4)
62791 	/* Deactivate failed. Firmware is not currently patched. */
62792 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_NOT_PATCHED	UINT32_C(0x5)
62793 	/* Authentication of a signed livepatch failed. */
62794 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_AUTH_FAIL	UINT32_C(0x6)
62795 	/* Livepatch header check failed. Patch incompatible. */
62796 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_INVALID_HEADER  UINT32_C(0x7)
62797 	/* Livepatch size incompatible. */
62798 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_INVALID_SIZE	UINT32_C(0x8)
62799 	/*
62800 	 * Activate failed. Firmware has already been patched. Deactivate
62801 	 * existing livepatch before proceeding.
62802 	 */
62803 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_ALREADY_PATCHED UINT32_C(0x9)
62804 	#define HWRM_FW_LIVEPATCH_CMD_ERR_CODE_LAST	HWRM_FW_LIVEPATCH_CMD_ERR_CODE_ALREADY_PATCHED
62805 	uint8_t	unused_0[7];
62806 } hwrm_fw_livepatch_cmd_err_t, *phwrm_fw_livepatch_cmd_err_t;
62807 
62808 /****************
62809  * hwrm_fw_sync *
62810  ****************/
62811 
62812 
62813 /* hwrm_fw_sync_input (size:192b/24B) */
62814 
62815 typedef struct hwrm_fw_sync_input {
62816 	/* The HWRM command request type. */
62817 	uint16_t	req_type;
62818 	/*
62819 	 * The completion ring to send the completion event on. This should
62820 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62821 	 */
62822 	uint16_t	cmpl_ring;
62823 	/*
62824 	 * The sequence ID is used by the driver for tracking multiple
62825 	 * commands. This ID is treated as opaque data by the firmware and
62826 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62827 	 */
62828 	uint16_t	seq_id;
62829 	/*
62830 	 * The target ID of the command:
62831 	 * * 0x0-0xFFF8 - The function ID
62832 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62833 	 * * 0xFFFD - Reserved for user-space HWRM interface
62834 	 * * 0xFFFF - HWRM
62835 	 */
62836 	uint16_t	target_id;
62837 	/*
62838 	 * A physical address pointer pointing to a host buffer that the
62839 	 * command's response data will be written. This can be either a host
62840 	 * physical address (HPA) or a guest physical address (GPA) and must
62841 	 * point to a physically contiguous block of memory.
62842 	 */
62843 	uint64_t	resp_addr;
62844 	uint32_t	sync_action;
62845 	/*
62846 	 * If action is '1' (sync) and this bit is set, the SBI
62847 	 * images will be synchronized, copying from the instance
62848 	 * used for boot to the other instance, if they currently
62849 	 * do not match.
62850 	 */
62851 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_SBI	UINT32_C(0x1)
62852 	/*
62853 	 * If action is '1' (sync) and this bit is set, the SRT
62854 	 * images will be synchronized, copying from the instance
62855 	 * used for boot to the other instance, if they currently
62856 	 * do not match.
62857 	 */
62858 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_SRT	UINT32_C(0x2)
62859 	/*
62860 	 * If action is '1' (sync) and this bit is set, the CRT
62861 	 * images will be synchronized (or second stage SRT if that
62862 	 * is used in place of CRT), copying from the instance
62863 	 * used for boot to the other instance, if they currently
62864 	 * do not match.
62865 	 */
62866 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_CRT	UINT32_C(0x4)
62867 	/*
62868 	 * If action is '1' (sync) and this bit is set, the dir_hdr
62869 	 * partition will be synchronized, copying from the instance
62870 	 * used for boot to the other instance, if they currently
62871 	 * do not match.
62872 	 */
62873 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_DIR_HDR	UINT32_C(0x8)
62874 	/*
62875 	 * If action is '1' (sync) and this bit is set, the MBR
62876 	 * will be erased and reprogrammed with valid content.
62877 	 */
62878 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_WRITE_MBR	UINT32_C(0x10)
62879 	/*
62880 	 * If action is '1' (sync) and this bit is set, the
62881 	 * configuration will be resynced or repaired as needed.
62882 	 */
62883 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_CFG	UINT32_C(0x20)
62884 	/*
62885 	 * If action is '1' (sync) and this bit is set, the
62886 	 * FRU in NVM file will be synchronized, copying the active
62887 	 * FRU to the backup FRU.
62888 	 */
62889 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_FRU	UINT32_C(0x40)
62890 	/*
62891 	 * If action is '1' (sync) and this bit is set, the CRT2
62892 	 * images will be synchronized, copying from the instance
62893 	 * used for boot to the other instance, if they currently
62894 	 * do not match.
62895 	 */
62896 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_CRT2	UINT32_C(0x80)
62897 	/*
62898 	 * If action is '1' (sync) and this bit is set, the GXRT
62899 	 * images will be synchronized, copying from the instance
62900 	 * used for boot to the other instance, if they currently
62901 	 * do not match.
62902 	 */
62903 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_GXRT	UINT32_C(0x100)
62904 	/*
62905 	 * If action is '1' (sync) and this bit is set, the SRT2
62906 	 * images will be synchronized, copying from the instance
62907 	 * used for boot to the other instance, if they currently
62908 	 * do not match.
62909 	 */
62910 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_SYNC_SRT2	UINT32_C(0x200)
62911 	/*
62912 	 * A value of '1' instructs the firmware to perform an image
62913 	 * synchronization of the firmware types denoted by the
62914 	 * sync_sbi, sync_srt, sync_crt, sync_crt2, sync_srt2 bits.
62915 	 * A value of '0' just requests the status for the previously
62916 	 * requested sync operation.
62917 	 */
62918 	#define HWRM_FW_SYNC_INPUT_SYNC_ACTION_ACTION	UINT32_C(0x80000000)
62919 	uint8_t	unused_0[4];
62920 } hwrm_fw_sync_input_t, *phwrm_fw_sync_input_t;
62921 
62922 /* hwrm_fw_sync_output (size:128b/16B) */
62923 
62924 typedef struct hwrm_fw_sync_output {
62925 	/* The specific error status for the command. */
62926 	uint16_t	error_code;
62927 	/* The HWRM command request type. */
62928 	uint16_t	req_type;
62929 	/* The sequence ID from the original command. */
62930 	uint16_t	seq_id;
62931 	/* The length of the response data in number of bytes. */
62932 	uint16_t	resp_len;
62933 	uint32_t	sync_status;
62934 	/* This bit field indicates the error if 'sync_err' bit is set. */
62935 	#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_MASK	UINT32_C(0xff)
62936 	#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_SFT	0
62937 	/* Success, no error */
62938 		#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_SUCCESS	UINT32_C(0x0)
62939 	/*
62940 	 * A previously requested synchronization command is still
62941 	 * in progress.
62942 	 */
62943 		#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_IN_PROGRESS  UINT32_C(0x1)
62944 	/* An NVRAM operation has timed out. */
62945 		#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_TIMEOUT	UINT32_C(0x2)
62946 	/* General NVRAM error code. */
62947 		#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_GENERAL	UINT32_C(0x3)
62948 		#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_LAST	HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_ERR_CODE_GENERAL
62949 	/*
62950 	 * This bit is '1' if the synchronization request has completed
62951 	 * with an error; the 'err_code' field can be used to obtain
62952 	 * information about error type.
62953 	 */
62954 	#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_SYNC_ERR		UINT32_C(0x40000000)
62955 	/*
62956 	 * This bit is '0' if the previously requested synchronization
62957 	 * command is still in progress, or '1' if the previously
62958 	 * requested sync command has completed. If '1', the 'sync_err'
62959 	 * field will indicate if it completed successfully or with
62960 	 * an error.
62961 	 */
62962 	#define HWRM_FW_SYNC_OUTPUT_SYNC_STATUS_SYNC_COMPLETE	UINT32_C(0x80000000)
62963 	uint8_t	unused_0[3];
62964 	/*
62965 	 * This field is used in Output records to indicate that the output
62966 	 * is completely written to RAM. This field should be read as '1'
62967 	 * to indicate that the output has been completely written. When
62968 	 * writing a command completion or response to an internal processor,
62969 	 * the order of writes has to be such that this field is written last.
62970 	 */
62971 	uint8_t	valid;
62972 } hwrm_fw_sync_output_t, *phwrm_fw_sync_output_t;
62973 
62974 /***********************
62975  * hwrm_fw_state_qcaps *
62976  ***********************/
62977 
62978 
62979 /* hwrm_fw_state_qcaps_input (size:128b/16B) */
62980 
62981 typedef struct hwrm_fw_state_qcaps_input {
62982 	/* The HWRM command request type. */
62983 	uint16_t	req_type;
62984 	/*
62985 	 * The completion ring to send the completion event on. This should
62986 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
62987 	 */
62988 	uint16_t	cmpl_ring;
62989 	/*
62990 	 * The sequence ID is used by the driver for tracking multiple
62991 	 * commands. This ID is treated as opaque data by the firmware and
62992 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
62993 	 */
62994 	uint16_t	seq_id;
62995 	/*
62996 	 * The target ID of the command:
62997 	 * * 0x0-0xFFF8 - The function ID
62998 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
62999 	 * * 0xFFFD - Reserved for user-space HWRM interface
63000 	 * * 0xFFFF - HWRM
63001 	 */
63002 	uint16_t	target_id;
63003 	/*
63004 	 * A physical address pointer pointing to a host buffer that the
63005 	 * command's response data will be written. This can be either a host
63006 	 * physical address (HPA) or a guest physical address (GPA) and must
63007 	 * point to a physically contiguous block of memory.
63008 	 */
63009 	uint64_t	resp_addr;
63010 } hwrm_fw_state_qcaps_input_t, *phwrm_fw_state_qcaps_input_t;
63011 
63012 /* hwrm_fw_state_qcaps_output (size:256b/32B) */
63013 
63014 typedef struct hwrm_fw_state_qcaps_output {
63015 	/* The specific error status for the command. */
63016 	uint16_t	error_code;
63017 	/* The HWRM command request type. */
63018 	uint16_t	req_type;
63019 	/* The sequence ID from the original command. */
63020 	uint16_t	seq_id;
63021 	/* The length of the response data in number of bytes. */
63022 	uint16_t	resp_len;
63023 	/*
63024 	 * This field indicates the size in bytes required by host backup
63025 	 * memory. Host software should allocate memory according to this
63026 	 * size requirement and pass the allocated memory to the
63027 	 * HWRM_FW_STATE_BACKUP and HWRM_FW_STATE_RESTORE commands in the form
63028 	 * of PBL data as specified in those commands.
63029 	 */
63030 	uint32_t	backup_memory;
63031 	/*
63032 	 * This field indicates the max time in milliseconds that firmware
63033 	 * waits for quiesce to complete. Firmware indicates successful
63034 	 * quiesce completion if the quiesce operation completes within this
63035 	 * timeout. If firmware is still waiting for the quiesce operation
63036 	 * to complete when this timeout is reached, firmware stops waiting
63037 	 * (without canceling any quiesce action such as pausing or
63038 	 * clearing meter profiles) and indicates a timeout status result
63039 	 * via NQE completion notification. This timeout value may also be
63040 	 * used by the driver to know the max time to wait for any NQE
63041 	 * notification response to the HWRM_FW_STATE_QUIESCE command. After
63042 	 * a timeout, the driver may elect to invoke HWRM_FW_STATE_QUIESCE
63043 	 * again to keep trying or to invoke HWRM_FW_STATE_UNQUIESCE to
63044 	 * revert the operation. Since there is no identifier correlating
63045 	 * each HWRM_FW_STATE_QUIESCE command with its NQE response, it is
63046 	 * important for the driver to wait for the NQE response before
63047 	 * issuing a subsequent HWRM_FW_STATE_QUIESCE command.
63048 	 */
63049 	uint32_t	quiesce_timeout;
63050 	/*
63051 	 * This field indicates time in milliseconds that the driver should
63052 	 * wait after return from HWRM_FW_RESET to begin polling the device
63053 	 * for status 0x8000.
63054 	 */
63055 	uint32_t	fw_status_blackout;
63056 	/*
63057 	 * This field indicates a max time for firmware to poll for status
63058 	 * 0x8000 before assuming a reset failure occurred. This time does
63059 	 * not include fw_status_blackout time which would immediately precede
63060 	 * this wait.
63061 	 */
63062 	uint32_t	fw_status_max_wait;
63063 	uint8_t	unused_0[4];
63064 	uint8_t	unused_1[3];
63065 	/*
63066 	 * This field is used in Output records to indicate that the output
63067 	 * is completely written to RAM. This field should be read as '1'
63068 	 * to indicate that the output has been completely written. When
63069 	 * writing a command completion or response to an internal processor,
63070 	 * the order of writes has to be such that this field is written last.
63071 	 */
63072 	uint8_t	valid;
63073 } hwrm_fw_state_qcaps_output_t, *phwrm_fw_state_qcaps_output_t;
63074 
63075 /*************************
63076  * hwrm_fw_state_quiesce *
63077  *************************/
63078 
63079 
63080 /* hwrm_fw_state_quiesce_input (size:192b/24B) */
63081 
63082 typedef struct hwrm_fw_state_quiesce_input {
63083 	/* The HWRM command request type. */
63084 	uint16_t	req_type;
63085 	/*
63086 	 * The completion ring to send the completion event on. This should
63087 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63088 	 */
63089 	uint16_t	cmpl_ring;
63090 	/*
63091 	 * The sequence ID is used by the driver for tracking multiple
63092 	 * commands. This ID is treated as opaque data by the firmware and
63093 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63094 	 */
63095 	uint16_t	seq_id;
63096 	/*
63097 	 * The target ID of the command:
63098 	 * * 0x0-0xFFF8 - The function ID
63099 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63100 	 * * 0xFFFD - Reserved for user-space HWRM interface
63101 	 * * 0xFFFF - HWRM
63102 	 */
63103 	uint16_t	target_id;
63104 	/*
63105 	 * A physical address pointer pointing to a host buffer that the
63106 	 * command's response data will be written. This can be either a host
63107 	 * physical address (HPA) or a guest physical address (GPA) and must
63108 	 * point to a physically contiguous block of memory.
63109 	 */
63110 	uint64_t	resp_addr;
63111 	uint8_t	flags;
63112 	/*
63113 	 * Setting this bit to '1', indicates impactless firmware update
63114 	 * is in a recovery mode where hardware is in an error state and
63115 	 * where recovery is desired with reasonably minimal impact to
63116 	 * connected clients. The quiesce operation may require separate
63117 	 * steps to handle quiescing when hardware is in a hung or locked
63118 	 * state. For example, quiesce via draining may not be possible
63119 	 * depending on the type of error. This flag's state would be kept
63120 	 * in firmware if recovery-specific steps are also needed for the
63121 	 * HWRM_FW_STATE_BACKUP. Note this option is available only for
63122 	 * specific recovery scenarios and may not be operational across
63123 	 * all controllers.
63124 	 */
63125 	#define HWRM_FW_STATE_QUIESCE_INPUT_FLAGS_ERROR_RECOVERY	UINT32_C(0x1)
63126 	uint8_t	unused_0[7];
63127 } hwrm_fw_state_quiesce_input_t, *phwrm_fw_state_quiesce_input_t;
63128 
63129 /* hwrm_fw_state_quiesce_output (size:192b/24B) */
63130 
63131 typedef struct hwrm_fw_state_quiesce_output {
63132 	/* The specific error status for the command. */
63133 	uint16_t	error_code;
63134 	/* The HWRM command request type. */
63135 	uint16_t	req_type;
63136 	/* The sequence ID from the original command. */
63137 	uint16_t	seq_id;
63138 	/* The length of the response data in number of bytes. */
63139 	uint16_t	resp_len;
63140 	uint32_t	quiesce_status;
63141 	/*
63142 	 * This bit is '1' if the quiesce request has been successfully
63143 	 * initiated.
63144 	 */
63145 	#define HWRM_FW_STATE_QUIESCE_OUTPUT_QUIESCE_STATUS_INITIATED	UINT32_C(0x80000000)
63146 	uint8_t	unused_0[4];
63147 	uint8_t	unused_1[7];
63148 	/*
63149 	 * This field is used in Output records to indicate that the output
63150 	 * is completely written to RAM. This field should be read as '1' to
63151 	 * indicate that the output has been completely written. When
63152 	 * writing a command completion or response to an internal
63153 	 * processor, the order of writes has to be such that this field is
63154 	 * written last.
63155 	 */
63156 	uint8_t	valid;
63157 } hwrm_fw_state_quiesce_output_t, *phwrm_fw_state_quiesce_output_t;
63158 
63159 /***************************
63160  * hwrm_fw_state_unquiesce *
63161  ***************************/
63162 
63163 
63164 /* hwrm_fw_state_unquiesce_input (size:128b/16B) */
63165 
63166 typedef struct hwrm_fw_state_unquiesce_input {
63167 	/* The HWRM command request type. */
63168 	uint16_t	req_type;
63169 	/*
63170 	 * The completion ring to send the completion event on. This should
63171 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63172 	 */
63173 	uint16_t	cmpl_ring;
63174 	/*
63175 	 * The sequence ID is used by the driver for tracking multiple
63176 	 * commands. This ID is treated as opaque data by the firmware and
63177 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63178 	 */
63179 	uint16_t	seq_id;
63180 	/*
63181 	 * The target ID of the command:
63182 	 * * 0x0-0xFFF8 - The function ID
63183 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63184 	 * * 0xFFFD - Reserved for user-space HWRM interface
63185 	 * * 0xFFFF - HWRM
63186 	 */
63187 	uint16_t	target_id;
63188 	/*
63189 	 * A physical address pointer pointing to a host buffer that the
63190 	 * command's response data will be written. This can be either a host
63191 	 * physical address (HPA) or a guest physical address (GPA) and must
63192 	 * point to a physically contiguous block of memory.
63193 	 */
63194 	uint64_t	resp_addr;
63195 } hwrm_fw_state_unquiesce_input_t, *phwrm_fw_state_unquiesce_input_t;
63196 
63197 /* hwrm_fw_state_unquiesce_output (size:192b/24B) */
63198 
63199 typedef struct hwrm_fw_state_unquiesce_output {
63200 	/* The specific error status for the command. */
63201 	uint16_t	error_code;
63202 	/* The HWRM command request type. */
63203 	uint16_t	req_type;
63204 	/* The sequence ID from the original command. */
63205 	uint16_t	seq_id;
63206 	/* The length of the response data in number of bytes. */
63207 	uint16_t	resp_len;
63208 	uint32_t	unquiesce_status;
63209 	/* This bit is '1' if the unquiesce request has fully completed. */
63210 	#define HWRM_FW_STATE_UNQUIESCE_OUTPUT_UNQUIESCE_STATUS_COMPLETE	UINT32_C(0x80000000)
63211 	uint8_t	unused_0[4];
63212 	uint8_t	unused_1[7];
63213 	/*
63214 	 * This field is used in Output records to indicate that the output
63215 	 * is completely written to RAM. This field should be read as '1'
63216 	 * to indicate that the output has been completely written. When
63217 	 * writing a command completion or response to an internal processor,
63218 	 * the order of writes has to be such that this field is written last.
63219 	 */
63220 	uint8_t	valid;
63221 } hwrm_fw_state_unquiesce_output_t, *phwrm_fw_state_unquiesce_output_t;
63222 
63223 /************************
63224  * hwrm_fw_state_backup *
63225  ************************/
63226 
63227 
63228 /* hwrm_fw_state_backup_input (size:256b/32B) */
63229 
63230 typedef struct hwrm_fw_state_backup_input {
63231 	/* The HWRM command request type. */
63232 	uint16_t	req_type;
63233 	/*
63234 	 * The completion ring to send the completion event on. This should
63235 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63236 	 */
63237 	uint16_t	cmpl_ring;
63238 	/*
63239 	 * The sequence ID is used by the driver for tracking multiple
63240 	 * commands. This ID is treated as opaque data by the firmware and
63241 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63242 	 */
63243 	uint16_t	seq_id;
63244 	/*
63245 	 * The target ID of the command:
63246 	 * * 0x0-0xFFF8 - The function ID
63247 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63248 	 * * 0xFFFD - Reserved for user-space HWRM interface
63249 	 * * 0xFFFF - HWRM
63250 	 */
63251 	uint16_t	target_id;
63252 	/*
63253 	 * A physical address pointer pointing to a host buffer that the
63254 	 * command's response data will be written. This can be either a host
63255 	 * physical address (HPA) or a guest physical address (GPA) and must
63256 	 * point to a physically contiguous block of memory.
63257 	 */
63258 	uint64_t	resp_addr;
63259 	/* State backup page size and level. */
63260 	uint8_t	backup_pg_size_backup_lvl;
63261 	/* State backup PBL indirect levels. */
63262 	#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_MASK	UINT32_C(0xf)
63263 	#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_SFT	0
63264 	/* PBL pointer is physical start address. */
63265 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LVL_0	UINT32_C(0x0)
63266 	/* PBL pointer points to PTE table. */
63267 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LVL_1	UINT32_C(0x1)
63268 	/*
63269 	 * PBL pointer points to PDE table with each entry pointing to PTE
63270 	 * tables.
63271 	 */
63272 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LVL_2	UINT32_C(0x2)
63273 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LAST	HWRM_FW_STATE_BACKUP_INPUT_BACKUP_LVL_LVL_2
63274 	/* State backup page size. */
63275 	#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_MASK  UINT32_C(0xf0)
63276 	#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_SFT   4
63277 	/* 4KB. */
63278 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
63279 	/* 8KB. */
63280 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
63281 	/* 64KB. */
63282 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
63283 	/* 2MB. */
63284 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
63285 	/* 8MB. */
63286 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
63287 	/* 1GB. */
63288 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
63289 		#define HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_LAST   HWRM_FW_STATE_BACKUP_INPUT_BACKUP_PG_SIZE_PG_1G
63290 	uint8_t	unused_0[7];
63291 	/* State backup page directory. */
63292 	uint64_t	backup_page_dir;
63293 } hwrm_fw_state_backup_input_t, *phwrm_fw_state_backup_input_t;
63294 
63295 /* hwrm_fw_state_backup_output (size:192b/24B) */
63296 
63297 typedef struct hwrm_fw_state_backup_output {
63298 	/* The specific error status for the command. */
63299 	uint16_t	error_code;
63300 	/* The HWRM command request type. */
63301 	uint16_t	req_type;
63302 	/* The sequence ID from the original command. */
63303 	uint16_t	seq_id;
63304 	/* The length of the response data in number of bytes. */
63305 	uint16_t	resp_len;
63306 	uint32_t	backup_status;
63307 	/*
63308 	 * This bit field provides additional information if the error if
63309 	 * error_code in the common HWRM header is set.
63310 	 */
63311 	#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_MASK	UINT32_C(0xff)
63312 	#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_SFT	0
63313 	/* Success, no error */
63314 		#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_SUCCESS	UINT32_C(0x0)
63315 	/* Data or control plane detected as non-quiesced */
63316 		#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_QUIESCE_ERROR  UINT32_C(0x1)
63317 	/* General backup error */
63318 		#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_GENERAL	UINT32_C(0x3)
63319 		#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_LAST	HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_ERR_CODE_GENERAL
63320 	/*
63321 	 * This bit is '0' if the backout was done in a way that firmware
63322 	 * may continue running normally after the backup, for example if
63323 	 * the host elects to skip the subsequent reset and restore for any
63324 	 * reason. A value of '1' indicates the act of backing up has left
63325 	 * the firmware/device in a state where subsequent reset is
63326 	 * required, for example of probing state of a queue leaves changes
63327 	 * state in a way that is detectable by users.
63328 	 */
63329 	#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_RESET_REQUIRED	UINT32_C(0x40000000)
63330 	/* This bit is '1' if the backup request has fully completed. */
63331 	#define HWRM_FW_STATE_BACKUP_OUTPUT_BACKUP_STATUS_COMPLETE		UINT32_C(0x80000000)
63332 	uint8_t	unused_0[4];
63333 	uint8_t	unused_1[7];
63334 	/*
63335 	 * This field is used in Output records to indicate that the output
63336 	 * is completely written to RAM. This field should be read as '1'
63337 	 * to indicate that the output has been completely written. When
63338 	 * writing a command completion or response to an internal processor,
63339 	 * the order of writes has to be such that this field is written last.
63340 	 */
63341 	uint8_t	valid;
63342 } hwrm_fw_state_backup_output_t, *phwrm_fw_state_backup_output_t;
63343 
63344 /*************************
63345  * hwrm_fw_state_restore *
63346  *************************/
63347 
63348 
63349 /* hwrm_fw_state_restore_input (size:256b/32B) */
63350 
63351 typedef struct hwrm_fw_state_restore_input {
63352 	/* The HWRM command request type. */
63353 	uint16_t	req_type;
63354 	/*
63355 	 * The completion ring to send the completion event on. This should
63356 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63357 	 */
63358 	uint16_t	cmpl_ring;
63359 	/*
63360 	 * The sequence ID is used by the driver for tracking multiple
63361 	 * commands. This ID is treated as opaque data by the firmware and
63362 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63363 	 */
63364 	uint16_t	seq_id;
63365 	/*
63366 	 * The target ID of the command:
63367 	 * * 0x0-0xFFF8 - The function ID
63368 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63369 	 * * 0xFFFD - Reserved for user-space HWRM interface
63370 	 * * 0xFFFF - HWRM
63371 	 */
63372 	uint16_t	target_id;
63373 	/*
63374 	 * A physical address pointer pointing to a host buffer that the
63375 	 * command's response data will be written. This can be either a host
63376 	 * physical address (HPA) or a guest physical address (GPA) and must
63377 	 * point to a physically contiguous block of memory.
63378 	 */
63379 	uint64_t	resp_addr;
63380 	/* State restore page size and level. */
63381 	uint8_t	restore_pg_size_restore_lvl;
63382 	/* State restore PBL indirect levels. */
63383 	#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_MASK	UINT32_C(0xf)
63384 	#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_SFT	0
63385 	/* PBL pointer is physical start address. */
63386 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LVL_0	UINT32_C(0x0)
63387 	/* PBL pointer points to PTE table. */
63388 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LVL_1	UINT32_C(0x1)
63389 	/*
63390 	 * PBL pointer points to PDE table with each entry pointing to PTE
63391 	 * tables.
63392 	 */
63393 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LVL_2	UINT32_C(0x2)
63394 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LAST	HWRM_FW_STATE_RESTORE_INPUT_RESTORE_LVL_LVL_2
63395 	/* State restore page size. */
63396 	#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_MASK  UINT32_C(0xf0)
63397 	#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_SFT   4
63398 	/* 4KB. */
63399 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
63400 	/* 8KB. */
63401 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
63402 	/* 64KB. */
63403 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
63404 	/* 2MB. */
63405 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
63406 	/* 8MB. */
63407 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
63408 	/* 1GB. */
63409 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
63410 		#define HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_LAST   HWRM_FW_STATE_RESTORE_INPUT_RESTORE_PG_SIZE_PG_1G
63411 	uint8_t	unused_0[7];
63412 	/* State restore page directory. */
63413 	uint64_t	restore_page_dir;
63414 } hwrm_fw_state_restore_input_t, *phwrm_fw_state_restore_input_t;
63415 
63416 /* hwrm_fw_state_restore_output (size:128b/16B) */
63417 
63418 typedef struct hwrm_fw_state_restore_output {
63419 	/* The specific error status for the command. */
63420 	uint16_t	error_code;
63421 	/* The HWRM command request type. */
63422 	uint16_t	req_type;
63423 	/* The sequence ID from the original command. */
63424 	uint16_t	seq_id;
63425 	/* The length of the response data in number of bytes. */
63426 	uint16_t	resp_len;
63427 	uint32_t	restore_status;
63428 	/*
63429 	 * This bit field provides additional information if the error if
63430 	 * error_code in the common HWRM header is set.
63431 	 */
63432 	#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_MASK		UINT32_C(0xff)
63433 	#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_SFT		0
63434 	/* Success, no error */
63435 		#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_SUCCESS		UINT32_C(0x0)
63436 	/* General restore error */
63437 		#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_GENERAL		UINT32_C(0x1)
63438 	/* Format parse error */
63439 		#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_FORMAT_PARSE		UINT32_C(0x2)
63440 	/* Integrity check error */
63441 		#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_INTEGRITY_CHECK	UINT32_C(0x3)
63442 		#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_LAST		HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_ERR_CODE_INTEGRITY_CHECK
63443 	/*
63444 	 * If a failure occurs (complete is 0), restore attempts to
63445 	 * completely roll back any state applied so that the failure
63446 	 * results in no state change. This flag indicates whether that
63447 	 * rollback completed successfully and thoroughly.
63448 	 */
63449 	#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_FAILURE_ROLLBACK_COMPLETED	UINT32_C(0x40000000)
63450 	/* This bit is '1' if the restore request has fully completed. */
63451 	#define HWRM_FW_STATE_RESTORE_OUTPUT_RESTORE_STATUS_COMPLETE			UINT32_C(0x80000000)
63452 	uint8_t	unused_0[3];
63453 	/*
63454 	 * This field is used in Output records to indicate that the output
63455 	 * is completely written to RAM. This field should be read as '1'
63456 	 * to indicate that the output has been completely written. When
63457 	 * writing a command completion or response to an internal processor,
63458 	 * the order of writes has to be such that this field is written last.
63459 	 */
63460 	uint8_t	valid;
63461 } hwrm_fw_state_restore_output_t, *phwrm_fw_state_restore_output_t;
63462 
63463 /**********************
63464  * hwrm_fw_secure_cfg *
63465  **********************/
63466 
63467 
63468 /* hwrm_fw_secure_cfg_input (size:256b/32B) */
63469 
63470 typedef struct hwrm_fw_secure_cfg_input {
63471 	/* The HWRM command request type. */
63472 	uint16_t	req_type;
63473 	/*
63474 	 * The completion ring to send the completion event on. This should
63475 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63476 	 */
63477 	uint16_t	cmpl_ring;
63478 	/*
63479 	 * The sequence ID is used by the driver for tracking multiple
63480 	 * commands. This ID is treated as opaque data by the firmware and
63481 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63482 	 */
63483 	uint16_t	seq_id;
63484 	/*
63485 	 * The target ID of the command:
63486 	 * * 0x0-0xFFF8 - The function ID
63487 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63488 	 * * 0xFFFD - Reserved for user-space HWRM interface
63489 	 * * 0xFFFF - HWRM
63490 	 */
63491 	uint16_t	target_id;
63492 	/*
63493 	 * A physical address pointer pointing to a host buffer that the
63494 	 * command's response data will be written. This can be either a host
63495 	 * physical address (HPA) or a guest physical address (GPA) and must
63496 	 * point to a physically contiguous block of memory.
63497 	 */
63498 	uint64_t	resp_addr;
63499 	/* Specify the type of security option. */
63500 	uint8_t	enable;
63501 	/* Fields for the nvm lock mode are valid. */
63502 	#define HWRM_FW_SECURE_CFG_INPUT_ENABLE_NVRAM UINT32_C(0x1)
63503 	/* Fields for the grc access control are valid. */
63504 	#define HWRM_FW_SECURE_CFG_INPUT_ENABLE_GRC   UINT32_C(0x2)
63505 	/* Fields for the uart access control are valid. */
63506 	#define HWRM_FW_SECURE_CFG_INPUT_ENABLE_UART  UINT32_C(0x3)
63507 	#define HWRM_FW_SECURE_CFG_INPUT_ENABLE_LAST HWRM_FW_SECURE_CFG_INPUT_ENABLE_UART
63508 	/*
63509 	 * This bit field indicates the type of the configuration to be
63510 	 * updated.
63511 	 */
63512 	uint8_t	config_mode;
63513 	/* When this bit is '1', persistent config would be updated. */
63514 	#define HWRM_FW_SECURE_CFG_INPUT_CONFIG_MODE_PERSISTENT	UINT32_C(0x1)
63515 	/* When this bit is '1', runtime config would be updated. */
63516 	#define HWRM_FW_SECURE_CFG_INPUT_CONFIG_MODE_RUNTIME	UINT32_C(0x2)
63517 	/* define lock mode for nvram. */
63518 	uint8_t	nvm_lock_mode;
63519 	/*
63520 	 * Contents of the entire NVRAM including FW and Config can be
63521 	 * altered by a HWRM client.
63522 	 */
63523 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_LOCK_MODE_NONE	UINT32_C(0x0)
63524 	/*
63525 	 * Only partial sections of the NVM are to be locked. To specify
63526 	 * section to be locked the 'nvm_partial_lock_mask' should be used.
63527 	 */
63528 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_LOCK_MODE_PARTIAL UINT32_C(0x1)
63529 	/*
63530 	 * Contents of the entire NVM including FW and Config are to be
63531 	 * locked against any alteration by any HWRM client.
63532 	 */
63533 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_LOCK_MODE_FULL	UINT32_C(0x2)
63534 	/*
63535 	 * This is a HW lock of the NVM itself. Once locked firmware has no
63536 	 * control to unlock. Contents of the NVM cannot be altered.
63537 	 * Require a power cycle to unlock.
63538 	 */
63539 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_LOCK_MODE_CHIP	UINT32_C(0x3)
63540 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_LOCK_MODE_LAST   HWRM_FW_SECURE_CFG_INPUT_NVM_LOCK_MODE_CHIP
63541 	/*
63542 	 * bit field indicating the type of partial_lock.
63543 	 * This field is only applicable if the partial_lock is set.
63544 	 */
63545 	uint8_t	nvm_partial_lock_mask;
63546 	/* When this bit is '1', updating the FW images are locked. */
63547 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_PARTIAL_LOCK_MASK_EXE	UINT32_C(0x1)
63548 	/* When this bit is '1', updating the CFG are locked. */
63549 	#define HWRM_FW_SECURE_CFG_INPUT_NVM_PARTIAL_LOCK_MASK_CFG	UINT32_C(0x2)
63550 	/* specify grc access control for specified HWRM clients. */
63551 	uint8_t	grc_ctrl;
63552 	/* Read Only */
63553 	#define HWRM_FW_SECURE_CFG_INPUT_GRC_CTRL_RO UINT32_C(0x0)
63554 	/* Read-Write */
63555 	#define HWRM_FW_SECURE_CFG_INPUT_GRC_CTRL_RW UINT32_C(0x1)
63556 	#define HWRM_FW_SECURE_CFG_INPUT_GRC_CTRL_LAST HWRM_FW_SECURE_CFG_INPUT_GRC_CTRL_RW
63557 	/* specify debug access control via UART */
63558 	uint8_t	uart_ctrl;
63559 	/* disable UART access for debugging */
63560 	#define HWRM_FW_SECURE_CFG_INPUT_UART_CTRL_DISABLE UINT32_C(0x0)
63561 	/* enable UART access for debugging */
63562 	#define HWRM_FW_SECURE_CFG_INPUT_UART_CTRL_ENABLE  UINT32_C(0x1)
63563 	#define HWRM_FW_SECURE_CFG_INPUT_UART_CTRL_LAST   HWRM_FW_SECURE_CFG_INPUT_UART_CTRL_ENABLE
63564 	uint8_t	unused_0[2];
63565 	uint64_t	unused_1;
63566 } hwrm_fw_secure_cfg_input_t, *phwrm_fw_secure_cfg_input_t;
63567 
63568 /* hwrm_fw_secure_cfg_output (size:128b/16B) */
63569 
63570 typedef struct hwrm_fw_secure_cfg_output {
63571 	/* The specific error status for the command. */
63572 	uint16_t	error_code;
63573 	/* The HWRM command request type. */
63574 	uint16_t	req_type;
63575 	/* The sequence ID from the original command. */
63576 	uint16_t	seq_id;
63577 	/* The length of the response data in number of bytes. */
63578 	uint16_t	resp_len;
63579 	uint8_t	unused_0[7];
63580 	/*
63581 	 * This field is used in Output records to indicate that the output
63582 	 * is completely written to RAM. This field should be read as '1'
63583 	 * to indicate that the output has been completely written.
63584 	 * When writing a command completion or response to an internal
63585 	 * processor, the order of writes has to be such that this field is
63586 	 * written last.
63587 	 */
63588 	uint8_t	valid;
63589 } hwrm_fw_secure_cfg_output_t, *phwrm_fw_secure_cfg_output_t;
63590 
63591 /**********************
63592  * hwrm_exec_fwd_resp *
63593  **********************/
63594 
63595 
63596 /* hwrm_exec_fwd_resp_input (size:1024b/128B) */
63597 
63598 typedef struct hwrm_exec_fwd_resp_input {
63599 	/* The HWRM command request type. */
63600 	uint16_t	req_type;
63601 	/*
63602 	 * The completion ring to send the completion event on. This should
63603 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63604 	 */
63605 	uint16_t	cmpl_ring;
63606 	/*
63607 	 * The sequence ID is used by the driver for tracking multiple
63608 	 * commands. This ID is treated as opaque data by the firmware and
63609 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63610 	 */
63611 	uint16_t	seq_id;
63612 	/*
63613 	 * The target ID of the command:
63614 	 * * 0x0-0xFFF8 - The function ID
63615 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63616 	 * * 0xFFFD - Reserved for user-space HWRM interface
63617 	 * * 0xFFFF - HWRM
63618 	 */
63619 	uint16_t	target_id;
63620 	/*
63621 	 * A physical address pointer pointing to a host buffer that the
63622 	 * command's response data will be written. This can be either a host
63623 	 * physical address (HPA) or a guest physical address (GPA) and must
63624 	 * point to a physically contiguous block of memory.
63625 	 */
63626 	uint64_t	resp_addr;
63627 	/*
63628 	 * This is an encapsulated request. This request should
63629 	 * be executed by the HWRM and the response should be
63630 	 * provided in the response buffer inside the encapsulated
63631 	 * request.
63632 	 */
63633 	uint32_t	encap_request[26];
63634 	/*
63635 	 * This value indicates the target id of the response to
63636 	 * the encapsulated request.
63637 	 * 0x0 - 0xFFF8 - Used for function ids
63638 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
63639 	 * 0xFFFF - HWRM
63640 	 */
63641 	uint16_t	encap_resp_target_id;
63642 	uint8_t	unused_0[6];
63643 } hwrm_exec_fwd_resp_input_t, *phwrm_exec_fwd_resp_input_t;
63644 
63645 /* hwrm_exec_fwd_resp_output (size:128b/16B) */
63646 
63647 typedef struct hwrm_exec_fwd_resp_output {
63648 	/* The specific error status for the command. */
63649 	uint16_t	error_code;
63650 	/* The HWRM command request type. */
63651 	uint16_t	req_type;
63652 	/* The sequence ID from the original command. */
63653 	uint16_t	seq_id;
63654 	/* The length of the response data in number of bytes. */
63655 	uint16_t	resp_len;
63656 	uint8_t	unused_0[7];
63657 	/*
63658 	 * This field is used in Output records to indicate that the output
63659 	 * is completely written to RAM. This field should be read as '1'
63660 	 * to indicate that the output has been completely written. When
63661 	 * writing a command completion or response to an internal processor,
63662 	 * the order of writes has to be such that this field is written last.
63663 	 */
63664 	uint8_t	valid;
63665 } hwrm_exec_fwd_resp_output_t, *phwrm_exec_fwd_resp_output_t;
63666 
63667 /************************
63668  * hwrm_reject_fwd_resp *
63669  ************************/
63670 
63671 
63672 /* hwrm_reject_fwd_resp_input (size:1024b/128B) */
63673 
63674 typedef struct hwrm_reject_fwd_resp_input {
63675 	/* The HWRM command request type. */
63676 	uint16_t	req_type;
63677 	/*
63678 	 * The completion ring to send the completion event on. This should
63679 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63680 	 */
63681 	uint16_t	cmpl_ring;
63682 	/*
63683 	 * The sequence ID is used by the driver for tracking multiple
63684 	 * commands. This ID is treated as opaque data by the firmware and
63685 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63686 	 */
63687 	uint16_t	seq_id;
63688 	/*
63689 	 * The target ID of the command:
63690 	 * * 0x0-0xFFF8 - The function ID
63691 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63692 	 * * 0xFFFD - Reserved for user-space HWRM interface
63693 	 * * 0xFFFF - HWRM
63694 	 */
63695 	uint16_t	target_id;
63696 	/*
63697 	 * A physical address pointer pointing to a host buffer that the
63698 	 * command's response data will be written. This can be either a host
63699 	 * physical address (HPA) or a guest physical address (GPA) and must
63700 	 * point to a physically contiguous block of memory.
63701 	 */
63702 	uint64_t	resp_addr;
63703 	/*
63704 	 * This is an encapsulated request. This request should
63705 	 * be rejected by the HWRM and the error response should be
63706 	 * provided in the response buffer inside the encapsulated
63707 	 * request.
63708 	 */
63709 	uint32_t	encap_request[26];
63710 	/*
63711 	 * This value indicates the target id of the response to
63712 	 * the encapsulated request.
63713 	 * 0x0 - 0xFFF8 - Used for function ids
63714 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
63715 	 * 0xFFFF - HWRM
63716 	 */
63717 	uint16_t	encap_resp_target_id;
63718 	uint8_t	unused_0[6];
63719 } hwrm_reject_fwd_resp_input_t, *phwrm_reject_fwd_resp_input_t;
63720 
63721 /* hwrm_reject_fwd_resp_output (size:128b/16B) */
63722 
63723 typedef struct hwrm_reject_fwd_resp_output {
63724 	/* The specific error status for the command. */
63725 	uint16_t	error_code;
63726 	/* The HWRM command request type. */
63727 	uint16_t	req_type;
63728 	/* The sequence ID from the original command. */
63729 	uint16_t	seq_id;
63730 	/* The length of the response data in number of bytes. */
63731 	uint16_t	resp_len;
63732 	uint8_t	unused_0[7];
63733 	/*
63734 	 * This field is used in Output records to indicate that the output
63735 	 * is completely written to RAM. This field should be read as '1'
63736 	 * to indicate that the output has been completely written. When
63737 	 * writing a command completion or response to an internal processor,
63738 	 * the order of writes has to be such that this field is written last.
63739 	 */
63740 	uint8_t	valid;
63741 } hwrm_reject_fwd_resp_output_t, *phwrm_reject_fwd_resp_output_t;
63742 
63743 /*****************
63744  * hwrm_fwd_resp *
63745  *****************/
63746 
63747 
63748 /* hwrm_fwd_resp_input (size:1024b/128B) */
63749 
63750 typedef struct hwrm_fwd_resp_input {
63751 	/* The HWRM command request type. */
63752 	uint16_t	req_type;
63753 	/*
63754 	 * The completion ring to send the completion event on. This should
63755 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63756 	 */
63757 	uint16_t	cmpl_ring;
63758 	/*
63759 	 * The sequence ID is used by the driver for tracking multiple
63760 	 * commands. This ID is treated as opaque data by the firmware and
63761 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63762 	 */
63763 	uint16_t	seq_id;
63764 	/*
63765 	 * The target ID of the command:
63766 	 * * 0x0-0xFFF8 - The function ID
63767 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63768 	 * * 0xFFFD - Reserved for user-space HWRM interface
63769 	 * * 0xFFFF - HWRM
63770 	 */
63771 	uint16_t	target_id;
63772 	/*
63773 	 * A physical address pointer pointing to a host buffer that the
63774 	 * command's response data will be written. This can be either a host
63775 	 * physical address (HPA) or a guest physical address (GPA) and must
63776 	 * point to a physically contiguous block of memory.
63777 	 */
63778 	uint64_t	resp_addr;
63779 	/*
63780 	 * This value indicates the target id of the encapsulated
63781 	 * response.
63782 	 * 0x0 - 0xFFF8 - Used for function ids
63783 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
63784 	 * 0xFFFF - HWRM
63785 	 */
63786 	uint16_t	encap_resp_target_id;
63787 	/*
63788 	 * This value indicates the completion ring the encapsulated
63789 	 * response will be optionally completed on. If the value is
63790 	 * -1, then no CR completion shall be generated for the
63791 	 * encapsulated response. Any other value must be a
63792 	 * valid CR ring_id value. If a valid encap_resp_cmpl_ring
63793 	 * is provided, then a CR completion shall be generated for
63794 	 * the encapsulated response.
63795 	 */
63796 	uint16_t	encap_resp_cmpl_ring;
63797 	/* This field indicates the length of encapsulated response. */
63798 	uint16_t	encap_resp_len;
63799 	uint8_t	unused_0;
63800 	uint8_t	unused_1;
63801 	/*
63802 	 * This is the host address where the encapsulated response
63803 	 * will be written.
63804 	 * This area must be 16B aligned and must be cleared to zero
63805 	 * before the original request is made.
63806 	 */
63807 	uint64_t	encap_resp_addr;
63808 	/* This is an encapsulated response. */
63809 	uint32_t	encap_resp[24];
63810 } hwrm_fwd_resp_input_t, *phwrm_fwd_resp_input_t;
63811 
63812 /* hwrm_fwd_resp_output (size:128b/16B) */
63813 
63814 typedef struct hwrm_fwd_resp_output {
63815 	/* The specific error status for the command. */
63816 	uint16_t	error_code;
63817 	/* The HWRM command request type. */
63818 	uint16_t	req_type;
63819 	/* The sequence ID from the original command. */
63820 	uint16_t	seq_id;
63821 	/* The length of the response data in number of bytes. */
63822 	uint16_t	resp_len;
63823 	uint8_t	unused_0[7];
63824 	/*
63825 	 * This field is used in Output records to indicate that the output
63826 	 * is completely written to RAM. This field should be read as '1'
63827 	 * to indicate that the output has been completely written. When
63828 	 * writing a command completion or response to an internal processor,
63829 	 * the order of writes has to be such that this field is written last.
63830 	 */
63831 	uint8_t	valid;
63832 } hwrm_fwd_resp_output_t, *phwrm_fwd_resp_output_t;
63833 
63834 /*****************************
63835  * hwrm_fwd_async_event_cmpl *
63836  *****************************/
63837 
63838 
63839 /* hwrm_fwd_async_event_cmpl_input (size:320b/40B) */
63840 
63841 typedef struct hwrm_fwd_async_event_cmpl_input {
63842 	/* The HWRM command request type. */
63843 	uint16_t	req_type;
63844 	/*
63845 	 * The completion ring to send the completion event on. This should
63846 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63847 	 */
63848 	uint16_t	cmpl_ring;
63849 	/*
63850 	 * The sequence ID is used by the driver for tracking multiple
63851 	 * commands. This ID is treated as opaque data by the firmware and
63852 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63853 	 */
63854 	uint16_t	seq_id;
63855 	/*
63856 	 * The target ID of the command:
63857 	 * * 0x0-0xFFF8 - The function ID
63858 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63859 	 * * 0xFFFD - Reserved for user-space HWRM interface
63860 	 * * 0xFFFF - HWRM
63861 	 */
63862 	uint16_t	target_id;
63863 	/*
63864 	 * A physical address pointer pointing to a host buffer that the
63865 	 * command's response data will be written. This can be either a host
63866 	 * physical address (HPA) or a guest physical address (GPA) and must
63867 	 * point to a physically contiguous block of memory.
63868 	 */
63869 	uint64_t	resp_addr;
63870 	/*
63871 	 * This value indicates the target id of the encapsulated
63872 	 * asynchronous event.
63873 	 * 0x0 - 0xFFF8 - Used for function ids
63874 	 * 0xFFF8 - 0xFFFE - Reserved for internal processors
63875 	 * 0xFFFF - Broadcast to all children VFs (only applicable when
63876 	 * a PF is the requester)
63877 	 */
63878 	uint16_t	encap_async_event_target_id;
63879 	uint8_t	unused_0[6];
63880 	/* This is an encapsulated asynchronous event completion. */
63881 	uint32_t	encap_async_event_cmpl[4];
63882 } hwrm_fwd_async_event_cmpl_input_t, *phwrm_fwd_async_event_cmpl_input_t;
63883 
63884 /* hwrm_fwd_async_event_cmpl_output (size:128b/16B) */
63885 
63886 typedef struct hwrm_fwd_async_event_cmpl_output {
63887 	/* The specific error status for the command. */
63888 	uint16_t	error_code;
63889 	/* The HWRM command request type. */
63890 	uint16_t	req_type;
63891 	/* The sequence ID from the original command. */
63892 	uint16_t	seq_id;
63893 	/* The length of the response data in number of bytes. */
63894 	uint16_t	resp_len;
63895 	uint8_t	unused_0[7];
63896 	/*
63897 	 * This field is used in Output records to indicate that the output
63898 	 * is completely written to RAM. This field should be read as '1'
63899 	 * to indicate that the output has been completely written. When
63900 	 * writing a command completion or response to an internal processor,
63901 	 * the order of writes has to be such that this field is written last.
63902 	 */
63903 	uint8_t	valid;
63904 } hwrm_fwd_async_event_cmpl_output_t, *phwrm_fwd_async_event_cmpl_output_t;
63905 
63906 /***************************
63907  * hwrm_temp_monitor_query *
63908  ***************************/
63909 
63910 
63911 /* hwrm_temp_monitor_query_input (size:128b/16B) */
63912 
63913 typedef struct hwrm_temp_monitor_query_input {
63914 	/* The HWRM command request type. */
63915 	uint16_t	req_type;
63916 	/*
63917 	 * The completion ring to send the completion event on. This should
63918 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
63919 	 */
63920 	uint16_t	cmpl_ring;
63921 	/*
63922 	 * The sequence ID is used by the driver for tracking multiple
63923 	 * commands. This ID is treated as opaque data by the firmware and
63924 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
63925 	 */
63926 	uint16_t	seq_id;
63927 	/*
63928 	 * The target ID of the command:
63929 	 * * 0x0-0xFFF8 - The function ID
63930 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
63931 	 * * 0xFFFD - Reserved for user-space HWRM interface
63932 	 * * 0xFFFF - HWRM
63933 	 */
63934 	uint16_t	target_id;
63935 	/*
63936 	 * A physical address pointer pointing to a host buffer that the
63937 	 * command's response data will be written. This can be either a host
63938 	 * physical address (HPA) or a guest physical address (GPA) and must
63939 	 * point to a physically contiguous block of memory.
63940 	 */
63941 	uint64_t	resp_addr;
63942 } hwrm_temp_monitor_query_input_t, *phwrm_temp_monitor_query_input_t;
63943 
63944 /* hwrm_temp_monitor_query_output (size:192b/24B) */
63945 
63946 typedef struct hwrm_temp_monitor_query_output {
63947 	/* The specific error status for the command. */
63948 	uint16_t	error_code;
63949 	/* The HWRM command request type. */
63950 	uint16_t	req_type;
63951 	/* The sequence ID from the original command. */
63952 	uint16_t	seq_id;
63953 	/* The length of the response data in number of bytes. */
63954 	uint16_t	resp_len;
63955 	/*
63956 	 * The HWRM shall provide the current temperature of
63957 	 * the device in Celsius. This is the max of PCIe_temp
63958 	 * and PM_temp
63959 	 */
63960 	uint8_t	temp;
63961 	/*
63962 	 * The HWRM shall provide the current temperature of
63963 	 * the phy in Celsius.
63964 	 */
63965 	uint8_t	phy_temp;
63966 	/*
63967 	 * The HWRM shall provide the current temperature of
63968 	 * the module_index in Celsius.
63969 	 */
63970 	uint8_t	om_temp;
63971 	/* Describe individual temperature sensor condition. */
63972 	uint8_t	flags;
63973 	/*
63974 	 * "1" in this bit indicates temperature read not
63975 	 * successful.
63976 	 */
63977 	#define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_TEMP_NOT_AVAILABLE		UINT32_C(0x1)
63978 	/*
63979 	 * "1" in this bit indicates phy temperature read not
63980 	 * successful.
63981 	 */
63982 	#define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_PHY_TEMP_NOT_AVAILABLE	UINT32_C(0x2)
63983 	/* "1" in this bit indicates optical module(s) not present. */
63984 	#define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_OM_NOT_PRESENT		UINT32_C(0x4)
63985 	/*
63986 	 * "1" in this bit indicates om temperature read not
63987 	 * successful.
63988 	 */
63989 	#define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_OM_TEMP_NOT_AVAILABLE	UINT32_C(0x8)
63990 	/*
63991 	 * "1" in this bit indicates the extended temperature fields are
63992 	 * available.
63993 	 */
63994 	#define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_EXT_TEMP_FIELDS_AVAILABLE	UINT32_C(0x10)
63995 	/*
63996 	 * "1" in this bit indicates the thermal threshold values are
63997 	 * available.
63998 	 */
63999 	#define HWRM_TEMP_MONITOR_QUERY_OUTPUT_FLAGS_THRESHOLD_VALUES_AVAILABLE	UINT32_C(0x20)
64000 	/*
64001 	 * This field encodes the current device temperature in Celsius.
64002 	 * This field is unsigned and the value range of 0 to 255 is used to
64003 	 * indicate a temperature range from -64 to +191. The actual
64004 	 * temperature is derived by subtracting 64 from this field.
64005 	 * Example: A value of 0 represents a temperature of -64, a value of
64006 	 * 255 represents a temperature of 191.
64007 	 */
64008 	uint8_t	temp2;
64009 	/*
64010 	 * This field encodes the current phy temperature in Celsius. This
64011 	 * field is unsigned and the value range of 0 to 255 is used to
64012 	 * indicate a temperature range from -64 to +191. The actual
64013 	 * temperature is derived by subtracting 64 from this field.
64014 	 * Example: A value of 0 represents a temperature of -64, a value of
64015 	 * 255 represents a temperature of 191.
64016 	 */
64017 	uint8_t	phy_temp2;
64018 	/*
64019 	 * This field encodes the current module index temperature in Celsius.
64020 	 * This field is unsigned and the value range of 0 to 255 is used to
64021 	 * indicate a temperature range from -64 to +191. The actual
64022 	 * temperature is derived by subtracting 64 from this field.
64023 	 * Example: A value of 0 represents a temperature of -64, a value of
64024 	 * 255 represents a temperature of 191.
64025 	 */
64026 	uint8_t	om_temp2;
64027 	/*
64028 	 * This field reports the device's threshold value for reporting
64029 	 * a warning indication. The temperature is reported in Celsius.
64030 	 */
64031 	uint8_t	warn_threshold;
64032 	/*
64033 	 * This field reports the device's threshold value for reporting
64034 	 * a critical indication. The temperature is reported in Celsius.
64035 	 */
64036 	uint8_t	critical_threshold;
64037 	/*
64038 	 * This field reports the device's threshold value for reporting
64039 	 * a fatal indication. The temperature is reported in Celsius.
64040 	 */
64041 	uint8_t	fatal_threshold;
64042 	/*
64043 	 * This field reports the threshold value at which the device will
64044 	 * a perform a self shutdown. The temperature is reported in Celsius.
64045 	 * If the value is zero, then that indicates self shutdown is not
64046 	 * configured.
64047 	 */
64048 	uint8_t	shutdown_threshold;
64049 	uint8_t	unused_0[4];
64050 	/*
64051 	 * This field is used in Output records to indicate that the output
64052 	 * is completely written to RAM. This field should be read as '1'
64053 	 * to indicate that the output has been completely written. When
64054 	 * writing a command completion or response to an internal processor,
64055 	 * the order of writes has to be such that this field is written last.
64056 	 */
64057 	uint8_t	valid;
64058 } hwrm_temp_monitor_query_output_t, *phwrm_temp_monitor_query_output_t;
64059 
64060 /************************
64061  * hwrm_reg_power_query *
64062  ************************/
64063 
64064 
64065 /* hwrm_reg_power_query_input (size:128b/16B) */
64066 
64067 typedef struct hwrm_reg_power_query_input {
64068 	/* The HWRM command request type. */
64069 	uint16_t	req_type;
64070 	/*
64071 	 * The completion ring to send the completion event on. This should
64072 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
64073 	 */
64074 	uint16_t	cmpl_ring;
64075 	/*
64076 	 * The sequence ID is used by the driver for tracking multiple
64077 	 * commands. This ID is treated as opaque data by the firmware and
64078 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
64079 	 */
64080 	uint16_t	seq_id;
64081 	/*
64082 	 * The target ID of the command:
64083 	 * * 0x0-0xFFF8 - The function ID
64084 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
64085 	 * * 0xFFFD - Reserved for user-space HWRM interface
64086 	 * * 0xFFFF - HWRM
64087 	 */
64088 	uint16_t	target_id;
64089 	/*
64090 	 * A physical address pointer pointing to a host buffer that the
64091 	 * command's response data will be written. This can be either a host
64092 	 * physical address (HPA) or a guest physical address (GPA) and must
64093 	 * point to a physically contiguous block of memory.
64094 	 */
64095 	uint64_t	resp_addr;
64096 } hwrm_reg_power_query_input_t, *phwrm_reg_power_query_input_t;
64097 
64098 /* hwrm_reg_power_query_output (size:192b/24B) */
64099 
64100 typedef struct hwrm_reg_power_query_output {
64101 	/* The specific error status for the command. */
64102 	uint16_t	error_code;
64103 	/* The HWRM command request type. */
64104 	uint16_t	req_type;
64105 	/* The sequence ID from the original command. */
64106 	uint16_t	seq_id;
64107 	/* The length of the response data in number of bytes. */
64108 	uint16_t	resp_len;
64109 	/* Describe availability of switching regulator power values. */
64110 	uint32_t	flags;
64111 	/* When this bit is set to '1', the input power is available. */
64112 	#define HWRM_REG_POWER_QUERY_OUTPUT_FLAGS_IN_POWER_AVAILABLE	UINT32_C(0x1)
64113 	/* When this bit is set to '1', the output power is available. */
64114 	#define HWRM_REG_POWER_QUERY_OUTPUT_FLAGS_OUT_POWER_AVAILABLE	UINT32_C(0x2)
64115 	/*
64116 	 * The HWRM shall provide the current switching regulator
64117 	 * input power in mW, if available.
64118 	 */
64119 	uint32_t	in_power_mw;
64120 	/*
64121 	 * The HWRM shall provide the current switching regulator
64122 	 * output power in mW, if available.
64123 	 */
64124 	uint32_t	out_power_mw;
64125 	uint8_t	unused_0[3];
64126 	/*
64127 	 * This field is used in Output records to indicate that the output
64128 	 * is completely written to RAM. This field should be read as '1'
64129 	 * to indicate that the output has been completely written. When
64130 	 * writing a command completion or response to an internal processor,
64131 	 * the order of writes has to be such that this field is written last.
64132 	 */
64133 	uint8_t	valid;
64134 } hwrm_reg_power_query_output_t, *phwrm_reg_power_query_output_t;
64135 
64136 /*****************************
64137  * hwrm_core_frequency_query *
64138  *****************************/
64139 
64140 
64141 /* hwrm_core_frequency_query_input (size:128b/16B) */
64142 
64143 typedef struct hwrm_core_frequency_query_input {
64144 	/* The HWRM command request type. */
64145 	uint16_t	req_type;
64146 	/*
64147 	 * The completion ring to send the completion event on. This should
64148 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
64149 	 */
64150 	uint16_t	cmpl_ring;
64151 	/*
64152 	 * The sequence ID is used by the driver for tracking multiple
64153 	 * commands. This ID is treated as opaque data by the firmware and
64154 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
64155 	 */
64156 	uint16_t	seq_id;
64157 	/*
64158 	 * The target ID of the command:
64159 	 * * 0x0-0xFFF8 - The function ID
64160 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
64161 	 * * 0xFFFD - Reserved for user-space HWRM interface
64162 	 * * 0xFFFF - HWRM
64163 	 */
64164 	uint16_t	target_id;
64165 	/*
64166 	 * A physical address pointer pointing to a host buffer that the
64167 	 * command's response data will be written. This can be either a host
64168 	 * physical address (HPA) or a guest physical address (GPA) and must
64169 	 * point to a physically contiguous block of memory.
64170 	 */
64171 	uint64_t	resp_addr;
64172 } hwrm_core_frequency_query_input_t, *phwrm_core_frequency_query_input_t;
64173 
64174 /* hwrm_core_frequency_query_output (size:128b/16B) */
64175 
64176 typedef struct hwrm_core_frequency_query_output {
64177 	/* The specific error status for the command. */
64178 	uint16_t	error_code;
64179 	/* The HWRM command request type. */
64180 	uint16_t	req_type;
64181 	/* The sequence ID from the original command. */
64182 	uint16_t	seq_id;
64183 	/* The length of the response data in number of bytes. */
64184 	uint16_t	resp_len;
64185 	/* The HWRM shall provide the core frequency in Hz. */
64186 	uint32_t	core_frequency_hz;
64187 	uint8_t	unused_0[3];
64188 	/*
64189 	 * This field is used in Output records to indicate that the output
64190 	 * is completely written to RAM. This field should be read as '1'
64191 	 * to indicate that the output has been completely written. When
64192 	 * writing a command completion or response to an internal processor,
64193 	 * the order of writes has to be such that this field is written last.
64194 	 */
64195 	uint8_t	valid;
64196 } hwrm_core_frequency_query_output_t, *phwrm_core_frequency_query_output_t;
64197 
64198 /****************************
64199  * hwrm_reg_power_histogram *
64200  ****************************/
64201 
64202 
64203 /* hwrm_reg_power_histogram_input (size:192b/24B) */
64204 
64205 typedef struct hwrm_reg_power_histogram_input {
64206 	/* The HWRM command request type. */
64207 	uint16_t	req_type;
64208 	/*
64209 	 * The completion ring to send the completion event on. This should
64210 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
64211 	 */
64212 	uint16_t	cmpl_ring;
64213 	/*
64214 	 * The sequence ID is used by the driver for tracking multiple
64215 	 * commands. This ID is treated as opaque data by the firmware and
64216 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
64217 	 */
64218 	uint16_t	seq_id;
64219 	/*
64220 	 * The target ID of the command:
64221 	 * * 0x0-0xFFF8 - The function ID
64222 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
64223 	 * * 0xFFFD - Reserved for user-space HWRM interface
64224 	 * * 0xFFFF - HWRM
64225 	 */
64226 	uint16_t	target_id;
64227 	/*
64228 	 * A physical address pointer pointing to a host buffer that the
64229 	 * command's response data will be written. This can be either a host
64230 	 * physical address (HPA) or a guest physical address (GPA) and must
64231 	 * point to a physically contiguous block of memory.
64232 	 */
64233 	uint64_t	resp_addr;
64234 	/* Describe operational mode of power histogram command. */
64235 	uint32_t	flags;
64236 	/*
64237 	 * When this bit is set to '1', histogram data for the respective
64238 	 * client (HWRM or BMC) is cleared after read.
64239 	 */
64240 	#define HWRM_REG_POWER_HISTOGRAM_INPUT_FLAGS_CLEAR_HISTOGRAM	UINT32_C(0x1)
64241 	uint32_t	unused_0;
64242 } hwrm_reg_power_histogram_input_t, *phwrm_reg_power_histogram_input_t;
64243 
64244 /* hwrm_reg_power_histogram_output (size:1088b/136B) */
64245 
64246 typedef struct hwrm_reg_power_histogram_output {
64247 	/* The specific error status for the command. */
64248 	uint16_t	error_code;
64249 	/* The HWRM command request type. */
64250 	uint16_t	req_type;
64251 	/* The sequence ID from the original command. */
64252 	uint16_t	seq_id;
64253 	/* The length of the response data in number of bytes. */
64254 	uint16_t	resp_len;
64255 	/* Describe output characteristics of power histogram command. */
64256 	uint16_t	flags;
64257 	/*
64258 	 * Indicates whether input or output power is used. Some switching
64259 	 * regulators provide both input and output voltage and current
64260 	 * measurements, and others provide only output measurements. When
64261 	 * both are available, input is used. This value is constant for a
64262 	 * given board.
64263 	 */
64264 	#define HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT	UINT32_C(0x1)
64265 	/*
64266 	 * The switching regulator's input power is used
64267 	 * data.
64268 	 */
64269 		#define HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT_INPUT   UINT32_C(0x0)
64270 	/*
64271 	 * The switching regulator's output power is used
64272 	 * data.
64273 	 */
64274 		#define HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT_OUTPUT  UINT32_C(0x1)
64275 		#define HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT_LAST   HWRM_REG_POWER_HISTOGRAM_OUTPUT_FLAGS_POWER_IN_OUT_OUTPUT
64276 	uint8_t	unused_0[2];
64277 	/*
64278 	 * Time in microseconds between samples. This value is constant in
64279 	 * firmware. The initial design sets this constant at 10000 us (10
64280 	 * ms). Power values for voltage regulators calculate a power value
64281 	 * over a 300 us period, so a 10 ms sampling period covers 3% of
64282 	 * time ranges. Future firmware designs may opt for different
64283 	 * sampling periods, so this value is provided on output.
64284 	 */
64285 	uint32_t	sampling_period;
64286 	/*
64287 	 * Total samples taken since last clear. If no counter has
64288 	 * saturated, the sum of counts in each bucket equates to this
64289 	 * sample_count value. If a single counter has saturated, its value
64290 	 * can be calculated by subtracting the remaining bucket values from
64291 	 * this sample_count value.
64292 	 */
64293 	uint64_t	sample_count;
64294 	/*
64295 	 * The power usage expressed in histogram buckets. Bucket value
64296 	 * ranges and array indices are defined per the enumeration
64297 	 * power_histogram_bucket_enum. Values saturate at the max 32-bit
64298 	 * value, 0xFFFFFFFF, and do not roll over. Clients should use the
64299 	 * clear bit on input to clear the histogram array periodically or
64300 	 * when saturation is observed.
64301 	 */
64302 	uint32_t	power_hist[26];
64303 	uint8_t	unused_1[7];
64304 	/*
64305 	 * This field is used in Output records to indicate that the output
64306 	 * is completely written to RAM. This field should be read as '1'
64307 	 * to indicate that the output has been completely written. When
64308 	 * writing a command completion or response to an internal processor,
64309 	 * the order of writes has to be such that this field is written last.
64310 	 */
64311 	uint8_t	valid;
64312 } hwrm_reg_power_histogram_output_t, *phwrm_reg_power_histogram_output_t;
64313 
64314 /*
64315  * Count of timer callback routines run with no data measured. This
64316  * may occur when data from the switching regulator is not available
64317  * to the firmware timer callback routine. One possible reason for
64318  * this is contention with other users of the i2c bus which is used
64319  * to communicate with the switching regulator, for example when a
64320  * call to hwrm_reg_power_query occurs while the timer routine is
64321  * running.
64322  */
64323 #define BUCKET_NO_DATA_FOR_SAMPLE UINT32_C(0x0)
64324 /* Count of samples measured at less than 8W */
64325 #define BUCKET_RANGE_8W_OR_LESS   UINT32_C(0x1)
64326 /* Count of samples measured >= 8 W and < 9 W */
64327 #define BUCKET_RANGE_8W_TO_9W	UINT32_C(0x2)
64328 /* Count of samples measured >= 9 W and < 10 W */
64329 #define BUCKET_RANGE_9W_TO_10W	UINT32_C(0x3)
64330 /* Count of samples measured >= 10 W and < 11 W */
64331 #define BUCKET_RANGE_10W_TO_11W   UINT32_C(0x4)
64332 /* Count of samples measured >= 11 W and < 12 W */
64333 #define BUCKET_RANGE_11W_TO_12W   UINT32_C(0x5)
64334 /* Count of samples measured >= 12 W and < 13 W */
64335 #define BUCKET_RANGE_12W_TO_13W   UINT32_C(0x6)
64336 /* Count of samples measured >= 13 W and < 14 W */
64337 #define BUCKET_RANGE_13W_TO_14W   UINT32_C(0x7)
64338 /* Count of samples measured >= 14 W and < 15 W */
64339 #define BUCKET_RANGE_14W_TO_15W   UINT32_C(0x8)
64340 /* Count of samples measured >= 15 W and < 16 W */
64341 #define BUCKET_RANGE_15W_TO_16W   UINT32_C(0x9)
64342 /* Count of samples measured >= 16 W and < 18 W */
64343 #define BUCKET_RANGE_16W_TO_18W   UINT32_C(0xa)
64344 /* Count of samples measured >= 18 W and < 20 W */
64345 #define BUCKET_RANGE_18W_TO_20W   UINT32_C(0xb)
64346 /* Count of samples measured >= 20 W and < 22 W */
64347 #define BUCKET_RANGE_20W_TO_22W   UINT32_C(0xc)
64348 /* Count of samples measured >= 22 W and < 24 W */
64349 #define BUCKET_RANGE_22W_TO_24W   UINT32_C(0xd)
64350 /* Count of samples measured >= 24 W and < 26 W */
64351 #define BUCKET_RANGE_24W_TO_26W   UINT32_C(0xe)
64352 /* Count of samples measured >= 26 W and < 28 W */
64353 #define BUCKET_RANGE_26W_TO_28W   UINT32_C(0xf)
64354 /* Count of samples measured >= 28 W and < 30 W */
64355 #define BUCKET_RANGE_28W_TO_30W   UINT32_C(0x10)
64356 /* Count of samples measured >= 30 W and < 32 W */
64357 #define BUCKET_RANGE_30W_TO_32W   UINT32_C(0x11)
64358 /* Count of samples measured >= 32 W and < 34 W */
64359 #define BUCKET_RANGE_32W_TO_34W   UINT32_C(0x12)
64360 /* Count of samples measured >= 34 W and < 36 W */
64361 #define BUCKET_RANGE_34W_TO_36W   UINT32_C(0x13)
64362 /* Count of samples measured >= 36 W and < 38 W */
64363 #define BUCKET_RANGE_36W_TO_38W   UINT32_C(0x14)
64364 /* Count of samples measured >= 38 W and < 40 W */
64365 #define BUCKET_RANGE_38W_TO_40W   UINT32_C(0x15)
64366 /* Count of samples measured >= 40 W and < 42 W */
64367 #define BUCKET_RANGE_40W_TO_42W   UINT32_C(0x16)
64368 /* Count of samples measured >= 42 W and < 44 W */
64369 #define BUCKET_RANGE_42W_TO_44W   UINT32_C(0x17)
64370 /* Count of samples measured >= 44 W and < 50 W */
64371 #define BUCKET_RANGE_44W_TO_50W   UINT32_C(0x18)
64372 /* Count of samples measured at 50 W or greater */
64373 #define BUCKET_RANGE_OVER_50W	UINT32_C(0x19)
64374 #define BUCKET_LAST		BUCKET_RANGE_OVER_50W
64375 
64376 
64377 /*************************
64378  * hwrm_wol_filter_alloc *
64379  *************************/
64380 
64381 
64382 /* hwrm_wol_filter_alloc_input (size:512b/64B) */
64383 
64384 typedef struct hwrm_wol_filter_alloc_input {
64385 	/* The HWRM command request type. */
64386 	uint16_t	req_type;
64387 	/*
64388 	 * The completion ring to send the completion event on. This should
64389 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
64390 	 */
64391 	uint16_t	cmpl_ring;
64392 	/*
64393 	 * The sequence ID is used by the driver for tracking multiple
64394 	 * commands. This ID is treated as opaque data by the firmware and
64395 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
64396 	 */
64397 	uint16_t	seq_id;
64398 	/*
64399 	 * The target ID of the command:
64400 	 * * 0x0-0xFFF8 - The function ID
64401 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
64402 	 * * 0xFFFD - Reserved for user-space HWRM interface
64403 	 * * 0xFFFF - HWRM
64404 	 */
64405 	uint16_t	target_id;
64406 	/*
64407 	 * A physical address pointer pointing to a host buffer that the
64408 	 * command's response data will be written. This can be either a host
64409 	 * physical address (HPA) or a guest physical address (GPA) and must
64410 	 * point to a physically contiguous block of memory.
64411 	 */
64412 	uint64_t	resp_addr;
64413 	uint32_t	flags;
64414 	uint32_t	enables;
64415 	/*
64416 	 * This bit must be '1' for the mac_address field to be
64417 	 * configured.
64418 	 */
64419 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_MAC_ADDRESS	UINT32_C(0x1)
64420 	/*
64421 	 * This bit must be '1' for the pattern_offset field to be
64422 	 * configured.
64423 	 */
64424 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_OFFSET	UINT32_C(0x2)
64425 	/*
64426 	 * This bit must be '1' for the pattern_buf_size field to be
64427 	 * configured.
64428 	 */
64429 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_BUF_SIZE	UINT32_C(0x4)
64430 	/*
64431 	 * This bit must be '1' for the pattern_buf_addr field to be
64432 	 * configured.
64433 	 */
64434 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_BUF_ADDR	UINT32_C(0x8)
64435 	/*
64436 	 * This bit must be '1' for the pattern_mask_addr field to be
64437 	 * configured.
64438 	 */
64439 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_MASK_ADDR	UINT32_C(0x10)
64440 	/*
64441 	 * This bit must be '1' for the pattern_mask_size field to be
64442 	 * configured.
64443 	 */
64444 	#define HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_PATTERN_MASK_SIZE	UINT32_C(0x20)
64445 	/* Port ID of port on which WoL filter is configured. */
64446 	uint16_t	port_id;
64447 	/* This value represents a Wake-on-LAN type. */
64448 	uint8_t	wol_type;
64449 	/* Magic Packet */
64450 	#define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_MAGICPKT UINT32_C(0x0)
64451 	/* Bitmap */
64452 	#define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_BMP	UINT32_C(0x1)
64453 	/* Invalid */
64454 	#define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_INVALID  UINT32_C(0xff)
64455 	#define HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_LAST	HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_INVALID
64456 	uint8_t	unused_0[5];
64457 	/*
64458 	 * # If this field is enabled and magic packet WoL filter
64459 	 * type is specified in this command, the value set in this
64460 	 * field shall be used in setting the magic packet based
64461 	 * WoL filter.
64462 	 * # If this field is not enabled and magic packet WoL
64463 	 * filter type is specified and port id is specified to
64464 	 * 0xFF in this command, then the HWRM
64465 	 * shall use default MAC address configured on the
64466 	 * function associated with the HWRM client.
64467 	 * # If this field is not enabled and magic packet WoL
64468 	 * filter type is specified and port id is not specified to
64469 	 * 0xFF in this command, then the HWRM
64470 	 * shall use default MAC address configured on the port.
64471 	 */
64472 	uint8_t	mac_address[6];
64473 	/*
64474 	 * The offset from the beginning of MAC header where
64475 	 * pattern should be matched.
64476 	 * Applies to bitmap WoL.
64477 	 */
64478 	uint16_t	pattern_offset;
64479 	/*
64480 	 * The size of the pattern that is being matched.
64481 	 * Applies to bitmap WoL.
64482 	 */
64483 	uint16_t	pattern_buf_size;
64484 	/*
64485 	 * The size of the pattern mask.
64486 	 * Applies to bitmap WoL.
64487 	 */
64488 	uint16_t	pattern_mask_size;
64489 	uint8_t	unused_1[4];
64490 	/*
64491 	 * Physical address of the pattern buffer.
64492 	 * Applies to bitmap WoL.
64493 	 */
64494 	uint64_t	pattern_buf_addr;
64495 	/*
64496 	 * Physical address of the pattern mask.
64497 	 * Applies to bitmap WoL.
64498 	 */
64499 	uint64_t	pattern_mask_addr;
64500 } hwrm_wol_filter_alloc_input_t, *phwrm_wol_filter_alloc_input_t;
64501 
64502 /* hwrm_wol_filter_alloc_output (size:128b/16B) */
64503 
64504 typedef struct hwrm_wol_filter_alloc_output {
64505 	/* The specific error status for the command. */
64506 	uint16_t	error_code;
64507 	/* The HWRM command request type. */
64508 	uint16_t	req_type;
64509 	/* The sequence ID from the original command. */
64510 	uint16_t	seq_id;
64511 	/* The length of the response data in number of bytes. */
64512 	uint16_t	resp_len;
64513 	/* This value identifies a Wake-on-LAN (WoL) filter. */
64514 	uint8_t	wol_filter_id;
64515 	uint8_t	unused_0[6];
64516 	/*
64517 	 * This field is used in Output records to indicate that the output
64518 	 * is completely written to RAM. This field should be read as '1'
64519 	 * to indicate that the output has been completely written. When
64520 	 * writing a command completion or response to an internal processor,
64521 	 * the order of writes has to be such that this field is written last.
64522 	 */
64523 	uint8_t	valid;
64524 } hwrm_wol_filter_alloc_output_t, *phwrm_wol_filter_alloc_output_t;
64525 
64526 /************************
64527  * hwrm_wol_filter_free *
64528  ************************/
64529 
64530 
64531 /* hwrm_wol_filter_free_input (size:256b/32B) */
64532 
64533 typedef struct hwrm_wol_filter_free_input {
64534 	/* The HWRM command request type. */
64535 	uint16_t	req_type;
64536 	/*
64537 	 * The completion ring to send the completion event on. This should
64538 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
64539 	 */
64540 	uint16_t	cmpl_ring;
64541 	/*
64542 	 * The sequence ID is used by the driver for tracking multiple
64543 	 * commands. This ID is treated as opaque data by the firmware and
64544 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
64545 	 */
64546 	uint16_t	seq_id;
64547 	/*
64548 	 * The target ID of the command:
64549 	 * * 0x0-0xFFF8 - The function ID
64550 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
64551 	 * * 0xFFFD - Reserved for user-space HWRM interface
64552 	 * * 0xFFFF - HWRM
64553 	 */
64554 	uint16_t	target_id;
64555 	/*
64556 	 * A physical address pointer pointing to a host buffer that the
64557 	 * command's response data will be written. This can be either a host
64558 	 * physical address (HPA) or a guest physical address (GPA) and must
64559 	 * point to a physically contiguous block of memory.
64560 	 */
64561 	uint64_t	resp_addr;
64562 	uint32_t	flags;
64563 	/*
64564 	 * # When this bit is set to '1', then all active WoL
64565 	 * filters on the port are requested to be freed.
64566 	 * # If the a function driver sets this flag to '1', then
64567 	 * the HWRM shall free all active WoL filters that are not
64568 	 * set by other function drivers on that port.
64569 	 */
64570 	#define HWRM_WOL_FILTER_FREE_INPUT_FLAGS_FREE_ALL_WOL_FILTERS	UINT32_C(0x1)
64571 	uint32_t	enables;
64572 	/*
64573 	 * This bit must be '1' for the wol_filter_id field to be
64574 	 * configured.
64575 	 */
64576 	#define HWRM_WOL_FILTER_FREE_INPUT_ENABLES_WOL_FILTER_ID	UINT32_C(0x1)
64577 	/* Port ID of the port on which WoL filter(s) is (are) being freed. */
64578 	uint16_t	port_id;
64579 	/*
64580 	 * The HWRM shall ignore this field if free_all_wol_filters
64581 	 * flag is set.
64582 	 */
64583 	uint8_t	wol_filter_id;
64584 	uint8_t	unused_0[5];
64585 } hwrm_wol_filter_free_input_t, *phwrm_wol_filter_free_input_t;
64586 
64587 /* hwrm_wol_filter_free_output (size:128b/16B) */
64588 
64589 typedef struct hwrm_wol_filter_free_output {
64590 	/* The specific error status for the command. */
64591 	uint16_t	error_code;
64592 	/* The HWRM command request type. */
64593 	uint16_t	req_type;
64594 	/* The sequence ID from the original command. */
64595 	uint16_t	seq_id;
64596 	/* The length of the response data in number of bytes. */
64597 	uint16_t	resp_len;
64598 	uint8_t	unused_0[7];
64599 	/*
64600 	 * This field is used in Output records to indicate that the output
64601 	 * is completely written to RAM. This field should be read as '1'
64602 	 * to indicate that the output has been completely written. When
64603 	 * writing a command completion or response to an internal processor,
64604 	 * the order of writes has to be such that this field is written last.
64605 	 */
64606 	uint8_t	valid;
64607 } hwrm_wol_filter_free_output_t, *phwrm_wol_filter_free_output_t;
64608 
64609 /************************
64610  * hwrm_wol_filter_qcfg *
64611  ************************/
64612 
64613 
64614 /* hwrm_wol_filter_qcfg_input (size:448b/56B) */
64615 
64616 typedef struct hwrm_wol_filter_qcfg_input {
64617 	/* The HWRM command request type. */
64618 	uint16_t	req_type;
64619 	/*
64620 	 * The completion ring to send the completion event on. This should
64621 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
64622 	 */
64623 	uint16_t	cmpl_ring;
64624 	/*
64625 	 * The sequence ID is used by the driver for tracking multiple
64626 	 * commands. This ID is treated as opaque data by the firmware and
64627 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
64628 	 */
64629 	uint16_t	seq_id;
64630 	/*
64631 	 * The target ID of the command:
64632 	 * * 0x0-0xFFF8 - The function ID
64633 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
64634 	 * * 0xFFFD - Reserved for user-space HWRM interface
64635 	 * * 0xFFFF - HWRM
64636 	 */
64637 	uint16_t	target_id;
64638 	/*
64639 	 * A physical address pointer pointing to a host buffer that the
64640 	 * command's response data will be written. This can be either a host
64641 	 * physical address (HPA) or a guest physical address (GPA) and must
64642 	 * point to a physically contiguous block of memory.
64643 	 */
64644 	uint64_t	resp_addr;
64645 	/* Port ID of port on which WoL filter that is being queried. */
64646 	uint16_t	port_id;
64647 	/*
64648 	 * This is an opaque handle used to access filters.
64649 	 * # The HWRM client shall set this field to 0x0000 to begin
64650 	 * the query.
64651 	 * # After the first query, the HWRM client shall retrieve
64652 	 * next filters (if they exist) using the HWRM provided handle
64653 	 * in the response.
64654 	 */
64655 	uint16_t	handle;
64656 	uint8_t	unused_0[4];
64657 	/*
64658 	 * Physical address of the pattern buffer.
64659 	 * Applies to bitmap WoL filter only.
64660 	 * # Value of 0 indicates an invalid buffer address.
64661 	 * If this field is set to 0, then HWRM shall ignore
64662 	 * pattern_buf_size.
64663 	 * # If the HWRM client provides an invalid buffer address
64664 	 * for the pattern, then the HWRM is not required to
64665 	 * provide pattern when the response contains a bitmap WoL
64666 	 * filter.
64667 	 */
64668 	uint64_t	pattern_buf_addr;
64669 	/*
64670 	 * The size of the pattern buffer.
64671 	 * Applies to bitmap WoL filter only.
64672 	 */
64673 	uint16_t	pattern_buf_size;
64674 	uint8_t	unused_1[6];
64675 	/*
64676 	 * Physical address of the pattern mask.
64677 	 * Applies to bitmap WoL filter only.
64678 	 * # Value of 0 indicates an invalid pattern mask address.
64679 	 * If this field is set to 0, then HWRM shall ignore
64680 	 * pattern_mask_size.
64681 	 * # If the HWRM client provides an invalid mask address
64682 	 * for the pattern, then the HWRM is not required to
64683 	 * provide mask when the response contains a bitmap WoL
64684 	 * filter.
64685 	 */
64686 	uint64_t	pattern_mask_addr;
64687 	/*
64688 	 * The size of the buffer for pattern mask.
64689 	 * Applies to bitmap WoL filter only.
64690 	 */
64691 	uint16_t	pattern_mask_size;
64692 	uint8_t	unused_2[6];
64693 } hwrm_wol_filter_qcfg_input_t, *phwrm_wol_filter_qcfg_input_t;
64694 
64695 /* hwrm_wol_filter_qcfg_output (size:256b/32B) */
64696 
64697 typedef struct hwrm_wol_filter_qcfg_output {
64698 	/* The specific error status for the command. */
64699 	uint16_t	error_code;
64700 	/* The HWRM command request type. */
64701 	uint16_t	req_type;
64702 	/* The sequence ID from the original command. */
64703 	uint16_t	seq_id;
64704 	/* The length of the response data in number of bytes. */
64705 	uint16_t	resp_len;
64706 	/*
64707 	 * This is the next handle that is used to access filters.
64708 	 * # If this field is set to 0x0000, then no WoL filters are
64709 	 * currently configured on this port and all other fields in
64710 	 * the output shall be ignored by the HWRM client.
64711 	 * # If this field is set to neither 0x0000 nor 0xFFFF, then the
64712 	 * wol_filter_id is valid and the parameters provided in the
64713 	 * response are based on the wol_type.
64714 	 * # If this field is set to 0xFFFF, then there are no remaining
64715 	 * configured WoL filters to be queried for the queried function
64716 	 * after this response, wol_filter_id is valid and the parameters
64717 	 * provided in the response are based on the wol_type.
64718 	 */
64719 	uint16_t	next_handle;
64720 	/*
64721 	 * This value identifies the filter returned in this
64722 	 * response.
64723 	 */
64724 	uint8_t	wol_filter_id;
64725 	/*
64726 	 * This value identifies the type of WoL filter returned
64727 	 * in this response.
64728 	 */
64729 	uint8_t	wol_type;
64730 	/* Magic Packet */
64731 	#define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_MAGICPKT UINT32_C(0x0)
64732 	/* Bitmap */
64733 	#define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_BMP	UINT32_C(0x1)
64734 	/* Invalid */
64735 	#define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_INVALID  UINT32_C(0xff)
64736 	#define HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_LAST	HWRM_WOL_FILTER_QCFG_OUTPUT_WOL_TYPE_INVALID
64737 	uint32_t	unused_0;
64738 	/*
64739 	 * The MAC address value used by the WoL filter.
64740 	 * Applies to magic packet based WoL.
64741 	 */
64742 	uint8_t	mac_address[6];
64743 	/*
64744 	 * The offset from the beginning of MAC header where
64745 	 * pattern should be matched.
64746 	 * Applies to bitmap WoL.
64747 	 */
64748 	uint16_t	pattern_offset;
64749 	/*
64750 	 * The actual size of the pattern that is being returned.
64751 	 * Applies to bitmap WoL.
64752 	 */
64753 	uint16_t	pattern_size;
64754 	/*
64755 	 * The actual size of the pattern mask that is being returned.
64756 	 * Applies to bitmap WoL.
64757 	 */
64758 	uint16_t	pattern_mask_size;
64759 	uint8_t	unused_1[3];
64760 	/*
64761 	 * This field is used in Output records to indicate that the output
64762 	 * is completely written to RAM. This field should be read as '1'
64763 	 * to indicate that the output has been completely written. When
64764 	 * writing a command completion or response to an internal processor,
64765 	 * the order of writes has to be such that this field is written last.
64766 	 */
64767 	uint8_t	valid;
64768 } hwrm_wol_filter_qcfg_output_t, *phwrm_wol_filter_qcfg_output_t;
64769 
64770 /************************
64771  * hwrm_wol_reason_qcfg *
64772  ************************/
64773 
64774 
64775 /* hwrm_wol_reason_qcfg_input (size:320b/40B) */
64776 
64777 typedef struct hwrm_wol_reason_qcfg_input {
64778 	/* The HWRM command request type. */
64779 	uint16_t	req_type;
64780 	/*
64781 	 * The completion ring to send the completion event on. This should
64782 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
64783 	 */
64784 	uint16_t	cmpl_ring;
64785 	/*
64786 	 * The sequence ID is used by the driver for tracking multiple
64787 	 * commands. This ID is treated as opaque data by the firmware and
64788 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
64789 	 */
64790 	uint16_t	seq_id;
64791 	/*
64792 	 * The target ID of the command:
64793 	 * * 0x0-0xFFF8 - The function ID
64794 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
64795 	 * * 0xFFFD - Reserved for user-space HWRM interface
64796 	 * * 0xFFFF - HWRM
64797 	 */
64798 	uint16_t	target_id;
64799 	/*
64800 	 * A physical address pointer pointing to a host buffer that the
64801 	 * command's response data will be written. This can be either a host
64802 	 * physical address (HPA) or a guest physical address (GPA) and must
64803 	 * point to a physically contiguous block of memory.
64804 	 */
64805 	uint64_t	resp_addr;
64806 	/* Port ID of port for which this query is for. */
64807 	uint16_t	port_id;
64808 	uint8_t	unused_0[6];
64809 	/*
64810 	 * Physical address of the packet buffer for querying
64811 	 * WoL packet.
64812 	 */
64813 	uint64_t	wol_pkt_buf_addr;
64814 	/* The size of the buffer for the WoL packet. */
64815 	uint16_t	wol_pkt_buf_size;
64816 	uint8_t	unused_1[6];
64817 } hwrm_wol_reason_qcfg_input_t, *phwrm_wol_reason_qcfg_input_t;
64818 
64819 /* hwrm_wol_reason_qcfg_output (size:128b/16B) */
64820 
64821 typedef struct hwrm_wol_reason_qcfg_output {
64822 	/* The specific error status for the command. */
64823 	uint16_t	error_code;
64824 	/* The HWRM command request type. */
64825 	uint16_t	req_type;
64826 	/* The sequence ID from the original command. */
64827 	uint16_t	seq_id;
64828 	/* The length of the response data in number of bytes. */
64829 	uint16_t	resp_len;
64830 	/*
64831 	 * This value identifies the filter that matched
64832 	 * the last WoL packet.
64833 	 * This id is only valid with valid WoL reason.
64834 	 */
64835 	uint8_t	wol_filter_id;
64836 	/*
64837 	 * This value identifies the type of WoL reason returned
64838 	 * in this response.
64839 	 * When the wol_type is set to invalid, then there is
64840 	 * no WoL event that happened during last system
64841 	 * wake-up.
64842 	 */
64843 	uint8_t	wol_reason;
64844 	/* Magic Packet */
64845 	#define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_MAGICPKT UINT32_C(0x0)
64846 	/* Bitmap */
64847 	#define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_BMP	UINT32_C(0x1)
64848 	/* Invalid */
64849 	#define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_INVALID  UINT32_C(0xff)
64850 	#define HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_LAST	HWRM_WOL_REASON_QCFG_OUTPUT_WOL_REASON_INVALID
64851 	/* The value identifies the length of the WoL packet in bytes. */
64852 	uint8_t	wol_pkt_len;
64853 	uint8_t	unused_0[4];
64854 	/*
64855 	 * This field is used in Output records to indicate that the output
64856 	 * is completely written to RAM. This field should be read as '1'
64857 	 * to indicate that the output has been completely written. When
64858 	 * writing a command completion or response to an internal processor,
64859 	 * the order of writes has to be such that this field is written last.
64860 	 */
64861 	uint8_t	valid;
64862 } hwrm_wol_reason_qcfg_output_t, *phwrm_wol_reason_qcfg_output_t;
64863 
64864 /************************
64865  * hwrm_dbg_read_direct *
64866  ************************/
64867 
64868 
64869 /* hwrm_dbg_read_direct_input (size:256b/32B) */
64870 
64871 typedef struct hwrm_dbg_read_direct_input {
64872 	/* The HWRM command request type. */
64873 	uint16_t	req_type;
64874 	/*
64875 	 * The completion ring to send the completion event on. This should
64876 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
64877 	 */
64878 	uint16_t	cmpl_ring;
64879 	/*
64880 	 * The sequence ID is used by the driver for tracking multiple
64881 	 * commands. This ID is treated as opaque data by the firmware and
64882 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
64883 	 */
64884 	uint16_t	seq_id;
64885 	/*
64886 	 * The target ID of the command:
64887 	 * * 0x0-0xFFF8 - The function ID
64888 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
64889 	 * * 0xFFFD - Reserved for user-space HWRM interface
64890 	 * * 0xFFFF - HWRM
64891 	 */
64892 	uint16_t	target_id;
64893 	/*
64894 	 * A physical address pointer pointing to a host buffer that the
64895 	 * command's response data will be written. This can be either a host
64896 	 * physical address (HPA) or a guest physical address (GPA) and must
64897 	 * point to a physically contiguous block of memory.
64898 	 */
64899 	uint64_t	resp_addr;
64900 	/*
64901 	 * host address where the data content will be written
64902 	 * when the request is complete. This area must be 16B aligned.
64903 	 */
64904 	uint64_t	host_dest_addr;
64905 	/* address(in ChiMP view) to start reading */
64906 	uint32_t	read_addr;
64907 	/* number of dwords to read */
64908 	uint32_t	read_len32;
64909 } hwrm_dbg_read_direct_input_t, *phwrm_dbg_read_direct_input_t;
64910 
64911 /* hwrm_dbg_read_direct_output (size:128b/16B) */
64912 
64913 typedef struct hwrm_dbg_read_direct_output {
64914 	/* The specific error status for the command. */
64915 	uint16_t	error_code;
64916 	/* The HWRM command request type. */
64917 	uint16_t	req_type;
64918 	/* The sequence ID from the original command. */
64919 	uint16_t	seq_id;
64920 	/* The length of the response data in number of bytes. */
64921 	uint16_t	resp_len;
64922 	/*
64923 	 * This field, if not zero, contains the IEEE 802.3 CRC-32 checksum of
64924 	 * the number of dwords read in this request using this polynomial:
64925 	 * x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1
64926 	 */
64927 	uint32_t	crc32;
64928 	uint8_t	unused_0[3];
64929 	/*
64930 	 * This field is used in Output records to indicate that the output
64931 	 * is completely written to RAM. This field should be read as '1'
64932 	 * to indicate that the output has been completely written. When
64933 	 * writing a command completion or response to an internal processor,
64934 	 * the order of writes has to be such that this field is written last.
64935 	 */
64936 	uint8_t	valid;
64937 } hwrm_dbg_read_direct_output_t, *phwrm_dbg_read_direct_output_t;
64938 
64939 /*************************
64940  * hwrm_dbg_write_direct *
64941  *************************/
64942 
64943 
64944 /* hwrm_dbg_write_direct_input (size:448b/56B) */
64945 
64946 typedef struct hwrm_dbg_write_direct_input {
64947 	/* The HWRM command request type. */
64948 	uint16_t	req_type;
64949 	/*
64950 	 * The completion ring to send the completion event on. This should
64951 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
64952 	 */
64953 	uint16_t	cmpl_ring;
64954 	/*
64955 	 * The sequence ID is used by the driver for tracking multiple
64956 	 * commands. This ID is treated as opaque data by the firmware and
64957 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
64958 	 */
64959 	uint16_t	seq_id;
64960 	/*
64961 	 * The target ID of the command:
64962 	 * * 0x0-0xFFF8 - The function ID
64963 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
64964 	 * * 0xFFFD - Reserved for user-space HWRM interface
64965 	 * * 0xFFFF - HWRM
64966 	 */
64967 	uint16_t	target_id;
64968 	/*
64969 	 * A physical address pointer pointing to a host buffer that the
64970 	 * command's response data will be written. This can be either a host
64971 	 * physical address (HPA) or a guest physical address (GPA) and must
64972 	 * point to a physically contiguous block of memory.
64973 	 */
64974 	uint64_t	resp_addr;
64975 	/* address(in ChiMP view) to start writing */
64976 	uint32_t	write_addr;
64977 	/* number of dwords to write (up to 8 dwords) */
64978 	uint32_t	write_len32;
64979 	/* write data (up to 8 dwords) */
64980 	uint32_t	write_data[8];
64981 } hwrm_dbg_write_direct_input_t, *phwrm_dbg_write_direct_input_t;
64982 
64983 /* hwrm_dbg_write_direct_output (size:128b/16B) */
64984 
64985 typedef struct hwrm_dbg_write_direct_output {
64986 	/* The specific error status for the command. */
64987 	uint16_t	error_code;
64988 	/* The HWRM command request type. */
64989 	uint16_t	req_type;
64990 	/* The sequence ID from the original command. */
64991 	uint16_t	seq_id;
64992 	/* The length of the response data in number of bytes. */
64993 	uint16_t	resp_len;
64994 	uint8_t	unused_0[7];
64995 	/*
64996 	 * This field is used in Output records to indicate that the output
64997 	 * is completely written to RAM. This field should be read as '1'
64998 	 * to indicate that the output has been completely written. When
64999 	 * writing a command completion or response to an internal processor,
65000 	 * the order of writes has to be such that this field is written last.
65001 	 */
65002 	uint8_t	valid;
65003 } hwrm_dbg_write_direct_output_t, *phwrm_dbg_write_direct_output_t;
65004 
65005 /**************************
65006  * hwrm_dbg_read_indirect *
65007  **************************/
65008 
65009 
65010 /* hwrm_dbg_read_indirect_input (size:640b/80B) */
65011 
65012 typedef struct hwrm_dbg_read_indirect_input {
65013 	/* The HWRM command request type. */
65014 	uint16_t	req_type;
65015 	/*
65016 	 * The completion ring to send the completion event on. This should
65017 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
65018 	 */
65019 	uint16_t	cmpl_ring;
65020 	/*
65021 	 * The sequence ID is used by the driver for tracking multiple
65022 	 * commands. This ID is treated as opaque data by the firmware and
65023 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
65024 	 */
65025 	uint16_t	seq_id;
65026 	/*
65027 	 * The target ID of the command:
65028 	 * * 0x0-0xFFF8 - The function ID
65029 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
65030 	 * * 0xFFFD - Reserved for user-space HWRM interface
65031 	 * * 0xFFFF - HWRM
65032 	 */
65033 	uint16_t	target_id;
65034 	/*
65035 	 * A physical address pointer pointing to a host buffer that the
65036 	 * command's response data will be written. This can be either a host
65037 	 * physical address (HPA) or a guest physical address (GPA) and must
65038 	 * point to a physically contiguous block of memory.
65039 	 */
65040 	uint64_t	resp_addr;
65041 	/*
65042 	 * host address where the data content will be written
65043 	 * when the request is complete. This area must be 16B aligned.
65044 	 */
65045 	uint64_t	host_dest_addr;
65046 	/* Length of host buffer used for transferring debug data. */
65047 	uint32_t	host_dest_addr_len;
65048 	/* Indirect access type to on-chip data structures. */
65049 	uint8_t	indirect_access_type;
65050 	/* L2 Mgmt filters in Transmit Engine (TE) */
65051 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_TE_MGMT_FILTERS_L2	UINT32_C(0x0)
65052 	/* L3/L4 Mgmt filters in Transmit Engine (TE) */
65053 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_TE_MGMT_FILTERS_L3L4	UINT32_C(0x1)
65054 	/* L2 Mgmt filters in Receive Engine (RE) */
65055 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_RE_MGMT_FILTERS_L2	UINT32_C(0x2)
65056 	/* L3/L4 Mgmt filters in Receive Engine (RE) */
65057 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_RE_MGMT_FILTERS_L3L4	UINT32_C(0x3)
65058 	/* Statistics contexts */
65059 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_STAT_CTXS		UINT32_C(0x4)
65060 	/* TX L2 TCAM */
65061 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_L2_TCAM		UINT32_C(0x5)
65062 	/* RX L2 TCAM */
65063 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_L2_TCAM		UINT32_C(0x6)
65064 	/* TX IPv6 subnet TCAM */
65065 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_IPV6_SUBNET_TCAM	UINT32_C(0x7)
65066 	/* RX IPv6 subnet TCAM */
65067 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_IPV6_SUBNET_TCAM	UINT32_C(0x8)
65068 	/* TX source properties TCAM */
65069 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_SRC_PROPERTIES_TCAM UINT32_C(0x9)
65070 	/* RX source properties TCAM */
65071 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_SRC_PROPERTIES_TCAM UINT32_C(0xa)
65072 	/* VEB Lookup TCAM */
65073 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_VEB_LOOKUP_TCAM	UINT32_C(0xb)
65074 	/* TX Profile Lookup TCAM */
65075 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_PROFILE_LOOKUP_TCAM UINT32_C(0xc)
65076 	/* RX Profile Lookup TCAM */
65077 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_PROFILE_LOOKUP_TCAM UINT32_C(0xd)
65078 	/* TX Lookup TCAM */
65079 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_LOOKUP_TCAM	UINT32_C(0xe)
65080 	/* RX Lookup TCAM */
65081 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_LOOKUP_TCAM	UINT32_C(0xf)
65082 	/* MHB registers (valid for multi-host environment) */
65083 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_MHB			UINT32_C(0x10)
65084 	/* PCIE global registers (valid for multi-host environment) */
65085 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_PCIE_GBL		UINT32_C(0x11)
65086 	/* SOC registers (valid for multi-host environment) */
65087 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_MULTI_HOST_SOC		UINT32_C(0x12)
65088 	/* PCIE private registers */
65089 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_PCIE_PRIVATE		UINT32_C(0x13)
65090 	/* Host DMA read */
65091 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_HOST_DMA		UINT32_C(0x14)
65092 	/*
65093 	 * Elog (valid for only smartNIC only)
65094 	 * Three sub-types will be supported which will be specified
65095 	 * in the opaque[0] field.
65096 	 * 1) sub-type CHECK(0) if ELOG is available in media.
65097 	 * 2) sub-type READ(1) a portion of the elog.
65098 	 * 3) sub-type ERASE(2) a portion of the elog.
65099 	 *	> opaque[1] Erase offset.
65100 	 *	> opaque[2] Erase size.
65101 	 */
65102 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_SOC_ELOG		UINT32_C(0x15)
65103 	/* Context operation */
65104 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CTX			UINT32_C(0x16)
65105 	/* Port Stats */
65106 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_STATS			UINT32_C(0x17)
65107 	#define HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_LAST			HWRM_DBG_READ_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_STATS
65108 	uint8_t	unused_0[3];
65109 	/* Entry number to start reading */
65110 	uint32_t	start_index;
65111 	/* Total number of entries to read */
65112 	uint32_t	num_of_entries;
65113 	/*
65114 	 * command dependent data (e.g. function id for host dma command or
65115 	 * sub-code, erase offset and erase size for soc_elog)
65116 	 */
65117 	uint32_t	opaque[10];
65118 } hwrm_dbg_read_indirect_input_t, *phwrm_dbg_read_indirect_input_t;
65119 
65120 /* hwrm_dbg_read_indirect_output (size:128b/16B) */
65121 
65122 typedef struct hwrm_dbg_read_indirect_output {
65123 	/* The specific error status for the command. */
65124 	uint16_t	error_code;
65125 	/* The HWRM command request type. */
65126 	uint16_t	req_type;
65127 	/* The sequence ID from the original command. */
65128 	uint16_t	seq_id;
65129 	/* The length of the response data in number of bytes. */
65130 	uint16_t	resp_len;
65131 	uint8_t	unused_0[7];
65132 	/*
65133 	 * This field is used in Output records to indicate that the output
65134 	 * is completely written to RAM. This field should be read as '1'
65135 	 * to indicate that the output has been completely written. When
65136 	 * writing a command completion or response to an internal processor,
65137 	 * the order of writes has to be such that this field is written last.
65138 	 */
65139 	uint8_t	valid;
65140 } hwrm_dbg_read_indirect_output_t, *phwrm_dbg_read_indirect_output_t;
65141 
65142 /***************************
65143  * hwrm_dbg_write_indirect *
65144  ***************************/
65145 
65146 
65147 /* hwrm_dbg_write_indirect_input (size:832b/104B) */
65148 
65149 typedef struct hwrm_dbg_write_indirect_input {
65150 	/* The HWRM command request type. */
65151 	uint16_t	req_type;
65152 	/*
65153 	 * The completion ring to send the completion event on. This should
65154 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
65155 	 */
65156 	uint16_t	cmpl_ring;
65157 	/*
65158 	 * The sequence ID is used by the driver for tracking multiple
65159 	 * commands. This ID is treated as opaque data by the firmware and
65160 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
65161 	 */
65162 	uint16_t	seq_id;
65163 	/*
65164 	 * The target ID of the command:
65165 	 * * 0x0-0xFFF8 - The function ID
65166 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
65167 	 * * 0xFFFD - Reserved for user-space HWRM interface
65168 	 * * 0xFFFF - HWRM
65169 	 */
65170 	uint16_t	target_id;
65171 	/*
65172 	 * A physical address pointer pointing to a host buffer that the
65173 	 * command's response data will be written. This can be either a host
65174 	 * physical address (HPA) or a guest physical address (GPA) and must
65175 	 * point to a physically contiguous block of memory.
65176 	 */
65177 	uint64_t	resp_addr;
65178 	/* Indirect access type to on-chip data structures. */
65179 	uint8_t	indirect_access_type;
65180 	/* L2 Mgmt filters in Transmit Engine (TE) */
65181 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_TE_MGMT_FILTERS_L2	UINT32_C(0x0)
65182 	/* L3/L4 Mgmt filters in Transmit Engine (TE) */
65183 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_TE_MGMT_FILTERS_L3L4	UINT32_C(0x1)
65184 	/* L2 Mgmt filters in Receive Engine (RE) */
65185 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_RE_MGMT_FILTERS_L2	UINT32_C(0x2)
65186 	/* L3/L4 Mgmt filters in Receive Engine (RE) */
65187 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_RE_MGMT_FILTERS_L3L4	UINT32_C(0x3)
65188 	/* Statistics contexts */
65189 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_STAT_CTXS		UINT32_C(0x4)
65190 	/* TX L2 TCAM */
65191 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_L2_TCAM		UINT32_C(0x5)
65192 	/* RX L2 TCAM */
65193 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_L2_TCAM		UINT32_C(0x6)
65194 	/* TX IPv6 subnet TCAM */
65195 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_IPV6_SUBNET_TCAM	UINT32_C(0x7)
65196 	/* RX IPv6 subnet TCAM */
65197 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_IPV6_SUBNET_TCAM	UINT32_C(0x8)
65198 	/* TX source properties TCAM */
65199 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_SRC_PROPERTIES_TCAM UINT32_C(0x9)
65200 	/* RX source properties TCAM */
65201 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_SRC_PROPERTIES_TCAM UINT32_C(0xa)
65202 	/* VEB Lookup TCAM */
65203 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_VEB_LOOKUP_TCAM	UINT32_C(0xb)
65204 	/* TX Profile Lookup TCAM */
65205 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_PROFILE_LOOKUP_TCAM UINT32_C(0xc)
65206 	/* RX Profile Lookup TCAM */
65207 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_PROFILE_LOOKUP_TCAM UINT32_C(0xd)
65208 	/* TX Lookup TCAM */
65209 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_TX_LOOKUP_TCAM	UINT32_C(0xe)
65210 	/* RX Lookup TCAM */
65211 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CFA_RX_LOOKUP_TCAM	UINT32_C(0xf)
65212 	/* MHB registers (valid for multi-host environment) */
65213 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_MHB			UINT32_C(0x10)
65214 	/* PCIE global registers (valid for multi-host environment) */
65215 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_PCIE_GBL		UINT32_C(0x11)
65216 	/* SOC registers (valid for multi-host environment) */
65217 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_MULTI_HOST_SOC		UINT32_C(0x12)
65218 	/* PCIE private registers */
65219 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_PCIE_PRIVATE		UINT32_C(0x13)
65220 	/* Host DMA write */
65221 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_HOST_DMA		UINT32_C(0x14)
65222 	/* Invalid */
65223 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_SOC_ELOG		UINT32_C(0x15)
65224 	/* Context operation */
65225 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_CTX			UINT32_C(0x16)
65226 	/* Port Stats */
65227 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_STATS			UINT32_C(0x17)
65228 	#define HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_LAST			HWRM_DBG_WRITE_INDIRECT_INPUT_INDIRECT_ACCESS_TYPE_STATS
65229 	uint8_t	unused_0[3];
65230 	/* Entry number to start reading */
65231 	uint32_t	start_index;
65232 	/* Total number of entries to read */
65233 	uint32_t	num_of_entries;
65234 	uint8_t	unused_1[4];
65235 	/* write data (up to 8 dwords) */
65236 	uint32_t	write_data[8];
65237 	/* command dependent data (e.g. function id for host dma command) */
65238 	uint32_t	opaque[10];
65239 } hwrm_dbg_write_indirect_input_t, *phwrm_dbg_write_indirect_input_t;
65240 
65241 /* hwrm_dbg_write_indirect_output (size:128b/16B) */
65242 
65243 typedef struct hwrm_dbg_write_indirect_output {
65244 	/* The specific error status for the command. */
65245 	uint16_t	error_code;
65246 	/* The HWRM command request type. */
65247 	uint16_t	req_type;
65248 	/* The sequence ID from the original command. */
65249 	uint16_t	seq_id;
65250 	/* The length of the response data in number of bytes. */
65251 	uint16_t	resp_len;
65252 	uint8_t	unused_0[7];
65253 	/*
65254 	 * This field is used in Output records to indicate that the output
65255 	 * is completely written to RAM. This field should be read as '1'
65256 	 * to indicate that the output has been completely written. When
65257 	 * writing a command completion or response to an internal processor,
65258 	 * the order of writes has to be such that this field is written last.
65259 	 */
65260 	uint8_t	valid;
65261 } hwrm_dbg_write_indirect_output_t, *phwrm_dbg_write_indirect_output_t;
65262 
65263 /*****************
65264  * hwrm_dbg_dump *
65265  *****************/
65266 
65267 
65268 /* hwrm_dbg_dump_input (size:320b/40B) */
65269 
65270 typedef struct hwrm_dbg_dump_input {
65271 	/* The HWRM command request type. */
65272 	uint16_t	req_type;
65273 	/*
65274 	 * The completion ring to send the completion event on. This should
65275 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
65276 	 */
65277 	uint16_t	cmpl_ring;
65278 	/*
65279 	 * The sequence ID is used by the driver for tracking multiple
65280 	 * commands. This ID is treated as opaque data by the firmware and
65281 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
65282 	 */
65283 	uint16_t	seq_id;
65284 	/*
65285 	 * The target ID of the command:
65286 	 * * 0x0-0xFFF8 - The function ID
65287 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
65288 	 * * 0xFFFD - Reserved for user-space HWRM interface
65289 	 * * 0xFFFF - HWRM
65290 	 */
65291 	uint16_t	target_id;
65292 	/*
65293 	 * A physical address pointer pointing to a host buffer that the
65294 	 * command's response data will be written. This can be either a host
65295 	 * physical address (HPA) or a guest physical address (GPA) and must
65296 	 * point to a physically contiguous block of memory.
65297 	 */
65298 	uint64_t	resp_addr;
65299 	/*
65300 	 * Handle used to dump debug data.
65301 	 * handle = 0 indicates the beginning of the dump.
65302 	 * handle != 0 indicates the request to dump the next part.
65303 	 */
65304 	uint32_t	handle;
65305 	uint8_t	unused_0[4];
65306 	/*
65307 	 * Address of the host buffer where the debug data is
65308 	 * requested to be dumped.
65309 	 */
65310 	uint64_t	host_dbg_dump_addr;
65311 	/* Length of host buffer used for transferring debug data. */
65312 	uint64_t	host_dbg_dump_addr_len;
65313 } hwrm_dbg_dump_input_t, *phwrm_dbg_dump_input_t;
65314 
65315 /* hwrm_dbg_dump_output (size:192b/24B) */
65316 
65317 typedef struct hwrm_dbg_dump_output {
65318 	/* The specific error status for the command. */
65319 	uint16_t	error_code;
65320 	/* The HWRM command request type. */
65321 	uint16_t	req_type;
65322 	/* The sequence ID from the original command. */
65323 	uint16_t	seq_id;
65324 	/* The length of the response data in number of bytes. */
65325 	uint16_t	resp_len;
65326 	/*
65327 	 * Handle used to indicate availability of additional
65328 	 * debug data.
65329 	 * nexthandle = 0 indicates that there is no more debug data
65330 	 * available.
65331 	 * nexthandle != 0 indicates the handle value that should be used
65332 	 * to request the next part of debug data.
65333 	 */
65334 	uint32_t	nexthandle;
65335 	/*
65336 	 * The number of bytes of debug data written to debug dump
65337 	 * buffer.
65338 	 */
65339 	uint32_t	dbg_data_len;
65340 	uint8_t	unused_0[7];
65341 	/*
65342 	 * This field is used in Output records to indicate that the output
65343 	 * is completely written to RAM. This field should be read as '1'
65344 	 * to indicate that the output has been completely written. When
65345 	 * writing a command completion or response to an internal processor,
65346 	 * the order of writes has to be such that this field is written last.
65347 	 */
65348 	uint8_t	valid;
65349 } hwrm_dbg_dump_output_t, *phwrm_dbg_dump_output_t;
65350 
65351 /**********************
65352  * hwrm_dbg_erase_nvm *
65353  **********************/
65354 
65355 
65356 /* hwrm_dbg_erase_nvm_input (size:192b/24B) */
65357 
65358 typedef struct hwrm_dbg_erase_nvm_input {
65359 	/* The HWRM command request type. */
65360 	uint16_t	req_type;
65361 	/*
65362 	 * The completion ring to send the completion event on. This should
65363 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
65364 	 */
65365 	uint16_t	cmpl_ring;
65366 	/*
65367 	 * The sequence ID is used by the driver for tracking multiple
65368 	 * commands. This ID is treated as opaque data by the firmware and
65369 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
65370 	 */
65371 	uint16_t	seq_id;
65372 	/*
65373 	 * The target ID of the command:
65374 	 * * 0x0-0xFFF8 - The function ID
65375 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
65376 	 * * 0xFFFD - Reserved for user-space HWRM interface
65377 	 * * 0xFFFF - HWRM
65378 	 */
65379 	uint16_t	target_id;
65380 	/*
65381 	 * A physical address pointer pointing to a host buffer that the
65382 	 * command's response data will be written. This can be either a host
65383 	 * physical address (HPA) or a guest physical address (GPA) and must
65384 	 * point to a physically contiguous block of memory.
65385 	 */
65386 	uint64_t	resp_addr;
65387 	uint16_t	flags;
65388 	/* If set to 1, then erase all locations in persistent storage. */
65389 	#define HWRM_DBG_ERASE_NVM_INPUT_FLAGS_ERASE_ALL		UINT32_C(0x1)
65390 	/*
65391 	 * This bit is only used when external secure SoC is used for
65392 	 * Secure boot. This bit is utilized to differentiate between
65393 	 * erase for NIC or Security SoC non-volatile storage on the
65394 	 * device. If this bit is set, then erases all locations in the
65395 	 * persistent storage of the secure SoC non-volatile storage device.
65396 	 */
65397 	#define HWRM_DBG_ERASE_NVM_INPUT_FLAGS_SECURITY_SOC_NVM	UINT32_C(0x2)
65398 	uint8_t	unused_0[6];
65399 } hwrm_dbg_erase_nvm_input_t, *phwrm_dbg_erase_nvm_input_t;
65400 
65401 /* hwrm_dbg_erase_nvm_output (size:128b/16B) */
65402 
65403 typedef struct hwrm_dbg_erase_nvm_output {
65404 	/* The specific error status for the command. */
65405 	uint16_t	error_code;
65406 	/* The HWRM command request type. */
65407 	uint16_t	req_type;
65408 	/* The sequence ID from the original command. */
65409 	uint16_t	seq_id;
65410 	/* The length of the response data in number of bytes. */
65411 	uint16_t	resp_len;
65412 	uint8_t	unused_0[7];
65413 	/*
65414 	 * This field is used in Output records to indicate that the output
65415 	 * is completely written to RAM. This field should be read as '1'
65416 	 * to indicate that the output has been completely written. When
65417 	 * writing a command completion or response to an internal processor,
65418 	 * the order of writes has to be such that this field is written last.
65419 	 */
65420 	uint8_t	valid;
65421 } hwrm_dbg_erase_nvm_output_t, *phwrm_dbg_erase_nvm_output_t;
65422 
65423 /****************
65424  * hwrm_dbg_cfg *
65425  ****************/
65426 
65427 
65428 /* hwrm_dbg_cfg_input (size:192b/24B) */
65429 
65430 typedef struct hwrm_dbg_cfg_input {
65431 	/* The HWRM command request type. */
65432 	uint16_t	req_type;
65433 	/*
65434 	 * The completion ring to send the completion event on. This should
65435 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
65436 	 */
65437 	uint16_t	cmpl_ring;
65438 	/*
65439 	 * The sequence ID is used by the driver for tracking multiple
65440 	 * commands. This ID is treated as opaque data by the firmware and
65441 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
65442 	 */
65443 	uint16_t	seq_id;
65444 	/*
65445 	 * The target ID of the command:
65446 	 * * 0x0-0xFFF8 - The function ID
65447 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
65448 	 * * 0xFFFD - Reserved for user-space HWRM interface
65449 	 * * 0xFFFF - HWRM
65450 	 */
65451 	uint16_t	target_id;
65452 	/*
65453 	 * A physical address pointer pointing to a host buffer that the
65454 	 * command's response data will be written. This can be either a host
65455 	 * physical address (HPA) or a guest physical address (GPA) and must
65456 	 * point to a physically contiguous block of memory.
65457 	 */
65458 	uint64_t	resp_addr;
65459 	uint32_t	flags;
65460 	/*
65461 	 * If set to 1, then UART logging will be enabled for the primary
65462 	 * firmware. Disabled otherwise.
65463 	 */
65464 	#define HWRM_DBG_CFG_INPUT_FLAGS_UART_LOG		UINT32_C(0x1)
65465 	/*
65466 	 * If set to 1, then UART logging will be enabled for the secondary
65467 	 * firmware. Disabled otherwise. If a single UART is available then
65468 	 * setting this bit will override the uart_log bit.
65469 	 */
65470 	#define HWRM_DBG_CFG_INPUT_FLAGS_UART_LOG_SECONDARY	UINT32_C(0x2)
65471 	/*
65472 	 * If set to 1, then completion ring logging will be enabled for the
65473 	 * primary firmware. Disabled otherwise.
65474 	 */
65475 	#define HWRM_DBG_CFG_INPUT_FLAGS_FW_TRACE		UINT32_C(0x4)
65476 	/*
65477 	 * If set to 1, then completion ring logging will be enabled for the
65478 	 * secondary firmware. Disabled otherwise.
65479 	 */
65480 	#define HWRM_DBG_CFG_INPUT_FLAGS_FW_TRACE_SECONDARY	UINT32_C(0x8)
65481 	/*
65482 	 * If set to 1, firmware will generate debug_notification async
65483 	 * events to the driver as applicable.
65484 	 */
65485 	#define HWRM_DBG_CFG_INPUT_FLAGS_DEBUG_NOTIFY	UINT32_C(0x10)
65486 	/*
65487 	 * If set to 1, firmware is allowed to be unresponsive to heartbeat
65488 	 * health checks, allowing for JTAG debugging scenarios where the
65489 	 * debugger has the firmware processes stopped indefinitely. This
65490 	 * flag has effect only on debug builds of firmware.
65491 	 */
65492 	#define HWRM_DBG_CFG_INPUT_FLAGS_JTAG_DEBUG		UINT32_C(0x20)
65493 	/*
65494 	 * Notification queue (completion ring) used by the firmware to post
65495 	 * async debug notifications and fw trace logs. This field is valid
65496 	 * when fw_trace, fw_trace_secondary or debug_notify flags are set.
65497 	 */
65498 	uint16_t	async_cmpl_ring;
65499 	uint8_t	unused_0[2];
65500 } hwrm_dbg_cfg_input_t, *phwrm_dbg_cfg_input_t;
65501 
65502 /* hwrm_dbg_cfg_output (size:128b/16B) */
65503 
65504 typedef struct hwrm_dbg_cfg_output {
65505 	/* The specific error status for the command. */
65506 	uint16_t	error_code;
65507 	/* The HWRM command request type. */
65508 	uint16_t	req_type;
65509 	/* The sequence ID from the original command. */
65510 	uint16_t	seq_id;
65511 	/* The length of the response data in number of bytes. */
65512 	uint16_t	resp_len;
65513 	uint8_t	unused_0[7];
65514 	/*
65515 	 * This field is used in Output records to indicate that the output
65516 	 * is completely written to RAM. This field should be read as '1'
65517 	 * to indicate that the output has been completely written. When
65518 	 * writing a command completion or response to an internal processor,
65519 	 * the order of writes has to be such that this field is written last.
65520 	 */
65521 	uint8_t	valid;
65522 } hwrm_dbg_cfg_output_t, *phwrm_dbg_cfg_output_t;
65523 
65524 /*****************************
65525  * hwrm_dbg_crashdump_header *
65526  *****************************/
65527 
65528 
65529 /* hwrm_dbg_crashdump_header_input (size:192b/24B) */
65530 
65531 typedef struct hwrm_dbg_crashdump_header_input {
65532 	/* The HWRM command request type. */
65533 	uint16_t	req_type;
65534 	/*
65535 	 * The completion ring to send the completion event on. This should
65536 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
65537 	 */
65538 	uint16_t	cmpl_ring;
65539 	/*
65540 	 * The sequence ID is used by the driver for tracking multiple
65541 	 * commands. This ID is treated as opaque data by the firmware and
65542 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
65543 	 */
65544 	uint16_t	seq_id;
65545 	/*
65546 	 * The target ID of the command:
65547 	 * * 0x0-0xFFF8 - The function ID
65548 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
65549 	 * * 0xFFFD - Reserved for user-space HWRM interface
65550 	 * * 0xFFFF - HWRM
65551 	 */
65552 	uint16_t	target_id;
65553 	/*
65554 	 * A physical address pointer pointing to a host buffer that the
65555 	 * command's response data will be written. This can be either a host
65556 	 * physical address (HPA) or a guest physical address (GPA) and must
65557 	 * point to a physically contiguous block of memory.
65558 	 */
65559 	uint64_t	resp_addr;
65560 	uint64_t	unused_0;
65561 } hwrm_dbg_crashdump_header_input_t, *phwrm_dbg_crashdump_header_input_t;
65562 
65563 /* hwrm_dbg_crashdump_header_output (size:512b/64B) */
65564 
65565 typedef struct hwrm_dbg_crashdump_header_output {
65566 	/* The specific error status for the command. */
65567 	uint16_t	error_code;
65568 	/* The HWRM command request type. */
65569 	uint16_t	req_type;
65570 	/* The sequence ID from the original command. */
65571 	uint16_t	seq_id;
65572 	/* The length of the response data in number of bytes. */
65573 	uint16_t	resp_len;
65574 	/* Major version. */
65575 	uint8_t	version_hi;
65576 	/* Minor version. */
65577 	uint8_t	version_low;
65578 	/*
65579 	 * Header length in bytes. This includes all fields from version
65580 	 * to dev_uid (whose length is specified in dev_uid_length).
65581 	 */
65582 	uint16_t	header_len;
65583 	/* This is the crash dump size in bytes. */
65584 	uint32_t	dump_size;
65585 	/*
65586 	 * This is a "wall clock" timestamp value of when the crash occurred.
65587 	 * Format is of time_t type.
65588 	 */
65589 	uint32_t	crash_time;
65590 	/* This is the timezone information for the crash_time. */
65591 	int8_t	utc_offset;
65592 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_UTC				0
65593 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMSTERDAM			4
65594 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_EGYPT			8
65595 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_EUROPE_MOSCOW		12
65596 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_IRAN			14
65597 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_DUBAI			16
65598 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_KABUL			18
65599 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ANTARCTICA_MAWSON		20
65600 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_COLOMBO		22
65601 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_KATHMANDU		23
65602 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_INDIAN_CHAGOS		24
65603 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_INDIAN_COCOS		26
65604 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_BANGKOK		28
65605 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_HONG_KONG		32
65606 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_PYONGYANG		34
65607 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_EUCLA		35
65608 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ASIA_TOKYO			36
65609 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_ADELAIDE		38
65610 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_BROKEN_HILL	38
65611 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_DARWIN		38
65612 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_SYDNEY		40
65613 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AUSTRALIA_LORD_HOWE		42
65614 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ANTARCTICA_MACQUARIE	44
65615 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ANTARCTICA_SOUTH_POLE	48
65616 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_CHATHAM		51
65617 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_APIA		52
65618 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_KIRITIMATIS		56
65619 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ATLANTIC_CAPE_VERDE		-4
65620 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_ATLANTIC_SOUTH_GEORGIA	-8
65621 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_ARGENTINA_BUENOS_AIRES -12
65622 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_SAO_PAULO		-12
65623 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_NEWFOUNDLAND	-14
65624 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_BARBADOS		-16
65625 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_CANCUN		-20
65626 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_COSTA_RICA		-24
65627 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_AMERICA_PHOENIX		-28
65628 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_US_ARIZONA			-28
65629 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_US_PACIFIC			-32
65630 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_US_ALASKA			-36
65631 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_MARQUESAS		-38
65632 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_HAWAII		-40
65633 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_MIDWAY		-44
65634 	#define HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_LAST			HWRM_DBG_CRASHDUMP_HEADER_OUTPUT_UTC_OFFSET_PACIFIC_MIDWAY
65635 	/*
65636 	 * This field is a counter value of the crash dump available. This
65637 	 * value is incremented monotonically at each crash.
65638 	 */
65639 	uint8_t	crash_cntr;
65640 	/*
65641 	 * This specifies the length of the dev_uid in bytes. The maximum
65642 	 * value is 31.
65643 	 */
65644 	uint16_t	dev_uid_length;
65645 	/*
65646 	 * This is a unique device identifier (e.g. the first port MAC
65647 	 * address for a network controller or a serial number for an
65648 	 * en/decryption device) in ASCII format. It is used to identify
65649 	 * where the crash dump content is coming from. Unused bytes must
65650 	 * have '\0' character.
65651 	 */
65652 	uint8_t	dev_uid[32];
65653 	/*
65654 	 * This is a count value tracking the number of successful boots
65655 	 * before the crash occurred.
65656 	 */
65657 	uint32_t	power_on_count;
65658 	uint8_t	unused_2[3];
65659 	/*
65660 	 * This field is used in Output records to indicate that the output
65661 	 * is completely written to RAM. This field should be read as '1'
65662 	 * to indicate that the output has been completely written. When
65663 	 * writing a command completion or response to an internal processor,
65664 	 * the order of writes has to be such that this field is written last.
65665 	 */
65666 	uint8_t	valid;
65667 } hwrm_dbg_crashdump_header_output_t, *phwrm_dbg_crashdump_header_output_t;
65668 
65669 /****************************
65670  * hwrm_dbg_crashdump_erase *
65671  ****************************/
65672 
65673 
65674 /* hwrm_dbg_crashdump_erase_input (size:192b/24B) */
65675 
65676 typedef struct hwrm_dbg_crashdump_erase_input {
65677 	/* The HWRM command request type. */
65678 	uint16_t	req_type;
65679 	/*
65680 	 * The completion ring to send the completion event on. This should
65681 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
65682 	 */
65683 	uint16_t	cmpl_ring;
65684 	/*
65685 	 * The sequence ID is used by the driver for tracking multiple
65686 	 * commands. This ID is treated as opaque data by the firmware and
65687 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
65688 	 */
65689 	uint16_t	seq_id;
65690 	/*
65691 	 * The target ID of the command:
65692 	 * * 0x0-0xFFF8 - The function ID
65693 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
65694 	 * * 0xFFFD - Reserved for user-space HWRM interface
65695 	 * * 0xFFFF - HWRM
65696 	 */
65697 	uint16_t	target_id;
65698 	/*
65699 	 * A physical address pointer pointing to a host buffer that the
65700 	 * command's response data will be written. This can be either a host
65701 	 * physical address (HPA) or a guest physical address (GPA) and must
65702 	 * point to a physically contiguous block of memory.
65703 	 */
65704 	uint64_t	resp_addr;
65705 	/* The scope of the erase */
65706 	uint8_t	scope;
65707 	/*
65708 	 * Wipe all crashdump data blocks, making them available for
65709 	 * the next crash(es). This is the typical value to be used.
65710 	 */
65711 	#define HWRM_DBG_CRASHDUMP_ERASE_INPUT_SCOPE_INVALIDATE UINT32_C(0x0)
65712 	/*
65713 	 * Experimental: Remove all data blocks from the directory
65714 	 * (without erasing any existing contents), re-allocate and
65715 	 * re-initialize new ones. In case where the crash dump feature
65716 	 * stops functioning, this can be used to restore it back to the
65717 	 * clean slate.
65718 	 */
65719 	#define HWRM_DBG_CRASHDUMP_ERASE_INPUT_SCOPE_REINIT	UINT32_C(0x1)
65720 	#define HWRM_DBG_CRASHDUMP_ERASE_INPUT_SCOPE_LAST	HWRM_DBG_CRASHDUMP_ERASE_INPUT_SCOPE_REINIT
65721 	uint8_t	unused_0[3];
65722 	uint32_t	unused_1;
65723 } hwrm_dbg_crashdump_erase_input_t, *phwrm_dbg_crashdump_erase_input_t;
65724 
65725 /* hwrm_dbg_crashdump_erase_output (size:128b/16B) */
65726 
65727 typedef struct hwrm_dbg_crashdump_erase_output {
65728 	/* The specific error status for the command. */
65729 	uint16_t	error_code;
65730 	/* The HWRM command request type. */
65731 	uint16_t	req_type;
65732 	/* The sequence ID from the original command. */
65733 	uint16_t	seq_id;
65734 	/* The length of the response data in number of bytes. */
65735 	uint16_t	resp_len;
65736 	uint8_t	unused_1[7];
65737 	/*
65738 	 * This field is used in Output records to indicate that the output
65739 	 * is completely written to RAM. This field should be read as '1'
65740 	 * to indicate that the output has been completely written. When
65741 	 * writing a command completion or response to an internal processor,
65742 	 * the order of writes has to be such that this field is written last.
65743 	 */
65744 	uint8_t	valid;
65745 } hwrm_dbg_crashdump_erase_output_t, *phwrm_dbg_crashdump_erase_output_t;
65746 
65747 /******************
65748  * hwrm_dbg_qcaps *
65749  ******************/
65750 
65751 
65752 /* hwrm_dbg_qcaps_input (size:192b/24B) */
65753 
65754 typedef struct hwrm_dbg_qcaps_input {
65755 	/* The HWRM command request type. */
65756 	uint16_t	req_type;
65757 	/*
65758 	 * The completion ring to send the completion event on. This should
65759 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
65760 	 */
65761 	uint16_t	cmpl_ring;
65762 	/*
65763 	 * The sequence ID is used by the driver for tracking multiple
65764 	 * commands. This ID is treated as opaque data by the firmware and
65765 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
65766 	 */
65767 	uint16_t	seq_id;
65768 	/*
65769 	 * The target ID of the command:
65770 	 * * 0x0-0xFFF8 - The function ID
65771 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
65772 	 * * 0xFFFD - Reserved for user-space HWRM interface
65773 	 * * 0xFFFF - HWRM
65774 	 */
65775 	uint16_t	target_id;
65776 	/*
65777 	 * A physical address pointer pointing to a host buffer that the
65778 	 * command's response data will be written. This can be either a host
65779 	 * physical address (HPA) or a guest physical address (GPA) and must
65780 	 * point to a physically contiguous block of memory.
65781 	 */
65782 	uint64_t	resp_addr;
65783 	/*
65784 	 * Function ID of the function that is being queried.
65785 	 * 0xFF... (All Fs) if the query is for the requesting
65786 	 * function.
65787 	 */
65788 	uint16_t	fid;
65789 	uint8_t	unused_0[6];
65790 } hwrm_dbg_qcaps_input_t, *phwrm_dbg_qcaps_input_t;
65791 
65792 /* hwrm_dbg_qcaps_output (size:192b/24B) */
65793 
65794 typedef struct hwrm_dbg_qcaps_output {
65795 	/* The specific error status for the command. */
65796 	uint16_t	error_code;
65797 	/* The HWRM command request type. */
65798 	uint16_t	req_type;
65799 	/* The sequence ID from the original command. */
65800 	uint16_t	seq_id;
65801 	/* The length of the response data in number of bytes. */
65802 	uint16_t	resp_len;
65803 	/*
65804 	 * FID value. This value is used to identify operations on the PCI
65805 	 * bus as belonging to a particular PCI function.
65806 	 */
65807 	uint16_t	fid;
65808 	uint8_t	unused_0[2];
65809 	/*
65810 	 * Bitwise field of components FW supports skipping during collection
65811 	 * of coredump as part of a crash collection.
65812 	 */
65813 	uint32_t	coredump_component_disable_caps;
65814 	/*
65815 	 * If 1, FW supports disabling the collection of NVM during a
65816 	 * coredump taken as part of crash collection.
65817 	 */
65818 	#define HWRM_DBG_QCAPS_OUTPUT_COREDUMP_COMPONENT_DISABLE_CAPS_NVRAM	UINT32_C(0x1)
65819 	uint32_t	flags;
65820 	/* If 1, FW supports writing a crashdump to NVM. */
65821 	#define HWRM_DBG_QCAPS_OUTPUT_FLAGS_CRASHDUMP_NVM		UINT32_C(0x1)
65822 	/* If 1, FW supports writing a crashdump to host ddr. */
65823 	#define HWRM_DBG_QCAPS_OUTPUT_FLAGS_CRASHDUMP_HOST_DDR	UINT32_C(0x2)
65824 	/* If 1, FW supports writing a crashdump to soc ddr. */
65825 	#define HWRM_DBG_QCAPS_OUTPUT_FLAGS_CRASHDUMP_SOC_DDR	UINT32_C(0x4)
65826 	/* If 1, FW supports USEQ operations */
65827 	#define HWRM_DBG_QCAPS_OUTPUT_FLAGS_USEQ			UINT32_C(0x8)
65828 	/*
65829 	 * If 1, FW supports writing a coredump to host ddr.
65830 	 * The driver instance can allocate the Host memory to
65831 	 * capture coredump.
65832 	 */
65833 	#define HWRM_DBG_QCAPS_OUTPUT_FLAGS_COREDUMP_HOST_DDR	UINT32_C(0x10)
65834 	/*
65835 	 * If 1, FW supports HWRM_DBG_COREDUMP_CAPTURE command to collect the
65836 	 * coredump into the Host memory address. The driver instance can
65837 	 * invoke the command to collect coredump upon any fatal event.
65838 	 * Tx timeout is an example scenario.
65839 	 */
65840 	#define HWRM_DBG_QCAPS_OUTPUT_FLAGS_COREDUMP_HOST_CAPTURE	UINT32_C(0x20)
65841 	/*
65842 	 * If 1, FW supports the PTrace capability.PTrace(PEX Trace Capture)
65843 	 * provides a means for capturing and buffering PCIe TLPs, DLLPs and
65844 	 * ordered sets following in both directions through a PEX station.
65845 	 * This capability is advertised only on PF's.
65846 	 */
65847 	#define HWRM_DBG_QCAPS_OUTPUT_FLAGS_PTRACE			UINT32_C(0x40)
65848 	uint8_t	unused_1[3];
65849 	/*
65850 	 * This field is used in Output records to indicate that the output
65851 	 * is completely written to RAM. This field should be read as '1'
65852 	 * to indicate that the output has been completely written. When
65853 	 * writing a command completion or response to an internal processor,
65854 	 * the order of writes has to be such that this field is written last.
65855 	 */
65856 	uint8_t	valid;
65857 } hwrm_dbg_qcaps_output_t, *phwrm_dbg_qcaps_output_t;
65858 
65859 /*****************
65860  * hwrm_dbg_qcfg *
65861  *****************/
65862 
65863 
65864 /* hwrm_dbg_qcfg_input (size:192b/24B) */
65865 
65866 typedef struct hwrm_dbg_qcfg_input {
65867 	/* The HWRM command request type. */
65868 	uint16_t	req_type;
65869 	/*
65870 	 * The completion ring to send the completion event on. This should
65871 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
65872 	 */
65873 	uint16_t	cmpl_ring;
65874 	/*
65875 	 * The sequence ID is used by the driver for tracking multiple
65876 	 * commands. This ID is treated as opaque data by the firmware and
65877 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
65878 	 */
65879 	uint16_t	seq_id;
65880 	/*
65881 	 * The target ID of the command:
65882 	 * * 0x0-0xFFF8 - The function ID
65883 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
65884 	 * * 0xFFFD - Reserved for user-space HWRM interface
65885 	 * * 0xFFFF - HWRM
65886 	 */
65887 	uint16_t	target_id;
65888 	/*
65889 	 * A physical address pointer pointing to a host buffer that the
65890 	 * command's response data will be written. This can be either a host
65891 	 * physical address (HPA) or a guest physical address (GPA) and must
65892 	 * point to a physically contiguous block of memory.
65893 	 */
65894 	uint64_t	resp_addr;
65895 	/*
65896 	 * Function ID of the function that is being queried.
65897 	 * 0xFF... (All Fs) if the query is for the requesting
65898 	 * function.
65899 	 */
65900 	uint16_t	fid;
65901 	uint16_t	flags;
65902 	/*
65903 	 * The crashdump size represents size of crashdump
65904 	 * written to the specified destination.
65905 	 */
65906 	#define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_MASK	UINT32_C(0x3)
65907 	#define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_SFT	0
65908 	/* crashdump size written to nvm */
65909 		#define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_NVM	UINT32_C(0x0)
65910 	/* crashdump size written to host_ddr */
65911 		#define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_HOST_DDR  UINT32_C(0x1)
65912 	/* crashdump size written to soc_ddr */
65913 		#define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_SOC_DDR   UINT32_C(0x2)
65914 		#define HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_LAST	HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_SOC_DDR
65915 	/*
65916 	 * Bitwise field of components requested for FW to skip when
65917 	 * calculating the size of a coredump collection.
65918 	 */
65919 	uint32_t	coredump_component_disable_flags;
65920 	/*
65921 	 * If 1, NVM will not be collected during a coredump taken as part
65922 	 * of crash collection.
65923 	 */
65924 	#define HWRM_DBG_QCFG_INPUT_COREDUMP_COMPONENT_DISABLE_FLAGS_NVRAM	UINT32_C(0x1)
65925 } hwrm_dbg_qcfg_input_t, *phwrm_dbg_qcfg_input_t;
65926 
65927 /* hwrm_dbg_qcfg_output (size:256b/32B) */
65928 
65929 typedef struct hwrm_dbg_qcfg_output {
65930 	/* The specific error status for the command. */
65931 	uint16_t	error_code;
65932 	/* The HWRM command request type. */
65933 	uint16_t	req_type;
65934 	/* The sequence ID from the original command. */
65935 	uint16_t	seq_id;
65936 	/* The length of the response data in number of bytes. */
65937 	uint16_t	resp_len;
65938 	/*
65939 	 * FID value. This value is used to identify operations on the PCI
65940 	 * bus as belonging to a particular PCI function.
65941 	 */
65942 	uint16_t	fid;
65943 	uint8_t	unused_0[2];
65944 	/*
65945 	 * Size in bytes of a coredump file created by the FW. This takes into
65946 	 * consideration any components selected in the
65947 	 * coredump_component_disable_flags field from hwrm_dbg_qcfg_input.
65948 	 */
65949 	uint32_t	coredump_size;
65950 	uint32_t	flags;
65951 	/*
65952 	 * If set to 1, then UART logging is enabled for the primary
65953 	 * firmware. Disabled otherwise.
65954 	 */
65955 	#define HWRM_DBG_QCFG_OUTPUT_FLAGS_UART_LOG		UINT32_C(0x1)
65956 	/*
65957 	 * If set to 1, then UART logging is enabled for the secondary
65958 	 * firmware. Disabled otherwise.
65959 	 */
65960 	#define HWRM_DBG_QCFG_OUTPUT_FLAGS_UART_LOG_SECONDARY	UINT32_C(0x2)
65961 	/*
65962 	 * If set to 1, then completion ring logging is enabled for the
65963 	 * primary firmware. Disabled otherwise.
65964 	 */
65965 	#define HWRM_DBG_QCFG_OUTPUT_FLAGS_FW_TRACE		UINT32_C(0x4)
65966 	/*
65967 	 * If set to 1, then completion ring logging is enabled for the
65968 	 * secondary firmware. Disabled otherwise.
65969 	 */
65970 	#define HWRM_DBG_QCFG_OUTPUT_FLAGS_FW_TRACE_SECONDARY	UINT32_C(0x8)
65971 	/*
65972 	 * If set to 1, firmware will generate debug_notification async
65973 	 * events to the driver as applicable.
65974 	 */
65975 	#define HWRM_DBG_QCFG_OUTPUT_FLAGS_DEBUG_NOTIFY	UINT32_C(0x10)
65976 	/*
65977 	 * If set to 1, firmware is allowed to be unresponsive to heartbeat
65978 	 * health checks, allowing for JTAG debugging scenarios where the
65979 	 * debugger has the firmware processes stopped indefinitely. This
65980 	 * flag has effect only on debug builds of firmware.
65981 	 */
65982 	#define HWRM_DBG_QCFG_OUTPUT_FLAGS_JTAG_DEBUG		UINT32_C(0x20)
65983 	/*
65984 	 * Notification queue (completion ring) used by the firmware to post
65985 	 * async debug notifications and fw trace logs. This field is valid
65986 	 * when fw_trace, fw_trace_secondary or debug_notify flags are set.
65987 	 */
65988 	uint16_t	async_cmpl_ring;
65989 	uint8_t	unused_2[2];
65990 	/*
65991 	 * Size in bytes of a crashdump file created by the FW. Uses input
65992 	 * flags to determine medium destination and corresponding size.
65993 	 */
65994 	uint32_t	crashdump_size;
65995 	uint8_t	unused_3[3];
65996 	/*
65997 	 * This field is used in Output records to indicate that the output
65998 	 * is completely written to RAM. This field should be read as '1'
65999 	 * to indicate that the output has been completely written. When
66000 	 * writing a command completion or response to an internal processor,
66001 	 * the order of writes has to be such that this field is written last.
66002 	 */
66003 	uint8_t	valid;
66004 } hwrm_dbg_qcfg_output_t, *phwrm_dbg_qcfg_output_t;
66005 
66006 /*********************************
66007  * hwrm_dbg_crashdump_medium_cfg *
66008  *********************************/
66009 
66010 
66011 /* hwrm_dbg_crashdump_medium_cfg_input (size:320b/40B) */
66012 
66013 typedef struct hwrm_dbg_crashdump_medium_cfg_input {
66014 	/* The HWRM command request type. */
66015 	uint16_t	req_type;
66016 	/*
66017 	 * The completion ring to send the completion event on. This should
66018 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
66019 	 */
66020 	uint16_t	cmpl_ring;
66021 	/*
66022 	 * The sequence ID is used by the driver for tracking multiple
66023 	 * commands. This ID is treated as opaque data by the firmware and
66024 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
66025 	 */
66026 	uint16_t	seq_id;
66027 	/*
66028 	 * The target ID of the command:
66029 	 * * 0x0-0xFFF8 - The function ID
66030 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
66031 	 * * 0xFFFD - Reserved for user-space HWRM interface
66032 	 * * 0xFFFF - HWRM
66033 	 */
66034 	uint16_t	target_id;
66035 	/*
66036 	 * A physical address pointer pointing to a host buffer that the
66037 	 * command's response data will be written. This can be either a host
66038 	 * physical address (HPA) or a guest physical address (GPA) and must
66039 	 * point to a physically contiguous block of memory.
66040 	 */
66041 	uint64_t	resp_addr;
66042 	uint16_t	output_dest_flags;
66043 	/* Destination is DDR ram. */
66044 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_TYPE_DDR	UINT32_C(0x1)
66045 	uint16_t	pg_size_lvl;
66046 	/* PBL indirect levels. */
66047 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_MASK	UINT32_C(0x3)
66048 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_SFT	0
66049 	/* PBL pointer is physical start address. */
66050 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LVL_0	UINT32_C(0x0)
66051 	/* PBL pointer points to PTE table. */
66052 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LVL_1	UINT32_C(0x1)
66053 	/*
66054 	 * PBL pointer points to PDE table with each entry pointing to
66055 	 * PTE tables.
66056 	 */
66057 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LVL_2	UINT32_C(0x2)
66058 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LAST	HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_LVL_LVL_2
66059 	/* page size. */
66060 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_MASK  UINT32_C(0x1c)
66061 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_SFT   2
66062 	/* 4KB. */
66063 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_4K   (UINT32_C(0x0) << 2)
66064 	/* 8KB. */
66065 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_8K   (UINT32_C(0x1) << 2)
66066 	/* 64KB. */
66067 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_64K  (UINT32_C(0x2) << 2)
66068 	/* 2MB. */
66069 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_2M   (UINT32_C(0x3) << 2)
66070 	/* 8MB. */
66071 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_8M   (UINT32_C(0x4) << 2)
66072 	/* 1GB. */
66073 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_1G   (UINT32_C(0x5) << 2)
66074 		#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_LAST   HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_1G
66075 	/* unused11 is 11 b */
66076 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_UNUSED11_MASK UINT32_C(0xffe0)
66077 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_UNUSED11_SFT  5
66078 	/* Crashdump buffer size. */
66079 	uint32_t	size;
66080 	/*
66081 	 * Bitwise field of components that FW is requested to skip during
66082 	 * coredump as part of a crash collection.
66083 	 */
66084 	uint32_t	coredump_component_disable_flags;
66085 	/*
66086 	 * If 1, then NVM will not be collected during a coredump taken as
66087 	 * part of crash collection.
66088 	 */
66089 	#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_NVRAM	UINT32_C(0x1)
66090 	uint32_t	unused_0;
66091 	/* Crashdump buffer PBL physical address. */
66092 	uint64_t	pbl;
66093 } hwrm_dbg_crashdump_medium_cfg_input_t, *phwrm_dbg_crashdump_medium_cfg_input_t;
66094 
66095 /* hwrm_dbg_crashdump_medium_cfg_output (size:128b/16B) */
66096 
66097 typedef struct hwrm_dbg_crashdump_medium_cfg_output {
66098 	/* The specific error status for the command. */
66099 	uint16_t	error_code;
66100 	/* The HWRM command request type. */
66101 	uint16_t	req_type;
66102 	/* The sequence ID from the original command. */
66103 	uint16_t	seq_id;
66104 	/* The length of the response data in number of bytes. */
66105 	uint16_t	resp_len;
66106 	uint8_t	unused_1[7];
66107 	/*
66108 	 * This field is used in Output records to indicate that the output
66109 	 * is completely written to RAM. This field should be read as '1'
66110 	 * to indicate that the output has been completely written. When
66111 	 * writing a command completion or response to an internal processor,
66112 	 * the order of writes has to be such that this field is written last.
66113 	 */
66114 	uint8_t	valid;
66115 } hwrm_dbg_crashdump_medium_cfg_output_t, *phwrm_dbg_crashdump_medium_cfg_output_t;
66116 
66117 /* coredump_segment_record (size:128b/16B) */
66118 
66119 typedef struct coredump_segment_record {
66120 	/* Component id of the returned component. */
66121 	uint16_t	component_id;
66122 	/* Segment id of the returned component. */
66123 	uint16_t	segment_id;
66124 	/* Not used. */
66125 	uint16_t	max_instances;
66126 	/* Major version. */
66127 	uint8_t	version_hi;
66128 	/* Minor version. */
66129 	uint8_t	version_low;
66130 	/*
66131 	 * bit 0: live data
66132 	 * bit 1: crashed data
66133 	 */
66134 	uint8_t	seg_flags;
66135 	/* This field is used to indicate the segment is compressed. */
66136 	uint8_t	compress_flags;
66137 	/*
66138 	 * SFLAG_COMPRESSED_ZLIB indicates that the segment data is
66139 	 * compressed.
66140 	 */
66141 	#define SFLAG_COMPRESSED_ZLIB	UINT32_C(0x1)
66142 	uint8_t	unused_0[2];
66143 	/*
66144 	 * This field is the length of the segment data. It will be zero if
66145 	 * the firmware does not support returning the segment data length.
66146 	 */
66147 	uint32_t	segment_len;
66148 } coredump_segment_record_t, *pcoredump_segment_record_t;
66149 
66150 /**************************
66151  * hwrm_dbg_coredump_list *
66152  **************************/
66153 
66154 
66155 /* hwrm_dbg_coredump_list_input (size:256b/32B) */
66156 
66157 typedef struct hwrm_dbg_coredump_list_input {
66158 	/* The HWRM command request type. */
66159 	uint16_t	req_type;
66160 	/*
66161 	 * The completion ring to send the completion event on. This should
66162 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
66163 	 */
66164 	uint16_t	cmpl_ring;
66165 	/*
66166 	 * The sequence ID is used by the driver for tracking multiple
66167 	 * commands. This ID is treated as opaque data by the firmware and
66168 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
66169 	 */
66170 	uint16_t	seq_id;
66171 	/*
66172 	 * The target ID of the command:
66173 	 * * 0x0-0xFFF8 - The function ID
66174 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
66175 	 * * 0xFFFD - Reserved for user-space HWRM interface
66176 	 * * 0xFFFF - HWRM
66177 	 */
66178 	uint16_t	target_id;
66179 	/*
66180 	 * A physical address pointer pointing to a host buffer that the
66181 	 * command's response data will be written. This can be either a host
66182 	 * physical address (HPA) or a guest physical address (GPA) and must
66183 	 * point to a physically contiguous block of memory.
66184 	 */
66185 	uint64_t	resp_addr;
66186 	/*
66187 	 * host address where the data content will be written
66188 	 * when the request is complete. This area must be 16B aligned.
66189 	 */
66190 	uint64_t	host_dest_addr;
66191 	/* Length of host buffer used for transferring debug data. */
66192 	uint32_t	host_buf_len;
66193 	/* Sequence number of the request. Starts at 0. */
66194 	uint16_t	seq_no;
66195 	/*  */
66196 	uint8_t	flags;
66197 	/*
66198 	 * If set to 1, crash dump is requested.
66199 	 * If set to 0, both live core and crash dump are requested.
66200 	 */
66201 	#define HWRM_DBG_COREDUMP_LIST_INPUT_FLAGS_CRASHDUMP	UINT32_C(0x1)
66202 	uint8_t	unused_0[1];
66203 } hwrm_dbg_coredump_list_input_t, *phwrm_dbg_coredump_list_input_t;
66204 
66205 /* hwrm_dbg_coredump_list_output (size:128b/16B) */
66206 
66207 typedef struct hwrm_dbg_coredump_list_output {
66208 	/* The specific error status for the command. */
66209 	uint16_t	error_code;
66210 	/* The HWRM command request type. */
66211 	uint16_t	req_type;
66212 	/* The sequence ID from the original command. */
66213 	uint16_t	seq_id;
66214 	/* The length of the response data in number of bytes. */
66215 	uint16_t	resp_len;
66216 	uint8_t	flags;
66217 	/*
66218 	 * Value of 1 means that there is more data available.
66219 	 * Issue the request again with the next sequence number.
66220 	 */
66221 	#define HWRM_DBG_COREDUMP_LIST_OUTPUT_FLAGS_MORE	UINT32_C(0x1)
66222 	uint8_t	unused_0;
66223 	/* Total number of segments to be returned. */
66224 	uint16_t	total_segments;
66225 	/* Actual length of data returned in bytes. */
66226 	uint16_t	data_len;
66227 	uint8_t	unused_1;
66228 	/*
66229 	 * This field is used in Output records to indicate that the output
66230 	 * is completely written to RAM. This field should be read as '1'
66231 	 * to indicate that the output has been completely written. When
66232 	 * writing a command completion or response to an internal processor,
66233 	 * the order of writes has to be such that this field is written last.
66234 	 */
66235 	uint8_t	valid;
66236 } hwrm_dbg_coredump_list_output_t, *phwrm_dbg_coredump_list_output_t;
66237 
66238 /******************************
66239  * hwrm_dbg_coredump_initiate *
66240  ******************************/
66241 
66242 
66243 /* hwrm_dbg_coredump_initiate_input (size:256b/32B) */
66244 
66245 typedef struct hwrm_dbg_coredump_initiate_input {
66246 	/* The HWRM command request type. */
66247 	uint16_t	req_type;
66248 	/*
66249 	 * The completion ring to send the completion event on. This should
66250 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
66251 	 */
66252 	uint16_t	cmpl_ring;
66253 	/*
66254 	 * The sequence ID is used by the driver for tracking multiple
66255 	 * commands. This ID is treated as opaque data by the firmware and
66256 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
66257 	 */
66258 	uint16_t	seq_id;
66259 	/*
66260 	 * The target ID of the command:
66261 	 * * 0x0-0xFFF8 - The function ID
66262 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
66263 	 * * 0xFFFD - Reserved for user-space HWRM interface
66264 	 * * 0xFFFF - HWRM
66265 	 */
66266 	uint16_t	target_id;
66267 	/*
66268 	 * A physical address pointer pointing to a host buffer that the
66269 	 * command's response data will be written. This can be either a host
66270 	 * physical address (HPA) or a guest physical address (GPA) and must
66271 	 * point to a physically contiguous block of memory.
66272 	 */
66273 	uint64_t	resp_addr;
66274 	/* Component id of the returned component. */
66275 	uint16_t	component_id;
66276 	/* Segment id of the returned component. */
66277 	uint16_t	segment_id;
66278 	/* Not used. */
66279 	uint16_t	instance;
66280 	/* Not used. */
66281 	uint16_t	unused_0;
66282 	/*
66283 	 * bit 0: live data
66284 	 * bit 1: crashed data
66285 	 * bit 2: collect context l1 cache
66286 	 */
66287 	uint8_t	seg_flags;
66288 	/* Not Used. */
66289 	#define HWRM_DBG_COREDUMP_INITIATE_INPUT_SEG_FLAGS_LIVE_DATA		UINT32_C(0x1)
66290 	/* Not Used. */
66291 	#define HWRM_DBG_COREDUMP_INITIATE_INPUT_SEG_FLAGS_CRASH_DATA		UINT32_C(0x2)
66292 	/*
66293 	 * If this bit is set, this setting will enforce firmware to collect
66294 	 * CFCx l1 cache.
66295 	 */
66296 	#define HWRM_DBG_COREDUMP_INITIATE_INPUT_SEG_FLAGS_COLLECT_CTX_L1_CACHE	UINT32_C(0x4)
66297 	/* Not used. */
66298 	uint8_t	unused_1[7];
66299 } hwrm_dbg_coredump_initiate_input_t, *phwrm_dbg_coredump_initiate_input_t;
66300 
66301 /* hwrm_dbg_coredump_initiate_output (size:128b/16B) */
66302 
66303 typedef struct hwrm_dbg_coredump_initiate_output {
66304 	/* The specific error status for the command. */
66305 	uint16_t	error_code;
66306 	/* The HWRM command request type. */
66307 	uint16_t	req_type;
66308 	/* The sequence ID from the original command. */
66309 	uint16_t	seq_id;
66310 	/* The length of the response data in number of bytes. */
66311 	uint16_t	resp_len;
66312 	uint8_t	unused_0[7];
66313 	/*
66314 	 * This field is used in Output records to indicate that the output
66315 	 * is completely written to RAM. This field should be read as '1'
66316 	 * to indicate that the output has been completely written. When
66317 	 * writing a command completion or response to an internal processor,
66318 	 * the order of writes has to be such that this field is written last.
66319 	 */
66320 	uint8_t	valid;
66321 } hwrm_dbg_coredump_initiate_output_t, *phwrm_dbg_coredump_initiate_output_t;
66322 
66323 /* coredump_data_hdr (size:128b/16B) */
66324 
66325 typedef struct coredump_data_hdr {
66326 	/* Starting address of the register range. */
66327 	uint32_t	address;
66328 	/*
66329 	 * length: 0 - 23 bits represents the actual data without the pad.
66330 	 * flags: 24 - 31 bits represents indirect register ranges.
66331 	 *   - bit 24: Set if registers in this segment are indirect accessed.
66332 	 */
66333 	uint32_t	flags_length;
66334 	/* These bits represents the actual length of the data segment */
66335 	#define COREDUMP_DATA_HDR_FLAGS_LENGTH_ACTUAL_LEN_MASK	UINT32_C(0xffffff)
66336 	#define COREDUMP_DATA_HDR_FLAGS_LENGTH_ACTUAL_LEN_SFT	0
66337 	/* Set if registers in this segment are indirect accessed. */
66338 	#define COREDUMP_DATA_HDR_FLAGS_LENGTH_INDIRECT_ACCESS	UINT32_C(0x1000000)
66339 	/* Value in the partner register for indirect or multi-field registers. */
66340 	uint32_t	instance;
66341 	/* Starting address of the next register after the current data range */
66342 	uint32_t	next_offset;
66343 } coredump_data_hdr_t, *pcoredump_data_hdr_t;
66344 
66345 /******************************
66346  * hwrm_dbg_coredump_retrieve *
66347  ******************************/
66348 
66349 
66350 /* hwrm_dbg_coredump_retrieve_input (size:448b/56B) */
66351 
66352 typedef struct hwrm_dbg_coredump_retrieve_input {
66353 	/* The HWRM command request type. */
66354 	uint16_t	req_type;
66355 	/*
66356 	 * The completion ring to send the completion event on. This should
66357 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
66358 	 */
66359 	uint16_t	cmpl_ring;
66360 	/*
66361 	 * The sequence ID is used by the driver for tracking multiple
66362 	 * commands. This ID is treated as opaque data by the firmware and
66363 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
66364 	 */
66365 	uint16_t	seq_id;
66366 	/*
66367 	 * The target ID of the command:
66368 	 * * 0x0-0xFFF8 - The function ID
66369 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
66370 	 * * 0xFFFD - Reserved for user-space HWRM interface
66371 	 * * 0xFFFF - HWRM
66372 	 */
66373 	uint16_t	target_id;
66374 	/*
66375 	 * A physical address pointer pointing to a host buffer that the
66376 	 * command's response data will be written. This can be either a host
66377 	 * physical address (HPA) or a guest physical address (GPA) and must
66378 	 * point to a physically contiguous block of memory.
66379 	 */
66380 	uint64_t	resp_addr;
66381 	/*
66382 	 * host address where the data content will be written
66383 	 * when the request is complete. This area must be 16B aligned.
66384 	 */
66385 	uint64_t	host_dest_addr;
66386 	/* Length of host buffer used for transferring debug data. */
66387 	uint32_t	host_buf_len;
66388 	/* Not used. */
66389 	uint32_t	unused_0;
66390 	/* Component id of the returned component. */
66391 	uint16_t	component_id;
66392 	/* Segment id of the returned component. */
66393 	uint16_t	segment_id;
66394 	/* Not used. */
66395 	uint16_t	instance;
66396 	/* Not used. */
66397 	uint16_t	unused_1;
66398 	/*
66399 	 * bit 0: live data
66400 	 * bit 1: crashed data
66401 	 */
66402 	uint8_t	seg_flags;
66403 	uint8_t	unused_2;
66404 	uint16_t	unused_3;
66405 	/* Not used. */
66406 	uint32_t	unused_4;
66407 	/* Sequence number is used per segment request. Starts at 0. */
66408 	uint32_t	seq_no;
66409 	uint32_t	unused_5;
66410 } hwrm_dbg_coredump_retrieve_input_t, *phwrm_dbg_coredump_retrieve_input_t;
66411 
66412 /* hwrm_dbg_coredump_retrieve_output (size:128b/16B) */
66413 
66414 typedef struct hwrm_dbg_coredump_retrieve_output {
66415 	/* The specific error status for the command. */
66416 	uint16_t	error_code;
66417 	/* The HWRM command request type. */
66418 	uint16_t	req_type;
66419 	/* The sequence ID from the original command. */
66420 	uint16_t	seq_id;
66421 	/* The length of the response data in number of bytes. */
66422 	uint16_t	resp_len;
66423 	uint8_t	flags;
66424 	/*
66425 	 * Value of 1 means that there is more data available.
66426 	 * Issue the request again with the next sequence number.
66427 	 */
66428 	#define HWRM_DBG_COREDUMP_RETRIEVE_OUTPUT_FLAGS_MORE	UINT32_C(0x1)
66429 	uint8_t	unused_0;
66430 	/* Actual length of data returned in bytes. */
66431 	uint16_t	data_len;
66432 	uint8_t	unused_1[3];
66433 	/*
66434 	 * This field is used in Output records to indicate that the output
66435 	 * is completely written to RAM. This field should be read as '1'
66436 	 * to indicate that the output has been completely written. When
66437 	 * writing a command completion or response to an internal processor,
66438 	 * the order of writes has to be such that this field is written last.
66439 	 */
66440 	uint8_t	valid;
66441 } hwrm_dbg_coredump_retrieve_output_t, *phwrm_dbg_coredump_retrieve_output_t;
66442 
66443 /********************
66444  * hwrm_dbg_i2c_cmd *
66445  ********************/
66446 
66447 
66448 /* hwrm_dbg_i2c_cmd_input (size:320b/40B) */
66449 
66450 typedef struct hwrm_dbg_i2c_cmd_input {
66451 	/* The HWRM command request type. */
66452 	uint16_t	req_type;
66453 	/*
66454 	 * The completion ring to send the completion event on. This should
66455 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
66456 	 */
66457 	uint16_t	cmpl_ring;
66458 	/*
66459 	 * The sequence ID is used by the driver for tracking multiple
66460 	 * commands. This ID is treated as opaque data by the firmware and
66461 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
66462 	 */
66463 	uint16_t	seq_id;
66464 	/*
66465 	 * The target ID of the command:
66466 	 * * 0x0-0xFFF8 - The function ID
66467 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
66468 	 * * 0xFFFD - Reserved for user-space HWRM interface
66469 	 * * 0xFFFF - HWRM
66470 	 */
66471 	uint16_t	target_id;
66472 	/*
66473 	 * A physical address pointer pointing to a host buffer that the
66474 	 * command's response data will be written. This can be either a host
66475 	 * physical address (HPA) or a guest physical address (GPA) and must
66476 	 * point to a physically contiguous block of memory.
66477 	 */
66478 	uint64_t	resp_addr;
66479 	/*
66480 	 * host address where the data content will be read or written.
66481 	 * For master write, data content will be read from host memory and
66482 	 * write to i2c slave. (size defined by write_size)
66483 	 * For master read, data content will be read from i2c slave and write
66484 	 * to the host memory. (size defined by read_size)
66485 	 * For master write/read, data content will be first read from host
66486 	 * memory and write to i2c slave. (size defined by write_size) then
66487 	 * data read from i2c slave will be written back to the same host
66488 	 * memory. (size defined by read_size)
66489 	 */
66490 	uint64_t	host_dest_addr;
66491 	/* read size in bytes, valid only for master read and write/read */
66492 	uint16_t	read_size;
66493 	/* write size in bytes, valid only for master write and write/read */
66494 	uint16_t	write_size;
66495 	/*
66496 	 * instance of i2c channel for this operation. Valid if multiple
66497 	 * instances
66498 	 * of i2c channels are connected to external i2c devices.
66499 	 */
66500 	uint8_t	chnl_id;
66501 	uint8_t	options;
66502 	/*
66503 	 * This bit must be '1' for 10-bit i2c addressing,
66504 	 * 7-bit addressing otherwise.
66505 	 */
66506 	#define HWRM_DBG_I2C_CMD_INPUT_OPTIONS_10_BIT_ADDRESSING	UINT32_C(0x1)
66507 	/*
66508 	 * This bit must be '1' for 400 kbit/s, 100 kbit/s
66509 	 * otherwise.
66510 	 */
66511 	#define HWRM_DBG_I2C_CMD_INPUT_OPTIONS_FAST_MODE		UINT32_C(0x2)
66512 	/* I2C slave address. */
66513 	uint16_t	slave_addr;
66514 	/* I2C transfer mode. */
66515 	uint8_t	xfer_mode;
66516 	/* read data from slave device */
66517 	#define HWRM_DBG_I2C_CMD_INPUT_XFER_MODE_MASTER_READ	UINT32_C(0x0)
66518 	/* write data to slave device */
66519 	#define HWRM_DBG_I2C_CMD_INPUT_XFER_MODE_MASTER_WRITE	UINT32_C(0x1)
66520 	/* write follow by read data from slave device */
66521 	#define HWRM_DBG_I2C_CMD_INPUT_XFER_MODE_MASTER_WRITE_READ UINT32_C(0x2)
66522 	#define HWRM_DBG_I2C_CMD_INPUT_XFER_MODE_LAST		HWRM_DBG_I2C_CMD_INPUT_XFER_MODE_MASTER_WRITE_READ
66523 	uint8_t	unused_1[7];
66524 } hwrm_dbg_i2c_cmd_input_t, *phwrm_dbg_i2c_cmd_input_t;
66525 
66526 /* hwrm_dbg_i2c_cmd_output (size:128b/16B) */
66527 
66528 typedef struct hwrm_dbg_i2c_cmd_output {
66529 	/* The specific error status for the command. */
66530 	uint16_t	error_code;
66531 	/* The HWRM command request type. */
66532 	uint16_t	req_type;
66533 	/* The sequence ID from the original command. */
66534 	uint16_t	seq_id;
66535 	/* The length of the response data in number of bytes. */
66536 	uint16_t	resp_len;
66537 	uint8_t	unused_0[7];
66538 	/*
66539 	 * This field is used in Output records to indicate that the output
66540 	 * is completely written to RAM. This field should be read as '1'
66541 	 * to indicate that the output has been completely written. When
66542 	 * writing a command completion or response to an internal processor,
66543 	 * the order of writes has to be such that this field is written last.
66544 	 */
66545 	uint8_t	valid;
66546 } hwrm_dbg_i2c_cmd_output_t, *phwrm_dbg_i2c_cmd_output_t;
66547 
66548 /*******************
66549  * hwrm_dbg_fw_cli *
66550  *******************/
66551 
66552 
66553 /* hwrm_dbg_fw_cli_input (size:1024b/128B) */
66554 
66555 typedef struct hwrm_dbg_fw_cli_input {
66556 	/* The HWRM command request type. */
66557 	uint16_t	req_type;
66558 	/*
66559 	 * The completion ring to send the completion event on. This should
66560 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
66561 	 */
66562 	uint16_t	cmpl_ring;
66563 	/*
66564 	 * The sequence ID is used by the driver for tracking multiple
66565 	 * commands. This ID is treated as opaque data by the firmware and
66566 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
66567 	 */
66568 	uint16_t	seq_id;
66569 	/*
66570 	 * The target ID of the command:
66571 	 * * 0x0-0xFFF8 - The function ID
66572 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
66573 	 * * 0xFFFD - Reserved for user-space HWRM interface
66574 	 * * 0xFFFF - HWRM
66575 	 */
66576 	uint16_t	target_id;
66577 	/*
66578 	 * A physical address pointer pointing to a host buffer that the
66579 	 * command's response data will be written. This can be either a host
66580 	 * physical address (HPA) or a guest physical address (GPA) and must
66581 	 * point to a physically contiguous block of memory.
66582 	 */
66583 	uint64_t	resp_addr;
66584 	/*
66585 	 * Address of the host buffer where debug CLI data
66586 	 * is requested to be dumped.
66587 	 */
66588 	uint64_t	host_dest_addr;
66589 	/* Length of host buffer used for transferring debug data. */
66590 	uint32_t	host_buf_len;
66591 	/* Length of CLI command. */
66592 	uint16_t	cli_cmd_len;
66593 	uint8_t	unused_0[2];
66594 	/* CLI command string, a single ASCII encoded null terminated string. */
66595 	uint8_t	cli_cmd[96];
66596 } hwrm_dbg_fw_cli_input_t, *phwrm_dbg_fw_cli_input_t;
66597 
66598 /* hwrm_dbg_fw_cli_output (size:128b/16B) */
66599 
66600 typedef struct hwrm_dbg_fw_cli_output {
66601 	/* The specific error status for the command. */
66602 	uint16_t	error_code;
66603 	/* The HWRM command request type. */
66604 	uint16_t	req_type;
66605 	/* The sequence ID from the original command. */
66606 	uint16_t	seq_id;
66607 	/* The length of the response data in number of bytes. */
66608 	uint16_t	resp_len;
66609 	/* Size of debug CLI data returned in bytes. */
66610 	uint32_t	cli_data_len;
66611 	uint8_t	unused_0[3];
66612 	/*
66613 	 * This field is used in Output records to indicate that the output
66614 	 * is completely written to RAM. This field should be read as '1'
66615 	 * to indicate that the output has been completely written. When
66616 	 * writing a command completion or response to an internal processor,
66617 	 * the order of writes has to be such that this field is written last.
66618 	 */
66619 	uint8_t	valid;
66620 } hwrm_dbg_fw_cli_output_t, *phwrm_dbg_fw_cli_output_t;
66621 
66622 /**************************
66623  * hwrm_dbg_ring_info_get *
66624  **************************/
66625 
66626 
66627 /* hwrm_dbg_ring_info_get_input (size:192b/24B) */
66628 
66629 typedef struct hwrm_dbg_ring_info_get_input {
66630 	/* The HWRM command request type. */
66631 	uint16_t	req_type;
66632 	/*
66633 	 * The completion ring to send the completion event on. This should
66634 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
66635 	 */
66636 	uint16_t	cmpl_ring;
66637 	/*
66638 	 * The sequence ID is used by the driver for tracking multiple
66639 	 * commands. This ID is treated as opaque data by the firmware and
66640 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
66641 	 */
66642 	uint16_t	seq_id;
66643 	/*
66644 	 * The target ID of the command:
66645 	 * * 0x0-0xFFF8 - The function ID
66646 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
66647 	 * * 0xFFFD - Reserved for user-space HWRM interface
66648 	 * * 0xFFFF - HWRM
66649 	 */
66650 	uint16_t	target_id;
66651 	/*
66652 	 * A physical address pointer pointing to a host buffer that the
66653 	 * command's response data will be written. This can be either a host
66654 	 * physical address (HPA) or a guest physical address (GPA) and must
66655 	 * point to a physically contiguous block of memory.
66656 	 */
66657 	uint64_t	resp_addr;
66658 	/* Ring Type. */
66659 	uint8_t	ring_type;
66660 	/* L2 Completion Ring (CR) */
66661 	#define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)
66662 	/* TX Ring (TR) */
66663 	#define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_TX	UINT32_C(0x1)
66664 	/* RX Ring (RR) */
66665 	#define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_RX	UINT32_C(0x2)
66666 	/* Notification Queue (NQ) */
66667 	#define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_NQ	UINT32_C(0x3)
66668 	#define HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_LAST   HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_NQ
66669 	uint8_t	unused_0[3];
66670 	/* Firmware ring ID associated with ring being queried. */
66671 	uint32_t	fw_ring_id;
66672 } hwrm_dbg_ring_info_get_input_t, *phwrm_dbg_ring_info_get_input_t;
66673 
66674 /* hwrm_dbg_ring_info_get_output (size:192b/24B) */
66675 
66676 typedef struct hwrm_dbg_ring_info_get_output {
66677 	/* The specific error status for the command. */
66678 	uint16_t	error_code;
66679 	/* The HWRM command request type. */
66680 	uint16_t	req_type;
66681 	/* The sequence ID from the original command. */
66682 	uint16_t	seq_id;
66683 	/* The length of the response data in number of bytes. */
66684 	uint16_t	resp_len;
66685 	/* Producer index for the queried ring. */
66686 	uint32_t	producer_index;
66687 	/* Consumer index for the queried ring. */
66688 	uint32_t	consumer_index;
66689 	/*
66690 	 * CAG Vector Control for the queried NQ ring.
66691 	 * Not valid for other ring types.
66692 	 */
66693 	uint32_t	cag_vector_ctrl;
66694 	/*
66695 	 * Steering Tag. The current value of the steering tag for the ring.
66696 	 * The steering tag is only valid if it is advertised by Firmware in
66697 	 * flags_ext2.steering_tag_supported of hwrm_func_qcaps response.
66698 	 */
66699 	uint16_t	st_tag;
66700 	uint8_t	unused_0;
66701 	/*
66702 	 * This field is used in Output records to indicate that the output
66703 	 * is completely written to RAM. This field should be read as '1'
66704 	 * to indicate that the output has been completely written. When
66705 	 * writing a command completion or response to an internal processor,
66706 	 * the order of writes has to be such that this field is written last.
66707 	 */
66708 	uint8_t	valid;
66709 } hwrm_dbg_ring_info_get_output_t, *phwrm_dbg_ring_info_get_output_t;
66710 
66711 /**********************
66712  * hwrm_dbg_drv_trace *
66713  **********************/
66714 
66715 
66716 /* hwrm_dbg_drv_trace_input (size:1024b/128B) */
66717 
66718 typedef struct hwrm_dbg_drv_trace_input {
66719 	/* The HWRM command request type. */
66720 	uint16_t	req_type;
66721 	/*
66722 	 * The completion ring to send the completion event on. This should
66723 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
66724 	 */
66725 	uint16_t	cmpl_ring;
66726 	/*
66727 	 * The sequence ID is used by the driver for tracking multiple
66728 	 * commands. This ID is treated as opaque data by the firmware and
66729 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
66730 	 */
66731 	uint16_t	seq_id;
66732 	/*
66733 	 * The target ID of the command:
66734 	 * * 0x0-0xFFF8 - The function ID
66735 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
66736 	 * * 0xFFFD - Reserved for user-space HWRM interface
66737 	 * * 0xFFFF - HWRM
66738 	 */
66739 	uint16_t	target_id;
66740 	/*
66741 	 * A physical address pointer pointing to a host buffer that the
66742 	 * command's response data will be written. This can be either a host
66743 	 * physical address (HPA) or a guest physical address (GPA) and must
66744 	 * point to a physically contiguous block of memory.
66745 	 */
66746 	uint64_t	resp_addr;
66747 	/* Severity of the message. */
66748 	uint8_t	severity;
66749 	/* Fatal */
66750 	#define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_FATAL   UINT32_C(0x0)
66751 	/* Error */
66752 	#define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_ERROR   UINT32_C(0x1)
66753 	/* Warning */
66754 	#define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_WARNING UINT32_C(0x2)
66755 	/* Info */
66756 	#define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_INFO	UINT32_C(0x3)
66757 	/* Debug */
66758 	#define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_DEBUG   UINT32_C(0x4)
66759 	#define HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_LAST		HWRM_DBG_DRV_TRACE_INPUT_SEVERITY_TRACE_LEVEL_DEBUG
66760 	/* Number of bytes to write including terminating 'NULL' if any. */
66761 	uint8_t	write_len;
66762 	uint8_t	unused_0[6];
66763 	/*
66764 	 * This field represents the debug data sent by driver
66765 	 * ASCII chars, 'NULL' termination not required.
66766 	 */
66767 	char	trace_data[104];
66768 } hwrm_dbg_drv_trace_input_t, *phwrm_dbg_drv_trace_input_t;
66769 
66770 /* hwrm_dbg_drv_trace_output (size:128b/16B) */
66771 
66772 typedef struct hwrm_dbg_drv_trace_output {
66773 	/* The specific error status for the command. */
66774 	uint16_t	error_code;
66775 	/* The HWRM command request type. */
66776 	uint16_t	req_type;
66777 	/* The sequence ID from the original command. */
66778 	uint16_t	seq_id;
66779 	/* The length of the response data in number of bytes. */
66780 	uint16_t	resp_len;
66781 	uint8_t	unused_0[7];
66782 	/*
66783 	 * This field is used in Output records to indicate that the output
66784 	 * is completely written to RAM. This field should be read as '1'
66785 	 * to indicate that the output has been completely written. When
66786 	 * writing a command completion or response to an internal processor,
66787 	 * the order of writes has to be such that this field is written last.
66788 	 */
66789 	uint8_t	valid;
66790 } hwrm_dbg_drv_trace_output_t, *phwrm_dbg_drv_trace_output_t;
66791 
66792 /***********************
66793  * hwrm_dbg_useq_alloc *
66794  ***********************/
66795 
66796 
66797 /* hwrm_dbg_useq_alloc_input (size:192b/24B) */
66798 
66799 typedef struct hwrm_dbg_useq_alloc_input {
66800 	/* The HWRM command request type. */
66801 	uint16_t	req_type;
66802 	/*
66803 	 * The completion ring to send the completion event on. This should
66804 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
66805 	 */
66806 	uint16_t	cmpl_ring;
66807 	/*
66808 	 * The sequence ID is used by the driver for tracking multiple
66809 	 * commands. This ID is treated as opaque data by the firmware and
66810 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
66811 	 */
66812 	uint16_t	seq_id;
66813 	/*
66814 	 * The target ID of the command:
66815 	 * * 0x0-0xFFF8 - The function ID
66816 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
66817 	 * * 0xFFFD - Reserved for user-space HWRM interface
66818 	 * * 0xFFFF - HWRM
66819 	 */
66820 	uint16_t	target_id;
66821 	/*
66822 	 * A physical address pointer pointing to a host buffer that the
66823 	 * command's response data will be written. This can be either a host
66824 	 * physical address (HPA) or a guest physical address (GPA) and must
66825 	 * point to a physically contiguous block of memory.
66826 	 */
66827 	uint64_t	resp_addr;
66828 	/*
66829 	 * Number size of the allocation, in bytes, for the USEQ in the code
66830 	 * words array
66831 	 */
66832 	uint32_t	size;
66833 	/*
66834 	 * Number of bytes executing the USEQ will produce. Must be a multiple
66835 	 * of 4
66836 	 */
66837 	uint16_t	output_bytes;
66838 	/* This field is reserved */
66839 	uint16_t	unused_0;
66840 } hwrm_dbg_useq_alloc_input_t, *phwrm_dbg_useq_alloc_input_t;
66841 
66842 /* hwrm_dbg_useq_alloc_output (size:256b/32B) */
66843 
66844 typedef struct hwrm_dbg_useq_alloc_output {
66845 	/* The specific error status for the command. */
66846 	uint16_t	error_code;
66847 	/* The HWRM command request type. */
66848 	uint16_t	req_type;
66849 	/* The sequence ID from the original command. */
66850 	uint16_t	seq_id;
66851 	/* The length of the response data in number of bytes. */
66852 	uint16_t	resp_len;
66853 	/* Non-zero firmware timestamp */
66854 	uint32_t	nz_fw_timestamp;
66855 	/* The last selected USID */
66856 	uint16_t	last_usid;
66857 	/* The number of USEQs currently allocated */
66858 	uint16_t	num_useq_allocd;
66859 	/* Flags indicating current USEQ engine state */
66860 	uint32_t	useq_resp_flags;
66861 	/* When set, there is at least some data available to be delivered */
66862 	#define HWRM_DBG_USEQ_ALLOC_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
66863 	/* When set, all internal buffers are full */
66864 	#define HWRM_DBG_USEQ_ALLOC_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
66865 	#define HWRM_DBG_USEQ_ALLOC_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_LAST	HWRM_DBG_USEQ_ALLOC_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW
66866 	/* Current count of the number of full buffers available for delivery */
66867 	uint8_t	full_cnt;
66868 	/* Reserved */
66869 	uint8_t	useq_resp_unused_0[3];
66870 	/* This is the allocated usid */
66871 	uint16_t	alloc_usid;
66872 	/* This field is reserved */
66873 	uint16_t	unused_0;
66874 	/*
66875 	 * This field is used in Output records to indicate that the output
66876 	 * is completely written to RAM. This field should be read as '1'
66877 	 * to indicate that the output has been completely written. When
66878 	 * writing a command completion or response to an internal processor,
66879 	 * the order of writes has to be such that this field is written last.
66880 	 */
66881 	uint32_t	valid;
66882 } hwrm_dbg_useq_alloc_output_t, *phwrm_dbg_useq_alloc_output_t;
66883 
66884 /**********************
66885  * hwrm_dbg_useq_free *
66886  **********************/
66887 
66888 
66889 /* hwrm_dbg_useq_free_input (size:192b/24B) */
66890 
66891 typedef struct hwrm_dbg_useq_free_input {
66892 	/* The HWRM command request type. */
66893 	uint16_t	req_type;
66894 	/*
66895 	 * The completion ring to send the completion event on. This should
66896 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
66897 	 */
66898 	uint16_t	cmpl_ring;
66899 	/*
66900 	 * The sequence ID is used by the driver for tracking multiple
66901 	 * commands. This ID is treated as opaque data by the firmware and
66902 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
66903 	 */
66904 	uint16_t	seq_id;
66905 	/*
66906 	 * The target ID of the command:
66907 	 * * 0x0-0xFFF8 - The function ID
66908 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
66909 	 * * 0xFFFD - Reserved for user-space HWRM interface
66910 	 * * 0xFFFF - HWRM
66911 	 */
66912 	uint16_t	target_id;
66913 	/*
66914 	 * A physical address pointer pointing to a host buffer that the
66915 	 * command's response data will be written. This can be either a host
66916 	 * physical address (HPA) or a guest physical address (GPA) and must
66917 	 * point to a physically contiguous block of memory.
66918 	 */
66919 	uint64_t	resp_addr;
66920 	/* The USID of the sequence to free */
66921 	uint16_t	usid;
66922 	/* This field is reserved */
66923 	uint8_t	unused_0[6];
66924 } hwrm_dbg_useq_free_input_t, *phwrm_dbg_useq_free_input_t;
66925 
66926 /* hwrm_dbg_useq_free_output (size:256b/32B) */
66927 
66928 typedef struct hwrm_dbg_useq_free_output {
66929 	/* The specific error status for the command. */
66930 	uint16_t	error_code;
66931 	/* The HWRM command request type. */
66932 	uint16_t	req_type;
66933 	/* The sequence ID from the original command. */
66934 	uint16_t	seq_id;
66935 	/* The length of the response data in number of bytes. */
66936 	uint16_t	resp_len;
66937 	/* Non-zero firmware timestamp */
66938 	uint32_t	nz_fw_timestamp;
66939 	/* The last selected USID */
66940 	uint16_t	last_usid;
66941 	/* The number of USEQs currently allocated */
66942 	uint16_t	num_useq_allocd;
66943 	/* Flags indicating current USEQ engine state */
66944 	uint32_t	useq_resp_flags;
66945 	/* When set, there is at least some data available to be delivered */
66946 	#define HWRM_DBG_USEQ_FREE_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
66947 	/* When set, all internal buffers are full */
66948 	#define HWRM_DBG_USEQ_FREE_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
66949 	#define HWRM_DBG_USEQ_FREE_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_LAST	HWRM_DBG_USEQ_FREE_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW
66950 	/* Current count of the number of full buffers available for delivery */
66951 	uint8_t	full_cnt;
66952 	/* Reserved */
66953 	uint8_t	useq_resp_unused_0[3];
66954 	/* This field is reserved */
66955 	uint32_t	unused_0;
66956 	/*
66957 	 * This field is used in Output records to indicate that the output
66958 	 * is completely written to RAM. This field should be read as '1'
66959 	 * to indicate that the output has been completely written. When
66960 	 * writing a command completion or response to an internal processor,
66961 	 * the order of writes has to be such that this field is written last.
66962 	 */
66963 	uint32_t	valid;
66964 } hwrm_dbg_useq_free_output_t, *phwrm_dbg_useq_free_output_t;
66965 
66966 /***********************
66967  * hwrm_dbg_useq_flush *
66968  ***********************/
66969 
66970 
66971 /* hwrm_dbg_useq_flush_input (size:192b/24B) */
66972 
66973 typedef struct hwrm_dbg_useq_flush_input {
66974 	/* The HWRM command request type. */
66975 	uint16_t	req_type;
66976 	/*
66977 	 * The completion ring to send the completion event on. This should
66978 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
66979 	 */
66980 	uint16_t	cmpl_ring;
66981 	/*
66982 	 * The sequence ID is used by the driver for tracking multiple
66983 	 * commands. This ID is treated as opaque data by the firmware and
66984 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
66985 	 */
66986 	uint16_t	seq_id;
66987 	/*
66988 	 * The target ID of the command:
66989 	 * * 0x0-0xFFF8 - The function ID
66990 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
66991 	 * * 0xFFFD - Reserved for user-space HWRM interface
66992 	 * * 0xFFFF - HWRM
66993 	 */
66994 	uint16_t	target_id;
66995 	/*
66996 	 * A physical address pointer pointing to a host buffer that the
66997 	 * command's response data will be written. This can be either a host
66998 	 * physical address (HPA) or a guest physical address (GPA) and must
66999 	 * point to a physically contiguous block of memory.
67000 	 */
67001 	uint64_t	resp_addr;
67002 	/* Bitwise flags described below */
67003 	uint16_t	flags;
67004 	/* Flush all USEQ code words, resetting all USIDs to invalid */
67005 	#define HWRM_DBG_USEQ_FLUSH_INPUT_USEQ_CODE_WORDS UINT32_C(0x1)
67006 	/* Initialize all buffers, clearing out any collected data */
67007 	#define HWRM_DBG_USEQ_FLUSH_INPUT_BUFFERS	UINT32_C(0x2)
67008 	#define HWRM_DBG_USEQ_FLUSH_INPUT_LAST	HWRM_DBG_USEQ_FLUSH_INPUT_BUFFERS
67009 	/* This field is reserved */
67010 	uint8_t	unused_0[6];
67011 } hwrm_dbg_useq_flush_input_t, *phwrm_dbg_useq_flush_input_t;
67012 
67013 /* hwrm_dbg_useq_flush_output (size:256b/32B) */
67014 
67015 typedef struct hwrm_dbg_useq_flush_output {
67016 	/* The specific error status for the command. */
67017 	uint16_t	error_code;
67018 	/* The HWRM command request type. */
67019 	uint16_t	req_type;
67020 	/* The sequence ID from the original command. */
67021 	uint16_t	seq_id;
67022 	/* The length of the response data in number of bytes. */
67023 	uint16_t	resp_len;
67024 	/* Non-zero firmware timestamp */
67025 	uint32_t	nz_fw_timestamp;
67026 	/* The last selected USID */
67027 	uint16_t	last_usid;
67028 	/* The number of USEQs currently allocated */
67029 	uint16_t	num_useq_allocd;
67030 	/* Flags indicating current USEQ engine state */
67031 	uint32_t	useq_resp_flags;
67032 	/* When set, there is at least some data available to be delivered */
67033 	#define HWRM_DBG_USEQ_FLUSH_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
67034 	/* When set, all internal buffers are full */
67035 	#define HWRM_DBG_USEQ_FLUSH_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
67036 	#define HWRM_DBG_USEQ_FLUSH_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_LAST	HWRM_DBG_USEQ_FLUSH_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW
67037 	/* Current count of the number of full buffers available for delivery */
67038 	uint8_t	full_cnt;
67039 	/* Reserved */
67040 	uint8_t	useq_resp_unused_0[3];
67041 	/* This field is reserved */
67042 	uint32_t	unused_0;
67043 	/*
67044 	 * This field is used in Output records to indicate that the output
67045 	 * is completely written to RAM. This field should be read as '1'
67046 	 * to indicate that the output has been completely written. When
67047 	 * writing a command completion or response to an internal processor,
67048 	 * the order of writes has to be such that this field is written last.
67049 	 */
67050 	uint32_t	valid;
67051 } hwrm_dbg_useq_flush_output_t, *phwrm_dbg_useq_flush_output_t;
67052 
67053 /************************
67054  * hwrm_dbg_useq_cw_cfg *
67055  ************************/
67056 
67057 
67058 /* hwrm_dbg_useq_cw_cfg_input (size:960b/120B) */
67059 
67060 typedef struct hwrm_dbg_useq_cw_cfg_input {
67061 	/* The HWRM command request type. */
67062 	uint16_t	req_type;
67063 	/*
67064 	 * The completion ring to send the completion event on. This should
67065 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
67066 	 */
67067 	uint16_t	cmpl_ring;
67068 	/*
67069 	 * The sequence ID is used by the driver for tracking multiple
67070 	 * commands. This ID is treated as opaque data by the firmware and
67071 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
67072 	 */
67073 	uint16_t	seq_id;
67074 	/*
67075 	 * The target ID of the command:
67076 	 * * 0x0-0xFFF8 - The function ID
67077 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
67078 	 * * 0xFFFD - Reserved for user-space HWRM interface
67079 	 * * 0xFFFF - HWRM
67080 	 */
67081 	uint16_t	target_id;
67082 	/*
67083 	 * A physical address pointer pointing to a host buffer that the
67084 	 * command's response data will be written. This can be either a host
67085 	 * physical address (HPA) or a guest physical address (GPA) and must
67086 	 * point to a physically contiguous block of memory.
67087 	 */
67088 	uint64_t	resp_addr;
67089 	/* The USID of the sequence being configured */
67090 	uint16_t	usid;
67091 	/*
67092 	 * The code words given in this message will be placed
67093 	 * at this offset from the starting code word for this
67094 	 * usid. NOTE: when offset is zero, the first 6 32-bit
67095 	 * words may contain values for F0-F7 as well as the
67096 	 * main code word index. This is determined by checking
67097 	 * the usid_ctrl_present flag.
67098 	 */
67099 	uint16_t	offset;
67100 	/*
67101 	 * When the use_dma flag is clear, this is the length in bytes
67102 	 * to be digested from the opaque data area.
67103 	 */
67104 	uint16_t	size;
67105 	/*
67106 	 * Flags associated with the current message
67107 	 * data area.
67108 	 */
67109 	uint16_t	flags;
67110 	/*
67111 	 * When set, the opaque data begins with a block of control
67112 	 * information to be associated with the usid. This includes
67113 	 * F0-F7 code word indexes as well as the code word index for
67114 	 * main.
67115 	 */
67116 	#define HWRM_DBG_USEQ_CW_CFG_INPUT_FLAGS_USID_CTRL_PRESENT UINT32_C(0x1)
67117 	/*
67118 	 * When set, opaque contains a 64b host address used to DMA
67119 	 * the entire code word sequence. The offset within the
67120 	 * opaque data depends on the state of other flags.
67121 	 */
67122 	#define HWRM_DBG_USEQ_CW_CFG_INPUT_FLAGS_USE_DMA	UINT32_C(0x2)
67123 	/*
67124 	 * When set, this message is the last configuration message
67125 	 * for the given usid.
67126 	 */
67127 	#define HWRM_DBG_USEQ_CW_CFG_INPUT_FLAGS_END		UINT32_C(0x8000)
67128 	#define HWRM_DBG_USEQ_CW_CFG_INPUT_FLAGS_LAST		HWRM_DBG_USEQ_CW_CFG_INPUT_FLAGS_END
67129 	/* command dependent data (e.g. function id for host dma command) */
67130 	uint32_t	opaque[24];
67131 } hwrm_dbg_useq_cw_cfg_input_t, *phwrm_dbg_useq_cw_cfg_input_t;
67132 
67133 /* hwrm_dbg_useq_cw_cfg_output (size:192b/24B) */
67134 
67135 typedef struct hwrm_dbg_useq_cw_cfg_output {
67136 	/* The specific error status for the command. */
67137 	uint16_t	error_code;
67138 	/* The HWRM command request type. */
67139 	uint16_t	req_type;
67140 	/* The sequence ID from the original command. */
67141 	uint16_t	seq_id;
67142 	/* The length of the response data in number of bytes. */
67143 	uint16_t	resp_len;
67144 	/* Non-zero firmware timestamp */
67145 	uint32_t	nz_fw_timestamp;
67146 	/* The last selected USID */
67147 	uint16_t	last_usid;
67148 	/* The number of USEQs currently allocated */
67149 	uint16_t	num_useq_allocd;
67150 	/* Flags indicating current USEQ engine state */
67151 	uint32_t	useq_resp_flags;
67152 	/* When set, there is at least some data available to be delivered */
67153 	#define HWRM_DBG_USEQ_CW_CFG_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
67154 	/* When set, all internal buffers are full */
67155 	#define HWRM_DBG_USEQ_CW_CFG_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
67156 	#define HWRM_DBG_USEQ_CW_CFG_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_LAST	HWRM_DBG_USEQ_CW_CFG_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW
67157 	/* Current count of the number of full buffers available for delivery */
67158 	uint8_t	full_cnt;
67159 	/* Reserved */
67160 	uint8_t	useq_resp_unused_0[3];
67161 } hwrm_dbg_useq_cw_cfg_output_t, *phwrm_dbg_useq_cw_cfg_output_t;
67162 
67163 /***********************
67164  * hwrm_dbg_useq_qcaps *
67165  ***********************/
67166 
67167 
67168 /* hwrm_dbg_useq_qcaps_input (size:128b/16B) */
67169 
67170 typedef struct hwrm_dbg_useq_qcaps_input {
67171 	/* The HWRM command request type. */
67172 	uint16_t	req_type;
67173 	/*
67174 	 * The completion ring to send the completion event on. This should
67175 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
67176 	 */
67177 	uint16_t	cmpl_ring;
67178 	/*
67179 	 * The sequence ID is used by the driver for tracking multiple
67180 	 * commands. This ID is treated as opaque data by the firmware and
67181 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
67182 	 */
67183 	uint16_t	seq_id;
67184 	/*
67185 	 * The target ID of the command:
67186 	 * * 0x0-0xFFF8 - The function ID
67187 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
67188 	 * * 0xFFFD - Reserved for user-space HWRM interface
67189 	 * * 0xFFFF - HWRM
67190 	 */
67191 	uint16_t	target_id;
67192 	/*
67193 	 * A physical address pointer pointing to a host buffer that the
67194 	 * command's response data will be written. This can be either a host
67195 	 * physical address (HPA) or a guest physical address (GPA) and must
67196 	 * point to a physically contiguous block of memory.
67197 	 */
67198 	uint64_t	resp_addr;
67199 } hwrm_dbg_useq_qcaps_input_t, *phwrm_dbg_useq_qcaps_input_t;
67200 
67201 /* hwrm_dbg_useq_qcaps_output (size:384b/48B) */
67202 
67203 typedef struct hwrm_dbg_useq_qcaps_output {
67204 	/* The specific error status for the command. */
67205 	uint16_t	error_code;
67206 	/* The HWRM command request type. */
67207 	uint16_t	req_type;
67208 	/* The sequence ID from the original command. */
67209 	uint16_t	seq_id;
67210 	/* The length of the response data in number of bytes. */
67211 	uint16_t	resp_len;
67212 	/* Non-zero firmware timestamp */
67213 	uint32_t	nz_fw_timestamp;
67214 	/* The last selected USID */
67215 	uint16_t	last_usid;
67216 	/* The number of USEQs currently allocated */
67217 	uint16_t	num_useq_allocd;
67218 	/* Flags indicating current USEQ engine state */
67219 	uint32_t	useq_resp_flags;
67220 	/* When set, there is at least some data available to be delivered */
67221 	#define HWRM_DBG_USEQ_QCAPS_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
67222 	/* When set, all internal buffers are full */
67223 	#define HWRM_DBG_USEQ_QCAPS_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
67224 	#define HWRM_DBG_USEQ_QCAPS_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_LAST	HWRM_DBG_USEQ_QCAPS_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW
67225 	/* Current count of the number of full buffers available for delivery */
67226 	uint8_t	full_cnt;
67227 	/* Reserved */
67228 	uint8_t	useq_resp_unused_0[3];
67229 	/* Maximum number of USEQ that can be tracked by firmware */
67230 	uint32_t	max_num_useq;
67231 	/* Maximum number of code word bytes for a single USEQ */
67232 	uint32_t	max_useq_size;
67233 	/* The maximum number of output bytes a single USEQ may generate */
67234 	uint32_t	max_useq_32b_output_size;
67235 	/* The number of internal USEQ output buffers, each of 4096 bytes */
67236 	uint32_t	num_buf;
67237 	/* This field is reserved */
67238 	uint32_t	unused_0;
67239 	/*
67240 	 * This field is used in Output records to indicate that the output
67241 	 * is completely written to RAM. This field should be read as '1'
67242 	 * to indicate that the output has been completely written. When
67243 	 * writing a command completion or response to an internal processor,
67244 	 * the order of writes has to be such that this field is written last.
67245 	 */
67246 	uint32_t	valid;
67247 } hwrm_dbg_useq_qcaps_output_t, *phwrm_dbg_useq_qcaps_output_t;
67248 
67249 /***************************
67250  * hwrm_dbg_useq_sched_cfg *
67251  ***************************/
67252 
67253 
67254 /* hwrm_dbg_useq_sched_cfg_input (size:192b/24B) */
67255 
67256 typedef struct hwrm_dbg_useq_sched_cfg_input {
67257 	/* The HWRM command request type. */
67258 	uint16_t	req_type;
67259 	/*
67260 	 * The completion ring to send the completion event on. This should
67261 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
67262 	 */
67263 	uint16_t	cmpl_ring;
67264 	/*
67265 	 * The sequence ID is used by the driver for tracking multiple
67266 	 * commands. This ID is treated as opaque data by the firmware and
67267 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
67268 	 */
67269 	uint16_t	seq_id;
67270 	/*
67271 	 * The target ID of the command:
67272 	 * * 0x0-0xFFF8 - The function ID
67273 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
67274 	 * * 0xFFFD - Reserved for user-space HWRM interface
67275 	 * * 0xFFFF - HWRM
67276 	 */
67277 	uint16_t	target_id;
67278 	/*
67279 	 * A physical address pointer pointing to a host buffer that the
67280 	 * command's response data will be written. This can be either a host
67281 	 * physical address (HPA) or a guest physical address (GPA) and must
67282 	 * point to a physically contiguous block of memory.
67283 	 */
67284 	uint64_t	resp_addr;
67285 	/* Enumeration values for enabling, disabling scheduler */
67286 	uint16_t	global_cfg;
67287 	/* This value will leave the global scheduler in its current state */
67288 	#define HWRM_DBG_USEQ_SCHED_CFG_INPUT_NO_CHANGE UINT32_C(0x0)
67289 	/*
67290 	 * This value disables the global scheduler. This mode must be used
67291 	 * when the RUN command is being used to run individual sequences.
67292 	 */
67293 	#define HWRM_DBG_USEQ_SCHED_CFG_INPUT_DISABLE   UINT32_C(0x1)
67294 	/*
67295 	 * This value enables the global scheduler. When enabled, USEQs will
67296 	 * be scheduled based on their polling intervals
67297 	 */
67298 	#define HWRM_DBG_USEQ_SCHED_CFG_INPUT_ENABLE	UINT32_C(0x2)
67299 	#define HWRM_DBG_USEQ_SCHED_CFG_INPUT_LAST	HWRM_DBG_USEQ_SCHED_CFG_INPUT_ENABLE
67300 	/*
67301 	 * The given polling interval will be associated with this USID. A
67302 	 * value of -1 indicates that the USID is invalid. The invalid USID is
67303 	 * used when using this message only for global scheduler
67304 	 * configuration.
67305 	 */
67306 	uint16_t	usid;
67307 	/* This value represents microseconds between runs of the USEQ */
67308 	uint32_t	polling_interval;
67309 } hwrm_dbg_useq_sched_cfg_input_t, *phwrm_dbg_useq_sched_cfg_input_t;
67310 
67311 /* hwrm_dbg_useq_sched_cfg_output (size:256b/32B) */
67312 
67313 typedef struct hwrm_dbg_useq_sched_cfg_output {
67314 	/* The specific error status for the command. */
67315 	uint16_t	error_code;
67316 	/* The HWRM command request type. */
67317 	uint16_t	req_type;
67318 	/* The sequence ID from the original command. */
67319 	uint16_t	seq_id;
67320 	/* The length of the response data in number of bytes. */
67321 	uint16_t	resp_len;
67322 	/* Non-zero firmware timestamp */
67323 	uint32_t	nz_fw_timestamp;
67324 	/* The last selected USID */
67325 	uint16_t	last_usid;
67326 	/* The number of USEQs currently allocated */
67327 	uint16_t	num_useq_allocd;
67328 	/* Flags indicating current USEQ engine state */
67329 	uint32_t	useq_resp_flags;
67330 	/* When set, there is at least some data available to be delivered */
67331 	#define HWRM_DBG_USEQ_SCHED_CFG_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
67332 	/* When set, all internal buffers are full */
67333 	#define HWRM_DBG_USEQ_SCHED_CFG_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
67334 	#define HWRM_DBG_USEQ_SCHED_CFG_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_LAST	HWRM_DBG_USEQ_SCHED_CFG_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW
67335 	/* Current count of the number of full buffers available for delivery */
67336 	uint8_t	full_cnt;
67337 	/* Reserved */
67338 	uint8_t	useq_resp_unused_0[3];
67339 	/* This field is reserved */
67340 	uint32_t	unused_0;
67341 	/*
67342 	 * This field is used in Output records to indicate that the output
67343 	 * is completely written to RAM. This field should be read as '1'
67344 	 * to indicate that the output has been completely written. When
67345 	 * writing a command completion or response to an internal processor,
67346 	 * the order of writes has to be such that this field is written last.
67347 	 */
67348 	uint32_t	valid;
67349 } hwrm_dbg_useq_sched_cfg_output_t, *phwrm_dbg_useq_sched_cfg_output_t;
67350 
67351 /*********************
67352  * hwrm_dbg_useq_run *
67353  *********************/
67354 
67355 
67356 /* hwrm_dbg_useq_run_input (size:320b/40B) */
67357 
67358 typedef struct hwrm_dbg_useq_run_input {
67359 	/* The HWRM command request type. */
67360 	uint16_t	req_type;
67361 	/*
67362 	 * The completion ring to send the completion event on. This should
67363 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
67364 	 */
67365 	uint16_t	cmpl_ring;
67366 	/*
67367 	 * The sequence ID is used by the driver for tracking multiple
67368 	 * commands. This ID is treated as opaque data by the firmware and
67369 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
67370 	 */
67371 	uint16_t	seq_id;
67372 	/*
67373 	 * The target ID of the command:
67374 	 * * 0x0-0xFFF8 - The function ID
67375 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
67376 	 * * 0xFFFD - Reserved for user-space HWRM interface
67377 	 * * 0xFFFF - HWRM
67378 	 */
67379 	uint16_t	target_id;
67380 	/*
67381 	 * A physical address pointer pointing to a host buffer that the
67382 	 * command's response data will be written. This can be either a host
67383 	 * physical address (HPA) or a guest physical address (GPA) and must
67384 	 * point to a physically contiguous block of memory.
67385 	 */
67386 	uint64_t	resp_addr;
67387 	/* The USID to be run */
67388 	uint16_t	usid;
67389 	/* Type of run to execute for the given USID */
67390 	uint8_t	run_type;
67391 	/* This run type will execute the requested USEQ only a single time */
67392 	#define HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_SINGLE   UINT32_C(0x0)
67393 	/*
67394 	 * This run type will execute the requested USEQ a number of times
67395 	 * given by run_cnt with a run interval given by the run_interval
67396 	 * parameter.
67397 	 */
67398 	#define HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_CNT	UINT32_C(0x1)
67399 	/*
67400 	 * This run type will execute the requested USEQ as many times as it
67401 	 * needs to fill an entire buffer to return to the host. The runs
67402 	 * will occur with a run interval given by the run_interval
67403 	 * parameter.
67404 	 */
67405 	#define HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_FILL_BUF UINT32_C(0x2)
67406 	#define HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_LAST	HWRM_DBG_USEQ_RUN_INPUT_RUN_TYPE_FILL_BUF
67407 	/*
67408 	 * If indicated by flags, this represents the number of times to run
67409 	 * the USEQ. Note that runs are stopped if the buffer fills prior
67410 	 * regardless of the number of runs. For example, if a run_cnt of 10 is
67411 	 * specified and 3 runs results in the buffer being full then only 3
67412 	 * runs are executed.
67413 	 */
67414 	uint8_t	run_cnt;
67415 	/*
67416 	 * This value represents microseconds between runs of the USEQ when
67417 	 * running multiple times as indicated by flags.
67418 	 */
67419 	uint32_t	run_interval;
67420 	/*
67421 	 * Address of the host buffer where collected USEQ output data will be
67422 	 * placed
67423 	 */
67424 	uint64_t	host_dest_addr;
67425 	/*
67426 	 * Size, in bytes, of the memory associated with host_dest_addr. It is
67427 	 * expected that this is >= 4096
67428 	 */
67429 	uint32_t	host_dest_len;
67430 	/* This field is reserved */
67431 	uint32_t	unused_0;
67432 } hwrm_dbg_useq_run_input_t, *phwrm_dbg_useq_run_input_t;
67433 
67434 /* hwrm_dbg_useq_run_output (size:256b/32B) */
67435 
67436 typedef struct hwrm_dbg_useq_run_output {
67437 	/* The specific error status for the command. */
67438 	uint16_t	error_code;
67439 	/* The HWRM command request type. */
67440 	uint16_t	req_type;
67441 	/* The sequence ID from the original command. */
67442 	uint16_t	seq_id;
67443 	/* The length of the response data in number of bytes. */
67444 	uint16_t	resp_len;
67445 	/* Non-zero firmware timestamp */
67446 	uint32_t	nz_fw_timestamp;
67447 	/* The last selected USID */
67448 	uint16_t	last_usid;
67449 	/* The number of USEQs currently allocated */
67450 	uint16_t	num_useq_allocd;
67451 	/* Flags indicating current USEQ engine state */
67452 	uint32_t	useq_resp_flags;
67453 	/* When set, there is at least some data available to be delivered */
67454 	#define HWRM_DBG_USEQ_RUN_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
67455 	/* When set, all internal buffers are full */
67456 	#define HWRM_DBG_USEQ_RUN_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
67457 	#define HWRM_DBG_USEQ_RUN_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_LAST	HWRM_DBG_USEQ_RUN_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW
67458 	/* Current count of the number of full buffers available for delivery */
67459 	uint8_t	full_cnt;
67460 	/* Reserved */
67461 	uint8_t	useq_resp_unused_0[3];
67462 	/*
67463 	 * The length, in bytes, of the amount of data placed in the
67464 	 * corresponding host_dest_addr given in the input message. This will
67465 	 * always be a multiple of 4096
67466 	 */
67467 	uint32_t	host_dest_filled_len;
67468 	/*
67469 	 * This field is used in Output records to indicate that the output
67470 	 * is completely written to RAM. This field should be read as '1'
67471 	 * to indicate that the output has been completely written. When
67472 	 * writing a command completion or response to an internal processor,
67473 	 * the order of writes has to be such that this field is written last.
67474 	 */
67475 	uint32_t	valid;
67476 } hwrm_dbg_useq_run_output_t, *phwrm_dbg_useq_run_output_t;
67477 
67478 /******************************
67479  * hwrm_dbg_useq_delivery_req *
67480  ******************************/
67481 
67482 
67483 /* hwrm_dbg_useq_delivery_req_input (size:896b/112B) */
67484 
67485 typedef struct hwrm_dbg_useq_delivery_req_input {
67486 	/* The HWRM command request type. */
67487 	uint16_t	req_type;
67488 	/*
67489 	 * The completion ring to send the completion event on. This should
67490 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
67491 	 */
67492 	uint16_t	cmpl_ring;
67493 	/*
67494 	 * The sequence ID is used by the driver for tracking multiple
67495 	 * commands. This ID is treated as opaque data by the firmware and
67496 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
67497 	 */
67498 	uint16_t	seq_id;
67499 	/*
67500 	 * The target ID of the command:
67501 	 * * 0x0-0xFFF8 - The function ID
67502 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
67503 	 * * 0xFFFD - Reserved for user-space HWRM interface
67504 	 * * 0xFFFF - HWRM
67505 	 */
67506 	uint16_t	target_id;
67507 	/*
67508 	 * A physical address pointer pointing to a host buffer that the
67509 	 * command's response data will be written. This can be either a host
67510 	 * physical address (HPA) or a guest physical address (GPA) and must
67511 	 * point to a physically contiguous block of memory.
67512 	 */
67513 	uint64_t	resp_addr;
67514 	/*
67515 	 * Eight destination addresses provide host memory space for FW to
67516 	 * deliver USEQ output details. A value of 0x0 for the address can be
67517 	 * used to inform FW that the buffer is not available.
67518 	 */
67519 	uint64_t	host_dest_addrs[8];
67520 	/*
67521 	 * The length, in bytes, of the corresponding host_dest_addrs array
67522 	 * entry. Each valid hist_dest_addrs entry must have a len of at least
67523 	 * 4096 bytes.
67524 	 */
67525 	uint32_t	host_dest_len[8];
67526 } hwrm_dbg_useq_delivery_req_input_t, *phwrm_dbg_useq_delivery_req_input_t;
67527 
67528 /* hwrm_dbg_useq_delivery_req_output (size:512b/64B) */
67529 
67530 typedef struct hwrm_dbg_useq_delivery_req_output {
67531 	/* The specific error status for the command. */
67532 	uint16_t	error_code;
67533 	/* The HWRM command request type. */
67534 	uint16_t	req_type;
67535 	/* The sequence ID from the original command. */
67536 	uint16_t	seq_id;
67537 	/* The length of the response data in number of bytes. */
67538 	uint16_t	resp_len;
67539 	/* Non-zero firmware timestamp */
67540 	uint32_t	nz_fw_timestamp;
67541 	/* The last selected USID */
67542 	uint16_t	last_usid;
67543 	/* The number of USEQs currently allocated */
67544 	uint16_t	num_useq_allocd;
67545 	/* Flags indicating current USEQ engine state */
67546 	uint32_t	useq_resp_flags;
67547 	/* When set, there is at least some data available to be delivered */
67548 	#define HWRM_DBG_USEQ_DELIVERY_REQ_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_AVAIL	UINT32_C(0x1)
67549 	/* When set, all internal buffers are full */
67550 	#define HWRM_DBG_USEQ_DELIVERY_REQ_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW UINT32_C(0x2)
67551 	#define HWRM_DBG_USEQ_DELIVERY_REQ_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_LAST	HWRM_DBG_USEQ_DELIVERY_REQ_OUTPUT_HWRM_DBG_USEQ_RESP_HDR_USEQ_RESP_FLAGS_OVERFLOW
67552 	/* Current count of the number of full buffers available for delivery */
67553 	uint8_t	full_cnt;
67554 	/* Reserved */
67555 	uint8_t	useq_resp_unused_0[3];
67556 	/*
67557 	 * The length, in bytes, of the amount of data placed in the
67558 	 * corresponding host_dest_addrs entry given in the input message. This
67559 	 * will always be a multiple of 4096.
67560 	 */
67561 	uint32_t	host_dest_filled_len[8];
67562 	/* This field is reserved */
67563 	uint32_t	unused_0;
67564 	/*
67565 	 * This field is used in Output records to indicate that the output
67566 	 * is completely written to RAM. This field should be read as '1'
67567 	 * to indicate that the output has been completely written. When
67568 	 * writing a command completion or response to an internal processor,
67569 	 * the order of writes has to be such that this field is written last.
67570 	 */
67571 	uint32_t	valid;
67572 } hwrm_dbg_useq_delivery_req_output_t, *phwrm_dbg_useq_delivery_req_output_t;
67573 
67574 /*****************************
67575  * hwrm_dbg_log_buffer_flush *
67576  *****************************/
67577 
67578 
67579 /* hwrm_dbg_log_buffer_flush_input (size:192b/24B) */
67580 
67581 typedef struct hwrm_dbg_log_buffer_flush_input {
67582 	/* The HWRM command request type. */
67583 	uint16_t	req_type;
67584 	/*
67585 	 * The completion ring to send the completion event on. This should
67586 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
67587 	 */
67588 	uint16_t	cmpl_ring;
67589 	/*
67590 	 * The sequence ID is used by the driver for tracking multiple
67591 	 * commands. This ID is treated as opaque data by the firmware and
67592 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
67593 	 */
67594 	uint16_t	seq_id;
67595 	/*
67596 	 * The target ID of the command:
67597 	 * * 0x0-0xFFF8 - The function ID
67598 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
67599 	 * * 0xFFFD - Reserved for user-space HWRM interface
67600 	 * * 0xFFFF - HWRM
67601 	 */
67602 	uint16_t	target_id;
67603 	/*
67604 	 * A physical address pointer pointing to a host buffer that the
67605 	 * command's response data will be written. This can be either a host
67606 	 * physical address (HPA) or a guest physical address (GPA) and must
67607 	 * point to a physically contiguous block of memory.
67608 	 */
67609 	uint64_t	resp_addr;
67610 	/* Type of trace buffer to flush. */
67611 	uint16_t	type;
67612 	/* SRT trace. */
67613 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_SRT_TRACE	UINT32_C(0x0)
67614 	/* SRT2 trace. */
67615 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_SRT2_TRACE	UINT32_C(0x1)
67616 	/* CRT trace. */
67617 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_CRT_TRACE	UINT32_C(0x2)
67618 	/* CRT2 trace. */
67619 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_CRT2_TRACE	UINT32_C(0x3)
67620 	/* RIGP0 trace. */
67621 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_RIGP0_TRACE	UINT32_C(0x4)
67622 	/* L2 HWRM trace. */
67623 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_L2_HWRM_TRACE   UINT32_C(0x5)
67624 	/* RoCE HWRM trace. */
67625 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_ROCE_HWRM_TRACE UINT32_C(0x6)
67626 	/* Context Accelerator CPU 0 trace. */
67627 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_CA0_TRACE	UINT32_C(0x7)
67628 	/* Context Accelerator CPU 1 trace. */
67629 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_CA1_TRACE	UINT32_C(0x8)
67630 	/* Context Accelerator CPU 2 trace. */
67631 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_CA2_TRACE	UINT32_C(0x9)
67632 	/* RIGP1 trace. */
67633 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_RIGP1_TRACE	UINT32_C(0xa)
67634 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_LAST	HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_RIGP1_TRACE
67635 	uint8_t	unused_1[2];
67636 	/* Control flags. */
67637 	uint32_t	flags;
67638 	/*
67639 	 * When set, it indicates that all buffers should be flushed.
67640 	 * The type will be ignored.
67641 	 */
67642 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_FLAGS_FLUSH_ALL_BUFFERS	UINT32_C(0x1)
67643 } hwrm_dbg_log_buffer_flush_input_t, *phwrm_dbg_log_buffer_flush_input_t;
67644 
67645 /* hwrm_dbg_log_buffer_flush_output (size:128b/16B) */
67646 
67647 typedef struct hwrm_dbg_log_buffer_flush_output {
67648 	/* The specific error status for the command. */
67649 	uint16_t	error_code;
67650 	/* The HWRM command request type. */
67651 	uint16_t	req_type;
67652 	/* The sequence ID from the original command. */
67653 	uint16_t	seq_id;
67654 	/* The length of the response data in number of bytes. */
67655 	uint16_t	resp_len;
67656 	/*
67657 	 * Specifies the current host buffer offset. Data up to this offset
67658 	 * has been populated by the firmware. For example, if the firmware
67659 	 * has DMA-ed 8192 bytes to the host buffer, then this field has a
67660 	 * value of 8192. This field rolls over to zero once the firmware
67661 	 * writes the last page of the host buffer
67662 	 */
67663 	uint32_t	current_buffer_offset;
67664 	uint8_t	unused_1[3];
67665 	/*
67666 	 * This field is used in Output records to indicate that the output
67667 	 * is completely written to RAM. This field should be read as '1'
67668 	 * to indicate that the output has been completely written. When
67669 	 * writing a command completion or response to an internal processor,
67670 	 * the order of writes has to be such that this field is written last.
67671 	 */
67672 	uint8_t	valid;
67673 } hwrm_dbg_log_buffer_flush_output_t, *phwrm_dbg_log_buffer_flush_output_t;
67674 
67675 /************************
67676  * hwrm_dbg_serdes_test *
67677  ************************/
67678 
67679 
67680 /* hwrm_dbg_serdes_test_input (size:320b/40B) */
67681 
67682 typedef struct hwrm_dbg_serdes_test_input {
67683 	/* The HWRM command request type. */
67684 	uint16_t	req_type;
67685 	/*
67686 	 * The completion ring to send the completion event on. This should
67687 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
67688 	 */
67689 	uint16_t	cmpl_ring;
67690 	/*
67691 	 * The sequence ID is used by the driver for tracking multiple
67692 	 * commands. This ID is treated as opaque data by the firmware and
67693 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
67694 	 */
67695 	uint16_t	seq_id;
67696 	/*
67697 	 * The target ID of the command:
67698 	 * * 0x0-0xFFF8 - The function ID
67699 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
67700 	 * * 0xFFFD - Reserved for user-space HWRM interface
67701 	 * * 0xFFFF - HWRM
67702 	 */
67703 	uint16_t	target_id;
67704 	/*
67705 	 * A physical address pointer pointing to a host buffer that the
67706 	 * command's response data will be written. This can be either a host
67707 	 * physical address (HPA) or a guest physical address (GPA) and must
67708 	 * point to a physically contiguous block of memory.
67709 	 */
67710 	uint64_t	resp_addr;
67711 	/* Host address data is to DMA'd to. */
67712 	uint64_t	resp_data_addr;
67713 	/*
67714 	 * This field contains the offset into the captured data to begin
67715 	 * copying the data to the host from. This should be set to 0 on the
67716 	 * initial call to this command.
67717 	 */
67718 	uint32_t	resp_data_offset;
67719 	/*
67720 	 * Size of the buffer pointed to by resp_data_addr. The firmware may
67721 	 * use this entire buffer or less than the entire buffer, but never
67722 	 * more.
67723 	 */
67724 	uint16_t	data_len;
67725 	/*
67726 	 * This field allows this command to request the individual serdes
67727 	 * tests to be run using this command.
67728 	 */
67729 	uint8_t	flags;
67730 	/* Unused. */
67731 	#define HWRM_DBG_SERDES_TEST_INPUT_FLAGS_UNUSED_TEST_MASK	UINT32_C(0x7)
67732 	#define HWRM_DBG_SERDES_TEST_INPUT_FLAGS_UNUSED_TEST_SFT	0
67733 	/* Display eye_projection */
67734 	#define HWRM_DBG_SERDES_TEST_INPUT_FLAGS_EYE_PROJECTION	UINT32_C(0x8)
67735 	/* Run the PCIe serdes test. */
67736 	#define HWRM_DBG_SERDES_TEST_INPUT_FLAGS_PCIE_SERDES_TEST	UINT32_C(0x10)
67737 	/* Run the Ethernet serdes test. */
67738 	#define HWRM_DBG_SERDES_TEST_INPUT_FLAGS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
67739 	uint8_t	options;
67740 	/*
67741 	 * This field represents the lane number on which tools wants to
67742 	 * retrieve eye plot. This field is valid only when pcie_serdes_test
67743 	 * or ethernet_serdes_test flag is set. For pcie_serdes_test, the
67744 	 * maximum value is the device pcie lane width minus 1. For
67745 	 * ethernet_serdes_test, the maximum value is the total lanes of
67746 	 * the network port minus 1. Valid values from 0 to 16.
67747 	 */
67748 	#define HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_LANE_NO_MASK	UINT32_C(0xf)
67749 	#define HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_LANE_NO_SFT	0
67750 	/* This value indicates the Horizontal or vertical plot direction. */
67751 	#define HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_DIRECTION		UINT32_C(0x10)
67752 	/* Value 0 indicates Horizontal plot request. */
67753 		#define HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_DIRECTION_HORIZONTAL	(UINT32_C(0x0) << 4)
67754 	/* Value 1 indicates vertical plot request. */
67755 		#define HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_DIRECTION_VERTICAL	(UINT32_C(0x1) << 4)
67756 		#define HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_DIRECTION_LAST	HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_DIRECTION_VERTICAL
67757 	/* This value indicates eye projection type */
67758 	#define HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_PROJ_TYPE		UINT32_C(0x20)
67759 	/*
67760 	 * Value 0 indicates left/top projection in horizontal/vertical
67761 	 * This value is valid only when eye_projection flag was set.
67762 	 */
67763 		#define HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_PROJ_TYPE_LEFT_TOP	(UINT32_C(0x0) << 5)
67764 	/*
67765 	 * Value 1 indicates right/bottom projection in
67766 	 * horizontal/vertical. This value is valid only when
67767 	 * eye_projection flag was set.
67768 	 */
67769 		#define HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_PROJ_TYPE_RIGHT_BOTTOM  (UINT32_C(0x1) << 5)
67770 		#define HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_PROJ_TYPE_LAST	HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_PROJ_TYPE_RIGHT_BOTTOM
67771 	/* Reserved for future. */
67772 	#define HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_RSVD_MASK		UINT32_C(0xc0)
67773 	#define HWRM_DBG_SERDES_TEST_INPUT_OPTIONS_RSVD_SFT		6
67774 	/*
67775 	 * This field allows this command to request a specific targetBER
67776 	 * to be run using this command.
67777 	 */
67778 	uint8_t	targetBER;
67779 	/* When collecting an eyescope, measure with a target BER of 1e-8 */
67780 	#define HWRM_DBG_SERDES_TEST_INPUT_TARGETBER_BER_1E8  UINT32_C(0x0)
67781 	/* When collecting an eyescope, measure with a target BER of 1e-9 */
67782 	#define HWRM_DBG_SERDES_TEST_INPUT_TARGETBER_BER_1E9  UINT32_C(0x1)
67783 	/* When collecting an eyescope, measure with a target BER of 1e-10 */
67784 	#define HWRM_DBG_SERDES_TEST_INPUT_TARGETBER_BER_1E10 UINT32_C(0x2)
67785 	/* When collecting an eyescope, measure with a target BER of 1e-11 */
67786 	#define HWRM_DBG_SERDES_TEST_INPUT_TARGETBER_BER_1E11 UINT32_C(0x3)
67787 	/* When collecting an eyescope, measure with a target BER of 1e-12 */
67788 	#define HWRM_DBG_SERDES_TEST_INPUT_TARGETBER_BER_1E12 UINT32_C(0x4)
67789 	#define HWRM_DBG_SERDES_TEST_INPUT_TARGETBER_LAST	HWRM_DBG_SERDES_TEST_INPUT_TARGETBER_BER_1E12
67790 	/*
67791 	 * This field allows this command to specify the action to take when
67792 	 * collecting an eyescope.
67793 	 */
67794 	uint8_t	action;
67795 	/*
67796 	 * Value 0 indicates that collection of the eyescope should be
67797 	 * returned synchronously in the output. This only applies to
67798 	 * a targetBER of 1e-8.
67799 	 */
67800 	#define HWRM_DBG_SERDES_TEST_INPUT_ACTION_SYNCHRONOUS UINT32_C(0x0)
67801 	/*
67802 	 * Value 1 indicates to the firmware to start the collection of the
67803 	 * eyescope.
67804 	 */
67805 	#define HWRM_DBG_SERDES_TEST_INPUT_ACTION_START	UINT32_C(0x1)
67806 	/*
67807 	 * Value 2 indicates to the firmware to respond with a progress
67808 	 * percentage of the current eyescope collection from 0.0 to 100.0.
67809 	 */
67810 	#define HWRM_DBG_SERDES_TEST_INPUT_ACTION_PROGRESS	UINT32_C(0x2)
67811 	/*
67812 	 * Value 3 indicates to stop the eyescope. if the progress
67813 	 * percentage is 100.0, the data will be DMAed back to
67814 	 * resp_data_addr.
67815 	 */
67816 	#define HWRM_DBG_SERDES_TEST_INPUT_ACTION_STOP	UINT32_C(0x3)
67817 	#define HWRM_DBG_SERDES_TEST_INPUT_ACTION_LAST	HWRM_DBG_SERDES_TEST_INPUT_ACTION_STOP
67818 	uint8_t	unused[6];
67819 } hwrm_dbg_serdes_test_input_t, *phwrm_dbg_serdes_test_input_t;
67820 
67821 /* hwrm_dbg_serdes_test_output (size:192b/24B) */
67822 
67823 typedef struct hwrm_dbg_serdes_test_output {
67824 	/* The specific error status for the command. */
67825 	uint16_t	error_code;
67826 	/* The HWRM command request type. */
67827 	uint16_t	req_type;
67828 	/* The sequence ID from the original command. */
67829 	uint16_t	seq_id;
67830 	/* The length of the response data in number of bytes. */
67831 	uint16_t	resp_len;
67832 	/* Total length of stored data. */
67833 	uint16_t	total_data_len;
67834 	/*
67835 	 * Amount of data DMA'd to host by this call. The driver can use this
67836 	 * field along with the total_data_len field above to determine the
67837 	 * value to write to the resp_data_offset field in the next call
67838 	 * if more than one call to these commands is required to retrieve all
67839 	 * the stored data.
67840 	 */
67841 	uint16_t	copied_data_len;
67842 	/*
67843 	 * Percentage of completion of collection of BER values from the
67844 	 * current eyescope operation in tenths of a percentage. 0 (0.0) to
67845 	 * 1000 (100.0).
67846 	 */
67847 	uint16_t	progress_percent;
67848 	/* Timeout in seconds for timeout of an individual BER point. */
67849 	uint16_t	timeout;
67850 	uint8_t	flags;
67851 	/*
67852 	 * This value indicates the structure of data returned by the
67853 	 * firmware when DMA'ed to resp_data_addr.
67854 	 */
67855 	#define HWRM_DBG_SERDES_TEST_OUTPUT_FLAGS_BIT_COUNT_TYPE		UINT32_C(0x1)
67856 	/*
67857 	 * Value 0 indicates that bit_count value is a raw total
67858 	 * such that BER = error_count / bit_count.
67859 	 */
67860 		#define HWRM_DBG_SERDES_TEST_OUTPUT_FLAGS_BIT_COUNT_TYPE_BIT_COUNT_TOTAL  UINT32_C(0x0)
67861 	/*
67862 	 * Value 1 indicates that bit count is a power of
67863 	 * 2 that bit_count is normalized to. A Value of 42 indicates
67864 	 * that BER = error_count / 2^42
67865 	 */
67866 		#define HWRM_DBG_SERDES_TEST_OUTPUT_FLAGS_BIT_COUNT_TYPE_BIT_COUNT_POW2   UINT32_C(0x1)
67867 		#define HWRM_DBG_SERDES_TEST_OUTPUT_FLAGS_BIT_COUNT_TYPE_LAST		HWRM_DBG_SERDES_TEST_OUTPUT_FLAGS_BIT_COUNT_TYPE_BIT_COUNT_POW2
67868 	/* Reserved for future. */
67869 	#define HWRM_DBG_SERDES_TEST_OUTPUT_FLAGS_RSVD_MASK			UINT32_C(0xfe)
67870 	#define HWRM_DBG_SERDES_TEST_OUTPUT_FLAGS_RSVD_SFT			1
67871 	uint8_t	unused_0;
67872 	/*
67873 	 * Size of header prepended to the bit_count and error_count array.
67874 	 * Use this value to skip forward to the bit_count and error_count
67875 	 * array.
67876 	 */
67877 	uint16_t	hdr_size;
67878 	uint8_t	unused_1[3];
67879 	/*
67880 	 * This field is used in Output records to indicate that the output
67881 	 * is completely written to RAM. This field should be read as '1'
67882 	 * to indicate that the output has been completely written. When
67883 	 * writing a command completion or response to an internal processor,
67884 	 * the order of writes has to be such that this field is written last.
67885 	 */
67886 	uint8_t	valid;
67887 } hwrm_dbg_serdes_test_output_t, *phwrm_dbg_serdes_test_output_t;
67888 
67889 /*****************************
67890  * hwrm_dbg_coredump_capture *
67891  *****************************/
67892 
67893 
67894 /* hwrm_dbg_coredump_capture_input (size:128b/16B) */
67895 
67896 typedef struct hwrm_dbg_coredump_capture_input {
67897 	/* The HWRM command request type. */
67898 	uint16_t	req_type;
67899 	/*
67900 	 * The completion ring to send the completion event on. This should
67901 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
67902 	 */
67903 	uint16_t	cmpl_ring;
67904 	/*
67905 	 * The sequence ID is used by the driver for tracking multiple
67906 	 * commands. This ID is treated as opaque data by the firmware and
67907 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
67908 	 */
67909 	uint16_t	seq_id;
67910 	/*
67911 	 * The target ID of the command:
67912 	 * * 0x0-0xFFF8 - The function ID
67913 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
67914 	 * * 0xFFFD - Reserved for user-space HWRM interface
67915 	 * * 0xFFFF - HWRM
67916 	 */
67917 	uint16_t	target_id;
67918 	/*
67919 	 * A physical address pointer pointing to a host buffer that the
67920 	 * command's response data will be written. This can be either a host
67921 	 * physical address (HPA) or a guest physical address (GPA) and must
67922 	 * point to a physically contiguous block of memory.
67923 	 */
67924 	uint64_t	resp_addr;
67925 } hwrm_dbg_coredump_capture_input_t, *phwrm_dbg_coredump_capture_input_t;
67926 
67927 /* hwrm_dbg_coredump_capture_output (size:128b/16B) */
67928 
67929 typedef struct hwrm_dbg_coredump_capture_output {
67930 	/* The specific error status for the command. */
67931 	uint16_t	error_code;
67932 	/* The HWRM command request type. */
67933 	uint16_t	req_type;
67934 	/* The sequence ID from the original command. */
67935 	uint16_t	seq_id;
67936 	/* The length of the response data in number of bytes. */
67937 	uint16_t	resp_len;
67938 	uint8_t	unused_0[7];
67939 	/*
67940 	 * This field is used in Output records to indicate that the output
67941 	 * is completely written to RAM. This field should be read as '1'
67942 	 * to indicate that the output has been completely written. When
67943 	 * writing a command completion or response to an internal processor,
67944 	 * the order of writes has to be such that this field is written last.
67945 	 */
67946 	uint8_t	valid;
67947 } hwrm_dbg_coredump_capture_output_t, *phwrm_dbg_coredump_capture_output_t;
67948 
67949 /****************************
67950  * hwrm_dbg_sim_cable_state *
67951  ****************************/
67952 
67953 
67954 /* hwrm_dbg_sim_cable_state_input (size:192b/24B) */
67955 
67956 typedef struct hwrm_dbg_sim_cable_state_input {
67957 	/* The HWRM command request type. */
67958 	uint16_t	req_type;
67959 	/*
67960 	 * The completion ring to send the completion event on. This should
67961 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
67962 	 */
67963 	uint16_t	cmpl_ring;
67964 	/*
67965 	 * The sequence ID is used by the driver for tracking multiple
67966 	 * commands. This ID is treated as opaque data by the firmware and
67967 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
67968 	 */
67969 	uint16_t	seq_id;
67970 	/*
67971 	 * The target ID of the command:
67972 	 * * 0x0-0xFFF8 - The function ID
67973 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
67974 	 * * 0xFFFD - Reserved for user-space HWRM interface
67975 	 * * 0xFFFF - HWRM
67976 	 */
67977 	uint16_t	target_id;
67978 	/*
67979 	 * A physical address pointer pointing to a host buffer that the
67980 	 * command's response data will be written. This can be either a host
67981 	 * physical address (HPA) or a guest physical address (GPA) and must
67982 	 * point to a physically contiguous block of memory.
67983 	 */
67984 	uint64_t	resp_addr;
67985 	/* This field allows this command to specify the action to take. */
67986 	uint8_t	action;
67987 	/* Value 0 indicates to the firmware to insert the cable. */
67988 	#define HWRM_DBG_SIM_CABLE_STATE_INPUT_ACTION_INSERT UINT32_C(0x0)
67989 	/* Value 1 indicates to the firmware to remove the cable. */
67990 	#define HWRM_DBG_SIM_CABLE_STATE_INPUT_ACTION_REMOVE UINT32_C(0x1)
67991 	#define HWRM_DBG_SIM_CABLE_STATE_INPUT_ACTION_LAST  HWRM_DBG_SIM_CABLE_STATE_INPUT_ACTION_REMOVE
67992 	uint8_t	unused_0[7];
67993 } hwrm_dbg_sim_cable_state_input_t, *phwrm_dbg_sim_cable_state_input_t;
67994 
67995 /* hwrm_dbg_sim_cable_state_output (size:128b/16B) */
67996 
67997 typedef struct hwrm_dbg_sim_cable_state_output {
67998 	/* The specific error status for the command. */
67999 	uint16_t	error_code;
68000 	/* The HWRM command request type. */
68001 	uint16_t	req_type;
68002 	/* The sequence ID from the original command. */
68003 	uint16_t	seq_id;
68004 	/* The length of the response data in number of bytes. */
68005 	uint16_t	resp_len;
68006 	uint8_t	unused_0[7];
68007 	/*
68008 	 * This field is used in Output records to indicate that the output
68009 	 * is completely written to RAM. This field should be read as '1'
68010 	 * to indicate that the output has been completely written. When
68011 	 * writing a command completion or response to an internal processor,
68012 	 * the order of writes has to be such that this field is written last.
68013 	 */
68014 	uint8_t	valid;
68015 } hwrm_dbg_sim_cable_state_output_t, *phwrm_dbg_sim_cable_state_output_t;
68016 
68017 /*******************
68018  * hwrm_dbg_ptrace *
68019  *******************/
68020 
68021 
68022 /* hwrm_dbg_ptrace_input (size:320b/40B) */
68023 
68024 typedef struct hwrm_dbg_ptrace_input {
68025 	/* The HWRM command request type. */
68026 	uint16_t	req_type;
68027 	/*
68028 	 * The completion ring to send the completion event on. This should
68029 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
68030 	 */
68031 	uint16_t	cmpl_ring;
68032 	/*
68033 	 * The sequence ID is used by the driver for tracking multiple
68034 	 * commands. This ID is treated as opaque data by the firmware and
68035 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
68036 	 */
68037 	uint16_t	seq_id;
68038 	/*
68039 	 * The target ID of the command:
68040 	 * * 0x0-0xFFF8 - The function ID
68041 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
68042 	 * * 0xFFFD - Reserved for user-space HWRM interface
68043 	 * * 0xFFFF - HWRM
68044 	 */
68045 	uint16_t	target_id;
68046 	/*
68047 	 * A physical address pointer pointing to a host buffer that the
68048 	 * command's response data will be written. This can be either a host
68049 	 * physical address (HPA) or a guest physical address (GPA) and must
68050 	 * point to a physically contiguous block of memory.
68051 	 */
68052 	uint64_t	resp_addr;
68053 	/*
68054 	 * Physical address pointer pointing to a host buffer that the PDI
68055 	 * command's input request. This can be either a host physical address
68056 	 * (HPA) or a guest physical address (GPA) and must point to a
68057 	 * physically contiguous block of memory.
68058 	 */
68059 	uint64_t	pdi_cmd_buf_addr;
68060 	/*
68061 	 * Physical address pointer pointing to a host buffer that the
68062 	 * command's response data will be written. This can be either a host
68063 	 * physical address (HPA) or a guest physical address (GPA) and must
68064 	 * point to a physically contiguous block of memory.
68065 	 */
68066 	uint64_t	pdi_resp_buf_addr;
68067 	/* Host PDI request buffer length. */
68068 	uint32_t	pdi_req_buf_len;
68069 	uint16_t	seq_no;
68070 	uint16_t	flags;
68071 	/*
68072 	 * when this flag is set, register access will be enabled for the
68073 	 * ICAP Tx/Egress block.
68074 	 */
68075 	#define HWRM_DBG_PTRACE_INPUT_FLAGS_SELECT_IN	UINT32_C(0x1)
68076 	/*
68077 	 * when this flag is set, register access will be enabled for the
68078 	 * ICAP Rx/Ingress block.
68079 	 */
68080 	#define HWRM_DBG_PTRACE_INPUT_FLAGS_SELECT_OUT	UINT32_C(0x2)
68081 	/*
68082 	 * when this flag is set, capture will be started for both Tx and
68083 	 * Rx directions simultaneously.
68084 	 */
68085 	#define HWRM_DBG_PTRACE_INPUT_FLAGS_GLOBAL_START	UINT32_C(0x4)
68086 	/*
68087 	 * when this flag is set, capture will be stopped for both Tx and
68088 	 * Rx directions simultaneously.
68089 	 */
68090 	#define HWRM_DBG_PTRACE_INPUT_FLAGS_GLOBAL_STOP	UINT32_C(0x8)
68091 } hwrm_dbg_ptrace_input_t, *phwrm_dbg_ptrace_input_t;
68092 
68093 /* hwrm_dbg_ptrace_output (size:128b/16B) */
68094 
68095 typedef struct hwrm_dbg_ptrace_output {
68096 	/* The specific error status for the command. */
68097 	uint16_t	error_code;
68098 	/* The HWRM command request type. */
68099 	uint16_t	req_type;
68100 	/* The sequence ID from the original command. */
68101 	uint16_t	seq_id;
68102 	/* The length of the response data in number of bytes. */
68103 	uint16_t	resp_len;
68104 	uint16_t	flags;
68105 	/*
68106 	 * When this flag is set, it indicates that there is more data
68107 	 * available.
68108 	 * Issue the request again with the next sequence number.
68109 	 */
68110 	#define HWRM_DBG_PTRACE_OUTPUT_FLAGS_MORE	UINT32_C(0x1)
68111 	uint16_t	data_len;
68112 	uint8_t	unused_0[3];
68113 	/*
68114 	 * This field is used in Output records to indicate that the output is
68115 	 * completely written to RAM. This field should be read as '1' to
68116 	 * indicate that the output has been completely written. When writing
68117 	 * a command completion or response to an internal processor, the order
68118 	 * of writes has to be such that this field is written last.
68119 	 */
68120 	uint8_t	valid;
68121 } hwrm_dbg_ptrace_output_t, *phwrm_dbg_ptrace_output_t;
68122 
68123 /**************************
68124  * hwrm_nvm_raw_write_blk *
68125  **************************/
68126 
68127 
68128 /* hwrm_nvm_raw_write_blk_input (size:320b/40B) */
68129 
68130 typedef struct hwrm_nvm_raw_write_blk_input {
68131 	/* The HWRM command request type. */
68132 	uint16_t	req_type;
68133 	/*
68134 	 * The completion ring to send the completion event on. This should
68135 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
68136 	 */
68137 	uint16_t	cmpl_ring;
68138 	/*
68139 	 * The sequence ID is used by the driver for tracking multiple
68140 	 * commands. This ID is treated as opaque data by the firmware and
68141 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
68142 	 */
68143 	uint16_t	seq_id;
68144 	/*
68145 	 * The target ID of the command:
68146 	 * * 0x0-0xFFF8 - The function ID
68147 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
68148 	 * * 0xFFFD - Reserved for user-space HWRM interface
68149 	 * * 0xFFFF - HWRM
68150 	 */
68151 	uint16_t	target_id;
68152 	/*
68153 	 * A physical address pointer pointing to a host buffer that the
68154 	 * command's response data will be written. This can be either a host
68155 	 * physical address (HPA) or a guest physical address (GPA) and must
68156 	 * point to a physically contiguous block of memory.
68157 	 */
68158 	uint64_t	resp_addr;
68159 	/*
68160 	 * 64-bit Host Source Address.
68161 	 * This is the location of the source data to be written.
68162 	 */
68163 	uint64_t	host_src_addr;
68164 	/*
68165 	 * 32-bit Destination Address.
68166 	 * This is the NVRAM byte-offset where the source data will be written
68167 	 * to.
68168 	 */
68169 	uint32_t	dest_addr;
68170 	/* Length of data to be written, in bytes. */
68171 	uint32_t	len;
68172 	uint8_t	flags;
68173 	/*
68174 	 * This bit is only used when external secure SoC is used for
68175 	 * secure boot. This bit is utilized to differentiate between
68176 	 * writes for NIC or Security SoC non-volatile storage on the
68177 	 * device. If this bit is set, then this write is for the
68178 	 * Security SoC non-volatile storage on the device.
68179 	 */
68180 	#define HWRM_NVM_RAW_WRITE_BLK_INPUT_FLAGS_SECURITY_SOC_NVM	UINT32_C(0x1)
68181 	uint8_t	unused_0[7];
68182 } hwrm_nvm_raw_write_blk_input_t, *phwrm_nvm_raw_write_blk_input_t;
68183 
68184 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */
68185 
68186 typedef struct hwrm_nvm_raw_write_blk_output {
68187 	/* The specific error status for the command. */
68188 	uint16_t	error_code;
68189 	/* The HWRM command request type. */
68190 	uint16_t	req_type;
68191 	/* The sequence ID from the original command. */
68192 	uint16_t	seq_id;
68193 	/* The length of the response data in number of bytes. */
68194 	uint16_t	resp_len;
68195 	uint8_t	unused_0[7];
68196 	/*
68197 	 * This field is used in Output records to indicate that the output
68198 	 * is completely written to RAM. This field should be read as '1'
68199 	 * to indicate that the output has been completely written. When
68200 	 * writing a command completion or response to an internal processor,
68201 	 * the order of writes has to be such that this field is written last.
68202 	 */
68203 	uint8_t	valid;
68204 } hwrm_nvm_raw_write_blk_output_t, *phwrm_nvm_raw_write_blk_output_t;
68205 
68206 /*****************
68207  * hwrm_nvm_read *
68208  *****************/
68209 
68210 
68211 /* hwrm_nvm_read_input (size:320b/40B) */
68212 
68213 typedef struct hwrm_nvm_read_input {
68214 	/* The HWRM command request type. */
68215 	uint16_t	req_type;
68216 	/*
68217 	 * The completion ring to send the completion event on. This should
68218 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
68219 	 */
68220 	uint16_t	cmpl_ring;
68221 	/*
68222 	 * The sequence ID is used by the driver for tracking multiple
68223 	 * commands. This ID is treated as opaque data by the firmware and
68224 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
68225 	 */
68226 	uint16_t	seq_id;
68227 	/*
68228 	 * The target ID of the command:
68229 	 * * 0x0-0xFFF8 - The function ID
68230 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
68231 	 * * 0xFFFD - Reserved for user-space HWRM interface
68232 	 * * 0xFFFF - HWRM
68233 	 */
68234 	uint16_t	target_id;
68235 	/*
68236 	 * A physical address pointer pointing to a host buffer that the
68237 	 * command's response data will be written. This can be either a host
68238 	 * physical address (HPA) or a guest physical address (GPA) and must
68239 	 * point to a physically contiguous block of memory.
68240 	 */
68241 	uint64_t	resp_addr;
68242 	/*
68243 	 * 64-bit Host Destination Address.
68244 	 * This is the host address where the data will be written to.
68245 	 */
68246 	uint64_t	host_dest_addr;
68247 	/* The 0-based index of the directory entry. */
68248 	uint16_t	dir_idx;
68249 	uint8_t	unused_0[2];
68250 	/* The NVRAM byte-offset to read from. */
68251 	uint32_t	offset;
68252 	/* The length of the data to be read, in bytes. */
68253 	uint32_t	len;
68254 	uint8_t	unused_1[4];
68255 } hwrm_nvm_read_input_t, *phwrm_nvm_read_input_t;
68256 
68257 /* hwrm_nvm_read_output (size:128b/16B) */
68258 
68259 typedef struct hwrm_nvm_read_output {
68260 	/* The specific error status for the command. */
68261 	uint16_t	error_code;
68262 	/* The HWRM command request type. */
68263 	uint16_t	req_type;
68264 	/* The sequence ID from the original command. */
68265 	uint16_t	seq_id;
68266 	/* The length of the response data in number of bytes. */
68267 	uint16_t	resp_len;
68268 	uint8_t	unused_0[7];
68269 	/*
68270 	 * This field is used in Output records to indicate that the output
68271 	 * is completely written to RAM. This field should be read as '1'
68272 	 * to indicate that the output has been completely written. When
68273 	 * writing a command completion or response to an internal processor,
68274 	 * the order of writes has to be such that this field is written last.
68275 	 */
68276 	uint8_t	valid;
68277 } hwrm_nvm_read_output_t, *phwrm_nvm_read_output_t;
68278 
68279 /*********************
68280  * hwrm_nvm_raw_dump *
68281  *********************/
68282 
68283 
68284 /* hwrm_nvm_raw_dump_input (size:320b/40B) */
68285 
68286 typedef struct hwrm_nvm_raw_dump_input {
68287 	/* The HWRM command request type. */
68288 	uint16_t	req_type;
68289 	/*
68290 	 * The completion ring to send the completion event on. This should
68291 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
68292 	 */
68293 	uint16_t	cmpl_ring;
68294 	/*
68295 	 * The sequence ID is used by the driver for tracking multiple
68296 	 * commands. This ID is treated as opaque data by the firmware and
68297 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
68298 	 */
68299 	uint16_t	seq_id;
68300 	/*
68301 	 * The target ID of the command:
68302 	 * * 0x0-0xFFF8 - The function ID
68303 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
68304 	 * * 0xFFFD - Reserved for user-space HWRM interface
68305 	 * * 0xFFFF - HWRM
68306 	 */
68307 	uint16_t	target_id;
68308 	/*
68309 	 * A physical address pointer pointing to a host buffer that the
68310 	 * command's response data will be written. This can be either a host
68311 	 * physical address (HPA) or a guest physical address (GPA) and must
68312 	 * point to a physically contiguous block of memory.
68313 	 */
68314 	uint64_t	resp_addr;
68315 	/*
68316 	 * 64-bit Host Destination Address.
68317 	 * This is the host address where the data will be written to.
68318 	 */
68319 	uint64_t	host_dest_addr;
68320 	/* 32-bit NVRAM byte-offset to read from. */
68321 	uint32_t	offset;
68322 	/* Total length of NVRAM contents to be read, in bytes. */
68323 	uint32_t	len;
68324 	uint8_t	flags;
68325 	/*
68326 	 * This bit is only used when external secure SoC is used for
68327 	 * secure boot. This bit is utilized to differentiate between
68328 	 * read for NIC or Security SoC non-volatile storage on the
68329 	 * device. If this bit is set, then this read is for the Security
68330 	 * SoC non-volatile storage on the device.
68331 	 */
68332 	#define HWRM_NVM_RAW_DUMP_INPUT_FLAGS_SECURITY_SOC_NVM	UINT32_C(0x1)
68333 	uint8_t	unused_0[7];
68334 } hwrm_nvm_raw_dump_input_t, *phwrm_nvm_raw_dump_input_t;
68335 
68336 /* hwrm_nvm_raw_dump_output (size:128b/16B) */
68337 
68338 typedef struct hwrm_nvm_raw_dump_output {
68339 	/* The specific error status for the command. */
68340 	uint16_t	error_code;
68341 	/* The HWRM command request type. */
68342 	uint16_t	req_type;
68343 	/* The sequence ID from the original command. */
68344 	uint16_t	seq_id;
68345 	/* The length of the response data in number of bytes. */
68346 	uint16_t	resp_len;
68347 	uint8_t	unused_0[7];
68348 	/*
68349 	 * This field is used in Output records to indicate that the output
68350 	 * is completely written to RAM. This field should be read as '1'
68351 	 * to indicate that the output has been completely written. When
68352 	 * writing a command completion or response to an internal processor,
68353 	 * the order of writes has to be such that this field is written last.
68354 	 */
68355 	uint8_t	valid;
68356 } hwrm_nvm_raw_dump_output_t, *phwrm_nvm_raw_dump_output_t;
68357 
68358 /****************************
68359  * hwrm_nvm_get_dir_entries *
68360  ****************************/
68361 
68362 
68363 /* hwrm_nvm_get_dir_entries_input (size:192b/24B) */
68364 
68365 typedef struct hwrm_nvm_get_dir_entries_input {
68366 	/* The HWRM command request type. */
68367 	uint16_t	req_type;
68368 	/*
68369 	 * The completion ring to send the completion event on. This should
68370 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
68371 	 */
68372 	uint16_t	cmpl_ring;
68373 	/*
68374 	 * The sequence ID is used by the driver for tracking multiple
68375 	 * commands. This ID is treated as opaque data by the firmware and
68376 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
68377 	 */
68378 	uint16_t	seq_id;
68379 	/*
68380 	 * The target ID of the command:
68381 	 * * 0x0-0xFFF8 - The function ID
68382 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
68383 	 * * 0xFFFD - Reserved for user-space HWRM interface
68384 	 * * 0xFFFF - HWRM
68385 	 */
68386 	uint16_t	target_id;
68387 	/*
68388 	 * A physical address pointer pointing to a host buffer that the
68389 	 * command's response data will be written. This can be either a host
68390 	 * physical address (HPA) or a guest physical address (GPA) and must
68391 	 * point to a physically contiguous block of memory.
68392 	 */
68393 	uint64_t	resp_addr;
68394 	/*
68395 	 * 64-bit Host Destination Address.
68396 	 * This is the host address where the directory will be written.
68397 	 */
68398 	uint64_t	host_dest_addr;
68399 } hwrm_nvm_get_dir_entries_input_t, *phwrm_nvm_get_dir_entries_input_t;
68400 
68401 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */
68402 
68403 typedef struct hwrm_nvm_get_dir_entries_output {
68404 	/* The specific error status for the command. */
68405 	uint16_t	error_code;
68406 	/* The HWRM command request type. */
68407 	uint16_t	req_type;
68408 	/* The sequence ID from the original command. */
68409 	uint16_t	seq_id;
68410 	/* The length of the response data in number of bytes. */
68411 	uint16_t	resp_len;
68412 	uint8_t	unused_0[7];
68413 	/*
68414 	 * This field is used in Output records to indicate that the output
68415 	 * is completely written to RAM. This field should be read as '1'
68416 	 * to indicate that the output has been completely written. When
68417 	 * writing a command completion or response to an internal processor,
68418 	 * the order of writes has to be such that this field is written last.
68419 	 */
68420 	uint8_t	valid;
68421 } hwrm_nvm_get_dir_entries_output_t, *phwrm_nvm_get_dir_entries_output_t;
68422 
68423 /*************************
68424  * hwrm_nvm_get_dir_info *
68425  *************************/
68426 
68427 
68428 /* hwrm_nvm_get_dir_info_input (size:128b/16B) */
68429 
68430 typedef struct hwrm_nvm_get_dir_info_input {
68431 	/* The HWRM command request type. */
68432 	uint16_t	req_type;
68433 	/*
68434 	 * The completion ring to send the completion event on. This should
68435 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
68436 	 */
68437 	uint16_t	cmpl_ring;
68438 	/*
68439 	 * The sequence ID is used by the driver for tracking multiple
68440 	 * commands. This ID is treated as opaque data by the firmware and
68441 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
68442 	 */
68443 	uint16_t	seq_id;
68444 	/*
68445 	 * The target ID of the command:
68446 	 * * 0x0-0xFFF8 - The function ID
68447 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
68448 	 * * 0xFFFD - Reserved for user-space HWRM interface
68449 	 * * 0xFFFF - HWRM
68450 	 */
68451 	uint16_t	target_id;
68452 	/*
68453 	 * A physical address pointer pointing to a host buffer that the
68454 	 * command's response data will be written. This can be either a host
68455 	 * physical address (HPA) or a guest physical address (GPA) and must
68456 	 * point to a physically contiguous block of memory.
68457 	 */
68458 	uint64_t	resp_addr;
68459 } hwrm_nvm_get_dir_info_input_t, *phwrm_nvm_get_dir_info_input_t;
68460 
68461 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */
68462 
68463 typedef struct hwrm_nvm_get_dir_info_output {
68464 	/* The specific error status for the command. */
68465 	uint16_t	error_code;
68466 	/* The HWRM command request type. */
68467 	uint16_t	req_type;
68468 	/* The sequence ID from the original command. */
68469 	uint16_t	seq_id;
68470 	/* The length of the response data in number of bytes. */
68471 	uint16_t	resp_len;
68472 	/* Number of directory entries in the directory. */
68473 	uint32_t	entries;
68474 	/* Size of each directory entry, in bytes. */
68475 	uint32_t	entry_length;
68476 	uint8_t	unused_0[7];
68477 	/*
68478 	 * This field is used in Output records to indicate that the output
68479 	 * is completely written to RAM. This field should be read as '1'
68480 	 * to indicate that the output has been completely written. When
68481 	 * writing a command completion or response to an internal processor,
68482 	 * the order of writes has to be such that this field is written last.
68483 	 */
68484 	uint8_t	valid;
68485 } hwrm_nvm_get_dir_info_output_t, *phwrm_nvm_get_dir_info_output_t;
68486 
68487 /******************
68488  * hwrm_nvm_write *
68489  ******************/
68490 
68491 
68492 /* hwrm_nvm_write_input (size:448b/56B) */
68493 
68494 typedef struct hwrm_nvm_write_input {
68495 	/* The HWRM command request type. */
68496 	uint16_t	req_type;
68497 	/*
68498 	 * The completion ring to send the completion event on. This should
68499 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
68500 	 */
68501 	uint16_t	cmpl_ring;
68502 	/*
68503 	 * The sequence ID is used by the driver for tracking multiple
68504 	 * commands. This ID is treated as opaque data by the firmware and
68505 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
68506 	 */
68507 	uint16_t	seq_id;
68508 	/*
68509 	 * The target ID of the command:
68510 	 * * 0x0-0xFFF8 - The function ID
68511 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
68512 	 * * 0xFFFD - Reserved for user-space HWRM interface
68513 	 * * 0xFFFF - HWRM
68514 	 */
68515 	uint16_t	target_id;
68516 	/*
68517 	 * A physical address pointer pointing to a host buffer that the
68518 	 * command's response data will be written. This can be either a host
68519 	 * physical address (HPA) or a guest physical address (GPA) and must
68520 	 * point to a physically contiguous block of memory.
68521 	 */
68522 	uint64_t	resp_addr;
68523 	/*
68524 	 * 64-bit Host Source Address.
68525 	 * This is where the source data is.
68526 	 */
68527 	uint64_t	host_src_addr;
68528 	/*
68529 	 * The Directory Entry Type (valid values are defined in the
68530 	 * bnxnvm_directory_type enum defined in the file bnxnvm_defs.h).
68531 	 */
68532 	uint16_t	dir_type;
68533 	/*
68534 	 * Directory ordinal.
68535 	 * The 0-based instance of the combined Directory Entry Type and
68536 	 * Extension.
68537 	 */
68538 	uint16_t	dir_ordinal;
68539 	/*
68540 	 * The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file
68541 	 * bnxnvm_defs.h).
68542 	 */
68543 	uint16_t	dir_ext;
68544 	/*
68545 	 * Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file
68546 	 * bnxnvm_defs.h).
68547 	 */
68548 	uint16_t	dir_attr;
68549 	/*
68550 	 * Length of data to write, in bytes. May be less than or equal to the
68551 	 * allocated size for the directory entry.
68552 	 * The data length stored in the directory entry will be updated to
68553 	 * reflect this value once the write is complete.
68554 	 */
68555 	uint32_t	dir_data_length;
68556 	/* Option. */
68557 	uint16_t	option;
68558 	uint16_t	flags;
68559 	/*
68560 	 * When this bit is '1', the original active image
68561 	 * will not be removed. TBD: what purpose is this?
68562 	 */
68563 	#define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG	UINT32_C(0x1)
68564 	/*
68565 	 * This flag indicates the sender wants to modify a continuous
68566 	 * NVRAM area using a batch of this HWRM requests. The
68567 	 * offset of a request must be continuous to the end of previous
68568 	 * request's. Firmware does not update the directory entry until
68569 	 * receiving the last request, which is indicated by the batch_last
68570 	 * flag. This flag is set usually when a sender does not have a
68571 	 * block of memory that is big enough to hold the entire NVRAM
68572 	 * data for send at one time.
68573 	 */
68574 	#define HWRM_NVM_WRITE_INPUT_FLAGS_BATCH_MODE		UINT32_C(0x2)
68575 	/*
68576 	 * This flag can be used only when the batch_mode flag is set. It
68577 	 * indicates this request is the last of batch requests.
68578 	 */
68579 	#define HWRM_NVM_WRITE_INPUT_FLAGS_BATCH_LAST		UINT32_C(0x4)
68580 	/*
68581 	 * The requested length of the allocated NVM for the item, in bytes.
68582 	 * This value may be greater than or equal to the specified data
68583 	 * length (dir_data_length).
68584 	 * If this value is less than the specified data length, it will be
68585 	 * ignored. The response will contain the actual allocated item length,
68586 	 * which may be greater than the requested item length.
68587 	 * The purpose for allocating more than the required number of bytes
68588 	 * for an item's data is to pre-allocate extra storage (padding) to
68589 	 * accommodate the potential future growth of an item (e.g. upgraded
68590 	 * firmware with a size increase, log growth, expanded configuration
68591 	 * data).
68592 	 */
68593 	uint32_t	dir_item_length;
68594 	/*
68595 	 * 32-bit offset of data blob from where data is being written.
68596 	 * Only valid for batch mode. For non-batch writes 'dont care'.
68597 	 */
68598 	uint32_t	offset;
68599 	/*
68600 	 * Length of data to be written.Should be non-zero.
68601 	 * Only valid for batch mode. For non-batch writes 'dont care'.
68602 	 */
68603 	uint32_t	len;
68604 	uint32_t	unused_0;
68605 } hwrm_nvm_write_input_t, *phwrm_nvm_write_input_t;
68606 
68607 /* hwrm_nvm_write_output (size:128b/16B) */
68608 
68609 typedef struct hwrm_nvm_write_output {
68610 	/* The specific error status for the command. */
68611 	uint16_t	error_code;
68612 	/* The HWRM command request type. */
68613 	uint16_t	req_type;
68614 	/* The sequence ID from the original command. */
68615 	uint16_t	seq_id;
68616 	/* The length of the response data in number of bytes. */
68617 	uint16_t	resp_len;
68618 	/*
68619 	 * Length of the allocated NVM for the item, in bytes. The value may be
68620 	 * greater than or equal to the specified data length or the requested
68621 	 * item length.
68622 	 * The actual item length used when creating a new directory entry will
68623 	 * be a multiple of an NVM block size.
68624 	 */
68625 	uint32_t	dir_item_length;
68626 	/* The directory index of the created or modified item. */
68627 	uint16_t	dir_idx;
68628 	uint8_t	unused_0;
68629 	/*
68630 	 * This field is used in Output records to indicate that the output
68631 	 * is completely written to RAM. This field should be read as '1'
68632 	 * to indicate that the output has been completely written. When
68633 	 * writing a command completion or response to an internal processor,
68634 	 * the order of writes has to be such that this field is written last.
68635 	 */
68636 	uint8_t	valid;
68637 } hwrm_nvm_write_output_t, *phwrm_nvm_write_output_t;
68638 
68639 /* hwrm_nvm_write_cmd_err (size:64b/8B) */
68640 
68641 typedef struct hwrm_nvm_write_cmd_err {
68642 	/*
68643 	 * command specific error codes that goes to
68644 	 * the cmd_err field in Common HWRM Error Response.
68645 	 */
68646 	uint8_t	code;
68647 	/* Unknown error */
68648 	#define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
68649 	/* Unable to complete operation due to fragmentation */
68650 	#define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
68651 	/* nvm is completely full. */
68652 	#define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
68653 	#define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST	HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE
68654 	uint8_t	unused_0[7];
68655 } hwrm_nvm_write_cmd_err_t, *phwrm_nvm_write_cmd_err_t;
68656 
68657 /*******************
68658  * hwrm_nvm_modify *
68659  *******************/
68660 
68661 
68662 /* hwrm_nvm_modify_input (size:320b/40B) */
68663 
68664 typedef struct hwrm_nvm_modify_input {
68665 	/* The HWRM command request type. */
68666 	uint16_t	req_type;
68667 	/*
68668 	 * The completion ring to send the completion event on. This should
68669 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
68670 	 */
68671 	uint16_t	cmpl_ring;
68672 	/*
68673 	 * The sequence ID is used by the driver for tracking multiple
68674 	 * commands. This ID is treated as opaque data by the firmware and
68675 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
68676 	 */
68677 	uint16_t	seq_id;
68678 	/*
68679 	 * The target ID of the command:
68680 	 * * 0x0-0xFFF8 - The function ID
68681 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
68682 	 * * 0xFFFD - Reserved for user-space HWRM interface
68683 	 * * 0xFFFF - HWRM
68684 	 */
68685 	uint16_t	target_id;
68686 	/*
68687 	 * A physical address pointer pointing to a host buffer that the
68688 	 * command's response data will be written. This can be either a host
68689 	 * physical address (HPA) or a guest physical address (GPA) and must
68690 	 * point to a physically contiguous block of memory.
68691 	 */
68692 	uint64_t	resp_addr;
68693 	/*
68694 	 * 64-bit Host Source Address.
68695 	 * This is where the modified data is.
68696 	 */
68697 	uint64_t	host_src_addr;
68698 	/* 16-bit directory entry index. */
68699 	uint16_t	dir_idx;
68700 	uint16_t	flags;
68701 	/*
68702 	 * This flag indicates the sender wants to modify a continuous NVRAM
68703 	 * area using a batch of this HWRM requests. The offset of a request
68704 	 * must be continuous to the end of previous request's. Firmware does
68705 	 * not update the directory entry until receiving the last request,
68706 	 * which is indicated by the batch_last flag.
68707 	 * This flag is set usually when a sender does not have a block of
68708 	 * memory that is big enough to hold the entire NVRAM data for send
68709 	 * at one time.
68710 	 */
68711 	#define HWRM_NVM_MODIFY_INPUT_FLAGS_BATCH_MODE	UINT32_C(0x1)
68712 	/*
68713 	 * This flag can be used only when the batch_mode flag is set.
68714 	 * It indicates this request is the last of batch requests.
68715 	 */
68716 	#define HWRM_NVM_MODIFY_INPUT_FLAGS_BATCH_LAST	UINT32_C(0x2)
68717 	/* 32-bit NVRAM byte-offset to modify content from. */
68718 	uint32_t	offset;
68719 	/*
68720 	 * Length of data to be modified, in bytes. The length shall
68721 	 * be non-zero.
68722 	 */
68723 	uint32_t	len;
68724 	uint8_t	unused_1[4];
68725 } hwrm_nvm_modify_input_t, *phwrm_nvm_modify_input_t;
68726 
68727 /* hwrm_nvm_modify_output (size:128b/16B) */
68728 
68729 typedef struct hwrm_nvm_modify_output {
68730 	/* The specific error status for the command. */
68731 	uint16_t	error_code;
68732 	/* The HWRM command request type. */
68733 	uint16_t	req_type;
68734 	/* The sequence ID from the original command. */
68735 	uint16_t	seq_id;
68736 	/* The length of the response data in number of bytes. */
68737 	uint16_t	resp_len;
68738 	uint8_t	unused_0[7];
68739 	/*
68740 	 * This field is used in Output records to indicate that the output
68741 	 * is completely written to RAM. This field should be read as '1'
68742 	 * to indicate that the output has been completely written. When
68743 	 * writing a command completion or response to an internal processor,
68744 	 * the order of writes has to be such that this field is written last.
68745 	 */
68746 	uint8_t	valid;
68747 } hwrm_nvm_modify_output_t, *phwrm_nvm_modify_output_t;
68748 
68749 /***************************
68750  * hwrm_nvm_find_dir_entry *
68751  ***************************/
68752 
68753 
68754 /* hwrm_nvm_find_dir_entry_input (size:256b/32B) */
68755 
68756 typedef struct hwrm_nvm_find_dir_entry_input {
68757 	/* The HWRM command request type. */
68758 	uint16_t	req_type;
68759 	/*
68760 	 * The completion ring to send the completion event on. This should
68761 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
68762 	 */
68763 	uint16_t	cmpl_ring;
68764 	/*
68765 	 * The sequence ID is used by the driver for tracking multiple
68766 	 * commands. This ID is treated as opaque data by the firmware and
68767 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
68768 	 */
68769 	uint16_t	seq_id;
68770 	/*
68771 	 * The target ID of the command:
68772 	 * * 0x0-0xFFF8 - The function ID
68773 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
68774 	 * * 0xFFFD - Reserved for user-space HWRM interface
68775 	 * * 0xFFFF - HWRM
68776 	 */
68777 	uint16_t	target_id;
68778 	/*
68779 	 * A physical address pointer pointing to a host buffer that the
68780 	 * command's response data will be written. This can be either a host
68781 	 * physical address (HPA) or a guest physical address (GPA) and must
68782 	 * point to a physically contiguous block of memory.
68783 	 */
68784 	uint64_t	resp_addr;
68785 	uint32_t	enables;
68786 	/*
68787 	 * This bit must be '1' for the dir_idx_valid field to be
68788 	 * configured.
68789 	 */
68790 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID	UINT32_C(0x1)
68791 	/* Directory Entry Index */
68792 	uint16_t	dir_idx;
68793 	/* Directory Entry (Image) Type */
68794 	uint16_t	dir_type;
68795 	/*
68796 	 * Directory ordinal.
68797 	 * The instance of this Directory Type
68798 	 */
68799 	uint16_t	dir_ordinal;
68800 	/* The Directory Entry Extension flags. */
68801 	uint16_t	dir_ext;
68802 	/* This value indicates the search option using dir_ordinal. */
68803 	uint8_t	opt_ordinal;
68804 	/* This value indicates the search option using dir_ordinal. */
68805 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK UINT32_C(0x3)
68806 	#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT 0
68807 	/* Equal to specified ordinal value. */
68808 		#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ	UINT32_C(0x0)
68809 	/* Greater than or equal to specified ordinal value */
68810 		#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE	UINT32_C(0x1)
68811 	/* Greater than specified ordinal value */
68812 		#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT	UINT32_C(0x2)
68813 		#define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT
68814 	uint8_t	unused_0[3];
68815 } hwrm_nvm_find_dir_entry_input_t, *phwrm_nvm_find_dir_entry_input_t;
68816 
68817 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */
68818 
68819 typedef struct hwrm_nvm_find_dir_entry_output {
68820 	/* The specific error status for the command. */
68821 	uint16_t	error_code;
68822 	/* The HWRM command request type. */
68823 	uint16_t	req_type;
68824 	/* The sequence ID from the original command. */
68825 	uint16_t	seq_id;
68826 	/* The length of the response data in number of bytes. */
68827 	uint16_t	resp_len;
68828 	/* Allocated NVRAM for this directory entry, in bytes. */
68829 	uint32_t	dir_item_length;
68830 	/* Size of the stored data for this directory entry, in bytes. */
68831 	uint32_t	dir_data_length;
68832 	/*
68833 	 * Firmware version.
68834 	 * Only valid if the directory entry is for embedded firmware stored
68835 	 * in APE_BIN Format.
68836 	 */
68837 	uint32_t	fw_ver;
68838 	/* Directory ordinal. */
68839 	uint16_t	dir_ordinal;
68840 	/* Directory Entry Index */
68841 	uint16_t	dir_idx;
68842 	uint8_t	unused_0[7];
68843 	/*
68844 	 * This field is used in Output records to indicate that the output
68845 	 * is completely written to RAM. This field should be read as '1'
68846 	 * to indicate that the output has been completely written. When
68847 	 * writing a command completion or response to an internal processor,
68848 	 * the order of writes has to be such that this field is written last.
68849 	 */
68850 	uint8_t	valid;
68851 } hwrm_nvm_find_dir_entry_output_t, *phwrm_nvm_find_dir_entry_output_t;
68852 
68853 /****************************
68854  * hwrm_nvm_erase_dir_entry *
68855  ****************************/
68856 
68857 
68858 /* hwrm_nvm_erase_dir_entry_input (size:192b/24B) */
68859 
68860 typedef struct hwrm_nvm_erase_dir_entry_input {
68861 	/* The HWRM command request type. */
68862 	uint16_t	req_type;
68863 	/*
68864 	 * The completion ring to send the completion event on. This should
68865 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
68866 	 */
68867 	uint16_t	cmpl_ring;
68868 	/*
68869 	 * The sequence ID is used by the driver for tracking multiple
68870 	 * commands. This ID is treated as opaque data by the firmware and
68871 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
68872 	 */
68873 	uint16_t	seq_id;
68874 	/*
68875 	 * The target ID of the command:
68876 	 * * 0x0-0xFFF8 - The function ID
68877 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
68878 	 * * 0xFFFD - Reserved for user-space HWRM interface
68879 	 * * 0xFFFF - HWRM
68880 	 */
68881 	uint16_t	target_id;
68882 	/*
68883 	 * A physical address pointer pointing to a host buffer that the
68884 	 * command's response data will be written. This can be either a host
68885 	 * physical address (HPA) or a guest physical address (GPA) and must
68886 	 * point to a physically contiguous block of memory.
68887 	 */
68888 	uint64_t	resp_addr;
68889 	/* Directory Entry Index */
68890 	uint16_t	dir_idx;
68891 	uint8_t	unused_0[6];
68892 } hwrm_nvm_erase_dir_entry_input_t, *phwrm_nvm_erase_dir_entry_input_t;
68893 
68894 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */
68895 
68896 typedef struct hwrm_nvm_erase_dir_entry_output {
68897 	/* The specific error status for the command. */
68898 	uint16_t	error_code;
68899 	/* The HWRM command request type. */
68900 	uint16_t	req_type;
68901 	/* The sequence ID from the original command. */
68902 	uint16_t	seq_id;
68903 	/* The length of the response data in number of bytes. */
68904 	uint16_t	resp_len;
68905 	uint8_t	unused_0[7];
68906 	/*
68907 	 * This field is used in Output records to indicate that the output
68908 	 * is completely written to RAM. This field should be read as '1'
68909 	 * to indicate that the output has been completely written. When
68910 	 * writing a command completion or response to an internal processor,
68911 	 * the order of writes has to be such that this field is written last.
68912 	 */
68913 	uint8_t	valid;
68914 } hwrm_nvm_erase_dir_entry_output_t, *phwrm_nvm_erase_dir_entry_output_t;
68915 
68916 /*************************
68917  * hwrm_nvm_get_dev_info *
68918  *************************/
68919 
68920 
68921 /* hwrm_nvm_get_dev_info_input (size:192b/24B) */
68922 
68923 typedef struct hwrm_nvm_get_dev_info_input {
68924 	/* The HWRM command request type. */
68925 	uint16_t	req_type;
68926 	/*
68927 	 * The completion ring to send the completion event on. This should
68928 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
68929 	 */
68930 	uint16_t	cmpl_ring;
68931 	/*
68932 	 * The sequence ID is used by the driver for tracking multiple
68933 	 * commands. This ID is treated as opaque data by the firmware and
68934 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
68935 	 */
68936 	uint16_t	seq_id;
68937 	/*
68938 	 * The target ID of the command:
68939 	 * * 0x0-0xFFF8 - The function ID
68940 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
68941 	 * * 0xFFFD - Reserved for user-space HWRM interface
68942 	 * * 0xFFFF - HWRM
68943 	 */
68944 	uint16_t	target_id;
68945 	/*
68946 	 * A physical address pointer pointing to a host buffer that the
68947 	 * command's response data will be written. This can be either a host
68948 	 * physical address (HPA) or a guest physical address (GPA) and must
68949 	 * point to a physically contiguous block of memory.
68950 	 */
68951 	uint64_t	resp_addr;
68952 	uint8_t	flags;
68953 	/*
68954 	 * This bit is only used when external secure SoC is used for
68955 	 * secure boot.This bit is utilized to differentiate between
68956 	 * device information for NIC or Security SoC non-volatile
68957 	 * storage on the device. If this bit is set, then device
68958 	 * information for the Security SoC non-volatile storage on the
68959 	 * device.
68960 	 */
68961 	#define HWRM_NVM_GET_DEV_INFO_INPUT_FLAGS_SECURITY_SOC_NVM	UINT32_C(0x1)
68962 	uint8_t	unused_0[7];
68963 } hwrm_nvm_get_dev_info_input_t, *phwrm_nvm_get_dev_info_input_t;
68964 
68965 /* hwrm_nvm_get_dev_info_output (size:768b/96B) */
68966 
68967 typedef struct hwrm_nvm_get_dev_info_output {
68968 	/* The specific error status for the command. */
68969 	uint16_t	error_code;
68970 	/* The HWRM command request type. */
68971 	uint16_t	req_type;
68972 	/* The sequence ID from the original command. */
68973 	uint16_t	seq_id;
68974 	/* The length of the response data in number of bytes. */
68975 	uint16_t	resp_len;
68976 	/* Manufacturer ID. */
68977 	uint16_t	manufacturer_id;
68978 	/* Device ID. */
68979 	uint16_t	device_id;
68980 	/* Sector size of the NVRAM device. */
68981 	uint32_t	sector_size;
68982 	/* Total size, in bytes of the NVRAM device. */
68983 	uint32_t	nvram_size;
68984 	uint32_t	reserved_size;
68985 	/*
68986 	 * Available size that can be used, in bytes. Available size is the
68987 	 * NVRAM size take away the used size and reserved size.
68988 	 */
68989 	uint32_t	available_size;
68990 	/* This field represents the major version of NVM cfg */
68991 	uint8_t	nvm_cfg_ver_maj;
68992 	/* This field represents the minor version of NVM cfg */
68993 	uint8_t	nvm_cfg_ver_min;
68994 	/* This field represents the update version of NVM cfg */
68995 	uint8_t	nvm_cfg_ver_upd;
68996 	uint8_t	flags;
68997 	/*
68998 	 * If set to 1, firmware will provide various firmware version
68999 	 * information stored in the flash.
69000 	 */
69001 	#define HWRM_NVM_GET_DEV_INFO_OUTPUT_FLAGS_FW_VER_VALID	UINT32_C(0x1)
69002 	/*
69003 	 * This field represents the board package name stored in the flash.
69004 	 * (ASCII chars with NULL at the end).
69005 	 */
69006 	char	pkg_name[16];
69007 	/*
69008 	 * This field represents the major version of HWRM firmware, stored in
69009 	 * the flash.
69010 	 */
69011 	uint16_t	hwrm_fw_major;
69012 	/*
69013 	 * This field represents the minor version of HWRM firmware, stored in
69014 	 * the flash.
69015 	 */
69016 	uint16_t	hwrm_fw_minor;
69017 	/*
69018 	 * This field represents the build version of HWRM firmware, stored in
69019 	 * the flash.
69020 	 */
69021 	uint16_t	hwrm_fw_build;
69022 	/*
69023 	 * This field can be used to represent firmware branches or customer
69024 	 * specific releases tied to a specific (major, minor, build) version
69025 	 * of the HWRM firmware.
69026 	 */
69027 	uint16_t	hwrm_fw_patch;
69028 	/*
69029 	 * This field represents the major version of mgmt firmware, stored in
69030 	 * the flash.
69031 	 */
69032 	uint16_t	mgmt_fw_major;
69033 	/*
69034 	 * This field represents the minor version of mgmt firmware, stored in
69035 	 * the flash.
69036 	 */
69037 	uint16_t	mgmt_fw_minor;
69038 	/*
69039 	 * This field represents the build version of mgmt firmware, stored in
69040 	 * the flash.
69041 	 */
69042 	uint16_t	mgmt_fw_build;
69043 	/*
69044 	 * This field can be used to represent firmware branches or customer
69045 	 * specific releases tied to a specific (major, minor, build) version
69046 	 * of the mgmt firmware.
69047 	 */
69048 	uint16_t	mgmt_fw_patch;
69049 	/*
69050 	 * This field represents the major version of roce firmware, stored in
69051 	 * the flash.
69052 	 */
69053 	uint16_t	roce_fw_major;
69054 	/*
69055 	 * This field represents the minor version of roce firmware, stored in
69056 	 * the flash.
69057 	 */
69058 	uint16_t	roce_fw_minor;
69059 	/*
69060 	 * This field represents the build version of roce firmware, stored in
69061 	 * the flash.
69062 	 */
69063 	uint16_t	roce_fw_build;
69064 	/*
69065 	 * This field can be used to represent firmware branches or customer
69066 	 * specific releases tied to a specific (major, minor, build) version
69067 	 * of the roce firmware.
69068 	 */
69069 	uint16_t	roce_fw_patch;
69070 	/*
69071 	 * This field represents the major version of network control firmware,
69072 	 * stored in the flash.
69073 	 */
69074 	uint16_t	netctrl_fw_major;
69075 	/*
69076 	 * This field represents the minor version of network control firmware,
69077 	 * stored in the flash.
69078 	 */
69079 	uint16_t	netctrl_fw_minor;
69080 	/*
69081 	 * This field represents the build version of network control firmware,
69082 	 * stored in the flash.
69083 	 */
69084 	uint16_t	netctrl_fw_build;
69085 	/*
69086 	 * This field can be used to represent firmware branches or customer
69087 	 * specific releases tied to a specific (major, minor, build) version
69088 	 * of the network control firmware.
69089 	 */
69090 	uint16_t	netctrl_fw_patch;
69091 	/*
69092 	 * This field represents the major version of SRT2 firmware, stored in
69093 	 * the flash.
69094 	 */
69095 	uint16_t	srt2_fw_major;
69096 	/*
69097 	 * This field represents the minor version of SRT2 firmware, stored in
69098 	 * the flash.
69099 	 */
69100 	uint16_t	srt2_fw_minor;
69101 	/*
69102 	 * This field represents the build version of SRT2 firmware, stored in
69103 	 * the flash.
69104 	 */
69105 	uint16_t	srt2_fw_build;
69106 	/*
69107 	 * This field can be used to represent firmware branches or customer
69108 	 * specific releases tied to a specific (major, minor, build) version
69109 	 * of the SRT2 firmware.
69110 	 */
69111 	uint16_t	srt2_fw_patch;
69112 	uint8_t	unused_0[7];
69113 	/*
69114 	 * This field is used in Output records to indicate that the output
69115 	 * is completely written to RAM. This field should be read as '1'
69116 	 * to indicate that the output has been completely written. When
69117 	 * writing a command completion or response to an internal processor,
69118 	 * the order of writes has to be such that this field is written last.
69119 	 */
69120 	uint8_t	valid;
69121 } hwrm_nvm_get_dev_info_output_t, *phwrm_nvm_get_dev_info_output_t;
69122 
69123 /**************************
69124  * hwrm_nvm_mod_dir_entry *
69125  **************************/
69126 
69127 
69128 /* hwrm_nvm_mod_dir_entry_input (size:256b/32B) */
69129 
69130 typedef struct hwrm_nvm_mod_dir_entry_input {
69131 	/* The HWRM command request type. */
69132 	uint16_t	req_type;
69133 	/*
69134 	 * The completion ring to send the completion event on. This should
69135 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
69136 	 */
69137 	uint16_t	cmpl_ring;
69138 	/*
69139 	 * The sequence ID is used by the driver for tracking multiple
69140 	 * commands. This ID is treated as opaque data by the firmware and
69141 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
69142 	 */
69143 	uint16_t	seq_id;
69144 	/*
69145 	 * The target ID of the command:
69146 	 * * 0x0-0xFFF8 - The function ID
69147 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
69148 	 * * 0xFFFD - Reserved for user-space HWRM interface
69149 	 * * 0xFFFF - HWRM
69150 	 */
69151 	uint16_t	target_id;
69152 	/*
69153 	 * A physical address pointer pointing to a host buffer that the
69154 	 * command's response data will be written. This can be either a host
69155 	 * physical address (HPA) or a guest physical address (GPA) and must
69156 	 * point to a physically contiguous block of memory.
69157 	 */
69158 	uint64_t	resp_addr;
69159 	uint32_t	enables;
69160 	/*
69161 	 * This bit must be '1' for the checksum field to be
69162 	 * configured.
69163 	 */
69164 	#define HWRM_NVM_MOD_DIR_ENTRY_INPUT_ENABLES_CHECKSUM	UINT32_C(0x1)
69165 	/* Directory Entry Index */
69166 	uint16_t	dir_idx;
69167 	/*
69168 	 * Directory ordinal.
69169 	 * The (0-based) instance of this Directory Type.
69170 	 */
69171 	uint16_t	dir_ordinal;
69172 	/*
69173 	 * The Directory Entry Extension flags (see BNX_DIR_EXT_* for
69174 	 * extension flag definitions).
69175 	 */
69176 	uint16_t	dir_ext;
69177 	/*
69178 	 * Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute
69179 	 * flag definitions).
69180 	 */
69181 	uint16_t	dir_attr;
69182 	/*
69183 	 * If valid, then this field updates the checksum
69184 	 * value of the content in the directory entry.
69185 	 */
69186 	uint32_t	checksum;
69187 } hwrm_nvm_mod_dir_entry_input_t, *phwrm_nvm_mod_dir_entry_input_t;
69188 
69189 /* hwrm_nvm_mod_dir_entry_output (size:128b/16B) */
69190 
69191 typedef struct hwrm_nvm_mod_dir_entry_output {
69192 	/* The specific error status for the command. */
69193 	uint16_t	error_code;
69194 	/* The HWRM command request type. */
69195 	uint16_t	req_type;
69196 	/* The sequence ID from the original command. */
69197 	uint16_t	seq_id;
69198 	/* The length of the response data in number of bytes. */
69199 	uint16_t	resp_len;
69200 	uint8_t	unused_0[7];
69201 	/*
69202 	 * This field is used in Output records to indicate that the output
69203 	 * is completely written to RAM. This field should be read as '1'
69204 	 * to indicate that the output has been completely written. When
69205 	 * writing a command completion or response to an internal processor,
69206 	 * the order of writes has to be such that this field is written last.
69207 	 */
69208 	uint8_t	valid;
69209 } hwrm_nvm_mod_dir_entry_output_t, *phwrm_nvm_mod_dir_entry_output_t;
69210 
69211 /**************************
69212  * hwrm_nvm_verify_update *
69213  **************************/
69214 
69215 
69216 /* hwrm_nvm_verify_update_input (size:192b/24B) */
69217 
69218 typedef struct hwrm_nvm_verify_update_input {
69219 	/* The HWRM command request type. */
69220 	uint16_t	req_type;
69221 	/*
69222 	 * The completion ring to send the completion event on. This should
69223 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
69224 	 */
69225 	uint16_t	cmpl_ring;
69226 	/*
69227 	 * The sequence ID is used by the driver for tracking multiple
69228 	 * commands. This ID is treated as opaque data by the firmware and
69229 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
69230 	 */
69231 	uint16_t	seq_id;
69232 	/*
69233 	 * The target ID of the command:
69234 	 * * 0x0-0xFFF8 - The function ID
69235 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
69236 	 * * 0xFFFD - Reserved for user-space HWRM interface
69237 	 * * 0xFFFF - HWRM
69238 	 */
69239 	uint16_t	target_id;
69240 	/*
69241 	 * A physical address pointer pointing to a host buffer that the
69242 	 * command's response data will be written. This can be either a host
69243 	 * physical address (HPA) or a guest physical address (GPA) and must
69244 	 * point to a physically contiguous block of memory.
69245 	 */
69246 	uint64_t	resp_addr;
69247 	/* Directory Entry Type, to be verified. */
69248 	uint16_t	dir_type;
69249 	/*
69250 	 * Directory ordinal.
69251 	 * The instance of the Directory Type to be verified.
69252 	 */
69253 	uint16_t	dir_ordinal;
69254 	/*
69255 	 * The Directory Entry Extension flags.
69256 	 * The "UPDATE" extension flag must be set in this value.
69257 	 * A corresponding directory entry with the same type and ordinal
69258 	 * values but *without*
69259 	 * the "UPDATE" extension flag must also exist. The other flags of
69260 	 * the extension must
69261 	 * be identical between the active and update entries.
69262 	 */
69263 	uint16_t	dir_ext;
69264 	uint8_t	unused_0[2];
69265 } hwrm_nvm_verify_update_input_t, *phwrm_nvm_verify_update_input_t;
69266 
69267 /* hwrm_nvm_verify_update_output (size:128b/16B) */
69268 
69269 typedef struct hwrm_nvm_verify_update_output {
69270 	/* The specific error status for the command. */
69271 	uint16_t	error_code;
69272 	/* The HWRM command request type. */
69273 	uint16_t	req_type;
69274 	/* The sequence ID from the original command. */
69275 	uint16_t	seq_id;
69276 	/* The length of the response data in number of bytes. */
69277 	uint16_t	resp_len;
69278 	uint8_t	unused_0[7];
69279 	/*
69280 	 * This field is used in Output records to indicate that the output
69281 	 * is completely written to RAM. This field should be read as '1'
69282 	 * to indicate that the output has been completely written. When
69283 	 * writing a command completion or response to an internal processor,
69284 	 * the order of writes has to be such that this field is written last.
69285 	 */
69286 	uint8_t	valid;
69287 } hwrm_nvm_verify_update_output_t, *phwrm_nvm_verify_update_output_t;
69288 
69289 /***************************
69290  * hwrm_nvm_install_update *
69291  ***************************/
69292 
69293 
69294 /* hwrm_nvm_install_update_input (size:192b/24B) */
69295 
69296 typedef struct hwrm_nvm_install_update_input {
69297 	/* The HWRM command request type. */
69298 	uint16_t	req_type;
69299 	/*
69300 	 * The completion ring to send the completion event on. This should
69301 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
69302 	 */
69303 	uint16_t	cmpl_ring;
69304 	/*
69305 	 * The sequence ID is used by the driver for tracking multiple
69306 	 * commands. This ID is treated as opaque data by the firmware and
69307 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
69308 	 */
69309 	uint16_t	seq_id;
69310 	/*
69311 	 * The target ID of the command:
69312 	 * * 0x0-0xFFF8 - The function ID
69313 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
69314 	 * * 0xFFFD - Reserved for user-space HWRM interface
69315 	 * * 0xFFFF - HWRM
69316 	 */
69317 	uint16_t	target_id;
69318 	/*
69319 	 * A physical address pointer pointing to a host buffer that the
69320 	 * command's response data will be written. This can be either a host
69321 	 * physical address (HPA) or a guest physical address (GPA) and must
69322 	 * point to a physically contiguous block of memory.
69323 	 */
69324 	uint64_t	resp_addr;
69325 	/*
69326 	 * Installation type. If the value 3 through 0xffff is used,
69327 	 * only packaged items with that type value will be installed and
69328 	 * conditional installation directives for those packaged items
69329 	 * will be over-ridden (i.e. 'create' or 'replace' will be treated
69330 	 * as 'install').
69331 	 */
69332 	uint32_t	install_type;
69333 	/*
69334 	 * Perform a normal package installation. Conditional installation
69335 	 * directives (e.g. 'create' and 'replace') of packaged items
69336 	 * will be followed.
69337 	 */
69338 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_NORMAL UINT32_C(0x0)
69339 	/*
69340 	 * Install all packaged items regardless of installation directive
69341 	 * (i.e. treat all packaged items as though they have an installation
69342 	 * directive of 'install').
69343 	 */
69344 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL	UINT32_C(0xffffffff)
69345 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_LAST  HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL
69346 	uint16_t	flags;
69347 	/*
69348 	 * If set to 1, then securely erase all unused locations in
69349 	 * persistent storage.
69350 	 */
69351 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ERASE_UNUSED_SPACE	UINT32_C(0x1)
69352 	/*
69353 	 * If set to 1, then unspecified images, images not in the package
69354 	 * file, will be safely deleted.
69355 	 * When combined with erase_unused_space then unspecified images will
69356 	 * be securely erased.
69357 	 */
69358 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_REMOVE_UNUSED_PKG	UINT32_C(0x2)
69359 	/*
69360 	 * If set to 1, FW will defragment the NVM if defragmentation is
69361 	 * required for the update.
69362 	 * Allow additional time for this command to complete if this bit is
69363 	 * set to 1.
69364 	 */
69365 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG	UINT32_C(0x4)
69366 	/*
69367 	 * If set to 1, FW will verify the package in the "UPDATE" NVM item
69368 	 * without installing it. This flag is for FW internal use only.
69369 	 * Users should not set this flag. The request will otherwise fail.
69370 	 */
69371 	#define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_VERIFY_ONLY		UINT32_C(0x8)
69372 	uint8_t	unused_0[2];
69373 } hwrm_nvm_install_update_input_t, *phwrm_nvm_install_update_input_t;
69374 
69375 /* hwrm_nvm_install_update_output (size:192b/24B) */
69376 
69377 typedef struct hwrm_nvm_install_update_output {
69378 	/* The specific error status for the command. */
69379 	uint16_t	error_code;
69380 	/* The HWRM command request type. */
69381 	uint16_t	req_type;
69382 	/* The sequence ID from the original command. */
69383 	uint16_t	seq_id;
69384 	/* The length of the response data in number of bytes. */
69385 	uint16_t	resp_len;
69386 	/*
69387 	 * Bit-mask of successfully installed items.
69388 	 * Bit-0 corresponding to the first packaged item, Bit-1 for the second
69389 	 * item, etc. A value of 0 indicates that no items were successfully
69390 	 * installed.
69391 	 */
69392 	uint64_t	installed_items;
69393 	/* result is 8 b corresponding to BCMRETVAL error codes */
69394 	uint8_t	result;
69395 	/* There was no problem with the package installation. */
69396 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS			UINT32_C(0x0)
69397 	/* Generic failure */
69398 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_FAILURE			UINT32_C(0xff)
69399 	/* Allocation error malloc failure */
69400 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_MALLOC_FAILURE		UINT32_C(0xfd)
69401 	/* NVM install error due to invalid index */
69402 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_INDEX_PARAMETER	UINT32_C(0xfb)
69403 	/* NVM install error due to invalid type */
69404 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_TYPE_PARAMETER	UINT32_C(0xf3)
69405 	/* Invalid package due to invalid prerequisite */
69406 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_PREREQUISITE	UINT32_C(0xf2)
69407 	/* Invalid package due to invalid file header */
69408 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_FILE_HEADER	UINT32_C(0xec)
69409 	/* Invalid package due to invalid format */
69410 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_SIGNATURE		UINT32_C(0xeb)
69411 	/* Invalid package due to invalid property stream */
69412 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_PROP_STREAM	UINT32_C(0xea)
69413 	/* Invalid package due to invalid property length */
69414 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_PROP_LENGTH	UINT32_C(0xe9)
69415 	/* Invalid package due to invalid manifest */
69416 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_MANIFEST		UINT32_C(0xe8)
69417 	/* Invalid package due to invalid trailer */
69418 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_TRAILER		UINT32_C(0xe7)
69419 	/* Invalid package due to invalid checksum */
69420 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_CHECKSUM		UINT32_C(0xe6)
69421 	/* Invalid package due to invalid item checksum */
69422 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_ITEM_CHECKSUM	UINT32_C(0xe5)
69423 	/* Invalid package due to invalid length */
69424 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_DATA_LENGTH	UINT32_C(0xe4)
69425 	/* Invalid package due to invalid directive */
69426 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_DIRECTIVE		UINT32_C(0xe1)
69427 	/* Invalid device due to unsupported chip revision */
69428 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_CHIP_REV	UINT32_C(0xce)
69429 	/* Invalid device due to unsupported device ID */
69430 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_DEVICE_ID	UINT32_C(0xcd)
69431 	/* Invalid device due to unsupported subsystem vendor */
69432 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_SUBSYS_VENDOR	UINT32_C(0xcc)
69433 	/* Invalid device due to unsupported subsystem ID */
69434 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_SUBSYS_ID	UINT32_C(0xcb)
69435 	/* Invalid device due to unsupported product ID or customer ID */
69436 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_PLATFORM	UINT32_C(0xc5)
69437 	/* Invalid package due to duplicate item */
69438 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_DUPLICATE_ITEM		UINT32_C(0xc4)
69439 	/* Invalid package due to zero length item */
69440 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_ZERO_LENGTH_ITEM		UINT32_C(0xc3)
69441 	/* NVM integrity error checksum */
69442 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INSTALL_CHECKSUM_ERROR	UINT32_C(0xb9)
69443 	/* NVM integrity error */
69444 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INSTALL_DATA_ERROR	UINT32_C(0xb8)
69445 	/* Authentication error */
69446 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INSTALL_AUTHENTICATION_ERROR UINT32_C(0xb7)
69447 	/* NVM install error item not found */
69448 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_ITEM_NOT_FOUND		UINT32_C(0xb0)
69449 	/* NVM install error item locked */
69450 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_ITEM_LOCKED		UINT32_C(0xa7)
69451 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_LAST			HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_ITEM_LOCKED
69452 	/* problem_item is 8 b */
69453 	uint8_t	problem_item;
69454 	/* There was no problem with any packaged items. */
69455 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_NONE	UINT32_C(0x0)
69456 	/* There was a problem with the NVM package itself. */
69457 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE UINT32_C(0xff)
69458 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_LAST   HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE
69459 	/* reset_required is 8 b */
69460 	uint8_t	reset_required;
69461 	/*
69462 	 * No reset is required for installed/updated firmware or
69463 	 * microcode to take effect.
69464 	 */
69465 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_NONE  UINT32_C(0x0)
69466 	/*
69467 	 * A PCIe reset (e.g. system reboot) is
69468 	 * required for newly installed/updated firmware or
69469 	 * microcode to take effect.
69470 	 */
69471 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_PCI   UINT32_C(0x1)
69472 	/*
69473 	 * A controller power reset (e.g. system power-cycle) is
69474 	 * required for newly installed/updated firmware or
69475 	 * microcode to take effect. Some newly installed/updated
69476 	 * firmware or microcode may still take effect upon the
69477 	 * next PCIe reset.
69478 	 */
69479 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER UINT32_C(0x2)
69480 	#define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_LAST HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER
69481 	uint8_t	unused_0[4];
69482 	/*
69483 	 * This field is used in Output records to indicate that the output
69484 	 * is completely written to RAM. This field should be read as '1'
69485 	 * to indicate that the output has been completely written. When
69486 	 * writing a command completion or response to an internal processor,
69487 	 * the order of writes has to be such that this field is written last.
69488 	 */
69489 	uint8_t	valid;
69490 } hwrm_nvm_install_update_output_t, *phwrm_nvm_install_update_output_t;
69491 
69492 /* hwrm_nvm_install_update_cmd_err (size:64b/8B) */
69493 
69494 typedef struct hwrm_nvm_install_update_cmd_err {
69495 	/*
69496 	 * command specific error codes that goes to
69497 	 * the cmd_err field in Common HWRM Error Response.
69498 	 */
69499 	uint8_t	code;
69500 	/* Unknown error */
69501 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_UNKNOWN		UINT32_C(0x0)
69502 	/* Unable to complete operation due to fragmentation */
69503 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR	UINT32_C(0x1)
69504 	/* nvm is completely full. */
69505 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE	UINT32_C(0x2)
69506 	/* Firmware update failed due to Anti-rollback. */
69507 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_ANTI_ROLLBACK	UINT32_C(0x3)
69508 	/* Firmware update does not support voltage regulators on the device. */
69509 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_VOLTREG_SUPPORT UINT32_C(0x4)
69510 	#define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_LAST		HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_VOLTREG_SUPPORT
69511 	uint8_t	unused_0[7];
69512 } hwrm_nvm_install_update_cmd_err_t, *phwrm_nvm_install_update_cmd_err_t;
69513 
69514 /******************
69515  * hwrm_nvm_flush *
69516  ******************/
69517 
69518 
69519 /* hwrm_nvm_flush_input (size:128b/16B) */
69520 
69521 typedef struct hwrm_nvm_flush_input {
69522 	/* The HWRM command request type. */
69523 	uint16_t	req_type;
69524 	/*
69525 	 * The completion ring to send the completion event on. This should
69526 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
69527 	 */
69528 	uint16_t	cmpl_ring;
69529 	/*
69530 	 * The sequence ID is used by the driver for tracking multiple
69531 	 * commands. This ID is treated as opaque data by the firmware and
69532 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
69533 	 */
69534 	uint16_t	seq_id;
69535 	/*
69536 	 * The target ID of the command:
69537 	 * * 0x0-0xFFF8 - The function ID
69538 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
69539 	 * * 0xFFFD - Reserved for user-space HWRM interface
69540 	 * * 0xFFFF - HWRM
69541 	 */
69542 	uint16_t	target_id;
69543 	/*
69544 	 * A physical address pointer pointing to a host buffer that the
69545 	 * command's response data will be written. This can be either a host
69546 	 * physical address (HPA) or a guest physical address (GPA) and must
69547 	 * point to a physically contiguous block of memory.
69548 	 */
69549 	uint64_t	resp_addr;
69550 } hwrm_nvm_flush_input_t, *phwrm_nvm_flush_input_t;
69551 
69552 /* hwrm_nvm_flush_output (size:128b/16B) */
69553 
69554 typedef struct hwrm_nvm_flush_output {
69555 	/* The specific error status for the command. */
69556 	uint16_t	error_code;
69557 	/* The HWRM command request type. */
69558 	uint16_t	req_type;
69559 	/* The sequence ID from the original command. */
69560 	uint16_t	seq_id;
69561 	/* The length of the response data in number of bytes. */
69562 	uint16_t	resp_len;
69563 	uint8_t	unused_0[7];
69564 	/*
69565 	 * This field is used in Output records to indicate that the output
69566 	 * is completely written to RAM. This field should be read as '1'
69567 	 * to indicate that the output has been completely written. When
69568 	 * writing a command completion or response to an internal processor,
69569 	 * the order of writes has to be such that this field is written last.
69570 	 */
69571 	uint8_t	valid;
69572 } hwrm_nvm_flush_output_t, *phwrm_nvm_flush_output_t;
69573 
69574 /* hwrm_nvm_flush_cmd_err (size:64b/8B) */
69575 
69576 typedef struct hwrm_nvm_flush_cmd_err {
69577 	/*
69578 	 * command specific error codes that goes to
69579 	 * the cmd_err field in Common HWRM Error Response.
69580 	 */
69581 	uint8_t	code;
69582 	/* Unknown error */
69583 	#define HWRM_NVM_FLUSH_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
69584 	/* flush could not be performed */
69585 	#define HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL	UINT32_C(0x1)
69586 	#define HWRM_NVM_FLUSH_CMD_ERR_CODE_LAST   HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL
69587 	uint8_t	unused_0[7];
69588 } hwrm_nvm_flush_cmd_err_t, *phwrm_nvm_flush_cmd_err_t;
69589 
69590 /*************************
69591  * hwrm_nvm_get_variable *
69592  *************************/
69593 
69594 
69595 /* hwrm_nvm_get_variable_input (size:320b/40B) */
69596 
69597 typedef struct hwrm_nvm_get_variable_input {
69598 	/* The HWRM command request type. */
69599 	uint16_t	req_type;
69600 	/*
69601 	 * The completion ring to send the completion event on. This should
69602 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
69603 	 */
69604 	uint16_t	cmpl_ring;
69605 	/*
69606 	 * The sequence ID is used by the driver for tracking multiple
69607 	 * commands. This ID is treated as opaque data by the firmware and
69608 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
69609 	 */
69610 	uint16_t	seq_id;
69611 	/*
69612 	 * The target ID of the command:
69613 	 * * 0x0-0xFFF8 - The function ID
69614 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
69615 	 * * 0xFFFD - Reserved for user-space HWRM interface
69616 	 * * 0xFFFF - HWRM
69617 	 */
69618 	uint16_t	target_id;
69619 	/*
69620 	 * A physical address pointer pointing to a host buffer that the
69621 	 * command's response data will be written. This can be either a host
69622 	 * physical address (HPA) or a guest physical address (GPA) and must
69623 	 * point to a physically contiguous block of memory.
69624 	 */
69625 	uint64_t	resp_addr;
69626 	/*
69627 	 * This is the host address where
69628 	 * nvm variable will be stored
69629 	 */
69630 	uint64_t	dest_data_addr;
69631 	/* size of data in bits */
69632 	uint16_t	data_len;
69633 	/* nvm cfg option number */
69634 	uint16_t	option_num;
69635 	/* reserved. */
69636 	#define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_0	UINT32_C(0x0)
69637 	/* reserved. */
69638 	#define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
69639 	#define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_LAST	HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
69640 	/*
69641 	 * Number of dimensions for this nvm configuration variable.
69642 	 * This value indicates how many of the indexN values to use.
69643 	 * A value of 0 means that none of the indexN values are valid.
69644 	 * A value of 1 requires at index0 is valued, a value of 2
69645 	 * requires that index0 and index1 are valid, and so forth
69646 	 */
69647 	uint16_t	dimensions;
69648 	/* index for the 1st dimensions */
69649 	uint16_t	index_0;
69650 	/* index for the 2nd dimensions */
69651 	uint16_t	index_1;
69652 	/* index for the 3rd dimensions */
69653 	uint16_t	index_2;
69654 	/* index for the 4th dimensions */
69655 	uint16_t	index_3;
69656 	uint8_t	flags;
69657 	/*
69658 	 * When this bit is set to 1, the factory default value will be
69659 	 * returned, 0 returns the operational value.
69660 	 */
69661 	#define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT	UINT32_C(0x1)
69662 	uint8_t	unused_0;
69663 } hwrm_nvm_get_variable_input_t, *phwrm_nvm_get_variable_input_t;
69664 
69665 /* hwrm_nvm_get_variable_output (size:128b/16B) */
69666 
69667 typedef struct hwrm_nvm_get_variable_output {
69668 	/* The specific error status for the command. */
69669 	uint16_t	error_code;
69670 	/* The HWRM command request type. */
69671 	uint16_t	req_type;
69672 	/* The sequence ID from the original command. */
69673 	uint16_t	seq_id;
69674 	/* The length of the response data in number of bytes. */
69675 	uint16_t	resp_len;
69676 	/* size of data of the actual variable retrieved in bits */
69677 	uint16_t	data_len;
69678 	/*
69679 	 * option_num is the option number for the data retrieved. It is
69680 	 * possible in the future that the option number returned would be
69681 	 * different than requested. This condition could occur if an option is
69682 	 * deprecated and a new option id is defined with similar
69683 	 * characteristics, but has a slightly different definition. This
69684 	 * also makes it convenient for the caller to identify the variable
69685 	 * result with the option id from the response.
69686 	 */
69687 	uint16_t	option_num;
69688 	/* reserved. */
69689 	#define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_0	UINT32_C(0x0)
69690 	/* reserved. */
69691 	#define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
69692 	#define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_LAST	HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF
69693 	uint8_t	unused_0[3];
69694 	/*
69695 	 * This field is used in Output records to indicate that the output
69696 	 * is completely written to RAM. This field should be read as '1'
69697 	 * to indicate that the output has been completely written. When
69698 	 * writing a command completion or response to an internal processor,
69699 	 * the order of writes has to be such that this field is written last.
69700 	 */
69701 	uint8_t	valid;
69702 } hwrm_nvm_get_variable_output_t, *phwrm_nvm_get_variable_output_t;
69703 
69704 /* hwrm_nvm_get_variable_cmd_err (size:64b/8B) */
69705 
69706 typedef struct hwrm_nvm_get_variable_cmd_err {
69707 	/*
69708 	 * command specific error codes that goes to
69709 	 * the cmd_err field in Common HWRM Error Response.
69710 	 */
69711 	uint8_t	code;
69712 	/* Unknown error */
69713 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
69714 	/* variable does not exist */
69715 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
69716 	/* configuration is corrupted and the variable cannot be saved */
69717 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
69718 	/* length specified is too small */
69719 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT UINT32_C(0x3)
69720 	#define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LAST	HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT
69721 	uint8_t	unused_0[7];
69722 } hwrm_nvm_get_variable_cmd_err_t, *phwrm_nvm_get_variable_cmd_err_t;
69723 
69724 /*************************
69725  * hwrm_nvm_set_variable *
69726  *************************/
69727 
69728 
69729 /* hwrm_nvm_set_variable_input (size:320b/40B) */
69730 
69731 typedef struct hwrm_nvm_set_variable_input {
69732 	/* The HWRM command request type. */
69733 	uint16_t	req_type;
69734 	/*
69735 	 * The completion ring to send the completion event on. This should
69736 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
69737 	 */
69738 	uint16_t	cmpl_ring;
69739 	/*
69740 	 * The sequence ID is used by the driver for tracking multiple
69741 	 * commands. This ID is treated as opaque data by the firmware and
69742 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
69743 	 */
69744 	uint16_t	seq_id;
69745 	/*
69746 	 * The target ID of the command:
69747 	 * * 0x0-0xFFF8 - The function ID
69748 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
69749 	 * * 0xFFFD - Reserved for user-space HWRM interface
69750 	 * * 0xFFFF - HWRM
69751 	 */
69752 	uint16_t	target_id;
69753 	/*
69754 	 * A physical address pointer pointing to a host buffer that the
69755 	 * command's response data will be written. This can be either a host
69756 	 * physical address (HPA) or a guest physical address (GPA) and must
69757 	 * point to a physically contiguous block of memory.
69758 	 */
69759 	uint64_t	resp_addr;
69760 	/*
69761 	 * This is the host address where
69762 	 * nvm variable will be copied from
69763 	 */
69764 	uint64_t	src_data_addr;
69765 	/* size of data in bits */
69766 	uint16_t	data_len;
69767 	/* nvm cfg option number */
69768 	uint16_t	option_num;
69769 	/* reserved. */
69770 	#define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_0	UINT32_C(0x0)
69771 	/* reserved. */
69772 	#define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
69773 	#define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_LAST	HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
69774 	/*
69775 	 * Number of dimensions for this nvm configuration variable.
69776 	 * This value indicates how many of the indexN values to use.
69777 	 * A value of 0 means that none of the indexN values are valid.
69778 	 * A value of 1 requires at index0 is valued, a value of 2
69779 	 * requires that index0 and index1 are valid, and so forth
69780 	 */
69781 	uint16_t	dimensions;
69782 	/* index for the 1st dimensions */
69783 	uint16_t	index_0;
69784 	/* index for the 2nd dimensions */
69785 	uint16_t	index_1;
69786 	/* index for the 3rd dimensions */
69787 	uint16_t	index_2;
69788 	/* index for the 4th dimensions */
69789 	uint16_t	index_3;
69790 	uint8_t	flags;
69791 	/*
69792 	 * When this bit is 1, flush internal cache after this write
69793 	 * operation (see hwrm_nvm_flush command.)
69794 	 */
69795 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FORCE_FLUSH		UINT32_C(0x1)
69796 	/* encryption method */
69797 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_MASK	UINT32_C(0xe)
69798 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_SFT	1
69799 	/* No encryption. */
69800 		#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_NONE		(UINT32_C(0x0) << 1)
69801 	/* one-way encryption. */
69802 		#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1	(UINT32_C(0x1) << 1)
69803 	/* symmetric AES256 encryption. */
69804 		#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_AES256	(UINT32_C(0x2) << 1)
69805 	/* SHA1 digest appended to plaintext contents, for authentication */
69806 		#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH  (UINT32_C(0x3) << 1)
69807 		#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_LAST	HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH
69808 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_MASK	UINT32_C(0x70)
69809 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_SFT	4
69810 	/* When this bit is 1, update the factory default region */
69811 	#define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FACTORY_DEFAULT		UINT32_C(0x80)
69812 	uint8_t	unused_0;
69813 } hwrm_nvm_set_variable_input_t, *phwrm_nvm_set_variable_input_t;
69814 
69815 /* hwrm_nvm_set_variable_output (size:128b/16B) */
69816 
69817 typedef struct hwrm_nvm_set_variable_output {
69818 	/* The specific error status for the command. */
69819 	uint16_t	error_code;
69820 	/* The HWRM command request type. */
69821 	uint16_t	req_type;
69822 	/* The sequence ID from the original command. */
69823 	uint16_t	seq_id;
69824 	/* The length of the response data in number of bytes. */
69825 	uint16_t	resp_len;
69826 	uint8_t	unused_0[7];
69827 	/*
69828 	 * This field is used in Output records to indicate that the output
69829 	 * is completely written to RAM. This field should be read as '1'
69830 	 * to indicate that the output has been completely written. When
69831 	 * writing a command completion or response to an internal processor,
69832 	 * the order of writes has to be such that this field is written last.
69833 	 */
69834 	uint8_t	valid;
69835 } hwrm_nvm_set_variable_output_t, *phwrm_nvm_set_variable_output_t;
69836 
69837 /* hwrm_nvm_set_variable_cmd_err (size:64b/8B) */
69838 
69839 typedef struct hwrm_nvm_set_variable_cmd_err {
69840 	/*
69841 	 * command specific error codes that goes to
69842 	 * the cmd_err field in Common HWRM Error Response.
69843 	 */
69844 	uint8_t	code;
69845 	/* Unknown error */
69846 	#define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
69847 	/* variable does not exist */
69848 	#define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
69849 	/* configuration is corrupted and the variable cannot be saved */
69850 	#define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
69851 	#define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_LAST	HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR
69852 	uint8_t	unused_0[7];
69853 } hwrm_nvm_set_variable_cmd_err_t, *phwrm_nvm_set_variable_cmd_err_t;
69854 
69855 /****************************
69856  * hwrm_nvm_validate_option *
69857  ****************************/
69858 
69859 
69860 /* hwrm_nvm_validate_option_input (size:320b/40B) */
69861 
69862 typedef struct hwrm_nvm_validate_option_input {
69863 	/* The HWRM command request type. */
69864 	uint16_t	req_type;
69865 	/*
69866 	 * The completion ring to send the completion event on. This should
69867 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
69868 	 */
69869 	uint16_t	cmpl_ring;
69870 	/*
69871 	 * The sequence ID is used by the driver for tracking multiple
69872 	 * commands. This ID is treated as opaque data by the firmware and
69873 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
69874 	 */
69875 	uint16_t	seq_id;
69876 	/*
69877 	 * The target ID of the command:
69878 	 * * 0x0-0xFFF8 - The function ID
69879 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
69880 	 * * 0xFFFD - Reserved for user-space HWRM interface
69881 	 * * 0xFFFF - HWRM
69882 	 */
69883 	uint16_t	target_id;
69884 	/*
69885 	 * A physical address pointer pointing to a host buffer that the
69886 	 * command's response data will be written. This can be either a host
69887 	 * physical address (HPA) or a guest physical address (GPA) and must
69888 	 * point to a physically contiguous block of memory.
69889 	 */
69890 	uint64_t	resp_addr;
69891 	/*
69892 	 * This is the host address where
69893 	 * nvm variable will be copied from
69894 	 */
69895 	uint64_t	src_data_addr;
69896 	/* size of data in bits */
69897 	uint16_t	data_len;
69898 	/* nvm cfg option number */
69899 	uint16_t	option_num;
69900 	/* reserved. */
69901 	#define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_0	UINT32_C(0x0)
69902 	/* reserved. */
69903 	#define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF UINT32_C(0xffff)
69904 	#define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_LAST	HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF
69905 	/*
69906 	 * Number of dimensions for this nvm configuration variable.
69907 	 * This value indicates how many of the indexN values to use.
69908 	 * A value of 0 means that none of the indexN values are valid.
69909 	 * A value of 1 requires at index0 is valued, a value of 2
69910 	 * requires that index0 and index1 are valid, and so forth
69911 	 */
69912 	uint16_t	dimensions;
69913 	/* index for the 1st dimensions */
69914 	uint16_t	index_0;
69915 	/* index for the 2nd dimensions */
69916 	uint16_t	index_1;
69917 	/* index for the 3rd dimensions */
69918 	uint16_t	index_2;
69919 	/* index for the 4th dimensions */
69920 	uint16_t	index_3;
69921 	uint8_t	unused_0[2];
69922 } hwrm_nvm_validate_option_input_t, *phwrm_nvm_validate_option_input_t;
69923 
69924 /* hwrm_nvm_validate_option_output (size:128b/16B) */
69925 
69926 typedef struct hwrm_nvm_validate_option_output {
69927 	/* The specific error status for the command. */
69928 	uint16_t	error_code;
69929 	/* The HWRM command request type. */
69930 	uint16_t	req_type;
69931 	/* The sequence ID from the original command. */
69932 	uint16_t	seq_id;
69933 	/* The length of the response data in number of bytes. */
69934 	uint16_t	resp_len;
69935 	uint8_t	result;
69936 	/*
69937 	 * indicates that the value provided for the option is not matching
69938 	 * with the saved data.
69939 	 */
69940 	#define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_NOT_MATCH UINT32_C(0x0)
69941 	/*
69942 	 * indicates that the value provided for the option is matching the
69943 	 * saved data.
69944 	 */
69945 	#define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH	UINT32_C(0x1)
69946 	#define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_LAST	HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH
69947 	uint8_t	unused_0[6];
69948 	/*
69949 	 * This field is used in Output records to indicate that the output
69950 	 * is completely written to RAM. This field should be read as '1'
69951 	 * to indicate that the output has been completely written. When
69952 	 * writing a command completion or response to an internal processor,
69953 	 * the order of writes has to be such that this field is written last.
69954 	 */
69955 	uint8_t	valid;
69956 } hwrm_nvm_validate_option_output_t, *phwrm_nvm_validate_option_output_t;
69957 
69958 /* hwrm_nvm_validate_option_cmd_err (size:64b/8B) */
69959 
69960 typedef struct hwrm_nvm_validate_option_cmd_err {
69961 	/*
69962 	 * command specific error codes that goes to
69963 	 * the cmd_err field in Common HWRM Error Response.
69964 	 */
69965 	uint8_t	code;
69966 	/* Unknown error */
69967 	#define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
69968 	#define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_LAST   HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN
69969 	uint8_t	unused_0[7];
69970 } hwrm_nvm_validate_option_cmd_err_t, *phwrm_nvm_validate_option_cmd_err_t;
69971 
69972 /*****************************
69973  * hwrm_nvm_factory_defaults *
69974  *****************************/
69975 
69976 
69977 /* hwrm_nvm_factory_defaults_input (size:192b/24B) */
69978 
69979 typedef struct hwrm_nvm_factory_defaults_input {
69980 	/* The HWRM command request type. */
69981 	uint16_t	req_type;
69982 	/*
69983 	 * The completion ring to send the completion event on. This should
69984 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
69985 	 */
69986 	uint16_t	cmpl_ring;
69987 	/*
69988 	 * The sequence ID is used by the driver for tracking multiple
69989 	 * commands. This ID is treated as opaque data by the firmware and
69990 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
69991 	 */
69992 	uint16_t	seq_id;
69993 	/*
69994 	 * The target ID of the command:
69995 	 * * 0x0-0xFFF8 - The function ID
69996 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
69997 	 * * 0xFFFD - Reserved for user-space HWRM interface
69998 	 * * 0xFFFF - HWRM
69999 	 */
70000 	uint16_t	target_id;
70001 	/*
70002 	 * A physical address pointer pointing to a host buffer that the
70003 	 * command's response data will be written. This can be either a host
70004 	 * physical address (HPA) or a guest physical address (GPA) and must
70005 	 * point to a physically contiguous block of memory.
70006 	 */
70007 	uint64_t	resp_addr;
70008 	/* mode is 8 b */
70009 	uint8_t	mode;
70010 	/*
70011 	 * If set to 1, it triggers restoration of factory default data.
70012 	 * If the selection field is zero, all data are restored to default.
70013 	 * If the selection field is non-zero, only the selected data are
70014 	 * restored.
70015 	 */
70016 	#define HWRM_NVM_FACTORY_DEFAULTS_INPUT_MODE_RESTORE UINT32_C(0x0)
70017 	/*
70018 	 * If set to 1, it triggers creation of factory default data.
70019 	 * If the selection field is zero, all default data are created.
70020 	 * If the selection field is non-zero, only the selected data are
70021 	 * created.
70022 	 */
70023 	#define HWRM_NVM_FACTORY_DEFAULTS_INPUT_MODE_CREATE  UINT32_C(0x1)
70024 	#define HWRM_NVM_FACTORY_DEFAULTS_INPUT_MODE_LAST   HWRM_NVM_FACTORY_DEFAULTS_INPUT_MODE_CREATE
70025 	uint8_t	unused_0[1];
70026 	/*
70027 	 * This field selects which data the factory default operation applies.
70028 	 * If it is '0', the operation applies to all data. If it is not '0',
70029 	 * the operation only applies to the data selected by this field.
70030 	 */
70031 	uint16_t	selection;
70032 	/* When this bit is '1', config option is selected. */
70033 	#define HWRM_NVM_FACTORY_DEFAULTS_INPUT_SELECTION_CFG_OPTION	UINT32_C(0x1)
70034 	/* When this bit is '1', crashdump is selected. */
70035 	#define HWRM_NVM_FACTORY_DEFAULTS_INPUT_SELECTION_CRASHDUMP	UINT32_C(0x2)
70036 	uint8_t	unused_1[4];
70037 } hwrm_nvm_factory_defaults_input_t, *phwrm_nvm_factory_defaults_input_t;
70038 
70039 /* hwrm_nvm_factory_defaults_output (size:128b/16B) */
70040 
70041 typedef struct hwrm_nvm_factory_defaults_output {
70042 	/* The specific error status for the command. */
70043 	uint16_t	error_code;
70044 	/* The HWRM command request type. */
70045 	uint16_t	req_type;
70046 	/* The sequence ID from the original command. */
70047 	uint16_t	seq_id;
70048 	/* The length of the response data in number of bytes. */
70049 	uint16_t	resp_len;
70050 	uint8_t	result;
70051 	/* factory defaults created successfully. */
70052 	#define HWRM_NVM_FACTORY_DEFAULTS_OUTPUT_RESULT_CREATE_OK	UINT32_C(0x0)
70053 	/* factory defaults restored successfully. */
70054 	#define HWRM_NVM_FACTORY_DEFAULTS_OUTPUT_RESULT_RESTORE_OK	UINT32_C(0x1)
70055 	/* factory defaults already created. */
70056 	#define HWRM_NVM_FACTORY_DEFAULTS_OUTPUT_RESULT_CREATE_ALREADY UINT32_C(0x2)
70057 	#define HWRM_NVM_FACTORY_DEFAULTS_OUTPUT_RESULT_LAST	HWRM_NVM_FACTORY_DEFAULTS_OUTPUT_RESULT_CREATE_ALREADY
70058 	uint8_t	unused_0[6];
70059 	/*
70060 	 * This field is used in Output records to indicate that the output
70061 	 * is completely written to RAM. This field should be read as '1'
70062 	 * to indicate that the output has been completely written. When
70063 	 * writing a command completion or response to an internal processor,
70064 	 * the order of writes has to be such that this field is written last.
70065 	 */
70066 	uint8_t	valid;
70067 } hwrm_nvm_factory_defaults_output_t, *phwrm_nvm_factory_defaults_output_t;
70068 
70069 /* hwrm_nvm_factory_defaults_cmd_err (size:64b/8B) */
70070 
70071 typedef struct hwrm_nvm_factory_defaults_cmd_err {
70072 	/*
70073 	 * command specific error codes that goes to
70074 	 * the cmd_err field in Common HWRM Error Response.
70075 	 */
70076 	uint8_t	code;
70077 	/* Unknown error */
70078 	#define HWRM_NVM_FACTORY_DEFAULTS_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
70079 	/* valid configuration not present to create defaults */
70080 	#define HWRM_NVM_FACTORY_DEFAULTS_CMD_ERR_CODE_NO_VALID_CFG UINT32_C(0x1)
70081 	/* No saved configuration present to restore, restore failed */
70082 	#define HWRM_NVM_FACTORY_DEFAULTS_CMD_ERR_CODE_NO_SAVED_CFG UINT32_C(0x2)
70083 	#define HWRM_NVM_FACTORY_DEFAULTS_CMD_ERR_CODE_LAST	HWRM_NVM_FACTORY_DEFAULTS_CMD_ERR_CODE_NO_SAVED_CFG
70084 	uint8_t	unused_0[7];
70085 } hwrm_nvm_factory_defaults_cmd_err_t, *phwrm_nvm_factory_defaults_cmd_err_t;
70086 
70087 /****************************
70088  * hwrm_nvm_req_arbitration *
70089  ****************************/
70090 
70091 
70092 /* hwrm_nvm_req_arbitration_input (size:192b/24B) */
70093 
70094 typedef struct hwrm_nvm_req_arbitration_input {
70095 	/* The HWRM command request type. */
70096 	uint16_t	req_type;
70097 	/*
70098 	 * The completion ring to send the completion event on. This should
70099 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
70100 	 */
70101 	uint16_t	cmpl_ring;
70102 	/*
70103 	 * The sequence ID is used by the driver for tracking multiple
70104 	 * commands. This ID is treated as opaque data by the firmware and
70105 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
70106 	 */
70107 	uint16_t	seq_id;
70108 	/*
70109 	 * The target ID of the command:
70110 	 * * 0x0-0xFFF8 - The function ID
70111 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
70112 	 * * 0xFFFD - Reserved for user-space HWRM interface
70113 	 * * 0xFFFF - HWRM
70114 	 */
70115 	uint16_t	target_id;
70116 	/*
70117 	 * A physical address pointer pointing to a host buffer that the
70118 	 * command's response data will be written. This can be either a host
70119 	 * physical address (HPA) or a guest physical address (GPA) and must
70120 	 * point to a physically contiguous block of memory.
70121 	 */
70122 	uint64_t	resp_addr;
70123 	/* Type of NVRAM arbitration request */
70124 	uint8_t	type;
70125 	/* Query if NVRAM arbitration semaphore is acquired outside of Nitro */
70126 	#define HWRM_NVM_REQ_ARBITRATION_INPUT_TYPE_STATUS  UINT32_C(0x0)
70127 	/* Acquire NVRAM arbitration semaphore */
70128 	#define HWRM_NVM_REQ_ARBITRATION_INPUT_TYPE_ACQUIRE UINT32_C(0x1)
70129 	/* Release NVRAM arbitration semaphore */
70130 	#define HWRM_NVM_REQ_ARBITRATION_INPUT_TYPE_RELEASE UINT32_C(0x2)
70131 	#define HWRM_NVM_REQ_ARBITRATION_INPUT_TYPE_LAST   HWRM_NVM_REQ_ARBITRATION_INPUT_TYPE_RELEASE
70132 	uint8_t	unused_0[7];
70133 } hwrm_nvm_req_arbitration_input_t, *phwrm_nvm_req_arbitration_input_t;
70134 
70135 /* hwrm_nvm_req_arbitration_output (size:128b/16B) */
70136 
70137 typedef struct hwrm_nvm_req_arbitration_output {
70138 	/* The specific error status for the command. */
70139 	uint16_t	error_code;
70140 	/* The HWRM command request type. */
70141 	uint16_t	req_type;
70142 	/* The sequence ID from the original command. */
70143 	uint16_t	seq_id;
70144 	/* The length of the response data in number of bytes. */
70145 	uint16_t	resp_len;
70146 	/* NVRAM arbitration semaphore is acquired if value is 1 */
70147 	uint8_t	acquired;
70148 	uint8_t	unused_0[6];
70149 	/*
70150 	 * This field is used in Output records to indicate that the output
70151 	 * is completely written to RAM. This field should be read as '1'
70152 	 * to indicate that the output has been completely written. When
70153 	 * writing a command completion or response to an internal processor,
70154 	 * the order of writes has to be such that this field is written last.
70155 	 */
70156 	uint8_t	valid;
70157 } hwrm_nvm_req_arbitration_output_t, *phwrm_nvm_req_arbitration_output_t;
70158 
70159 /*******************
70160  * hwrm_nvm_defrag *
70161  *******************/
70162 
70163 
70164 /* hwrm_nvm_defrag_input (size:192b/24B) */
70165 
70166 typedef struct hwrm_nvm_defrag_input {
70167 	/* The HWRM command request type. */
70168 	uint16_t	req_type;
70169 	/*
70170 	 * The completion ring to send the completion event on. This should
70171 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
70172 	 */
70173 	uint16_t	cmpl_ring;
70174 	/*
70175 	 * The sequence ID is used by the driver for tracking multiple
70176 	 * commands. This ID is treated as opaque data by the firmware and
70177 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
70178 	 */
70179 	uint16_t	seq_id;
70180 	/*
70181 	 * The target ID of the command:
70182 	 * * 0x0-0xFFF8 - The function ID
70183 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
70184 	 * * 0xFFFD - Reserved for user-space HWRM interface
70185 	 * * 0xFFFF - HWRM
70186 	 */
70187 	uint16_t	target_id;
70188 	/*
70189 	 * A physical address pointer pointing to a host buffer that the
70190 	 * command's response data will be written. This can be either a host
70191 	 * physical address (HPA) or a guest physical address (GPA) and must
70192 	 * point to a physically contiguous block of memory.
70193 	 */
70194 	uint64_t	resp_addr;
70195 	uint32_t	flags;
70196 	/* This bit must be '1' to perform NVM defragmentation. */
70197 	#define HWRM_NVM_DEFRAG_INPUT_FLAGS_DEFRAG	UINT32_C(0x1)
70198 	uint8_t	unused_0[4];
70199 } hwrm_nvm_defrag_input_t, *phwrm_nvm_defrag_input_t;
70200 
70201 /* hwrm_nvm_defrag_output (size:128b/16B) */
70202 
70203 typedef struct hwrm_nvm_defrag_output {
70204 	/* The specific error status for the command. */
70205 	uint16_t	error_code;
70206 	/* The HWRM command request type. */
70207 	uint16_t	req_type;
70208 	/* The sequence ID from the original command. */
70209 	uint16_t	seq_id;
70210 	/* The length of the response data in number of bytes. */
70211 	uint16_t	resp_len;
70212 	uint8_t	unused_0[7];
70213 	/*
70214 	 * This field is used in Output records to indicate that the output
70215 	 * is completely written to RAM. This field should be read as '1'
70216 	 * to indicate that the output has been completely written. When
70217 	 * writing a command completion or response to an internal processor,
70218 	 * the order of writes has to be such that this field is written last.
70219 	 */
70220 	uint8_t	valid;
70221 } hwrm_nvm_defrag_output_t, *phwrm_nvm_defrag_output_t;
70222 
70223 /* hwrm_nvm_defrag_cmd_err (size:64b/8B) */
70224 
70225 typedef struct hwrm_nvm_defrag_cmd_err {
70226 	/*
70227 	 * command specific error codes that goes to
70228 	 * the cmd_err field in Common HWRM Error Response.
70229 	 */
70230 	uint8_t	code;
70231 	/* Unknown error */
70232 	#define HWRM_NVM_DEFRAG_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
70233 	/* NVM defragmentation could not be performed */
70234 	#define HWRM_NVM_DEFRAG_CMD_ERR_CODE_FAIL	UINT32_C(0x1)
70235 	#define HWRM_NVM_DEFRAG_CMD_ERR_CODE_LAST   HWRM_NVM_DEFRAG_CMD_ERR_CODE_FAIL
70236 	uint8_t	unused_0[7];
70237 } hwrm_nvm_defrag_cmd_err_t, *phwrm_nvm_defrag_cmd_err_t;
70238 
70239 /*******************************
70240  * hwrm_nvm_get_vpd_field_info *
70241  *******************************/
70242 
70243 
70244 /* hwrm_nvm_get_vpd_field_info_input (size:192b/24B) */
70245 
70246 typedef struct hwrm_nvm_get_vpd_field_info_input {
70247 	/* The HWRM command request type. */
70248 	uint16_t	req_type;
70249 	/*
70250 	 * The completion ring to send the completion event on. This should
70251 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
70252 	 */
70253 	uint16_t	cmpl_ring;
70254 	/*
70255 	 * The sequence ID is used by the driver for tracking multiple
70256 	 * commands. This ID is treated as opaque data by the firmware and
70257 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
70258 	 */
70259 	uint16_t	seq_id;
70260 	/*
70261 	 * The target ID of the command:
70262 	 * * 0x0-0xFFF8 - The function ID
70263 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
70264 	 * * 0xFFFD - Reserved for user-space HWRM interface
70265 	 * * 0xFFFF - HWRM
70266 	 */
70267 	uint16_t	target_id;
70268 	/*
70269 	 * A physical address pointer pointing to a host buffer that the
70270 	 * command's response data will be written. This can be either a host
70271 	 * physical address (HPA) or a guest physical address (GPA) and must
70272 	 * point to a physically contiguous block of memory.
70273 	 */
70274 	uint64_t	resp_addr;
70275 	/*
70276 	 * Tag ID of the requested field. To request the Product Name
70277 	 * a value of [0x00, 0x82] should be used. All other fields
70278 	 * would use the two byte hexadecimal value of the ASCII
70279 	 * characters. The first letter of the ASCII keyword is recorded
70280 	 * in tag_id[0] and the next letter in tag_id[1].
70281 	 */
70282 	uint8_t	tag_id[2];
70283 	uint8_t	unused_0[6];
70284 } hwrm_nvm_get_vpd_field_info_input_t, *phwrm_nvm_get_vpd_field_info_input_t;
70285 
70286 /* hwrm_nvm_get_vpd_field_info_output (size:2176b/272B) */
70287 
70288 typedef struct hwrm_nvm_get_vpd_field_info_output {
70289 	/* The specific error status for the command. */
70290 	uint16_t	error_code;
70291 	/* The HWRM command request type. */
70292 	uint16_t	req_type;
70293 	/* The sequence ID from the original command. */
70294 	uint16_t	seq_id;
70295 	/* The length of the response data in number of bytes. */
70296 	uint16_t	resp_len;
70297 	/* Data retrieved from VPD field */
70298 	uint8_t	data[256];
70299 	/* size of data retrieved in bytes */
70300 	uint16_t	data_len;
70301 	uint8_t	unused_0[5];
70302 	/*
70303 	 * This field is used in Output records to indicate that the output
70304 	 * is completely written to RAM. This field should be read as '1'
70305 	 * to indicate that the output has been completely written. When
70306 	 * writing a command completion or response to an internal processor,
70307 	 * the order of writes has to be such that this field is written last.
70308 	 */
70309 	uint8_t	valid;
70310 } hwrm_nvm_get_vpd_field_info_output_t, *phwrm_nvm_get_vpd_field_info_output_t;
70311 
70312 /*******************************
70313  * hwrm_nvm_set_vpd_field_info *
70314  *******************************/
70315 
70316 
70317 /* hwrm_nvm_set_vpd_field_info_input (size:256b/32B) */
70318 
70319 typedef struct hwrm_nvm_set_vpd_field_info_input {
70320 	/* The HWRM command request type. */
70321 	uint16_t	req_type;
70322 	/*
70323 	 * The completion ring to send the completion event on. This should
70324 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
70325 	 */
70326 	uint16_t	cmpl_ring;
70327 	/*
70328 	 * The sequence ID is used by the driver for tracking multiple
70329 	 * commands. This ID is treated as opaque data by the firmware and
70330 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
70331 	 */
70332 	uint16_t	seq_id;
70333 	/*
70334 	 * The target ID of the command:
70335 	 * * 0x0-0xFFF8 - The function ID
70336 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
70337 	 * * 0xFFFD - Reserved for user-space HWRM interface
70338 	 * * 0xFFFF - HWRM
70339 	 */
70340 	uint16_t	target_id;
70341 	/*
70342 	 * A physical address pointer pointing to a host buffer that the
70343 	 * command's response data will be written. This can be either a host
70344 	 * physical address (HPA) or a guest physical address (GPA) and must
70345 	 * point to a physically contiguous block of memory.
70346 	 */
70347 	uint64_t	resp_addr;
70348 	/*
70349 	 * This is the host address where
70350 	 * VPD data value will be copied from
70351 	 */
70352 	uint64_t	host_src_addr;
70353 	/*
70354 	 * Tag ID of the requested field. To request the Product Name
70355 	 * a value of [0x00, 0x82] should be used. All other fields
70356 	 * would use the two byte hexadecimal value of the ASCII
70357 	 * characters. The first letter of the ASCII keyword is recorded
70358 	 * in tag_id[0] and the next letter in tag_id[1].
70359 	 */
70360 	uint8_t	tag_id[2];
70361 	/* size of data in bytes */
70362 	uint16_t	data_len;
70363 	uint8_t	unused_0[4];
70364 } hwrm_nvm_set_vpd_field_info_input_t, *phwrm_nvm_set_vpd_field_info_input_t;
70365 
70366 /* hwrm_nvm_set_vpd_field_info_output (size:128b/16B) */
70367 
70368 typedef struct hwrm_nvm_set_vpd_field_info_output {
70369 	/* The specific error status for the command. */
70370 	uint16_t	error_code;
70371 	/* The HWRM command request type. */
70372 	uint16_t	req_type;
70373 	/* The sequence ID from the original command. */
70374 	uint16_t	seq_id;
70375 	/* The length of the response data in number of bytes. */
70376 	uint16_t	resp_len;
70377 	uint8_t	unused_0[7];
70378 	/*
70379 	 * This field is used in Output records to indicate that the output
70380 	 * is completely written to RAM. This field should be read as '1'
70381 	 * to indicate that the output has been completely written. When
70382 	 * writing a command completion or response to an internal processor,
70383 	 * the order of writes has to be such that this field is written last.
70384 	 */
70385 	uint8_t	valid;
70386 } hwrm_nvm_set_vpd_field_info_output_t, *phwrm_nvm_set_vpd_field_info_output_t;
70387 
70388 #define ROCE_SP_HSI_VERSION_MAJOR 1
70389 #define ROCE_SP_HSI_VERSION_MINOR 8
70390 #define ROCE_SP_HSI_VERSION_UPDATE 4
70391 #define ROCE_SP_HSI_VERSION_STR "1.8.4"
70392 /*
70393  * Following is the signature for ROCE_SP_HSI message field that indicates
70394  * not applicable (All F's). Need to cast it the size of the field if
70395  * needed.
70396  */
70397 #define ROCE_SP_HSI_NA_SIGNATURE ((uint32_t)(-1))
70398 
70399 /* cmdq_init (size:128b/16B) */
70400 
70401 typedef struct cmdq_init {
70402 	/* CMDQ PBL physical address. */
70403 	uint64_t	cmdq_pbl;
70404 	uint16_t	cmdq_size_cmdq_lvl;
70405 	/* CMDQ PBL indirection levels. */
70406 	#define CMDQ_INIT_CMDQ_LVL_MASK UINT32_C(0x3)
70407 	#define CMDQ_INIT_CMDQ_LVL_SFT  0
70408 	/* CMDQ size. */
70409 	#define CMDQ_INIT_CMDQ_SIZE_MASK UINT32_C(0xfffc)
70410 	#define CMDQ_INIT_CMDQ_SIZE_SFT 2
70411 	/* CREQ completion ring id. */
70412 	uint16_t	creq_ring_id;
70413 	/* Mailbox producer index. MSB must also be set. */
70414 	uint32_t	prod_idx;
70415 } cmdq_init_t, *pcmdq_init_t;
70416 
70417 /* cmdq_update (size:128b/16B) */
70418 
70419 typedef struct cmdq_update {
70420 	/* reserved64 is 64 b */
70421 	uint64_t	reserved64;
70422 	/* reserved32 is 32 b */
70423 	uint32_t	reserved32;
70424 	/* Mailbox producer index. */
70425 	uint32_t	prod_idx;
70426 } cmdq_update_t, *pcmdq_update_t;
70427 
70428 /* cmdq_base (size:128b/16B) */
70429 
70430 typedef struct cmdq_base {
70431 	/* Command opcode. */
70432 	uint8_t	opcode;
70433 	/*
70434 	 * Create QP command allocates QP context with the specified
70435 	 * SQ, RQ/SRQ, CQ and other parameters.
70436 	 */
70437 	#define CMDQ_BASE_OPCODE_CREATE_QP			UINT32_C(0x1)
70438 	/*
70439 	 * Destroy QP command deletes the QP context and ceases
70440 	 * any further reference.
70441 	 */
70442 	#define CMDQ_BASE_OPCODE_DESTROY_QP			UINT32_C(0x2)
70443 	/*
70444 	 * Modify QP command changes QP states and other QP specific
70445 	 * parameters.
70446 	 */
70447 	#define CMDQ_BASE_OPCODE_MODIFY_QP			UINT32_C(0x3)
70448 	/* Query QP command retrieves info about the specified QP. */
70449 	#define CMDQ_BASE_OPCODE_QUERY_QP			UINT32_C(0x4)
70450 	/* Create SRQ command allocates a SRQ with the specified parameters. */
70451 	#define CMDQ_BASE_OPCODE_CREATE_SRQ			UINT32_C(0x5)
70452 	/* Destroy SRQ command deletes and flushes the specified SRQ. */
70453 	#define CMDQ_BASE_OPCODE_DESTROY_SRQ			UINT32_C(0x6)
70454 	/* Query SRP command retrieves info about the specified SRQ. */
70455 	#define CMDQ_BASE_OPCODE_QUERY_SRQ			UINT32_C(0x8)
70456 	/* Create CQ command allocates a CQ with the specified parameters. */
70457 	#define CMDQ_BASE_OPCODE_CREATE_CQ			UINT32_C(0x9)
70458 	/* Destroy CQ command deletes and flushes the specified CQ. */
70459 	#define CMDQ_BASE_OPCODE_DESTROY_CQ			UINT32_C(0xa)
70460 	/* Resize CQ command resizes the specified CQ. */
70461 	#define CMDQ_BASE_OPCODE_RESIZE_CQ			UINT32_C(0xc)
70462 	/*
70463 	 * Allocate MRW command allocates a MR/MW with the specified parameters
70464 	 * and returns the region's L_KEY/R_KEY
70465 	 */
70466 	#define CMDQ_BASE_OPCODE_ALLOCATE_MRW			UINT32_C(0xd)
70467 	/*
70468 	 * De-allocate key command frees a MR/MW entry associated with the
70469 	 * specified key.
70470 	 */
70471 	#define CMDQ_BASE_OPCODE_DEALLOCATE_KEY		UINT32_C(0xe)
70472 	/* Register MR command registers memory to the specified MR. */
70473 	#define CMDQ_BASE_OPCODE_REGISTER_MR			UINT32_C(0xf)
70474 	/* Deregister MR command de-registers memory from the specified MR. */
70475 	#define CMDQ_BASE_OPCODE_DEREGISTER_MR		UINT32_C(0x10)
70476 	/* Add GID command adds a GID to the local address table. */
70477 	#define CMDQ_BASE_OPCODE_ADD_GID			UINT32_C(0x11)
70478 	/* Delete GID command deletes a GID from the local address table. */
70479 	#define CMDQ_BASE_OPCODE_DELETE_GID			UINT32_C(0x12)
70480 	/* Modify GID command modifies a GID in the local address table. */
70481 	#define CMDQ_BASE_OPCODE_MODIFY_GID			UINT32_C(0x17)
70482 	/* Query GID command queries a GID in the local address table. */
70483 	#define CMDQ_BASE_OPCODE_QUERY_GID			UINT32_C(0x18)
70484 	/* Create QP1 command allocates a QP1 only. */
70485 	#define CMDQ_BASE_OPCODE_CREATE_QP1			UINT32_C(0x13)
70486 	/* Destroy QP1 command deletes and flushes the specified QP1. */
70487 	#define CMDQ_BASE_OPCODE_DESTROY_QP1			UINT32_C(0x14)
70488 	/* Create AH command allocates an AH with the specified parameters. */
70489 	#define CMDQ_BASE_OPCODE_CREATE_AH			UINT32_C(0x15)
70490 	/* Destroy AH command deletes the specified AH. */
70491 	#define CMDQ_BASE_OPCODE_DESTROY_AH			UINT32_C(0x16)
70492 	/*
70493 	 * Initialize firmware command initializes the firmware with
70494 	 * the specified parameters.
70495 	 */
70496 	#define CMDQ_BASE_OPCODE_INITIALIZE_FW		UINT32_C(0x80)
70497 	/* De-initialize firmware command deinitializes the firmware. */
70498 	#define CMDQ_BASE_OPCODE_DEINITIALIZE_FW		UINT32_C(0x81)
70499 	/* Stop the function */
70500 	#define CMDQ_BASE_OPCODE_STOP_FUNC			UINT32_C(0x82)
70501 	/* Query the HW capabilities for the function. */
70502 	#define CMDQ_BASE_OPCODE_QUERY_FUNC			UINT32_C(0x83)
70503 	/*
70504 	 * Set the following resources for the function:
70505 	 * - Max QP, CQ, MR+MW, SRQ per PF
70506 	 * - Max QP, CQ, MR+MW, SRQ per VF
70507 	 */
70508 	#define CMDQ_BASE_OPCODE_SET_FUNC_RESOURCES		UINT32_C(0x84)
70509 	/*
70510 	 * Read the current state of any internal resource context. Can only be
70511 	 * issued from a PF.
70512 	 */
70513 	#define CMDQ_BASE_OPCODE_READ_CONTEXT			UINT32_C(0x85)
70514 	/*
70515 	 * Send a request from VF to pass a command to the PF. VF HSI is
70516 	 * suspended until the PF returns the response
70517 	 */
70518 	#define CMDQ_BASE_OPCODE_VF_BACKCHANNEL_REQUEST	UINT32_C(0x86)
70519 	/*
70520 	 * Read VF memory (primarily to get the backchannel request blob). Can
70521 	 * only be issued from a PF.
70522 	 */
70523 	#define CMDQ_BASE_OPCODE_READ_VF_MEMORY		UINT32_C(0x87)
70524 	/*
70525 	 * Write VF memory (primarily to put the backchannel response blob),
70526 	 * and reenable VF HSI (post a CAG completion to it). Can only be
70527 	 * issued from a PF.
70528 	 */
70529 	#define CMDQ_BASE_OPCODE_COMPLETE_VF_REQUEST		UINT32_C(0x88)
70530 	/*
70531 	 * Deprecated.
70532 	 * Extend resource (QPC, MRW, CQ, SRQ) array, after the host allocates
70533 	 * more. Can only be issued from a PF.
70534 	 */
70535 	#define CMDQ_BASE_OPCODE_EXTEND_CONTEXT_ARRAY_DEPRECATED UINT32_C(0x89)
70536 	/* Map TC to COS. Can only be issued from a PF. */
70537 	#define CMDQ_BASE_OPCODE_MAP_TC_TO_COS		UINT32_C(0x8a)
70538 	/* Query version. */
70539 	#define CMDQ_BASE_OPCODE_QUERY_VERSION		UINT32_C(0x8b)
70540 	/* Modify congestion control. Can only be issued from a PF. */
70541 	#define CMDQ_BASE_OPCODE_MODIFY_ROCE_CC		UINT32_C(0x8c)
70542 	/* Query congestion control. */
70543 	#define CMDQ_BASE_OPCODE_QUERY_ROCE_CC		UINT32_C(0x8d)
70544 	/* Query RoCE statistics. */
70545 	#define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS		UINT32_C(0x8e)
70546 	/* Set LAG mode. */
70547 	#define CMDQ_BASE_OPCODE_SET_LINK_AGGR_MODE		UINT32_C(0x8f)
70548 	/* Modify CQ */
70549 	#define CMDQ_BASE_OPCODE_MODIFY_CQ			UINT32_C(0x90)
70550 	/*
70551 	 * Query QP for a PF other than the requesting PF. Also can query for
70552 	 * more than one QP.
70553 	 */
70554 	#define CMDQ_BASE_OPCODE_QUERY_QP_EXTEND		UINT32_C(0x91)
70555 	/* Query extended RoCE statistics. */
70556 	#define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS_EXT		UINT32_C(0x92)
70557 	/*
70558 	 * This command updates the QP context id ranges on the PF,
70559 	 * to orchestrate QP context id range migration.
70560 	 * This command is valid for devices that
70561 	 * support the pseudo-static QP allocation feature.
70562 	 */
70563 	#define CMDQ_BASE_OPCODE_ORCHESTRATE_QID_MIGRATION	UINT32_C(0x93)
70564 	/*
70565 	 * This command allocates a batch of the requested count of QPs
70566 	 * in a sequential range.
70567 	 */
70568 	#define CMDQ_BASE_OPCODE_CREATE_QP_BATCH		UINT32_C(0x94)
70569 	/*
70570 	 * This command deletes a batch of the requested count of QPs.
70571 	 * The starting QP ID can be specified to request a batch deletion
70572 	 * of a sequential range.
70573 	 */
70574 	#define CMDQ_BASE_OPCODE_DESTROY_QP_BATCH		UINT32_C(0x95)
70575 	/*
70576 	 * This command allocates an extended RoCE statistics context
70577 	 * that supports periodic DMA to a host address. The extended
70578 	 * statistics context id can be assigned by the driver
70579 	 * via `create_qp`, `create_qp_batch`, or `modify_qp` to a specific QP,
70580 	 * a subset of QPs or to all QPs of a specific function.
70581 	 * These statistics can be queried via `query_roce_stats_ext_v2`.
70582 	 */
70583 	#define CMDQ_BASE_OPCODE_ALLOCATE_ROCE_STATS_EXT_CTX	UINT32_C(0x96)
70584 	/* This command deallocates an extended RoCE statistics context. */
70585 	#define CMDQ_BASE_OPCODE_DEALLOCATE_ROCE_STATS_EXT_CTX   UINT32_C(0x97)
70586 	/*
70587 	 * This command queries extended RoCE statistics for context
70588 	 * allocated via `allocate_roce_stats_ext_ctx`.
70589 	 */
70590 	#define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS_EXT_V2	UINT32_C(0x98)
70591 	#define CMDQ_BASE_OPCODE_LAST			CMDQ_BASE_OPCODE_QUERY_ROCE_STATS_EXT_V2
70592 	/* Size of the command in 16-byte units. */
70593 	uint8_t	cmd_size;
70594 	/* Flags and attribs of the command. */
70595 	uint16_t	flags;
70596 	/* Driver supplied handle to associate the command and the response. */
70597 	uint16_t	cookie;
70598 	/* Size of the response buffer in 16-byte units. */
70599 	uint8_t	resp_size;
70600 	uint8_t	reserved8;
70601 	/* Host address of the response. */
70602 	uint64_t	resp_addr;
70603 } cmdq_base_t, *pcmdq_base_t;
70604 
70605 /* creq_base (size:128b/16B) */
70606 
70607 typedef struct creq_base {
70608 	uint8_t	type;
70609 	/*
70610 	 * This field indicates the exact type of the completion.
70611 	 * By convention, the LSB identifies the length of the
70612 	 * record in 16B units. Even values indicate 16B
70613 	 * records. Odd values indicate 32B
70614 	 * records.
70615 	 */
70616 	#define CREQ_BASE_TYPE_MASK	UINT32_C(0x3f)
70617 	#define CREQ_BASE_TYPE_SFT	0
70618 	/* QP Async Notification */
70619 		#define CREQ_BASE_TYPE_QP_EVENT	UINT32_C(0x38)
70620 	/* Function Async Notification */
70621 		#define CREQ_BASE_TYPE_FUNC_EVENT  UINT32_C(0x3a)
70622 		#define CREQ_BASE_TYPE_LAST	CREQ_BASE_TYPE_FUNC_EVENT
70623 	uint8_t	reserved56[7];
70624 	uint8_t	v;
70625 	/*
70626 	 * This value is written by the NIC such that it will be different
70627 	 * for each pass through the completion queue. The even passes
70628 	 * will write 1. The odd passes will write 0.
70629 	 */
70630 	#define CREQ_BASE_V	UINT32_C(0x1)
70631 	/* This is the modifier on to the type field. */
70632 	uint8_t	event;
70633 	uint8_t	reserved48[6];
70634 } creq_base_t, *pcreq_base_t;
70635 
70636 /* creq_resp_sb_hdr (size:64b/8B) */
70637 
70638 typedef struct creq_resp_sb_hdr {
70639 	/* Command opcode. */
70640 	uint8_t	opcode;
70641 	/* Query QP command response. */
70642 	#define CREQ_RESP_SB_HDR_OPCODE_QUERY_QP		UINT32_C(0x4)
70643 	/* Query SRQ command response. */
70644 	#define CREQ_RESP_SB_HDR_OPCODE_QUERY_SRQ		UINT32_C(0x8)
70645 	/* Query GID command response. */
70646 	#define CREQ_RESP_SB_HDR_OPCODE_QUERY_GID		UINT32_C(0x18)
70647 	/* Query info PF command response */
70648 	#define CREQ_RESP_SB_HDR_OPCODE_QUERY_FUNC		UINT32_C(0x83)
70649 	/* Query version response. */
70650 	#define CREQ_RESP_SB_HDR_OPCODE_QUERY_VERSION	UINT32_C(0x8b)
70651 	/* Query congestion control response. */
70652 	#define CREQ_RESP_SB_HDR_OPCODE_QUERY_ROCE_CC	UINT32_C(0x8d)
70653 	/* Query RoCE statistics response. */
70654 	#define CREQ_RESP_SB_HDR_OPCODE_QUERY_ROCE_STATS	UINT32_C(0x8e)
70655 	/* Query QP extended response. */
70656 	#define CREQ_RESP_SB_HDR_OPCODE_QUERY_QP_EXTEND	UINT32_C(0x91)
70657 	/* Query extended RoCE statistics response. */
70658 	#define CREQ_RESP_SB_HDR_OPCODE_QUERY_ROCE_STATS_EXT	UINT32_C(0x92)
70659 	/* Query extended RoCE statistics v2 response. */
70660 	#define CREQ_RESP_SB_HDR_OPCODE_QUERY_ROCE_STATS_EXT_V2 UINT32_C(0x98)
70661 	#define CREQ_RESP_SB_HDR_OPCODE_LAST		CREQ_RESP_SB_HDR_OPCODE_QUERY_ROCE_STATS_EXT_V2
70662 	/* Status of the response. */
70663 	uint8_t	status;
70664 	/* Driver supplied handle to associate the command and the response. */
70665 	uint16_t	cookie;
70666 	/* Flags and attribs of the command. */
70667 	uint16_t	flags;
70668 	/* Size of the response buffer in 16-byte units. */
70669 	uint8_t	resp_size;
70670 	uint8_t	reserved8;
70671 } creq_resp_sb_hdr_t, *pcreq_resp_sb_hdr_t;
70672 
70673 /*
70674  * Structure to be used for the qp_params array of
70675  * the `create_qp_batch` command.
70676  */
70677 /* create_qp_batch_data (size:768b/96B) */
70678 
70679 typedef struct create_qp_batch_data {
70680 	/* QP handle. */
70681 	uint64_t	qp_handle;
70682 	/* Create QP flags. */
70683 	uint32_t	qp_flags;
70684 	/*
70685 	 * SRQ is used.
70686 	 * This flag is not supported on express mode QPs.
70687 	 */
70688 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_SRQ_USED		UINT32_C(0x1)
70689 	/* post CQE for all SQ WQEs. */
70690 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_FORCE_COMPLETION	UINT32_C(0x2)
70691 	/* This QP can use reserved L_Key */
70692 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_RESERVED_LKEY_ENABLE	UINT32_C(0x4)
70693 	/* This QP can fast register physical memory */
70694 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_FR_PMR_ENABLED		UINT32_C(0x8)
70695 	/* This QP can send variable sized WQEs. */
70696 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_VARIABLE_SIZED_WQE_ENABLED UINT32_C(0x10)
70697 	/*
70698 	 * WQEs with inline data sent on this QP are able to flow
70699 	 * through an optimized transmit path to lower latency. This
70700 	 * transmit path is opportunistic and not guaranteed to always
70701 	 * occur.
70702 	 */
70703 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_OPTIMIZED_TRANSMIT_ENABLED UINT32_C(0x20)
70704 	/*
70705 	 * For UD QPs the default responder CQE format is `cq_res_ud`.
70706 	 * This flag specifies the `cq_res_ud_cfa` format to be used
70707 	 * instead.
70708 	 */
70709 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_RESPONDER_UD_CQE_WITH_CFA  UINT32_C(0x40)
70710 	/*
70711 	 * This QP must be included in the extended RoCE statistics
70712 	 * that can be queried via `query_roce_stats_ext`.
70713 	 */
70714 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_EXT_STATS_ENABLED	UINT32_C(0x80)
70715 	/* This QP uses express mode. */
70716 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_EXPRESS_MODE_ENABLED	UINT32_C(0x100)
70717 	/* This QP uses the steering tag specified in the command. */
70718 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_STEERING_TAG_VALID	UINT32_C(0x200)
70719 	/*
70720 	 * This QP can be used for RDMA Read or Atomic operations.
70721 	 * This value is used to optimize metadata memory allocation
70722 	 * when the device supports `internal_queue_memory` feature.
70723 	 */
70724 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_RDMA_READ_OR_ATOMICS_USED  UINT32_C(0x400)
70725 	/*
70726 	 * This QP must be included in the extended RoCE statistics context
70727 	 * specified in the field `ext_stats_ctx_id`
70728 	 */
70729 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_EXT_STATS_CTX_VALID	UINT32_C(0x800)
70730 	/* The schq_id field passed in by the caller is valid. */
70731 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_SCHQ_ID_VALID		UINT32_C(0x1000)
70732 	#define CREATE_QP_BATCH_DATA_QP_FLAGS_LAST			CREATE_QP_BATCH_DATA_QP_FLAGS_SCHQ_ID_VALID
70733 	/* Supported QP types. */
70734 	uint8_t	type;
70735 	/* Reliable Connection. */
70736 	#define CREATE_QP_BATCH_DATA_TYPE_RC		UINT32_C(0x2)
70737 	/* Unreliable Datagram. */
70738 	#define CREATE_QP_BATCH_DATA_TYPE_UD		UINT32_C(0x4)
70739 	/* Raw Ethertype. */
70740 	#define CREATE_QP_BATCH_DATA_TYPE_RAW_ETHERTYPE UINT32_C(0x6)
70741 	/* General Services Interface on QP1 over UD. */
70742 	#define CREATE_QP_BATCH_DATA_TYPE_GSI	UINT32_C(0x7)
70743 	#define CREATE_QP_BATCH_DATA_TYPE_LAST	CREATE_QP_BATCH_DATA_TYPE_GSI
70744 	uint8_t	sq_pg_size_sq_lvl;
70745 	/*
70746 	 * SQ PBL indirect levels.
70747 	 * This field is ignored for express mode QPs.
70748 	 */
70749 	#define CREATE_QP_BATCH_DATA_SQ_LVL_MASK	UINT32_C(0xf)
70750 	#define CREATE_QP_BATCH_DATA_SQ_LVL_SFT	0
70751 	/* PBL pointer is physical start address. */
70752 		#define CREATE_QP_BATCH_DATA_SQ_LVL_LVL_0	UINT32_C(0x0)
70753 	/* PBL pointer points to PTE table. */
70754 		#define CREATE_QP_BATCH_DATA_SQ_LVL_LVL_1	UINT32_C(0x1)
70755 	/*
70756 	 * PBL pointer points to PDE table with each entry pointing to
70757 	 * PTE tables.
70758 	 */
70759 		#define CREATE_QP_BATCH_DATA_SQ_LVL_LVL_2	UINT32_C(0x2)
70760 		#define CREATE_QP_BATCH_DATA_SQ_LVL_LAST	CREATE_QP_BATCH_DATA_SQ_LVL_LVL_2
70761 	/*
70762 	 * SQ page size.
70763 	 * This field is ignored for express mode QPs.
70764 	 */
70765 	#define CREATE_QP_BATCH_DATA_SQ_PG_SIZE_MASK  UINT32_C(0xf0)
70766 	#define CREATE_QP_BATCH_DATA_SQ_PG_SIZE_SFT   4
70767 	/* 4KB. */
70768 		#define CREATE_QP_BATCH_DATA_SQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
70769 	/* 8KB. */
70770 		#define CREATE_QP_BATCH_DATA_SQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
70771 	/* 64KB. */
70772 		#define CREATE_QP_BATCH_DATA_SQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
70773 	/* 2MB. */
70774 		#define CREATE_QP_BATCH_DATA_SQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
70775 	/* 8MB. */
70776 		#define CREATE_QP_BATCH_DATA_SQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
70777 	/* 1GB. */
70778 		#define CREATE_QP_BATCH_DATA_SQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
70779 		#define CREATE_QP_BATCH_DATA_SQ_PG_SIZE_LAST   CREATE_QP_BATCH_DATA_SQ_PG_SIZE_PG_1G
70780 	uint8_t	rq_pg_size_rq_lvl;
70781 	/*
70782 	 * RQ PBL indirect levels.
70783 	 * This field is ignored for express mode QPs.
70784 	 */
70785 	#define CREATE_QP_BATCH_DATA_RQ_LVL_MASK	UINT32_C(0xf)
70786 	#define CREATE_QP_BATCH_DATA_RQ_LVL_SFT	0
70787 	/* PBL pointer is physical start address. */
70788 		#define CREATE_QP_BATCH_DATA_RQ_LVL_LVL_0	UINT32_C(0x0)
70789 	/* PBL pointer points to PTE table. */
70790 		#define CREATE_QP_BATCH_DATA_RQ_LVL_LVL_1	UINT32_C(0x1)
70791 	/*
70792 	 * PBL pointer points to PDE table with each entry pointing to
70793 	 * PTE tables.
70794 	 */
70795 		#define CREATE_QP_BATCH_DATA_RQ_LVL_LVL_2	UINT32_C(0x2)
70796 		#define CREATE_QP_BATCH_DATA_RQ_LVL_LAST	CREATE_QP_BATCH_DATA_RQ_LVL_LVL_2
70797 	/*
70798 	 * RQ page size.
70799 	 * This field is ignored for express mode QPs.
70800 	 */
70801 	#define CREATE_QP_BATCH_DATA_RQ_PG_SIZE_MASK  UINT32_C(0xf0)
70802 	#define CREATE_QP_BATCH_DATA_RQ_PG_SIZE_SFT   4
70803 	/* 4KB. */
70804 		#define CREATE_QP_BATCH_DATA_RQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
70805 	/* 8KB. */
70806 		#define CREATE_QP_BATCH_DATA_RQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
70807 	/* 64KB. */
70808 		#define CREATE_QP_BATCH_DATA_RQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
70809 	/* 2MB. */
70810 		#define CREATE_QP_BATCH_DATA_RQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
70811 	/* 8MB. */
70812 		#define CREATE_QP_BATCH_DATA_RQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
70813 	/* 1GB. */
70814 		#define CREATE_QP_BATCH_DATA_RQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
70815 		#define CREATE_QP_BATCH_DATA_RQ_PG_SIZE_LAST   CREATE_QP_BATCH_DATA_RQ_PG_SIZE_PG_1G
70816 	uint8_t	unused_0;
70817 	/* Doorbell page index. */
70818 	uint32_t	dpi;
70819 	/*
70820 	 * When the SQ is configured to use variable-size WQE, 'sq_size'
70821 	 * denotes the SQ size with a unit of 16B. When the SQ is configured
70822 	 * to use fixed-size WQE, 'sq_size' denotes the max number of SQ WQEs.
70823 	 */
70824 	uint32_t	sq_size;
70825 	/* Max number of RQ wqes. */
70826 	uint32_t	rq_size;
70827 	uint16_t	sq_fwo_sq_sge;
70828 	/*
70829 	 * Max send SGEs per SWQE. This is only applicable to fixed-size
70830 	 * WQE support. On variable-size WQE, this is ignored.
70831 	 */
70832 	#define CREATE_QP_BATCH_DATA_SQ_SGE_MASK UINT32_C(0xf)
70833 	#define CREATE_QP_BATCH_DATA_SQ_SGE_SFT 0
70834 	/*
70835 	 * Offset of First WQE in the first SQ page, in 128 byte units.
70836 	 * This field is ignored for express mode QPs.
70837 	 */
70838 	#define CREATE_QP_BATCH_DATA_SQ_FWO_MASK UINT32_C(0xfff0)
70839 	#define CREATE_QP_BATCH_DATA_SQ_FWO_SFT 4
70840 	uint16_t	rq_fwo_rq_sge;
70841 	/*
70842 	 * Max recv SGEs per RWQE.
70843 	 * On chips with variable-size WQE support, a value of zero implies
70844 	 * 30 SGEs.
70845 	 */
70846 	#define CREATE_QP_BATCH_DATA_RQ_SGE_MASK UINT32_C(0xf)
70847 	#define CREATE_QP_BATCH_DATA_RQ_SGE_SFT 0
70848 	/*
70849 	 * Offset of First WQE in the first RQ page, in 128 byte units.
70850 	 * This field is ignored for express mode QPs.
70851 	 */
70852 	#define CREATE_QP_BATCH_DATA_RQ_FWO_MASK UINT32_C(0xfff0)
70853 	#define CREATE_QP_BATCH_DATA_RQ_FWO_SFT 4
70854 	/* Send CQ context id. */
70855 	uint32_t	scq_cid;
70856 	/* Receive CQ context id. */
70857 	uint32_t	rcq_cid;
70858 	/* SRQ context id. */
70859 	uint32_t	srq_cid;
70860 	/* Protection domain id. */
70861 	uint32_t	pd_id;
70862 	/*
70863 	 * SQ PBL physical address.
70864 	 * This field is ignored for express mode QPs.
70865 	 */
70866 	uint64_t	sq_pbl;
70867 	/*
70868 	 * RQ PBL physical address.
70869 	 * This field is ignored for express mode QPs.
70870 	 */
70871 	uint64_t	rq_pbl;
70872 	/*
70873 	 * IRRQ address. This field is ignored on devices that
70874 	 * support the `internal_queue_memory` feature.
70875 	 */
70876 	uint64_t	irrq_addr;
70877 	/*
70878 	 * ORRQ address. This field is ignored on devices that
70879 	 * support the `internal_queue_memory` feature.
70880 	 */
70881 	uint64_t	orrq_addr;
70882 	/*
70883 	 * xid to use for the non-QP1 QP.
70884 	 * The requested xid must be within the valid range
70885 	 * of the predetermined assignment scheme of the
70886 	 * pseudo static QP allocation feature. The valid range
70887 	 * for the data QPs is determined by the start_qid and
70888 	 * max_qp fields of query_func response. When the value is zero,
70889 	 * firmware will automatically choose an xid from its free pool.
70890 	 * QP1 allocation, indicated by specifying `type` field as gsi,
70891 	 * must specify a request_xid as zero.
70892 	 * This field is ignored on devices that do not support
70893 	 * the pseudo static QP allocation feature.
70894 	 */
70895 	uint32_t	request_xid;
70896 	/* Steering tag to use for memory transactions. */
70897 	uint16_t	steering_tag;
70898 	/*
70899 	 * This value is used to optimize metadata memory allocation when
70900 	 * the device supports `internal_queue_memory` feature.
70901 	 * When the SQ is configured to use variable-size WQEs, the SQ size is
70902 	 * only specified in units of 16 Bytes. This value hints the max number
70903 	 * of WQEs that would ever be present on the SQ.
70904 	 */
70905 	uint16_t	sq_max_num_wqes;
70906 	/* Extended RoCE statistics context id. */
70907 	uint32_t	ext_stats_ctx_id;
70908 	/*
70909 	 * Identifies the new scheduling queue to associate with
70910 	 * the RoCE QP. A value of zero indicates that the QP is being
70911 	 * created with the default scheduling queue. Can only be specified
70912 	 * by the PF driver. VFs get assigned a scheduling queue based on PF
70913 	 * configuration (via HWRM_FUNC_CFG). Specified scheduling queue id is
70914 	 * allocated by firmware (via HWRM_SCHQ_ALLOC) when the device supports
70915 	 * the `scheduling queue` feature.
70916 	 */
70917 	uint16_t	schq_id;
70918 	uint16_t	reserved16;
70919 } create_qp_batch_data_t, *pcreate_qp_batch_data_t;
70920 
70921 /* Periodic extended RoCE statistics context DMA to host. */
70922 /* roce_stats_ext_ctx (size:1856b/232B) */
70923 
70924 typedef struct roce_stats_ext_ctx {
70925 	/* Number of transmitted Atomic request packets without errors. */
70926 	uint64_t	tx_atomic_req_pkts;
70927 	/* Number of transmitted Read request packets without errors. */
70928 	uint64_t	tx_read_req_pkts;
70929 	/* Number of transmitted Read response packets without errors. */
70930 	uint64_t	tx_read_res_pkts;
70931 	/* Number of transmitted Write request packets without errors. */
70932 	uint64_t	tx_write_req_pkts;
70933 	/* Number of transmitted RC Send packets without errors. */
70934 	uint64_t	tx_rc_send_req_pkts;
70935 	/*
70936 	 * Number of transmitted UD Send (including QP1) packets
70937 	 * without errors.
70938 	 */
70939 	uint64_t	tx_ud_send_req_pkts;
70940 	/* Number of transmitted CNPs. Includes DCN_CNPs. */
70941 	uint64_t	tx_cnp_pkts;
70942 	/*
70943 	 * Number of transmitted RoCE packets.
70944 	 * This includes RC, UD, RawEth, and QP1 packets
70945 	 */
70946 	uint64_t	tx_roce_pkts;
70947 	/*
70948 	 * Number of transmitted RoCE header and payload bytes.
70949 	 * This includes RC, UD, RawEth, and QP1 packets.
70950 	 */
70951 	uint64_t	tx_roce_bytes;
70952 	/*
70953 	 * Number of drops that occurred to lack of buffers.
70954 	 * This count includes RC sends, RC writes with immediate,
70955 	 * UD sends, RawEth, and QP1 packets dropped due to lack of buffers.
70956 	 */
70957 	uint64_t	rx_out_of_buffer_pkts;
70958 	/* Number of packets that were received out of sequence. */
70959 	uint64_t	rx_out_of_sequence_pkts;
70960 	/*
70961 	 * Number of duplicate read/atomic requests resulting in responder
70962 	 * hardware retransmission.
70963 	 */
70964 	uint64_t	dup_req;
70965 	/*
70966 	 * Number of missing response packets resulting in hardware
70967 	 * retransmission.
70968 	 */
70969 	uint64_t	missing_resp;
70970 	/*
70971 	 * Number of sequence error NAKs received resulting in hardware
70972 	 * retransmission.
70973 	 */
70974 	uint64_t	seq_err_naks_rcvd;
70975 	/* Number of RNR NAKs received resulting in hardware retransmission. */
70976 	uint64_t	rnr_naks_rcvd;
70977 	/* Number of timeouts resulting in hardware retransmission. */
70978 	uint64_t	to_retransmits;
70979 	/* Number of received Atomic request packets without errors. */
70980 	uint64_t	rx_atomic_req_pkts;
70981 	/* Number of received Read request packets without errors. */
70982 	uint64_t	rx_read_req_pkts;
70983 	/* Number of received Read response packets without errors. */
70984 	uint64_t	rx_read_res_pkts;
70985 	/* Number of received Write request packets without errors. */
70986 	uint64_t	rx_write_req_pkts;
70987 	/* Number of received RC Send packets without errors. */
70988 	uint64_t	rx_rc_send_pkts;
70989 	/* Number of received UD Send packets without errors. */
70990 	uint64_t	rx_ud_send_pkts;
70991 	/* Number of received DCN payload cut packets. */
70992 	uint64_t	rx_dcn_payload_cut;
70993 	/* Number of received ECN-marked packets. */
70994 	uint64_t	rx_ecn_marked_pkts;
70995 	/* Number of received CNP packets. Includes DCN_CNPs. */
70996 	uint64_t	rx_cnp_pkts;
70997 	/*
70998 	 * Number of received RoCE packets including RoCE packets with errors.
70999 	 * This includes RC, UD, RawEth, and QP1 packets
71000 	 */
71001 	uint64_t	rx_roce_pkts;
71002 	/*
71003 	 * Number of received RoCE header and payload bytes including RoCE
71004 	 * packets with errors.
71005 	 * This includes RC, UD, RawEth, and QP1 packets.
71006 	 */
71007 	uint64_t	rx_roce_bytes;
71008 	/*
71009 	 * Number of received RoCE packets without errors.
71010 	 * This includes RC, UD, RawEth, and QP1 packets
71011 	 */
71012 	uint64_t	rx_roce_good_pkts;
71013 	/*
71014 	 * Number of received RoCE header and payload bytes without errors.
71015 	 * This includes RC, UD, RawEth, and QP1 packets.
71016 	 */
71017 	uint64_t	rx_roce_good_bytes;
71018 } roce_stats_ext_ctx_t, *proce_stats_ext_ctx_t;
71019 
71020 /*****************
71021  * query_version *
71022  *****************/
71023 
71024 
71025 /* cmdq_query_version (size:128b/16B) */
71026 
71027 typedef struct cmdq_query_version {
71028 	/* Command opcode. */
71029 	uint8_t	opcode;
71030 	/* Query version. */
71031 	#define CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION UINT32_C(0x8b)
71032 	#define CMDQ_QUERY_VERSION_OPCODE_LAST	CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION
71033 	/* Size of the command in 16-byte units. */
71034 	uint8_t	cmd_size;
71035 	/* Flags and attribs of the command. */
71036 	uint16_t	flags;
71037 	/* Driver supplied handle to associate the command and the response. */
71038 	uint16_t	cookie;
71039 	/* Size of the response buffer in 16-byte units. */
71040 	uint8_t	resp_size;
71041 	uint8_t	reserved8;
71042 	/* Host address of the response. */
71043 	uint64_t	resp_addr;
71044 } cmdq_query_version_t, *pcmdq_query_version_t;
71045 
71046 /* creq_query_version_resp (size:128b/16B) */
71047 
71048 typedef struct creq_query_version_resp {
71049 	uint8_t	type;
71050 	/*
71051 	 * This field indicates the exact type of the completion.
71052 	 * By convention, the LSB identifies the length of the
71053 	 * record in 16B units. Even values indicate 16B
71054 	 * records. Odd values indicate 32B
71055 	 * records.
71056 	 */
71057 	#define CREQ_QUERY_VERSION_RESP_TYPE_MASK	UINT32_C(0x3f)
71058 	#define CREQ_QUERY_VERSION_RESP_TYPE_SFT	0
71059 	/* QP Async Notification */
71060 		#define CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
71061 		#define CREQ_QUERY_VERSION_RESP_TYPE_LAST	CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT
71062 	/* Status of the response. */
71063 	uint8_t	status;
71064 	/* Driver supplied handle to associate the command and the response. */
71065 	uint16_t	cookie;
71066 	/* firmware major version */
71067 	uint8_t	fw_maj;
71068 	/* firmware minor version */
71069 	uint8_t	fw_minor;
71070 	/* firmware build version */
71071 	uint8_t	fw_bld;
71072 	/* firmware reserved version */
71073 	uint8_t	fw_rsvd;
71074 	uint8_t	v;
71075 	/*
71076 	 * This value is written by the NIC such that it will be different
71077 	 * for each pass through the completion queue. The even passes
71078 	 * will write 1. The odd passes will write 0.
71079 	 */
71080 	#define CREQ_QUERY_VERSION_RESP_V	UINT32_C(0x1)
71081 	/* Event or command opcode. */
71082 	uint8_t	event;
71083 	/* Query firmware and interface version response. */
71084 	#define CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION UINT32_C(0x8b)
71085 	#define CREQ_QUERY_VERSION_RESP_EVENT_LAST	CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION
71086 	uint16_t	reserved16;
71087 	/* interface major version */
71088 	uint8_t	intf_maj;
71089 	/* interface minor version */
71090 	uint8_t	intf_minor;
71091 	/* interface build version */
71092 	uint8_t	intf_bld;
71093 	/* interface reserved version */
71094 	uint8_t	intf_rsvd;
71095 } creq_query_version_resp_t, *pcreq_query_version_resp_t;
71096 
71097 /*****************
71098  * initialize_fw *
71099  *****************/
71100 
71101 
71102 /* cmdq_initialize_fw (size:1024b/128B) */
71103 
71104 typedef struct cmdq_initialize_fw {
71105 	/* Command opcode. */
71106 	uint8_t	opcode;
71107 	/*
71108 	 * Initialize firmware command initializes the firmware with
71109 	 * the specified parameters.
71110 	 */
71111 	#define CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW UINT32_C(0x80)
71112 	#define CMDQ_INITIALIZE_FW_OPCODE_LAST	CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW
71113 	/* Size of the command in 16-byte units. */
71114 	uint8_t	cmd_size;
71115 	/* Flags and attribs of the command. */
71116 	uint16_t	flags;
71117 	/*
71118 	 * When set, the 32b `max_mrw_per_vf` field is logically divided
71119 	 * into two 16b fields, `max_mr_per_vf` and `max_av_per_vf`.
71120 	 */
71121 	#define CMDQ_INITIALIZE_FW_FLAGS_MRAV_RESERVATION_SPLIT	UINT32_C(0x1)
71122 	/*
71123 	 * When set, the hardware based requester retransmission
71124 	 * feature is supported.
71125 	 */
71126 	#define CMDQ_INITIALIZE_FW_FLAGS_HW_REQUESTER_RETX_SUPPORTED	UINT32_C(0x2)
71127 	/* When set, the driver version is provided. */
71128 	#define CMDQ_INITIALIZE_FW_FLAGS_DRV_VERSION			UINT32_C(0x4)
71129 	/* When set, driver supports optimizing Modify QP operation. */
71130 	#define CMDQ_INITIALIZE_FW_FLAGS_OPTIMIZE_MODIFY_QP_SUPPORTED	UINT32_C(0x8)
71131 	/*
71132 	 * When set, the VF RoCE resources will be managed by the L2
71133 	 * driver via func_cfg.
71134 	 */
71135 	#define CMDQ_INITIALIZE_FW_FLAGS_L2_VF_RESOURCE_MGMT		UINT32_C(0x10)
71136 	/* Driver supplied handle to associate the command and the response. */
71137 	uint16_t	cookie;
71138 	/* Size of the response buffer in 16-byte units. */
71139 	uint8_t	resp_size;
71140 	uint8_t	reserved8;
71141 	/* Host address of the response. */
71142 	uint64_t	resp_addr;
71143 	uint8_t	qpc_pg_size_qpc_lvl;
71144 	/* QPC PBL indirect levels. */
71145 	#define CMDQ_INITIALIZE_FW_QPC_LVL_MASK	UINT32_C(0xf)
71146 	#define CMDQ_INITIALIZE_FW_QPC_LVL_SFT	0
71147 	/* PBL pointer is physical start address. */
71148 		#define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_0	UINT32_C(0x0)
71149 	/* PBL pointer points to PTE table. */
71150 		#define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_1	UINT32_C(0x1)
71151 	/*
71152 	 * PBL pointer points to PDE table with each entry pointing to
71153 	 * PTE tables.
71154 	 */
71155 		#define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2	UINT32_C(0x2)
71156 		#define CMDQ_INITIALIZE_FW_QPC_LVL_LAST	CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2
71157 	/* QPC page size. */
71158 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_MASK  UINT32_C(0xf0)
71159 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_SFT   4
71160 	/* 4KB. */
71161 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
71162 	/* 8KB. */
71163 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
71164 	/* 64KB. */
71165 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
71166 	/* 2MB. */
71167 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
71168 	/* 8MB. */
71169 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
71170 	/* 1GB. */
71171 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
71172 		#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G
71173 	uint8_t	mrw_pg_size_mrw_lvl;
71174 	/* MRW PBL indirect levels. */
71175 	#define CMDQ_INITIALIZE_FW_MRW_LVL_MASK	UINT32_C(0xf)
71176 	#define CMDQ_INITIALIZE_FW_MRW_LVL_SFT	0
71177 	/* PBL pointer is physical start address. */
71178 		#define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_0	UINT32_C(0x0)
71179 	/* PBL pointer points to PTE table. */
71180 		#define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_1	UINT32_C(0x1)
71181 	/*
71182 	 * PBL pointer points to PDE table with each entry pointing to PTE
71183 	 * tables.
71184 	 */
71185 		#define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2	UINT32_C(0x2)
71186 		#define CMDQ_INITIALIZE_FW_MRW_LVL_LAST	CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2
71187 	/* MRW page size. */
71188 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_MASK  UINT32_C(0xf0)
71189 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_SFT   4
71190 	/* 4KB. */
71191 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
71192 	/* 8KB. */
71193 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
71194 	/* 64KB. */
71195 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
71196 	/* 2MB. */
71197 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
71198 	/* 8MB. */
71199 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
71200 	/* 1GB. */
71201 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
71202 		#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G
71203 	uint8_t	srq_pg_size_srq_lvl;
71204 	/* SRQ PBL indirect levels. */
71205 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_MASK	UINT32_C(0xf)
71206 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_SFT	0
71207 	/* PBL pointer is physical start address. */
71208 		#define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_0	UINT32_C(0x0)
71209 	/* PBL pointer points to PTE table. */
71210 		#define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_1	UINT32_C(0x1)
71211 	/*
71212 	 * PBL pointer points to PDE table with each entry pointing to PTE
71213 	 * tables.
71214 	 */
71215 		#define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2	UINT32_C(0x2)
71216 		#define CMDQ_INITIALIZE_FW_SRQ_LVL_LAST	CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2
71217 	/* SRQ page size. */
71218 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_MASK  UINT32_C(0xf0)
71219 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_SFT   4
71220 	/* 4KB. */
71221 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
71222 	/* 8KB. */
71223 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
71224 	/* 64KB. */
71225 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
71226 	/* 2MB. */
71227 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
71228 	/* 8MB. */
71229 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
71230 	/* 1GB. */
71231 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
71232 		#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G
71233 	uint8_t	cq_pg_size_cq_lvl;
71234 	/* CQ PBL indirect levels. */
71235 	#define CMDQ_INITIALIZE_FW_CQ_LVL_MASK	UINT32_C(0xf)
71236 	#define CMDQ_INITIALIZE_FW_CQ_LVL_SFT	0
71237 	/* PBL pointer is physical start address. */
71238 		#define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_0	UINT32_C(0x0)
71239 	/* PBL pointer points to PTE table. */
71240 		#define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_1	UINT32_C(0x1)
71241 	/*
71242 	 * PBL pointer points to PDE table with each entry pointing to PTE
71243 	 * tables.
71244 	 */
71245 		#define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2	UINT32_C(0x2)
71246 		#define CMDQ_INITIALIZE_FW_CQ_LVL_LAST	CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2
71247 	/* CQ page size. */
71248 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_MASK  UINT32_C(0xf0)
71249 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_SFT   4
71250 	/* 4KB. */
71251 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
71252 	/* 8KB. */
71253 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
71254 	/* 64KB. */
71255 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
71256 	/* 2MB. */
71257 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
71258 	/* 8MB. */
71259 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
71260 	/* 1GB. */
71261 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
71262 		#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G
71263 	uint8_t	tqm_pg_size_tqm_lvl;
71264 	/* TQM PBL indirect levels. */
71265 	#define CMDQ_INITIALIZE_FW_TQM_LVL_MASK	UINT32_C(0xf)
71266 	#define CMDQ_INITIALIZE_FW_TQM_LVL_SFT	0
71267 	/* PBL pointer is physical start address. */
71268 		#define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_0	UINT32_C(0x0)
71269 	/* PBL pointer points to PTE table. */
71270 		#define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_1	UINT32_C(0x1)
71271 	/*
71272 	 * PBL pointer points to PDE table with each entry pointing to PTE
71273 	 * tables.
71274 	 */
71275 		#define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2	UINT32_C(0x2)
71276 		#define CMDQ_INITIALIZE_FW_TQM_LVL_LAST	CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2
71277 	/* TQM page size. */
71278 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_MASK  UINT32_C(0xf0)
71279 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_SFT   4
71280 	/* 4KB. */
71281 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
71282 	/* 8KB. */
71283 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
71284 	/* 64KB. */
71285 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
71286 	/* 2MB. */
71287 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
71288 	/* 8MB. */
71289 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
71290 	/* 1GB. */
71291 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
71292 		#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G
71293 	uint8_t	tim_pg_size_tim_lvl;
71294 	/* TIM PBL indirect levels. */
71295 	#define CMDQ_INITIALIZE_FW_TIM_LVL_MASK	UINT32_C(0xf)
71296 	#define CMDQ_INITIALIZE_FW_TIM_LVL_SFT	0
71297 	/* PBL pointer is physical start address. */
71298 		#define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_0	UINT32_C(0x0)
71299 	/* PBL pointer points to PTE table. */
71300 		#define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_1	UINT32_C(0x1)
71301 	/*
71302 	 * PBL pointer points to PDE table with each entry pointing to PTE
71303 	 * tables.
71304 	 */
71305 		#define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2	UINT32_C(0x2)
71306 		#define CMDQ_INITIALIZE_FW_TIM_LVL_LAST	CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2
71307 	/* TIM page size. */
71308 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_MASK  UINT32_C(0xf0)
71309 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_SFT   4
71310 	/* 4KB. */
71311 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
71312 	/* 8KB. */
71313 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
71314 	/* 64KB. */
71315 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
71316 	/* 2MB. */
71317 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
71318 	/* 8MB. */
71319 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
71320 	/* 1GB. */
71321 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
71322 		#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G
71323 	uint16_t	log2_dbr_pg_size;
71324 	/*
71325 	 * Log base 2 of DBR page size - 12. 0 for 4KB. HW supported values
71326 	 * are enumerated below.
71327 	 */
71328 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_MASK   UINT32_C(0xf)
71329 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_SFT	0
71330 	/* 4KB. */
71331 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4K	UINT32_C(0x0)
71332 	/* 8KB. */
71333 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8K	UINT32_C(0x1)
71334 	/* 16KB. */
71335 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16K   UINT32_C(0x2)
71336 	/* 32KB. */
71337 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32K   UINT32_C(0x3)
71338 	/* 64KB. */
71339 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64K   UINT32_C(0x4)
71340 	/* 128KB. */
71341 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128K  UINT32_C(0x5)
71342 	/* 256KB. */
71343 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_256K  UINT32_C(0x6)
71344 	/* 512KB. */
71345 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_512K  UINT32_C(0x7)
71346 	/* 1MB. */
71347 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_1M	UINT32_C(0x8)
71348 	/* 2MB. */
71349 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_2M	UINT32_C(0x9)
71350 	/* 4MB. */
71351 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4M	UINT32_C(0xa)
71352 	/* 8MB. */
71353 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8M	UINT32_C(0xb)
71354 	/* 16MB. */
71355 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16M   UINT32_C(0xc)
71356 	/* 32MB. */
71357 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32M   UINT32_C(0xd)
71358 	/* 64MB. */
71359 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64M   UINT32_C(0xe)
71360 	/* 128MB. */
71361 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M  UINT32_C(0xf)
71362 		#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_LAST	CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M
71363 	/* rsvd is 12 b */
71364 	#define CMDQ_INITIALIZE_FW_RSVD_MASK		UINT32_C(0xfff0)
71365 	#define CMDQ_INITIALIZE_FW_RSVD_SFT		4
71366 	/* Kernel notification queue page directory. */
71367 	uint64_t	qpc_page_dir;
71368 	/* MRW page directory. */
71369 	uint64_t	mrw_page_dir;
71370 	/* SRQ page directory. */
71371 	uint64_t	srq_page_dir;
71372 	/* CQ page directory. */
71373 	uint64_t	cq_page_dir;
71374 	/* TQM page directory. */
71375 	uint64_t	tqm_page_dir;
71376 	/* TIM page directory. */
71377 	uint64_t	tim_page_dir;
71378 	/*
71379 	 * Number of QPs. This field is ignored when the backing store HWRM's
71380 	 * are used.
71381 	 */
71382 	uint32_t	number_of_qp;
71383 	/*
71384 	 * Number of MRWs. This field is ignored when the backing store HWRM's
71385 	 * are used.
71386 	 */
71387 	uint32_t	number_of_mrw;
71388 	/*
71389 	 * Number of SRQs. This field is ignored when the backing store HWRM's
71390 	 * are used.
71391 	 */
71392 	uint32_t	number_of_srq;
71393 	/*
71394 	 * Number of CQs. This field is ignored when the backing store HWRM's
71395 	 * are used.
71396 	 */
71397 	uint32_t	number_of_cq;
71398 	/*
71399 	 * Number of QPs per VF. This field must be set to zero when the flag,
71400 	 * l2_vf_resource_mgmt, is set and RoCE SRIOV is enabled.
71401 	 */
71402 	uint32_t	max_qp_per_vf;
71403 	/*
71404 	 * If the MR/AV split reservation flag is not set, then this field
71405 	 * represents the total number of MR plus AV entries allowed per
71406 	 * VF. For versions of firmware that support the split reservation,
71407 	 * when it is not specified half of the entries will be reserved
71408 	 * for MRs and the other half for AVs.
71409 	 *
71410 	 * If the MR/AV split reservation flag is set, then this
71411 	 * field is logically divided into two 16b fields. Bits `[31:16]`
71412 	 * represents the `max_mr_per_vf` and bits `[15:0]` represents
71413 	 * `max_av_per_vf`. The granularity of these values is defined by
71414 	 * the `mrav_num_entries_unit` field returned by the
71415 	 * `backing_store_qcaps` command.
71416 	 *
71417 	 * This field must be set to zero when the flag, l2_vf_resource_mgmt,
71418 	 * is set and RoCE SRIOV is enabled.
71419 	 */
71420 	uint32_t	max_mrw_per_vf;
71421 	/*
71422 	 * Number of SRQs per VF. This field must be set to zero when the flag,
71423 	 * l2_vf_resource_mgmt, is set and RoCE SRIOV is enabled.
71424 	 */
71425 	uint32_t	max_srq_per_vf;
71426 	/*
71427 	 * Number of CQs per VF. This field must be set to zero when the flag,
71428 	 * l2_vf_resource_mgmt, is set and RoCE SRIOV is enabled.
71429 	 */
71430 	uint32_t	max_cq_per_vf;
71431 	/*
71432 	 * Number of GIDs per VF. This field must be set to zero when the flag,
71433 	 * l2_vf_resource_mgmt, is set and RoCE SRIOV is enabled.
71434 	 */
71435 	uint32_t	max_gid_per_vf;
71436 	/* Statistics context index for this function. */
71437 	uint32_t	stat_ctx_id;
71438 	/* The driver HSI major version number. */
71439 	uint8_t	drv_hsi_ver_maj;
71440 	/* The driver HSI minor version number. */
71441 	uint8_t	drv_hsi_ver_min;
71442 	/* The driver HSI update version number. */
71443 	uint8_t	drv_hsi_ver_upd;
71444 	/* This is the 40bit unused. */
71445 	uint8_t	unused40[5];
71446 	/* The driver build major version number. */
71447 	uint16_t	drv_build_ver_maj;
71448 	/* The driver build minor version number. */
71449 	uint16_t	drv_build_ver_min;
71450 	/* The driver build update version number. */
71451 	uint16_t	drv_build_ver_upd;
71452 	/* The driver build patch version number. */
71453 	uint16_t	drv_build_ver_patch;
71454 } cmdq_initialize_fw_t, *pcmdq_initialize_fw_t;
71455 
71456 /* creq_initialize_fw_resp (size:128b/16B) */
71457 
71458 typedef struct creq_initialize_fw_resp {
71459 	uint8_t	type;
71460 	/*
71461 	 * This field indicates the exact type of the completion.
71462 	 * By convention, the LSB identifies the length of the
71463 	 * record in 16B units. Even values indicate 16B
71464 	 * records. Odd values indicate 32B
71465 	 * records.
71466 	 */
71467 	#define CREQ_INITIALIZE_FW_RESP_TYPE_MASK	UINT32_C(0x3f)
71468 	#define CREQ_INITIALIZE_FW_RESP_TYPE_SFT	0
71469 	/* QP Async Notification */
71470 		#define CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
71471 		#define CREQ_INITIALIZE_FW_RESP_TYPE_LAST	CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT
71472 	/* Status of the response. */
71473 	uint8_t	status;
71474 	/* Driver supplied handle to associate the command and the response. */
71475 	uint16_t	cookie;
71476 	uint32_t	reserved32;
71477 	uint8_t	v;
71478 	/*
71479 	 * This value is written by the NIC such that it will be different
71480 	 * for each pass through the completion queue. The even passes
71481 	 * will write 1. The odd passes will write 0.
71482 	 */
71483 	#define CREQ_INITIALIZE_FW_RESP_V	UINT32_C(0x1)
71484 	/* Event or command opcode. */
71485 	uint8_t	event;
71486 	/* Initialize firmware command response. */
71487 	#define CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW UINT32_C(0x80)
71488 	#define CREQ_INITIALIZE_FW_RESP_EVENT_LAST	CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW
71489 	uint8_t	reserved48[6];
71490 } creq_initialize_fw_resp_t, *pcreq_initialize_fw_resp_t;
71491 
71492 /*******************
71493  * deinitialize_fw *
71494  *******************/
71495 
71496 
71497 /* cmdq_deinitialize_fw (size:128b/16B) */
71498 
71499 typedef struct cmdq_deinitialize_fw {
71500 	/* Command opcode. */
71501 	uint8_t	opcode;
71502 	/* De-initialize firmware command deinitializes the firmware. */
71503 	#define CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW UINT32_C(0x81)
71504 	#define CMDQ_DEINITIALIZE_FW_OPCODE_LAST	CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW
71505 	/* Size of the command in 16-byte units. */
71506 	uint8_t	cmd_size;
71507 	/* Flags and attribs of the command. */
71508 	uint16_t	flags;
71509 	/* Driver supplied handle to associate the command and the response. */
71510 	uint16_t	cookie;
71511 	/* Size of the response buffer in 16-byte units. */
71512 	uint8_t	resp_size;
71513 	uint8_t	reserved8;
71514 	/* Host address of the response. */
71515 	uint64_t	resp_addr;
71516 } cmdq_deinitialize_fw_t, *pcmdq_deinitialize_fw_t;
71517 
71518 /* creq_deinitialize_fw_resp (size:128b/16B) */
71519 
71520 typedef struct creq_deinitialize_fw_resp {
71521 	uint8_t	type;
71522 	/*
71523 	 * This field indicates the exact type of the completion.
71524 	 * By convention, the LSB identifies the length of the
71525 	 * record in 16B units. Even values indicate 16B
71526 	 * records. Odd values indicate 32B
71527 	 * records.
71528 	 */
71529 	#define CREQ_DEINITIALIZE_FW_RESP_TYPE_MASK	UINT32_C(0x3f)
71530 	#define CREQ_DEINITIALIZE_FW_RESP_TYPE_SFT	0
71531 	/* QP Async Notification */
71532 		#define CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
71533 		#define CREQ_DEINITIALIZE_FW_RESP_TYPE_LAST	CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT
71534 	/* Status of the response. */
71535 	uint8_t	status;
71536 	/* Driver supplied handle to associate the command and the response. */
71537 	uint16_t	cookie;
71538 	uint32_t	reserved32;
71539 	uint8_t	v;
71540 	/*
71541 	 * This value is written by the NIC such that it will be different
71542 	 * for each pass through the completion queue. The even passes
71543 	 * will write 1. The odd passes will write 0.
71544 	 */
71545 	#define CREQ_DEINITIALIZE_FW_RESP_V	UINT32_C(0x1)
71546 	/* Event or command opcode. */
71547 	uint8_t	event;
71548 	/* De-initialize firmware command response. */
71549 	#define CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW UINT32_C(0x81)
71550 	#define CREQ_DEINITIALIZE_FW_RESP_EVENT_LAST	CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW
71551 	uint8_t	reserved48[6];
71552 } creq_deinitialize_fw_resp_t, *pcreq_deinitialize_fw_resp_t;
71553 
71554 /*************
71555  * create_qp *
71556  *************/
71557 
71558 
71559 /* cmdq_create_qp (size:896b/112B) */
71560 
71561 typedef struct cmdq_create_qp {
71562 	/* Command opcode. */
71563 	uint8_t	opcode;
71564 	/*
71565 	 * Create QP command allocates QP context with the specified
71566 	 * SQ, RQ/SRQ, CQ and other parameters.
71567 	 */
71568 	#define CMDQ_CREATE_QP_OPCODE_CREATE_QP UINT32_C(0x1)
71569 	#define CMDQ_CREATE_QP_OPCODE_LAST	CMDQ_CREATE_QP_OPCODE_CREATE_QP
71570 	/* Size of the command in 16-byte units. */
71571 	uint8_t	cmd_size;
71572 	/* Flags and attribs of the command. */
71573 	uint16_t	flags;
71574 	/* Driver supplied handle to associate the command and the response. */
71575 	uint16_t	cookie;
71576 	/* Size of the response buffer in 16-byte units. */
71577 	uint8_t	resp_size;
71578 	uint8_t	reserved8;
71579 	/* Host address of the response. */
71580 	uint64_t	resp_addr;
71581 	/* QP handle. */
71582 	uint64_t	qp_handle;
71583 	/* Create QP flags. */
71584 	uint32_t	qp_flags;
71585 	/*
71586 	 * SRQ is used.
71587 	 * This flag is not supported on express mode QPs.
71588 	 */
71589 	#define CMDQ_CREATE_QP_QP_FLAGS_SRQ_USED		UINT32_C(0x1)
71590 	/* post CQE for all SQ WQEs. */
71591 	#define CMDQ_CREATE_QP_QP_FLAGS_FORCE_COMPLETION	UINT32_C(0x2)
71592 	/* This QP can use reserved L_Key */
71593 	#define CMDQ_CREATE_QP_QP_FLAGS_RESERVED_LKEY_ENABLE	UINT32_C(0x4)
71594 	/* This QP can fast register physical memory */
71595 	#define CMDQ_CREATE_QP_QP_FLAGS_FR_PMR_ENABLED		UINT32_C(0x8)
71596 	/* This QP can send variable sized WQEs. */
71597 	#define CMDQ_CREATE_QP_QP_FLAGS_VARIABLE_SIZED_WQE_ENABLED UINT32_C(0x10)
71598 	/*
71599 	 * WQEs with inline data sent on this QP are able to flow
71600 	 * through an optimized transmit path to lower latency. This
71601 	 * transmit path is opportunistic and not guaranteed to always
71602 	 * occur.
71603 	 */
71604 	#define CMDQ_CREATE_QP_QP_FLAGS_OPTIMIZED_TRANSMIT_ENABLED UINT32_C(0x20)
71605 	/*
71606 	 * For UD QPs the default responder CQE format is `cq_res_ud`.
71607 	 * This flag specifies the `cq_res_ud_cfa` format to be used
71608 	 * instead.
71609 	 */
71610 	#define CMDQ_CREATE_QP_QP_FLAGS_RESPONDER_UD_CQE_WITH_CFA  UINT32_C(0x40)
71611 	/*
71612 	 * This QP must be included in the extended RoCE statistics
71613 	 * that can be queried via `query_roce_stats_ext`.
71614 	 */
71615 	#define CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_ENABLED	UINT32_C(0x80)
71616 	/* This QP uses express mode. */
71617 	#define CMDQ_CREATE_QP_QP_FLAGS_EXPRESS_MODE_ENABLED	UINT32_C(0x100)
71618 	/* This QP uses the steering tag specified in the command. */
71619 	#define CMDQ_CREATE_QP_QP_FLAGS_STEERING_TAG_VALID	UINT32_C(0x200)
71620 	/*
71621 	 * This QP can be used for RDMA Read or Atomic operations.
71622 	 * This value is used to optimize metadata memory allocation
71623 	 * when the device supports `internal_queue_memory` feature.
71624 	 */
71625 	#define CMDQ_CREATE_QP_QP_FLAGS_RDMA_READ_OR_ATOMICS_USED  UINT32_C(0x400)
71626 	/*
71627 	 * This QP must be included in the extended RoCE statistics context
71628 	 * specified in the field `ext_stats_ctx_id`
71629 	 */
71630 	#define CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_CTX_VALID	UINT32_C(0x800)
71631 	/* The schq_id field passed in by the caller is valid. */
71632 	#define CMDQ_CREATE_QP_QP_FLAGS_SCHQ_ID_VALID		UINT32_C(0x1000)
71633 	#define CMDQ_CREATE_QP_QP_FLAGS_LAST			CMDQ_CREATE_QP_QP_FLAGS_SCHQ_ID_VALID
71634 	/* Supported QP types. */
71635 	uint8_t	type;
71636 	/* Reliable Connection. */
71637 	#define CMDQ_CREATE_QP_TYPE_RC		UINT32_C(0x2)
71638 	/* Unreliable Datagram. */
71639 	#define CMDQ_CREATE_QP_TYPE_UD		UINT32_C(0x4)
71640 	/* Raw Ethertype. */
71641 	#define CMDQ_CREATE_QP_TYPE_RAW_ETHERTYPE UINT32_C(0x6)
71642 	/* General Services Interface on QP1 over UD. */
71643 	#define CMDQ_CREATE_QP_TYPE_GSI	UINT32_C(0x7)
71644 	#define CMDQ_CREATE_QP_TYPE_LAST	CMDQ_CREATE_QP_TYPE_GSI
71645 	uint8_t	sq_pg_size_sq_lvl;
71646 	/*
71647 	 * SQ PBL indirect levels.
71648 	 * This field is ignored for express mode QPs.
71649 	 */
71650 	#define CMDQ_CREATE_QP_SQ_LVL_MASK	UINT32_C(0xf)
71651 	#define CMDQ_CREATE_QP_SQ_LVL_SFT	0
71652 	/* PBL pointer is physical start address. */
71653 		#define CMDQ_CREATE_QP_SQ_LVL_LVL_0	UINT32_C(0x0)
71654 	/* PBL pointer points to PTE table. */
71655 		#define CMDQ_CREATE_QP_SQ_LVL_LVL_1	UINT32_C(0x1)
71656 	/*
71657 	 * PBL pointer points to PDE table with each entry pointing to
71658 	 * PTE tables.
71659 	 */
71660 		#define CMDQ_CREATE_QP_SQ_LVL_LVL_2	UINT32_C(0x2)
71661 		#define CMDQ_CREATE_QP_SQ_LVL_LAST	CMDQ_CREATE_QP_SQ_LVL_LVL_2
71662 	/*
71663 	 * SQ page size.
71664 	 * This field is ignored for express mode QPs.
71665 	 */
71666 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_MASK  UINT32_C(0xf0)
71667 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_SFT   4
71668 	/* 4KB. */
71669 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
71670 	/* 8KB. */
71671 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
71672 	/* 64KB. */
71673 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
71674 	/* 2MB. */
71675 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
71676 	/* 8MB. */
71677 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
71678 	/* 1GB. */
71679 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
71680 		#define CMDQ_CREATE_QP_SQ_PG_SIZE_LAST   CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G
71681 	uint8_t	rq_pg_size_rq_lvl;
71682 	/*
71683 	 * RQ PBL indirect levels.
71684 	 * This field is ignored for express mode QPs.
71685 	 */
71686 	#define CMDQ_CREATE_QP_RQ_LVL_MASK	UINT32_C(0xf)
71687 	#define CMDQ_CREATE_QP_RQ_LVL_SFT	0
71688 	/* PBL pointer is physical start address. */
71689 		#define CMDQ_CREATE_QP_RQ_LVL_LVL_0	UINT32_C(0x0)
71690 	/* PBL pointer points to PTE table. */
71691 		#define CMDQ_CREATE_QP_RQ_LVL_LVL_1	UINT32_C(0x1)
71692 	/*
71693 	 * PBL pointer points to PDE table with each entry pointing to
71694 	 * PTE tables.
71695 	 */
71696 		#define CMDQ_CREATE_QP_RQ_LVL_LVL_2	UINT32_C(0x2)
71697 		#define CMDQ_CREATE_QP_RQ_LVL_LAST	CMDQ_CREATE_QP_RQ_LVL_LVL_2
71698 	/*
71699 	 * RQ page size.
71700 	 * This field is ignored for express mode QPs.
71701 	 */
71702 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_MASK  UINT32_C(0xf0)
71703 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_SFT   4
71704 	/* 4KB. */
71705 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
71706 	/* 8KB. */
71707 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
71708 	/* 64KB. */
71709 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
71710 	/* 2MB. */
71711 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
71712 	/* 8MB. */
71713 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
71714 	/* 1GB. */
71715 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
71716 		#define CMDQ_CREATE_QP_RQ_PG_SIZE_LAST   CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G
71717 	uint8_t	unused_0;
71718 	/* Doorbell page index. */
71719 	uint32_t	dpi;
71720 	/*
71721 	 * When the SQ is configured to use variable-size WQE, 'sq_size'
71722 	 * denotes the SQ size with a unit of 16B. When the SQ is configured
71723 	 * to use fixed-size WQE, 'sq_size' denotes the max number of SQ WQEs.
71724 	 */
71725 	uint32_t	sq_size;
71726 	/* Max number of RQ wqes. */
71727 	uint32_t	rq_size;
71728 	uint16_t	sq_fwo_sq_sge;
71729 	/*
71730 	 * Max send SGEs per SWQE. This is only applicable to fixed-size
71731 	 * WQE support. On variable-size WQE, this is ignored.
71732 	 */
71733 	#define CMDQ_CREATE_QP_SQ_SGE_MASK UINT32_C(0xf)
71734 	#define CMDQ_CREATE_QP_SQ_SGE_SFT 0
71735 	/*
71736 	 * Offset of First WQE in the first SQ page, in 128 byte units.
71737 	 * This field is ignored for express mode QPs.
71738 	 */
71739 	#define CMDQ_CREATE_QP_SQ_FWO_MASK UINT32_C(0xfff0)
71740 	#define CMDQ_CREATE_QP_SQ_FWO_SFT 4
71741 	uint16_t	rq_fwo_rq_sge;
71742 	/*
71743 	 * Max recv SGEs per RWQE.
71744 	 * On chips with variable-size WQE support, a value of zero implies
71745 	 * 30 SGEs.
71746 	 */
71747 	#define CMDQ_CREATE_QP_RQ_SGE_MASK UINT32_C(0xf)
71748 	#define CMDQ_CREATE_QP_RQ_SGE_SFT 0
71749 	/*
71750 	 * Offset of First WQE in the first RQ page, in 128 byte units.
71751 	 * This field is ignored for express mode QPs.
71752 	 */
71753 	#define CMDQ_CREATE_QP_RQ_FWO_MASK UINT32_C(0xfff0)
71754 	#define CMDQ_CREATE_QP_RQ_FWO_SFT 4
71755 	/* Send CQ context id. */
71756 	uint32_t	scq_cid;
71757 	/* Receive CQ context id. */
71758 	uint32_t	rcq_cid;
71759 	/* SRQ context id. */
71760 	uint32_t	srq_cid;
71761 	/* Protection domain id. */
71762 	uint32_t	pd_id;
71763 	/*
71764 	 * SQ PBL physical address.
71765 	 * This field is ignored for express mode QPs.
71766 	 */
71767 	uint64_t	sq_pbl;
71768 	/*
71769 	 * RQ PBL physical address.
71770 	 * This field is ignored for express mode QPs.
71771 	 */
71772 	uint64_t	rq_pbl;
71773 	/*
71774 	 * IRRQ address. This field is ignored on devices that
71775 	 * support the `internal_queue_memory` feature.
71776 	 */
71777 	uint64_t	irrq_addr;
71778 	/*
71779 	 * ORRQ address. This field is ignored on devices that
71780 	 * support the `internal_queue_memory` feature.
71781 	 */
71782 	uint64_t	orrq_addr;
71783 	/*
71784 	 * xid to use for the non-QP1 QP.
71785 	 * The requested xid must be within the valid range
71786 	 * of the predetermined assignment scheme of the
71787 	 * pseudo static QP allocation feature. The valid range
71788 	 * for the data QPs is determined by the start_qid and
71789 	 * max_qp fields of query_func response. When the value is zero,
71790 	 * firmware will automatically choose an xid from its free pool.
71791 	 * QP1 allocation, indicated by specifying `type` field as gsi,
71792 	 * must specify a request_xid as zero.
71793 	 * This field is ignored on devices that do not support
71794 	 * the pseudo static QP allocation feature.
71795 	 */
71796 	uint32_t	request_xid;
71797 	/* Steering tag to use for memory transactions. */
71798 	uint16_t	steering_tag;
71799 	/*
71800 	 * This value is used to optimize metadata memory allocation when
71801 	 * the device supports `internal_queue_memory` feature.
71802 	 * When the SQ is configured to use variable-size WQEs, the SQ size is
71803 	 * only specified in units of 16 Bytes. This value hints the max number
71804 	 * of WQEs that would ever be present on the SQ.
71805 	 */
71806 	uint16_t	sq_max_num_wqes;
71807 	/* Extended RoCE statistics context id. */
71808 	uint32_t	ext_stats_ctx_id;
71809 	/*
71810 	 * Identifies the new scheduling queue to associate with
71811 	 * the RoCE QP. A value of zero indicates that the QP is being
71812 	 * created with the default scheduling queue. Can only be specified
71813 	 * by the PF driver. VFs get assigned a scheduling queue based on PF
71814 	 * configuration (via HWRM_FUNC_CFG). Specified scheduling queue id is
71815 	 * allocated by firmware (via HWRM_SCHQ_ALLOC) when the device supports
71816 	 * the `scheduling queue` feature.
71817 	 */
71818 	uint16_t	schq_id;
71819 	uint16_t	reserved16;
71820 } cmdq_create_qp_t, *pcmdq_create_qp_t;
71821 
71822 /* creq_create_qp_resp (size:128b/16B) */
71823 
71824 typedef struct creq_create_qp_resp {
71825 	uint8_t	type;
71826 	/*
71827 	 * This field indicates the exact type of the completion.
71828 	 * By convention, the LSB identifies the length of the
71829 	 * record in 16B units. Even values indicate 16B
71830 	 * records. Odd values indicate 32B
71831 	 * records.
71832 	 */
71833 	#define CREQ_CREATE_QP_RESP_TYPE_MASK	UINT32_C(0x3f)
71834 	#define CREQ_CREATE_QP_RESP_TYPE_SFT	0
71835 	/* QP Async Notification */
71836 		#define CREQ_CREATE_QP_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
71837 		#define CREQ_CREATE_QP_RESP_TYPE_LAST	CREQ_CREATE_QP_RESP_TYPE_QP_EVENT
71838 	/* Status of the response. */
71839 	uint8_t	status;
71840 	/* Driver supplied handle to associate the command and the response. */
71841 	uint16_t	cookie;
71842 	/* QP context id */
71843 	uint32_t	xid;
71844 	uint8_t	v;
71845 	/*
71846 	 * This value is written by the NIC such that it will be different
71847 	 * for each pass through the completion queue. The even passes
71848 	 * will write 1. The odd passes will write 0.
71849 	 */
71850 	#define CREQ_CREATE_QP_RESP_V	UINT32_C(0x1)
71851 	/* Event or command opcode. */
71852 	uint8_t	event;
71853 	/* Create QP command response. */
71854 	#define CREQ_CREATE_QP_RESP_EVENT_CREATE_QP UINT32_C(0x1)
71855 	#define CREQ_CREATE_QP_RESP_EVENT_LAST	CREQ_CREATE_QP_RESP_EVENT_CREATE_QP
71856 	/*
71857 	 * Support for optimized transmit path to lower latency
71858 	 * for WQEs with inline data has been enabled for this QP.
71859 	 */
71860 	uint8_t	optimized_transmit_enabled;
71861 	uint8_t	reserved48[5];
71862 } creq_create_qp_resp_t, *pcreq_create_qp_resp_t;
71863 
71864 /**************
71865  * destroy_qp *
71866  **************/
71867 
71868 
71869 /* cmdq_destroy_qp (size:192b/24B) */
71870 
71871 typedef struct cmdq_destroy_qp {
71872 	/* Command opcode. */
71873 	uint8_t	opcode;
71874 	/*
71875 	 * Destroy QP command deletes the QP context and ceases
71876 	 * any further reference.
71877 	 */
71878 	#define CMDQ_DESTROY_QP_OPCODE_DESTROY_QP UINT32_C(0x2)
71879 	#define CMDQ_DESTROY_QP_OPCODE_LAST	CMDQ_DESTROY_QP_OPCODE_DESTROY_QP
71880 	/* Size of the command in 16-byte units. */
71881 	uint8_t	cmd_size;
71882 	/* Flags and attribs of the command. */
71883 	uint16_t	flags;
71884 	/* Driver supplied handle to associate the command and the response. */
71885 	uint16_t	cookie;
71886 	/* Size of the response buffer in 16-byte units. */
71887 	uint8_t	resp_size;
71888 	uint8_t	reserved8;
71889 	/* Host address of the response. */
71890 	uint64_t	resp_addr;
71891 	/* QP context id */
71892 	uint32_t	qp_cid;
71893 	uint32_t	unused_0;
71894 } cmdq_destroy_qp_t, *pcmdq_destroy_qp_t;
71895 
71896 /* creq_destroy_qp_resp (size:128b/16B) */
71897 
71898 typedef struct creq_destroy_qp_resp {
71899 	uint8_t	type;
71900 	/*
71901 	 * This field indicates the exact type of the completion.
71902 	 * By convention, the LSB identifies the length of the
71903 	 * record in 16B units. Even values indicate 16B
71904 	 * records. Odd values indicate 32B
71905 	 * records.
71906 	 */
71907 	#define CREQ_DESTROY_QP_RESP_TYPE_MASK	UINT32_C(0x3f)
71908 	#define CREQ_DESTROY_QP_RESP_TYPE_SFT	0
71909 	/* QP Async Notification */
71910 		#define CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
71911 		#define CREQ_DESTROY_QP_RESP_TYPE_LAST	CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT
71912 	/* Status of the response. */
71913 	uint8_t	status;
71914 	/* Driver supplied handle to associate the command and the response. */
71915 	uint16_t	cookie;
71916 	/* QP context id */
71917 	uint32_t	xid;
71918 	uint8_t	v;
71919 	/*
71920 	 * This value is written by the NIC such that it will be different
71921 	 * for each pass through the completion queue. The even passes
71922 	 * will write 1. The odd passes will write 0.
71923 	 */
71924 	#define CREQ_DESTROY_QP_RESP_V	UINT32_C(0x1)
71925 	/* Event or command opcode. */
71926 	uint8_t	event;
71927 	/* Destroy QP command response. */
71928 	#define CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP UINT32_C(0x2)
71929 	#define CREQ_DESTROY_QP_RESP_EVENT_LAST	CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP
71930 	uint8_t	reserved48[6];
71931 } creq_destroy_qp_resp_t, *pcreq_destroy_qp_resp_t;
71932 
71933 /*************
71934  * modify_qp *
71935  *************/
71936 
71937 
71938 /* cmdq_modify_qp (size:1152b/144B) */
71939 
71940 typedef struct cmdq_modify_qp {
71941 	/* Command opcode. */
71942 	uint8_t	opcode;
71943 	/*
71944 	 * Modify QP command changes QP states and other QP specific
71945 	 * parameters.
71946 	 */
71947 	#define CMDQ_MODIFY_QP_OPCODE_MODIFY_QP UINT32_C(0x3)
71948 	#define CMDQ_MODIFY_QP_OPCODE_LAST	CMDQ_MODIFY_QP_OPCODE_MODIFY_QP
71949 	/* Size of the command in 16-byte units. */
71950 	uint8_t	cmd_size;
71951 	/* Flags and attribs of the command. */
71952 	uint16_t	flags;
71953 	/*
71954 	 * This field, used by firmware for optimizing Modify QP operation,
71955 	 * must be set when the driver has indicated support for the
71956 	 * optimize_modify_qp_supported feature in cmdq_initialize_fw and
71957 	 * when QP Type RC is configured to use SRQ.
71958 	 */
71959 	#define CMDQ_MODIFY_QP_FLAGS_SRQ_USED		UINT32_C(0x1)
71960 	/*
71961 	 * This field must be set when the driver has indicated that the
71962 	 * qp should be excluded from udcc sessions.
71963 	 */
71964 	#define CMDQ_MODIFY_QP_FLAGS_EXCLUDE_QP_UDCC	UINT32_C(0x2)
71965 	/* Driver supplied handle to associate the command and the response. */
71966 	uint16_t	cookie;
71967 	/* Size of the response buffer in 16-byte units. */
71968 	uint8_t	resp_size;
71969 	/*
71970 	 * This field, used by firmware for optimizing Modify QP operation,
71971 	 * must be set when the driver has indicated support for the
71972 	 * optimize_modify_qp_supported feature in cmdq_initialize_fw.
71973 	 */
71974 	uint8_t	qp_type;
71975 	/* Reliable Connection. */
71976 	#define CMDQ_MODIFY_QP_QP_TYPE_RC		UINT32_C(0x2)
71977 	/* Unreliable Datagram. */
71978 	#define CMDQ_MODIFY_QP_QP_TYPE_UD		UINT32_C(0x4)
71979 	/* Raw Ethertype. */
71980 	#define CMDQ_MODIFY_QP_QP_TYPE_RAW_ETHERTYPE UINT32_C(0x6)
71981 	/* General Services Interface on QP1 over UD. */
71982 	#define CMDQ_MODIFY_QP_QP_TYPE_GSI	UINT32_C(0x7)
71983 	#define CMDQ_MODIFY_QP_QP_TYPE_LAST	CMDQ_MODIFY_QP_QP_TYPE_GSI
71984 	/* Host address of the response. */
71985 	uint64_t	resp_addr;
71986 	/* Modify mask signifies the field that is requesting the change. */
71987 	uint32_t	modify_mask;
71988 	/* QP state change. */
71989 	#define CMDQ_MODIFY_QP_MODIFY_MASK_STATE		UINT32_C(0x1)
71990 	/* Enable SQ drain asynchronous notification change. */
71991 	#define CMDQ_MODIFY_QP_MODIFY_MASK_EN_SQD_ASYNC_NOTIFY	UINT32_C(0x2)
71992 	/* Access change. */
71993 	#define CMDQ_MODIFY_QP_MODIFY_MASK_ACCESS		UINT32_C(0x4)
71994 	/* P_KEY change. */
71995 	#define CMDQ_MODIFY_QP_MODIFY_MASK_PKEY			UINT32_C(0x8)
71996 	/* Q_KEY index change. */
71997 	#define CMDQ_MODIFY_QP_MODIFY_MASK_QKEY			UINT32_C(0x10)
71998 	/* Destination GID change. */
71999 	#define CMDQ_MODIFY_QP_MODIFY_MASK_DGID			UINT32_C(0x20)
72000 	/* Flow label change. */
72001 	#define CMDQ_MODIFY_QP_MODIFY_MASK_FLOW_LABEL		UINT32_C(0x40)
72002 	/* SGID change. */
72003 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SGID_INDEX		UINT32_C(0x80)
72004 	/* Hop limit change. */
72005 	#define CMDQ_MODIFY_QP_MODIFY_MASK_HOP_LIMIT		UINT32_C(0x100)
72006 	/* Traffic class change. */
72007 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TRAFFIC_CLASS	UINT32_C(0x200)
72008 	/* destination MAC change. */
72009 	#define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_MAC		UINT32_C(0x400)
72010 	/* Ping pong push mode change. */
72011 	#define CMDQ_MODIFY_QP_MODIFY_MASK_PINGPONG_PUSH_MODE	UINT32_C(0x800)
72012 	/* Path MTU change. */
72013 	#define CMDQ_MODIFY_QP_MODIFY_MASK_PATH_MTU		UINT32_C(0x1000)
72014 	/* Timeout change. */
72015 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TIMEOUT		UINT32_C(0x2000)
72016 	/* Retry count change. */
72017 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RETRY_CNT		UINT32_C(0x4000)
72018 	/* RNR Retry change. */
72019 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RNR_RETRY		UINT32_C(0x8000)
72020 	/* RQ start packet sequence number change. */
72021 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_PSN		UINT32_C(0x10000)
72022 	/* Max outstanding RDMA read atomic change. */
72023 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_RD_ATOMIC	UINT32_C(0x20000)
72024 	/* RNR minimum timer change. */
72025 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MIN_RNR_TIMER	UINT32_C(0x40000)
72026 	/* SQ start packet sequence number change. */
72027 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_PSN		UINT32_C(0x80000)
72028 	/* Max destination outstanding RDMA read atomic change. */
72029 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_DEST_RD_ATOMIC	UINT32_C(0x100000)
72030 	/* Max send WQE change. */
72031 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SIZE		UINT32_C(0x200000)
72032 	/* Max recv WQE change. */
72033 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SIZE		UINT32_C(0x400000)
72034 	/* Max recv SGEs per SWQE change. */
72035 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SGE		UINT32_C(0x800000)
72036 	/* Max send SGEs per RWQE change. */
72037 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SGE		UINT32_C(0x1000000)
72038 	/* Max inline data length change. */
72039 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_INLINE_DATA	UINT32_C(0x2000000)
72040 	/* Destination QP id change. */
72041 	#define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_QP_ID		UINT32_C(0x4000000)
72042 	/* Source MAC change. */
72043 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SRC_MAC		UINT32_C(0x8000000)
72044 	/* Source VLAN id change. */
72045 	#define CMDQ_MODIFY_QP_MODIFY_MASK_VLAN_ID		UINT32_C(0x10000000)
72046 	/* Congestion control RoCE v2 change. */
72047 	#define CMDQ_MODIFY_QP_MODIFY_MASK_ENABLE_CC		UINT32_C(0x20000000)
72048 	/* IP TOS ECN change */
72049 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_ECN		UINT32_C(0x40000000)
72050 	/* IP TOS DSCP change */
72051 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_DSCP		UINT32_C(0x80000000)
72052 	/* QP context id */
72053 	uint32_t	qp_cid;
72054 	uint8_t	network_type_en_sqd_async_notify_new_state;
72055 	/* New QP state. */
72056 	#define CMDQ_MODIFY_QP_NEW_STATE_MASK	UINT32_C(0xf)
72057 	#define CMDQ_MODIFY_QP_NEW_STATE_SFT	0
72058 	/* Reset. */
72059 		#define CMDQ_MODIFY_QP_NEW_STATE_RESET	UINT32_C(0x0)
72060 	/* Init. */
72061 		#define CMDQ_MODIFY_QP_NEW_STATE_INIT		UINT32_C(0x1)
72062 	/* Ready To Receive. */
72063 		#define CMDQ_MODIFY_QP_NEW_STATE_RTR		UINT32_C(0x2)
72064 	/* Ready To Send. */
72065 		#define CMDQ_MODIFY_QP_NEW_STATE_RTS		UINT32_C(0x3)
72066 	/* SQ Drain. */
72067 		#define CMDQ_MODIFY_QP_NEW_STATE_SQD		UINT32_C(0x4)
72068 	/* SQ Error. */
72069 		#define CMDQ_MODIFY_QP_NEW_STATE_SQE		UINT32_C(0x5)
72070 	/* Error. */
72071 		#define CMDQ_MODIFY_QP_NEW_STATE_ERR		UINT32_C(0x6)
72072 		#define CMDQ_MODIFY_QP_NEW_STATE_LAST	CMDQ_MODIFY_QP_NEW_STATE_ERR
72073 	/* Enable SQ drain asynchronous notification. */
72074 	#define CMDQ_MODIFY_QP_EN_SQD_ASYNC_NOTIFY	UINT32_C(0x10)
72075 	/* unused1 is 1 b */
72076 	#define CMDQ_MODIFY_QP_UNUSED1		UINT32_C(0x20)
72077 	/* network type. */
72078 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_MASK	UINT32_C(0xc0)
72079 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_SFT	6
72080 	/* RoCEv1. */
72081 		#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV1	(UINT32_C(0x0) << 6)
72082 	/* RoCEv2 IPv4. */
72083 		#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV4  (UINT32_C(0x2) << 6)
72084 	/* RoCEv2 IPv6. */
72085 		#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6  (UINT32_C(0x3) << 6)
72086 		#define CMDQ_MODIFY_QP_NETWORK_TYPE_LAST	CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6
72087 	/* Access flags. */
72088 	uint8_t	access;
72089 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_MASK		UINT32_C(0xff)
72090 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_SFT		0
72091 	/* Local write access. */
72092 	#define CMDQ_MODIFY_QP_ACCESS_LOCAL_WRITE							UINT32_C(0x1)
72093 	/* Remote write access. */
72094 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_WRITE							UINT32_C(0x2)
72095 	/* Remote read access. */
72096 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_READ							UINT32_C(0x4)
72097 	/*
72098 	 * Remote atomic access. Applicable to devices that support
72099 	 * Atomic operations.
72100 	 */
72101 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC							UINT32_C(0x8)
72102 	/* P_KEY. */
72103 	uint16_t	pkey;
72104 	/* Q_KEY. */
72105 	uint32_t	qkey;
72106 	/* Destination GID. */
72107 	uint32_t	dgid[4];
72108 	/* Flow label. */
72109 	uint32_t	flow_label;
72110 	/* Source GID index. */
72111 	uint16_t	sgid_index;
72112 	/* Hop limit. */
72113 	uint8_t	hop_limit;
72114 	/* Traffic class. */
72115 	uint8_t	traffic_class;
72116 	/* Destination MAC address. */
72117 	uint16_t	dest_mac[3];
72118 	uint8_t	tos_dscp_tos_ecn;
72119 	/* IP TOS ECN. Valid values are 1 or 2 when ECN is enabled. */
72120 	#define CMDQ_MODIFY_QP_TOS_ECN_MASK UINT32_C(0x3)
72121 	#define CMDQ_MODIFY_QP_TOS_ECN_SFT  0
72122 	/* IP TOS DSCP. */
72123 	#define CMDQ_MODIFY_QP_TOS_DSCP_MASK UINT32_C(0xfc)
72124 	#define CMDQ_MODIFY_QP_TOS_DSCP_SFT 2
72125 	uint8_t	path_mtu_pingpong_push_enable;
72126 	/*
72127 	 * Driver requests for ping pong push mode to be enabled for this
72128 	 * QP. This request can be done only during modify from RST to INIT
72129 	 * state.
72130 	 */
72131 	#define CMDQ_MODIFY_QP_PINGPONG_PUSH_ENABLE	UINT32_C(0x1)
72132 	/* unused3 is 3 b */
72133 	#define CMDQ_MODIFY_QP_UNUSED3_MASK		UINT32_C(0xe)
72134 	#define CMDQ_MODIFY_QP_UNUSED3_SFT		1
72135 	/* Path MTU. */
72136 	#define CMDQ_MODIFY_QP_PATH_MTU_MASK		UINT32_C(0xf0)
72137 	#define CMDQ_MODIFY_QP_PATH_MTU_SFT		4
72138 	/* 256. */
72139 		#define CMDQ_MODIFY_QP_PATH_MTU_MTU_256	(UINT32_C(0x0) << 4)
72140 	/* 512. */
72141 		#define CMDQ_MODIFY_QP_PATH_MTU_MTU_512	(UINT32_C(0x1) << 4)
72142 	/* 1024. */
72143 		#define CMDQ_MODIFY_QP_PATH_MTU_MTU_1024	(UINT32_C(0x2) << 4)
72144 	/* 2048. */
72145 		#define CMDQ_MODIFY_QP_PATH_MTU_MTU_2048	(UINT32_C(0x3) << 4)
72146 	/* 4096. */
72147 		#define CMDQ_MODIFY_QP_PATH_MTU_MTU_4096	(UINT32_C(0x4) << 4)
72148 	/* 8192. */
72149 		#define CMDQ_MODIFY_QP_PATH_MTU_MTU_8192	(UINT32_C(0x5) << 4)
72150 		#define CMDQ_MODIFY_QP_PATH_MTU_LAST		CMDQ_MODIFY_QP_PATH_MTU_MTU_8192
72151 	/* Timeout value for SWQEs. */
72152 	uint8_t	timeout;
72153 	/* Max retry count for WQEs. */
72154 	uint8_t	retry_cnt;
72155 	/* Max RNR retry count for WQEs. */
72156 	uint8_t	rnr_retry;
72157 	/* Min RNR timer that the QP will report to the remote. */
72158 	uint8_t	min_rnr_timer;
72159 	/* RQ start packet sequence number. */
72160 	uint32_t	rq_psn;
72161 	/* SQ start packet sequence number. */
72162 	uint32_t	sq_psn;
72163 	/* Max outstanding RDMA read atomic. */
72164 	uint8_t	max_rd_atomic;
72165 	/* Max destination outstanding RDMA read atomic. */
72166 	uint8_t	max_dest_rd_atomic;
72167 	uint16_t	enable_cc;
72168 	/* Enable congestion control. */
72169 	#define CMDQ_MODIFY_QP_ENABLE_CC	UINT32_C(0x1)
72170 	/* unused15 is 15 b */
72171 	#define CMDQ_MODIFY_QP_UNUSED15_MASK UINT32_C(0xfffe)
72172 	#define CMDQ_MODIFY_QP_UNUSED15_SFT  1
72173 	/* Max send WQE. */
72174 	uint32_t	sq_size;
72175 	/* Max recv WQE. */
72176 	uint32_t	rq_size;
72177 	/* Max send SGEs per SWQE. */
72178 	uint16_t	sq_sge;
72179 	/* Max recv SGEs per RWQE. */
72180 	uint16_t	rq_sge;
72181 	/* Max inline data length (up to 120 bytes). */
72182 	uint32_t	max_inline_data;
72183 	/* Destination QP id. */
72184 	uint32_t	dest_qp_id;
72185 	/* This is the DPI RoCE driver allocated for ping pong push. */
72186 	uint32_t	pingpong_push_dpi;
72187 	/* Source MAC. (Unused. Comes from Source GID index) */
72188 	uint16_t	src_mac[3];
72189 	uint16_t	vlan_pcp_vlan_dei_vlan_id;
72190 	/* VLAN id. (Unused. Comes from Source GID index) */
72191 	#define CMDQ_MODIFY_QP_VLAN_ID_MASK UINT32_C(0xfff)
72192 	#define CMDQ_MODIFY_QP_VLAN_ID_SFT  0
72193 	/* VLAN DEI field - Drop Eligibility Indicator. */
72194 	#define CMDQ_MODIFY_QP_VLAN_DEI	UINT32_C(0x1000)
72195 	/* VLAN PCP field - Priority Code Point. */
72196 	#define CMDQ_MODIFY_QP_VLAN_PCP_MASK UINT32_C(0xe000)
72197 	#define CMDQ_MODIFY_QP_VLAN_PCP_SFT 13
72198 	/* IRRQ address. */
72199 	uint64_t	irrq_addr;
72200 	/* ORRQ address. */
72201 	uint64_t	orrq_addr;
72202 	/*
72203 	 * Extended Modify mask signifies the field that is requesting the
72204 	 * change.
72205 	 */
72206 	uint32_t	ext_modify_mask;
72207 	/* Extended RoCE statistics context id change */
72208 	#define CMDQ_MODIFY_QP_EXT_MODIFY_MASK_EXT_STATS_CTX	UINT32_C(0x1)
72209 	/* The schq_id field is valid */
72210 	#define CMDQ_MODIFY_QP_EXT_MODIFY_MASK_SCHQ_ID_VALID	UINT32_C(0x2)
72211 	/* Extended RoCE statistics context id. */
72212 	uint32_t	ext_stats_ctx_id;
72213 	/*
72214 	 * Identifies the new scheduling queue to associate to the RoCE QP.
72215 	 * A value of zero indicates that the QP is being modified to use
72216 	 * the default scheduling queue. Specified scheduling queue id is
72217 	 * allocated by firmware (via HWRM_SCHQ_ALLOC) when the device supports
72218 	 * the `scheduling queue` feature.
72219 	 */
72220 	uint16_t	schq_id;
72221 	/* unused_0 is 16 b */
72222 	uint16_t	unused_0;
72223 	/* reserved32 is 32 b */
72224 	uint32_t	reserved32;
72225 } cmdq_modify_qp_t, *pcmdq_modify_qp_t;
72226 
72227 /* creq_modify_qp_resp (size:128b/16B) */
72228 
72229 typedef struct creq_modify_qp_resp {
72230 	uint8_t	type;
72231 	/*
72232 	 * This field indicates the exact type of the completion.
72233 	 * By convention, the LSB identifies the length of the
72234 	 * record in 16B units. Even values indicate 16B
72235 	 * records. Odd values indicate 32B
72236 	 * records.
72237 	 */
72238 	#define CREQ_MODIFY_QP_RESP_TYPE_MASK	UINT32_C(0x3f)
72239 	#define CREQ_MODIFY_QP_RESP_TYPE_SFT	0
72240 	/* QP Async Notification */
72241 		#define CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
72242 		#define CREQ_MODIFY_QP_RESP_TYPE_LAST	CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT
72243 	/* Status of the response. */
72244 	uint8_t	status;
72245 	/* Driver supplied handle to associate the command and the response. */
72246 	uint16_t	cookie;
72247 	/* QP context id */
72248 	uint32_t	xid;
72249 	uint8_t	v;
72250 	/*
72251 	 * This value is written by the NIC such that it will be different
72252 	 * for each pass through the completion queue. The even passes
72253 	 * will write 1. The odd passes will write 0.
72254 	 */
72255 	#define CREQ_MODIFY_QP_RESP_V	UINT32_C(0x1)
72256 	/* Event or command opcode. */
72257 	uint8_t	event;
72258 	/* Modify QP command response. */
72259 	#define CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP UINT32_C(0x3)
72260 	#define CREQ_MODIFY_QP_RESP_EVENT_LAST	CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP
72261 	uint8_t	pingpong_push_state_index_enabled;
72262 	/*
72263 	 * When set it indicates that FW was able to successfully enable
72264 	 * ping pong push mode for this QP.
72265 	 */
72266 	#define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_ENABLED	UINT32_C(0x1)
72267 	/*
72268 	 * When ping pong push mode is enabled this field will give the
72269 	 * index into the push page where the QP has been mapped.
72270 	 */
72271 	#define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_INDEX_MASK  UINT32_C(0xe)
72272 	#define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_INDEX_SFT   1
72273 	/*
72274 	 * This bit will tell whether to use ping or pong buffer
72275 	 * for first push operation. 0 - ping buffer, 1 - pong buffer.
72276 	 */
72277 	#define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_STATE	UINT32_C(0x10)
72278 	uint8_t	reserved8;
72279 	/* Scrambled src mac needed to calculate UDP source port. */
72280 	uint32_t	lag_src_mac;
72281 } creq_modify_qp_resp_t, *pcreq_modify_qp_resp_t;
72282 
72283 /************
72284  * query_qp *
72285  ************/
72286 
72287 
72288 /* cmdq_query_qp (size:192b/24B) */
72289 
72290 typedef struct cmdq_query_qp {
72291 	/* Command opcode. */
72292 	uint8_t	opcode;
72293 	/* Query QP command retrieves info about the specified QP. */
72294 	#define CMDQ_QUERY_QP_OPCODE_QUERY_QP UINT32_C(0x4)
72295 	#define CMDQ_QUERY_QP_OPCODE_LAST	CMDQ_QUERY_QP_OPCODE_QUERY_QP
72296 	/* Size of the command in 16-byte units. */
72297 	uint8_t	cmd_size;
72298 	/* Flags and attribs of the command. */
72299 	uint16_t	flags;
72300 	/* Driver supplied handle to associate the command and the response. */
72301 	uint16_t	cookie;
72302 	/* Size of the response buffer in 16-byte units. */
72303 	uint8_t	resp_size;
72304 	uint8_t	reserved8;
72305 	/* Host address of the response. */
72306 	uint64_t	resp_addr;
72307 	/* QP context id */
72308 	uint32_t	qp_cid;
72309 	uint32_t	unused_0;
72310 } cmdq_query_qp_t, *pcmdq_query_qp_t;
72311 
72312 /* creq_query_qp_resp (size:128b/16B) */
72313 
72314 typedef struct creq_query_qp_resp {
72315 	uint8_t	type;
72316 	/*
72317 	 * This field indicates the exact type of the completion.
72318 	 * By convention, the LSB identifies the length of the
72319 	 * record in 16B units. Even values indicate 16B
72320 	 * records. Odd values indicate 32B
72321 	 * records.
72322 	 */
72323 	#define CREQ_QUERY_QP_RESP_TYPE_MASK	UINT32_C(0x3f)
72324 	#define CREQ_QUERY_QP_RESP_TYPE_SFT	0
72325 	/* QP Async Notification */
72326 		#define CREQ_QUERY_QP_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
72327 		#define CREQ_QUERY_QP_RESP_TYPE_LAST	CREQ_QUERY_QP_RESP_TYPE_QP_EVENT
72328 	/* Status of the response. */
72329 	uint8_t	status;
72330 	/* Driver supplied handle to associate the command and the response. */
72331 	uint16_t	cookie;
72332 	/* Side buffer size in 16-byte units */
72333 	uint32_t	size;
72334 	uint8_t	v;
72335 	/*
72336 	 * This value is written by the NIC such that it will be different
72337 	 * for each pass through the completion queue. The even passes
72338 	 * will write 1. The odd passes will write 0.
72339 	 */
72340 	#define CREQ_QUERY_QP_RESP_V	UINT32_C(0x1)
72341 	/* Event or command opcode. */
72342 	uint8_t	event;
72343 	/* Query QP command response. */
72344 	#define CREQ_QUERY_QP_RESP_EVENT_QUERY_QP UINT32_C(0x4)
72345 	#define CREQ_QUERY_QP_RESP_EVENT_LAST	CREQ_QUERY_QP_RESP_EVENT_QUERY_QP
72346 	uint8_t	reserved48[6];
72347 } creq_query_qp_resp_t, *pcreq_query_qp_resp_t;
72348 
72349 /* Query QP command response side buffer structure. */
72350 /* creq_query_qp_resp_sb (size:832b/104B) */
72351 
72352 typedef struct creq_query_qp_resp_sb {
72353 	/* Command opcode. */
72354 	uint8_t	opcode;
72355 	/* Query QP command response. */
72356 	#define CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP UINT32_C(0x4)
72357 	#define CREQ_QUERY_QP_RESP_SB_OPCODE_LAST	CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP
72358 	/* Status of the response. */
72359 	uint8_t	status;
72360 	/* Driver supplied handle to associate the command and the response. */
72361 	uint16_t	cookie;
72362 	/* Flags and attribs of the command. */
72363 	uint16_t	flags;
72364 	/* Size of the response buffer in 16-byte units. */
72365 	uint8_t	resp_size;
72366 	uint8_t	reserved8;
72367 	/* QP context id */
72368 	uint32_t	xid;
72369 	uint8_t	en_sqd_async_notify_state;
72370 	/* QP state */
72371 	#define CREQ_QUERY_QP_RESP_SB_STATE_MASK		UINT32_C(0xf)
72372 	#define CREQ_QUERY_QP_RESP_SB_STATE_SFT		0
72373 	/* Reset. */
72374 		#define CREQ_QUERY_QP_RESP_SB_STATE_RESET		UINT32_C(0x0)
72375 	/* Init. */
72376 		#define CREQ_QUERY_QP_RESP_SB_STATE_INIT		UINT32_C(0x1)
72377 	/* Ready To Receive. */
72378 		#define CREQ_QUERY_QP_RESP_SB_STATE_RTR		UINT32_C(0x2)
72379 	/* Ready To Send. */
72380 		#define CREQ_QUERY_QP_RESP_SB_STATE_RTS		UINT32_C(0x3)
72381 	/* SQ Drain. */
72382 		#define CREQ_QUERY_QP_RESP_SB_STATE_SQD		UINT32_C(0x4)
72383 	/* SQ Error. */
72384 		#define CREQ_QUERY_QP_RESP_SB_STATE_SQE		UINT32_C(0x5)
72385 	/* Error. */
72386 		#define CREQ_QUERY_QP_RESP_SB_STATE_ERR		UINT32_C(0x6)
72387 		#define CREQ_QUERY_QP_RESP_SB_STATE_LAST		CREQ_QUERY_QP_RESP_SB_STATE_ERR
72388 	/* SQ drain asynchronous notification. */
72389 	#define CREQ_QUERY_QP_RESP_SB_EN_SQD_ASYNC_NOTIFY	UINT32_C(0x10)
72390 	/* Enable congestion control. */
72391 	#define CREQ_QUERY_QP_RESP_SB_UNUSED3_MASK		UINT32_C(0xe0)
72392 	#define CREQ_QUERY_QP_RESP_SB_UNUSED3_SFT		5
72393 	/* Access flags. */
72394 	uint8_t	access;
72395 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_MASK		UINT32_C(0xff)
72396 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_SFT		0
72397 	/* Local write access. */
72398 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_LOCAL_WRITE							UINT32_C(0x1)
72399 	/* Remote write access. */
72400 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_WRITE							UINT32_C(0x2)
72401 	/* Remote read access. */
72402 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_READ							UINT32_C(0x4)
72403 	/* Remote atomic access. */
72404 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC							UINT32_C(0x8)
72405 	/* P_KEY index. */
72406 	uint16_t	pkey;
72407 	/* Q_KEY. */
72408 	uint32_t	qkey;
72409 	/*
72410 	 * UDP source port used in RoCEv2 packets. Valid only when
72411 	 * change_udp_src_port_wqe_supported feature is advertised.
72412 	 */
72413 	uint16_t	udp_src_port;
72414 	uint16_t	reserved16;
72415 	/* Destination GID. */
72416 	uint32_t	dgid[4];
72417 	/* Flow label. */
72418 	uint32_t	flow_label;
72419 	/* Source GID index. */
72420 	uint16_t	sgid_index;
72421 	/* Hop limit. */
72422 	uint8_t	hop_limit;
72423 	/* Traffic class. */
72424 	uint8_t	traffic_class;
72425 	/* Destination MAC address. */
72426 	uint16_t	dest_mac[3];
72427 	uint16_t	path_mtu_dest_vlan_id;
72428 	/* Destination VLAN ID. */
72429 	#define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_MASK UINT32_C(0xfff)
72430 	#define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_SFT 0
72431 	/* Path MTU. */
72432 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MASK	UINT32_C(0xf000)
72433 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_SFT	12
72434 	/* 256. */
72435 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_256   (UINT32_C(0x0) << 12)
72436 	/* 512. */
72437 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_512   (UINT32_C(0x1) << 12)
72438 	/* 1024. */
72439 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_1024  (UINT32_C(0x2) << 12)
72440 	/* 2048. */
72441 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_2048  (UINT32_C(0x3) << 12)
72442 	/* 4096. */
72443 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_4096  (UINT32_C(0x4) << 12)
72444 	/* 8192. */
72445 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192  (UINT32_C(0x5) << 12)
72446 		#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_LAST	CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192
72447 	/* Timeout value for SWQEs. */
72448 	uint8_t	timeout;
72449 	/* Max retry count for WQEs. */
72450 	uint8_t	retry_cnt;
72451 	/* Max RNR retry count for WQEs. */
72452 	uint8_t	rnr_retry;
72453 	/* Min RNR timer that the QP will report to the remote. */
72454 	uint8_t	min_rnr_timer;
72455 	/* RQ start packet sequence number. */
72456 	uint32_t	rq_psn;
72457 	/* SQ start packet sequence number. */
72458 	uint32_t	sq_psn;
72459 	/* Max outstanding RDMA read atomic. */
72460 	uint8_t	max_rd_atomic;
72461 	/* Max destination outstanding RDMA read atomic. */
72462 	uint8_t	max_dest_rd_atomic;
72463 	uint8_t	tos_dscp_tos_ecn;
72464 	/* IP TOS ECN. */
72465 	#define CREQ_QUERY_QP_RESP_SB_TOS_ECN_MASK UINT32_C(0x3)
72466 	#define CREQ_QUERY_QP_RESP_SB_TOS_ECN_SFT  0
72467 	/* IP TOS DSCP. */
72468 	#define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_MASK UINT32_C(0xfc)
72469 	#define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_SFT 2
72470 	uint8_t	enable_cc;
72471 	/* enable_cc is 1 b */
72472 	#define CREQ_QUERY_QP_RESP_SB_ENABLE_CC	UINT32_C(0x1)
72473 	/* Max send WQE. */
72474 	uint32_t	sq_size;
72475 	/* Max recv WQE. */
72476 	uint32_t	rq_size;
72477 	/* Max send SGEs per SWQE. */
72478 	uint16_t	sq_sge;
72479 	/* Max recv SGEs per RWQE (NOT SUPPORTED BY HARDWARE). */
72480 	uint16_t	rq_sge;
72481 	/* Max inline data length (up to 120 bytes). */
72482 	uint32_t	max_inline_data;
72483 	/* Destination QP id. */
72484 	uint32_t	dest_qp_id;
72485 	/* Port ID associated with the QP. */
72486 	uint16_t	port_id;
72487 	uint8_t	unused_0;
72488 	/* Statistic collection ID allocated for this QP. */
72489 	uint8_t	stat_collection_id;
72490 	/* Source MAC. */
72491 	uint16_t	src_mac[3];
72492 	uint16_t	vlan_pcp_vlan_dei_vlan_id;
72493 	/* Source VLAN id. */
72494 	#define CREQ_QUERY_QP_RESP_SB_VLAN_ID_MASK UINT32_C(0xfff)
72495 	#define CREQ_QUERY_QP_RESP_SB_VLAN_ID_SFT  0
72496 	/* VLAN DEI field - Drop Eligibility Indicator. */
72497 	#define CREQ_QUERY_QP_RESP_SB_VLAN_DEI	UINT32_C(0x1000)
72498 	/* VLAN PCP field - Priority Code Point. */
72499 	#define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_MASK UINT32_C(0xe000)
72500 	#define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_SFT 13
72501 } creq_query_qp_resp_sb_t, *pcreq_query_qp_resp_sb_t;
72502 
72503 /*******************
72504  * query_qp_extend *
72505  *******************/
72506 
72507 
72508 /* cmdq_query_qp_extend (size:192b/24B) */
72509 
72510 typedef struct cmdq_query_qp_extend {
72511 	/* Command opcode. */
72512 	uint8_t	opcode;
72513 	/*
72514 	 * Query QP extend command retrieves info about multiple QPs
72515 	 * associated with a specific PF.
72516 	 */
72517 	#define CMDQ_QUERY_QP_EXTEND_OPCODE_QUERY_QP_EXTEND UINT32_C(0x91)
72518 	#define CMDQ_QUERY_QP_EXTEND_OPCODE_LAST	CMDQ_QUERY_QP_EXTEND_OPCODE_QUERY_QP_EXTEND
72519 	/* Size of the command in 16-byte units. */
72520 	uint8_t	cmd_size;
72521 	/* Flags and attribs of the command. */
72522 	uint16_t	flags;
72523 	/* Driver supplied handle to associate the command and the response. */
72524 	uint16_t	cookie;
72525 	/* Size of the response buffer in 16-byte units. */
72526 	uint8_t	resp_size;
72527 	/*
72528 	 * Number of QPs for which FW needs to query and provide info back to
72529 	 * host.
72530 	 */
72531 	uint8_t	num_qps;
72532 	/* Host address of the response. */
72533 	uint64_t	resp_addr;
72534 	/* Unique identified for a function */
72535 	uint32_t	function_id;
72536 	/* PF number */
72537 	#define CMDQ_QUERY_QP_EXTEND_PF_NUM_MASK  UINT32_C(0xff)
72538 	#define CMDQ_QUERY_QP_EXTEND_PF_NUM_SFT   0
72539 	/* VF number */
72540 	#define CMDQ_QUERY_QP_EXTEND_VF_NUM_MASK  UINT32_C(0xffff00)
72541 	#define CMDQ_QUERY_QP_EXTEND_VF_NUM_SFT   8
72542 	/* When set the vf_num is valid. */
72543 	#define CMDQ_QUERY_QP_EXTEND_VF_VALID	UINT32_C(0x1000000)
72544 	/*
72545 	 * This is the current index where firmware left off for query qp.
72546 	 * Driver will pass this back in the next query_qp_extend command.
72547 	 */
72548 	uint32_t	current_index;
72549 } cmdq_query_qp_extend_t, *pcmdq_query_qp_extend_t;
72550 
72551 /* creq_query_qp_extend_resp (size:128b/16B) */
72552 
72553 typedef struct creq_query_qp_extend_resp {
72554 	uint8_t	type;
72555 	/*
72556 	 * This field indicates the exact type of the completion.
72557 	 * By convention, the LSB identifies the length of the
72558 	 * record in 16B units. Even values indicate 16B
72559 	 * records. Odd values indicate 32B
72560 	 * records.
72561 	 */
72562 	#define CREQ_QUERY_QP_EXTEND_RESP_TYPE_MASK	UINT32_C(0x3f)
72563 	#define CREQ_QUERY_QP_EXTEND_RESP_TYPE_SFT	0
72564 	/* QP Async Notification */
72565 		#define CREQ_QUERY_QP_EXTEND_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
72566 		#define CREQ_QUERY_QP_EXTEND_RESP_TYPE_LAST	CREQ_QUERY_QP_EXTEND_RESP_TYPE_QP_EVENT
72567 	/* Status of the response. */
72568 	uint8_t	status;
72569 	/* Driver supplied handle to associate the command and the response. */
72570 	uint16_t	cookie;
72571 	/* Side buffer size in 16-byte units */
72572 	uint32_t	size;
72573 	uint8_t	v;
72574 	/*
72575 	 * This value is written by the NIC such that it will be different
72576 	 * for each pass through the completion queue. The even passes
72577 	 * will write 1. The odd passes will write 0.
72578 	 */
72579 	#define CREQ_QUERY_QP_EXTEND_RESP_V	UINT32_C(0x1)
72580 	/* Event or command opcode. */
72581 	uint8_t	event;
72582 	/* Query QP extend command response. */
72583 	#define CREQ_QUERY_QP_EXTEND_RESP_EVENT_QUERY_QP_EXTEND UINT32_C(0x91)
72584 	#define CREQ_QUERY_QP_EXTEND_RESP_EVENT_LAST	CREQ_QUERY_QP_EXTEND_RESP_EVENT_QUERY_QP_EXTEND
72585 	uint16_t	reserved16;
72586 	/*
72587 	 * This is the current index where firmware left off for query qp.
72588 	 * Driver will pass this back in the next query_qp_extend command.
72589 	 */
72590 	uint32_t	current_index;
72591 } creq_query_qp_extend_resp_t, *pcreq_query_qp_extend_resp_t;
72592 
72593 /* Query QP extend command response side buffer structure. */
72594 /* creq_query_qp_extend_resp_sb (size:384b/48B) */
72595 
72596 typedef struct creq_query_qp_extend_resp_sb {
72597 	/* Command opcode. */
72598 	uint8_t	opcode;
72599 	/* Query QP command extend response. */
72600 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_QUERY_QP_EXTEND UINT32_C(0x91)
72601 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_LAST	CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_QUERY_QP_EXTEND
72602 	/* Status of the response. */
72603 	uint8_t	status;
72604 	/* Driver supplied handle to associate the command and the response. */
72605 	uint16_t	cookie;
72606 	/* Flags and attribs of the command. */
72607 	uint16_t	flags;
72608 	/* Size of the response buffer in 16-byte units. */
72609 	uint8_t	resp_size;
72610 	uint8_t	reserved8;
72611 	/* QP context id */
72612 	uint32_t	xid;
72613 	uint8_t	state;
72614 	/* QP state */
72615 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_MASK  UINT32_C(0xf)
72616 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SFT   0
72617 	/* Reset. */
72618 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RESET   UINT32_C(0x0)
72619 	/* Init. */
72620 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_INIT	UINT32_C(0x1)
72621 	/* Ready To Receive. */
72622 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RTR	UINT32_C(0x2)
72623 	/* Ready To Send. */
72624 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RTS	UINT32_C(0x3)
72625 	/* SQ Drain. */
72626 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SQD	UINT32_C(0x4)
72627 	/* SQ Error. */
72628 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SQE	UINT32_C(0x5)
72629 	/* Error. */
72630 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_ERR	UINT32_C(0x6)
72631 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_LAST   CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_ERR
72632 	/*  */
72633 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_UNUSED4_MASK UINT32_C(0xf0)
72634 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_UNUSED4_SFT 4
72635 	uint8_t	reserved_8;
72636 	/* Port ID associated with the QP. */
72637 	uint16_t	port_id;
72638 	/* Q_KEY. */
72639 	uint32_t	qkey;
72640 	/* Source GID index. */
72641 	uint16_t	sgid_index;
72642 	/* Network type. */
72643 	uint8_t	network_type;
72644 	/* RoCEv1. */
72645 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV1	UINT32_C(0x0)
72646 	/* RoCEv2 IPv4. */
72647 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV4 UINT32_C(0x2)
72648 	/* RoCEv2 IPv6. */
72649 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV6 UINT32_C(0x3)
72650 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_LAST	CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV6
72651 	uint8_t	unused_0;
72652 	/* Destination GID. */
72653 	uint32_t	dgid[4];
72654 	/* Destination QP id. */
72655 	uint32_t	dest_qp_id;
72656 	/* Statistic collection ID allocated for this QP. */
72657 	uint8_t	stat_collection_id;
72658 	uint8_t	reserved2_8;
72659 	uint16_t	reserved_16;
72660 } creq_query_qp_extend_resp_sb_t, *pcreq_query_qp_extend_resp_sb_t;
72661 
72662 /*
72663  * TLV encapsulated Query QP extend control command response
72664  * side buffer.
72665  */
72666 /* creq_query_qp_extend_resp_sb_tlv (size:512b/64B) */
72667 
72668 typedef struct creq_query_qp_extend_resp_sb_tlv {
72669 	/*
72670 	 * The command discriminator is used to differentiate between various
72671 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
72672 	 * command messages as well as newer TLV encapsulated HWRM commands.
72673 	 *
72674 	 * For TLV encapsulated messages this field must be 0x8000.
72675 	 */
72676 	uint16_t	cmd_discr;
72677 	uint8_t	reserved_8b;
72678 	uint8_t	tlv_flags;
72679 	/*
72680 	 * Indicates the presence of additional TLV encapsulated data
72681 	 * follows this TLV.
72682 	 */
72683 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE	UINT32_C(0x1)
72684 	/* Last TLV in a sequence of TLVs. */
72685 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
72686 	/* More TLVs follow this TLV. */
72687 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
72688 	/*
72689 	 * When an HWRM receiver detects a TLV type that it does not
72690 	 * support with the TLV required flag set, the receiver must
72691 	 * reject the HWRM message with an error code indicating an
72692 	 * unsupported TLV type.
72693 	 */
72694 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED	UINT32_C(0x2)
72695 	/* No */
72696 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
72697 	/* Yes */
72698 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
72699 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES
72700 	/*
72701 	 * This field defines the TLV type value which is divided into
72702 	 * two ranges to differentiate between global and local TLV types.
72703 	 * Global TLV types must be unique across all defined TLV types.
72704 	 * Local TLV types are valid only for extensions to a given
72705 	 * HWRM message and may be repeated across different HWRM message
72706 	 * types. There is a direct correlation of each HWRM message type
72707 	 * to a single global TLV type value.
72708 	 *
72709 	 * Global TLV range: `0 - (63k-1)`
72710 	 *
72711 	 * Local TLV range: `63k - (64k-1)`
72712 	 */
72713 	uint16_t	tlv_type;
72714 	/*
72715 	 * Length of the message data encapsulated by this TLV in bytes.
72716 	 * This length does not include the size of the TLV header itself
72717 	 * and it must be an integer multiple of 8B.
72718 	 */
72719 	uint16_t	length;
72720 	/*
72721 	 * Size of the tlv encapsulated response,
72722 	 * including all tlvs and extension data in 16-byte units.
72723 	 */
72724 	uint8_t	total_size;
72725 	uint8_t	reserved56[7];
72726 	/* Command opcode. */
72727 	uint8_t	opcode;
72728 	/* Query QP command extend response. */
72729 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_QUERY_QP_EXTEND UINT32_C(0x91)
72730 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_LAST	CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_QUERY_QP_EXTEND
72731 	/* Status of the response. */
72732 	uint8_t	status;
72733 	/* Driver supplied handle to associate the command and the response. */
72734 	uint16_t	cookie;
72735 	/* Flags and attribs of the command. */
72736 	uint16_t	flags;
72737 	/* Size of the response buffer in 16-byte units. */
72738 	uint8_t	resp_size;
72739 	uint8_t	reserved8;
72740 	/* QP context id */
72741 	uint32_t	xid;
72742 	uint8_t	state;
72743 	/* QP state */
72744 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_MASK  UINT32_C(0xf)
72745 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SFT   0
72746 	/* Reset. */
72747 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RESET   UINT32_C(0x0)
72748 	/* Init. */
72749 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_INIT	UINT32_C(0x1)
72750 	/* Ready To Receive. */
72751 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RTR	UINT32_C(0x2)
72752 	/* Ready To Send. */
72753 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RTS	UINT32_C(0x3)
72754 	/* SQ Drain. */
72755 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SQD	UINT32_C(0x4)
72756 	/* SQ Error. */
72757 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SQE	UINT32_C(0x5)
72758 	/* Error. */
72759 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_ERR	UINT32_C(0x6)
72760 		#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_LAST   CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_ERR
72761 	/*  */
72762 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_UNUSED4_MASK UINT32_C(0xf0)
72763 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_UNUSED4_SFT 4
72764 	uint8_t	reserved_8;
72765 	/* Port ID associated with the QP. */
72766 	uint16_t	port_id;
72767 	/* Q_KEY. */
72768 	uint32_t	qkey;
72769 	/* Source GID index. */
72770 	uint16_t	sgid_index;
72771 	/* Network type. */
72772 	uint8_t	network_type;
72773 	/* RoCEv1. */
72774 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV1	UINT32_C(0x0)
72775 	/* RoCEv2 IPv4. */
72776 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV4 UINT32_C(0x2)
72777 	/* RoCEv2 IPv6. */
72778 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV6 UINT32_C(0x3)
72779 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_LAST	CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV6
72780 	uint8_t	unused_0;
72781 	/* Destination GID. */
72782 	uint32_t	dgid[4];
72783 	/* Destination QP id. */
72784 	uint32_t	dest_qp_id;
72785 	/* Statistic collection ID allocated for this QP. */
72786 	uint8_t	stat_collection_id;
72787 	uint8_t	reserved2_8;
72788 	uint16_t	reserved_16;
72789 } creq_query_qp_extend_resp_sb_tlv_t, *pcreq_query_qp_extend_resp_sb_tlv_t;
72790 
72791 /**************
72792  * create_srq *
72793  **************/
72794 
72795 
72796 /* cmdq_create_srq (size:512b/64B) */
72797 
72798 typedef struct cmdq_create_srq {
72799 	/* Command opcode. */
72800 	uint8_t	opcode;
72801 	/* Create SRQ command allocates a SRQ with the specified parameters. */
72802 	#define CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ UINT32_C(0x5)
72803 	#define CMDQ_CREATE_SRQ_OPCODE_LAST	CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ
72804 	/* Size of the command in 16-byte units. */
72805 	uint8_t	cmd_size;
72806 	/* Flags and attribs of the command. */
72807 	uint16_t	flags;
72808 	/* This SRQ uses the steering tag specified in the command. */
72809 	#define CMDQ_CREATE_SRQ_FLAGS_STEERING_TAG_VALID	UINT32_C(0x1)
72810 	/* Driver supplied handle to associate the command and the response. */
72811 	uint16_t	cookie;
72812 	/* Size of the response buffer in 16-byte units. */
72813 	uint8_t	resp_size;
72814 	uint8_t	reserved8;
72815 	/* Host address of the response. */
72816 	uint64_t	resp_addr;
72817 	/* SRQ handle. */
72818 	uint64_t	srq_handle;
72819 	uint16_t	pg_size_lvl;
72820 	/* SRQ PBL indirect levels. */
72821 	#define CMDQ_CREATE_SRQ_LVL_MASK	UINT32_C(0x3)
72822 	#define CMDQ_CREATE_SRQ_LVL_SFT	0
72823 	/* PBL pointer is physical start address. */
72824 		#define CMDQ_CREATE_SRQ_LVL_LVL_0	UINT32_C(0x0)
72825 	/* PBL pointer points to PTE table. */
72826 		#define CMDQ_CREATE_SRQ_LVL_LVL_1	UINT32_C(0x1)
72827 	/*
72828 	 * PBL pointer points to PDE table with each entry pointing to PTE
72829 	 * tables.
72830 	 */
72831 		#define CMDQ_CREATE_SRQ_LVL_LVL_2	UINT32_C(0x2)
72832 		#define CMDQ_CREATE_SRQ_LVL_LAST	CMDQ_CREATE_SRQ_LVL_LVL_2
72833 	/* page size. */
72834 	#define CMDQ_CREATE_SRQ_PG_SIZE_MASK  UINT32_C(0x1c)
72835 	#define CMDQ_CREATE_SRQ_PG_SIZE_SFT   2
72836 	/* 4KB. */
72837 		#define CMDQ_CREATE_SRQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 2)
72838 	/* 8KB. */
72839 		#define CMDQ_CREATE_SRQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 2)
72840 	/* 64KB. */
72841 		#define CMDQ_CREATE_SRQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 2)
72842 	/* 2MB. */
72843 		#define CMDQ_CREATE_SRQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 2)
72844 	/* 8MB. */
72845 		#define CMDQ_CREATE_SRQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 2)
72846 	/* 1GB. */
72847 		#define CMDQ_CREATE_SRQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 2)
72848 		#define CMDQ_CREATE_SRQ_PG_SIZE_LAST   CMDQ_CREATE_SRQ_PG_SIZE_PG_1G
72849 	/* unused11 is 11 b */
72850 	#define CMDQ_CREATE_SRQ_UNUSED11_MASK UINT32_C(0xffe0)
72851 	#define CMDQ_CREATE_SRQ_UNUSED11_SFT  5
72852 	uint16_t	eventq_id;
72853 	/* eventq_id is 12 b */
72854 	#define CMDQ_CREATE_SRQ_EVENTQ_ID_MASK UINT32_C(0xfff)
72855 	#define CMDQ_CREATE_SRQ_EVENTQ_ID_SFT 0
72856 	/* unused4 is 4 b */
72857 	#define CMDQ_CREATE_SRQ_UNUSED4_MASK  UINT32_C(0xf000)
72858 	#define CMDQ_CREATE_SRQ_UNUSED4_SFT   12
72859 	/* Max number of SRQ wqes. */
72860 	uint16_t	srq_size;
72861 	uint16_t	srq_fwo;
72862 	/* Offset of first WQE in the first page of SRQ, in 128 byte units */
72863 	#define CMDQ_CREATE_SRQ_SRQ_FWO_MASK UINT32_C(0xfff)
72864 	#define CMDQ_CREATE_SRQ_SRQ_FWO_SFT 0
72865 	/*
72866 	 * Max SGEs per SRQ WQE. This field is enabled if flag,
72867 	 * create_srq_sge_supported, is set in query_func response.
72868 	 */
72869 	#define CMDQ_CREATE_SRQ_SRQ_SGE_MASK UINT32_C(0xf000)
72870 	#define CMDQ_CREATE_SRQ_SRQ_SGE_SFT 12
72871 	/* Doorbell page index. */
72872 	uint32_t	dpi;
72873 	/* Protection domain id. */
72874 	uint32_t	pd_id;
72875 	/* RQ PBL physical address. */
72876 	uint64_t	pbl;
72877 	/* Steering tag to use for memory transactions. */
72878 	uint16_t	steering_tag;
72879 	uint8_t	reserved48[6];
72880 	/* reserved64 is 64 b */
72881 	uint64_t	reserved64;
72882 } cmdq_create_srq_t, *pcmdq_create_srq_t;
72883 
72884 /* creq_create_srq_resp (size:128b/16B) */
72885 
72886 typedef struct creq_create_srq_resp {
72887 	uint8_t	type;
72888 	/*
72889 	 * This field indicates the exact type of the completion.
72890 	 * By convention, the LSB identifies the length of the
72891 	 * record in 16B units. Even values indicate 16B
72892 	 * records. Odd values indicate 32B
72893 	 * records.
72894 	 */
72895 	#define CREQ_CREATE_SRQ_RESP_TYPE_MASK	UINT32_C(0x3f)
72896 	#define CREQ_CREATE_SRQ_RESP_TYPE_SFT	0
72897 	/* QP Async Notification */
72898 		#define CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
72899 		#define CREQ_CREATE_SRQ_RESP_TYPE_LAST	CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT
72900 	/* Status of the response. */
72901 	uint8_t	status;
72902 	/* Driver supplied handle to associate the command and the response. */
72903 	uint16_t	cookie;
72904 	/* SRQ context id */
72905 	uint32_t	xid;
72906 	uint8_t	v;
72907 	/*
72908 	 * This value is written by the NIC such that it will be different
72909 	 * for each pass through the completion queue. The even passes
72910 	 * will write 1. The odd passes will write 0.
72911 	 */
72912 	#define CREQ_CREATE_SRQ_RESP_V	UINT32_C(0x1)
72913 	/* Event or command opcode. */
72914 	uint8_t	event;
72915 	/* Create SRQ command response. */
72916 	#define CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ UINT32_C(0x5)
72917 	#define CREQ_CREATE_SRQ_RESP_EVENT_LAST	CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ
72918 	uint8_t	reserved48[6];
72919 } creq_create_srq_resp_t, *pcreq_create_srq_resp_t;
72920 
72921 /***************
72922  * destroy_srq *
72923  ***************/
72924 
72925 
72926 /* cmdq_destroy_srq (size:192b/24B) */
72927 
72928 typedef struct cmdq_destroy_srq {
72929 	/* Command opcode. */
72930 	uint8_t	opcode;
72931 	/* Destroy SRQ command deletes and flushes the specified SRQ. */
72932 	#define CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ UINT32_C(0x6)
72933 	#define CMDQ_DESTROY_SRQ_OPCODE_LAST	CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ
72934 	/* Size of the command in 16-byte units. */
72935 	uint8_t	cmd_size;
72936 	/* Flags and attribs of the command. */
72937 	uint16_t	flags;
72938 	/* Driver supplied handle to associate the command and the response. */
72939 	uint16_t	cookie;
72940 	/* Size of the response buffer in 16-byte units. */
72941 	uint8_t	resp_size;
72942 	uint8_t	reserved8;
72943 	/* Host address of the response. */
72944 	uint64_t	resp_addr;
72945 	/* SRQ context id */
72946 	uint32_t	srq_cid;
72947 	uint32_t	unused_0;
72948 } cmdq_destroy_srq_t, *pcmdq_destroy_srq_t;
72949 
72950 /* creq_destroy_srq_resp (size:128b/16B) */
72951 
72952 typedef struct creq_destroy_srq_resp {
72953 	uint8_t	type;
72954 	/*
72955 	 * This field indicates the exact type of the completion.
72956 	 * By convention, the LSB identifies the length of the
72957 	 * record in 16B units. Even values indicate 16B
72958 	 * records. Odd values indicate 32B
72959 	 * records.
72960 	 */
72961 	#define CREQ_DESTROY_SRQ_RESP_TYPE_MASK	UINT32_C(0x3f)
72962 	#define CREQ_DESTROY_SRQ_RESP_TYPE_SFT	0
72963 	/* QP Async Notification */
72964 		#define CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
72965 		#define CREQ_DESTROY_SRQ_RESP_TYPE_LAST	CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT
72966 	/* Status of the response. */
72967 	uint8_t	status;
72968 	/* Driver supplied handle to associate the command and the response. */
72969 	uint16_t	cookie;
72970 	/* SRQ context id */
72971 	uint32_t	xid;
72972 	uint8_t	v;
72973 	/*
72974 	 * This value is written by the NIC such that it will be different
72975 	 * for each pass through the completion queue. The even passes
72976 	 * will write 1. The odd passes will write 0.
72977 	 */
72978 	#define CREQ_DESTROY_SRQ_RESP_V	UINT32_C(0x1)
72979 	/* Event or command opcode. */
72980 	uint8_t	event;
72981 	/* Destroy SRQ command response. */
72982 	#define CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ UINT32_C(0x6)
72983 	#define CREQ_DESTROY_SRQ_RESP_EVENT_LAST	CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ
72984 	uint16_t	enable_for_arm[3];
72985 	#define CREQ_DESTROY_SRQ_RESP_UNUSED0_MASK	UINT32_C(0xffff)
72986 	#define CREQ_DESTROY_SRQ_RESP_UNUSED0_SFT	0
72987 	/*
72988 	 * Set to 1 if this SRQ is allowed to be armed for threshold async
72989 	 * event
72990 	 */
72991 	#define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_MASK UINT32_C(0x30000)
72992 	#define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_SFT 16
72993 } creq_destroy_srq_resp_t, *pcreq_destroy_srq_resp_t;
72994 
72995 /*************
72996  * query_srq *
72997  *************/
72998 
72999 
73000 /* cmdq_query_srq (size:192b/24B) */
73001 
73002 typedef struct cmdq_query_srq {
73003 	/* Command opcode. */
73004 	uint8_t	opcode;
73005 	/* Query SRP command retrieves info about the specified SRQ. */
73006 	#define CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ UINT32_C(0x8)
73007 	#define CMDQ_QUERY_SRQ_OPCODE_LAST	CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ
73008 	/* Size of the command in 16-byte units. */
73009 	uint8_t	cmd_size;
73010 	/* Flags and attribs of the command. */
73011 	uint16_t	flags;
73012 	/* Driver supplied handle to associate the command and the response. */
73013 	uint16_t	cookie;
73014 	/* Size of the response buffer in 16-byte units. */
73015 	uint8_t	resp_size;
73016 	uint8_t	reserved8;
73017 	/* Host address of the response. */
73018 	uint64_t	resp_addr;
73019 	/* SRQ context id */
73020 	uint32_t	srq_cid;
73021 	uint32_t	unused_0;
73022 } cmdq_query_srq_t, *pcmdq_query_srq_t;
73023 
73024 /* creq_query_srq_resp (size:128b/16B) */
73025 
73026 typedef struct creq_query_srq_resp {
73027 	uint8_t	type;
73028 	/*
73029 	 * This field indicates the exact type of the completion.
73030 	 * By convention, the LSB identifies the length of the
73031 	 * record in 16B units. Even values indicate 16B
73032 	 * records. Odd values indicate 32B
73033 	 * records.
73034 	 */
73035 	#define CREQ_QUERY_SRQ_RESP_TYPE_MASK	UINT32_C(0x3f)
73036 	#define CREQ_QUERY_SRQ_RESP_TYPE_SFT	0
73037 	/* QP Async Notification */
73038 		#define CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
73039 		#define CREQ_QUERY_SRQ_RESP_TYPE_LAST	CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT
73040 	/* Status of the response. */
73041 	uint8_t	status;
73042 	/* Driver supplied handle to associate the command and the response. */
73043 	uint16_t	cookie;
73044 	/* Side buffer size in 16-byte units */
73045 	uint32_t	size;
73046 	uint8_t	v;
73047 	/*
73048 	 * This value is written by the NIC such that it will be different
73049 	 * for each pass through the completion queue. The even passes
73050 	 * will write 1. The odd passes will write 0.
73051 	 */
73052 	#define CREQ_QUERY_SRQ_RESP_V	UINT32_C(0x1)
73053 	/* Event or command opcode. */
73054 	uint8_t	event;
73055 	/* Query SRQ command response. */
73056 	#define CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ UINT32_C(0x8)
73057 	#define CREQ_QUERY_SRQ_RESP_EVENT_LAST	CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ
73058 	uint8_t	reserved48[6];
73059 } creq_query_srq_resp_t, *pcreq_query_srq_resp_t;
73060 
73061 /* Query SRQ command response side buffer structure. */
73062 /* creq_query_srq_resp_sb (size:256b/32B) */
73063 
73064 typedef struct creq_query_srq_resp_sb {
73065 	/* Command opcode. */
73066 	uint8_t	opcode;
73067 	/* Query SRQ command response. */
73068 	#define CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ UINT32_C(0x8)
73069 	#define CREQ_QUERY_SRQ_RESP_SB_OPCODE_LAST	CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ
73070 	/* Status of the response. */
73071 	uint8_t	status;
73072 	/* Driver supplied handle to associate the command and the response. */
73073 	uint16_t	cookie;
73074 	/* Flags and attribs of the command. */
73075 	uint16_t	flags;
73076 	/* Size of the response buffer in 16-byte units. */
73077 	uint8_t	resp_size;
73078 	uint8_t	reserved8;
73079 	/* SRQ context id */
73080 	uint32_t	xid;
73081 	/* Watermark value to generate a SRQ limit event. */
73082 	uint16_t	srq_limit;
73083 	uint16_t	reserved16;
73084 	/* data is 128 b */
73085 	uint32_t	data[4];
73086 } creq_query_srq_resp_sb_t, *pcreq_query_srq_resp_sb_t;
73087 
73088 /*************
73089  * create_cq *
73090  *************/
73091 
73092 
73093 /* cmdq_create_cq (size:512b/64B) */
73094 
73095 typedef struct cmdq_create_cq {
73096 	/* Command opcode. */
73097 	uint8_t	opcode;
73098 	/* Create CQ command allocates a CQ with the specified parameters. */
73099 	#define CMDQ_CREATE_CQ_OPCODE_CREATE_CQ UINT32_C(0x9)
73100 	#define CMDQ_CREATE_CQ_OPCODE_LAST	CMDQ_CREATE_CQ_OPCODE_CREATE_CQ
73101 	/* Size of the command in 16-byte units. */
73102 	uint8_t	cmd_size;
73103 	/* Flags and attribs of the command. */
73104 	uint16_t	flags;
73105 	/*
73106 	 * When the HW Doorbell Drop Recovery feature is enabled,
73107 	 * HW can flag false CQ overflow when CQ consumer index
73108 	 * doorbells are dropped when there really wasn't any overflow.
73109 	 * The CQE values could have already been processed by the driver,
73110 	 * but HW doesn't know about this because of the doorbell drop.
73111 	 * To avoid false detection of CQ overflow events,
73112 	 * it is recommended that CQ overflow detection is disabled
73113 	 * by the driver when HW based doorbell recovery is enabled.
73114 	 */
73115 	#define CMDQ_CREATE_CQ_FLAGS_DISABLE_CQ_OVERFLOW_DETECTION	UINT32_C(0x1)
73116 	/* This CQ uses the steering tag specified in the command. */
73117 	#define CMDQ_CREATE_CQ_FLAGS_STEERING_TAG_VALID		UINT32_C(0x2)
73118 	/*
73119 	 * This CQ uses the infinite CQ mode.
73120 	 * In the infinite CQ mode, all CQEs are written to the same
73121 	 * address. Note that this mode implies a HW client is
73122 	 * handling each entry instantly and avoiding overwrites.
73123 	 * The following limitations apply when this mode is enabled:
73124 	 * -cq_size field must be 1
73125 	 * -disable_cq_overflow_detection flag must be true.
73126 	 * -the CQ will never be armed.
73127 	 * -the consumer index of CQ will never be changed
73128 	 */
73129 	#define CMDQ_CREATE_CQ_FLAGS_INFINITE_CQ_MODE		UINT32_C(0x4)
73130 	/*
73131 	 * This CQ uses coalescing data specified in the command.
73132 	 * This feature is not supported if infinite_cq_mode is also enabled.
73133 	 */
73134 	#define CMDQ_CREATE_CQ_FLAGS_COALESCING_VALID		UINT32_C(0x8)
73135 	/* Driver supplied handle to associate the command and the response. */
73136 	uint16_t	cookie;
73137 	/* Size of the response buffer in 16-byte units. */
73138 	uint8_t	resp_size;
73139 	uint8_t	reserved8;
73140 	/* Host address of the response. */
73141 	uint64_t	resp_addr;
73142 	/* CQ handle. */
73143 	uint64_t	cq_handle;
73144 	uint32_t	pg_size_lvl;
73145 	/* PBL indirect levels. */
73146 	#define CMDQ_CREATE_CQ_LVL_MASK	UINT32_C(0x3)
73147 	#define CMDQ_CREATE_CQ_LVL_SFT	0
73148 	/* PBL pointer is physical start address. */
73149 		#define CMDQ_CREATE_CQ_LVL_LVL_0	UINT32_C(0x0)
73150 	/* PBL pointer points to PTE table. */
73151 		#define CMDQ_CREATE_CQ_LVL_LVL_1	UINT32_C(0x1)
73152 	/*
73153 	 * PBL pointer points to PDE table with each entry pointing to PTE
73154 	 * tables.
73155 	 */
73156 		#define CMDQ_CREATE_CQ_LVL_LVL_2	UINT32_C(0x2)
73157 		#define CMDQ_CREATE_CQ_LVL_LAST	CMDQ_CREATE_CQ_LVL_LVL_2
73158 	/* page size. */
73159 	#define CMDQ_CREATE_CQ_PG_SIZE_MASK  UINT32_C(0x1c)
73160 	#define CMDQ_CREATE_CQ_PG_SIZE_SFT   2
73161 	/* 4KB. */
73162 		#define CMDQ_CREATE_CQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 2)
73163 	/* 8KB. */
73164 		#define CMDQ_CREATE_CQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 2)
73165 	/* 64KB. */
73166 		#define CMDQ_CREATE_CQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 2)
73167 	/* 2MB. */
73168 		#define CMDQ_CREATE_CQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 2)
73169 	/* 8MB. */
73170 		#define CMDQ_CREATE_CQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 2)
73171 	/* 1GB. */
73172 		#define CMDQ_CREATE_CQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 2)
73173 		#define CMDQ_CREATE_CQ_PG_SIZE_LAST   CMDQ_CREATE_CQ_PG_SIZE_PG_1G
73174 	/* unused27 is 27 b */
73175 	#define CMDQ_CREATE_CQ_UNUSED27_MASK UINT32_C(0xffffffe0)
73176 	#define CMDQ_CREATE_CQ_UNUSED27_SFT  5
73177 	uint32_t	cq_fco_cnq_id;
73178 	/* cnq_id is 12 b */
73179 	#define CMDQ_CREATE_CQ_CNQ_ID_MASK UINT32_C(0xfff)
73180 	#define CMDQ_CREATE_CQ_CNQ_ID_SFT 0
73181 	/* Offset of first CQE in the first Page, in 32 byte units */
73182 	#define CMDQ_CREATE_CQ_CQ_FCO_MASK UINT32_C(0xfffff000)
73183 	#define CMDQ_CREATE_CQ_CQ_FCO_SFT 12
73184 	/* Doorbell page index. */
73185 	uint32_t	dpi;
73186 	/* Max number of CQ wqes. */
73187 	uint32_t	cq_size;
73188 	/* CQ PBL physical address. */
73189 	uint64_t	pbl;
73190 	/* Steering tag to use for memory transactions. */
73191 	uint16_t	steering_tag;
73192 	uint8_t	reserved16[2];
73193 	uint32_t	coalescing;
73194 	/*
73195 	 * Buffer Max time before flushing buffer (units of 1us). This
73196 	 * specifies the maximum time before completion buffers are
73197 	 * flushed out to host memory even if the number of coalesced
73198 	 * buffers is less than the threshold. buf_maxtime is 9 bits.
73199 	 */
73200 	#define CMDQ_CREATE_CQ_BUF_MAXTIME_MASK	UINT32_C(0x1ff)
73201 	#define CMDQ_CREATE_CQ_BUF_MAXTIME_SFT	0
73202 	/*
73203 	 * This specifies the number of buffers coalesced before sending
73204 	 * to memory during normal operation. Buffer unit is 16B
73205 	 * completions. normal_maxbuf is 5 bits.
73206 	 */
73207 	#define CMDQ_CREATE_CQ_NORMAL_MAXBUF_MASK	UINT32_C(0x3e00)
73208 	#define CMDQ_CREATE_CQ_NORMAL_MAXBUF_SFT	9
73209 	/*
73210 	 * This specifies the number of buffers coalesced before sending
73211 	 * to memory when the interrupt is masked. Buffer unit is 16B
73212 	 * completions. during_maxbuf is 5 bits.
73213 	 */
73214 	#define CMDQ_CREATE_CQ_DURING_MAXBUF_MASK	UINT32_C(0x7c000)
73215 	#define CMDQ_CREATE_CQ_DURING_MAXBUF_SFT	14
73216 	/*
73217 	 * This field is used to enable ring for global idle mode interrupt
73218 	 * generation. This mode will generate a notification (interrupt)
73219 	 * if armed when only one completion has been generated if the chip
73220 	 * is globally idle as determined by the device.
73221 	 * enable_ring_idle_mode is 1 bit.
73222 	 */
73223 	#define CMDQ_CREATE_CQ_ENABLE_RING_IDLE_MODE	UINT32_C(0x80000)
73224 	/* unused12 is 12 b */
73225 	#define CMDQ_CREATE_CQ_UNUSED12_MASK		UINT32_C(0xfff00000)
73226 	#define CMDQ_CREATE_CQ_UNUSED12_SFT		20
73227 	/* reserved64 is 64 b */
73228 	uint64_t	reserved64;
73229 } cmdq_create_cq_t, *pcmdq_create_cq_t;
73230 
73231 /* creq_create_cq_resp (size:128b/16B) */
73232 
73233 typedef struct creq_create_cq_resp {
73234 	uint8_t	type;
73235 	/*
73236 	 * This field indicates the exact type of the completion.
73237 	 * By convention, the LSB identifies the length of the
73238 	 * record in 16B units. Even values indicate 16B
73239 	 * records. Odd values indicate 32B
73240 	 * records.
73241 	 */
73242 	#define CREQ_CREATE_CQ_RESP_TYPE_MASK	UINT32_C(0x3f)
73243 	#define CREQ_CREATE_CQ_RESP_TYPE_SFT	0
73244 	/* QP Async Notification */
73245 		#define CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
73246 		#define CREQ_CREATE_CQ_RESP_TYPE_LAST	CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT
73247 	/* Status of the response. */
73248 	uint8_t	status;
73249 	/* Driver supplied handle to associate the command and the response. */
73250 	uint16_t	cookie;
73251 	/* CQ context id */
73252 	uint32_t	xid;
73253 	uint8_t	v;
73254 	/*
73255 	 * This value is written by the NIC such that it will be different
73256 	 * for each pass through the completion queue. The even passes
73257 	 * will write 1. The odd passes will write 0.
73258 	 */
73259 	#define CREQ_CREATE_CQ_RESP_V	UINT32_C(0x1)
73260 	/* Event or command opcode. */
73261 	uint8_t	event;
73262 	/* Create CQ command response. */
73263 	#define CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ UINT32_C(0x9)
73264 	#define CREQ_CREATE_CQ_RESP_EVENT_LAST	CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ
73265 	uint8_t	reserved48[6];
73266 } creq_create_cq_resp_t, *pcreq_create_cq_resp_t;
73267 
73268 /**************
73269  * destroy_cq *
73270  **************/
73271 
73272 
73273 /* cmdq_destroy_cq (size:192b/24B) */
73274 
73275 typedef struct cmdq_destroy_cq {
73276 	/* Command opcode. */
73277 	uint8_t	opcode;
73278 	/* Destroy CQ command deletes and flushes the specified CQ. */
73279 	#define CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ UINT32_C(0xa)
73280 	#define CMDQ_DESTROY_CQ_OPCODE_LAST	CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ
73281 	/* Size of the command in 16-byte units. */
73282 	uint8_t	cmd_size;
73283 	/* Flags and attribs of the command. */
73284 	uint16_t	flags;
73285 	/* Driver supplied handle to associate the command and the response. */
73286 	uint16_t	cookie;
73287 	/* Size of the response buffer in 16-byte units. */
73288 	uint8_t	resp_size;
73289 	uint8_t	reserved8;
73290 	/* Host address of the response. */
73291 	uint64_t	resp_addr;
73292 	/* CQ context id */
73293 	uint32_t	cq_cid;
73294 	uint32_t	unused_0;
73295 } cmdq_destroy_cq_t, *pcmdq_destroy_cq_t;
73296 
73297 /* creq_destroy_cq_resp (size:128b/16B) */
73298 
73299 typedef struct creq_destroy_cq_resp {
73300 	uint8_t	type;
73301 	/*
73302 	 * This field indicates the exact type of the completion.
73303 	 * By convention, the LSB identifies the length of the
73304 	 * record in 16B units. Even values indicate 16B
73305 	 * records. Odd values indicate 32B
73306 	 * records.
73307 	 */
73308 	#define CREQ_DESTROY_CQ_RESP_TYPE_MASK	UINT32_C(0x3f)
73309 	#define CREQ_DESTROY_CQ_RESP_TYPE_SFT	0
73310 	/* QP Async Notification */
73311 		#define CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
73312 		#define CREQ_DESTROY_CQ_RESP_TYPE_LAST	CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT
73313 	/* Status of the response. */
73314 	uint8_t	status;
73315 	/* Driver supplied handle to associate the command and the response. */
73316 	uint16_t	cookie;
73317 	/* CQ context id */
73318 	uint32_t	xid;
73319 	uint8_t	v;
73320 	/*
73321 	 * This value is written by the NIC such that it will be different
73322 	 * for each pass through the completion queue. The even passes
73323 	 * will write 1. The odd passes will write 0.
73324 	 */
73325 	#define CREQ_DESTROY_CQ_RESP_V	UINT32_C(0x1)
73326 	/* Event or command opcode. */
73327 	uint8_t	event;
73328 	/* Destroy CQ command response. */
73329 	#define CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ UINT32_C(0xa)
73330 	#define CREQ_DESTROY_CQ_RESP_EVENT_LAST	CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ
73331 	uint16_t	cq_arm_lvl;
73332 	/*
73333 	 * CQ ARM Level:
73334 	 * 0 ? Not Armed
73335 	 * 1 ? Arm SE Only, Generate CNQE only for incoming Solicited Events
73336 	 * 2 ? Arm all, Generate CNQE for Rx and Tx
73337 	 */
73338 	#define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_MASK UINT32_C(0x3)
73339 	#define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_SFT 0
73340 	/*
73341 	 * The total number of CNQ events for the CQ, incremented on each CNQ
73342 	 * event for the CQ (including firmware-generated CQ error
73343 	 * notification).
73344 	 */
73345 	uint16_t	total_cnq_events;
73346 	uint16_t	reserved16;
73347 } creq_destroy_cq_resp_t, *pcreq_destroy_cq_resp_t;
73348 
73349 /*************
73350  * resize_cq *
73351  *************/
73352 
73353 
73354 /* cmdq_resize_cq (size:320b/40B) */
73355 
73356 typedef struct cmdq_resize_cq {
73357 	/* Command opcode. */
73358 	uint8_t	opcode;
73359 	/* Resize CQ command resizes the specified CQ. */
73360 	#define CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ UINT32_C(0xc)
73361 	#define CMDQ_RESIZE_CQ_OPCODE_LAST	CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ
73362 	/* Size of the command in 16-byte units. */
73363 	uint8_t	cmd_size;
73364 	/* Flags and attribs of the command. */
73365 	uint16_t	flags;
73366 	/* Driver supplied handle to associate the command and the response. */
73367 	uint16_t	cookie;
73368 	/* Size of the response buffer in 16-byte units. */
73369 	uint8_t	resp_size;
73370 	uint8_t	reserved8;
73371 	/* Host address of the response. */
73372 	uint64_t	resp_addr;
73373 	/* CQ context id */
73374 	uint32_t	cq_cid;
73375 	uint32_t	new_cq_size_pg_size_lvl;
73376 	/* PBL indirect levels. */
73377 	#define CMDQ_RESIZE_CQ_LVL_MASK	UINT32_C(0x3)
73378 	#define CMDQ_RESIZE_CQ_LVL_SFT	0
73379 	/* PBL pointer is physical start address. */
73380 		#define CMDQ_RESIZE_CQ_LVL_LVL_0	UINT32_C(0x0)
73381 	/* PBL pointer points to PTE table. */
73382 		#define CMDQ_RESIZE_CQ_LVL_LVL_1	UINT32_C(0x1)
73383 	/*
73384 	 * PBL pointer points to PDE table with each entry pointing to PTE
73385 	 * tables.
73386 	 */
73387 		#define CMDQ_RESIZE_CQ_LVL_LVL_2	UINT32_C(0x2)
73388 		#define CMDQ_RESIZE_CQ_LVL_LAST	CMDQ_RESIZE_CQ_LVL_LVL_2
73389 	/* page size. */
73390 	#define CMDQ_RESIZE_CQ_PG_SIZE_MASK	UINT32_C(0x1c)
73391 	#define CMDQ_RESIZE_CQ_PG_SIZE_SFT	2
73392 	/* 4KB. */
73393 		#define CMDQ_RESIZE_CQ_PG_SIZE_PG_4K	(UINT32_C(0x0) << 2)
73394 	/* 8KB. */
73395 		#define CMDQ_RESIZE_CQ_PG_SIZE_PG_8K	(UINT32_C(0x1) << 2)
73396 	/* 64KB. */
73397 		#define CMDQ_RESIZE_CQ_PG_SIZE_PG_64K	(UINT32_C(0x2) << 2)
73398 	/* 2MB. */
73399 		#define CMDQ_RESIZE_CQ_PG_SIZE_PG_2M	(UINT32_C(0x3) << 2)
73400 	/* 8MB. */
73401 		#define CMDQ_RESIZE_CQ_PG_SIZE_PG_8M	(UINT32_C(0x4) << 2)
73402 	/* 1GB. */
73403 		#define CMDQ_RESIZE_CQ_PG_SIZE_PG_1G	(UINT32_C(0x5) << 2)
73404 		#define CMDQ_RESIZE_CQ_PG_SIZE_LAST	CMDQ_RESIZE_CQ_PG_SIZE_PG_1G
73405 	/* New max number of CQ wqes. */
73406 	#define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_MASK UINT32_C(0x1fffffe0)
73407 	#define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_SFT 5
73408 	/* CQ PBL physical address. */
73409 	uint64_t	new_pbl;
73410 	/* Offset of first CQE in the first Page, in 32 byte units */
73411 	uint32_t	new_cq_fco;
73412 	uint32_t	unused_0;
73413 } cmdq_resize_cq_t, *pcmdq_resize_cq_t;
73414 
73415 /* creq_resize_cq_resp (size:128b/16B) */
73416 
73417 typedef struct creq_resize_cq_resp {
73418 	uint8_t	type;
73419 	/*
73420 	 * This field indicates the exact type of the completion.
73421 	 * By convention, the LSB identifies the length of the
73422 	 * record in 16B units. Even values indicate 16B
73423 	 * records. Odd values indicate 32B
73424 	 * records.
73425 	 */
73426 	#define CREQ_RESIZE_CQ_RESP_TYPE_MASK	UINT32_C(0x3f)
73427 	#define CREQ_RESIZE_CQ_RESP_TYPE_SFT	0
73428 	/* QP Async Notification */
73429 		#define CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
73430 		#define CREQ_RESIZE_CQ_RESP_TYPE_LAST	CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT
73431 	/* Status of the response. */
73432 	uint8_t	status;
73433 	/* Driver supplied handle to associate the command and the response. */
73434 	uint16_t	cookie;
73435 	/* CQ context id */
73436 	uint32_t	xid;
73437 	uint8_t	v;
73438 	/*
73439 	 * This value is written by the NIC such that it will be different
73440 	 * for each pass through the completion queue. The even passes
73441 	 * will write 1. The odd passes will write 0.
73442 	 */
73443 	#define CREQ_RESIZE_CQ_RESP_V	UINT32_C(0x1)
73444 	/* Event or command opcode. */
73445 	uint8_t	event;
73446 	/* Resize CQ command response. */
73447 	#define CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ UINT32_C(0xc)
73448 	#define CREQ_RESIZE_CQ_RESP_EVENT_LAST	CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ
73449 	uint8_t	reserved48[6];
73450 } creq_resize_cq_resp_t, *pcreq_resize_cq_resp_t;
73451 
73452 /*************
73453  * modify_cq *
73454  *************/
73455 
73456 
73457 /* cmdq_modify_cq (size:512b/64B) */
73458 
73459 typedef struct cmdq_modify_cq {
73460 	/* Command opcode. */
73461 	uint8_t	opcode;
73462 	/* Modify CQ updates specific params in the CQ context. */
73463 	#define CMDQ_MODIFY_CQ_OPCODE_MODIFY_CQ UINT32_C(0x90)
73464 	#define CMDQ_MODIFY_CQ_OPCODE_LAST	CMDQ_MODIFY_CQ_OPCODE_MODIFY_CQ
73465 	/* Size of the command in 16-byte units. */
73466 	uint8_t	cmd_size;
73467 	/* Flags and attribs of the command. */
73468 	uint16_t	flags;
73469 	/*
73470 	 * When the HW Doorbell Drop Recovery feature is enabled,
73471 	 * HW can flag false CQ overflow when CQ consumer index
73472 	 * doorbells are dropped when there really wasn't any overflow.
73473 	 * The CQE values could have already been processed by the driver,
73474 	 * but HW doesn't know about this because of the doorbell drop.
73475 	 * To avoid false detection of CQ overflow events,
73476 	 * it is recommended that CQ overflow detection is disabled
73477 	 * by the driver when HW based doorbell recovery is enabled.
73478 	 */
73479 	#define CMDQ_MODIFY_CQ_FLAGS_DISABLE_CQ_OVERFLOW_DETECTION	UINT32_C(0x1)
73480 	/* Driver supplied handle to associate the command and the response. */
73481 	uint16_t	cookie;
73482 	/* Size of the response buffer in 16-byte units. */
73483 	uint8_t	resp_size;
73484 	uint8_t	reserved8;
73485 	/* Host address of the response. */
73486 	uint64_t	resp_addr;
73487 	/* Modify mask signifies the field that is requesting the change. */
73488 	uint32_t	modify_mask;
73489 	/* Enable change. */
73490 	#define CMDQ_MODIFY_CQ_MODIFY_MASK_CQ_HANDLE	UINT32_C(0x1)
73491 	/* CNQ ID */
73492 	#define CMDQ_MODIFY_CQ_MODIFY_MASK_CNQ_ID	UINT32_C(0x2)
73493 	/* Offset of first CQE in the first page, in 32 byte units */
73494 	#define CMDQ_MODIFY_CQ_MODIFY_MASK_FCO	UINT32_C(0x4)
73495 	/* Doorbell page index */
73496 	#define CMDQ_MODIFY_CQ_MODIFY_MASK_DPI	UINT32_C(0x8)
73497 	/* Max number of CQ Wqes */
73498 	#define CMDQ_MODIFY_CQ_MODIFY_MASK_CQ_SIZE	UINT32_C(0x10)
73499 	/* CQ PBL physical address */
73500 	#define CMDQ_MODIFY_CQ_MODIFY_MASK_PBL	UINT32_C(0x20)
73501 	/* reserved32 is 32 b */
73502 	uint32_t	reserved32;
73503 	/* CQ handle. */
73504 	uint64_t	cq_handle;
73505 	uint32_t	cq_fco_cnq_id;
73506 	/* cnq_id is 12 b */
73507 	#define CMDQ_MODIFY_CQ_CNQ_ID_MASK UINT32_C(0xfff)
73508 	#define CMDQ_MODIFY_CQ_CNQ_ID_SFT 0
73509 	/* Offset of first CQE in the first Page, in 32 byte units */
73510 	#define CMDQ_MODIFY_CQ_CQ_FCO_MASK UINT32_C(0xfffff000)
73511 	#define CMDQ_MODIFY_CQ_CQ_FCO_SFT 12
73512 	/* Doorbell page index. */
73513 	uint32_t	dpi;
73514 	/* Max number of CQ wqes. */
73515 	uint32_t	cq_size;
73516 	/* reserved32_1 is 32 b */
73517 	uint32_t	reserved32_1;
73518 	/* CQ PBL physical address. */
73519 	uint64_t	pbl;
73520 	/* reserved64 is 64 b */
73521 	uint64_t	reserved64;
73522 } cmdq_modify_cq_t, *pcmdq_modify_cq_t;
73523 
73524 /* creq_modify_cq_resp (size:128b/16B) */
73525 
73526 typedef struct creq_modify_cq_resp {
73527 	uint8_t	type;
73528 	/*
73529 	 * This field indicates the exact type of the completion.
73530 	 * By convention, the LSB identifies the length of the
73531 	 * record in 16B units. Even values indicate 16B
73532 	 * records. Odd values indicate 32B
73533 	 * records.
73534 	 */
73535 	#define CREQ_MODIFY_CQ_RESP_TYPE_MASK	UINT32_C(0x3f)
73536 	#define CREQ_MODIFY_CQ_RESP_TYPE_SFT	0
73537 	/* QP Async Notification */
73538 		#define CREQ_MODIFY_CQ_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
73539 		#define CREQ_MODIFY_CQ_RESP_TYPE_LAST	CREQ_MODIFY_CQ_RESP_TYPE_QP_EVENT
73540 	/* Status of the response. */
73541 	uint8_t	status;
73542 	/* Driver supplied handle to associate the command and the response. */
73543 	uint16_t	cookie;
73544 	/* CQ context id */
73545 	uint32_t	xid;
73546 	uint8_t	v;
73547 	/*
73548 	 * This value is written by the NIC such that it will be different
73549 	 * for each pass through the completion queue. The even passes
73550 	 * will write 1. The odd passes will write 0.
73551 	 */
73552 	#define CREQ_MODIFY_CQ_RESP_V	UINT32_C(0x1)
73553 	/* Event or command opcode. */
73554 	uint8_t	event;
73555 	/* Modify CQ command response. */
73556 	#define CREQ_MODIFY_CQ_RESP_EVENT_MODIFY_CQ UINT32_C(0x9)
73557 	#define CREQ_MODIFY_CQ_RESP_EVENT_LAST	CREQ_MODIFY_CQ_RESP_EVENT_MODIFY_CQ
73558 	uint8_t	reserved48[6];
73559 } creq_modify_cq_resp_t, *pcreq_modify_cq_resp_t;
73560 
73561 /****************
73562  * allocate_mrw *
73563  ****************/
73564 
73565 
73566 /* cmdq_allocate_mrw (size:256b/32B) */
73567 
73568 typedef struct cmdq_allocate_mrw {
73569 	/* Command opcode. */
73570 	uint8_t	opcode;
73571 	/*
73572 	 * Allocate MRW command allocates a MR/MW with the specified
73573 	 * parameters and returns the region's L_KEY/R_KEY
73574 	 */
73575 	#define CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW UINT32_C(0xd)
73576 	#define CMDQ_ALLOCATE_MRW_OPCODE_LAST	CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW
73577 	/* Size of the command in 16-byte units. */
73578 	uint8_t	cmd_size;
73579 	/* Flags and attribs of the command. */
73580 	uint16_t	flags;
73581 	/* Driver supplied handle to associate the command and the response. */
73582 	uint16_t	cookie;
73583 	/* Size of the response buffer in 16-byte units. */
73584 	uint8_t	resp_size;
73585 	uint8_t	reserved8;
73586 	/* Host address of the response. */
73587 	uint64_t	resp_addr;
73588 	/* MRW handle. */
73589 	uint64_t	mrw_handle;
73590 	uint8_t	mrw_flags;
73591 	/* Allocate MRW flags. */
73592 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MASK	UINT32_C(0xf)
73593 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_SFT	0
73594 	/* Allocate Memory Region */
73595 		#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MR		UINT32_C(0x0)
73596 	/* Allocate Physical Memory Region */
73597 		#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR		UINT32_C(0x1)
73598 	/* Allocate Memory Window (type 1) */
73599 		#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1	UINT32_C(0x2)
73600 	/* Allocate Memory Window (type 2A) */
73601 		#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A	UINT32_C(0x3)
73602 	/* Allocate Memory Window (type 2B) */
73603 		#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B	UINT32_C(0x4)
73604 		#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_LAST	CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B
73605 	/*
73606 	 * This Memory Region / Memory Window uses the
73607 	 * steering tag specified in the command.
73608 	 */
73609 	#define CMDQ_ALLOCATE_MRW_STEERING_TAG_VALID	UINT32_C(0x10)
73610 	/* unused3 is 3 b */
73611 	#define CMDQ_ALLOCATE_MRW_UNUSED3_MASK	UINT32_C(0xe0)
73612 	#define CMDQ_ALLOCATE_MRW_UNUSED3_SFT		5
73613 	/* Access flags. */
73614 	uint8_t	access;
73615 	/* Consumer owns the key */
73616 	#define CMDQ_ALLOCATE_MRW_ACCESS_CONSUMER_OWNED_KEY	UINT32_C(0x20)
73617 	/* Steering tag to use for memory transactions. */
73618 	uint16_t	steering_tag;
73619 	/* Protection domain id. */
73620 	uint32_t	pd_id;
73621 } cmdq_allocate_mrw_t, *pcmdq_allocate_mrw_t;
73622 
73623 /* creq_allocate_mrw_resp (size:128b/16B) */
73624 
73625 typedef struct creq_allocate_mrw_resp {
73626 	uint8_t	type;
73627 	/*
73628 	 * This field indicates the exact type of the completion.
73629 	 * By convention, the LSB identifies the length of the
73630 	 * record in 16B units. Even values indicate 16B
73631 	 * records. Odd values indicate 32B
73632 	 * records.
73633 	 */
73634 	#define CREQ_ALLOCATE_MRW_RESP_TYPE_MASK	UINT32_C(0x3f)
73635 	#define CREQ_ALLOCATE_MRW_RESP_TYPE_SFT	0
73636 	/* QP Async Notification */
73637 		#define CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
73638 		#define CREQ_ALLOCATE_MRW_RESP_TYPE_LAST	CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT
73639 	/* Status of the response. */
73640 	uint8_t	status;
73641 	/* Driver supplied handle to associate the command and the response. */
73642 	uint16_t	cookie;
73643 	/* L_KEY for MR, R_KEY for MW */
73644 	uint32_t	xid;
73645 	uint8_t	v;
73646 	/*
73647 	 * This value is written by the NIC such that it will be different
73648 	 * for each pass through the completion queue. The even passes
73649 	 * will write 1. The odd passes will write 0.
73650 	 */
73651 	#define CREQ_ALLOCATE_MRW_RESP_V	UINT32_C(0x1)
73652 	/* Event or command opcode. */
73653 	uint8_t	event;
73654 	/* Allocate MRW command response. */
73655 	#define CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW UINT32_C(0xd)
73656 	#define CREQ_ALLOCATE_MRW_RESP_EVENT_LAST	CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW
73657 	uint8_t	reserved48[6];
73658 } creq_allocate_mrw_resp_t, *pcreq_allocate_mrw_resp_t;
73659 
73660 /******************
73661  * deallocate_key *
73662  ******************/
73663 
73664 
73665 /* cmdq_deallocate_key (size:192b/24B) */
73666 
73667 typedef struct cmdq_deallocate_key {
73668 	/* Command opcode. */
73669 	uint8_t	opcode;
73670 	/*
73671 	 * De-allocate key command frees a MR/MW entry associated with the
73672 	 * specified key.
73673 	 */
73674 	#define CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY UINT32_C(0xe)
73675 	#define CMDQ_DEALLOCATE_KEY_OPCODE_LAST	CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY
73676 	/* Size of the command in 16-byte units. */
73677 	uint8_t	cmd_size;
73678 	/* Flags and attribs of the command. */
73679 	uint16_t	flags;
73680 	/* Driver supplied handle to associate the command and the response. */
73681 	uint16_t	cookie;
73682 	/* Size of the response buffer in 16-byte units. */
73683 	uint8_t	resp_size;
73684 	uint8_t	reserved8;
73685 	/* Host address of the response. */
73686 	uint64_t	resp_addr;
73687 	uint8_t	mrw_flags;
73688 	/* Deallocate MRW flags. */
73689 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MASK	UINT32_C(0xf)
73690 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_SFT	0
73691 	/* Deallocate Memory Region */
73692 		#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MR	UINT32_C(0x0)
73693 	/* Deallocate Physical Memory Region */
73694 		#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_PMR	UINT32_C(0x1)
73695 	/* Deallocate Memory Window (type 1) */
73696 		#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE1   UINT32_C(0x2)
73697 	/* Deallocate Memory Window (type 2A) */
73698 		#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2A  UINT32_C(0x3)
73699 	/* Deallocate Memory Window (type 2B) */
73700 		#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B  UINT32_C(0x4)
73701 		#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_LAST	CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B
73702 	/* unused4 is 4 b */
73703 	#define CMDQ_DEALLOCATE_KEY_UNUSED4_MASK	UINT32_C(0xf0)
73704 	#define CMDQ_DEALLOCATE_KEY_UNUSED4_SFT	4
73705 	/* unused24 is 24 b */
73706 	uint8_t	unused24[3];
73707 	/* key is 32 b */
73708 	uint32_t	key;
73709 } cmdq_deallocate_key_t, *pcmdq_deallocate_key_t;
73710 
73711 /* creq_deallocate_key_resp (size:128b/16B) */
73712 
73713 typedef struct creq_deallocate_key_resp {
73714 	uint8_t	type;
73715 	/*
73716 	 * This field indicates the exact type of the completion.
73717 	 * By convention, the LSB identifies the length of the
73718 	 * record in 16B units. Even values indicate 16B
73719 	 * records. Odd values indicate 32B
73720 	 * records.
73721 	 */
73722 	#define CREQ_DEALLOCATE_KEY_RESP_TYPE_MASK	UINT32_C(0x3f)
73723 	#define CREQ_DEALLOCATE_KEY_RESP_TYPE_SFT	0
73724 	/* QP Async Notification */
73725 		#define CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
73726 		#define CREQ_DEALLOCATE_KEY_RESP_TYPE_LAST	CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT
73727 	/* Status of the response. */
73728 	uint8_t	status;
73729 	/* Driver supplied handle to associate the command and the response. */
73730 	uint16_t	cookie;
73731 	/* L_KEY for MR, R_KEY for MW */
73732 	uint32_t	xid;
73733 	uint8_t	v;
73734 	/*
73735 	 * This value is written by the NIC such that it will be different
73736 	 * for each pass through the completion queue. The even passes
73737 	 * will write 1. The odd passes will write 0.
73738 	 */
73739 	#define CREQ_DEALLOCATE_KEY_RESP_V	UINT32_C(0x1)
73740 	/* Event or command opcode. */
73741 	uint8_t	event;
73742 	/* De-allocate key command response. */
73743 	#define CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY UINT32_C(0xe)
73744 	#define CREQ_DEALLOCATE_KEY_RESP_EVENT_LAST	CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY
73745 	uint16_t	reserved16;
73746 	/*
73747 	 * This is advisory data to facilitate eventual destruction of
73748 	 * lingering memory regions in Windows. For memory window, it contains
73749 	 * non-zero HWID of a region this window was bound to (without the
73750 	 * 8-bit key portion). The host may check if the region is lingering in
73751 	 * destroyed state and try to destroy it now. For memory region, if
73752 	 * deallocation fails because there are windows bound to this region,
73753 	 * this field will contain approximate number of those windows. This
73754 	 * number is read from the context right before the deregistration is
73755 	 * attempted and can potentially be slightly different from the current
73756 	 * number.
73757 	 */
73758 	uint32_t	bound_window_info;
73759 } creq_deallocate_key_resp_t, *pcreq_deallocate_key_resp_t;
73760 
73761 /***************
73762  * register_mr *
73763  ***************/
73764 
73765 
73766 /* cmdq_register_mr (size:512b/64B) */
73767 
73768 typedef struct cmdq_register_mr {
73769 	/* Command opcode. */
73770 	uint8_t	opcode;
73771 	/* Register MR command registers memory to the specified MR. */
73772 	#define CMDQ_REGISTER_MR_OPCODE_REGISTER_MR UINT32_C(0xf)
73773 	#define CMDQ_REGISTER_MR_OPCODE_LAST	CMDQ_REGISTER_MR_OPCODE_REGISTER_MR
73774 	/* Size of the command in 16-byte units. */
73775 	uint8_t	cmd_size;
73776 	/* Flags and attribs of the command. */
73777 	uint16_t	flags;
73778 	/*
73779 	 * When set, a new MR will be allocated first and then registered
73780 	 * using the fields in this command. Note that for MR allocation
73781 	 * the `key` field doesn't hold a valid L_KEY and is instead
73782 	 * overloaded to hold the Protection Domain ID `pd_id`.
73783 	 */
73784 	#define CMDQ_REGISTER_MR_FLAGS_ALLOC_MR		UINT32_C(0x1)
73785 	/*
73786 	 * This MR uses the steering tag specified in the command.
73787 	 * This flag can only be enabled when the command is used
73788 	 * to allocate a new MR first.
73789 	 */
73790 	#define CMDQ_REGISTER_MR_FLAGS_STEERING_TAG_VALID	UINT32_C(0x2)
73791 	/* When set, enable per MR relaxed ordering support. */
73792 	#define CMDQ_REGISTER_MR_FLAGS_ENABLE_RO		UINT32_C(0x4)
73793 	/* Driver supplied handle to associate the command and the response. */
73794 	uint16_t	cookie;
73795 	/* Size of the response buffer in 16-byte units. */
73796 	uint8_t	resp_size;
73797 	uint8_t	reserved8;
73798 	/* Host address of the response. */
73799 	uint64_t	resp_addr;
73800 	uint8_t	log2_pg_size_lvl;
73801 	/* PBL indirect levels. */
73802 	#define CMDQ_REGISTER_MR_LVL_MASK		UINT32_C(0x3)
73803 	#define CMDQ_REGISTER_MR_LVL_SFT		0
73804 	/* PBL pointer is physical start address. */
73805 		#define CMDQ_REGISTER_MR_LVL_LVL_0		UINT32_C(0x0)
73806 	/* PBL pointer points to PTE table. */
73807 		#define CMDQ_REGISTER_MR_LVL_LVL_1		UINT32_C(0x1)
73808 	/*
73809 	 * PBL pointer points to PDE table with each entry pointing to PTE
73810 	 * tables.
73811 	 */
73812 		#define CMDQ_REGISTER_MR_LVL_LVL_2		UINT32_C(0x2)
73813 		#define CMDQ_REGISTER_MR_LVL_LAST		CMDQ_REGISTER_MR_LVL_LVL_2
73814 	/*
73815 	 * Log base 2 of page size; 12 is the minimum for 4KB. HW supported
73816 	 * values are enumerated below.
73817 	 */
73818 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_MASK   UINT32_C(0x7c)
73819 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_SFT	2
73820 	/* 4KB. */
73821 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4K	(UINT32_C(0xc) << 2)
73822 	/* 8KB. */
73823 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_8K	(UINT32_C(0xd) << 2)
73824 	/* 64KB. */
73825 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_64K   (UINT32_C(0x10) << 2)
73826 	/* 256KB. */
73827 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_256K  (UINT32_C(0x12) << 2)
73828 	/* 1MB. */
73829 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1M	(UINT32_C(0x14) << 2)
73830 	/* 2MB. */
73831 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_2M	(UINT32_C(0x15) << 2)
73832 	/* 4MB. */
73833 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4M	(UINT32_C(0x16) << 2)
73834 	/* 1GB. */
73835 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G	(UINT32_C(0x1e) << 2)
73836 		#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_LAST	CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G
73837 	/* unused1 is 1 b */
73838 	#define CMDQ_REGISTER_MR_UNUSED1		UINT32_C(0x80)
73839 	/* Access flags. */
73840 	uint8_t	access;
73841 	/* Local write access. */
73842 	#define CMDQ_REGISTER_MR_ACCESS_LOCAL_WRITE	UINT32_C(0x1)
73843 	/* Remote read access. */
73844 	#define CMDQ_REGISTER_MR_ACCESS_REMOTE_READ	UINT32_C(0x2)
73845 	/* Remote write access. */
73846 	#define CMDQ_REGISTER_MR_ACCESS_REMOTE_WRITE	UINT32_C(0x4)
73847 	/* Remote atomic access. */
73848 	#define CMDQ_REGISTER_MR_ACCESS_REMOTE_ATOMIC	UINT32_C(0x8)
73849 	/* Bind access allowed. */
73850 	#define CMDQ_REGISTER_MR_ACCESS_MW_BIND	UINT32_C(0x10)
73851 	/* Indicate Zero Based Virtual Address (ZBVA). */
73852 	#define CMDQ_REGISTER_MR_ACCESS_ZERO_BASED	UINT32_C(0x20)
73853 	uint16_t	log2_pbl_pg_size;
73854 	/*
73855 	 * Log base 2 of PBL page size; 12 is the minimum for 4KB. HW
73856 	 * supported values are enumerated below
73857 	 */
73858 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_MASK   UINT32_C(0x1f)
73859 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_SFT	0
73860 	/* 4KB. */
73861 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4K	UINT32_C(0xc)
73862 	/* 8KB. */
73863 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_8K	UINT32_C(0xd)
73864 	/* 64KB. */
73865 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_64K   UINT32_C(0x10)
73866 	/* 256KB. */
73867 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_256K  UINT32_C(0x12)
73868 	/* 1MB. */
73869 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1M	UINT32_C(0x14)
73870 	/* 2MB. */
73871 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_2M	UINT32_C(0x15)
73872 	/* 4MB. */
73873 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4M	UINT32_C(0x16)
73874 	/* 1GB. */
73875 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G	UINT32_C(0x1e)
73876 		#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_LAST	CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G
73877 	/* unused11 is 11 b */
73878 	#define CMDQ_REGISTER_MR_UNUSED11_MASK	UINT32_C(0xffe0)
73879 	#define CMDQ_REGISTER_MR_UNUSED11_SFT		5
73880 	/*
73881 	 * L_KEY of the previously allocated MR.
73882 	 *
73883 	 * If the `ALLOC_MR` flag is set then this field does not hold an
73884 	 * L_KEY and instead contains the Protection Domain ID `pd_id`.
73885 	 */
73886 	uint32_t	key;
73887 	/* Page table of the MR memory. */
73888 	uint64_t	pbl;
73889 	/* Virtual address of the MR. */
73890 	uint64_t	va;
73891 	/* Size of the MR. */
73892 	uint64_t	mr_size;
73893 	/* Steering tag to use for memory transactions. */
73894 	uint16_t	steering_tag;
73895 	uint8_t	reserved48[6];
73896 	/* reserved64 is 64 b */
73897 	uint64_t	reserved64;
73898 } cmdq_register_mr_t, *pcmdq_register_mr_t;
73899 
73900 /* creq_register_mr_resp (size:128b/16B) */
73901 
73902 typedef struct creq_register_mr_resp {
73903 	uint8_t	type;
73904 	/*
73905 	 * This field indicates the exact type of the completion.
73906 	 * By convention, the LSB identifies the length of the
73907 	 * record in 16B units. Even values indicate 16B
73908 	 * records. Odd values indicate 32B
73909 	 * records.
73910 	 */
73911 	#define CREQ_REGISTER_MR_RESP_TYPE_MASK	UINT32_C(0x3f)
73912 	#define CREQ_REGISTER_MR_RESP_TYPE_SFT	0
73913 	/* QP Async Notification */
73914 		#define CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
73915 		#define CREQ_REGISTER_MR_RESP_TYPE_LAST	CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT
73916 	/* Status of the response. */
73917 	uint8_t	status;
73918 	/* Driver supplied handle to associate the command and the response. */
73919 	uint16_t	cookie;
73920 	/* L_KEY */
73921 	uint32_t	xid;
73922 	uint8_t	v;
73923 	/*
73924 	 * This value is written by the NIC such that it will be different
73925 	 * for each pass through the completion queue. The even passes
73926 	 * will write 1. The odd passes will write 0.
73927 	 */
73928 	#define CREQ_REGISTER_MR_RESP_V	UINT32_C(0x1)
73929 	/* Event or command opcode. */
73930 	uint8_t	event;
73931 	/* Register MR command response. */
73932 	#define CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR UINT32_C(0xf)
73933 	#define CREQ_REGISTER_MR_RESP_EVENT_LAST	CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR
73934 	uint8_t	reserved48[6];
73935 } creq_register_mr_resp_t, *pcreq_register_mr_resp_t;
73936 
73937 /*****************
73938  * deregister_mr *
73939  *****************/
73940 
73941 
73942 /* cmdq_deregister_mr (size:192b/24B) */
73943 
73944 typedef struct cmdq_deregister_mr {
73945 	/* Command opcode. */
73946 	uint8_t	opcode;
73947 	/* Deregister MR command de-registers memory from the specified MR. */
73948 	#define CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR UINT32_C(0x10)
73949 	#define CMDQ_DEREGISTER_MR_OPCODE_LAST	CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR
73950 	/* Size of the command in 16-byte units. */
73951 	uint8_t	cmd_size;
73952 	/* Flags and attribs of the command. */
73953 	uint16_t	flags;
73954 	/* Driver supplied handle to associate the command and the response. */
73955 	uint16_t	cookie;
73956 	/* Size of the response buffer in 16-byte units. */
73957 	uint8_t	resp_size;
73958 	uint8_t	reserved8;
73959 	/* Host address of the response. */
73960 	uint64_t	resp_addr;
73961 	/* L_KEY of the MR. */
73962 	uint32_t	lkey;
73963 	uint32_t	unused_0;
73964 } cmdq_deregister_mr_t, *pcmdq_deregister_mr_t;
73965 
73966 /* creq_deregister_mr_resp (size:128b/16B) */
73967 
73968 typedef struct creq_deregister_mr_resp {
73969 	uint8_t	type;
73970 	/*
73971 	 * This field indicates the exact type of the completion.
73972 	 * By convention, the LSB identifies the length of the
73973 	 * record in 16B units. Even values indicate 16B
73974 	 * records. Odd values indicate 32B
73975 	 * records.
73976 	 */
73977 	#define CREQ_DEREGISTER_MR_RESP_TYPE_MASK	UINT32_C(0x3f)
73978 	#define CREQ_DEREGISTER_MR_RESP_TYPE_SFT	0
73979 	/* QP Async Notification */
73980 		#define CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
73981 		#define CREQ_DEREGISTER_MR_RESP_TYPE_LAST	CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT
73982 	/* Status of the response. */
73983 	uint8_t	status;
73984 	/* Driver supplied handle to associate the command and the response. */
73985 	uint16_t	cookie;
73986 	/* L_KEY */
73987 	uint32_t	xid;
73988 	uint8_t	v;
73989 	/*
73990 	 * This value is written by the NIC such that it will be different
73991 	 * for each pass through the completion queue. The even passes
73992 	 * will write 1. The odd passes will write 0.
73993 	 */
73994 	#define CREQ_DEREGISTER_MR_RESP_V	UINT32_C(0x1)
73995 	/* Event or command opcode. */
73996 	uint8_t	event;
73997 	/* Deregister MR command response. */
73998 	#define CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR UINT32_C(0x10)
73999 	#define CREQ_DEREGISTER_MR_RESP_EVENT_LAST	CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR
74000 	uint16_t	reserved16;
74001 	/*
74002 	 * If deregister fails because there are windows bound to this region,
74003 	 * this field will contain approximate number of those windows. This
74004 	 * number is read from the context right before the deregistration is
74005 	 * attempted and can potentially be slightly different from the current
74006 	 * number.
74007 	 */
74008 	uint32_t	bound_windows;
74009 } creq_deregister_mr_resp_t, *pcreq_deregister_mr_resp_t;
74010 
74011 /***********
74012  * add_gid *
74013  ***********/
74014 
74015 
74016 /* cmdq_add_gid (size:384b/48B) */
74017 
74018 typedef struct cmdq_add_gid {
74019 	/* Command opcode. */
74020 	uint8_t	opcode;
74021 	/* Add GID command adds a GID to the local address table. */
74022 	#define CMDQ_ADD_GID_OPCODE_ADD_GID UINT32_C(0x11)
74023 	#define CMDQ_ADD_GID_OPCODE_LAST   CMDQ_ADD_GID_OPCODE_ADD_GID
74024 	/* Size of the command in 16-byte units. */
74025 	uint8_t	cmd_size;
74026 	/* Flags and attribs of the command. */
74027 	uint16_t	flags;
74028 	/* Driver supplied handle to associate the command and the response. */
74029 	uint16_t	cookie;
74030 	/* Size of the response buffer in 16-byte units. */
74031 	uint8_t	resp_size;
74032 	uint8_t	reserved8;
74033 	/* Host address of the response. */
74034 	uint64_t	resp_addr;
74035 	/* GID, specified in LE format. */
74036 	uint32_t	gid[4];
74037 	/* Source MAC. */
74038 	uint16_t	src_mac[3];
74039 	/* flags. */
74040 	uint16_t	vlan;
74041 	#define CMDQ_ADD_GID_VLAN_VLAN_EN_TPID_VLAN_ID_MASK	UINT32_C(0xffff)
74042 	#define CMDQ_ADD_GID_VLAN_VLAN_EN_TPID_VLAN_ID_SFT	0
74043 	/* Source VLAN id. */
74044 	#define CMDQ_ADD_GID_VLAN_VLAN_ID_MASK			UINT32_C(0xfff)
74045 	#define CMDQ_ADD_GID_VLAN_VLAN_ID_SFT			0
74046 	/* This set of bits select the TPID of the VLAN Tag. */
74047 	#define CMDQ_ADD_GID_VLAN_TPID_MASK			UINT32_C(0x7000)
74048 	#define CMDQ_ADD_GID_VLAN_TPID_SFT			12
74049 	/* TPID = 0x88A8. */
74050 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_88A8			(UINT32_C(0x0) << 12)
74051 	/* TPID = 0x8100. */
74052 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_8100			(UINT32_C(0x1) << 12)
74053 	/* TPID = 0x9100. */
74054 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_9100			(UINT32_C(0x2) << 12)
74055 	/* TPID = 0x9200. */
74056 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_9200			(UINT32_C(0x3) << 12)
74057 	/* TPID = 0x9300. */
74058 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_9300			(UINT32_C(0x4) << 12)
74059 	/* TPID = Configurable 1. */
74060 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG1			(UINT32_C(0x5) << 12)
74061 	/* TPID = Configurable 2. */
74062 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG2			(UINT32_C(0x6) << 12)
74063 	/* TPID = Configurable 3. */
74064 		#define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3			(UINT32_C(0x7) << 12)
74065 		#define CMDQ_ADD_GID_VLAN_TPID_LAST			CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3
74066 	/*
74067 	 * Setting this bit to 1 enables insertion of a VLAN Tag to a RoCE
74068 	 * header.
74069 	 */
74070 	#define CMDQ_ADD_GID_VLAN_VLAN_EN				UINT32_C(0x8000)
74071 	/* Identifier field in the IP header. */
74072 	uint16_t	ipid;
74073 	/* Stats context ID to use with this SGID */
74074 	uint16_t	stats_ctx;
74075 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID_STATS_CTX_ID_MASK		UINT32_C(0xffff)
74076 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID_STATS_CTX_ID_SFT		0
74077 	/* stats_ctx_id is 15 b */
74078 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_MASK				UINT32_C(0x7fff)
74079 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_SFT				0
74080 	/*
74081 	 * Setting this bit to 1 enables use of own stats context ID
74082 	 * instead of per-function.
74083 	 */
74084 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID				UINT32_C(0x8000)
74085 	uint32_t	unused_0;
74086 } cmdq_add_gid_t, *pcmdq_add_gid_t;
74087 
74088 /* creq_add_gid_resp (size:128b/16B) */
74089 
74090 typedef struct creq_add_gid_resp {
74091 	uint8_t	type;
74092 	/*
74093 	 * This field indicates the exact type of the completion.
74094 	 * By convention, the LSB identifies the length of the
74095 	 * record in 16B units. Even values indicate 16B
74096 	 * records. Odd values indicate 32B
74097 	 * records.
74098 	 */
74099 	#define CREQ_ADD_GID_RESP_TYPE_MASK	UINT32_C(0x3f)
74100 	#define CREQ_ADD_GID_RESP_TYPE_SFT	0
74101 	/* QP Async Notification */
74102 		#define CREQ_ADD_GID_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
74103 		#define CREQ_ADD_GID_RESP_TYPE_LAST	CREQ_ADD_GID_RESP_TYPE_QP_EVENT
74104 	/* Status of the response. */
74105 	uint8_t	status;
74106 	/* Driver supplied handle to associate the command and the response. */
74107 	uint16_t	cookie;
74108 	/* GID index */
74109 	uint32_t	xid;
74110 	uint8_t	v;
74111 	/*
74112 	 * This value is written by the NIC such that it will be different
74113 	 * for each pass through the completion queue. The even passes
74114 	 * will write 1. The odd passes will write 0.
74115 	 */
74116 	#define CREQ_ADD_GID_RESP_V	UINT32_C(0x1)
74117 	/* Event or command opcode. */
74118 	uint8_t	event;
74119 	/* Add GID command response. */
74120 	#define CREQ_ADD_GID_RESP_EVENT_ADD_GID UINT32_C(0x11)
74121 	#define CREQ_ADD_GID_RESP_EVENT_LAST   CREQ_ADD_GID_RESP_EVENT_ADD_GID
74122 	uint8_t	reserved48[6];
74123 } creq_add_gid_resp_t, *pcreq_add_gid_resp_t;
74124 
74125 /**************
74126  * delete_gid *
74127  **************/
74128 
74129 
74130 /* cmdq_delete_gid (size:192b/24B) */
74131 
74132 typedef struct cmdq_delete_gid {
74133 	/* Command opcode. */
74134 	uint8_t	opcode;
74135 	/* Delete GID command deletes a GID from the local address table. */
74136 	#define CMDQ_DELETE_GID_OPCODE_DELETE_GID UINT32_C(0x12)
74137 	#define CMDQ_DELETE_GID_OPCODE_LAST	CMDQ_DELETE_GID_OPCODE_DELETE_GID
74138 	/* Size of the command in 16-byte units. */
74139 	uint8_t	cmd_size;
74140 	/* Flags and attribs of the command. */
74141 	uint16_t	flags;
74142 	/* Driver supplied handle to associate the command and the response. */
74143 	uint16_t	cookie;
74144 	/* Size of the response buffer in 16-byte units. */
74145 	uint8_t	resp_size;
74146 	uint8_t	reserved8;
74147 	/* Host address of the response. */
74148 	uint64_t	resp_addr;
74149 	/* GID index */
74150 	uint16_t	gid_index;
74151 	uint8_t	unused_0[6];
74152 } cmdq_delete_gid_t, *pcmdq_delete_gid_t;
74153 
74154 /* creq_delete_gid_resp (size:128b/16B) */
74155 
74156 typedef struct creq_delete_gid_resp {
74157 	uint8_t	type;
74158 	/*
74159 	 * This field indicates the exact type of the completion.
74160 	 * By convention, the LSB identifies the length of the
74161 	 * record in 16B units. Even values indicate 16B
74162 	 * records. Odd values indicate 32B
74163 	 * records.
74164 	 */
74165 	#define CREQ_DELETE_GID_RESP_TYPE_MASK	UINT32_C(0x3f)
74166 	#define CREQ_DELETE_GID_RESP_TYPE_SFT	0
74167 	/* QP Async Notification */
74168 		#define CREQ_DELETE_GID_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
74169 		#define CREQ_DELETE_GID_RESP_TYPE_LAST	CREQ_DELETE_GID_RESP_TYPE_QP_EVENT
74170 	/* Status of the response. */
74171 	uint8_t	status;
74172 	/* Driver supplied handle to associate the command and the response. */
74173 	uint16_t	cookie;
74174 	/* GID index */
74175 	uint32_t	xid;
74176 	uint8_t	v;
74177 	/*
74178 	 * This value is written by the NIC such that it will be different
74179 	 * for each pass through the completion queue. The even passes
74180 	 * will write 1. The odd passes will write 0.
74181 	 */
74182 	#define CREQ_DELETE_GID_RESP_V	UINT32_C(0x1)
74183 	/* Event or command opcode. */
74184 	uint8_t	event;
74185 	/* Delete GID command response. */
74186 	#define CREQ_DELETE_GID_RESP_EVENT_DELETE_GID UINT32_C(0x12)
74187 	#define CREQ_DELETE_GID_RESP_EVENT_LAST	CREQ_DELETE_GID_RESP_EVENT_DELETE_GID
74188 	uint8_t	reserved48[6];
74189 } creq_delete_gid_resp_t, *pcreq_delete_gid_resp_t;
74190 
74191 /**************
74192  * modify_gid *
74193  **************/
74194 
74195 
74196 /* cmdq_modify_gid (size:384b/48B) */
74197 
74198 typedef struct cmdq_modify_gid {
74199 	/* Command opcode. */
74200 	uint8_t	opcode;
74201 	/* Modify GID command modifies a GID in the local address table. */
74202 	#define CMDQ_MODIFY_GID_OPCODE_MODIFY_GID UINT32_C(0x17)
74203 	#define CMDQ_MODIFY_GID_OPCODE_LAST	CMDQ_MODIFY_GID_OPCODE_MODIFY_GID
74204 	/* Size of the command in 16-byte units. */
74205 	uint8_t	cmd_size;
74206 	/* Flags and attribs of the command. */
74207 	uint16_t	flags;
74208 	/* Driver supplied handle to associate the command and the response. */
74209 	uint16_t	cookie;
74210 	/* Size of the response buffer in 16-byte units. */
74211 	uint8_t	resp_size;
74212 	uint8_t	reserved8;
74213 	/* Host address of the response. */
74214 	uint64_t	resp_addr;
74215 	/* GID */
74216 	uint32_t	gid[4];
74217 	/* Source MAC. */
74218 	uint16_t	src_mac[3];
74219 	/* flags. */
74220 	uint16_t	vlan;
74221 	/* Source VLAN id. */
74222 	#define CMDQ_MODIFY_GID_VLAN_VLAN_ID_MASK  UINT32_C(0xfff)
74223 	#define CMDQ_MODIFY_GID_VLAN_VLAN_ID_SFT   0
74224 	/* This set of bits select the TPID of the VLAN Tag. */
74225 	#define CMDQ_MODIFY_GID_VLAN_TPID_MASK	UINT32_C(0x7000)
74226 	#define CMDQ_MODIFY_GID_VLAN_TPID_SFT	12
74227 	/* TPID = 0x88A8. */
74228 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_88A8  (UINT32_C(0x0) << 12)
74229 	/* TPID = 0x8100. */
74230 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_8100  (UINT32_C(0x1) << 12)
74231 	/* TPID = 0x9100. */
74232 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9100  (UINT32_C(0x2) << 12)
74233 	/* TPID = 0x9200. */
74234 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9200  (UINT32_C(0x3) << 12)
74235 	/* TPID = 0x9300. */
74236 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9300  (UINT32_C(0x4) << 12)
74237 	/* TPID = Configurable 1. */
74238 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG1  (UINT32_C(0x5) << 12)
74239 	/* TPID = Configurable 2. */
74240 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG2  (UINT32_C(0x6) << 12)
74241 	/* TPID = Configurable 3. */
74242 		#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3  (UINT32_C(0x7) << 12)
74243 		#define CMDQ_MODIFY_GID_VLAN_TPID_LAST	CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3
74244 	/*
74245 	 * Setting this bit to 1 enables insertion of a VLAN Tag to a RoCE
74246 	 * header.
74247 	 */
74248 	#define CMDQ_MODIFY_GID_VLAN_VLAN_EN	UINT32_C(0x8000)
74249 	/* Identifier field in the IP header. */
74250 	uint16_t	ipid;
74251 	/* GID index */
74252 	uint16_t	gid_index;
74253 	/* Stats context ID to use with this SGID */
74254 	uint16_t	stats_ctx;
74255 	/* stats_ctx_id is 15 b */
74256 	#define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_MASK   UINT32_C(0x7fff)
74257 	#define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_SFT	0
74258 	/*
74259 	 * Setting this bit to 1 enables use of own stats context ID
74260 	 * instead of per-function.
74261 	 */
74262 	#define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_VALID	UINT32_C(0x8000)
74263 	uint16_t	unused_0;
74264 } cmdq_modify_gid_t, *pcmdq_modify_gid_t;
74265 
74266 /* creq_modify_gid_resp (size:128b/16B) */
74267 
74268 typedef struct creq_modify_gid_resp {
74269 	uint8_t	type;
74270 	/*
74271 	 * This field indicates the exact type of the completion.
74272 	 * By convention, the LSB identifies the length of the
74273 	 * record in 16B units. Even values indicate 16B
74274 	 * records. Odd values indicate 32B
74275 	 * records.
74276 	 */
74277 	#define CREQ_MODIFY_GID_RESP_TYPE_MASK	UINT32_C(0x3f)
74278 	#define CREQ_MODIFY_GID_RESP_TYPE_SFT	0
74279 	/* QP Async Notification */
74280 		#define CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
74281 		#define CREQ_MODIFY_GID_RESP_TYPE_LAST	CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT
74282 	/* Status of the response. */
74283 	uint8_t	status;
74284 	/* Driver supplied handle to associate the command and the response. */
74285 	uint16_t	cookie;
74286 	/* GID index */
74287 	uint32_t	xid;
74288 	uint8_t	v;
74289 	/*
74290 	 * This value is written by the NIC such that it will be different
74291 	 * for each pass through the completion queue. The even passes
74292 	 * will write 1. The odd passes will write 0.
74293 	 */
74294 	#define CREQ_MODIFY_GID_RESP_V	UINT32_C(0x1)
74295 	/* Event or command opcode. */
74296 	uint8_t	event;
74297 	/* Add GID command response. */
74298 	#define CREQ_MODIFY_GID_RESP_EVENT_ADD_GID UINT32_C(0x11)
74299 	#define CREQ_MODIFY_GID_RESP_EVENT_LAST   CREQ_MODIFY_GID_RESP_EVENT_ADD_GID
74300 	uint8_t	reserved48[6];
74301 } creq_modify_gid_resp_t, *pcreq_modify_gid_resp_t;
74302 
74303 /*************
74304  * query_gid *
74305  *************/
74306 
74307 
74308 /* cmdq_query_gid (size:192b/24B) */
74309 
74310 typedef struct cmdq_query_gid {
74311 	/* Command opcode. */
74312 	uint8_t	opcode;
74313 	/* Query GID command queries a GID in the local address table. */
74314 	#define CMDQ_QUERY_GID_OPCODE_QUERY_GID UINT32_C(0x18)
74315 	#define CMDQ_QUERY_GID_OPCODE_LAST	CMDQ_QUERY_GID_OPCODE_QUERY_GID
74316 	/* Size of the command in 16-byte units. */
74317 	uint8_t	cmd_size;
74318 	/* Flags and attribs of the command. */
74319 	uint16_t	flags;
74320 	/* Driver supplied handle to associate the command and the response. */
74321 	uint16_t	cookie;
74322 	/* Size of the response buffer in 16-byte units. */
74323 	uint8_t	resp_size;
74324 	uint8_t	reserved8;
74325 	/* Host address of the response. */
74326 	uint64_t	resp_addr;
74327 	/* GID index */
74328 	uint16_t	gid_index;
74329 	/* unused16 is 16 b */
74330 	uint8_t	unused16[6];
74331 } cmdq_query_gid_t, *pcmdq_query_gid_t;
74332 
74333 /* creq_query_gid_resp (size:128b/16B) */
74334 
74335 typedef struct creq_query_gid_resp {
74336 	uint8_t	type;
74337 	/*
74338 	 * This field indicates the exact type of the completion.
74339 	 * By convention, the LSB identifies the length of the
74340 	 * record in 16B units. Even values indicate 16B
74341 	 * records. Odd values indicate 32B
74342 	 * records.
74343 	 */
74344 	#define CREQ_QUERY_GID_RESP_TYPE_MASK	UINT32_C(0x3f)
74345 	#define CREQ_QUERY_GID_RESP_TYPE_SFT	0
74346 	/* QP Async Notification */
74347 		#define CREQ_QUERY_GID_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
74348 		#define CREQ_QUERY_GID_RESP_TYPE_LAST	CREQ_QUERY_GID_RESP_TYPE_QP_EVENT
74349 	/* Status of the response. */
74350 	uint8_t	status;
74351 	/* Driver supplied handle to associate the command and the response. */
74352 	uint16_t	cookie;
74353 	/* Side buffer size in 16-byte units */
74354 	uint32_t	size;
74355 	uint8_t	v;
74356 	/*
74357 	 * This value is written by the NIC such that it will be different
74358 	 * for each pass through the completion queue. The even passes
74359 	 * will write 1. The odd passes will write 0.
74360 	 */
74361 	#define CREQ_QUERY_GID_RESP_V	UINT32_C(0x1)
74362 	/* Event or command opcode. */
74363 	uint8_t	event;
74364 	/* Query GID command response. */
74365 	#define CREQ_QUERY_GID_RESP_EVENT_QUERY_GID UINT32_C(0x18)
74366 	#define CREQ_QUERY_GID_RESP_EVENT_LAST	CREQ_QUERY_GID_RESP_EVENT_QUERY_GID
74367 	uint8_t	reserved48[6];
74368 } creq_query_gid_resp_t, *pcreq_query_gid_resp_t;
74369 
74370 /* Query GID command response side buffer structure */
74371 /* creq_query_gid_resp_sb (size:320b/40B) */
74372 
74373 typedef struct creq_query_gid_resp_sb {
74374 	/* Command opcode. */
74375 	uint8_t	opcode;
74376 	/* Query GID command response. */
74377 	#define CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID UINT32_C(0x18)
74378 	#define CREQ_QUERY_GID_RESP_SB_OPCODE_LAST	CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID
74379 	/* Status of the response. */
74380 	uint8_t	status;
74381 	/* Driver supplied handle to associate the command and the response. */
74382 	uint16_t	cookie;
74383 	/* Flags and attribs of the command. */
74384 	uint16_t	flags;
74385 	/* Size of the response buffer in 16-byte units. */
74386 	uint8_t	resp_size;
74387 	uint8_t	reserved8;
74388 	/* GID */
74389 	uint32_t	gid[4];
74390 	/* Source MAC. */
74391 	uint16_t	src_mac[3];
74392 	/* flags. */
74393 	uint16_t	vlan;
74394 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN_TPID_VLAN_ID_MASK	UINT32_C(0xffff)
74395 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN_TPID_VLAN_ID_SFT	0
74396 	/* Source VLAN id. */
74397 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_MASK			UINT32_C(0xfff)
74398 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_SFT			0
74399 	/* This set of bits select the TPID of the VLAN Tag. */
74400 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_MASK			UINT32_C(0x7000)
74401 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_SFT			12
74402 	/* TPID = 0x88A8. */
74403 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_88A8			(UINT32_C(0x0) << 12)
74404 	/* TPID = 0x8100. */
74405 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_8100			(UINT32_C(0x1) << 12)
74406 	/* TPID = 0x9100. */
74407 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9100			(UINT32_C(0x2) << 12)
74408 	/* TPID = 0x9200. */
74409 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9200			(UINT32_C(0x3) << 12)
74410 	/* TPID = 0x9300. */
74411 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9300			(UINT32_C(0x4) << 12)
74412 	/* TPID = Configurable 1. */
74413 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG1			(UINT32_C(0x5) << 12)
74414 	/* TPID = Configurable 2. */
74415 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG2			(UINT32_C(0x6) << 12)
74416 	/* TPID = Configurable 3. */
74417 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3			(UINT32_C(0x7) << 12)
74418 		#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_LAST			CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3
74419 	/*
74420 	 * Setting this bit to 1 enables insertion of a VLAN Tag to a RoCE
74421 	 * header.
74422 	 */
74423 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN				UINT32_C(0x8000)
74424 	/* Identifier field in the IP header. */
74425 	uint16_t	ipid;
74426 	/* GID index */
74427 	uint16_t	gid_index;
74428 	uint32_t	unused_0;
74429 } creq_query_gid_resp_sb_t, *pcreq_query_gid_resp_sb_t;
74430 
74431 /**************
74432  * create_qp1 *
74433  **************/
74434 
74435 
74436 /* cmdq_create_qp1 (size:640b/80B) */
74437 
74438 typedef struct cmdq_create_qp1 {
74439 	/* Command opcode. */
74440 	uint8_t	opcode;
74441 	/* Create QP1 command allocates a QP1 only. */
74442 	#define CMDQ_CREATE_QP1_OPCODE_CREATE_QP1 UINT32_C(0x13)
74443 	#define CMDQ_CREATE_QP1_OPCODE_LAST	CMDQ_CREATE_QP1_OPCODE_CREATE_QP1
74444 	/* Size of the command in 16-byte units. */
74445 	uint8_t	cmd_size;
74446 	/* Flags and attribs of the command. */
74447 	uint16_t	flags;
74448 	/* Driver supplied handle to associate the command and the response. */
74449 	uint16_t	cookie;
74450 	/* Size of the response buffer in 16-byte units. */
74451 	uint8_t	resp_size;
74452 	uint8_t	reserved8;
74453 	/* Host address of the response. */
74454 	uint64_t	resp_addr;
74455 	/* QP1 handle. */
74456 	uint64_t	qp_handle;
74457 	/* Create QP1 flags. */
74458 	uint32_t	qp_flags;
74459 	/* SRQ is used. */
74460 	#define CMDQ_CREATE_QP1_QP_FLAGS_SRQ_USED		UINT32_C(0x1)
74461 	/* post CQE for all SQ WQEs. */
74462 	#define CMDQ_CREATE_QP1_QP_FLAGS_FORCE_COMPLETION	UINT32_C(0x2)
74463 	/* This QP can use reserved L_Key */
74464 	#define CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE UINT32_C(0x4)
74465 	#define CMDQ_CREATE_QP1_QP_FLAGS_LAST		CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE
74466 	/* Supported QP1 types. */
74467 	uint8_t	type;
74468 	/* General Services Interface on QP 1. */
74469 	#define CMDQ_CREATE_QP1_TYPE_GSI UINT32_C(0x1)
74470 	#define CMDQ_CREATE_QP1_TYPE_LAST CMDQ_CREATE_QP1_TYPE_GSI
74471 	uint8_t	sq_pg_size_sq_lvl;
74472 	/* SQ PBL indirect levels. */
74473 	#define CMDQ_CREATE_QP1_SQ_LVL_MASK	UINT32_C(0xf)
74474 	#define CMDQ_CREATE_QP1_SQ_LVL_SFT	0
74475 	/* PBL pointer is physical start address. */
74476 		#define CMDQ_CREATE_QP1_SQ_LVL_LVL_0	UINT32_C(0x0)
74477 	/* PBL pointer points to PTE table. */
74478 		#define CMDQ_CREATE_QP1_SQ_LVL_LVL_1	UINT32_C(0x1)
74479 	/*
74480 	 * PBL pointer points to PDE table with each entry pointing to PTE
74481 	 * tables.
74482 	 */
74483 		#define CMDQ_CREATE_QP1_SQ_LVL_LVL_2	UINT32_C(0x2)
74484 		#define CMDQ_CREATE_QP1_SQ_LVL_LAST	CMDQ_CREATE_QP1_SQ_LVL_LVL_2
74485 	/* SQ page size. */
74486 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_MASK  UINT32_C(0xf0)
74487 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_SFT   4
74488 	/* 4KB. */
74489 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
74490 	/* 8KB. */
74491 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
74492 	/* 64KB. */
74493 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
74494 	/* 2MB. */
74495 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
74496 	/* 8MB. */
74497 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
74498 	/* 1GB. */
74499 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
74500 		#define CMDQ_CREATE_QP1_SQ_PG_SIZE_LAST   CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G
74501 	uint8_t	rq_pg_size_rq_lvl;
74502 	/* RQ PBL indirect levels. */
74503 	#define CMDQ_CREATE_QP1_RQ_LVL_MASK	UINT32_C(0xf)
74504 	#define CMDQ_CREATE_QP1_RQ_LVL_SFT	0
74505 	/* PBL pointer is physical start address. */
74506 		#define CMDQ_CREATE_QP1_RQ_LVL_LVL_0	UINT32_C(0x0)
74507 	/* PBL pointer points to PTE table. */
74508 		#define CMDQ_CREATE_QP1_RQ_LVL_LVL_1	UINT32_C(0x1)
74509 	/*
74510 	 * PBL pointer points to PDE table with each entry pointing to PTE
74511 	 * tables.
74512 	 */
74513 		#define CMDQ_CREATE_QP1_RQ_LVL_LVL_2	UINT32_C(0x2)
74514 		#define CMDQ_CREATE_QP1_RQ_LVL_LAST	CMDQ_CREATE_QP1_RQ_LVL_LVL_2
74515 	/* RQ page size. */
74516 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_MASK  UINT32_C(0xf0)
74517 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_SFT   4
74518 	/* 4KB. */
74519 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_4K   (UINT32_C(0x0) << 4)
74520 	/* 8KB. */
74521 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8K   (UINT32_C(0x1) << 4)
74522 	/* 64KB. */
74523 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_64K  (UINT32_C(0x2) << 4)
74524 	/* 2MB. */
74525 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_2M   (UINT32_C(0x3) << 4)
74526 	/* 8MB. */
74527 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8M   (UINT32_C(0x4) << 4)
74528 	/* 1GB. */
74529 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G   (UINT32_C(0x5) << 4)
74530 		#define CMDQ_CREATE_QP1_RQ_PG_SIZE_LAST   CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G
74531 	uint8_t	unused_0;
74532 	/* Doorbell page index. */
74533 	uint32_t	dpi;
74534 	/* Max number of SQ wqes. */
74535 	uint32_t	sq_size;
74536 	/* Max number of RQ wqes. */
74537 	uint32_t	rq_size;
74538 	uint16_t	sq_fwo_sq_sge;
74539 	/* Max send SGEs per SWQE. */
74540 	#define CMDQ_CREATE_QP1_SQ_SGE_MASK UINT32_C(0xf)
74541 	#define CMDQ_CREATE_QP1_SQ_SGE_SFT 0
74542 	/* Offset of First WQE in the first SQ page, in 128 byte units */
74543 	#define CMDQ_CREATE_QP1_SQ_FWO_MASK UINT32_C(0xfff0)
74544 	#define CMDQ_CREATE_QP1_SQ_FWO_SFT 4
74545 	uint16_t	rq_fwo_rq_sge;
74546 	/* Max recv SGEs per RWQE (NOT SUPPORTED BY HARDWARE). */
74547 	#define CMDQ_CREATE_QP1_RQ_SGE_MASK UINT32_C(0xf)
74548 	#define CMDQ_CREATE_QP1_RQ_SGE_SFT 0
74549 	/* Offset of First WQE in the first RQ page, in 128 byte units */
74550 	#define CMDQ_CREATE_QP1_RQ_FWO_MASK UINT32_C(0xfff0)
74551 	#define CMDQ_CREATE_QP1_RQ_FWO_SFT 4
74552 	/* Send CQ context id. */
74553 	uint32_t	scq_cid;
74554 	/* Receive CQ context id. */
74555 	uint32_t	rcq_cid;
74556 	/* SRQ CQ context id. */
74557 	uint32_t	srq_cid;
74558 	/* Protection domain id. */
74559 	uint32_t	pd_id;
74560 	/* SQ PBL physical address. */
74561 	uint64_t	sq_pbl;
74562 	/* RQ PBL physical address. */
74563 	uint64_t	rq_pbl;
74564 } cmdq_create_qp1_t, *pcmdq_create_qp1_t;
74565 
74566 /* creq_create_qp1_resp (size:128b/16B) */
74567 
74568 typedef struct creq_create_qp1_resp {
74569 	uint8_t	type;
74570 	/*
74571 	 * This field indicates the exact type of the completion.
74572 	 * By convention, the LSB identifies the length of the
74573 	 * record in 16B units. Even values indicate 16B
74574 	 * records. Odd values indicate 32B
74575 	 * records.
74576 	 */
74577 	#define CREQ_CREATE_QP1_RESP_TYPE_MASK	UINT32_C(0x3f)
74578 	#define CREQ_CREATE_QP1_RESP_TYPE_SFT	0
74579 	/* QP Async Notification */
74580 		#define CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
74581 		#define CREQ_CREATE_QP1_RESP_TYPE_LAST	CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT
74582 	/* Status of the response. */
74583 	uint8_t	status;
74584 	/* Driver supplied handle to associate the command and the response. */
74585 	uint16_t	cookie;
74586 	/* QP1 context id */
74587 	uint32_t	xid;
74588 	uint8_t	v;
74589 	/*
74590 	 * This value is written by the NIC such that it will be different
74591 	 * for each pass through the completion queue. The even passes
74592 	 * will write 1. The odd passes will write 0.
74593 	 */
74594 	#define CREQ_CREATE_QP1_RESP_V	UINT32_C(0x1)
74595 	/* Event or command opcode. */
74596 	uint8_t	event;
74597 	/* Create QP1 command response. */
74598 	#define CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1 UINT32_C(0x13)
74599 	#define CREQ_CREATE_QP1_RESP_EVENT_LAST	CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1
74600 	uint8_t	reserved48[6];
74601 } creq_create_qp1_resp_t, *pcreq_create_qp1_resp_t;
74602 
74603 /***************
74604  * destroy_qp1 *
74605  ***************/
74606 
74607 
74608 /* cmdq_destroy_qp1 (size:192b/24B) */
74609 
74610 typedef struct cmdq_destroy_qp1 {
74611 	/* Command opcode. */
74612 	uint8_t	opcode;
74613 	/* Destroy QP1 command deletes and flushes the specified QP1. */
74614 	#define CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1 UINT32_C(0x14)
74615 	#define CMDQ_DESTROY_QP1_OPCODE_LAST	CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1
74616 	/* Size of the command in 16-byte units. */
74617 	uint8_t	cmd_size;
74618 	/* Flags and attribs of the command. */
74619 	uint16_t	flags;
74620 	/* Driver supplied handle to associate the command and the response. */
74621 	uint16_t	cookie;
74622 	/* Size of the response buffer in 16-byte units. */
74623 	uint8_t	resp_size;
74624 	uint8_t	reserved8;
74625 	/* Host address of the response. */
74626 	uint64_t	resp_addr;
74627 	/* QP1 context id */
74628 	uint32_t	qp1_cid;
74629 	uint32_t	unused_0;
74630 } cmdq_destroy_qp1_t, *pcmdq_destroy_qp1_t;
74631 
74632 /* creq_destroy_qp1_resp (size:128b/16B) */
74633 
74634 typedef struct creq_destroy_qp1_resp {
74635 	uint8_t	type;
74636 	/*
74637 	 * This field indicates the exact type of the completion.
74638 	 * By convention, the LSB identifies the length of the
74639 	 * record in 16B units. Even values indicate 16B
74640 	 * records. Odd values indicate 32B
74641 	 * records.
74642 	 */
74643 	#define CREQ_DESTROY_QP1_RESP_TYPE_MASK	UINT32_C(0x3f)
74644 	#define CREQ_DESTROY_QP1_RESP_TYPE_SFT	0
74645 	/* QP Async Notification */
74646 		#define CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
74647 		#define CREQ_DESTROY_QP1_RESP_TYPE_LAST	CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT
74648 	/* Status of the response. */
74649 	uint8_t	status;
74650 	/* Driver supplied handle to associate the command and the response. */
74651 	uint16_t	cookie;
74652 	/* QP1 context id */
74653 	uint32_t	xid;
74654 	uint8_t	v;
74655 	/*
74656 	 * This value is written by the NIC such that it will be different
74657 	 * for each pass through the completion queue. The even passes
74658 	 * will write 1. The odd passes will write 0.
74659 	 */
74660 	#define CREQ_DESTROY_QP1_RESP_V	UINT32_C(0x1)
74661 	/* Event or command opcode. */
74662 	uint8_t	event;
74663 	/* Destroy QP1 command response. */
74664 	#define CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1 UINT32_C(0x14)
74665 	#define CREQ_DESTROY_QP1_RESP_EVENT_LAST	CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1
74666 	uint8_t	reserved48[6];
74667 } creq_destroy_qp1_resp_t, *pcreq_destroy_qp1_resp_t;
74668 
74669 /*************
74670  * create_ah *
74671  *************/
74672 
74673 
74674 /* cmdq_create_ah (size:512b/64B) */
74675 
74676 typedef struct cmdq_create_ah {
74677 	/* Command opcode. */
74678 	uint8_t	opcode;
74679 	/* Create AH command allocates an AH with the specified parameters. */
74680 	#define CMDQ_CREATE_AH_OPCODE_CREATE_AH UINT32_C(0x15)
74681 	#define CMDQ_CREATE_AH_OPCODE_LAST	CMDQ_CREATE_AH_OPCODE_CREATE_AH
74682 	/* Size of the command in 16-byte units. */
74683 	uint8_t	cmd_size;
74684 	/* Flags and attribs of the command. */
74685 	uint16_t	flags;
74686 	/* Driver supplied handle to associate the command and the response. */
74687 	uint16_t	cookie;
74688 	/* Size of the response buffer in 16-byte units. */
74689 	uint8_t	resp_size;
74690 	uint8_t	reserved8;
74691 	/* Host address of the response. */
74692 	uint64_t	resp_addr;
74693 	/* AH handle. */
74694 	uint64_t	ah_handle;
74695 	/* Destination GID, specified in BE format. */
74696 	uint32_t	dgid[4];
74697 	/* V1, V2IPv4 or V2IPv6. */
74698 	uint8_t	type;
74699 	/* V2IPv4. */
74700 	#define CMDQ_CREATE_AH_TYPE_V1	UINT32_C(0x0)
74701 	/* V2IPv4. */
74702 	#define CMDQ_CREATE_AH_TYPE_V2IPV4 UINT32_C(0x2)
74703 	/* V2IPv6. */
74704 	#define CMDQ_CREATE_AH_TYPE_V2IPV6 UINT32_C(0x3)
74705 	#define CMDQ_CREATE_AH_TYPE_LAST  CMDQ_CREATE_AH_TYPE_V2IPV6
74706 	/* IPv6 Hop limit. */
74707 	uint8_t	hop_limit;
74708 	/* SGID index. */
74709 	uint16_t	sgid_index;
74710 	uint32_t	dest_vlan_id_flow_label;
74711 	/* Flow label. */
74712 	#define CMDQ_CREATE_AH_FLOW_LABEL_MASK  UINT32_C(0xfffff)
74713 	#define CMDQ_CREATE_AH_FLOW_LABEL_SFT   0
74714 	/* Destination VLAN ID. */
74715 	#define CMDQ_CREATE_AH_DEST_VLAN_ID_MASK UINT32_C(0xfff00000)
74716 	#define CMDQ_CREATE_AH_DEST_VLAN_ID_SFT 20
74717 	/* Protection domain id. */
74718 	uint32_t	pd_id;
74719 	uint32_t	unused_0;
74720 	/* Destination MAC address. */
74721 	uint16_t	dest_mac[3];
74722 	/* Traffic class. */
74723 	uint8_t	traffic_class;
74724 	uint8_t	enable_cc;
74725 	/* Enable congestion control. */
74726 	#define CMDQ_CREATE_AH_ENABLE_CC	UINT32_C(0x1)
74727 } cmdq_create_ah_t, *pcmdq_create_ah_t;
74728 
74729 /* creq_create_ah_resp (size:128b/16B) */
74730 
74731 typedef struct creq_create_ah_resp {
74732 	uint8_t	type;
74733 	/*
74734 	 * This field indicates the exact type of the completion.
74735 	 * By convention, the LSB identifies the length of the
74736 	 * record in 16B units. Even values indicate 16B
74737 	 * records. Odd values indicate 32B
74738 	 * records.
74739 	 */
74740 	#define CREQ_CREATE_AH_RESP_TYPE_MASK	UINT32_C(0x3f)
74741 	#define CREQ_CREATE_AH_RESP_TYPE_SFT	0
74742 	/* QP Async Notification */
74743 		#define CREQ_CREATE_AH_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
74744 		#define CREQ_CREATE_AH_RESP_TYPE_LAST	CREQ_CREATE_AH_RESP_TYPE_QP_EVENT
74745 	/* Status of the response. */
74746 	uint8_t	status;
74747 	/* Driver supplied handle to associate the command and the response. */
74748 	uint16_t	cookie;
74749 	/* AH context id */
74750 	uint32_t	xid;
74751 	uint8_t	v;
74752 	/*
74753 	 * This value is written by the NIC such that it will be different
74754 	 * for each pass through the completion queue. The even passes
74755 	 * will write 1. The odd passes will write 0.
74756 	 */
74757 	#define CREQ_CREATE_AH_RESP_V	UINT32_C(0x1)
74758 	/* Event or command opcode. */
74759 	uint8_t	event;
74760 	/* Create AH command response. */
74761 	#define CREQ_CREATE_AH_RESP_EVENT_CREATE_AH UINT32_C(0x15)
74762 	#define CREQ_CREATE_AH_RESP_EVENT_LAST	CREQ_CREATE_AH_RESP_EVENT_CREATE_AH
74763 	uint8_t	reserved48[6];
74764 } creq_create_ah_resp_t, *pcreq_create_ah_resp_t;
74765 
74766 /**************
74767  * destroy_ah *
74768  **************/
74769 
74770 
74771 /* cmdq_destroy_ah (size:192b/24B) */
74772 
74773 typedef struct cmdq_destroy_ah {
74774 	/* Command opcode. */
74775 	uint8_t	opcode;
74776 	/* Destroy AH command deletes the specified AH. */
74777 	#define CMDQ_DESTROY_AH_OPCODE_DESTROY_AH UINT32_C(0x16)
74778 	#define CMDQ_DESTROY_AH_OPCODE_LAST	CMDQ_DESTROY_AH_OPCODE_DESTROY_AH
74779 	/* Size of the command in 16-byte units. */
74780 	uint8_t	cmd_size;
74781 	/* Flags and attribs of the command. */
74782 	uint16_t	flags;
74783 	/* Driver supplied handle to associate the command and the response. */
74784 	uint16_t	cookie;
74785 	/* Size of the response buffer in 16-byte units. */
74786 	uint8_t	resp_size;
74787 	uint8_t	reserved8;
74788 	/* Host address of the response. */
74789 	uint64_t	resp_addr;
74790 	/* AH context id */
74791 	uint32_t	ah_cid;
74792 	uint32_t	unused_0;
74793 } cmdq_destroy_ah_t, *pcmdq_destroy_ah_t;
74794 
74795 /* creq_destroy_ah_resp (size:128b/16B) */
74796 
74797 typedef struct creq_destroy_ah_resp {
74798 	uint8_t	type;
74799 	/*
74800 	 * This field indicates the exact type of the completion.
74801 	 * By convention, the LSB identifies the length of the
74802 	 * record in 16B units. Even values indicate 16B
74803 	 * records. Odd values indicate 32B
74804 	 * records.
74805 	 */
74806 	#define CREQ_DESTROY_AH_RESP_TYPE_MASK	UINT32_C(0x3f)
74807 	#define CREQ_DESTROY_AH_RESP_TYPE_SFT	0
74808 	/* QP Async Notification */
74809 		#define CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
74810 		#define CREQ_DESTROY_AH_RESP_TYPE_LAST	CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT
74811 	/* Status of the response. */
74812 	uint8_t	status;
74813 	/* Driver supplied handle to associate the command and the response. */
74814 	uint16_t	cookie;
74815 	/* AH context id */
74816 	uint32_t	xid;
74817 	uint8_t	v;
74818 	/*
74819 	 * This value is written by the NIC such that it will be different
74820 	 * for each pass through the completion queue. The even passes
74821 	 * will write 1. The odd passes will write 0.
74822 	 */
74823 	#define CREQ_DESTROY_AH_RESP_V	UINT32_C(0x1)
74824 	/* Event or command opcode. */
74825 	uint8_t	event;
74826 	/* Destroy AH command response. */
74827 	#define CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH UINT32_C(0x16)
74828 	#define CREQ_DESTROY_AH_RESP_EVENT_LAST	CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH
74829 	uint8_t	reserved48[6];
74830 } creq_destroy_ah_resp_t, *pcreq_destroy_ah_resp_t;
74831 
74832 /********************
74833  * query_roce_stats *
74834  ********************/
74835 
74836 
74837 /* cmdq_query_roce_stats (size:192b/24B) */
74838 
74839 typedef struct cmdq_query_roce_stats {
74840 	/* Command opcode. */
74841 	uint8_t	opcode;
74842 	/* Query RoCE statistics. */
74843 	#define CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS UINT32_C(0x8e)
74844 	#define CMDQ_QUERY_ROCE_STATS_OPCODE_LAST		CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS
74845 	/* Size of the command in 16-byte units. */
74846 	uint8_t	cmd_size;
74847 	/* Flags and attribs of the command. */
74848 	uint16_t	flags;
74849 	/*
74850 	 * When this bit is set FW will use the collection_id to extract
74851 	 * RoCE statistics. If function_id is also specified the FW will
74852 	 * return stats corresponding to the collection for the function_id
74853 	 * specified.
74854 	 */
74855 	#define CMDQ_QUERY_ROCE_STATS_FLAGS_COLLECTION_ID	UINT32_C(0x1)
74856 	/*
74857 	 * When this bit is set FW will use the function_id to extract RoCE
74858 	 * statistics. When collection is specified then FW will return the
74859 	 * specific collection stats and if the collection is not specified
74860 	 * then FW will return the default stats which will be for all QPs.
74861 	 */
74862 	#define CMDQ_QUERY_ROCE_STATS_FLAGS_FUNCTION_ID	UINT32_C(0x2)
74863 	/* Driver supplied handle to associate the command and the response. */
74864 	uint16_t	cookie;
74865 	/* Size of the response buffer in 16-byte units. */
74866 	uint8_t	resp_size;
74867 	/* The specific statistics group being queried. */
74868 	uint8_t	collection_id;
74869 	/* Host address of the response. */
74870 	uint64_t	resp_addr;
74871 	/* Unique identifier for a function */
74872 	uint32_t	function_id;
74873 	/* PF number */
74874 	#define CMDQ_QUERY_ROCE_STATS_PF_NUM_MASK  UINT32_C(0xff)
74875 	#define CMDQ_QUERY_ROCE_STATS_PF_NUM_SFT   0
74876 	/* VF number */
74877 	#define CMDQ_QUERY_ROCE_STATS_VF_NUM_MASK  UINT32_C(0xffff00)
74878 	#define CMDQ_QUERY_ROCE_STATS_VF_NUM_SFT   8
74879 	/* When set the vf_num is valid. */
74880 	#define CMDQ_QUERY_ROCE_STATS_VF_VALID	UINT32_C(0x1000000)
74881 	uint32_t	reserved32;
74882 } cmdq_query_roce_stats_t, *pcmdq_query_roce_stats_t;
74883 
74884 /* creq_query_roce_stats_resp (size:128b/16B) */
74885 
74886 typedef struct creq_query_roce_stats_resp {
74887 	uint8_t	type;
74888 	/*
74889 	 * This field indicates the exact type of the completion.
74890 	 * By convention, the LSB identifies the length of the
74891 	 * record in 16B units. Even values indicate 16B
74892 	 * records. Odd values indicate 32B
74893 	 * records.
74894 	 */
74895 	#define CREQ_QUERY_ROCE_STATS_RESP_TYPE_MASK	UINT32_C(0x3f)
74896 	#define CREQ_QUERY_ROCE_STATS_RESP_TYPE_SFT	0
74897 	/* QP Async Notification */
74898 		#define CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
74899 		#define CREQ_QUERY_ROCE_STATS_RESP_TYPE_LAST	CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT
74900 	/* Status of the response. */
74901 	uint8_t	status;
74902 	/* Driver supplied handle to associate the command and the response. */
74903 	uint16_t	cookie;
74904 	/* Side buffer size in 16-byte units */
74905 	uint32_t	size;
74906 	uint8_t	v;
74907 	/*
74908 	 * This value is written by the NIC such that it will be different
74909 	 * for each pass through the completion queue. The even passes
74910 	 * will write 1. The odd passes will write 0.
74911 	 */
74912 	#define CREQ_QUERY_ROCE_STATS_RESP_V	UINT32_C(0x1)
74913 	/* Event or command opcode. */
74914 	uint8_t	event;
74915 	/* Query RoCE statistics. */
74916 	#define CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS UINT32_C(0x8e)
74917 	#define CREQ_QUERY_ROCE_STATS_RESP_EVENT_LAST		CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS
74918 	uint8_t	reserved48[6];
74919 } creq_query_roce_stats_resp_t, *pcreq_query_roce_stats_resp_t;
74920 
74921 /* Query RoCE Stats command response side buffer structure. */
74922 /* creq_query_roce_stats_resp_sb (size:3072b/384B) */
74923 
74924 typedef struct creq_query_roce_stats_resp_sb {
74925 	/* Command opcode. */
74926 	uint8_t	opcode;
74927 	/* Query RoCE statistics. */
74928 	#define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS UINT32_C(0x8e)
74929 	#define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_LAST		CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS
74930 	/* Status of the response. */
74931 	uint8_t	status;
74932 	/* Driver supplied handle to associate the command and the response. */
74933 	uint16_t	cookie;
74934 	/* Flags and attribs of the command. */
74935 	uint16_t	flags;
74936 	/* Size of the response buffer in 16-byte units. */
74937 	uint8_t	resp_size;
74938 	uint8_t	rsvd;
74939 	uint32_t	num_counters;
74940 	uint32_t	rsvd1;
74941 	uint64_t	to_retransmits;
74942 	/* seq_err_naks_rcvd is 64 b */
74943 	uint64_t	seq_err_naks_rcvd;
74944 	/* max_retry_exceeded is 64 b */
74945 	uint64_t	max_retry_exceeded;
74946 	/* rnr_naks_rcvd is 64 b */
74947 	uint64_t	rnr_naks_rcvd;
74948 	uint64_t	missing_resp;
74949 	/* unrecoverable_err is 64 b */
74950 	uint64_t	unrecoverable_err;
74951 	/* bad_resp_err is 64 b */
74952 	uint64_t	bad_resp_err;
74953 	/* local_qp_op_err is 64 b */
74954 	uint64_t	local_qp_op_err;
74955 	/* local_protection_err is 64 b */
74956 	uint64_t	local_protection_err;
74957 	/* mem_mgmt_op_err is 64 b */
74958 	uint64_t	mem_mgmt_op_err;
74959 	/* remote_invalid_req_err is 64 b */
74960 	uint64_t	remote_invalid_req_err;
74961 	/* remote_access_err is 64 b */
74962 	uint64_t	remote_access_err;
74963 	/* remote_op_err is 64 b */
74964 	uint64_t	remote_op_err;
74965 	/* dup_req is 64 b */
74966 	uint64_t	dup_req;
74967 	/* res_exceed_max is 64 b */
74968 	uint64_t	res_exceed_max;
74969 	/* res_length_mismatch is 64 b */
74970 	uint64_t	res_length_mismatch;
74971 	/* res_exceeds_wqe is 64 b */
74972 	uint64_t	res_exceeds_wqe;
74973 	/* res_opcode_err is 64 b */
74974 	uint64_t	res_opcode_err;
74975 	/* res_rx_invalid_rkey is 64 b */
74976 	uint64_t	res_rx_invalid_rkey;
74977 	/* res_rx_domain_err is 64 b */
74978 	uint64_t	res_rx_domain_err;
74979 	/* res_rx_no_perm is 64 b */
74980 	uint64_t	res_rx_no_perm;
74981 	/* res_rx_range_err is 64 b */
74982 	uint64_t	res_rx_range_err;
74983 	/* res_tx_invalid_rkey is 64 b */
74984 	uint64_t	res_tx_invalid_rkey;
74985 	/* res_tx_domain_err is 64 b */
74986 	uint64_t	res_tx_domain_err;
74987 	/* res_tx_no_perm is 64 b */
74988 	uint64_t	res_tx_no_perm;
74989 	/* res_tx_range_err is 64 b */
74990 	uint64_t	res_tx_range_err;
74991 	/* res_irrq_oflow is 64 b */
74992 	uint64_t	res_irrq_oflow;
74993 	/* res_unsup_opcode is 64 b */
74994 	uint64_t	res_unsup_opcode;
74995 	/* res_unaligned_atomic is 64 b */
74996 	uint64_t	res_unaligned_atomic;
74997 	/* res_rem_inv_err is 64 b */
74998 	uint64_t	res_rem_inv_err;
74999 	/* res_mem_error is 64 b */
75000 	uint64_t	res_mem_error;
75001 	/* res_srq_err is 64 b */
75002 	uint64_t	res_srq_err;
75003 	/* res_cmp_err is 64 b */
75004 	uint64_t	res_cmp_err;
75005 	/* res_invalid_dup_rkey is 64 b */
75006 	uint64_t	res_invalid_dup_rkey;
75007 	/* res_wqe_format_err is 64 b */
75008 	uint64_t	res_wqe_format_err;
75009 	/* res_cq_load_err is 64 b */
75010 	uint64_t	res_cq_load_err;
75011 	/* res_srq_load_err is 64 b */
75012 	uint64_t	res_srq_load_err;
75013 	/* res_tx_pci_err is 64 b */
75014 	uint64_t	res_tx_pci_err;
75015 	/* res_rx_pci_err is 64 b */
75016 	uint64_t	res_rx_pci_err;
75017 	/* res_oos_drop_count is 64 b */
75018 	uint64_t	res_oos_drop_count;
75019 	/* active_qp_count_p0 is 64 b */
75020 	uint64_t	active_qp_count_p0;
75021 	/* active_qp_count_p1 is 64 b */
75022 	uint64_t	active_qp_count_p1;
75023 	/* active_qp_count_p2 is 64 b */
75024 	uint64_t	active_qp_count_p2;
75025 	/* active_qp_count_p3 is 64 b */
75026 	uint64_t	active_qp_count_p3;
75027 	/* express mode SQ doorbell overflow error 64b counter. */
75028 	uint64_t	xp_sq_overflow_err;
75029 	/* express mode RQ doorbell overflow error 64b counter. */
75030 	uint64_t	xp_rq_overflow_error;
75031 } creq_query_roce_stats_resp_sb_t, *pcreq_query_roce_stats_resp_sb_t;
75032 
75033 /************************
75034  * query_roce_stats_ext *
75035  ************************/
75036 
75037 
75038 /* cmdq_query_roce_stats_ext (size:192b/24B) */
75039 
75040 typedef struct cmdq_query_roce_stats_ext {
75041 	/* Command opcode. */
75042 	uint8_t	opcode;
75043 	/* Query extended RoCE statistics. */
75044 	#define CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_QUERY_ROCE_STATS UINT32_C(0x92)
75045 	#define CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_LAST		CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_QUERY_ROCE_STATS
75046 	/* Size of the command in 16-byte units. */
75047 	uint8_t	cmd_size;
75048 	/* Flags and attribs of the command. */
75049 	uint16_t	flags;
75050 	/*
75051 	 * When this bit is set FW will use the collection_id to extract
75052 	 * RoCE statistics. If function_id is also specified the FW will
75053 	 * return stats corresponding to the collection for the function_id
75054 	 * specified.
75055 	 */
75056 	#define CMDQ_QUERY_ROCE_STATS_EXT_FLAGS_COLLECTION_ID	UINT32_C(0x1)
75057 	/*
75058 	 * When this bit is set FW will use the function_id to extract RoCE
75059 	 * statistics. When collection is specified then FW will return the
75060 	 * specific collection stats and if the collection is not specified
75061 	 * then FW will return the default stats which will be for all QPs.
75062 	 */
75063 	#define CMDQ_QUERY_ROCE_STATS_EXT_FLAGS_FUNCTION_ID	UINT32_C(0x2)
75064 	/* Driver supplied handle to associate the command and the response. */
75065 	uint16_t	cookie;
75066 	/* Size of the response buffer in 16-byte units. */
75067 	uint8_t	resp_size;
75068 	/* The specific statistics group being queried. */
75069 	uint8_t	collection_id;
75070 	/* Host address of the response. */
75071 	uint64_t	resp_addr;
75072 	/* Unique identifier for a function */
75073 	uint32_t	function_id;
75074 	/* PF number */
75075 	#define CMDQ_QUERY_ROCE_STATS_EXT_PF_NUM_MASK  UINT32_C(0xff)
75076 	#define CMDQ_QUERY_ROCE_STATS_EXT_PF_NUM_SFT   0
75077 	/* VF number */
75078 	#define CMDQ_QUERY_ROCE_STATS_EXT_VF_NUM_MASK  UINT32_C(0xffff00)
75079 	#define CMDQ_QUERY_ROCE_STATS_EXT_VF_NUM_SFT   8
75080 	/* When set the vf_num is valid. */
75081 	#define CMDQ_QUERY_ROCE_STATS_EXT_VF_VALID	UINT32_C(0x1000000)
75082 	uint32_t	reserved32;
75083 } cmdq_query_roce_stats_ext_t, *pcmdq_query_roce_stats_ext_t;
75084 
75085 /* creq_query_roce_stats_ext_resp (size:128b/16B) */
75086 
75087 typedef struct creq_query_roce_stats_ext_resp {
75088 	uint8_t	type;
75089 	/*
75090 	 * This field indicates the exact type of the completion.
75091 	 * By convention, the LSB identifies the length of the
75092 	 * record in 16B units. Even values indicate 16B
75093 	 * records. Odd values indicate 32B
75094 	 * records.
75095 	 */
75096 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_MASK	UINT32_C(0x3f)
75097 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_SFT	0
75098 	/* QP Async Notification */
75099 		#define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
75100 		#define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_LAST	CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_QP_EVENT
75101 	/* Status of the response. */
75102 	uint8_t	status;
75103 	/* Driver supplied handle to associate the command and the response. */
75104 	uint16_t	cookie;
75105 	/* Side buffer size in 16-byte units */
75106 	uint32_t	size;
75107 	uint8_t	v;
75108 	/*
75109 	 * This value is written by the NIC such that it will be different
75110 	 * for each pass through the completion queue. The even passes
75111 	 * will write 1. The odd passes will write 0.
75112 	 */
75113 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_V	UINT32_C(0x1)
75114 	/* Event or command opcode. */
75115 	uint8_t	event;
75116 	/* Query extended RoCE statistics. */
75117 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_QUERY_ROCE_STATS_EXT UINT32_C(0x92)
75118 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_LAST		CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_QUERY_ROCE_STATS_EXT
75119 	uint8_t	reserved48[6];
75120 } creq_query_roce_stats_ext_resp_t, *pcreq_query_roce_stats_ext_resp_t;
75121 
75122 /* Query extended RoCE Stats command response side buffer structure. */
75123 /* creq_query_roce_stats_ext_resp_sb (size:2304b/288B) */
75124 
75125 typedef struct creq_query_roce_stats_ext_resp_sb {
75126 	/* Command opcode. */
75127 	uint8_t	opcode;
75128 	/* Query extended RoCE statistics. */
75129 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_QUERY_ROCE_STATS_EXT UINT32_C(0x92)
75130 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_LAST		CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_QUERY_ROCE_STATS_EXT
75131 	/* Status of the response. */
75132 	uint8_t	status;
75133 	/* Driver supplied handle to associate the command and the response. */
75134 	uint16_t	cookie;
75135 	/* Flags and attribs of the command. */
75136 	uint16_t	flags;
75137 	/* Size of the response buffer in 16-byte units. */
75138 	uint8_t	resp_size;
75139 	uint8_t	rsvd;
75140 	/* Number of transmitted Atomic request packets. */
75141 	uint64_t	tx_atomic_req_pkts;
75142 	/* Number of transmitted Read request packets. */
75143 	uint64_t	tx_read_req_pkts;
75144 	/* Number of transmitted Read response packets. */
75145 	uint64_t	tx_read_res_pkts;
75146 	/* Number of transmitted Write request packets. */
75147 	uint64_t	tx_write_req_pkts;
75148 	/*
75149 	 * Number of transmitted Send request packets.
75150 	 * This is for RC QPs only.
75151 	 */
75152 	uint64_t	tx_send_req_pkts;
75153 	/*
75154 	 * Number of transmitted RoCE packets.
75155 	 * This includes RC, UD, RawEth, and QP1 packets
75156 	 */
75157 	uint64_t	tx_roce_pkts;
75158 	/*
75159 	 * Number of transmitted RoCE header and payload bytes.
75160 	 * This includes RC, UD, RawEth, and QP1 packets.
75161 	 */
75162 	uint64_t	tx_roce_bytes;
75163 	/* Number of received Atomic request packets. */
75164 	uint64_t	rx_atomic_req_pkts;
75165 	/* Number of received Read request packets. */
75166 	uint64_t	rx_read_req_pkts;
75167 	/* Number of received Read response packets. */
75168 	uint64_t	rx_read_res_pkts;
75169 	/* Number of received Write request packets. */
75170 	uint64_t	rx_write_req_pkts;
75171 	/*
75172 	 * Number of received Send request packets.
75173 	 * This is for RC QPs only.
75174 	 */
75175 	uint64_t	rx_send_req_pkts;
75176 	/*
75177 	 * Number of received RoCE packets including RoCE packets with errors.
75178 	 * This includes RC, UD, RawEth, and QP1 packets
75179 	 */
75180 	uint64_t	rx_roce_pkts;
75181 	/*
75182 	 * Number of received RoCE header and payload bytes including RoCE
75183 	 * packets with errors.
75184 	 * This includes RC, UD, RawEth, and QP1 packets.
75185 	 */
75186 	uint64_t	rx_roce_bytes;
75187 	/*
75188 	 * Number of received RoCE packets.
75189 	 * This includes RC, UD, RawEth, and QP1 packets
75190 	 */
75191 	uint64_t	rx_roce_good_pkts;
75192 	/*
75193 	 * Number of received RoCE header and payload bytes.
75194 	 * This includes RC, UD, RawEth, and QP1 packets.
75195 	 */
75196 	uint64_t	rx_roce_good_bytes;
75197 	/*
75198 	 * Number of drops that occurred to lack of buffers.
75199 	 * This is for RC QPs only.
75200 	 */
75201 	uint64_t	rx_out_of_buffer_pkts;
75202 	/* Number of packets that were received out of sequence. */
75203 	uint64_t	rx_out_of_sequence_pkts;
75204 	/* Number of transmitted CNP packets. The counter is per port. */
75205 	uint64_t	tx_cnp_pkts;
75206 	/* Number of received CNP packets. The counter is per port. */
75207 	uint64_t	rx_cnp_pkts;
75208 	/* Number of received ECN-marked RoCE packets. The counter is per port. */
75209 	uint64_t	rx_ecn_marked_pkts;
75210 	/* Number of transmitted CNP bytes. */
75211 	uint64_t	tx_cnp_bytes;
75212 	/* Number of received CNP bytes. */
75213 	uint64_t	rx_cnp_bytes;
75214 	/*
75215 	 * Number of sequence error NAKs received.
75216 	 * This counter is only applicable for devices that support
75217 	 * hardware based retransmission.
75218 	 */
75219 	uint64_t	seq_err_naks_rcvd;
75220 	/*
75221 	 * Number of RNR NAKs received.
75222 	 * This counter is only applicable for devices that support
75223 	 * hardware based retransmission.
75224 	 */
75225 	uint64_t	rnr_naks_rcvd;
75226 	/*
75227 	 * Number of missing response resulting in HW retransmission.
75228 	 * This counter is only applicable for devices that support
75229 	 * hardware based retransmission.
75230 	 */
75231 	uint64_t	missing_resp;
75232 	/*
75233 	 * Number of timeouts resulting in HW retransmission.
75234 	 * This counter is only applicable for devices that support
75235 	 * hardware based retransmission.
75236 	 */
75237 	uint64_t	to_retransmit;
75238 	/*
75239 	 * Number of duplicate read/atomic requests resulting in HW
75240 	 * retransmission.
75241 	 * This counter is only applicable for devices that support
75242 	 * hardware based retransmission.
75243 	 */
75244 	uint64_t	dup_req;
75245 	/*
75246 	 * Number of received DCN payload cut packets.
75247 	 * This counter is only applicable for devices that support
75248 	 * the DCN Payload Cut feature.
75249 	 */
75250 	uint64_t	rx_dcn_payload_cut;
75251 	/* Number of transmitted packets that bypassed the transmit engine. */
75252 	uint64_t	te_bypassed;
75253 	/*
75254 	 * Number of transmitted DCN CNP packets.
75255 	 * This counter is only applicable for devices that support
75256 	 * the DCN Payload Cut feature.
75257 	 */
75258 	uint64_t	tx_dcn_cnp;
75259 	/*
75260 	 * Number of received DCN CNP packets.
75261 	 * This counter is only applicable for devices that support
75262 	 * the DCN Payload Cut feature.
75263 	 */
75264 	uint64_t	rx_dcn_cnp;
75265 	/*
75266 	 * Number of received DCN payload cut packets.
75267 	 * This counter is only applicable for devices that support
75268 	 * the DCN Payload Cut feature.
75269 	 */
75270 	uint64_t	rx_payload_cut;
75271 	/*
75272 	 * Number of received DCN payload cut packets that are ignored
75273 	 * because they failed the PSN checks.
75274 	 * This counter is only applicable for devices that support
75275 	 * the DCN Payload Cut feature.
75276 	 */
75277 	uint64_t	rx_payload_cut_ignored;
75278 	/*
75279 	 * Number of received DCN CNP packets that are ignored either
75280 	 * because the ECN is not enabled on the QP or the ECN is enabled
75281 	 * but the CNP packets do not pass the packet validation checks.
75282 	 * This counter is only applicable for devices that support
75283 	 * the DCN Payload Cut feature.
75284 	 */
75285 	uint64_t	rx_dcn_cnp_ignored;
75286 } creq_query_roce_stats_ext_resp_sb_t, *pcreq_query_roce_stats_ext_resp_sb_t;
75287 
75288 /**************
75289  * query_func *
75290  **************/
75291 
75292 
75293 /* cmdq_query_func (size:128b/16B) */
75294 
75295 typedef struct cmdq_query_func {
75296 	/* Command opcode. */
75297 	uint8_t	opcode;
75298 	/* Query the HW capabilities for the function. */
75299 	#define CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC UINT32_C(0x83)
75300 	#define CMDQ_QUERY_FUNC_OPCODE_LAST	CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC
75301 	/* Size of the command in 16-byte units. */
75302 	uint8_t	cmd_size;
75303 	/* Flags and attribs of the command. */
75304 	uint16_t	flags;
75305 	/* Driver supplied handle to associate the command and the response. */
75306 	uint16_t	cookie;
75307 	/* Size of the response buffer in 16-byte units. */
75308 	uint8_t	resp_size;
75309 	uint8_t	reserved8;
75310 	/* Host address of the response. */
75311 	uint64_t	resp_addr;
75312 } cmdq_query_func_t, *pcmdq_query_func_t;
75313 
75314 /* creq_query_func_resp (size:128b/16B) */
75315 
75316 typedef struct creq_query_func_resp {
75317 	uint8_t	type;
75318 	/*
75319 	 * This field indicates the exact type of the completion.
75320 	 * By convention, the LSB identifies the length of the
75321 	 * record in 16B units. Even values indicate 16B
75322 	 * records. Odd values indicate 32B
75323 	 * records.
75324 	 */
75325 	#define CREQ_QUERY_FUNC_RESP_TYPE_MASK	UINT32_C(0x3f)
75326 	#define CREQ_QUERY_FUNC_RESP_TYPE_SFT	0
75327 	/* QP Async Notification */
75328 		#define CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
75329 		#define CREQ_QUERY_FUNC_RESP_TYPE_LAST	CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT
75330 	/* Status of the response. */
75331 	uint8_t	status;
75332 	/* Driver supplied handle to associate the command and the response. */
75333 	uint16_t	cookie;
75334 	/* Side buffer size in 16-byte units */
75335 	uint32_t	size;
75336 	uint8_t	v;
75337 	/*
75338 	 * This value is written by the NIC such that it will be different
75339 	 * for each pass through the completion queue. The even passes
75340 	 * will write 1. The odd passes will write 0.
75341 	 */
75342 	#define CREQ_QUERY_FUNC_RESP_V	UINT32_C(0x1)
75343 	/* Event or command opcode. */
75344 	uint8_t	event;
75345 	/* Query info PF command response. */
75346 	#define CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC UINT32_C(0x83)
75347 	#define CREQ_QUERY_FUNC_RESP_EVENT_LAST	CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC
75348 	uint8_t	reserved48[6];
75349 } creq_query_func_resp_t, *pcreq_query_func_resp_t;
75350 
75351 /* Query function command response side buffer structure. */
75352 /* creq_query_func_resp_sb (size:1280b/160B) */
75353 
75354 typedef struct creq_query_func_resp_sb {
75355 	/* Command opcode. */
75356 	uint8_t	opcode;
75357 	/* Query info PF command response. */
75358 	#define CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC UINT32_C(0x83)
75359 	#define CREQ_QUERY_FUNC_RESP_SB_OPCODE_LAST	CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC
75360 	/* Status of the response. */
75361 	uint8_t	status;
75362 	/* Driver supplied handle to associate the command and the response. */
75363 	uint16_t	cookie;
75364 	/* Flags and attribs of the command. */
75365 	uint16_t	flags;
75366 	/* Size of the response buffer in 16-byte units. */
75367 	uint8_t	resp_size;
75368 	uint8_t	reserved8;
75369 	/* Max MR size supported. */
75370 	uint64_t	max_mr_size;
75371 	/*
75372 	 * Max QP supported.
75373 	 * For devices that support the pseudo static allocation scheme,
75374 	 * this count:
75375 	 * -excludes the QP1 count.
75376 	 * -includes the count of QPs that can be migrated from the other PF
75377 	 *  Therefore, during normal operation when both PFs are active,
75378 	 *  the supported number of RoCE QPs for each of the PF is half
75379 	 *  of the advertised value.
75380 	 */
75381 	uint32_t	max_qp;
75382 	/* Max WQEs per QP. */
75383 	uint16_t	max_qp_wr;
75384 	/* Device capability flags. */
75385 	uint16_t	dev_cap_flags;
75386 	/* Allow QP resizing. */
75387 	#define CREQ_QUERY_FUNC_RESP_SB_RESIZE_QP				UINT32_C(0x1)
75388 	/* Specifies Congestion Control (CC) generation. */
75389 	#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_MASK		UINT32_C(0xe)
75390 	#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_SFT			1
75391 	/*
75392 	 * Includes support for DCTCP and TCP CC algorithms,
75393 	 * enabling operation in networks where PFC is enabled.
75394 	 */
75395 		#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN0		(UINT32_C(0x0) << 1)
75396 	/*
75397 	 * Enhances cc_gen0 support with probabilistic marking algorithm,
75398 	 * enabling fast ramp up and convergence,
75399 	 * as well as operation in networks where PFC is not enabled.
75400 	 * Includes a number of parameters that are different from cc_gen0
75401 	 * chips as well as new parameters. TCP CC algorithm is not
75402 	 * supported.
75403 	 */
75404 		#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1		(UINT32_C(0x1) << 1)
75405 	/*
75406 	 * Enhances cc_gen1 support for additional CC parameters:
75407 	 * reduce_init_en, reduce_init_cong_free_rtts_th, random_no_red_en,
75408 	 * actual_cr_shift_correction_en, quota_period_adjust_en
75409 	 */
75410 		#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1_EXT		(UINT32_C(0x2) << 1)
75411 	/*
75412 	 * Enhances cc_gen1_ext support, to include support for DCN/SARA.
75413 	 * Enables query and modification of Queue level table attributes,
75414 	 * which are used by the hardware to determine the QP's flow rate
75415 	 * based on congestion level and thereby reduce RoCE packet drop
75416 	 * due to network congestion.
75417 	 */
75418 		#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN2		(UINT32_C(0x3) << 1)
75419 		#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_LAST			CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN2
75420 	/*
75421 	 * Support for the extended RoCE statistics is available. These
75422 	 * statistics are queried via the `query_roce_stats_ext` command
75423 	 * and are enabled on a per-QP basis via `create_qp`.
75424 	 */
75425 	#define CREQ_QUERY_FUNC_RESP_SB_EXT_STATS				UINT32_C(0x10)
75426 	/*
75427 	 * Support for both allocating and registering a new MR via the
75428 	 * `register_mr` command is available. With this feature the
75429 	 * `allocate_mrw` command does not have to be called before
75430 	 * registering.
75431 	 */
75432 	#define CREQ_QUERY_FUNC_RESP_SB_MR_REGISTER_ALLOC			UINT32_C(0x20)
75433 	/*
75434 	 * Support for optimized transmit path to lower latency for WQEs
75435 	 * with inline data.
75436 	 */
75437 	#define CREQ_QUERY_FUNC_RESP_SB_OPTIMIZED_TRANSMIT_ENABLED	UINT32_C(0x40)
75438 	/*
75439 	 * The underlying HW uses the version 2 of the CQEs definitions for
75440 	 * the following CQE types:
75441 	 * RES_UD, RES_RAWETH_QP1, RES_UD_CFA
75442 	 */
75443 	#define CREQ_QUERY_FUNC_RESP_SB_CQE_V2				UINT32_C(0x80)
75444 	/* Support for ping pong push mode is available. */
75445 	#define CREQ_QUERY_FUNC_RESP_SB_PINGPONG_PUSH_MODE		UINT32_C(0x100)
75446 	/* Support for hardware requester retransmission is enabled. */
75447 	#define CREQ_QUERY_FUNC_RESP_SB_HW_REQUESTER_RETX_ENABLED		UINT32_C(0x200)
75448 	/* Support for hardware responder retransmission is enabled. */
75449 	#define CREQ_QUERY_FUNC_RESP_SB_HW_RESPONDER_RETX_ENABLED		UINT32_C(0x400)
75450 	/* Support for link aggregation is enabled. */
75451 	#define CREQ_QUERY_FUNC_RESP_SB_LINK_AGGR_SUPPORTED		UINT32_C(0x800)
75452 	/* link_aggr_supported is valid. */
75453 	#define CREQ_QUERY_FUNC_RESP_SB_LINK_AGGR_SUPPORTED_VALID		UINT32_C(0x1000)
75454 	/*
75455 	 * Support for pseudo static QP allocation is enabled.
75456 	 * This feature enables the following capabilities:
75457 	 * - QP context ID space is pseudo-static partitioned across PFs.
75458 	 * - An application can use a predetermined
75459 	 *   QP context ID assignment scheme for specific operations.
75460 	 * - For 2-port adapters, the application can migrate the QP context
75461 	 *   ID range across PFs, using the `orchestrate_qid_migration` HWRM,
75462 	 *   during network events such as Link Down.
75463 	 */
75464 	#define CREQ_QUERY_FUNC_RESP_SB_PSEUDO_STATIC_QP_ALLOC_SUPPORTED	UINT32_C(0x2000)
75465 	/*
75466 	 * Support for Express Mode is enabled.
75467 	 * For Express mode, the QP resources (SQ/RQ) are allocated in
75468 	 * on-chip queue memory. The host driver should not allocate memory
75469 	 * for these queue structures.
75470 	 */
75471 	#define CREQ_QUERY_FUNC_RESP_SB_EXPRESS_MODE_SUPPORTED		UINT32_C(0x4000)
75472 	/*
75473 	 * IRRQ/ORRQ and MSN Table structures are allocated in internal
75474 	 * queue memory.
75475 	 */
75476 	#define CREQ_QUERY_FUNC_RESP_SB_INTERNAL_QUEUE_MEMORY		UINT32_C(0x8000)
75477 	/* Max CQs supported. */
75478 	uint32_t	max_cq;
75479 	/* Max CQEs per CQ supported. */
75480 	uint32_t	max_cqe;
75481 	/* Max PDs supported. */
75482 	uint32_t	max_pd;
75483 	/*
75484 	 * Max SGEs per QP WQE supported. On chips with variable-size WQE
75485 	 * support, this field is applicable only for the backward compatible
75486 	 * mode.
75487 	 */
75488 	uint8_t	max_sge;
75489 	/* Max SGEs per SRQ WQE supported. */
75490 	uint8_t	max_srq_sge;
75491 	/* Max outstanding RDMA read & atomic supported. */
75492 	uint8_t	max_qp_rd_atom;
75493 	/*
75494 	 * Max outstanding RDMA read & atomic that can be sent from an
75495 	 * initiator.
75496 	 */
75497 	uint8_t	max_qp_init_rd_atom;
75498 	/* Max MRs supported. */
75499 	uint32_t	max_mr;
75500 	/* Max MWs supported. */
75501 	uint32_t	max_mw;
75502 	/* Max Raw Ethertype QPs supported. */
75503 	uint32_t	max_raw_eth_qp;
75504 	/* Max AHs supported. */
75505 	uint32_t	max_ah;
75506 	/* Max FMRs supported. */
75507 	uint32_t	max_fmr;
75508 	/* Max WQEs per SRQ supported. */
75509 	uint32_t	max_srq_wr;
75510 	/* Max PKEYs supported. */
75511 	uint32_t	max_pkeys;
75512 	/*
75513 	 * Max inline data supported. On chips with variable-size WQE support,
75514 	 * this field is applicable only for the backward compatible mode.
75515 	 */
75516 	uint32_t	max_inline_data;
75517 	/* Max mappings per FMR supported. */
75518 	uint8_t	max_map_per_fmr;
75519 	/* L2 DB space size in pages. */
75520 	uint8_t	l2_db_space_size;
75521 	/* Max SRQs supported. */
75522 	uint16_t	max_srq;
75523 	/* Max GIDs supported. */
75524 	uint32_t	max_gid;
75525 	/*
75526 	 * An array of 48 8-bit values to specify allocation multiplier for TQM
75527 	 * host buffer regions. Each region occupies 16 MB of TQM PBL address
75528 	 * space: 0x00000000, 0x01000000, 0x02000000, etc.
75529 	 * The host needs to allocate (<Number of QPs>*multiplier, rounded up
75530 	 * to page size) of physical memory for non-zero slots and map the
75531 	 * pages to the corresponding 16MB regions. Typically there are total
75532 	 * 3 non-zero values in this array, their values are 16, 16, 12.
75533 	 * Cu+ will only populate up to index 11. SR may populate up to
75534 	 * index 47.
75535 	 */
75536 	uint32_t	tqm_alloc_reqs[12];
75537 	/* Max Doorbell page indices supported. */
75538 	uint32_t	max_dpi;
75539 	/* Max SGEs per QP WQE supported in the variable-size WQE mode. */
75540 	uint8_t	max_sge_var_wqe;
75541 	/* Device capability extended flags. */
75542 	uint8_t	dev_cap_ext_flags;
75543 	/* RDMA Atomic operations are not supported. */
75544 	#define CREQ_QUERY_FUNC_RESP_SB_ATOMIC_OPS_NOT_SUPPORTED	UINT32_C(0x1)
75545 	/* Support driver version registration. */
75546 	#define CREQ_QUERY_FUNC_RESP_SB_DRV_VERSION_RGTR_SUPPORTED	UINT32_C(0x2)
75547 	/* Support for batch allocation of QPs is enabled. */
75548 	#define CREQ_QUERY_FUNC_RESP_SB_CREATE_QP_BATCH_SUPPORTED	UINT32_C(0x4)
75549 	/* Support for batch deletion of QPs is enabled. */
75550 	#define CREQ_QUERY_FUNC_RESP_SB_DESTROY_QP_BATCH_SUPPORTED	UINT32_C(0x8)
75551 	/*
75552 	 * Support for extended RoCE statistics context
75553 	 * with periodic DMA is enabled. The statistics contexts
75554 	 * are allocated via `allocate_roce_stats_ext_ctx`
75555 	 * and deallocated via `deallocate_roce_stats_ext_ctx`.
75556 	 * These contexts are assigned on a per-QP, per-group of QPs
75557 	 * or per-function basis via `create_qp`, `create_qp_batch`
75558 	 * or `modify_qp`command.
75559 	 * In addition to periodic DMA to a host address,
75560 	 * these statistics can be queried via `query_roce_stats_ext_v2`.
75561 	 */
75562 	#define CREQ_QUERY_FUNC_RESP_SB_ROCE_STATS_EXT_CTX_SUPPORTED	UINT32_C(0x10)
75563 	/*
75564 	 * Support for the srq_sge field in the create_srq command is
75565 	 * enabled.
75566 	 */
75567 	#define CREQ_QUERY_FUNC_RESP_SB_CREATE_SRQ_SGE_SUPPORTED	UINT32_C(0x20)
75568 	/* Support for fixed size SQ wqe (128B) is disabled. */
75569 	#define CREQ_QUERY_FUNC_RESP_SB_FIXED_SIZE_WQE_DISABLED	UINT32_C(0x40)
75570 	/* Support for DCN (Drop Congestion Notification) is enabled. */
75571 	#define CREQ_QUERY_FUNC_RESP_SB_DCN_SUPPORTED			UINT32_C(0x80)
75572 	/* Max inline data supported in the variable-size WQE mode. */
75573 	uint16_t	max_inline_data_var_wqe;
75574 	/*
75575 	 * starting xid of the predetermined assignment scheme supported
75576 	 * by the pseudo static allocation feature. Note that for a PF,
75577 	 * the start_qid is itself pseudo_static, and can change when the QP
75578 	 * context id range is migrated by the driver using the
75579 	 * cmdq_orchestrate_qid_migration. The supported QP count is
75580 	 * available in the `max_qp` field of `cmdq_query_func`.
75581 	 */
75582 	uint32_t	start_qid;
75583 	/*
75584 	 * Max number of MSN table entries supported for devices that support
75585 	 * the `internal_queue_memory` feature.
75586 	 */
75587 	uint8_t	max_msn_table_size;
75588 	/* reserved8_1 is 8 b */
75589 	uint8_t	reserved8_1;
75590 	/* Device capability extended flags_2 */
75591 	uint16_t	dev_cap_ext_flags_2;
75592 	/* Firmware support for optimizing Modify QP operation */
75593 	#define CREQ_QUERY_FUNC_RESP_SB_OPTIMIZE_MODIFY_QP_SUPPORTED		UINT32_C(0x1)
75594 	/*
75595 	 * Device supports changing UDP source port of RoCEv2 packets using
75596 	 * WQE.
75597 	 */
75598 	#define CREQ_QUERY_FUNC_RESP_SB_CHANGE_UDP_SRC_PORT_WQE_SUPPORTED	UINT32_C(0x2)
75599 	/* Device supports CQ Coalescing. */
75600 	#define CREQ_QUERY_FUNC_RESP_SB_CQ_COALESCING_SUPPORTED		UINT32_C(0x4)
75601 	/*
75602 	 * Device allows a memory region to be designated as
75603 	 * relaxed-ordering enabled or disabled.
75604 	 */
75605 	#define CREQ_QUERY_FUNC_RESP_SB_MEMORY_REGION_RO_SUPPORTED		UINT32_C(0x8)
75606 	/* The type of lookup table used for requester retransmission. */
75607 	#define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_MASK	UINT32_C(0x30)
75608 	#define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_SFT	4
75609 	/* Requester Retransmission uses a PSN table in host memory. */
75610 		#define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_HOST_PSN_TABLE  (UINT32_C(0x0) << 4)
75611 	/* Requester Retransmission uses an MSN table in host memory. */
75612 		#define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_HOST_MSN_TABLE  (UINT32_C(0x1) << 4)
75613 	/*
75614 	 * Requester Retransmission uses an MSN table in Device Internal
75615 	 * Queue Memory.
75616 	 */
75617 		#define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_IQM_MSN_TABLE   (UINT32_C(0x2) << 4)
75618 		#define CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_LAST	CREQ_QUERY_FUNC_RESP_SB_REQ_RETRANSMISSION_SUPPORT_IQM_MSN_TABLE
75619 	/*
75620 	 * Max number of 16B IQM memory slots supported by SQ or RQ
75621 	 * when QP is in express mode.
75622 	 * This field is only valid for express mode QPs.
75623 	 */
75624 	uint16_t	max_xp_qp_size;
75625 	/*
75626 	 * Max number of QPs that can be created in one `create_qp_batch`
75627 	 * command.
75628 	 */
75629 	uint16_t	create_qp_batch_size;
75630 	/*
75631 	 * Max number of QPs that can be destroyed in one `destroy_qp_batch`
75632 	 * command.
75633 	 */
75634 	uint16_t	destroy_qp_batch_size;
75635 	uint16_t	reserved16;
75636 	uint64_t	reserved64;
75637 } creq_query_func_resp_sb_t, *pcreq_query_func_resp_sb_t;
75638 
75639 /**********************
75640  * set_func_resources *
75641  **********************/
75642 
75643 
75644 /* cmdq_set_func_resources (size:448b/56B) */
75645 
75646 typedef struct cmdq_set_func_resources {
75647 	/* Command opcode. */
75648 	uint8_t	opcode;
75649 	/*
75650 	 * Set the following resources for the function:
75651 	 * - Max QP, CQ, MR+MW, SRQ per PF
75652 	 * - Max QP, CQ, MR+MW, SRQ per VF
75653 	 */
75654 	#define CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES UINT32_C(0x84)
75655 	#define CMDQ_SET_FUNC_RESOURCES_OPCODE_LAST		CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES
75656 	/* Size of the command in 16-byte units. */
75657 	uint8_t	cmd_size;
75658 	/* Flags and attribs of the command. */
75659 	uint16_t	flags;
75660 	/*
75661 	 * When set, the 32b `max_mrw_per_vf` field is logically divided
75662 	 * into two 16b fields, `max_mr_per_vf` and `max_av_per_vf`.
75663 	 */
75664 	#define CMDQ_SET_FUNC_RESOURCES_FLAGS_MRAV_RESERVATION_SPLIT	UINT32_C(0x1)
75665 	/* Driver supplied handle to associate the command and the response. */
75666 	uint16_t	cookie;
75667 	/* Size of the response buffer in 16-byte units. */
75668 	uint8_t	resp_size;
75669 	uint8_t	reserved8;
75670 	/* Host address of the response. */
75671 	uint64_t	resp_addr;
75672 	/*
75673 	 * Number of QPs. It is the responsibility of the host to first extend
75674 	 * the existing PBL with new addresses to pages to handle the
75675 	 * adjustment. Must be greater or equal to current.
75676 	 */
75677 	uint32_t	number_of_qp;
75678 	/*
75679 	 * Number of MRWs. It is the responsibility of the host to first extend
75680 	 * the existing PBL with new addresses to pages to handle the
75681 	 * adjustment. Must be greater or equal to current.
75682 	 */
75683 	uint32_t	number_of_mrw;
75684 	/*
75685 	 * Number of SRQs. It is the responsibility of the host to first extend
75686 	 * the existing PBL with new addresses to pages to handle the
75687 	 * adjustment. Must be greater or equal to current.
75688 	 */
75689 	uint32_t	number_of_srq;
75690 	/*
75691 	 * Number of CQs. It is the responsibility of the host to first extend
75692 	 * the existing PBL with new addresses to pages to handle the
75693 	 * adjustment. Must be greater or equal to current.
75694 	 */
75695 	uint32_t	number_of_cq;
75696 	/*
75697 	 * Number of QPs per VF. This field must be set to zero when the flag,
75698 	 * l2_vf_resource_mgmt, is set and RoCE SRIOV is enabled.
75699 	 */
75700 	uint32_t	max_qp_per_vf;
75701 	/*
75702 	 * If the MR/AV split reservation flag is not set, then this field
75703 	 * represents the total number of MR plus AV entries allowed per
75704 	 * VF. For versions of firmware that support the split reservation,
75705 	 * when it is not specified half of the entries will be reserved
75706 	 * for MRs and the other half for AVs.
75707 	 *
75708 	 * If the MR/AV split reservation flag is set, then this
75709 	 * field is logically divided into two 16b fields. Bits `[31:16]`
75710 	 * represents the `max_mr_per_vf` and bits `[15:0]` represents
75711 	 * `max_av_per_vf`. The granularity of these values is defined by
75712 	 * the `mrav_num_entries_unit` field returned by the
75713 	 * `backing_store_qcaps` command.
75714 	 *
75715 	 * This field must be set to zero when the flag, l2_vf_resource_mgmt,
75716 	 * is set and RoCE SRIOV is enabled.
75717 	 */
75718 	uint32_t	max_mrw_per_vf;
75719 	/*
75720 	 * Number of SRQs per VF. This field must be set to zero when the flag,
75721 	 * l2_vf_resource_mgmt, is set and RoCE SRIOV is enabled.
75722 	 */
75723 	uint32_t	max_srq_per_vf;
75724 	/*
75725 	 * Number of CQs per VF. This field must be set to zero when the flag,
75726 	 * l2_vf_resource_mgmt, is set and RoCE SRIOV is enabled.
75727 	 */
75728 	uint32_t	max_cq_per_vf;
75729 	/*
75730 	 * Number of GIDs per VF. This field must be set to zero when the flag,
75731 	 * l2_vf_resource_mgmt, is set and RoCE SRIOV is enabled.
75732 	 */
75733 	uint32_t	max_gid_per_vf;
75734 	/* Statistics context index for this function. */
75735 	uint32_t	stat_ctx_id;
75736 } cmdq_set_func_resources_t, *pcmdq_set_func_resources_t;
75737 
75738 /* creq_set_func_resources_resp (size:128b/16B) */
75739 
75740 typedef struct creq_set_func_resources_resp {
75741 	uint8_t	type;
75742 	/*
75743 	 * This field indicates the exact type of the completion.
75744 	 * By convention, the LSB identifies the length of the
75745 	 * record in 16B units. Even values indicate 16B
75746 	 * records. Odd values indicate 32B
75747 	 * records.
75748 	 */
75749 	#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_MASK	UINT32_C(0x3f)
75750 	#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_SFT	0
75751 	/* QP Async Notification */
75752 		#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
75753 		#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_LAST	CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT
75754 	/* Status of the response. */
75755 	uint8_t	status;
75756 	/* Driver supplied handle to associate the command and the response. */
75757 	uint16_t	cookie;
75758 	uint32_t	reserved32;
75759 	uint8_t	v;
75760 	/*
75761 	 * This value is written by the NIC such that it will be different
75762 	 * for each pass through the completion queue. The even passes
75763 	 * will write 1. The odd passes will write 0.
75764 	 */
75765 	#define CREQ_SET_FUNC_RESOURCES_RESP_V	UINT32_C(0x1)
75766 	/* Event or command opcode. */
75767 	uint8_t	event;
75768 	/* Set function resources command response. */
75769 	#define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES UINT32_C(0x84)
75770 	#define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_LAST		CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES
75771 	uint8_t	reserved48[6];
75772 } creq_set_func_resources_resp_t, *pcreq_set_func_resources_resp_t;
75773 
75774 /*************
75775  * stop_func *
75776  *************/
75777 
75778 
75779 /* cmdq_stop_func (size:128b/16B) */
75780 
75781 typedef struct cmdq_stop_func {
75782 	/* Command opcode. */
75783 	uint8_t	opcode;
75784 	/* Stop the function */
75785 	#define CMDQ_STOP_FUNC_OPCODE_STOP_FUNC UINT32_C(0x82)
75786 	#define CMDQ_STOP_FUNC_OPCODE_LAST	CMDQ_STOP_FUNC_OPCODE_STOP_FUNC
75787 	/* Size of the command in 16-byte units. */
75788 	uint8_t	cmd_size;
75789 	/* Flags and attribs of the command. */
75790 	uint16_t	flags;
75791 	/* Driver supplied handle to associate the command and the response. */
75792 	uint16_t	cookie;
75793 	/* Size of the response buffer in 16-byte units. */
75794 	uint8_t	resp_size;
75795 	uint8_t	reserved8;
75796 	/* Host address of the response. */
75797 	uint64_t	resp_addr;
75798 } cmdq_stop_func_t, *pcmdq_stop_func_t;
75799 
75800 /* creq_stop_func_resp (size:128b/16B) */
75801 
75802 typedef struct creq_stop_func_resp {
75803 	uint8_t	type;
75804 	/*
75805 	 * This field indicates the exact type of the completion.
75806 	 * By convention, the LSB identifies the length of the
75807 	 * record in 16B units. Even values indicate 16B
75808 	 * records. Odd values indicate 32B
75809 	 * records.
75810 	 */
75811 	#define CREQ_STOP_FUNC_RESP_TYPE_MASK	UINT32_C(0x3f)
75812 	#define CREQ_STOP_FUNC_RESP_TYPE_SFT	0
75813 	/* QP Async Notification */
75814 		#define CREQ_STOP_FUNC_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
75815 		#define CREQ_STOP_FUNC_RESP_TYPE_LAST	CREQ_STOP_FUNC_RESP_TYPE_QP_EVENT
75816 	/* Status of the response. */
75817 	uint8_t	status;
75818 	/* Driver supplied handle to associate the command and the response. */
75819 	uint16_t	cookie;
75820 	uint32_t	reserved32;
75821 	uint8_t	v;
75822 	/*
75823 	 * This value is written by the NIC such that it will be different
75824 	 * for each pass through the completion queue. The even passes
75825 	 * will write 1. The odd passes will write 0.
75826 	 */
75827 	#define CREQ_STOP_FUNC_RESP_V	UINT32_C(0x1)
75828 	/* Event or command opcode. */
75829 	uint8_t	event;
75830 	/* Stop PF command response. */
75831 	#define CREQ_STOP_FUNC_RESP_EVENT_STOP_FUNC UINT32_C(0x82)
75832 	#define CREQ_STOP_FUNC_RESP_EVENT_LAST	CREQ_STOP_FUNC_RESP_EVENT_STOP_FUNC
75833 	uint8_t	reserved48[6];
75834 } creq_stop_func_resp_t, *pcreq_stop_func_resp_t;
75835 
75836 /****************
75837  * read_context *
75838  ****************/
75839 
75840 
75841 /* cmdq_read_context (size:192b/24B) */
75842 
75843 typedef struct cmdq_read_context {
75844 	/* Command opcode. */
75845 	uint8_t	opcode;
75846 	/*
75847 	 * Read the current state of any internal resource context. Can only
75848 	 * be issued from a PF.
75849 	 */
75850 	#define CMDQ_READ_CONTEXT_OPCODE_READ_CONTEXT UINT32_C(0x85)
75851 	#define CMDQ_READ_CONTEXT_OPCODE_LAST	CMDQ_READ_CONTEXT_OPCODE_READ_CONTEXT
75852 	/* Size of the command in 16-byte units. */
75853 	uint8_t	cmd_size;
75854 	/* Flags and attribs of the command. */
75855 	uint16_t	flags;
75856 	/* Driver supplied handle to associate the command and the response. */
75857 	uint16_t	cookie;
75858 	/* Size of the response buffer in 16-byte units. */
75859 	uint8_t	resp_size;
75860 	uint8_t	reserved8;
75861 	/* Host address of the response. */
75862 	uint64_t	resp_addr;
75863 	/* Context ID */
75864 	uint32_t	xid;
75865 	/* Context type */
75866 	uint8_t	type;
75867 	/*
75868 	 * Read QPC. The context (448 bytes) goes to resp_addr (as is,
75869 	 * without a header), and resp_size should be set to 28
75870 	 * (448/16).
75871 	 */
75872 	#define CMDQ_READ_CONTEXT_TYPE_QPC UINT32_C(0x0)
75873 	/*
75874 	 * Read CQ. The context (64 bytes) goes to resp_addr (as is,
75875 	 * without a header), and resp_size should be set to 4 (64/16)
75876 	 */
75877 	#define CMDQ_READ_CONTEXT_TYPE_CQ  UINT32_C(0x1)
75878 	/*
75879 	 * Read MRW. The context (128 bytes) goes to resp_addr (as is,
75880 	 * without a header), and resp_size should be set to 8 (128/16)
75881 	 */
75882 	#define CMDQ_READ_CONTEXT_TYPE_MRW UINT32_C(0x2)
75883 	/*
75884 	 * Read SRQ. The context (64 bytes) goes to resp_addr (as is,
75885 	 * without a header), and resp_size should be set to 4 (64/16)
75886 	 */
75887 	#define CMDQ_READ_CONTEXT_TYPE_SRQ UINT32_C(0x3)
75888 	#define CMDQ_READ_CONTEXT_TYPE_LAST CMDQ_READ_CONTEXT_TYPE_SRQ
75889 	uint8_t	unused_0[3];
75890 } cmdq_read_context_t, *pcmdq_read_context_t;
75891 
75892 /* creq_read_context (size:128b/16B) */
75893 
75894 typedef struct creq_read_context {
75895 	uint8_t	type;
75896 	/*
75897 	 * This field indicates the exact type of the completion.
75898 	 * By convention, the LSB identifies the length of the
75899 	 * record in 16B units. Even values indicate 16B
75900 	 * records. Odd values indicate 32B records.
75901 	 * records.
75902 	 */
75903 	#define CREQ_READ_CONTEXT_TYPE_MASK	UINT32_C(0x3f)
75904 	#define CREQ_READ_CONTEXT_TYPE_SFT	0
75905 	/* QP Async Notification */
75906 		#define CREQ_READ_CONTEXT_TYPE_QP_EVENT  UINT32_C(0x38)
75907 		#define CREQ_READ_CONTEXT_TYPE_LAST	CREQ_READ_CONTEXT_TYPE_QP_EVENT
75908 	/* Status of the response. */
75909 	uint8_t	status;
75910 	/* Driver supplied handle to associate the command and the response. */
75911 	uint16_t	cookie;
75912 	uint32_t	reserved32;
75913 	uint8_t	v;
75914 	/*
75915 	 * This value is written by the NIC such that it will be different
75916 	 * for each pass through the completion queue. The even passes
75917 	 * will write 1. The odd passes will write 0.
75918 	 */
75919 	#define CREQ_READ_CONTEXT_V	UINT32_C(0x1)
75920 	/* Event or command opcode. */
75921 	uint8_t	event;
75922 	/*
75923 	 * Read the current state of any internal resource context. Can only
75924 	 * be issued from a PF.
75925 	 */
75926 	#define CREQ_READ_CONTEXT_EVENT_READ_CONTEXT UINT32_C(0x85)
75927 	#define CREQ_READ_CONTEXT_EVENT_LAST	CREQ_READ_CONTEXT_EVENT_READ_CONTEXT
75928 	uint16_t	reserved16;
75929 	uint32_t	reserved_32;
75930 } creq_read_context_t, *pcreq_read_context_t;
75931 
75932 /*****************
75933  * map_tc_to_cos *
75934  *****************/
75935 
75936 
75937 /* cmdq_map_tc_to_cos (size:192b/24B) */
75938 
75939 typedef struct cmdq_map_tc_to_cos {
75940 	/* Command opcode. */
75941 	uint8_t	opcode;
75942 	/* Map TC to COS. Can only be issued from a PF. */
75943 	#define CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS UINT32_C(0x8a)
75944 	#define CMDQ_MAP_TC_TO_COS_OPCODE_LAST	CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS
75945 	/* Size of the command in 16-byte units. */
75946 	uint8_t	cmd_size;
75947 	/* Flags and attribs of the command. */
75948 	uint16_t	flags;
75949 	/* Driver supplied handle to associate the command and the response. */
75950 	uint16_t	cookie;
75951 	/* Size of the response buffer in 16-byte units. */
75952 	uint8_t	resp_size;
75953 	uint8_t	reserved8;
75954 	/* Host address of the response. */
75955 	uint64_t	resp_addr;
75956 	/* 1st COS index mapped to RoCE */
75957 	uint16_t	cos0;
75958 	/* Don't change this COS. */
75959 	#define CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE UINT32_C(0xffff)
75960 	#define CMDQ_MAP_TC_TO_COS_COS0_LAST	CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE
75961 	/* 2nd COS index mapped to RoCE */
75962 	uint16_t	cos1;
75963 	/* Disable this COS. */
75964 	#define CMDQ_MAP_TC_TO_COS_COS1_DISABLE   UINT32_C(0x8000)
75965 	/* Don't change this COS. */
75966 	#define CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE UINT32_C(0xffff)
75967 	#define CMDQ_MAP_TC_TO_COS_COS1_LAST	CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE
75968 	uint32_t	unused_0;
75969 } cmdq_map_tc_to_cos_t, *pcmdq_map_tc_to_cos_t;
75970 
75971 /* creq_map_tc_to_cos_resp (size:128b/16B) */
75972 
75973 typedef struct creq_map_tc_to_cos_resp {
75974 	uint8_t	type;
75975 	/*
75976 	 * This field indicates the exact type of the completion.
75977 	 * By convention, the LSB identifies the length of the
75978 	 * record in 16B units. Even values indicate 16B
75979 	 * records. Odd values indicate 32B
75980 	 * records.
75981 	 */
75982 	#define CREQ_MAP_TC_TO_COS_RESP_TYPE_MASK	UINT32_C(0x3f)
75983 	#define CREQ_MAP_TC_TO_COS_RESP_TYPE_SFT	0
75984 	/* QP Async Notification */
75985 		#define CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
75986 		#define CREQ_MAP_TC_TO_COS_RESP_TYPE_LAST	CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT
75987 	/* Status of the response. */
75988 	uint8_t	status;
75989 	/* Driver supplied handle to associate the command and the response. */
75990 	uint16_t	cookie;
75991 	uint32_t	reserved32;
75992 	uint8_t	v;
75993 	/*
75994 	 * This value is written by the NIC such that it will be different
75995 	 * for each pass through the completion queue. The even passes
75996 	 * will write 1. The odd passes will write 0.
75997 	 */
75998 	#define CREQ_MAP_TC_TO_COS_RESP_V	UINT32_C(0x1)
75999 	/* Event or command opcode. */
76000 	uint8_t	event;
76001 	/* Map TC to COS response. */
76002 	#define CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS UINT32_C(0x8a)
76003 	#define CREQ_MAP_TC_TO_COS_RESP_EVENT_LAST	CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS
76004 	uint8_t	reserved48[6];
76005 } creq_map_tc_to_cos_resp_t, *pcreq_map_tc_to_cos_resp_t;
76006 
76007 /*****************
76008  * query_roce_cc *
76009  *****************/
76010 
76011 
76012 /* cmdq_query_roce_cc (size:128b/16B) */
76013 
76014 typedef struct cmdq_query_roce_cc {
76015 	/* Command opcode. */
76016 	uint8_t	opcode;
76017 	/* Query congestion control. */
76018 	#define CMDQ_QUERY_ROCE_CC_OPCODE_QUERY_ROCE_CC UINT32_C(0x8d)
76019 	#define CMDQ_QUERY_ROCE_CC_OPCODE_LAST	CMDQ_QUERY_ROCE_CC_OPCODE_QUERY_ROCE_CC
76020 	/* Size of the command in 16-byte units. */
76021 	uint8_t	cmd_size;
76022 	/* Flags and attribs of the command. */
76023 	uint16_t	flags;
76024 	/* Driver supplied handle to associate the command and the response. */
76025 	uint16_t	cookie;
76026 	/* Size of the response buffer in 16-byte units. */
76027 	uint8_t	resp_size;
76028 	uint8_t	reserved8;
76029 	/* Host address of the response. */
76030 	uint64_t	resp_addr;
76031 } cmdq_query_roce_cc_t, *pcmdq_query_roce_cc_t;
76032 
76033 /* creq_query_roce_cc_resp (size:128b/16B) */
76034 
76035 typedef struct creq_query_roce_cc_resp {
76036 	uint8_t	type;
76037 	/*
76038 	 * This field indicates the exact type of the completion.
76039 	 * By convention, the LSB identifies the length of the
76040 	 * record in 16B units. Even values indicate 16B
76041 	 * records. Odd values indicate 32B
76042 	 * records.
76043 	 */
76044 	#define CREQ_QUERY_ROCE_CC_RESP_TYPE_MASK	UINT32_C(0x3f)
76045 	#define CREQ_QUERY_ROCE_CC_RESP_TYPE_SFT	0
76046 	/* QP Async Notification */
76047 		#define CREQ_QUERY_ROCE_CC_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
76048 		#define CREQ_QUERY_ROCE_CC_RESP_TYPE_LAST	CREQ_QUERY_ROCE_CC_RESP_TYPE_QP_EVENT
76049 	/* Status of the response. */
76050 	uint8_t	status;
76051 	/* Driver supplied handle to associate the command and the response. */
76052 	uint16_t	cookie;
76053 	/* Side buffer size in 16-byte units */
76054 	uint32_t	size;
76055 	uint8_t	v;
76056 	/*
76057 	 * This value is written by the NIC such that it will be different
76058 	 * for each pass through the completion queue. The even passes
76059 	 * will write 1. The odd passes will write 0.
76060 	 */
76061 	#define CREQ_QUERY_ROCE_CC_RESP_V	UINT32_C(0x1)
76062 	/* Event or command opcode. */
76063 	uint8_t	event;
76064 	/* Query congestion control response. */
76065 	#define CREQ_QUERY_ROCE_CC_RESP_EVENT_QUERY_ROCE_CC UINT32_C(0x8d)
76066 	#define CREQ_QUERY_ROCE_CC_RESP_EVENT_LAST	CREQ_QUERY_ROCE_CC_RESP_EVENT_QUERY_ROCE_CC
76067 	uint8_t	reserved48[6];
76068 } creq_query_roce_cc_resp_t, *pcreq_query_roce_cc_resp_t;
76069 
76070 /* Query congestion control command response side buffer structure. */
76071 /* creq_query_roce_cc_resp_sb (size:256b/32B) */
76072 
76073 typedef struct creq_query_roce_cc_resp_sb {
76074 	/* Command opcode. */
76075 	uint8_t	opcode;
76076 	/* Query congestion control response. */
76077 	#define CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_QUERY_ROCE_CC UINT32_C(0x8d)
76078 	#define CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_LAST	CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_QUERY_ROCE_CC
76079 	/* Status of the response. */
76080 	uint8_t	status;
76081 	/* Driver supplied handle to associate the command and the response. */
76082 	uint16_t	cookie;
76083 	/* Flags and attribs of the command. */
76084 	uint16_t	flags;
76085 	/* Size of the response buffer in 16-byte units. */
76086 	uint8_t	resp_size;
76087 	uint8_t	reserved8;
76088 	uint8_t	enable_cc;
76089 	/* Enable. */
76090 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ENABLE_CC	UINT32_C(0x1)
76091 	/* unused7 is 7 b */
76092 	#define CREQ_QUERY_ROCE_CC_RESP_SB_UNUSED7_MASK  UINT32_C(0xfe)
76093 	#define CREQ_QUERY_ROCE_CC_RESP_SB_UNUSED7_SFT   1
76094 	uint8_t	tos_dscp_tos_ecn;
76095 	/* IP TOS ECN. */
76096 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_ECN_MASK UINT32_C(0x3)
76097 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_ECN_SFT  0
76098 	/*
76099 	 * IP TOS DSCP. When multi-lossless queue feature is enabled,
76100 	 * query applies only to the default traffic class (1).
76101 	 */
76102 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_DSCP_MASK UINT32_C(0xfc)
76103 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_DSCP_SFT 2
76104 	/* Congestion Probability averaging factor. */
76105 	uint8_t	g;
76106 	/* Number of phases in Fast Recovery and Active Increase. */
76107 	uint8_t	num_phases_per_state;
76108 	/* The starting value of rate. */
76109 	uint16_t	init_cr;
76110 	/* The starting value of target rate. */
76111 	uint16_t	init_tr;
76112 	uint8_t	alt_vlan_pcp;
76113 	/* Alternate vlan pcp value for CNP packets. */
76114 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_VLAN_PCP_MASK UINT32_C(0x7)
76115 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_VLAN_PCP_SFT 0
76116 	/* rsvd1 is 5 b */
76117 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD1_MASK	UINT32_C(0xf8)
76118 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD1_SFT	3
76119 	uint8_t	alt_tos_dscp;
76120 	/* Alternate IP TOS DSCP. */
76121 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_TOS_DSCP_MASK UINT32_C(0x3f)
76122 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_TOS_DSCP_SFT 0
76123 	/* rsvd4 is 2 b */
76124 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD4_MASK	UINT32_C(0xc0)
76125 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD4_SFT	6
76126 	uint8_t	cc_mode;
76127 	/* DCTCP CC algorithm. */
76128 	#define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_DCTCP	UINT32_C(0x0)
76129 	/*
76130 	 * Probabilistic marking CC algorithm. On chips with CC Gen 0
76131 	 * support this will be TCP CC algorithm.
76132 	 */
76133 	#define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_PROBABILISTIC UINT32_C(0x1)
76134 	#define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_LAST	CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_PROBABILISTIC
76135 	/* Specifies the RoCE Tx Queue to use for sending CNP packets. */
76136 	uint8_t	tx_queue;
76137 	uint16_t	rtt;
76138 	/* Round trip time in units of usecs */
76139 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RTT_MASK  UINT32_C(0x3fff)
76140 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RTT_SFT   0
76141 	/* rsvd5 is 2 b */
76142 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD5_MASK UINT32_C(0xc000)
76143 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD5_SFT 14
76144 	uint16_t	tcp_cp;
76145 	/* The value used as CP when cc_mode is 1(TCP) */
76146 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TCP_CP_MASK UINT32_C(0x3ff)
76147 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TCP_CP_SFT 0
76148 	/* rsvd6 is 6 b */
76149 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD6_MASK UINT32_C(0xfc00)
76150 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD6_SFT  10
76151 	/* Inactivity time after which QP CC parameters are initialized */
76152 	uint16_t	inactivity_th;
76153 	/* Number of packets per phase. Max is 255. */
76154 	uint8_t	pkts_per_phase;
76155 	/* Amount of time per phase in units of ms. Max is 15 */
76156 	uint8_t	time_per_phase;
76157 	uint32_t	reserved32;
76158 } creq_query_roce_cc_resp_sb_t, *pcreq_query_roce_cc_resp_sb_t;
76159 
76160 /*
76161  * TLV encapsulated Query congestion control command response
76162  * side buffer, with extended TLV record included for specifying
76163  * the extended configuration for CC level 1.
76164  */
76165 /* creq_query_roce_cc_resp_sb_tlv (size:384b/48B) */
76166 
76167 typedef struct creq_query_roce_cc_resp_sb_tlv {
76168 	/*
76169 	 * The command discriminator is used to differentiate between various
76170 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
76171 	 * command messages as well as newer TLV encapsulated HWRM commands.
76172 	 *
76173 	 * For TLV encapsulated messages this field must be 0x8000.
76174 	 */
76175 	uint16_t	cmd_discr;
76176 	uint8_t	reserved_8b;
76177 	uint8_t	tlv_flags;
76178 	/*
76179 	 * Indicates the presence of additional TLV encapsulated data
76180 	 * follows this TLV.
76181 	 */
76182 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE	UINT32_C(0x1)
76183 	/* Last TLV in a sequence of TLVs. */
76184 		#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
76185 	/* More TLVs follow this TLV. */
76186 		#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
76187 	/*
76188 	 * When an HWRM receiver detects a TLV type that it does not
76189 	 * support with the TLV required flag set, the receiver must
76190 	 * reject the HWRM message with an error code indicating an
76191 	 * unsupported TLV type.
76192 	 */
76193 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED	UINT32_C(0x2)
76194 	/* No */
76195 		#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
76196 	/* Yes */
76197 		#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
76198 		#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES
76199 	/*
76200 	 * This field defines the TLV type value which is divided into
76201 	 * two ranges to differentiate between global and local TLV types.
76202 	 * Global TLV types must be unique across all defined TLV types.
76203 	 * Local TLV types are valid only for extensions to a given
76204 	 * HWRM message and may be repeated across different HWRM message
76205 	 * types. There is a direct correlation of each HWRM message type
76206 	 * to a single global TLV type value.
76207 	 *
76208 	 * Global TLV range: `0 - (63k-1)`
76209 	 *
76210 	 * Local TLV range: `63k - (64k-1)`
76211 	 */
76212 	uint16_t	tlv_type;
76213 	/*
76214 	 * Length of the message data encapsulated by this TLV in bytes.
76215 	 * This length does not include the size of the TLV header itself
76216 	 * and it must be an integer multiple of 8B.
76217 	 */
76218 	uint16_t	length;
76219 	/*
76220 	 * Size of the tlv encapsulated response,
76221 	 * including all tlvs and extension data in 16-byte units.
76222 	 */
76223 	uint8_t	total_size;
76224 	uint8_t	reserved56[7];
76225 	/* Command opcode. */
76226 	uint8_t	opcode;
76227 	/* Query congestion control response. */
76228 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_QUERY_ROCE_CC UINT32_C(0x8d)
76229 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_LAST	CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_QUERY_ROCE_CC
76230 	/* Status of the response. */
76231 	uint8_t	status;
76232 	/* Driver supplied handle to associate the command and the response. */
76233 	uint16_t	cookie;
76234 	/* Flags and attribs of the command. */
76235 	uint16_t	flags;
76236 	/* Size of the response buffer in 16-byte units. */
76237 	uint8_t	resp_size;
76238 	uint8_t	reserved8;
76239 	uint8_t	enable_cc;
76240 	/* Enable. */
76241 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ENABLE_CC	UINT32_C(0x1)
76242 	/* unused7 is 7 b */
76243 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_UNUSED7_MASK  UINT32_C(0xfe)
76244 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_UNUSED7_SFT   1
76245 	uint8_t	tos_dscp_tos_ecn;
76246 	/* IP TOS ECN. */
76247 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_ECN_MASK UINT32_C(0x3)
76248 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_ECN_SFT  0
76249 	/*
76250 	 * IP TOS DSCP. When multi-lossless queue feature is enabled,
76251 	 * query applies only to the default traffic class (1).
76252 	 */
76253 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_DSCP_MASK UINT32_C(0xfc)
76254 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_DSCP_SFT 2
76255 	/* Congestion Probability averaging factor. */
76256 	uint8_t	g;
76257 	/* Number of phases in Fast Recovery and Active Increase. */
76258 	uint8_t	num_phases_per_state;
76259 	/* The starting value of rate. */
76260 	uint16_t	init_cr;
76261 	/* The starting value of target rate. */
76262 	uint16_t	init_tr;
76263 	uint8_t	alt_vlan_pcp;
76264 	/* Alternate vlan pcp value for CNP packets. */
76265 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_VLAN_PCP_MASK UINT32_C(0x7)
76266 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_VLAN_PCP_SFT 0
76267 	/* rsvd1 is 5 b */
76268 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD1_MASK	UINT32_C(0xf8)
76269 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD1_SFT	3
76270 	uint8_t	alt_tos_dscp;
76271 	/* Alternate IP TOS DSCP. */
76272 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_TOS_DSCP_MASK UINT32_C(0x3f)
76273 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_TOS_DSCP_SFT 0
76274 	/* rsvd4 is 2 b */
76275 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD4_MASK	UINT32_C(0xc0)
76276 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD4_SFT	6
76277 	uint8_t	cc_mode;
76278 	/* DCTCP CC algorithm. */
76279 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_DCTCP	UINT32_C(0x0)
76280 	/*
76281 	 * Probabilistic marking CC algorithm. On chips with CC Gen 0
76282 	 * support this will be TCP CC algorithm.
76283 	 */
76284 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_PROBABILISTIC UINT32_C(0x1)
76285 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_LAST	CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_PROBABILISTIC
76286 	/* Specifies the RoCE Tx Queue to use for sending CNP packets. */
76287 	uint8_t	tx_queue;
76288 	uint16_t	rtt;
76289 	/* Round trip time in units of usecs */
76290 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RTT_MASK  UINT32_C(0x3fff)
76291 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RTT_SFT   0
76292 	/* rsvd5 is 2 b */
76293 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD5_MASK UINT32_C(0xc000)
76294 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD5_SFT 14
76295 	uint16_t	tcp_cp;
76296 	/* The value used as CP when cc_mode is 1(TCP) */
76297 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TCP_CP_MASK UINT32_C(0x3ff)
76298 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TCP_CP_SFT 0
76299 	/* rsvd6 is 6 b */
76300 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD6_MASK UINT32_C(0xfc00)
76301 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD6_SFT  10
76302 	/* Inactivity time after which QP CC parameters are initialized */
76303 	uint16_t	inactivity_th;
76304 	/* Number of packets per phase. Max is 255. */
76305 	uint8_t	pkts_per_phase;
76306 	/* Amount of time per phase in units of ms. Max is 15 */
76307 	uint8_t	time_per_phase;
76308 	uint32_t	reserved32;
76309 } creq_query_roce_cc_resp_sb_tlv_t, *pcreq_query_roce_cc_resp_sb_tlv_t;
76310 
76311 /* creq_query_roce_cc_gen1_resp_sb_tlv (size:704b/88B) */
76312 
76313 typedef struct creq_query_roce_cc_gen1_resp_sb_tlv {
76314 	/*
76315 	 * The command discriminator is used to differentiate between various
76316 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
76317 	 * command messages as well as newer TLV encapsulated HWRM commands.
76318 	 *
76319 	 * For TLV encapsulated messages this field must be 0x8000.
76320 	 */
76321 	uint16_t	cmd_discr;
76322 	uint8_t	reserved_8b;
76323 	uint8_t	tlv_flags;
76324 	/*
76325 	 * Indicates the presence of additional TLV encapsulated data
76326 	 * follows this TLV.
76327 	 */
76328 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE	UINT32_C(0x1)
76329 	/* Last TLV in a sequence of TLVs. */
76330 		#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
76331 	/* More TLVs follow this TLV. */
76332 		#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
76333 	/*
76334 	 * When an HWRM receiver detects a TLV type that it does not
76335 	 * support with the TLV required flag set, the receiver must
76336 	 * reject the HWRM message with an error code indicating an
76337 	 * unsupported TLV type.
76338 	 */
76339 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED	UINT32_C(0x2)
76340 	/* No */
76341 		#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
76342 	/* Yes */
76343 		#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
76344 		#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES
76345 	/*
76346 	 * This field defines the TLV type value which is divided into
76347 	 * two ranges to differentiate between global and local TLV types.
76348 	 * Global TLV types must be unique across all defined TLV types.
76349 	 * Local TLV types are valid only for extensions to a given
76350 	 * HWRM message and may be repeated across different HWRM message
76351 	 * types. There is a direct correlation of each HWRM message type
76352 	 * to a single global TLV type value.
76353 	 *
76354 	 * Global TLV range: `0 - (63k-1)`
76355 	 *
76356 	 * Local TLV range: `63k - (64k-1)`
76357 	 */
76358 	uint16_t	tlv_type;
76359 	/*
76360 	 * Length of the message data encapsulated by this TLV in bytes.
76361 	 * This length does not include the size of the TLV header itself
76362 	 * and it must be an integer multiple of 8B.
76363 	 */
76364 	uint16_t	length;
76365 	uint64_t	reserved64;
76366 	/* High order bits of inactivity threshold. */
76367 	uint16_t	inactivity_th_hi;
76368 	/*
76369 	 * The number of uS between generation of CNPs when cc_mode is
76370 	 * probabilistic marking.
76371 	 */
76372 	uint16_t	min_time_between_cnps;
76373 	/*
76374 	 * The starting value of congestion probability. Input range
76375 	 * is 0 - 1023.
76376 	 */
76377 	uint16_t	init_cp;
76378 	/*
76379 	 * In tr_update_mode 0, Target Rate (TR) is updated to
76380 	 * halfway between the Current Rate (CR) before and after reduction.
76381 	 * In tr_update_mode 1, TR is updated to CR's value before reduction.
76382 	 */
76383 	uint8_t	tr_update_mode;
76384 	/*
76385 	 * Determine for how many RTTs with CNPs in a row, TR is being updated.
76386 	 * 0: TR is updated when QPC. rtts_with_cnps == 0
76387 	 * 1-6: TR is updated if QPC. rtts_with_cnps <= tr_update_cycles
76388 	 * 7: TR is updated on all reductions.
76389 	 */
76390 	uint8_t	tr_update_cycles;
76391 	/* Number of RTTs in Fast Recovery stage. */
76392 	uint8_t	fr_num_rtts;
76393 	/* Time increment to increase TR in active increase phase. */
76394 	uint8_t	ai_rate_increase;
76395 	/*
76396 	 * Indicates for how many RTTs with CNPs after the first one
76397 	 * to not reduce rate even if CNPs are received.
76398 	 */
76399 	uint16_t	reduction_relax_rtts_th;
76400 	/*
76401 	 * For low rates, additional number of RTTS with CNPs
76402 	 * for which no rate reduction is made.
76403 	 * num_bits: 14
76404 	 */
76405 	uint16_t	additional_relax_cr_th;
76406 	/*
76407 	 * If CR is less than or equal to this value,
76408 	 * then the actual CR average is set to this value
76409 	 * (shifted by bw_avg_weight).
76410 	 */
76411 	uint16_t	cr_min_th;
76412 	/* Log based averaging weight for QPC variable actual_cr_avg. */
76413 	uint8_t	bw_avg_weight;
76414 	/*
76415 	 * Used to compare CR to this factor times QPC.actual_cr_average
76416 	 * as a reduction reference. Values between 0 and 6 represent factor of
76417 	 * 1.125, 1.25, 1.5, 1.75, 2, 2.25, 2.5 respectively.
76418 	 */
76419 	uint8_t	actual_cr_factor;
76420 	/* The level of CR above which CP is set to maximum level. */
76421 	uint16_t	max_cp_cr_th;
76422 	/*
76423 	 * Enable adding fraction of CR to CP.
76424 	 * 0 for disable, 1 for enable.
76425 	 */
76426 	uint8_t	cp_bias_en;
76427 	/* Log based fraction of cr to add to CP when cp_bias_en is 1. */
76428 	uint8_t	cp_bias;
76429 	/*
76430 	 * The value of ECN bits in a CNP packet generated by hardware.
76431 	 * ECN-Capable Transport (ECT) codepoints supported include:
76432 	 * 0 for not_ect, 1 for ect_0, 2 for ect_1
76433 	 */
76434 	uint8_t	cnp_ecn;
76435 	/* Not ECN capable Transport */
76436 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_NOT_ECT UINT32_C(0x0)
76437 	/* ECN Capable Transport-1 */
76438 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_1   UINT32_C(0x1)
76439 	/* ECN Capable Transport-0 */
76440 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_0   UINT32_C(0x2)
76441 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_LAST   CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_0
76442 	/* Enables jitter in RTT. */
76443 	uint8_t	rtt_jitter_en;
76444 	/*
76445 	 * Number of bytes per usec, dependent on port speed.
76446 	 * 200 Gbps: 25,000
76447 	 * 100 Gbps: 12,500
76448 	 * 50 Gbps: 6,250
76449 	 * 25 Gbps: 3125
76450 	 * 10 Gbps: 1250
76451 	 */
76452 	uint16_t	link_bytes_per_usec;
76453 	/*
76454 	 * If CR is greater than or equal to this threshold,
76455 	 * QPC's CC state is reset to its initial state.
76456 	 */
76457 	uint16_t	reset_cc_cr_th;
76458 	/*
76459 	 * The number of valid lsbits in CR and TR.
76460 	 * Supported values include 10 through 14 to support 2^cr_width rate.
76461 	 */
76462 	uint8_t	cr_width;
76463 	/* Lower end of random selection of quota_period. */
76464 	uint8_t	quota_period_min;
76465 	/* Upper end of random selection of quota_period. */
76466 	uint8_t	quota_period_max;
76467 	/*
76468 	 * The absolute maximum possible quota_period,
76469 	 * applicable when rate table for lower 24 levels is used.
76470 	 */
76471 	uint8_t	quota_period_abs_max;
76472 	/* TR never goes below this level. */
76473 	uint16_t	tr_lower_bound;
76474 	/* Factor on probability threshold for adding 0.5 to CR randomly. */
76475 	uint8_t	cr_prob_factor;
76476 	/* Factor on probability threshold for adding 0.5 to TR randomly. */
76477 	uint8_t	tr_prob_factor;
76478 	/*
76479 	 * Threshold to ensure fairness between requester and responder.
76480 	 * If CR is less than the fairness threshold and a quota period has
76481 	 * passed priority will be given to the path that did not last
76482 	 * transfer data.
76483 	 */
76484 	uint16_t	fairness_cr_th;
76485 	/* Log based rate reduction divider. */
76486 	uint8_t	red_div;
76487 	/* Threshold for rate reductions when CNPS received over last RTT. */
76488 	uint8_t	cnp_ratio_th;
76489 	/*
76490 	 * Extended number of RTTS to wait, when there is no congestion,
76491 	 * to start doubling the rate.
76492 	 */
76493 	uint16_t	exp_ai_rtts;
76494 	/* Log based CR to CP ratio used in exponential increase. */
76495 	uint8_t	exp_ai_cr_cp_ratio;
76496 	/* Enable use of lowest 24 rate levels rate_table. */
76497 	uint8_t	use_rate_table;
76498 	/*
76499 	 * Determines after how many congestion free RTTs to start
76500 	 * updating CP to track CR.
76501 	 */
76502 	uint16_t	cp_exp_update_th;
76503 	/*
76504 	 * The threshold on congestion free RTTs above which AI can increase
76505 	 * to 16.
76506 	 */
76507 	uint16_t	high_exp_ai_rtts_th1;
76508 	/*
76509 	 * The threshold on congestion free RTTs above which AI can increase
76510 	 * to 32.
76511 	 */
76512 	uint16_t	high_exp_ai_rtts_th2;
76513 	/*
76514 	 * The number of congestion free RTTs above which
76515 	 * reduction based on actual rate is enabled.
76516 	 */
76517 	uint16_t	actual_cr_cong_free_rtts_th;
76518 	/*
76519 	 * If rtts_with_cong is greater than 7 (severe congestion) and
76520 	 * CR level post reduction is above this threshold,
76521 	 * then TR is capped to 1.5 times CR..
76522 	 */
76523 	uint16_t	severe_cong_cr_th1;
76524 	/*
76525 	 * If rtts_with_cong is greater than 7 (severe congestion) and
76526 	 * CR level post reduction is above this threshold,
76527 	 * then TR is capped to 1.25 times CR..
76528 	 */
76529 	uint16_t	severe_cong_cr_th2;
76530 	/*
76531 	 * The maximum number of 64B that can be transmitted during RTT time,
76532 	 * including all headers and Inter Packet Gap.
76533 	 */
76534 	uint32_t	link64B_per_rtt;
76535 	/*
76536 	 * The number of bytes to subtract from QPC.cc_bucket
76537 	 * when an ack is scheduled.
76538 	 */
76539 	uint8_t	cc_ack_bytes;
76540 	/*
76541 	 * Enables reduction of CR, TR, and CP to init values when
76542 	 * congestion free RTTs is greater than reduce2_init_cong_free_rtts_th.
76543 	 */
76544 	uint8_t	reduce_init_en;
76545 	/*
76546 	 * Minimum threshold value for number of congestion free RTTs before
76547 	 * reducing to init values for CR, TR, and CP when reduce_init_en is
76548 	 * enabled.
76549 	 */
76550 	uint16_t	reduce_init_cong_free_rtts_th;
76551 	/* Enables random no reduction of CR. */
76552 	uint8_t	random_no_red_en;
76553 	/*
76554 	 * Enables coarse correction to actual CR when actual RTT is longer
76555 	 * than nominal.
76556 	 */
76557 	uint8_t	actual_cr_shift_correction_en;
76558 	/* Enables adjustment to refill quota. */
76559 	uint8_t	quota_period_adjust_en;
76560 	uint8_t	reserved[5];
76561 } creq_query_roce_cc_gen1_resp_sb_tlv_t, *pcreq_query_roce_cc_gen1_resp_sb_tlv_t;
76562 
76563 /* creq_query_roce_cc_gen2_resp_sb_tlv (size:512b/64B) */
76564 
76565 typedef struct creq_query_roce_cc_gen2_resp_sb_tlv {
76566 	/*
76567 	 * The command discriminator is used to differentiate between various
76568 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
76569 	 * command messages as well as newer TLV encapsulated HWRM commands.
76570 	 *
76571 	 * For TLV encapsulated messages this field must be 0x8000.
76572 	 */
76573 	uint16_t	cmd_discr;
76574 	uint8_t	reserved_8b;
76575 	uint8_t	tlv_flags;
76576 	/*
76577 	 * Indicates the presence of additional TLV encapsulated data
76578 	 * follows this TLV.
76579 	 */
76580 	#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_TLV_FLAGS_MORE	UINT32_C(0x1)
76581 	/* Last TLV in a sequence of TLVs. */
76582 		#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
76583 	/* More TLVs follow this TLV. */
76584 		#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
76585 	/*
76586 	 * When an HWRM receiver detects a TLV type that it does not
76587 	 * support with the TLV required flag set, the receiver must
76588 	 * reject the HWRM message with an error code indicating an
76589 	 * unsupported TLV type.
76590 	 */
76591 	#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_TLV_FLAGS_REQUIRED	UINT32_C(0x2)
76592 	/* No */
76593 		#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
76594 	/* Yes */
76595 		#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
76596 		#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES
76597 	/*
76598 	 * This field defines the TLV type value which is divided into
76599 	 * two ranges to differentiate between global and local TLV types.
76600 	 * Global TLV types must be unique across all defined TLV types.
76601 	 * Local TLV types are valid only for extensions to a given
76602 	 * HWRM message and may be repeated across different HWRM message
76603 	 * types. There is a direct correlation of each HWRM message type
76604 	 * to a single global TLV type value.
76605 	 *
76606 	 * Global TLV range: `0 - (63k-1)`
76607 	 *
76608 	 * Local TLV range: `63k - (64k-1)`
76609 	 */
76610 	uint16_t	tlv_type;
76611 	/*
76612 	 * Length of the message data encapsulated by this TLV in bytes.
76613 	 * This length does not include the size of the TLV header itself
76614 	 * and it must be an integer multiple of 8B.
76615 	 */
76616 	uint16_t	length;
76617 	uint64_t	reserved64;
76618 	/*
76619 	 * DCN queue level threshold values associated with DCN queue
76620 	 * level table indices 0 to 7.
76621 	 */
76622 	uint16_t	dcn_qlevel_tbl_thr[8];
76623 	/*
76624 	 * DCN queue level table action values.
76625 	 * Returns CR, INC_CNP, UPD_IMM & TR fields associated with
76626 	 * DCN queue level table indices 0 to 7.
76627 	 */
76628 	uint32_t	dcn_qlevel_tbl_act[8];
76629 	/* DCN queue level current rate. */
76630 	#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_DCN_QLEVEL_TBL_ACT_CR_MASK	UINT32_C(0x3fff)
76631 	#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_DCN_QLEVEL_TBL_ACT_CR_SFT	0
76632 	/* DCN queue level increment CNP count. */
76633 	#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_DCN_QLEVEL_TBL_ACT_INC_CNP	UINT32_C(0x4000)
76634 	/* DCN queue level update CR and TR immediately. */
76635 	#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_DCN_QLEVEL_TBL_ACT_UPD_IMM	UINT32_C(0x8000)
76636 	/* DCN queue level target rate */
76637 	#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_DCN_QLEVEL_TBL_ACT_TR_MASK	UINT32_C(0x3fff0000)
76638 	#define CREQ_QUERY_ROCE_CC_GEN2_RESP_SB_TLV_DCN_QLEVEL_TBL_ACT_TR_SFT	16
76639 } creq_query_roce_cc_gen2_resp_sb_tlv_t, *pcreq_query_roce_cc_gen2_resp_sb_tlv_t;
76640 
76641 /***********************
76642  * cmdq_modify_roce_cc *
76643  ***********************/
76644 
76645 
76646 /* cmdq_modify_roce_cc (size:448b/56B) */
76647 
76648 typedef struct cmdq_modify_roce_cc {
76649 	/* Command opcode. */
76650 	uint8_t	opcode;
76651 	/* Modify congestion control. Can only be issued from a PF. */
76652 	#define CMDQ_MODIFY_ROCE_CC_OPCODE_MODIFY_ROCE_CC UINT32_C(0x8c)
76653 	#define CMDQ_MODIFY_ROCE_CC_OPCODE_LAST	CMDQ_MODIFY_ROCE_CC_OPCODE_MODIFY_ROCE_CC
76654 	/* Size of the command in 16-byte units. */
76655 	uint8_t	cmd_size;
76656 	/* Flags and attribs of the command. */
76657 	uint16_t	flags;
76658 	/* Driver supplied handle to associate the command and the response. */
76659 	uint16_t	cookie;
76660 	/* Size of the response buffer in 16-byte units. */
76661 	uint8_t	resp_size;
76662 	uint8_t	reserved8;
76663 	/* Host address of the response. */
76664 	uint64_t	resp_addr;
76665 	/* Modify mask signifies the field that is requesting the change. */
76666 	uint32_t	modify_mask;
76667 	/* Enable change. */
76668 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ENABLE_CC		UINT32_C(0x1)
76669 	/* Running average weight change. */
76670 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_G			UINT32_C(0x2)
76671 	/* Number of phases in Fast Recovery. */
76672 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_NUMPHASEPERSTATE	UINT32_C(0x4)
76673 	/* The starting value of rate change. */
76674 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INIT_CR		UINT32_C(0x8)
76675 	/* The starting value of target rate change. */
76676 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INIT_TR		UINT32_C(0x10)
76677 	/* IP TOS ECN change */
76678 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_ECN		UINT32_C(0x20)
76679 	/* IP TOS DSCP change */
76680 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_DSCP		UINT32_C(0x40)
76681 	/* Alternate IP TOS ECN change */
76682 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ALT_VLAN_PCP	UINT32_C(0x80)
76683 	/* Alternate IP TOS DSCP change */
76684 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ALT_TOS_DSCP	UINT32_C(0x100)
76685 	/* Round trip time in units of usecs */
76686 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_RTT		UINT32_C(0x200)
76687 	/* Congestion Control mode */
76688 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_CC_MODE		UINT32_C(0x400)
76689 	/* The value used as CP when cc_mode is 1(TCP) */
76690 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TCP_CP		UINT32_C(0x800)
76691 	/* Specifies the RoCE Tx Queue to use for sending CNP packets */
76692 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TX_QUEUE		UINT32_C(0x1000)
76693 	/* Inactivity time after which QP CC parameters are initialized */
76694 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INACTIVITY_CP	UINT32_C(0x2000)
76695 	/* Amount of time per phase in units of ms. Max is 15. */
76696 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TIME_PER_PHASE	UINT32_C(0x4000)
76697 	/* Number of packets per phase. Max is 255. */
76698 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_PKTS_PER_PHASE	UINT32_C(0x8000)
76699 	uint8_t	enable_cc;
76700 	/* Enable. */
76701 	#define CMDQ_MODIFY_ROCE_CC_ENABLE_CC	UINT32_C(0x1)
76702 	/* rsvd1 is 7 b */
76703 	#define CMDQ_MODIFY_ROCE_CC_RSVD1_MASK	UINT32_C(0xfe)
76704 	#define CMDQ_MODIFY_ROCE_CC_RSVD1_SFT	1
76705 	/* Congestion Probability averaging factor. */
76706 	uint8_t	g;
76707 	/* Number of phases in Fast Recovery. */
76708 	uint8_t	num_phases_per_state;
76709 	/* Number of packets per phase. Max is 255. */
76710 	uint8_t	pkts_per_phase;
76711 	/*
76712 	 * The starting value of rate.
76713 	 * The max value supported for CC support level 1 is 1024.
76714 	 */
76715 	uint16_t	init_cr;
76716 	/*
76717 	 * The starting value of target rate.
76718 	 * The max value supported for CC support level 1 is 1024.
76719 	 */
76720 	uint16_t	init_tr;
76721 	uint8_t	tos_dscp_tos_ecn;
76722 	/* IP TOS ECN. Valid values are 1 or 2 when ECN is enabled. */
76723 	#define CMDQ_MODIFY_ROCE_CC_TOS_ECN_MASK UINT32_C(0x3)
76724 	#define CMDQ_MODIFY_ROCE_CC_TOS_ECN_SFT  0
76725 	/*
76726 	 * IP TOS DSCP. When multi-lossless queue feature is enabled,
76727 	 * update applies only to the default traffic class (1).
76728 	 */
76729 	#define CMDQ_MODIFY_ROCE_CC_TOS_DSCP_MASK UINT32_C(0xfc)
76730 	#define CMDQ_MODIFY_ROCE_CC_TOS_DSCP_SFT 2
76731 	uint8_t	alt_vlan_pcp;
76732 	/* Alternate vlan pcp value for CNP packets. */
76733 	#define CMDQ_MODIFY_ROCE_CC_ALT_VLAN_PCP_MASK UINT32_C(0x7)
76734 	#define CMDQ_MODIFY_ROCE_CC_ALT_VLAN_PCP_SFT 0
76735 	/* rsvd3 is 5 b */
76736 	#define CMDQ_MODIFY_ROCE_CC_RSVD3_MASK	UINT32_C(0xf8)
76737 	#define CMDQ_MODIFY_ROCE_CC_RSVD3_SFT	3
76738 	uint16_t	alt_tos_dscp;
76739 	/* Alternate IP TOS DSCP. */
76740 	#define CMDQ_MODIFY_ROCE_CC_ALT_TOS_DSCP_MASK UINT32_C(0x3f)
76741 	#define CMDQ_MODIFY_ROCE_CC_ALT_TOS_DSCP_SFT 0
76742 	/* rsvd4 is 10 b */
76743 	#define CMDQ_MODIFY_ROCE_CC_RSVD4_MASK	UINT32_C(0xffc0)
76744 	#define CMDQ_MODIFY_ROCE_CC_RSVD4_SFT	6
76745 	uint16_t	rtt;
76746 	/*
76747 	 * Round trip time in units of usecs.
76748 	 * The max value supported for CC support level 1 is 2047.
76749 	 */
76750 	#define CMDQ_MODIFY_ROCE_CC_RTT_MASK  UINT32_C(0x3fff)
76751 	#define CMDQ_MODIFY_ROCE_CC_RTT_SFT   0
76752 	/* rsvd5 is 2 b */
76753 	#define CMDQ_MODIFY_ROCE_CC_RSVD5_MASK UINT32_C(0xc000)
76754 	#define CMDQ_MODIFY_ROCE_CC_RSVD5_SFT 14
76755 	uint16_t	tcp_cp;
76756 	/* The value used as CP when cc_mode is 1(TCP) */
76757 	#define CMDQ_MODIFY_ROCE_CC_TCP_CP_MASK UINT32_C(0x3ff)
76758 	#define CMDQ_MODIFY_ROCE_CC_TCP_CP_SFT 0
76759 	/* rsvd6 is 6 b */
76760 	#define CMDQ_MODIFY_ROCE_CC_RSVD6_MASK UINT32_C(0xfc00)
76761 	#define CMDQ_MODIFY_ROCE_CC_RSVD6_SFT  10
76762 	uint8_t	cc_mode;
76763 	/* DCTCP */
76764 	#define CMDQ_MODIFY_ROCE_CC_CC_MODE_DCTCP_CC_MODE	UINT32_C(0x0)
76765 	/*
76766 	 * Probabilistic marking. On chips with CC Gen 0 support this
76767 	 * will be TCP CC algorithm.
76768 	 */
76769 	#define CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE UINT32_C(0x1)
76770 	#define CMDQ_MODIFY_ROCE_CC_CC_MODE_LAST		CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE
76771 	/*
76772 	 * Specifies the RoCE Tx Queue to use for sending CNP packets.
76773 	 * CC support level 0 support 0 to 3 Tx queues.
76774 	 * CC support level 1 supports 0 to 7 Tx queues.
76775 	 */
76776 	uint8_t	tx_queue;
76777 	/* Inactivity time after which QP CC parameters are initialized */
76778 	uint16_t	inactivity_th;
76779 	/* Amount of time per phase in units of ms. Max is 15 */
76780 	uint8_t	time_per_phase;
76781 	/* reserved8 is 8 b */
76782 	uint8_t	reserved8_1;
76783 	/* reserved16 is 16 b */
76784 	uint16_t	reserved16;
76785 	uint32_t	reserved32;
76786 	uint64_t	reserved64;
76787 } cmdq_modify_roce_cc_t, *pcmdq_modify_roce_cc_t;
76788 
76789 /*
76790  * TLV encapsulated modify CC command, with extended TLV record
76791  * included for specifying the extended configuration for CC level 1.
76792  */
76793 /* cmdq_modify_roce_cc_tlv (size:640b/80B) */
76794 
76795 typedef struct cmdq_modify_roce_cc_tlv {
76796 	/*
76797 	 * The command discriminator is used to differentiate between various
76798 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
76799 	 * command messages as well as newer TLV encapsulated HWRM commands.
76800 	 *
76801 	 * For TLV encapsulated messages this field must be 0x8000.
76802 	 */
76803 	uint16_t	cmd_discr;
76804 	uint8_t	reserved_8b;
76805 	uint8_t	tlv_flags;
76806 	/*
76807 	 * Indicates the presence of additional TLV encapsulated data
76808 	 * follows this TLV.
76809 	 */
76810 	#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE	UINT32_C(0x1)
76811 	/* Last TLV in a sequence of TLVs. */
76812 		#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
76813 	/* More TLVs follow this TLV. */
76814 		#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
76815 	/*
76816 	 * When an HWRM receiver detects a TLV type that it does not
76817 	 * support with the TLV required flag set, the receiver must
76818 	 * reject the HWRM message with an error code indicating an
76819 	 * unsupported TLV type.
76820 	 */
76821 	#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED	UINT32_C(0x2)
76822 	/* No */
76823 		#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
76824 	/* Yes */
76825 		#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
76826 		#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_LAST CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_YES
76827 	/*
76828 	 * This field defines the TLV type value which is divided into
76829 	 * two ranges to differentiate between global and local TLV types.
76830 	 * Global TLV types must be unique across all defined TLV types.
76831 	 * Local TLV types are valid only for extensions to a given
76832 	 * HWRM message and may be repeated across different HWRM message
76833 	 * types. There is a direct correlation of each HWRM message type
76834 	 * to a single global TLV type value.
76835 	 *
76836 	 * Global TLV range: `0 - (63k-1)`
76837 	 *
76838 	 * Local TLV range: `63k - (64k-1)`
76839 	 */
76840 	uint16_t	tlv_type;
76841 	/*
76842 	 * Length of the message data encapsulated by this TLV in bytes.
76843 	 * This length does not include the size of the TLV header itself
76844 	 * and it must be an integer multiple of 8B.
76845 	 */
76846 	uint16_t	length;
76847 	/*
76848 	 * Size of the tlv encapsulated command, including all tlvs and
76849 	 * extension data in 16-byte units.
76850 	 */
76851 	uint8_t	total_size;
76852 	uint8_t	reserved56[7];
76853 	/* Command opcode. */
76854 	uint8_t	opcode;
76855 	/* Modify congestion control. Can only be issued from a PF. */
76856 	#define CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_MODIFY_ROCE_CC UINT32_C(0x8c)
76857 	#define CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_LAST	CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_MODIFY_ROCE_CC
76858 	/* Size of the command in 16-byte units. */
76859 	uint8_t	cmd_size;
76860 	/* Flags and attribs of the command. */
76861 	uint16_t	flags;
76862 	/* Driver supplied handle to associate the command and the response. */
76863 	uint16_t	cookie;
76864 	/* Size of the response buffer in 16-byte units. */
76865 	uint8_t	resp_size;
76866 	uint8_t	reserved8;
76867 	/* Host address of the response. */
76868 	uint64_t	resp_addr;
76869 	/* Modify mask signifies the field that is requesting the change. */
76870 	uint32_t	modify_mask;
76871 	/* Enable change. */
76872 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ENABLE_CC		UINT32_C(0x1)
76873 	/* Running average weight change. */
76874 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_G			UINT32_C(0x2)
76875 	/* Number of phases in Fast Recovery. */
76876 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_NUMPHASEPERSTATE	UINT32_C(0x4)
76877 	/* The starting value of rate change. */
76878 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INIT_CR		UINT32_C(0x8)
76879 	/* The starting value of target rate change. */
76880 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INIT_TR		UINT32_C(0x10)
76881 	/* IP TOS ECN change */
76882 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TOS_ECN		UINT32_C(0x20)
76883 	/* IP TOS DSCP change */
76884 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TOS_DSCP		UINT32_C(0x40)
76885 	/* Alternate IP TOS ECN change */
76886 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ALT_VLAN_PCP	UINT32_C(0x80)
76887 	/* Alternate IP TOS DSCP change */
76888 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ALT_TOS_DSCP	UINT32_C(0x100)
76889 	/* Round trip time in units of usecs */
76890 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_RTT		UINT32_C(0x200)
76891 	/* Congestion Control mode */
76892 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_CC_MODE		UINT32_C(0x400)
76893 	/* The value used as CP when cc_mode is 1(TCP) */
76894 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TCP_CP		UINT32_C(0x800)
76895 	/* Specifies the RoCE Tx Queue to use for sending CNP packets */
76896 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TX_QUEUE		UINT32_C(0x1000)
76897 	/* Inactivity time after which QP CC parameters are initialized */
76898 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INACTIVITY_CP	UINT32_C(0x2000)
76899 	/* Amount of time per phase in units of ms. Max is 15. */
76900 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TIME_PER_PHASE	UINT32_C(0x4000)
76901 	/* Number of packets per phase. Max is 255. */
76902 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_PKTS_PER_PHASE	UINT32_C(0x8000)
76903 	uint8_t	enable_cc;
76904 	/* Enable. */
76905 	#define CMDQ_MODIFY_ROCE_CC_TLV_ENABLE_CC	UINT32_C(0x1)
76906 	/* rsvd1 is 7 b */
76907 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD1_MASK	UINT32_C(0xfe)
76908 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD1_SFT	1
76909 	/* Congestion Probability averaging factor. */
76910 	uint8_t	g;
76911 	/* Number of phases in Fast Recovery. */
76912 	uint8_t	num_phases_per_state;
76913 	/* Number of packets per phase. Max is 255. */
76914 	uint8_t	pkts_per_phase;
76915 	/*
76916 	 * The starting value of rate.
76917 	 * The max value supported for CC support level 1 is 1024.
76918 	 */
76919 	uint16_t	init_cr;
76920 	/*
76921 	 * The starting value of target rate.
76922 	 * The max value supported for CC support level 1 is 1024.
76923 	 */
76924 	uint16_t	init_tr;
76925 	uint8_t	tos_dscp_tos_ecn;
76926 	/* IP TOS ECN. Valid values are 1 or 2 when ECN is enabled. */
76927 	#define CMDQ_MODIFY_ROCE_CC_TLV_TOS_ECN_MASK UINT32_C(0x3)
76928 	#define CMDQ_MODIFY_ROCE_CC_TLV_TOS_ECN_SFT  0
76929 	/*
76930 	 * IP TOS DSCP. When multi-lossless queue feature is enabled,
76931 	 * update applies only to the default traffic class (1).
76932 	 */
76933 	#define CMDQ_MODIFY_ROCE_CC_TLV_TOS_DSCP_MASK UINT32_C(0xfc)
76934 	#define CMDQ_MODIFY_ROCE_CC_TLV_TOS_DSCP_SFT 2
76935 	uint8_t	alt_vlan_pcp;
76936 	/* Alternate vlan pcp value for CNP packets. */
76937 	#define CMDQ_MODIFY_ROCE_CC_TLV_ALT_VLAN_PCP_MASK UINT32_C(0x7)
76938 	#define CMDQ_MODIFY_ROCE_CC_TLV_ALT_VLAN_PCP_SFT 0
76939 	/* rsvd3 is 5 b */
76940 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD3_MASK	UINT32_C(0xf8)
76941 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD3_SFT	3
76942 	uint16_t	alt_tos_dscp;
76943 	/* Alternate IP TOS DSCP. */
76944 	#define CMDQ_MODIFY_ROCE_CC_TLV_ALT_TOS_DSCP_MASK UINT32_C(0x3f)
76945 	#define CMDQ_MODIFY_ROCE_CC_TLV_ALT_TOS_DSCP_SFT 0
76946 	/* rsvd4 is 10 b */
76947 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD4_MASK	UINT32_C(0xffc0)
76948 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD4_SFT	6
76949 	uint16_t	rtt;
76950 	/*
76951 	 * Round trip time in units of usecs.
76952 	 * The max value supported for CC support level 1 is 2047.
76953 	 */
76954 	#define CMDQ_MODIFY_ROCE_CC_TLV_RTT_MASK  UINT32_C(0x3fff)
76955 	#define CMDQ_MODIFY_ROCE_CC_TLV_RTT_SFT   0
76956 	/* rsvd5 is 2 b */
76957 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD5_MASK UINT32_C(0xc000)
76958 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD5_SFT 14
76959 	uint16_t	tcp_cp;
76960 	/* The value used as CP when cc_mode is 1(TCP) */
76961 	#define CMDQ_MODIFY_ROCE_CC_TLV_TCP_CP_MASK UINT32_C(0x3ff)
76962 	#define CMDQ_MODIFY_ROCE_CC_TLV_TCP_CP_SFT 0
76963 	/* rsvd6 is 6 b */
76964 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD6_MASK UINT32_C(0xfc00)
76965 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD6_SFT  10
76966 	uint8_t	cc_mode;
76967 	/* DCTCP */
76968 	#define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_DCTCP_CC_MODE	UINT32_C(0x0)
76969 	/*
76970 	 * Probabilistic marking. On chips with CC Gen 0 support this
76971 	 * will be TCP CC algorithm.
76972 	 */
76973 	#define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_PROBABILISTIC_CC_MODE UINT32_C(0x1)
76974 	#define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_LAST		CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_PROBABILISTIC_CC_MODE
76975 	/*
76976 	 * Specifies the RoCE Tx Queue to use for sending CNP packets.
76977 	 * CC support level 0 support 0 to 3 Tx queues.
76978 	 * CC support level 1 supports 0 to 7 Tx queues.
76979 	 */
76980 	uint8_t	tx_queue;
76981 	/* Inactivity time after which QP CC parameters are initialized */
76982 	uint16_t	inactivity_th;
76983 	/* Amount of time per phase in units of ms. Max is 15 */
76984 	uint8_t	time_per_phase;
76985 	/* reserved8 is 8 b */
76986 	uint8_t	reserved8_1;
76987 	/* reserved16 is 16 b */
76988 	uint16_t	reserved16;
76989 	uint32_t	reserved32;
76990 	uint64_t	reserved64;
76991 	uint64_t	reservedtlvpad;
76992 } cmdq_modify_roce_cc_tlv_t, *pcmdq_modify_roce_cc_tlv_t;
76993 
76994 /* cmdq_modify_roce_cc_gen1_tlv (size:768b/96B) */
76995 
76996 typedef struct cmdq_modify_roce_cc_gen1_tlv {
76997 	/*
76998 	 * The command discriminator is used to differentiate between various
76999 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
77000 	 * command messages as well as newer TLV encapsulated HWRM commands.
77001 	 *
77002 	 * For TLV encapsulated messages this field must be 0x8000.
77003 	 */
77004 	uint16_t	cmd_discr;
77005 	uint8_t	reserved_8b;
77006 	uint8_t	tlv_flags;
77007 	/*
77008 	 * Indicates the presence of additional TLV encapsulated data
77009 	 * follows this TLV.
77010 	 */
77011 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE	UINT32_C(0x1)
77012 	/* Last TLV in a sequence of TLVs. */
77013 		#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
77014 	/* More TLVs follow this TLV. */
77015 		#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
77016 	/*
77017 	 * When an HWRM receiver detects a TLV type that it does not
77018 	 * support with the TLV required flag set, the receiver must
77019 	 * reject the HWRM message with an error code indicating an
77020 	 * unsupported TLV type.
77021 	 */
77022 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED	UINT32_C(0x2)
77023 	/* No */
77024 		#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
77025 	/* Yes */
77026 		#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
77027 		#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_LAST CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_YES
77028 	/*
77029 	 * This field defines the TLV type value which is divided into
77030 	 * two ranges to differentiate between global and local TLV types.
77031 	 * Global TLV types must be unique across all defined TLV types.
77032 	 * Local TLV types are valid only for extensions to a given
77033 	 * HWRM message and may be repeated across different HWRM message
77034 	 * types. There is a direct correlation of each HWRM message type
77035 	 * to a single global TLV type value.
77036 	 *
77037 	 * Global TLV range: `0 - (63k-1)`
77038 	 *
77039 	 * Local TLV range: `63k - (64k-1)`
77040 	 */
77041 	uint16_t	tlv_type;
77042 	/*
77043 	 * Length of the message data encapsulated by this TLV in bytes.
77044 	 * This length does not include the size of the TLV header itself
77045 	 * and it must be an integer multiple of 8B.
77046 	 */
77047 	uint16_t	length;
77048 	uint64_t	reserved64;
77049 	/* Modify mask signifies the field that is requesting the change. */
77050 	uint64_t	modify_mask;
77051 	/*
77052 	 * Update the number of uS between generation of CNPs for
77053 	 * probabilistic marking mode.
77054 	 */
77055 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_MIN_TIME_BETWEEN_CNPS		UINT32_C(0x1)
77056 	/*
77057 	 * Update starting value of Congestion Probability (CP).
77058 	 * Maximum value supported is 1023.
77059 	 */
77060 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_INIT_CP			UINT32_C(0x2)
77061 	/* Update Target Rate (TR) Update Mode. */
77062 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_UPDATE_MODE			UINT32_C(0x4)
77063 	/* Update number of RTTs with CNPs in a row for TR update. */
77064 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_UPDATE_CYCLES		UINT32_C(0x8)
77065 	/* Update number of RTTs in Fast Recovery stage. */
77066 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_FR_NUM_RTTS			UINT32_C(0x10)
77067 	/* Update time increment to increase TR in active increase phase. */
77068 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_AI_RATE_INCREASE		UINT32_C(0x20)
77069 	/*
77070 	 * Update count of RTTs with CNPs, received after
77071 	 * the first one, to wait, before reducing rate.
77072 	 */
77073 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCTION_RELAX_RTTS_TH	UINT32_C(0x40)
77074 	/*
77075 	 * Update additional number of RTTS with CNPs, to wait,
77076 	 * before further rate reduction, for low rates.
77077 	 */
77078 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ADDITIONAL_RELAX_CR_TH		UINT32_C(0x80)
77079 	/* Update threshold for update to Actual Current Rate (CR) */
77080 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_MIN_TH			UINT32_C(0x100)
77081 	/* Update log based averaging weight for QPC variable actual_cr */
77082 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_BW_AVG_WEIGHT			UINT32_C(0x200)
77083 	/* Update factor used in the computation of rate reduction. */
77084 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_FACTOR		UINT32_C(0x400)
77085 	/* Update the level of CR above which CP is set to maximum level. */
77086 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_MAX_CP_CR_TH			UINT32_C(0x800)
77087 	/* Enable adding fraction of CR to CP. */
77088 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_BIAS_EN			UINT32_C(0x1000)
77089 	/*
77090 	 * Update log based fraction of CR to add to CP
77091 	 * when cp_bias_en is 1.
77092 	 */
77093 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_BIAS			UINT32_C(0x2000)
77094 	/* Update ECN bits in a CNP packet generated by hardware. */
77095 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CNP_ECN			UINT32_C(0x4000)
77096 	/* Update enable of jitter in RTT. */
77097 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RTT_JITTER_EN			UINT32_C(0x8000)
77098 	/* Update number of bytes per usec. */
77099 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_LINK_BYTES_PER_USEC		UINT32_C(0x10000)
77100 	/*
77101 	 * Update threshold used to reset QPC CC state to its initial
77102 	 * state.
77103 	 */
77104 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RESET_CC_CR_TH			UINT32_C(0x20000)
77105 	/* Update number of valid lsbits in CR and TR */
77106 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_WIDTH			UINT32_C(0x40000)
77107 	/* Update lower end of random selection of quota_period. */
77108 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_MIN		UINT32_C(0x80000)
77109 	/* Update upper end of random selection of quota_period. */
77110 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_MAX		UINT32_C(0x100000)
77111 	/*
77112 	 * Update absolute maximum possible quota_period,
77113 	 * when rate table for lower 24 levels is used.
77114 	 */
77115 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_ABS_MAX		UINT32_C(0x200000)
77116 	/* Update lower bound of TR. */
77117 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_LOWER_BOUND			UINT32_C(0x400000)
77118 	/*
77119 	 * Update factor on probability threshold for adding
77120 	 * 0.5 to CR randomly.
77121 	 */
77122 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_PROB_FACTOR			UINT32_C(0x800000)
77123 	/*
77124 	 * Update factor on probability threshold for adding
77125 	 * 0.5 to TR randomly.
77126 	 */
77127 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_PROB_FACTOR			UINT32_C(0x1000000)
77128 	/*
77129 	 * Update threshold that ensures fairness between requester
77130 	 * and responder
77131 	 */
77132 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_FAIRNESS_CR_TH			UINT32_C(0x2000000)
77133 	/* Update log based rate reduction divider. */
77134 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RED_DIV			UINT32_C(0x4000000)
77135 	/*
77136 	 * Update threshold for rate reductions when CNPS received
77137 	 * over last RTT.
77138 	 */
77139 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CNP_RATIO_TH			UINT32_C(0x8000000)
77140 	/*
77141 	 * Update extended number of RTTS to wait,
77142 	 * when there is no congestion, to start doubling the rate.
77143 	 */
77144 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_EXP_AI_RTTS			UINT32_C(0x10000000)
77145 	/* Update log based CR to CP ratio used in exponential increase. */
77146 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_EXP_AI_CR_CP_RATIO		UINT32_C(0x20000000)
77147 	/*
77148 	 * Update threshold, in congestion free RTTs,
77149 	 * that triggers start of CP update to track CR.
77150 	 */
77151 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_EXP_UPDATE_TH		UINT32_C(0x40000000)
77152 	/*
77153 	 * Update threshold on congestion free RTTs above
77154 	 * which AI can increase to 16.
77155 	 */
77156 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_HIGH_EXP_AI_RTTS_TH1		UINT32_C(0x80000000)
77157 	/*
77158 	 * Update threshold on congestion free RTTs above
77159 	 * which AI can increase to 32.
77160 	 */
77161 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_HIGH_EXP_AI_RTTS_TH2		UINT32_C(0x100000000)L
77162 	/* Update use of lowest 24 rate levels rate_table. */
77163 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_USE_RATE_TABLE			UINT32_C(0x200000000)L
77164 	/*
77165 	 * Update the maximum number of 64B that can be transmitted
77166 	 * during RTT time.
77167 	 */
77168 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_LINK64B_PER_RTT		UINT32_C(0x400000000)L
77169 	/*
77170 	 * Update number of congestion free RTTs above which
77171 	 * reduction based on actual rate is enabled.
77172 	 */
77173 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_CONG_FREE_RTTS_TH	UINT32_C(0x800000000)L
77174 	/*
77175 	 * Update threshold used in severe congestion for
77176 	 * limiting TR to 1.5 times CR.
77177 	 */
77178 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_SEVERE_CONG_CR_TH1		UINT32_C(0x1000000000)L
77179 	/*
77180 	 * Update threshold used in severe congestion for
77181 	 * limiting TR to 1.25 times CR.
77182 	 */
77183 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_SEVERE_CONG_CR_TH2		UINT32_C(0x2000000000)L
77184 	/*
77185 	 * Update number of bytes to subtract from QPC.cc_bucket
77186 	 * when an ack is scheduled.
77187 	 */
77188 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CC_ACK_BYTES			UINT32_C(0x4000000000)L
77189 	/* Update enable of reduction of CR, TR, and CP to init values. */
77190 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCE_INIT_EN			UINT32_C(0x8000000000)L
77191 	/*
77192 	 * Update threshold used for reduction of CR, TR, and CP to init
77193 	 * values.
77194 	 */
77195 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCE_INIT_CONG_FREE_RTTS_TH	UINT32_C(0x10000000000)L
77196 	/* Update enable of random no reduction of CR. */
77197 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RANDOM_NO_RED_EN		UINT32_C(0x20000000000)L
77198 	/* Update enable of coarse correction to actual CR. */
77199 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_SHIFT_CORRECTION_EN	UINT32_C(0x40000000000)L
77200 	/* Update enable of adjustment to refill quota. */
77201 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_ADJUST_EN		UINT32_C(0x80000000000)L
77202 	/* High order bits of inactivity threshold. */
77203 	uint16_t	inactivity_th_hi;
77204 	/*
77205 	 * The number of uS between generation of CNPs when cc_mode is
77206 	 * probabilistic marking.
77207 	 */
77208 	uint16_t	min_time_between_cnps;
77209 	/*
77210 	 * The starting value of congestion probability. Input range
77211 	 * is 0 - 1023.
77212 	 */
77213 	uint16_t	init_cp;
77214 	/*
77215 	 * In tr_update_mode 0, Target Rate (TR) is updated to
77216 	 * halfway between the Current Rate (CR) before and after reduction.
77217 	 * In tr_update_mode 1, TR is updated to CR's value before reduction.
77218 	 */
77219 	uint8_t	tr_update_mode;
77220 	/*
77221 	 * Determine for how many RTTs with CNPs in a row, TR is being updated.
77222 	 * 0: TR is updated when QPC. rtts_with_cnps == 0
77223 	 * 1-6: TR is updated if QPC. rtts_with_cnps <= tr_update_cycles
77224 	 * 7: TR is updated on all reductions.
77225 	 */
77226 	uint8_t	tr_update_cycles;
77227 	/* Number of RTTs in Fast Recovery stage. */
77228 	uint8_t	fr_num_rtts;
77229 	/* Time increment to increase TR in active increase phase. */
77230 	uint8_t	ai_rate_increase;
77231 	/*
77232 	 * Indicates for how many RTTs with CNPs after the first one
77233 	 * to not reduce rate even if CNPs are received.
77234 	 */
77235 	uint16_t	reduction_relax_rtts_th;
77236 	/*
77237 	 * For low rates, additional number of RTTS with CNPs
77238 	 * for which no rate reduction is made.
77239 	 * num_bits: 14
77240 	 */
77241 	uint16_t	additional_relax_cr_th;
77242 	/*
77243 	 * If CR is less than or equal to this value,
77244 	 * then the actual CR average is set to this value
77245 	 * (shifted by bw_avg_weight).
77246 	 */
77247 	uint16_t	cr_min_th;
77248 	/* Log based averaging weight for QPC variable actual_cr_avg. */
77249 	uint8_t	bw_avg_weight;
77250 	/*
77251 	 * Used to compare CR to this factor times QPC.actual_cr_average
77252 	 * as a reduction reference. Values between 0 and 6 represent factor of
77253 	 * 1.125, 1.25, 1.5, 1.75, 2, 2.25, 2.5 respectively.
77254 	 */
77255 	uint8_t	actual_cr_factor;
77256 	/* The level of CR above which CP is set to maximum level. */
77257 	uint16_t	max_cp_cr_th;
77258 	/*
77259 	 * Enable adding fraction of CR to CP.
77260 	 * 0 for disable, 1 for enable.
77261 	 */
77262 	uint8_t	cp_bias_en;
77263 	/* Log based fraction of cr to add to CP when cp_bias_en is 1. */
77264 	uint8_t	cp_bias;
77265 	/*
77266 	 * The value of ECN bits in a CNP packet generated by hardware.
77267 	 * ECN-Capable Transport (ECT) codepoints supported include:
77268 	 * 0 for not_ect, 1 for ect_0, 2 for ect_1
77269 	 */
77270 	uint8_t	cnp_ecn;
77271 	/* Not ECN capable Transport */
77272 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_NOT_ECT UINT32_C(0x0)
77273 	/* ECN Capable Transport-1 */
77274 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_1   UINT32_C(0x1)
77275 	/* ECN Capable Transport-0 */
77276 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_0   UINT32_C(0x2)
77277 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_LAST   CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_0
77278 	/* Enables jitter in RTT. */
77279 	uint8_t	rtt_jitter_en;
77280 	/*
77281 	 * Number of bytes per usec, dependent on port speed.
77282 	 * 200 Gbps: 25,000
77283 	 * 100 Gbps: 12,500
77284 	 * 50 Gbps: 6,250
77285 	 * 25 Gbps: 3125
77286 	 * 10 Gbps: 1250
77287 	 */
77288 	uint16_t	link_bytes_per_usec;
77289 	/*
77290 	 * If CR is greater than or equal to this threshold,
77291 	 * QPC's CC state is reset to its initial state.
77292 	 */
77293 	uint16_t	reset_cc_cr_th;
77294 	/*
77295 	 * The number of valid lsbits in CR and TR.
77296 	 * Supported values include 10 through 14 to support 2^cr_width rate.
77297 	 */
77298 	uint8_t	cr_width;
77299 	/* Lower end of random selection of quota_period. */
77300 	uint8_t	quota_period_min;
77301 	/* Upper end of random selection of quota_period. */
77302 	uint8_t	quota_period_max;
77303 	/*
77304 	 * The absolute maximum possible quota_period,
77305 	 * applicable when rate table for lower 24 levels is used.
77306 	 */
77307 	uint8_t	quota_period_abs_max;
77308 	/* TR never goes below this level. */
77309 	uint16_t	tr_lower_bound;
77310 	/* Factor on probability threshold for adding 0.5 to CR randomly. */
77311 	uint8_t	cr_prob_factor;
77312 	/* Factor on probability threshold for adding 0.5 to TR randomly. */
77313 	uint8_t	tr_prob_factor;
77314 	/*
77315 	 * Threshold to ensure fairness between requester and responder.
77316 	 * If CR is less than the fairness threshold and a quota period has
77317 	 * passed priority will be given to the path that did not last
77318 	 * transfer data.
77319 	 */
77320 	uint16_t	fairness_cr_th;
77321 	/* Log based rate reduction divider. */
77322 	uint8_t	red_div;
77323 	/* Threshold for rate reductions when CNPS received over last RTT. */
77324 	uint8_t	cnp_ratio_th;
77325 	/*
77326 	 * Extended number of RTTS to wait, when there is no congestion,
77327 	 * to start doubling the rate.
77328 	 */
77329 	uint16_t	exp_ai_rtts;
77330 	/* Log based CR to CP ratio used in exponential increase. */
77331 	uint8_t	exp_ai_cr_cp_ratio;
77332 	/* Enable use of lowest 24 rate levels rate_table. */
77333 	uint8_t	use_rate_table;
77334 	/*
77335 	 * Determines after how many congestion free RTTs to start
77336 	 * updating CP to track CR.
77337 	 */
77338 	uint16_t	cp_exp_update_th;
77339 	/*
77340 	 * The threshold on congestion free RTTs above which AI can increase
77341 	 * to 16.
77342 	 */
77343 	uint16_t	high_exp_ai_rtts_th1;
77344 	/*
77345 	 * The threshold on congestion free RTTs above which AI can increase
77346 	 * to 32.
77347 	 */
77348 	uint16_t	high_exp_ai_rtts_th2;
77349 	/*
77350 	 * The number of congestion free RTTs above which
77351 	 * reduction based on actual rate is enabled.
77352 	 */
77353 	uint16_t	actual_cr_cong_free_rtts_th;
77354 	/*
77355 	 * If rtts_with_cong is greater than 7 (severe congestion) and
77356 	 * CR level post reduction is above this threshold,
77357 	 * then TR is capped to 1.5 times CR..
77358 	 */
77359 	uint16_t	severe_cong_cr_th1;
77360 	/*
77361 	 * If rtts_with_cong is greater than 7 (severe congestion) and
77362 	 * CR level post reduction is above this threshold,
77363 	 * then TR is capped to 1.25 times CR..
77364 	 */
77365 	uint16_t	severe_cong_cr_th2;
77366 	/*
77367 	 * The maximum number of 64B that can be transmitted during RTT time,
77368 	 * including all headers and Inter Packet Gap.
77369 	 */
77370 	uint32_t	link64B_per_rtt;
77371 	/*
77372 	 * The number of bytes to subtract from QPC.cc_bucket
77373 	 * when an ack is scheduled.
77374 	 */
77375 	uint8_t	cc_ack_bytes;
77376 	/*
77377 	 * Enables reduction of CR, TR, and CP to init values when
77378 	 * congestion free RTTs is greater than reduce2_init_cong_free_rtts_th.
77379 	 */
77380 	uint8_t	reduce_init_en;
77381 	/*
77382 	 * Minimum threshold value for number of congestion free RTTs before
77383 	 * reducing to init values for CR, TR, and CP when reduce_init_en is
77384 	 * enabled.
77385 	 */
77386 	uint16_t	reduce_init_cong_free_rtts_th;
77387 	/* Enables random no reduction of CR. */
77388 	uint8_t	random_no_red_en;
77389 	/*
77390 	 * Enables coarse correction to actual CR when actual RTT is longer
77391 	 * than nominal.
77392 	 */
77393 	uint8_t	actual_cr_shift_correction_en;
77394 	/* Enables adjustment to refill quota. */
77395 	uint8_t	quota_period_adjust_en;
77396 	uint8_t	reserved[5];
77397 } cmdq_modify_roce_cc_gen1_tlv_t, *pcmdq_modify_roce_cc_gen1_tlv_t;
77398 
77399 /* cmdq_modify_roce_cc_gen2_tlv (size:256b/32B) */
77400 
77401 typedef struct cmdq_modify_roce_cc_gen2_tlv {
77402 	/*
77403 	 * The command discriminator is used to differentiate between various
77404 	 * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
77405 	 * command messages as well as newer TLV encapsulated HWRM commands.
77406 	 *
77407 	 * For TLV encapsulated messages this field must be 0x8000.
77408 	 */
77409 	uint16_t	cmd_discr;
77410 	uint8_t	reserved_8b;
77411 	uint8_t	tlv_flags;
77412 	/*
77413 	 * Indicates the presence of additional TLV encapsulated data
77414 	 * follows this TLV.
77415 	 */
77416 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_TLV_FLAGS_MORE	UINT32_C(0x1)
77417 	/* Last TLV in a sequence of TLVs. */
77418 		#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_TLV_FLAGS_MORE_LAST	UINT32_C(0x0)
77419 	/* More TLVs follow this TLV. */
77420 		#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
77421 	/*
77422 	 * When an HWRM receiver detects a TLV type that it does not
77423 	 * support with the TLV required flag set, the receiver must
77424 	 * reject the HWRM message with an error code indicating an
77425 	 * unsupported TLV type.
77426 	 */
77427 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_TLV_FLAGS_REQUIRED	UINT32_C(0x2)
77428 	/* No */
77429 		#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_TLV_FLAGS_REQUIRED_NO	(UINT32_C(0x0) << 1)
77430 	/* Yes */
77431 		#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
77432 		#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_TLV_FLAGS_REQUIRED_LAST CMDQ_MODIFY_ROCE_CC_GEN2_TLV_TLV_FLAGS_REQUIRED_YES
77433 	/*
77434 	 * This field defines the TLV type value which is divided into
77435 	 * two ranges to differentiate between global and local TLV types.
77436 	 * Global TLV types must be unique across all defined TLV types.
77437 	 * Local TLV types are valid only for extensions to a given
77438 	 * HWRM message and may be repeated across different HWRM message
77439 	 * types. There is a direct correlation of each HWRM message type
77440 	 * to a single global TLV type value.
77441 	 *
77442 	 * Global TLV range: `0 - (63k-1)`
77443 	 *
77444 	 * Local TLV range: `63k - (64k-1)`
77445 	 */
77446 	uint16_t	tlv_type;
77447 	/*
77448 	 * Length of the message data encapsulated by this TLV in bytes.
77449 	 * This length does not include the size of the TLV header itself
77450 	 * and it must be an integer multiple of 8B.
77451 	 */
77452 	uint16_t	length;
77453 	uint64_t	reserved64;
77454 	/* Modify mask signifies the field that is requesting the change. */
77455 	uint64_t	modify_mask;
77456 	/*
77457 	 * Modify the specific DCN queue level table index data.
77458 	 * This must be set, to select the table index that needs an
77459 	 * update.
77460 	 */
77461 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_MODIFY_MASK_DCN_QLEVEL_TBL_IDX	UINT32_C(0x1)
77462 	/* Modify the DCN queue level threshold. */
77463 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_MODIFY_MASK_DCN_QLEVEL_TBL_THR	UINT32_C(0x2)
77464 	/* Modify DCN queue level current rate. */
77465 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_MODIFY_MASK_DCN_QLEVEL_TBL_CR	UINT32_C(0x4)
77466 	/* Modify DCN queue level increment CNP count. */
77467 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_MODIFY_MASK_DCN_QLEVEL_TBL_INC_CNP	UINT32_C(0x8)
77468 	/* Modify DCN queue level update current & target rate immediately. */
77469 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_MODIFY_MASK_DCN_QLEVEL_TBL_UPD_IMM	UINT32_C(0x10)
77470 	/* Modify DCN queue level target rate. */
77471 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_MODIFY_MASK_DCN_QLEVEL_TBL_TR	UINT32_C(0x20)
77472 	/* DCN queue level table index. Valid values are from 0 to 7. */
77473 	uint8_t	dcn_qlevel_tbl_idx;
77474 	uint8_t	reserved8;
77475 	/*
77476 	 * DCN queue level threshold value associated with a DCN queue
77477 	 * level table index.
77478 	 */
77479 	uint16_t	dcn_qlevel_tbl_thr;
77480 	/*
77481 	 * DCN queue level table action.
77482 	 * Updates CR, INC_CNP, UPD_IMM & TR fields associated with the
77483 	 * DCN queue level table index.
77484 	 */
77485 	uint32_t	dcn_qlevel_tbl_act;
77486 	/* DCN queue level current rate. */
77487 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_DCN_QLEVEL_TBL_ACT_CR_MASK	UINT32_C(0x3fff)
77488 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_DCN_QLEVEL_TBL_ACT_CR_SFT	0
77489 	/* DCN queue level increment CNP count. */
77490 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_DCN_QLEVEL_TBL_ACT_INC_CNP	UINT32_C(0x4000)
77491 	/* DCN queue level update CR and TR immediately. */
77492 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_DCN_QLEVEL_TBL_ACT_UPD_IMM	UINT32_C(0x8000)
77493 	/* DCN queue level target rate */
77494 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_DCN_QLEVEL_TBL_ACT_TR_MASK	UINT32_C(0x3fff0000)
77495 	#define CMDQ_MODIFY_ROCE_CC_GEN2_TLV_DCN_QLEVEL_TBL_ACT_TR_SFT	16
77496 } cmdq_modify_roce_cc_gen2_tlv_t, *pcmdq_modify_roce_cc_gen2_tlv_t;
77497 
77498 /* creq_modify_roce_cc_resp (size:128b/16B) */
77499 
77500 typedef struct creq_modify_roce_cc_resp {
77501 	uint8_t	type;
77502 	/*
77503 	 * This field indicates the exact type of the completion.
77504 	 * By convention, the LSB identifies the length of the
77505 	 * record in 16B units. Even values indicate 16B
77506 	 * records. Odd values indicate 32B
77507 	 * records.
77508 	 */
77509 	#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_MASK	UINT32_C(0x3f)
77510 	#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_SFT	0
77511 	/* QP Async Notification */
77512 		#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
77513 		#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_LAST	CREQ_MODIFY_ROCE_CC_RESP_TYPE_QP_EVENT
77514 	/* Status of the response. */
77515 	uint8_t	status;
77516 	/* Driver supplied handle to associate the command and the response. */
77517 	uint16_t	cookie;
77518 	uint32_t	reserved32;
77519 	uint8_t	v;
77520 	/*
77521 	 * This value is written by the NIC such that it will be different
77522 	 * for each pass through the completion queue. The even passes
77523 	 * will write 1. The odd passes will write 0.
77524 	 */
77525 	#define CREQ_MODIFY_ROCE_CC_RESP_V	UINT32_C(0x1)
77526 	/* Event or command opcode. */
77527 	uint8_t	event;
77528 	/* Modify congestion control response. */
77529 	#define CREQ_MODIFY_ROCE_CC_RESP_EVENT_MODIFY_ROCE_CC UINT32_C(0x8c)
77530 	#define CREQ_MODIFY_ROCE_CC_RESP_EVENT_LAST	CREQ_MODIFY_ROCE_CC_RESP_EVENT_MODIFY_ROCE_CC
77531 	uint8_t	reserved48[6];
77532 } creq_modify_roce_cc_resp_t, *pcreq_modify_roce_cc_resp_t;
77533 
77534 /******************************
77535  * cmdq_set_link_aggr_mode_cc *
77536  ******************************/
77537 
77538 
77539 /* cmdq_set_link_aggr_mode_cc (size:320b/40B) */
77540 
77541 typedef struct cmdq_set_link_aggr_mode_cc {
77542 	/* Command opcode. */
77543 	uint8_t	opcode;
77544 	/* Set LAG mode. */
77545 	#define CMDQ_SET_LINK_AGGR_MODE_OPCODE_SET_LINK_AGGR_MODE UINT32_C(0x8f)
77546 	#define CMDQ_SET_LINK_AGGR_MODE_OPCODE_LAST		CMDQ_SET_LINK_AGGR_MODE_OPCODE_SET_LINK_AGGR_MODE
77547 	/* Size of the command in 16-byte units. */
77548 	uint8_t	cmd_size;
77549 	/* Flags and attribs of the command. */
77550 	uint16_t	flags;
77551 	/* Driver supplied handle to associate the command and the response. */
77552 	uint16_t	cookie;
77553 	/* Size of the response buffer in 16-byte units. */
77554 	uint8_t	resp_size;
77555 	uint8_t	reserved8;
77556 	/* Host address of the response. */
77557 	uint64_t	resp_addr;
77558 	/* Modify mask signifies the field that is requesting the change. */
77559 	uint32_t	modify_mask;
77560 	/* Enable Link aggregation. */
77561 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_AGGR_EN		UINT32_C(0x1)
77562 	/* Bitmap of ports that are eligible to transmit RoCE traffic. */
77563 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_ACTIVE_PORT_MAP	UINT32_C(0x2)
77564 	/* Bitmap of ports that are members of the RoCE LAG. */
77565 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_MEMBER_PORT_MAP	UINT32_C(0x4)
77566 	/* Link aggregation mode being used. */
77567 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_AGGR_MODE	UINT32_C(0x8)
77568 	/* Stat context ID for all the ports. */
77569 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_STAT_CTX_ID	UINT32_C(0x10)
77570 	uint8_t	aggr_enable;
77571 	/* Enable Link aggregation. */
77572 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_ENABLE	UINT32_C(0x1)
77573 	/* rsvd1 is 7 b */
77574 	#define CMDQ_SET_LINK_AGGR_MODE_RSVD1_MASK	UINT32_C(0xfe)
77575 	#define CMDQ_SET_LINK_AGGR_MODE_RSVD1_SFT	1
77576 	uint8_t	active_port_map;
77577 	/* Bitmap of ports that are eligible to transmit RoCE traffic. */
77578 	#define CMDQ_SET_LINK_AGGR_MODE_ACTIVE_PORT_MAP_MASK UINT32_C(0xf)
77579 	#define CMDQ_SET_LINK_AGGR_MODE_ACTIVE_PORT_MAP_SFT 0
77580 	/* rsvd2 is 4 b */
77581 	#define CMDQ_SET_LINK_AGGR_MODE_RSVD2_MASK	UINT32_C(0xf0)
77582 	#define CMDQ_SET_LINK_AGGR_MODE_RSVD2_SFT	4
77583 	/* Bitmap of ports that are members of the RoCE LAG. */
77584 	uint8_t	member_port_map;
77585 	/* Link aggregation mode being used. */
77586 	uint8_t	link_aggr_mode;
77587 	/* active active mode. */
77588 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_ACTIVE_ACTIVE UINT32_C(0x1)
77589 	/* active backup mode. */
77590 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_ACTIVE_BACKUP UINT32_C(0x2)
77591 	/* Balance XOR mode. */
77592 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_BALANCE_XOR   UINT32_C(0x3)
77593 	/* 802.3AD mode. */
77594 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_802_3_AD	UINT32_C(0x4)
77595 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_LAST	CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_802_3_AD
77596 	/* Stat context IDs for all 4 ports. */
77597 	uint16_t	stat_ctx_id[4];
77598 	uint64_t	rsvd1;
77599 } cmdq_set_link_aggr_mode_cc_t, *pcmdq_set_link_aggr_mode_cc_t;
77600 
77601 /* creq_set_link_aggr_mode_resources_resp (size:128b/16B) */
77602 
77603 typedef struct creq_set_link_aggr_mode_resources_resp {
77604 	uint8_t	type;
77605 	/*
77606 	 * This field indicates the exact type of the completion.
77607 	 * By convention, the LSB identifies the length of the
77608 	 * record in 16B units. Even values indicate 16B
77609 	 * records. Odd values indicate 32B
77610 	 * records.
77611 	 */
77612 	#define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_MASK	UINT32_C(0x3f)
77613 	#define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_SFT	0
77614 	/* QP Async Notification */
77615 		#define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
77616 		#define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_LAST	CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_QP_EVENT
77617 	/* Status of the response. */
77618 	uint8_t	status;
77619 	/* Driver supplied handle to associate the command and the response. */
77620 	uint16_t	cookie;
77621 	uint32_t	reserved32;
77622 	uint8_t	v;
77623 	/*
77624 	 * This value is written by the NIC such that it will be different
77625 	 * for each pass through the completion queue. The even passes
77626 	 * will write 1. The odd passes will write 0.
77627 	 */
77628 	#define CREQ_SET_LINK_AGGR_MODE_RESP_V	UINT32_C(0x1)
77629 	/* Event or command opcode. */
77630 	uint8_t	event;
77631 	/* Set LAG mode. */
77632 	#define CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_SET_LINK_AGGR_MODE UINT32_C(0x8f)
77633 	#define CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_LAST		CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_SET_LINK_AGGR_MODE
77634 	uint8_t	reserved48[6];
77635 } creq_set_link_aggr_mode_resources_resp_t, *pcreq_set_link_aggr_mode_resources_resp_t;
77636 
77637 /* Send a request from VF to pass a command to the PF. VF HSI is suspended. */
77638 /* cmdq_vf_backchannel_request (size:256b/32B) */
77639 
77640 typedef struct cmdq_vf_backchannel_request {
77641 	/* Command opcode. */
77642 	uint8_t	opcode;
77643 	/*
77644 	 * Send a request from VF to pass a command to the PF. VF HSI is
77645 	 * suspended until the PF returns the response.
77646 	 */
77647 	#define CMDQ_VF_BACKCHANNEL_REQUEST_OPCODE_VF_BACKCHANNEL_REQUEST UINT32_C(0x86)
77648 	#define CMDQ_VF_BACKCHANNEL_REQUEST_OPCODE_LAST		CMDQ_VF_BACKCHANNEL_REQUEST_OPCODE_VF_BACKCHANNEL_REQUEST
77649 	/* Size of the command in 16-byte units. */
77650 	uint8_t	cmd_size;
77651 	/* Flags and attribs of the command. */
77652 	uint16_t	flags;
77653 	/* Driver supplied handle to associate the command and the response. */
77654 	uint16_t	cookie;
77655 	/* Size of the response buffer in 16-byte units. */
77656 	uint8_t	resp_size;
77657 	uint8_t	reserved8;
77658 	/* Host address of the response. */
77659 	uint64_t	resp_addr;
77660 	/* Address of command request structure in VF space */
77661 	uint64_t	command_addr;
77662 	/*
77663 	 * Command request length (up to 4K). An optional address of the extended
77664 	 * response buffer should be provided in the request.
77665 	 */
77666 	uint16_t	command_length;
77667 	uint8_t	unused_0[6];
77668 } cmdq_vf_backchannel_request_t, *pcmdq_vf_backchannel_request_t;
77669 
77670 /* Read VF memory (primarily to get the backchannel request blob). */
77671 /* cmdq_read_vf_memory (size:256b/32B) */
77672 
77673 typedef struct cmdq_read_vf_memory {
77674 	/* Command opcode. */
77675 	uint8_t	opcode;
77676 	/*
77677 	 * Read VF memory (primarily to get the backchannel request blob). Can
77678 	 * only be issued from a PF.
77679 	 */
77680 	#define CMDQ_READ_VF_MEMORY_OPCODE_READ_VF_MEMORY UINT32_C(0x87)
77681 	#define CMDQ_READ_VF_MEMORY_OPCODE_LAST	CMDQ_READ_VF_MEMORY_OPCODE_READ_VF_MEMORY
77682 	/* Size of the command in 16-byte units. */
77683 	uint8_t	cmd_size;
77684 	/* Flags and attribs of the command. */
77685 	uint16_t	flags;
77686 	/* Driver supplied handle to associate the command and the response. */
77687 	uint16_t	cookie;
77688 	/* Size of the response buffer in 16-byte units. */
77689 	uint8_t	resp_size;
77690 	uint8_t	reserved8;
77691 	/* Host address of the response. */
77692 	uint64_t	resp_addr;
77693 	/* Address of memory in VF space to read */
77694 	uint64_t	addr;
77695 	/* VF id, as provided in 0xC0 VF request notification */
77696 	uint16_t	vf_id;
77697 	/* Length to read, up to 4K */
77698 	uint16_t	length;
77699 	uint32_t	unused_0;
77700 } cmdq_read_vf_memory_t, *pcmdq_read_vf_memory_t;
77701 
77702 /* Write VF memory (primarily to put the backchannel response blob). */
77703 /* cmdq_complete_vf_request (size:320b/40B) */
77704 
77705 typedef struct cmdq_complete_vf_request {
77706 	/* Command opcode. */
77707 	uint8_t	opcode;
77708 	/*
77709 	 * Write VF memory (primarily to put the backchannel response blob),
77710 	 * and reenable VF HSI (post a CAG completion to it). Can only be
77711 	 * issued from a PF.
77712 	 */
77713 	#define CMDQ_COMPLETE_VF_REQUEST_OPCODE_COMPLETE_VF_REQUEST UINT32_C(0x88)
77714 	#define CMDQ_COMPLETE_VF_REQUEST_OPCODE_LAST		CMDQ_COMPLETE_VF_REQUEST_OPCODE_COMPLETE_VF_REQUEST
77715 	/* Size of the command in 16-byte units. */
77716 	uint8_t	cmd_size;
77717 	/* Flags and attribs of the command. */
77718 	uint16_t	flags;
77719 	/* Driver supplied handle to associate the command and the response. */
77720 	uint16_t	cookie;
77721 	/* Size of the response buffer in 16-byte units. */
77722 	uint8_t	resp_size;
77723 	uint8_t	reserved8;
77724 	/* Host address of the response. */
77725 	uint64_t	resp_addr;
77726 	/*
77727 	 * Optional address of extended response in VF space to write. Length is
77728 	 * in resp_size in 16 byte units.
77729 	 */
77730 	uint64_t	addr;
77731 	/* Completion misc field to VF CREQ */
77732 	uint32_t	vf_misc;
77733 	/* VF id, as provided in 0xC0 VF request notification */
77734 	uint16_t	vf_id;
77735 	/* Completion cookie for the VF command, goes to VF CREQ */
77736 	uint16_t	vf_cookie;
77737 	/* Completion status for the VF command, goes to VF CREQ */
77738 	uint8_t	vf_status;
77739 	uint8_t	unused_0[3];
77740 	uint32_t	unused_1;
77741 } cmdq_complete_vf_request_t, *pcmdq_complete_vf_request_t;
77742 
77743 /*****************************
77744  * orchestrate_qid_migration *
77745  *****************************/
77746 
77747 
77748 /* cmdq_orchestrate_qid_migration (size:256b/32B) */
77749 
77750 typedef struct cmdq_orchestrate_qid_migration {
77751 	/* Command opcode. */
77752 	uint8_t	opcode;
77753 	/*
77754 	 * This command updates the QP context id ranges on the PF,
77755 	 * to orchestrate QP context id range migration for devices that
77756 	 * support the pseudo-static QP allocation feature.
77757 	 */
77758 	#define CMDQ_ORCHESTRATE_QID_MIGRATION_OPCODE_ORCHESTRATE_QID_MIGRATION UINT32_C(0x93)
77759 	#define CMDQ_ORCHESTRATE_QID_MIGRATION_OPCODE_LAST			CMDQ_ORCHESTRATE_QID_MIGRATION_OPCODE_ORCHESTRATE_QID_MIGRATION
77760 	/* Size of the command in 16-byte units. */
77761 	uint8_t	cmd_size;
77762 	/* Flags and attribs of the command. */
77763 	uint16_t	flags;
77764 	/* Driver supplied handle to associate the command and the response. */
77765 	uint16_t	cookie;
77766 	/* Size of the response buffer in 16-byte units. */
77767 	uint8_t	resp_size;
77768 	uint8_t	reserved8;
77769 	/* Host address of the response. */
77770 	uint64_t	resp_addr;
77771 	uint8_t	qid_migration_flags;
77772 	/* Flags to orchestrate QP context ID range migration amongst PFs. */
77773 	#define CMDQ_ORCHESTRATE_QID_MIGRATION_QID_MIGRATION_FLAGS_MASK			UINT32_C(0xf)
77774 	#define CMDQ_ORCHESTRATE_QID_MIGRATION_QID_MIGRATION_FLAGS_SFT			0
77775 	/* Enable the PF's native QP context ID range. */
77776 		#define CMDQ_ORCHESTRATE_QID_MIGRATION_QID_MIGRATION_FLAGS_ENABLE_NATIVE_QID_RANGE	UINT32_C(0x0)
77777 	/* Enable the PF's extended QP context ID range. */
77778 		#define CMDQ_ORCHESTRATE_QID_MIGRATION_QID_MIGRATION_FLAGS_ENABLE_EXTENDED_QID_RANGE   UINT32_C(0x1)
77779 	/* Disable the PF's native QP context ID range. */
77780 		#define CMDQ_ORCHESTRATE_QID_MIGRATION_QID_MIGRATION_FLAGS_DISABLE_NATIVE_QID_RANGE	UINT32_C(0x2)
77781 	/* Disable the PF's extended QP context ID range. */
77782 		#define CMDQ_ORCHESTRATE_QID_MIGRATION_QID_MIGRATION_FLAGS_DISABLE_EXTENDED_QID_RANGE  UINT32_C(0x3)
77783 		#define CMDQ_ORCHESTRATE_QID_MIGRATION_QID_MIGRATION_FLAGS_LAST			CMDQ_ORCHESTRATE_QID_MIGRATION_QID_MIGRATION_FLAGS_DISABLE_EXTENDED_QID_RANGE
77784 	/* unused4 is 4 b */
77785 	#define CMDQ_ORCHESTRATE_QID_MIGRATION_UNUSED4_MASK				UINT32_C(0xf0)
77786 	#define CMDQ_ORCHESTRATE_QID_MIGRATION_UNUSED4_SFT				4
77787 	uint8_t	reserved56[7];
77788 	/* reserved64 is 64 b */
77789 	uint64_t	reserved64;
77790 } cmdq_orchestrate_qid_migration_t, *pcmdq_orchestrate_qid_migration_t;
77791 
77792 /* creq_orchestrate_qid_migration_resp (size:128b/16B) */
77793 
77794 typedef struct creq_orchestrate_qid_migration_resp {
77795 	uint8_t	type;
77796 	/*
77797 	 * This field indicates the exact type of the completion.
77798 	 * By convention, the LSB identifies the length of the
77799 	 * record in 16B units. Even values indicate 16B
77800 	 * records. Odd values indicate 32B
77801 	 * records.
77802 	 */
77803 	#define CREQ_ORCHESTRATE_QID_MIGRATION_RESP_TYPE_MASK	UINT32_C(0x3f)
77804 	#define CREQ_ORCHESTRATE_QID_MIGRATION_RESP_TYPE_SFT	0
77805 	/* QP Async Notification */
77806 		#define CREQ_ORCHESTRATE_QID_MIGRATION_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
77807 		#define CREQ_ORCHESTRATE_QID_MIGRATION_RESP_TYPE_LAST	CREQ_ORCHESTRATE_QID_MIGRATION_RESP_TYPE_QP_EVENT
77808 	/* Status of the response. */
77809 	uint8_t	status;
77810 	/* Driver supplied handle to associate the command and the response. */
77811 	uint16_t	cookie;
77812 	uint32_t	reserved32;
77813 	uint8_t	v;
77814 	/*
77815 	 * This value is written by the NIC such that it will be different
77816 	 * for each pass through the completion queue. The even passes
77817 	 * will write 1. The odd passes will write 0.
77818 	 */
77819 	#define CREQ_ORCHESTRATE_QID_MIGRATION_RESP_V	UINT32_C(0x1)
77820 	/* Event or command opcode. */
77821 	uint8_t	event;
77822 	/* Orchestrate QPID migration command response. */
77823 	#define CREQ_ORCHESTRATE_QID_MIGRATION_RESP_EVENT_ORCHESTRATE_QID_MIGRATION UINT32_C(0x93)
77824 	#define CREQ_ORCHESTRATE_QID_MIGRATION_RESP_EVENT_LAST			CREQ_ORCHESTRATE_QID_MIGRATION_RESP_EVENT_ORCHESTRATE_QID_MIGRATION
77825 	uint8_t	reserved48[6];
77826 } creq_orchestrate_qid_migration_resp_t, *pcreq_orchestrate_qid_migration_resp_t;
77827 
77828 /*******************
77829  * create_qp_batch *
77830  *******************/
77831 
77832 
77833 /* cmdq_create_qp_batch (size:384b/48B) */
77834 
77835 typedef struct cmdq_create_qp_batch {
77836 	/* Command opcode. */
77837 	uint8_t	opcode;
77838 	/* This command allocates a batch of QPs in a sequential range. */
77839 	#define CMDQ_CREATE_QP_BATCH_OPCODE_CREATE_QP_BATCH UINT32_C(0x94)
77840 	#define CMDQ_CREATE_QP_BATCH_OPCODE_LAST	CMDQ_CREATE_QP_BATCH_OPCODE_CREATE_QP_BATCH
77841 	/* Size of the command in 16-byte units. */
77842 	uint8_t	cmd_size;
77843 	/* Flags and attribs of the command. */
77844 	uint16_t	flags;
77845 	/* Driver supplied handle to associate the command and the response. */
77846 	uint16_t	cookie;
77847 	/* Size of the response buffer in 16-byte units. */
77848 	uint8_t	resp_size;
77849 	uint8_t	reserved8;
77850 	/* Host address of the response. */
77851 	uint64_t	resp_addr;
77852 	/* Starting QP context id to be used for the sequential range. */
77853 	uint32_t	start_xid;
77854 	/* Count of QPs to be allocated */
77855 	uint32_t	count;
77856 	/* Size of an individual element of the qp_params_array. */
77857 	uint32_t	per_qp_param_size;
77858 	uint32_t	reserved32;
77859 	/*
77860 	 * Host DMA address of the array of per-QP parameters.
77861 	 * Per-QP parameters are identical to those of the
77862 	 * `create_qp` command and specified by the
77863 	 * `create_qp_batch_data` structure.
77864 	 */
77865 	uint64_t	qp_params_array;
77866 	/* reserved64 is 64 b */
77867 	uint64_t	reserved64;
77868 } cmdq_create_qp_batch_t, *pcmdq_create_qp_batch_t;
77869 
77870 /* creq_create_qp_batch_resp (size:128b/16B) */
77871 
77872 typedef struct creq_create_qp_batch_resp {
77873 	uint8_t	type;
77874 	/*
77875 	 * This field indicates the exact type of the completion.
77876 	 * By convention, the LSB identifies the length of the
77877 	 * record in 16B units. Even values indicate 16B
77878 	 * records. Odd values indicate 32B
77879 	 * records.
77880 	 */
77881 	#define CREQ_CREATE_QP_BATCH_RESP_TYPE_MASK	UINT32_C(0x3f)
77882 	#define CREQ_CREATE_QP_BATCH_RESP_TYPE_SFT	0
77883 	/* QP Async Notification */
77884 		#define CREQ_CREATE_QP_BATCH_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
77885 		#define CREQ_CREATE_QP_BATCH_RESP_TYPE_LAST	CREQ_CREATE_QP_BATCH_RESP_TYPE_QP_EVENT
77886 	/* Status of the response. */
77887 	uint8_t	status;
77888 	/* Driver supplied handle to associate the command and the response. */
77889 	uint16_t	cookie;
77890 	uint32_t	reserved32;
77891 	uint8_t	v;
77892 	/*
77893 	 * This value is written by the NIC such that it will be different
77894 	 * for each pass through the completion queue. The even passes
77895 	 * will write 1. The odd passes will write 0.
77896 	 */
77897 	#define CREQ_CREATE_QP_BATCH_RESP_V	UINT32_C(0x1)
77898 	/* Event or command opcode. */
77899 	uint8_t	event;
77900 	/* Create batch QPs command response. */
77901 	#define CREQ_CREATE_QP_BATCH_RESP_EVENT_CREATE_QP_BATCH UINT32_C(0x94)
77902 	#define CREQ_CREATE_QP_BATCH_RESP_EVENT_LAST	CREQ_CREATE_QP_BATCH_RESP_EVENT_CREATE_QP_BATCH
77903 	uint16_t	reserved16;
77904 	/* Count of QPs successfully created. */
77905 	uint32_t	count;
77906 } creq_create_qp_batch_resp_t, *pcreq_create_qp_batch_resp_t;
77907 
77908 /********************
77909  * destroy_qp_batch *
77910  ********************/
77911 
77912 
77913 /* cmdq_destroy_qp_batch (size:256b/32B) */
77914 
77915 typedef struct cmdq_destroy_qp_batch {
77916 	/* Command opcode. */
77917 	uint8_t	opcode;
77918 	/*
77919 	 * This command deletes the batch of requested count of QPs.
77920 	 * The starting QP ID can be specified to request a batch deletion
77921 	 * of a sequential range.
77922 	 */
77923 	#define CMDQ_DESTROY_QP_BATCH_OPCODE_DESTROY_QP_BATCH UINT32_C(0x95)
77924 	#define CMDQ_DESTROY_QP_BATCH_OPCODE_LAST		CMDQ_DESTROY_QP_BATCH_OPCODE_DESTROY_QP_BATCH
77925 	/* Size of the command in 16-byte units. */
77926 	uint8_t	cmd_size;
77927 	/* Flags and attribs of the command. */
77928 	uint16_t	flags;
77929 	/* Driver supplied handle to associate the command and the response. */
77930 	uint16_t	cookie;
77931 	/* Size of the response buffer in 16-byte units. */
77932 	uint8_t	resp_size;
77933 	uint8_t	reserved8;
77934 	/* Host address of the response. */
77935 	uint64_t	resp_addr;
77936 	/* Starting QP context id to be used for the sequential range. */
77937 	uint32_t	start_xid;
77938 	/*
77939 	 * Count of QPs to be deleted. A value of zero implies all QPs
77940 	 * are to be deleted.
77941 	 */
77942 	uint32_t	count;
77943 	/* reserved64 is 64 b */
77944 	uint64_t	reserved64;
77945 } cmdq_destroy_qp_batch_t, *pcmdq_destroy_qp_batch_t;
77946 
77947 /* creq_destroy_qp_batch_resp (size:128b/16B) */
77948 
77949 typedef struct creq_destroy_qp_batch_resp {
77950 	uint8_t	type;
77951 	/*
77952 	 * This field indicates the exact type of the completion.
77953 	 * By convention, the LSB identifies the length of the
77954 	 * record in 16B units. Even values indicate 16B
77955 	 * records. Odd values indicate 32B
77956 	 * records.
77957 	 */
77958 	#define CREQ_DESTROY_QP_BATCH_RESP_TYPE_MASK	UINT32_C(0x3f)
77959 	#define CREQ_DESTROY_QP_BATCH_RESP_TYPE_SFT	0
77960 	/* QP Async Notification */
77961 		#define CREQ_DESTROY_QP_BATCH_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
77962 		#define CREQ_DESTROY_QP_BATCH_RESP_TYPE_LAST	CREQ_DESTROY_QP_BATCH_RESP_TYPE_QP_EVENT
77963 	/* Status of the response. */
77964 	uint8_t	status;
77965 	/* Driver supplied handle to associate the command and the response. */
77966 	uint16_t	cookie;
77967 	uint32_t	reserved32;
77968 	uint8_t	v;
77969 	/*
77970 	 * This value is written by the NIC such that it will be different
77971 	 * for each pass through the completion queue. The even passes
77972 	 * will write 1. The odd passes will write 0.
77973 	 */
77974 	#define CREQ_DESTROY_QP_BATCH_RESP_V	UINT32_C(0x1)
77975 	/* Event or command opcode. */
77976 	uint8_t	event;
77977 	/* Destroy batch QPs command response. */
77978 	#define CREQ_DESTROY_QP_BATCH_RESP_EVENT_DESTROY_QP_BATCH UINT32_C(0x95)
77979 	#define CREQ_DESTROY_QP_BATCH_RESP_EVENT_LAST		CREQ_DESTROY_QP_BATCH_RESP_EVENT_DESTROY_QP_BATCH
77980 	uint16_t	reserved16;
77981 	/* Count of QPs successfully destroyed. */
77982 	uint32_t	count;
77983 } creq_destroy_qp_batch_resp_t, *pcreq_destroy_qp_batch_resp_t;
77984 
77985 /*******************************
77986  * allocate_roce_stats_ext_ctx *
77987  *******************************/
77988 
77989 
77990 /* cmdq_allocate_roce_stats_ext_ctx (size:256b/32B) */
77991 
77992 typedef struct cmdq_allocate_roce_stats_ext_ctx {
77993 	/* Command opcode. */
77994 	uint8_t	opcode;
77995 	/*
77996 	 * This command allocates an extended RoCE statistics context
77997 	 * that supports periodic DMA to a host address. The extended
77998 	 * statistics context id can be assigned by the driver,
77999 	 * via `create_qp`, `create_qp_batch` or `modify_qp` to a
78000 	 * specific QP, a subset of QPs or to all QPs of a specific function.
78001 	 * These statistics can be queried via `query_roce_stats_ext_v2`.
78002 	 */
78003 	#define CMDQ_ALLOCATE_ROCE_STATS_EXT_CTX_OPCODE_ALLOCATE_ROCE_STATS_EXT_CTX UINT32_C(0x96)
78004 	#define CMDQ_ALLOCATE_ROCE_STATS_EXT_CTX_OPCODE_LAST			CMDQ_ALLOCATE_ROCE_STATS_EXT_CTX_OPCODE_ALLOCATE_ROCE_STATS_EXT_CTX
78005 	/* Size of the command in 16-byte units. */
78006 	uint8_t	cmd_size;
78007 	/* Flags and attribs of the command. */
78008 	uint16_t	flags;
78009 	/* Driver supplied handle to associate the command and the response. */
78010 	uint16_t	cookie;
78011 	/* Size of the response buffer in 16-byte units. */
78012 	uint8_t	resp_size;
78013 	uint8_t	reserved8;
78014 	/* Host address of the response. */
78015 	uint64_t	resp_addr;
78016 	/*
78017 	 * This is the address to be programmed in the statistic block
78018 	 * by the firmware to support periodic DMA of the statistics.
78019 	 */
78020 	uint64_t	stats_dma_addr;
78021 	/*
78022 	 * The statistic block update period in ms.
78023 	 * e.g. 250ms, 500ms, 750ms, 1000ms.
78024 	 * If update_period_ms is 0, then the stats update
78025 	 * shall be never done and the DMA address shall not be used.
78026 	 * In this case, the statistics can only be read by
78027 	 * `query_roce_stats_ext_v2` command.
78028 	 */
78029 	uint32_t	update_period_ms;
78030 	/* Steering tag to use for memory transactions. */
78031 	uint16_t	steering_tag;
78032 	uint16_t	reserved16;
78033 } cmdq_allocate_roce_stats_ext_ctx_t, *pcmdq_allocate_roce_stats_ext_ctx_t;
78034 
78035 /* creq_allocate_roce_stats_ext_ctx_resp (size:128b/16B) */
78036 
78037 typedef struct creq_allocate_roce_stats_ext_ctx_resp {
78038 	uint8_t	type;
78039 	/*
78040 	 * This field indicates the exact type of the completion.
78041 	 * By convention, the LSB identifies the length of the
78042 	 * record in 16B units. Even values indicate 16B
78043 	 * records. Odd values indicate 32B
78044 	 * records.
78045 	 */
78046 	#define CREQ_ALLOCATE_ROCE_STATS_EXT_CTX_RESP_TYPE_MASK	UINT32_C(0x3f)
78047 	#define CREQ_ALLOCATE_ROCE_STATS_EXT_CTX_RESP_TYPE_SFT	0
78048 	/* QP Async Notification */
78049 		#define CREQ_ALLOCATE_ROCE_STATS_EXT_CTX_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
78050 		#define CREQ_ALLOCATE_ROCE_STATS_EXT_CTX_RESP_TYPE_LAST	CREQ_ALLOCATE_ROCE_STATS_EXT_CTX_RESP_TYPE_QP_EVENT
78051 	/* Status of the response. */
78052 	uint8_t	status;
78053 	/* Driver supplied handle to associate the command and the response. */
78054 	uint16_t	cookie;
78055 	/* Extended RoCE statistics context id. */
78056 	uint32_t	roce_stats_ext_xid;
78057 	uint8_t	v;
78058 	/*
78059 	 * This value is written by the NIC such that it will be different
78060 	 * for each pass through the completion queue. The even passes
78061 	 * will write 1. The odd passes will write 0.
78062 	 */
78063 	#define CREQ_ALLOCATE_ROCE_STATS_EXT_CTX_RESP_V	UINT32_C(0x1)
78064 	/* Event or command opcode. */
78065 	uint8_t	event;
78066 	/* Allocate extended RoCE statistics context command response. */
78067 	#define CREQ_ALLOCATE_ROCE_STATS_EXT_CTX_RESP_EVENT_ALLOCATE_ROCE_STATS_EXT_CTX UINT32_C(0x96)
78068 	#define CREQ_ALLOCATE_ROCE_STATS_EXT_CTX_RESP_EVENT_LAST			CREQ_ALLOCATE_ROCE_STATS_EXT_CTX_RESP_EVENT_ALLOCATE_ROCE_STATS_EXT_CTX
78069 	uint8_t	reserved48[6];
78070 } creq_allocate_roce_stats_ext_ctx_resp_t, *pcreq_allocate_roce_stats_ext_ctx_resp_t;
78071 
78072 /*********************************
78073  * deallocate_roce_stats_ext_ctx *
78074  *********************************/
78075 
78076 
78077 /* cmdq_deallocate_roce_stats_ext_ctx (size:256b/32B) */
78078 
78079 typedef struct cmdq_deallocate_roce_stats_ext_ctx {
78080 	/* Command opcode. */
78081 	uint8_t	opcode;
78082 	/* This command deallocates an extended RoCE statistics context. */
78083 	#define CMDQ_DEALLOCATE_ROCE_STATS_EXT_CTX_OPCODE_DEALLOCATE_ROCE_STATS_EXT_CTX UINT32_C(0x97)
78084 	#define CMDQ_DEALLOCATE_ROCE_STATS_EXT_CTX_OPCODE_LAST			CMDQ_DEALLOCATE_ROCE_STATS_EXT_CTX_OPCODE_DEALLOCATE_ROCE_STATS_EXT_CTX
78085 	/* Size of the command in 16-byte units. */
78086 	uint8_t	cmd_size;
78087 	/* Flags and attribs of the command. */
78088 	uint16_t	flags;
78089 	/* Driver supplied handle to associate the command and the response. */
78090 	uint16_t	cookie;
78091 	/* Size of the response buffer in 16-byte units. */
78092 	uint8_t	resp_size;
78093 	uint8_t	reserved8;
78094 	/* Host address of the response. */
78095 	uint64_t	resp_addr;
78096 	/* Extended RoCE statistics context id. */
78097 	uint32_t	roce_stats_ext_xid;
78098 	uint32_t	reserved32;
78099 	/* reserved64 is 64 b */
78100 	uint64_t	reserved64;
78101 } cmdq_deallocate_roce_stats_ext_ctx_t, *pcmdq_deallocate_roce_stats_ext_ctx_t;
78102 
78103 /* creq_deallocate_roce_stats_ext_ctx_resp (size:128b/16B) */
78104 
78105 typedef struct creq_deallocate_roce_stats_ext_ctx_resp {
78106 	uint8_t	type;
78107 	/*
78108 	 * This field indicates the exact type of the completion.
78109 	 * By convention, the LSB identifies the length of the
78110 	 * record in 16B units. Even values indicate 16B
78111 	 * records. Odd values indicate 32B
78112 	 * records.
78113 	 */
78114 	#define CREQ_DEALLOCATE_ROCE_STATS_EXT_CTX_RESP_TYPE_MASK	UINT32_C(0x3f)
78115 	#define CREQ_DEALLOCATE_ROCE_STATS_EXT_CTX_RESP_TYPE_SFT	0
78116 	/* QP Async Notification */
78117 		#define CREQ_DEALLOCATE_ROCE_STATS_EXT_CTX_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
78118 		#define CREQ_DEALLOCATE_ROCE_STATS_EXT_CTX_RESP_TYPE_LAST	CREQ_DEALLOCATE_ROCE_STATS_EXT_CTX_RESP_TYPE_QP_EVENT
78119 	/* Status of the response. */
78120 	uint8_t	status;
78121 	/* Driver supplied handle to associate the command and the response. */
78122 	uint16_t	cookie;
78123 	/* Extended RoCE statistics context id. */
78124 	uint32_t	roce_stats_ext_xid;
78125 	uint8_t	v;
78126 	/*
78127 	 * This value is written by the NIC such that it will be different
78128 	 * for each pass through the completion queue. The even passes
78129 	 * will write 1. The odd passes will write 0.
78130 	 */
78131 	#define CREQ_DEALLOCATE_ROCE_STATS_EXT_CTX_RESP_V	UINT32_C(0x1)
78132 	/* Event or command opcode. */
78133 	uint8_t	event;
78134 	/* Deallocate extended RoCE statistics context command response. */
78135 	#define CREQ_DEALLOCATE_ROCE_STATS_EXT_CTX_RESP_EVENT_DEALLOCATE_ROCE_STATS_EXT_CTX UINT32_C(0x97)
78136 	#define CREQ_DEALLOCATE_ROCE_STATS_EXT_CTX_RESP_EVENT_LAST			CREQ_DEALLOCATE_ROCE_STATS_EXT_CTX_RESP_EVENT_DEALLOCATE_ROCE_STATS_EXT_CTX
78137 	uint8_t	reserved48[6];
78138 } creq_deallocate_roce_stats_ext_ctx_resp_t, *pcreq_deallocate_roce_stats_ext_ctx_resp_t;
78139 
78140 /***************************
78141  * query_roce_stats_ext_v2 *
78142  ***************************/
78143 
78144 
78145 /* cmdq_query_roce_stats_ext_v2 (size:256b/32B) */
78146 
78147 typedef struct cmdq_query_roce_stats_ext_v2 {
78148 	/* Command opcode. */
78149 	uint8_t	opcode;
78150 	/*
78151 	 * Query extended RoCE statistics for devices that support
78152 	 * `roce_stats_ext_ctx_supported` feature.
78153 	 */
78154 	#define CMDQ_QUERY_ROCE_STATS_EXT_V2_OPCODE_QUERY_ROCE_STATS_EXT_V2 UINT32_C(0x98)
78155 	#define CMDQ_QUERY_ROCE_STATS_EXT_V2_OPCODE_LAST		CMDQ_QUERY_ROCE_STATS_EXT_V2_OPCODE_QUERY_ROCE_STATS_EXT_V2
78156 	/* Size of the command in 16-byte units. */
78157 	uint8_t	cmd_size;
78158 	/* Flags and attribs of the command. */
78159 	uint16_t	flags;
78160 	/* Driver supplied handle to associate the command and the response. */
78161 	uint16_t	cookie;
78162 	/* Size of the response buffer in 16-byte units. */
78163 	uint8_t	resp_size;
78164 	uint8_t	reserved8;
78165 	/* Host address of the response. */
78166 	uint64_t	resp_addr;
78167 	/* Extended RoCE statistics context id. */
78168 	uint32_t	roce_stats_ext_xid;
78169 	uint32_t	reserved32;
78170 	/* reserved64 is 64 b */
78171 	uint64_t	reserved64;
78172 } cmdq_query_roce_stats_ext_v2_t, *pcmdq_query_roce_stats_ext_v2_t;
78173 
78174 /* creq_query_roce_stats_ext_v2_resp (size:128b/16B) */
78175 
78176 typedef struct creq_query_roce_stats_ext_v2_resp {
78177 	uint8_t	type;
78178 	/*
78179 	 * This field indicates the exact type of the completion.
78180 	 * By convention, the LSB identifies the length of the
78181 	 * record in 16B units. Even values indicate 16B
78182 	 * records. Odd values indicate 32B
78183 	 * records.
78184 	 */
78185 	#define CREQ_QUERY_ROCE_STATS_EXT_V2_RESP_TYPE_MASK	UINT32_C(0x3f)
78186 	#define CREQ_QUERY_ROCE_STATS_EXT_V2_RESP_TYPE_SFT	0
78187 	/* QP Async Notification */
78188 		#define CREQ_QUERY_ROCE_STATS_EXT_V2_RESP_TYPE_QP_EVENT  UINT32_C(0x38)
78189 		#define CREQ_QUERY_ROCE_STATS_EXT_V2_RESP_TYPE_LAST	CREQ_QUERY_ROCE_STATS_EXT_V2_RESP_TYPE_QP_EVENT
78190 	/* Status of the response. */
78191 	uint8_t	status;
78192 	/* Driver supplied handle to associate the command and the response. */
78193 	uint16_t	cookie;
78194 	/* Side buffer size in 16-byte units */
78195 	uint32_t	size;
78196 	uint8_t	v;
78197 	/*
78198 	 * This value is written by the NIC such that it will be different
78199 	 * for each pass through the completion queue. The even passes
78200 	 * will write 1. The odd passes will write 0.
78201 	 */
78202 	#define CREQ_QUERY_ROCE_STATS_EXT_V2_RESP_V	UINT32_C(0x1)
78203 	/* Event or command opcode. */
78204 	uint8_t	event;
78205 	/* Query extended RoCE statistics v2. */
78206 	#define CREQ_QUERY_ROCE_STATS_EXT_V2_RESP_EVENT_QUERY_ROCE_STATS_EXT_V2 UINT32_C(0x98)
78207 	#define CREQ_QUERY_ROCE_STATS_EXT_V2_RESP_EVENT_LAST		CREQ_QUERY_ROCE_STATS_EXT_V2_RESP_EVENT_QUERY_ROCE_STATS_EXT_V2
78208 	uint8_t	reserved48[6];
78209 } creq_query_roce_stats_ext_v2_resp_t, *pcreq_query_roce_stats_ext_v2_resp_t;
78210 
78211 /* Query extended RoCE Stats command response side buffer structure. */
78212 /* creq_query_roce_stats_ext_v2_resp_sb (size:1920b/240B) */
78213 
78214 typedef struct creq_query_roce_stats_ext_v2_resp_sb {
78215 	/* Command opcode. */
78216 	uint8_t	opcode;
78217 	/* Query extended RoCE statistics v2. */
78218 	#define CREQ_QUERY_ROCE_STATS_EXT_V2_RESP_SB_OPCODE_QUERY_ROCE_STATS_EXT_V2 UINT32_C(0x98)
78219 	#define CREQ_QUERY_ROCE_STATS_EXT_V2_RESP_SB_OPCODE_LAST		CREQ_QUERY_ROCE_STATS_EXT_V2_RESP_SB_OPCODE_QUERY_ROCE_STATS_EXT_V2
78220 	/* Status of the response. */
78221 	uint8_t	status;
78222 	/* Driver supplied handle to associate the command and the response. */
78223 	uint16_t	cookie;
78224 	/* Flags and attribs of the command. */
78225 	uint16_t	flags;
78226 	/* Size of the response buffer in 16-byte units. */
78227 	uint8_t	resp_size;
78228 	uint8_t	rsvd;
78229 	/* Number of transmitted Atomic request packets without errors. */
78230 	uint64_t	tx_atomic_req_pkts;
78231 	/* Number of transmitted Read request packets without errors. */
78232 	uint64_t	tx_read_req_pkts;
78233 	/* Number of transmitted Read response packets without errors. */
78234 	uint64_t	tx_read_res_pkts;
78235 	/* Number of transmitted Write request packets without errors. */
78236 	uint64_t	tx_write_req_pkts;
78237 	/* Number of transmitted RC Send packets without errors. */
78238 	uint64_t	tx_rc_send_req_pkts;
78239 	/*
78240 	 * Number of transmitted UD Send (including QP1) packets
78241 	 * without errors.
78242 	 */
78243 	uint64_t	tx_ud_send_req_pkts;
78244 	/* Number of transmitted CNPs. Includes DCN_CNPs. */
78245 	uint64_t	tx_cnp_pkts;
78246 	/*
78247 	 * Number of transmitted RoCE packets.
78248 	 * This includes RC, UD, RawEth, and QP1 packets
78249 	 */
78250 	uint64_t	tx_roce_pkts;
78251 	/*
78252 	 * Number of transmitted RoCE header and payload bytes.
78253 	 * This includes RC, UD, RawEth, and QP1 packets.
78254 	 */
78255 	uint64_t	tx_roce_bytes;
78256 	/*
78257 	 * Number of drops that occurred to lack of buffers.
78258 	 * This count includes RC sends, RC writes with immediate,
78259 	 * UD sends, RawEth, and QP1 packets dropped due to lack of buffers.
78260 	 */
78261 	uint64_t	rx_out_of_buffer_pkts;
78262 	/* Number of packets that were received out of sequence. */
78263 	uint64_t	rx_out_of_sequence_pkts;
78264 	/*
78265 	 * Number of duplicate read/atomic requests resulting in responder
78266 	 * hardware retransmission.
78267 	 */
78268 	uint64_t	dup_req;
78269 	/*
78270 	 * Number of missing response packets resulting in hardware
78271 	 * retransmission.
78272 	 */
78273 	uint64_t	missing_resp;
78274 	/*
78275 	 * Number of sequence error NAKs received resulting in hardware
78276 	 * retransmission.
78277 	 */
78278 	uint64_t	seq_err_naks_rcvd;
78279 	/* Number of RNR NAKs received resulting in hardware retransmission. */
78280 	uint64_t	rnr_naks_rcvd;
78281 	/* Number of timeouts resulting in hardware retransmission. */
78282 	uint64_t	to_retransmits;
78283 	/* Number of received Atomic request packets without errors. */
78284 	uint64_t	rx_atomic_req_pkts;
78285 	/* Number of received Read request packets without errors. */
78286 	uint64_t	rx_read_req_pkts;
78287 	/* Number of received Read response packets without errors. */
78288 	uint64_t	rx_read_res_pkts;
78289 	/* Number of received Write request packets without errors. */
78290 	uint64_t	rx_write_req_pkts;
78291 	/* Number of received RC Send packets without errors. */
78292 	uint64_t	rx_rc_send_pkts;
78293 	/* Number of received UD Send packets without errors. */
78294 	uint64_t	rx_ud_send_pkts;
78295 	/* Number of received DCN payload cut packets. */
78296 	uint64_t	rx_dcn_payload_cut;
78297 	/* Number of received ECN-marked packets. */
78298 	uint64_t	rx_ecn_marked_pkts;
78299 	/* Number of received CNP packets. Includes DCN_CNPs. */
78300 	uint64_t	rx_cnp_pkts;
78301 	/*
78302 	 * Number of received RoCE packets including RoCE packets with errors.
78303 	 * This includes RC, UD, RawEth, and QP1 packets
78304 	 */
78305 	uint64_t	rx_roce_pkts;
78306 	/*
78307 	 * Number of received RoCE header and payload bytes including RoCE
78308 	 * packets with errors.
78309 	 * This includes RC, UD, RawEth, and QP1 packets.
78310 	 */
78311 	uint64_t	rx_roce_bytes;
78312 	/*
78313 	 * Number of received RoCE packets without errors.
78314 	 * This includes RC, UD, RawEth, and QP1 packets
78315 	 */
78316 	uint64_t	rx_roce_good_pkts;
78317 	/*
78318 	 * Number of received RoCE header and payload bytes without errors.
78319 	 * This includes RC, UD, RawEth, and QP1 packets.
78320 	 */
78321 	uint64_t	rx_roce_good_bytes;
78322 } creq_query_roce_stats_ext_v2_resp_sb_t, *pcreq_query_roce_stats_ext_v2_resp_sb_t;
78323 
78324 /* RoCE function async event notifications. */
78325 /* creq_func_event (size:128b/16B) */
78326 
78327 typedef struct creq_func_event {
78328 	uint8_t	type;
78329 	/*
78330 	 * This field indicates the exact type of the completion.
78331 	 * By convention, the LSB identifies the length of the
78332 	 * record in 16B units. Even values indicate 16B
78333 	 * records. Odd values indicate 32B
78334 	 * records.
78335 	 */
78336 	#define CREQ_FUNC_EVENT_TYPE_MASK	UINT32_C(0x3f)
78337 	#define CREQ_FUNC_EVENT_TYPE_SFT	0
78338 	/* Function Async Notification */
78339 		#define CREQ_FUNC_EVENT_TYPE_FUNC_EVENT  UINT32_C(0x3a)
78340 		#define CREQ_FUNC_EVENT_TYPE_LAST	CREQ_FUNC_EVENT_TYPE_FUNC_EVENT
78341 	uint8_t	reserved56[7];
78342 	uint8_t	v;
78343 	/*
78344 	 * This value is written by the NIC such that it will be different
78345 	 * for each pass through the completion queue. The even passes
78346 	 * will write 1. The odd passes will write 0.
78347 	 */
78348 	#define CREQ_FUNC_EVENT_V	UINT32_C(0x1)
78349 	/*
78350 	 * This value defines what type of async event has occurred
78351 	 * on the function.
78352 	 */
78353 	uint8_t	event;
78354 	/*
78355 	 * Invalid PBL or PCIE UR response occurred
78356 	 * in SQ WQE or IRRQ read access.
78357 	 */
78358 	#define CREQ_FUNC_EVENT_EVENT_TX_WQE_ERROR	UINT32_C(0x1)
78359 	/*
78360 	 * Invalid PBL or PCIE UR response occurred
78361 	 * during data read access.
78362 	 */
78363 	#define CREQ_FUNC_EVENT_EVENT_TX_DATA_ERROR	UINT32_C(0x2)
78364 	/*
78365 	 * Invalid PBL or PCIE UR response occurred
78366 	 * in RQ/SRQ WQE or ORRQ read access.
78367 	 */
78368 	#define CREQ_FUNC_EVENT_EVENT_RX_WQE_ERROR	UINT32_C(0x3)
78369 	/* Invalid PBL occurred during data write access. */
78370 	#define CREQ_FUNC_EVENT_EVENT_RX_DATA_ERROR	UINT32_C(0x4)
78371 	/* Invalid PBL occurred during CQ write access. */
78372 	#define CREQ_FUNC_EVENT_EVENT_CQ_ERROR	UINT32_C(0x5)
78373 	/*
78374 	 * Invalid PBL or PCIE UR response occurred in TQM
78375 	 * read access.
78376 	 */
78377 	#define CREQ_FUNC_EVENT_EVENT_TQM_ERROR	UINT32_C(0x6)
78378 	/* PCIE UR response occurred in CFC read access. */
78379 	#define CREQ_FUNC_EVENT_EVENT_CFCQ_ERROR	UINT32_C(0x7)
78380 	/* PCIE UR response occurred in CFC read access. */
78381 	#define CREQ_FUNC_EVENT_EVENT_CFCS_ERROR	UINT32_C(0x8)
78382 	/* PCIE UR response occurred in CFC read access. */
78383 	#define CREQ_FUNC_EVENT_EVENT_CFCC_ERROR	UINT32_C(0x9)
78384 	/* PCIE UR response occurred in CFC read access. */
78385 	#define CREQ_FUNC_EVENT_EVENT_CFCM_ERROR	UINT32_C(0xa)
78386 	/*
78387 	 * Invalid PBL or
78388 	 * PCIE UR response
78389 	 * occurred on timer read access.
78390 	 */
78391 	#define CREQ_FUNC_EVENT_EVENT_TIM_ERROR	UINT32_C(0xb)
78392 	/* A VF sent a backchannel command request */
78393 	#define CREQ_FUNC_EVENT_EVENT_VF_COMM_REQUEST	UINT32_C(0x80)
78394 	/*
78395 	 * Communication resource (QPC, CQ, SRQ, MRW) exhausted, and resource
78396 	 * array extension is enabled.
78397 	 */
78398 	#define CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED UINT32_C(0x81)
78399 	#define CREQ_FUNC_EVENT_EVENT_LAST		CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED
78400 	uint8_t	reserved48[6];
78401 } creq_func_event_t, *pcreq_func_event_t;
78402 
78403 /* RoCE slowpath command completion events. */
78404 /* creq_qp_event (size:128b/16B) */
78405 
78406 typedef struct creq_qp_event {
78407 	uint8_t	type;
78408 	/*
78409 	 * This field indicates the exact type of the completion.
78410 	 * By convention, the LSB identifies the length of the
78411 	 * record in 16B units. Even values indicate 16B
78412 	 * records. Odd values indicate 32B
78413 	 * records.
78414 	 */
78415 	#define CREQ_QP_EVENT_TYPE_MASK	UINT32_C(0x3f)
78416 	#define CREQ_QP_EVENT_TYPE_SFT	0
78417 	/* QP Async Notification */
78418 		#define CREQ_QP_EVENT_TYPE_QP_EVENT  UINT32_C(0x38)
78419 		#define CREQ_QP_EVENT_TYPE_LAST	CREQ_QP_EVENT_TYPE_QP_EVENT
78420 	/* Status of the response. */
78421 	uint8_t	status;
78422 	/* Success. */
78423 	#define CREQ_QP_EVENT_STATUS_SUCCESS	UINT32_C(0x0)
78424 	/* Fail. */
78425 	#define CREQ_QP_EVENT_STATUS_FAIL		UINT32_C(0x1)
78426 	/* Resources. */
78427 	#define CREQ_QP_EVENT_STATUS_RESOURCES	UINT32_C(0x2)
78428 	/* Invalid command. */
78429 	#define CREQ_QP_EVENT_STATUS_INVALID_CMD	UINT32_C(0x3)
78430 	/* Not implemented. */
78431 	#define CREQ_QP_EVENT_STATUS_NOT_IMPLEMENTED   UINT32_C(0x4)
78432 	/* Invalid parameter. */
78433 	#define CREQ_QP_EVENT_STATUS_INVALID_PARAMETER UINT32_C(0x5)
78434 	/* Hardware operation failed. */
78435 	#define CREQ_QP_EVENT_STATUS_HARDWARE_ERROR	UINT32_C(0x6)
78436 	/* Firmware operation failed due to internal error. */
78437 	#define CREQ_QP_EVENT_STATUS_INTERNAL_ERROR	UINT32_C(0x7)
78438 	#define CREQ_QP_EVENT_STATUS_LAST		CREQ_QP_EVENT_STATUS_INTERNAL_ERROR
78439 	/* Driver supplied handle to associate the command and the response. */
78440 	uint16_t	cookie;
78441 	uint32_t	reserved32;
78442 	uint8_t	v;
78443 	/*
78444 	 * This value is written by the NIC such that it will be different
78445 	 * for each pass through the completion queue. The even passes
78446 	 * will write 1. The odd passes will write 0.
78447 	 */
78448 	#define CREQ_QP_EVENT_V	UINT32_C(0x1)
78449 	/* Event or command opcode. */
78450 	uint8_t	event;
78451 	/* Create QP command response. */
78452 	#define CREQ_QP_EVENT_EVENT_CREATE_QP		UINT32_C(0x1)
78453 	/* Destroy QP command response. */
78454 	#define CREQ_QP_EVENT_EVENT_DESTROY_QP		UINT32_C(0x2)
78455 	/* Modify QP command response. */
78456 	#define CREQ_QP_EVENT_EVENT_MODIFY_QP		UINT32_C(0x3)
78457 	/* Query QP command response. */
78458 	#define CREQ_QP_EVENT_EVENT_QUERY_QP		UINT32_C(0x4)
78459 	/* Create SRQ command response. */
78460 	#define CREQ_QP_EVENT_EVENT_CREATE_SRQ		UINT32_C(0x5)
78461 	/* Destroy SRQ command response. */
78462 	#define CREQ_QP_EVENT_EVENT_DESTROY_SRQ	UINT32_C(0x6)
78463 	/* Query SRQ command response. */
78464 	#define CREQ_QP_EVENT_EVENT_QUERY_SRQ		UINT32_C(0x8)
78465 	/* Create CQ command response. */
78466 	#define CREQ_QP_EVENT_EVENT_CREATE_CQ		UINT32_C(0x9)
78467 	/* Destroy CQ command response. */
78468 	#define CREQ_QP_EVENT_EVENT_DESTROY_CQ		UINT32_C(0xa)
78469 	/* Resize CQ command response. */
78470 	#define CREQ_QP_EVENT_EVENT_RESIZE_CQ		UINT32_C(0xc)
78471 	/* Allocate MRW command response. */
78472 	#define CREQ_QP_EVENT_EVENT_ALLOCATE_MRW	UINT32_C(0xd)
78473 	/* De-allocate key command response. */
78474 	#define CREQ_QP_EVENT_EVENT_DEALLOCATE_KEY	UINT32_C(0xe)
78475 	/* Register MR command response. */
78476 	#define CREQ_QP_EVENT_EVENT_REGISTER_MR	UINT32_C(0xf)
78477 	/* Deregister MR command response. */
78478 	#define CREQ_QP_EVENT_EVENT_DEREGISTER_MR	UINT32_C(0x10)
78479 	/* Add GID command response. */
78480 	#define CREQ_QP_EVENT_EVENT_ADD_GID		UINT32_C(0x11)
78481 	/* Delete GID command response. */
78482 	#define CREQ_QP_EVENT_EVENT_DELETE_GID		UINT32_C(0x12)
78483 	/* Modify GID command response. */
78484 	#define CREQ_QP_EVENT_EVENT_MODIFY_GID		UINT32_C(0x17)
78485 	/* Query GID command response. */
78486 	#define CREQ_QP_EVENT_EVENT_QUERY_GID		UINT32_C(0x18)
78487 	/* Create QP1 command response. */
78488 	#define CREQ_QP_EVENT_EVENT_CREATE_QP1		UINT32_C(0x13)
78489 	/* Destroy QP1 command response. */
78490 	#define CREQ_QP_EVENT_EVENT_DESTROY_QP1	UINT32_C(0x14)
78491 	/* Create AH command response. */
78492 	#define CREQ_QP_EVENT_EVENT_CREATE_AH		UINT32_C(0x15)
78493 	/* Destroy AH command response. */
78494 	#define CREQ_QP_EVENT_EVENT_DESTROY_AH		UINT32_C(0x16)
78495 	/* Initialize firmware command response. */
78496 	#define CREQ_QP_EVENT_EVENT_INITIALIZE_FW	UINT32_C(0x80)
78497 	/* De-initialize firmware command response. */
78498 	#define CREQ_QP_EVENT_EVENT_DEINITIALIZE_FW	UINT32_C(0x81)
78499 	/* Stop PF command response. */
78500 	#define CREQ_QP_EVENT_EVENT_STOP_FUNC		UINT32_C(0x82)
78501 	/* Query info PF command response. */
78502 	#define CREQ_QP_EVENT_EVENT_QUERY_FUNC		UINT32_C(0x83)
78503 	/* Set function resources command response. */
78504 	#define CREQ_QP_EVENT_EVENT_SET_FUNC_RESOURCES	UINT32_C(0x84)
78505 	/*
78506 	 * Read the current state of any internal resource context. Can only be
78507 	 * issued from a PF.
78508 	 */
78509 	#define CREQ_QP_EVENT_EVENT_READ_CONTEXT	UINT32_C(0x85)
78510 	/* Map TC to COS response. */
78511 	#define CREQ_QP_EVENT_EVENT_MAP_TC_TO_COS	UINT32_C(0x8a)
78512 	/* Query firmware and interface version response. */
78513 	#define CREQ_QP_EVENT_EVENT_QUERY_VERSION	UINT32_C(0x8b)
78514 	/* Modify congestion control response. */
78515 	#define CREQ_QP_EVENT_EVENT_MODIFY_CC		UINT32_C(0x8c)
78516 	/* Query congestion control response. */
78517 	#define CREQ_QP_EVENT_EVENT_QUERY_CC		UINT32_C(0x8d)
78518 	/* Query RoCE statistics. */
78519 	#define CREQ_QP_EVENT_EVENT_QUERY_ROCE_STATS	UINT32_C(0x8e)
78520 	/* Set LAG mode. */
78521 	#define CREQ_QP_EVENT_EVENT_SET_LINK_AGGR_MODE	UINT32_C(0x8f)
78522 	/*
78523 	 * Query QP for a PF other than the requesting PF. Also can query for
78524 	 * more than one QP.
78525 	 */
78526 	#define CREQ_QP_EVENT_EVENT_QUERY_QP_EXTEND	UINT32_C(0x91)
78527 	/* QP error notification event. */
78528 	#define CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION UINT32_C(0xc0)
78529 	/* CQ error notification event. */
78530 	#define CREQ_QP_EVENT_EVENT_CQ_ERROR_NOTIFICATION UINT32_C(0xc1)
78531 	#define CREQ_QP_EVENT_EVENT_LAST		CREQ_QP_EVENT_EVENT_CQ_ERROR_NOTIFICATION
78532 	uint8_t	reserved48[6];
78533 } creq_qp_event_t, *pcreq_qp_event_t;
78534 
78535 /* QP error notification event. */
78536 /* creq_qp_error_notification (size:128b/16B) */
78537 
78538 typedef struct creq_qp_error_notification {
78539 	uint8_t	type;
78540 	/*
78541 	 * This field indicates the exact type of the completion.
78542 	 * By convention, the LSB identifies the length of the
78543 	 * record in 16B units. Even values indicate 16B
78544 	 * records. Odd values indicate 32B
78545 	 * records.
78546 	 */
78547 	#define CREQ_QP_ERROR_NOTIFICATION_TYPE_MASK	UINT32_C(0x3f)
78548 	#define CREQ_QP_ERROR_NOTIFICATION_TYPE_SFT	0
78549 	/* QP Async Notification */
78550 		#define CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT  UINT32_C(0x38)
78551 		#define CREQ_QP_ERROR_NOTIFICATION_TYPE_LAST	CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT
78552 	/* Status of the response. */
78553 	uint8_t	status;
78554 	/* requestor slow path state */
78555 	uint8_t	req_slow_path_state;
78556 	/* requestor error reason */
78557 	uint8_t	req_err_state_reason;
78558 	/* No error. */
78559 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_NO_ERROR			UINT32_C(0x0)
78560 	/*
78561 	 * Requester detected opcode error.
78562 	 * * First, only, middle, last for incoming RDMA read
78563 	 *   responses are improperly ordered with respect to previous
78564 	 *   (PSN) packet.
78565 	 * * First or middle packet is not full MTU size.
78566 	 * This is an RX Detected Error.
78567 	 */
78568 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_OPCODE_ERROR		UINT32_C(0x1)
78569 	/*
78570 	 * Transport timeout retry limit exceeded.
78571 	 * The requestor retried the same unacked PSN request packet
78572 	 * too many times.
78573 	 * This is an RX Detected Error.
78574 	 */
78575 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_TIMEOUT_RETRY_LIMIT	UINT32_C(0x2)
78576 	/*
78577 	 * RNR NAK retry limit exceeded.
78578 	 * The requestor received an RNR NAK with the same NAK PSN
78579 	 * too many times.
78580 	 * This is an RX Detected Error.
78581 	 */
78582 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_RNR_TIMEOUT_RETRY_LIMIT UINT32_C(0x3)
78583 	/*
78584 	 * NAK arrival, When NAK code is 1, Invalid Request.
78585 	 * This is an RX Detected Error.
78586 	 */
78587 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_NAK_ARRIVAL_1	UINT32_C(0x4)
78588 	/*
78589 	 * NAK arrival, When NAK code is 2, Remote Access Error.
78590 	 * This is an RX Detected Error.
78591 	 */
78592 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_NAK_ARRIVAL_2	UINT32_C(0x5)
78593 	/*
78594 	 * NAK arrival, When NAK code is 3, Remote Operational Error.
78595 	 * This is an RX Detected Error.
78596 	 */
78597 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_NAK_ARRIVAL_3	UINT32_C(0x6)
78598 	/*
78599 	 * NAK arrival. When NAK code is 4, Invalid RD Request.
78600 	 * This is an RX Detected Error.
78601 	 */
78602 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_NAK_ARRIVAL_4	UINT32_C(0x7)
78603 	/*
78604 	 * Local memory error.
78605 	 * An SGE described an inaccessible memory.
78606 	 * This is an RX Detected Error.
78607 	 */
78608 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_RX_MEMORY_ERROR	UINT32_C(0x8)
78609 	/*
78610 	 * Local memory error.
78611 	 * An SGE described an inaccessible memory.
78612 	 * This is a TX Detected Error.
78613 	 */
78614 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_TX_MEMORY_ERROR	UINT32_C(0x9)
78615 	/*
78616 	 * Read response length error.
78617 	 * The read response payload size does not match the read
78618 	 * length of the request.
78619 	 * This is an RX Detected Error.
78620 	 */
78621 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_READ_RESP_LENGTH	UINT32_C(0xa)
78622 	/*
78623 	 * Invalid read response.
78624 	 * A read response arrived and had a PSN that was not in the
78625 	 * reply range of any outstanding read request on the ORRQ.
78626 	 * This is an RX Detected Error.
78627 	 */
78628 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_INVALID_READ_RESP	UINT32_C(0xb)
78629 	/*
78630 	 * Illegal bind.
78631 	 * * No MW with the specified R_Key exists.
78632 	 * * No MR with the specified L_Key exists.
78633 	 * * A bind request was performed on a window that was already
78634 	 *   bound.
78635 	 * * A bind request was performed for an underlying MR that
78636 	 *   is not registered.
78637 	 * * A bind request was performed for a memory area that exceeds
78638 	 *   the range of the underlying MR.
78639 	 * * A bind request was performed with a set of permissions
78640 	 *   that are looser than the permissions of the underlying MR.
78641 	 * * Domain error MW - When QP's PD does not match MW PD.
78642 	 * * Domain error MR - When QP's PD does not match parent MR's
78643 	 *   PD.
78644 	 * This is a TX Detected Error.
78645 	 */
78646 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_ILLEGAL_BIND		UINT32_C(0xc)
78647 	/*
78648 	 * Illegal fast register.
78649 	 * * No MR with the specified L_Key exists.
78650 	 * * A fast register request was performed on a non-
78651 	 *   physical MR.
78652 	 * * A fast register request was performed on a physical MR
78653 	 *   that is already registered.
78654 	 * * A fast register request was performed on a physical MR
78655 	 *   that does not have a page list allocated (has not been
78656 	 *   initialized).
78657 	 * * The number of pages being registered exceeds the capacity
78658 	 *   of the physical MR.
78659 	 * * The length of the registration is not possible with the
78660 	 *   actual number of pages provided.
78661 	 * * Domain error - when QP's PD does not match PMR PD.
78662 	 * This is a TX Detected Error.
78663 	 */
78664 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_ILLEGAL_FAST_REG	UINT32_C(0xd)
78665 	/*
78666 	 * Illegal invalidate.
78667 	 * * No MR with the specified L_Key exists.
78668 	 * * No MW with the specified R_Key exists.
78669 	 * * An invalidate was performed against a non-physical MR.
78670 	 * * An invalidate was performed against a physical MR that
78671 	 *   is not registered.
78672 	 * * An invalidate was performed against a MW that is not
78673 	 *   bound.
78674 	 * * The PD of the MR/MW being invalidated does not match the PD
78675 	 *   of the QP.
78676 	 * This is a TX Detected Error.
78677 	 */
78678 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_ILLEGAL_INVALIDATE	UINT32_C(0xe)
78679 	/*
78680 	 * Completion Error.
78681 	 * No CQE space available on queue, or CQ not in VALID state.
78682 	 * This is a Completion Detected Error.
78683 	 */
78684 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_CMP_ERROR		UINT32_C(0xf)
78685 	/*
78686 	 * Local memory error while retransmitting WQE.
78687 	 * An SQ SGE described an inaccessible memory.
78688 	 * This is a TX Detected Error.
78689 	 */
78690 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_RETRAN_LOCAL_ERROR	UINT32_C(0x10)
78691 	/*
78692 	 * Problem found in the format of a WQE in the SQ.
78693 	 * This is a TX Detected Error.
78694 	 */
78695 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_WQE_FORMAT_ERROR	UINT32_C(0x11)
78696 	/*
78697 	 * Problem was found in the format of an ORRQ entry.
78698 	 * This is a RX Detected Error.
78699 	 */
78700 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_ORRQ_FORMAT_ERROR	UINT32_C(0x12)
78701 	/*
78702 	 * A UD send attempted to use an invalid AVID.
78703 	 * This is a TX Detected Error.
78704 	 */
78705 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_INVALID_AVID_ERROR	UINT32_C(0x13)
78706 	/*
78707 	 * A UD send attempted to use an AVID that is outside of its
78708 	 * QP's protection domain.
78709 	 * This is a TX Detected Error.
78710 	 */
78711 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_AV_DOMAIN_ERROR	UINT32_C(0x14)
78712 	/*
78713 	 * A load error occurred on an attempt to load the CQ Context.
78714 	 * This is a Completion Detected Error.
78715 	 */
78716 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_CQ_LOAD_ERROR	UINT32_C(0x15)
78717 	/*
78718 	 * There was an attempt to process a WQE from the SQ that
78719 	 * corresponds to an operation that is unsupported for the
78720 	 * corresponding QP.
78721 	 * This is a TX Detected Error.
78722 	 */
78723 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_SERV_TYPE_ERROR	UINT32_C(0x16)
78724 	/*
78725 	 * There was an attempt to process a WQE from the SQ that
78726 	 * corresponds to an operation that is unsupported for the
78727 	 * corresponding QP, according to the supported_operations QPC
78728 	 * field.
78729 	 * This is a TX Detected Error.
78730 	 */
78731 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_INVALID_OP_ERROR	UINT32_C(0x17)
78732 	/*
78733 	 * A fatal error was detected on an attempt to read from
78734 	 * or write to PCIe on the transmit side. This error is
78735 	 * detected by the TX side (or CAGR), but has the priority
78736 	 * of a Completion Detected Error.
78737 	 */
78738 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_TX_PCI_ERROR		UINT32_C(0x18)
78739 	/*
78740 	 * A fatal error was detected on an attempt to read from
78741 	 * or write to PCIe on the receive side. This error is detected
78742 	 * by the RX side (or CAGR), but has the priority of a
78743 	 * Completion Detected Error.
78744 	 */
78745 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_RX_PCI_ERROR		UINT32_C(0x19)
78746 	/*
78747 	 * When processing a WQE from the SQ, TWE detected an error
78748 	 * such that the wqe_size given in the header is larger than
78749 	 * the delta between sq_work_idx and sq_prod_idx. This error
78750 	 * has priority over the non-error case that occurs when TWE
78751 	 * detects that it simply doesn't have enough slots fetched
78752 	 * to execute the WQE during the current residency.
78753 	 */
78754 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_PROD_WQE_MSMTCH_ERROR   UINT32_C(0x1a)
78755 	/*
78756 	 * When reading the MSN table to initiate HW retransmit, RWE
78757 	 * found that to_retransmit_psn was not within the range defined
78758 	 * by start_psn and next_psn in the corresponding MSN table
78759 	 * entry. To_retransmit_psn must be greater than or equal to
78760 	 * start_psn and less than next_psn in order for the range check
78761 	 * to succeed.
78762 	 * This is a RX Detected Error.
78763 	 */
78764 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_PSN_RANGE_CHECK_ERROR   UINT32_C(0x1b)
78765 	/*
78766 	 * While retransmitting, TWE detected one of several possible
78767 	 * error detection scenarios related to the improper setup of
78768 	 * retransmission. These include a category or errors known as
78769 	 * retx_end_error where the retransmission end does not line up
78770 	 * sequentially with the WQE index and PSN upon continuing on
78771 	 * with the regular transmission that follows the
78772 	 * retransmission. It also includes the error condition in which
78773 	 * the retransmission Work Request has gen_dup_read_request set
78774 	 * and the WQE fetched by TWE is not an RDMA Read or Atomic WQE.
78775 	 * Please see TWE requirements for a full list of the various
78776 	 * possible retransmit setup error cases. These error cases
78777 	 * apply to H/W and F/W retransmission, alike.
78778 	 * This is a TX Detected Error.
78779 	 */
78780 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_RETX_SETUP_ERROR	UINT32_C(0x1c)
78781 	/*
78782 	 * An express doorbell was posted that overflowed the SQ. The
78783 	 * doorbell is dropped, along with all subsequent doorbells for
78784 	 * this SQ. This is a TX Detected Error.
78785 	 */
78786 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_SQ_OVERFLOW		UINT32_C(0x1d)
78787 	#define CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_LAST			CREQ_QP_ERROR_NOTIFICATION_REQ_ERR_STATE_REASON_REQ_SQ_OVERFLOW
78788 	/* QP context id */
78789 	uint32_t	xid;
78790 	uint8_t	v;
78791 	/*
78792 	 * This value is written by the NIC such that it will be different
78793 	 * for each pass through the completion queue. The even passes
78794 	 * will write 1. The odd passes will write 0.
78795 	 */
78796 	#define CREQ_QP_ERROR_NOTIFICATION_V	UINT32_C(0x1)
78797 	/* Event or command opcode. */
78798 	uint8_t	event;
78799 	/* QP error notification event. */
78800 	#define CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION UINT32_C(0xc0)
78801 	#define CREQ_QP_ERROR_NOTIFICATION_EVENT_LAST		CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION
78802 	/* responder slow path state */
78803 	uint8_t	res_slow_path_state;
78804 	uint8_t	res_err_state_reason;
78805 	/* No error. */
78806 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_NO_ERROR			UINT32_C(0x0)
78807 	/*
78808 	 * Incoming Send, RDMA write, or RDMA read exceeds the maximum
78809 	 * transfer length. Detected on RX first and only packets for
78810 	 * write. Detected on RX request for read.
78811 	 * This is an RX Detected Error.
78812 	 */
78813 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_EXCEED_MAX		UINT32_C(0x1)
78814 	/*
78815 	 * RDMA write payload size does not match write length. Detected
78816 	 * when total write payload is not equal to the RDMA write
78817 	 * length that was given in the first or only packet of the
78818 	 * request.
78819 	 * This is an RX Detected Error.
78820 	 */
78821 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_PAYLOAD_LENGTH_MISMATCH   UINT32_C(0x2)
78822 	/*
78823 	 * Send payload exceeds RQ/SRQ WQE buffer capacity. The total
78824 	 * send payload that arrived is more than the size of the WQE
78825 	 * buffer that was fetched from the RQ/SRQ.
78826 	 * This is an RX Detected Error.
78827 	 */
78828 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_EXCEEDS_WQE		UINT32_C(0x3)
78829 	/*
78830 	 * Responder detected opcode error.
78831 	 * * First, only, middle, last or incoming requests are
78832 	 *   improperly ordered with respect to previous (PSN) packet.
78833 	 * * First or middle packet is not full MTU size.
78834 	 * This is an RX Detected Error.
78835 	 */
78836 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_OPCODE_ERROR		UINT32_C(0x4)
78837 	/*
78838 	 * PSN sequence error retry limit exceeded.
78839 	 * The responder encountered a PSN sequence error for the
78840 	 * same PSN too many times. This can occur via implicit or
78841 	 * explicit NAK.
78842 	 * This is an RX Detected Error.
78843 	 */
78844 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_PSN_SEQ_ERROR_RETRY_LIMIT UINT32_C(0x5)
78845 	/*
78846 	 * Invalid R_Key.
78847 	 * An incoming request contained an R_Key that did not reference
78848 	 * a valid MR/MW. This error may be detected by the RX engine
78849 	 * for RDMA write or by the TX engine for RDMA read
78850 	 * (detected while servicing IRRQ).
78851 	 * This is an RX Detected Error.
78852 	 */
78853 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_RX_INVALID_R_KEY	UINT32_C(0x6)
78854 	/*
78855 	 * Domain error.
78856 	 * An incoming request specified an R_Key which
78857 	 * referenced a MR/MW that was not in the same PD as the QP on
78858 	 * which the request arrived.
78859 	 * This is an RX Detected Error.
78860 	 */
78861 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_RX_DOMAIN_ERROR	UINT32_C(0x7)
78862 	/*
78863 	 * No permission.
78864 	 * An incoming request contained an R_Key that referenced a
78865 	 * MR/MW which did not have the access permission needed for
78866 	 * the operation.
78867 	 * This is an RX Detected Error.
78868 	 */
78869 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_RX_NO_PERMISSION	UINT32_C(0x8)
78870 	/*
78871 	 * Range error.
78872 	 * An incoming request had a combination of R_Key,VA, and
78873 	 * length that was out of bounds of the associated MR/MW.
78874 	 * This is an RX Detected Error.
78875 	 */
78876 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_RX_RANGE_ERROR		UINT32_C(0x9)
78877 	/*
78878 	 * Invalid R_Key.
78879 	 * An incoming request contained an R_Key that did not
78880 	 * reference a valid MR/MW. This error may be detected
78881 	 * by the RX engine for RDMA write or by the TX engine
78882 	 * for RDMA read (detected while servicing IRRQ).
78883 	 * This is a TX Detected Error.
78884 	 */
78885 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_TX_INVALID_R_KEY	UINT32_C(0xa)
78886 	/*
78887 	 * Domain error.
78888 	 * An incoming request specified an R_Key which referenced
78889 	 * a MR/MW that was not in the same PD as the QP on
78890 	 * which the request arrived.
78891 	 * This is a TX Detected Error.
78892 	 */
78893 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_TX_DOMAIN_ERROR	UINT32_C(0xb)
78894 	/*
78895 	 * No permission.
78896 	 * An incoming request contained an R_Key that referenced a
78897 	 * MR/MW which did not have the access permission needed for
78898 	 * the operation.
78899 	 * This is a TX Detected Error.
78900 	 */
78901 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_TX_NO_PERMISSION	UINT32_C(0xc)
78902 	/*
78903 	 * Range error.
78904 	 * An incoming request had a combination of R_Key, VA, and
78905 	 * length that was out of bounds of the associated MR/MW.
78906 	 * This is a TX Detected Error.
78907 	 */
78908 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_TX_RANGE_ERROR		UINT32_C(0xd)
78909 	/*
78910 	 * IRRQ overflow.
78911 	 * The peer sent us more RDMA read or atomic requests than
78912 	 * the negotiated maximum.
78913 	 * This is an RX Detected Error.
78914 	 */
78915 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_IRRQ_OFLOW		UINT32_C(0xe)
78916 	/*
78917 	 * Unsupported opcode.
78918 	 * The peer sent us a request with an opcode for a request
78919 	 * type that is not supported on this QP.
78920 	 * This is an RX Detected Error.
78921 	 */
78922 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_UNSUPPORTED_OPCODE	UINT32_C(0xf)
78923 	/*
78924 	 * Unaligned atomic operation. The VA of an atomic request
78925 	 * is on a memory boundary that prevents atomic execution.
78926 	 * This is an RX Detected Error.
78927 	 */
78928 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_UNALIGN_ATOMIC		UINT32_C(0x10)
78929 	/*
78930 	 * Remote invalidate error.
78931 	 * A send with invalidate request arrived in which the
78932 	 * R_Key to invalidate did not describe a MR/MW which could
78933 	 * be invalidated. RQ WQE completes with error status.
78934 	 * This error is only reported if the send operation did
78935 	 * not fail. If the send operation failed then the remote
78936 	 * invalidate error is not reported.
78937 	 * This is an RX Detected Error.
78938 	 */
78939 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_REM_INVALIDATE		UINT32_C(0x11)
78940 	/*
78941 	 * Local memory error. An RQ/SRQ SGE described an inaccessible
78942 	 * memory.
78943 	 * This is an RX Detected Error.
78944 	 */
78945 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_MEMORY_ERROR		UINT32_C(0x12)
78946 	/*
78947 	 * SRQ in error. The QP is moving to error state because it
78948 	 * found SRQ it uses in error.
78949 	 * This is an RX Detected Error.
78950 	 */
78951 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_SRQ_ERROR		UINT32_C(0x13)
78952 	/*
78953 	 * Completion error. No CQE space available on queue or CQ not
78954 	 * in VALID state.
78955 	 * This is a Completion Detected Error.
78956 	 */
78957 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_CMP_ERROR		UINT32_C(0x14)
78958 	/*
78959 	 * Invalid R_Key while resending responses to duplicate request.
78960 	 * This is a TX Detected Error.
78961 	 */
78962 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_INVALID_DUP_RKEY	UINT32_C(0x15)
78963 	/*
78964 	 * Problem was found in the format of a WQE in the RQ/SRQ.
78965 	 * This is an RX Detected Error.
78966 	 */
78967 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_WQE_FORMAT_ERROR	UINT32_C(0x16)
78968 	/*
78969 	 * Problem was found in the format of an IRRQ entry.
78970 	 * This is a TX Detected Error.
78971 	 */
78972 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_IRRQ_FORMAT_ERROR	UINT32_C(0x17)
78973 	/*
78974 	 * A load error occurred on an attempt to load the CQ Context.
78975 	 * This is a Completion Detected Error.
78976 	 */
78977 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_CQ_LOAD_ERROR		UINT32_C(0x18)
78978 	/*
78979 	 * A load error occurred on an attempt to load the SRQ Context.
78980 	 * This is an RX Detected Error.
78981 	 */
78982 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_SRQ_LOAD_ERROR		UINT32_C(0x19)
78983 	/*
78984 	 * A fatal error was detected on an attempt to read from or
78985 	 * write to PCIe on the transmit side. This error is detected
78986 	 * by the TX side, but has the priority of a Completion
78987 	 * Detected Error.
78988 	 */
78989 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_TX_PCI_ERROR		UINT32_C(0x1b)
78990 	/*
78991 	 * A fatal error was detected on an attempt to read from or
78992 	 * write to PCIe on the receive side. This error is detected
78993 	 * by the RX side (or CAGR), but has the priority of a Completion
78994 	 * Detected Error.
78995 	 */
78996 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_RX_PCI_ERROR		UINT32_C(0x1c)
78997 	/*
78998 	 * When searching the IRRQ to respond to a duplicate request,
78999 	 * RWE could not find the duplicate request in the entire IRRQ.
79000 	 * This is a RX Detected Error.
79001 	 */
79002 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_PSN_NOT_FOUND		UINT32_C(0x1d)
79003 	/*
79004 	 * An express doorbell was posted that overflowed the RQ. The
79005 	 * doorbell is dropped, along with all subsequent doorbells for
79006 	 * this RQ. This is an RX Detected Error.
79007 	 */
79008 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_RQ_OVERFLOW		UINT32_C(0x1e)
79009 	#define CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_LAST			CREQ_QP_ERROR_NOTIFICATION_RES_ERR_STATE_REASON_RES_RQ_OVERFLOW
79010 	/*
79011 	 * Final SQ Consumer Index value. Any additional SQ WQEs will
79012 	 * have to be completed by the user provider.
79013 	 */
79014 	uint16_t	sq_cons_idx;
79015 	/*
79016 	 * Final RQ Consumer Index value. Any additional RQ WQEs will
79017 	 * have to be completed by the user provider.
79018 	 */
79019 	uint16_t	rq_cons_idx;
79020 } creq_qp_error_notification_t, *pcreq_qp_error_notification_t;
79021 
79022 /* CQ error notification event. */
79023 /* creq_cq_error_notification (size:128b/16B) */
79024 
79025 typedef struct creq_cq_error_notification {
79026 	uint8_t	type;
79027 	/*
79028 	 * This field indicates the exact type of the completion.
79029 	 * By convention, the LSB identifies the length of the
79030 	 * record in 16B units. Even values indicate 16B
79031 	 * records. Odd values indicate 32B
79032 	 * records.
79033 	 */
79034 	#define CREQ_CQ_ERROR_NOTIFICATION_TYPE_MASK	UINT32_C(0x3f)
79035 	#define CREQ_CQ_ERROR_NOTIFICATION_TYPE_SFT	0
79036 	/* CQ Async Notification */
79037 		#define CREQ_CQ_ERROR_NOTIFICATION_TYPE_CQ_EVENT  UINT32_C(0x38)
79038 		#define CREQ_CQ_ERROR_NOTIFICATION_TYPE_LAST	CREQ_CQ_ERROR_NOTIFICATION_TYPE_CQ_EVENT
79039 	/* Status of the response. */
79040 	uint8_t	status;
79041 	/* CQ error reason code. */
79042 	uint8_t	cq_err_reason;
79043 	/* Requester completion error for invalid CQ state. */
79044 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_INVALID_ERROR  UINT32_C(0x1)
79045 	/* Requester completion error for CQ overflow. */
79046 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_OVERFLOW_ERROR UINT32_C(0x2)
79047 	/* Attempt to load CQ context resulted in error. */
79048 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_LOAD_ERROR	UINT32_C(0x3)
79049 	/* Responder completion error for invalid CQ state. */
79050 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_INVALID_ERROR  UINT32_C(0x4)
79051 	/* Responder completion error for CQ overflow. */
79052 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_OVERFLOW_ERROR UINT32_C(0x5)
79053 	/* Attempt to load CQ context resulted in error. */
79054 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_LOAD_ERROR	UINT32_C(0x6)
79055 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_LAST		CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_LOAD_ERROR
79056 	uint8_t	reserved8;
79057 	/* CQ context id */
79058 	uint32_t	xid;
79059 	uint8_t	v;
79060 	/*
79061 	 * This value is written by the NIC such that it will be different
79062 	 * for each pass through the completion queue. The even passes
79063 	 * will write 1. The odd passes will write 0.
79064 	 */
79065 	#define CREQ_CQ_ERROR_NOTIFICATION_V	UINT32_C(0x1)
79066 	/* Event or command opcode. */
79067 	uint8_t	event;
79068 	/* CQ error notification event. */
79069 	#define CREQ_CQ_ERROR_NOTIFICATION_EVENT_CQ_ERROR_NOTIFICATION UINT32_C(0xc1)
79070 	#define CREQ_CQ_ERROR_NOTIFICATION_EVENT_LAST		CREQ_CQ_ERROR_NOTIFICATION_EVENT_CQ_ERROR_NOTIFICATION
79071 	uint8_t	reserved48[6];
79072 } creq_cq_error_notification_t, *pcreq_cq_error_notification_t;
79073 
79074 /* sq_base (size:64b/8B) */
79075 
79076 typedef struct sq_base {
79077 	/* This field defines the type of SQ WQE. */
79078 	uint8_t	wqe_type;
79079 	/* Send */
79080 	#define SQ_BASE_WQE_TYPE_SEND		UINT32_C(0x0)
79081 	/*
79082 	 * Send with Immediate
79083 	 *
79084 	 * Allowed only on reliable connection (RC) and
79085 	 * unreliable datagram (UD) SQs.
79086 	 */
79087 	#define SQ_BASE_WQE_TYPE_SEND_W_IMMEAD	UINT32_C(0x1)
79088 	/*
79089 	 * Send with Invalidate.
79090 	 *
79091 	 * Allowed only on reliable connection (RC) SQs.
79092 	 */
79093 	#define SQ_BASE_WQE_TYPE_SEND_W_INVALID	UINT32_C(0x2)
79094 	/*
79095 	 * RDMA Write.
79096 	 *
79097 	 * Allowed only on reliable connection (RC) SQs.
79098 	 */
79099 	#define SQ_BASE_WQE_TYPE_WRITE_WQE		UINT32_C(0x4)
79100 	/*
79101 	 * RDMA Write with Immediate.
79102 	 *
79103 	 * Allowed only on reliable connection (RC) SQs.
79104 	 */
79105 	#define SQ_BASE_WQE_TYPE_WRITE_W_IMMEAD	UINT32_C(0x5)
79106 	/*
79107 	 * RDMA Read.
79108 	 *
79109 	 * Allowed only on reliable connection (RC) SQs.
79110 	 */
79111 	#define SQ_BASE_WQE_TYPE_READ_WQE		UINT32_C(0x6)
79112 	/*
79113 	 * Atomic Compare/Swap.
79114 	 *
79115 	 * Allowed only on reliable connection (RC) SQs.
79116 	 */
79117 	#define SQ_BASE_WQE_TYPE_ATOMIC_CS		UINT32_C(0x8)
79118 	/*
79119 	 * Atomic Fetch/Add.
79120 	 *
79121 	 * Allowed only on reliable connection (RC) SQs.
79122 	 */
79123 	#define SQ_BASE_WQE_TYPE_ATOMIC_FA		UINT32_C(0xb)
79124 	/*
79125 	 * Local Invalidate.
79126 	 *
79127 	 * Allowed only on reliable connection (RC) SQs.
79128 	 */
79129 	#define SQ_BASE_WQE_TYPE_LOCAL_INVALID	UINT32_C(0xc)
79130 	/*
79131 	 * FR-PMR (Fast Register Physical Memory Region)
79132 	 *
79133 	 * Allowed only on reliable connection (RC) SQs.
79134 	 */
79135 	#define SQ_BASE_WQE_TYPE_FR_PMR		UINT32_C(0xd)
79136 	/*
79137 	 * Memory Bind
79138 	 *
79139 	 * Allowed only on reliable connection (RC) SQs.
79140 	 */
79141 	#define SQ_BASE_WQE_TYPE_BIND		UINT32_C(0xe)
79142 	/*
79143 	 * FR-PPMR (Fast Register Proxy Physical Memory Region)
79144 	 *
79145 	 * Allowed only on reliable connection (RC) SQs.
79146 	 */
79147 	#define SQ_BASE_WQE_TYPE_FR_PPMR		UINT32_C(0xf)
79148 	/* Send V3 */
79149 	#define SQ_BASE_WQE_TYPE_SEND_V3		UINT32_C(0x10)
79150 	/*
79151 	 * Send with Immediate V3
79152 	 *
79153 	 * Allowed only on reliable connection (RC) SQs.
79154 	 */
79155 	#define SQ_BASE_WQE_TYPE_SEND_W_IMMED_V3	UINT32_C(0x11)
79156 	/*
79157 	 * Send with Invalidate V3
79158 	 *
79159 	 * Allowed only on reliable connection (RC) SQs.
79160 	 */
79161 	#define SQ_BASE_WQE_TYPE_SEND_W_INVALID_V3	UINT32_C(0x12)
79162 	/*
79163 	 * UD Send V3
79164 	 *
79165 	 * Allowed only on unreliable datagram (UD) SQs.
79166 	 */
79167 	#define SQ_BASE_WQE_TYPE_UDSEND_V3		UINT32_C(0x13)
79168 	/*
79169 	 * UD Send with Immediate V3
79170 	 *
79171 	 * Allowed only on unreliable datagram (UD) SQs.
79172 	 */
79173 	#define SQ_BASE_WQE_TYPE_UDSEND_W_IMMED_V3	UINT32_C(0x14)
79174 	/*
79175 	 * RDMA Write V3
79176 	 *
79177 	 * Allowed only on reliable connection (RC) SQs.
79178 	 */
79179 	#define SQ_BASE_WQE_TYPE_WRITE_WQE_V3	UINT32_C(0x15)
79180 	/*
79181 	 * RDMA Write with Immediate V3
79182 	 *
79183 	 * Allowed only on reliable connection (RC) SQs.
79184 	 */
79185 	#define SQ_BASE_WQE_TYPE_WRITE_W_IMMED_V3	UINT32_C(0x16)
79186 	/*
79187 	 * RDMA Read V3
79188 	 *
79189 	 * Allowed only on reliable connection (RC) SQs.
79190 	 */
79191 	#define SQ_BASE_WQE_TYPE_READ_WQE_V3	UINT32_C(0x17)
79192 	/*
79193 	 * Atomic Compare/Swap V3
79194 	 *
79195 	 * Allowed only on reliable connection (RC) SQs.
79196 	 */
79197 	#define SQ_BASE_WQE_TYPE_ATOMIC_CS_V3	UINT32_C(0x18)
79198 	/*
79199 	 * Atomic Fetch/Add V3
79200 	 *
79201 	 * Allowed only on reliable connection (RC) SQs.
79202 	 */
79203 	#define SQ_BASE_WQE_TYPE_ATOMIC_FA_V3	UINT32_C(0x19)
79204 	/*
79205 	 * Local Invalidate V3
79206 	 *
79207 	 * Allowed only on reliable connection (RC) SQs.
79208 	 */
79209 	#define SQ_BASE_WQE_TYPE_LOCAL_INVALID_V3	UINT32_C(0x1a)
79210 	/*
79211 	 * FR-PMR (Fast Register Physical Memory Region) V3
79212 	 *
79213 	 * Allowed only on reliable connection (RC) SQs.
79214 	 */
79215 	#define SQ_BASE_WQE_TYPE_FR_PMR_V3		UINT32_C(0x1b)
79216 	/*
79217 	 * Memory Bind V3
79218 	 *
79219 	 * Allowed only on reliable connection (RC) SQs.
79220 	 */
79221 	#define SQ_BASE_WQE_TYPE_BIND_V3		UINT32_C(0x1c)
79222 	/* RawEth/QP1 Send V3 */
79223 	#define SQ_BASE_WQE_TYPE_RAWQP1SEND_V3	UINT32_C(0x1d)
79224 	/* Change UDP Source Port V3 */
79225 	#define SQ_BASE_WQE_TYPE_CHANGE_UDPSRCPORT_V3 UINT32_C(0x1e)
79226 	#define SQ_BASE_WQE_TYPE_LAST		SQ_BASE_WQE_TYPE_CHANGE_UDPSRCPORT_V3
79227 	uint8_t	unused_0[7];
79228 } sq_base_t, *psq_base_t;
79229 
79230 /*
79231  * Most SQ WQEs contain SGEs used to define the SGL used to map payload
79232  * data in host memory. The number of SGE structures is defined by the
79233  * wqe_size field. SGE structures are aligned to 16B boundaries.
79234  *
79235  * In backward-compatible modes there can be 2, 4 or 6 SGEs (based on
79236  * the mode). In variable-sized WQE mode there can be 0-30 SGE
79237  * structures.
79238  */
79239 /* sq_sge (size:128b/16B) */
79240 
79241 typedef struct sq_sge {
79242 	/*
79243 	 * The virtual address in local memory or a physical address
79244 	 * when l_key value is a reserved value of a physical address.
79245 	 * Driver configures this value in the chip and the chip compares
79246 	 * l_key in SGEs with that reserved value, if equal it access
79247 	 * the physical address specified. The chip however MUST verify
79248 	 * that the QP allows the use reserved key.
79249 	 */
79250 	uint64_t	va_or_pa;
79251 	/*
79252 	 * Local Key associated with this registered MR; The 24 msb of
79253 	 * the key used to index the MRW Table and the 8 lsb are compared
79254 	 * with the 8 bits key part stored in the MRWC. The PBL in the
79255 	 * MRW Context is used to translate the above VA to physical
79256 	 * address.
79257 	 */
79258 	uint32_t	l_key;
79259 	/*
79260 	 * Size of SGE in bytes; Based on page size of the system the
79261 	 * chip knows how many entries are in the PBL
79262 	 */
79263 	uint32_t	size;
79264 } sq_sge_t, *psq_sge_t;
79265 
79266 /* sq_psn_search (size:64b/8B) */
79267 
79268 typedef struct sq_psn_search {
79269 	/* Start PSN. */
79270 	uint32_t	opcode_start_psn;
79271 	/* Start PSN. */
79272 	#define SQ_PSN_SEARCH_START_PSN_MASK UINT32_C(0xffffff)
79273 	#define SQ_PSN_SEARCH_START_PSN_SFT 0
79274 	/* The opcodes are software defined. */
79275 	#define SQ_PSN_SEARCH_OPCODE_MASK   UINT32_C(0xff000000)
79276 	#define SQ_PSN_SEARCH_OPCODE_SFT	24
79277 	uint32_t	flags_next_psn;
79278 	/* Next PSN. Equal to the start PSN of the next WQE. */
79279 	#define SQ_PSN_SEARCH_NEXT_PSN_MASK UINT32_C(0xffffff)
79280 	#define SQ_PSN_SEARCH_NEXT_PSN_SFT 0
79281 	/* Opcode specific flags. */
79282 	#define SQ_PSN_SEARCH_FLAGS_MASK   UINT32_C(0xff000000)
79283 	#define SQ_PSN_SEARCH_FLAGS_SFT	24
79284 } sq_psn_search_t, *psq_psn_search_t;
79285 
79286 /* This PSN table structure is used only on devices where variable size WQEs are supported. */
79287 /* sq_psn_search_ext (size:128b/16B) */
79288 
79289 typedef struct sq_psn_search_ext {
79290 	/* Start PSN. */
79291 	uint32_t	opcode_start_psn;
79292 	/* Start PSN. */
79293 	#define SQ_PSN_SEARCH_EXT_START_PSN_MASK UINT32_C(0xffffff)
79294 	#define SQ_PSN_SEARCH_EXT_START_PSN_SFT 0
79295 	/* The opcodes are software defined. */
79296 	#define SQ_PSN_SEARCH_EXT_OPCODE_MASK   UINT32_C(0xff000000)
79297 	#define SQ_PSN_SEARCH_EXT_OPCODE_SFT	24
79298 	uint32_t	flags_next_psn;
79299 	/* Next PSN. Equal to the start PSN of the next WQE. */
79300 	#define SQ_PSN_SEARCH_EXT_NEXT_PSN_MASK UINT32_C(0xffffff)
79301 	#define SQ_PSN_SEARCH_EXT_NEXT_PSN_SFT 0
79302 	/* Opcode specific flags. */
79303 	#define SQ_PSN_SEARCH_EXT_FLAGS_MASK   UINT32_C(0xff000000)
79304 	#define SQ_PSN_SEARCH_EXT_FLAGS_SFT	24
79305 	/*
79306 	 * This field is used only when variable sized WQEs are being used.
79307 	 * This indicates the starting slot index of the corresponding WQE.
79308 	 */
79309 	uint16_t	start_slot_idx;
79310 	/* reserved16 is 16 b */
79311 	uint16_t	reserved16;
79312 	/* reserved32 is 32 b */
79313 	uint32_t	reserved32;
79314 } sq_psn_search_ext_t, *psq_psn_search_ext_t;
79315 
79316 /* This MSN table structure is used only on devices where Hardware based Requester retransmission is used. */
79317 /* sq_msn_search (size:64b/8B) */
79318 
79319 typedef struct sq_msn_search {
79320 	/* MSN search entry. */
79321 	uint64_t	start_idx_next_psn_start_psn;
79322 	/* Start PSN. */
79323 	#define SQ_MSN_SEARCH_START_PSN_MASK UINT32_C(0xffffff)
79324 	#define SQ_MSN_SEARCH_START_PSN_SFT 0
79325 	/* Next PSN. Equal to the start PSN of the next WQE. */
79326 	#define SQ_MSN_SEARCH_NEXT_PSN_MASK 0xffffff000000ULL
79327 	#define SQ_MSN_SEARCH_NEXT_PSN_SFT  24
79328 	/*
79329 	 * For variable-size WQEs, this field indicates the starting
79330 	 * slot index that corresponds to the WQE.
79331 	 * In backward-compatible mode, this is the starting WQE index.
79332 	 */
79333 	#define SQ_MSN_SEARCH_START_IDX_MASK 0xffff000000000000ULL
79334 	#define SQ_MSN_SEARCH_START_IDX_SFT 48
79335 } sq_msn_search_t, *psq_msn_search_t;
79336 
79337 /* Send SQ WQE */
79338 /* sq_send (size:1024b/128B) */
79339 
79340 typedef struct sq_send {
79341 	/* This field defines the type of SQ WQE. */
79342 	uint8_t	wqe_type;
79343 	/* Send */
79344 	#define SQ_SEND_WQE_TYPE_SEND	UINT32_C(0x0)
79345 	/*
79346 	 * Send with Immediate
79347 	 *
79348 	 * Allowed only on reliable connection (RC) and
79349 	 * unreliable datagram (UD) SQs.
79350 	 */
79351 	#define SQ_SEND_WQE_TYPE_SEND_W_IMMEAD  UINT32_C(0x1)
79352 	/*
79353 	 * Send with Invalidate.
79354 	 *
79355 	 * Allowed only on reliable connection (RC) SQs.
79356 	 */
79357 	#define SQ_SEND_WQE_TYPE_SEND_W_INVALID UINT32_C(0x2)
79358 	#define SQ_SEND_WQE_TYPE_LAST	SQ_SEND_WQE_TYPE_SEND_W_INVALID
79359 	uint8_t	flags;
79360 	#define SQ_SEND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
79361 	#define SQ_SEND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
79362 	/*
79363 	 * Set if completion signaling is requested. If this bit is
79364 	 * 0, and the SQ is configured to support Unsignaled completion
79365 	 * the controller should not generate a CQE unless there was
79366 	 * an error. This refers to the CQE on the sender side. (The se
79367 	 * flag refers to the receiver side).
79368 	 */
79369 	#define SQ_SEND_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
79370 	/*
79371 	 * Indication to complete all previous RDMA Read or Atomic WQEs
79372 	 * on the SQ before executing this WQE.
79373 	 *
79374 	 * This flag must be zero for a UD send.
79375 	 */
79376 	#define SQ_SEND_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
79377 	/*
79378 	 * For local invalidate request. Indication to complete all
79379 	 * previous SQ's WQEs before executing this WQE.
79380 	 *
79381 	 * This flag must be zero for a UD send.
79382 	 */
79383 	#define SQ_SEND_FLAGS_UC_FENCE								UINT32_C(0x4)
79384 	/*
79385 	 * Solicit event flag. Indication sent in BTH header to the
79386 	 * receiver to generate a Completion Event Notification, i.e.
79387 	 * CNQE. This bit should be set only in the last (or only) packet
79388 	 * of the message.
79389 	 */
79390 	#define SQ_SEND_FLAGS_SE									UINT32_C(0x8)
79391 	/*
79392 	 * Indicate that inline data is posted to the SQ in the data
79393 	 * area of this WQE.
79394 	 */
79395 	#define SQ_SEND_FLAGS_INLINE								UINT32_C(0x10)
79396 	/*
79397 	 * If set to 1, then the timestamp from the WQE is used. If
79398 	 * cleared to 0, then TWE provides the timestamp.
79399 	 */
79400 	#define SQ_SEND_FLAGS_WQE_TS_EN								UINT32_C(0x20)
79401 	/*
79402 	 * When set to '1', this operation will cause a trace capture in
79403 	 * each block it passes through.
79404 	 */
79405 	#define SQ_SEND_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
79406 	/*
79407 	 * The number of 16 bytes chunks of data including this first
79408 	 * word of the request that are a valid part of the request. The
79409 	 * valid 16 bytes units other than the WQE structure can be
79410 	 * SGEs (Scatter Gather Elements) OR inline data.
79411 	 *
79412 	 * While this field defines the valid WQE size. The actual
79413 	 * total WQE size is always 128B.
79414 	 */
79415 	uint8_t	wqe_size;
79416 	uint8_t	reserved8_1;
79417 	/*
79418 	 * Either invalidate key (R_Key of the remote host) that will
79419 	 * be send with IETH (Invalidate ETH) if wqe_type is of Send
79420 	 * with Invalidate, or immediate value that will be sent with
79421 	 * ImmDt header if wqe_type is Send with Immediate.
79422 	 */
79423 	uint32_t	inv_key_or_imm_data;
79424 	/* This field represents a 32-bit total data length, in bytes. */
79425 	uint32_t	length;
79426 	/*
79427 	 * When in the SQ of a UD QP, indicates the q_key to be used in
79428 	 * the transmitted packet. However, if the most significant bit
79429 	 * of this field is set, then the q_key will be taken from QP
79430 	 * context, rather than from this field.
79431 	 *
79432 	 * When in the SQ of a non-UD QP, this field is reserved and
79433 	 * should be filled with zeros.
79434 	 */
79435 	uint32_t	q_key;
79436 	/*
79437 	 * When in the SQ of a UD QP, indicates the destination QP to be
79438 	 * used in the transmitted packet.
79439 	 *
79440 	 * When in the SQ of a non-UD QP, this field is reserved and
79441 	 * should be filled with zeros.
79442 	 */
79443 	uint32_t	dst_qp;
79444 	#define SQ_SEND_DST_QP_MASK UINT32_C(0xffffff)
79445 	#define SQ_SEND_DST_QP_SFT 0
79446 	uint32_t	avid;
79447 	/*
79448 	 * If the serv_type is 'UD', then this field supplies the AVID
79449 	 * (Address Vector ID).
79450 	 */
79451 	#define SQ_SEND_AVID_MASK UINT32_C(0xfffff)
79452 	#define SQ_SEND_AVID_SFT 0
79453 	uint32_t	reserved32;
79454 	uint32_t	timestamp;
79455 	/*
79456 	 * This field specifies a 24-bit timestamp that can be passed
79457 	 * down the TX path and optionally logged in the TXP timestamp
79458 	 * histogram.
79459 	 */
79460 	#define SQ_SEND_TIMESTAMP_MASK UINT32_C(0xffffff)
79461 	#define SQ_SEND_TIMESTAMP_SFT 0
79462 	/*
79463 	 * When inline=0, then this area is filled with from 1 to 6
79464 	 * SGEs based on the wqe_size field.
79465 	 *
79466 	 * When inline=1, this area is filled with payload data for the
79467 	 * send based on the length_or_AVID field. Bits [7:0] of word 0
79468 	 * hold the first byte to go out on the wire.
79469 	 */
79470 	uint32_t	data[24];
79471 } sq_send_t, *psq_send_t;
79472 
79473 /* Send SQ WQE header. */
79474 /* sq_send_hdr (size:256b/32B) */
79475 
79476 typedef struct sq_send_hdr {
79477 	/* This field defines the type of SQ WQE. */
79478 	uint8_t	wqe_type;
79479 	/* Send */
79480 	#define SQ_SEND_HDR_WQE_TYPE_SEND	UINT32_C(0x0)
79481 	/*
79482 	 * Send with Immediate
79483 	 *
79484 	 * Allowed only on reliable connection (RC) and
79485 	 * unreliable datagram (UD) SQs.
79486 	 */
79487 	#define SQ_SEND_HDR_WQE_TYPE_SEND_W_IMMEAD  UINT32_C(0x1)
79488 	/*
79489 	 * Send with Invalidate.
79490 	 *
79491 	 * Allowed only on reliable connection (RC) SQs.
79492 	 */
79493 	#define SQ_SEND_HDR_WQE_TYPE_SEND_W_INVALID UINT32_C(0x2)
79494 	#define SQ_SEND_HDR_WQE_TYPE_LAST	SQ_SEND_HDR_WQE_TYPE_SEND_W_INVALID
79495 	uint8_t	flags;
79496 	#define SQ_SEND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
79497 	#define SQ_SEND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
79498 	/*
79499 	 * Set if completion signaling is requested. If this bit is
79500 	 * 0, and the SQ is configured to support Unsignaled completion
79501 	 * the controller should not generate a CQE unless there was
79502 	 * an error. This refers to the CQE on the sender side. (The se
79503 	 * flag refers to the receiver side).
79504 	 */
79505 	#define SQ_SEND_HDR_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
79506 	/*
79507 	 * Indication to complete all previous RDMA Read or Atomic WQEs
79508 	 * on the SQ before executing this WQE.
79509 	 *
79510 	 * This flag must be zero for a UD send.
79511 	 */
79512 	#define SQ_SEND_HDR_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
79513 	/*
79514 	 * For local invalidate request. Indication to complete all
79515 	 * previous SQ's WQEs before executing this WQE.
79516 	 *
79517 	 * This flag must be zero for a UD send.
79518 	 */
79519 	#define SQ_SEND_HDR_FLAGS_UC_FENCE								UINT32_C(0x4)
79520 	/*
79521 	 * Solicit event flag. Indication sent in BTH header to the
79522 	 * receiver to generate a Completion Event Notification, i.e.
79523 	 * CNQE. This bit should be set only in the last (or only) packet
79524 	 * of the message.
79525 	 */
79526 	#define SQ_SEND_HDR_FLAGS_SE									UINT32_C(0x8)
79527 	/*
79528 	 * Indicate that inline data is posted to the SQ in the data
79529 	 * area of this WQE.
79530 	 */
79531 	#define SQ_SEND_HDR_FLAGS_INLINE								UINT32_C(0x10)
79532 	/*
79533 	 * If set to 1, then the timestamp from the WQE is used. If
79534 	 * cleared to 0, then TWE provides the timestamp.
79535 	 */
79536 	#define SQ_SEND_HDR_FLAGS_WQE_TS_EN								UINT32_C(0x20)
79537 	/*
79538 	 * When set to '1', this operation will cause a trace capture in
79539 	 * each block it passes through.
79540 	 */
79541 	#define SQ_SEND_HDR_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
79542 	/*
79543 	 * The number of 16 bytes chunks of data including this first
79544 	 * word of the request that are a valid part of the request. The
79545 	 * valid 16 bytes units other than the WQE structure can be
79546 	 * SGEs (Scatter Gather Elements) OR inline data.
79547 	 *
79548 	 * While this field defines the valid WQE size. The actual
79549 	 * total WQE size is always 128B.
79550 	 */
79551 	uint8_t	wqe_size;
79552 	uint8_t	reserved8_1;
79553 	/*
79554 	 * Either invalidate key (R_Key of the remote host) that will
79555 	 * be send with IETH (Invalidate ETH) if wqe_type is of Send
79556 	 * with Invalidate, or immediate value that will be sent with
79557 	 * ImmDt header if wqe_type is Send with Immediate.
79558 	 */
79559 	uint32_t	inv_key_or_imm_data;
79560 	/* This field represents a 32-bit total data length, in bytes. */
79561 	uint32_t	length;
79562 	/*
79563 	 * When in the SQ of a UD QP, indicates the q_key to be used in
79564 	 * the transmitted packet. However, if the most significant bit
79565 	 * of this field is set, then the q_key will be taken from QP
79566 	 * context, rather than from this field.
79567 	 *
79568 	 * When in the SQ of a non-UD QP, this field is reserved and
79569 	 * should be filled with zeros.
79570 	 */
79571 	uint32_t	q_key;
79572 	/*
79573 	 * When in the SQ of a UD QP, indicates the destination QP to be
79574 	 * used in the transmitted packet.
79575 	 *
79576 	 * When in the SQ of a non-UD QP, this field is reserved and
79577 	 * should be filled with zeros.
79578 	 */
79579 	uint32_t	dst_qp;
79580 	#define SQ_SEND_HDR_DST_QP_MASK UINT32_C(0xffffff)
79581 	#define SQ_SEND_HDR_DST_QP_SFT 0
79582 	uint32_t	avid;
79583 	/*
79584 	 * If the serv_type is 'UD', then this field supplies the AVID
79585 	 * (Address Vector ID).
79586 	 */
79587 	#define SQ_SEND_HDR_AVID_MASK UINT32_C(0xfffff)
79588 	#define SQ_SEND_HDR_AVID_SFT 0
79589 	uint32_t	reserved32;
79590 	uint32_t	timestamp;
79591 	/*
79592 	 * This field specifies a 24-bit timestamp that can be passed
79593 	 * down the TX path and optionally logged in the TXP timestamp
79594 	 * histogram.
79595 	 */
79596 	#define SQ_SEND_HDR_TIMESTAMP_MASK UINT32_C(0xffffff)
79597 	#define SQ_SEND_HDR_TIMESTAMP_SFT 0
79598 } sq_send_hdr_t, *psq_send_hdr_t;
79599 
79600 /* Send Raw Ethernet and QP1 SQ WQE */
79601 /* sq_send_raweth_qp1 (size:1024b/128B) */
79602 
79603 typedef struct sq_send_raweth_qp1 {
79604 	/* This field defines the type of SQ WQE. */
79605 	uint8_t	wqe_type;
79606 	/* Send */
79607 	#define SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND UINT32_C(0x0)
79608 	#define SQ_SEND_RAWETH_QP1_WQE_TYPE_LAST SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND
79609 	uint8_t	flags;
79610 	#define SQ_SEND_RAWETH_QP1_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
79611 	#define SQ_SEND_RAWETH_QP1_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
79612 	/*
79613 	 * Set if completion signaling is requested. If this bit is
79614 	 * 0, and the SQ is configured to support Unsignaled completion
79615 	 * the controller should not generate a CQE unless there was
79616 	 * an error. This refers to the CQE on the sender side. (The se
79617 	 * flag refers to the receiver side).
79618 	 */
79619 	#define SQ_SEND_RAWETH_QP1_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
79620 	/* This flag must be zero for a Raweth or QP1 send. */
79621 	#define SQ_SEND_RAWETH_QP1_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
79622 	/* This flag must be zero for a Raweth or QP1 send. */
79623 	#define SQ_SEND_RAWETH_QP1_FLAGS_UC_FENCE								UINT32_C(0x4)
79624 	/* This flag must be zero for a Raweth or QP1 send. */
79625 	#define SQ_SEND_RAWETH_QP1_FLAGS_SE									UINT32_C(0x8)
79626 	/*
79627 	 * Indicate that inline data is posted to the SQ in the data
79628 	 * area of this WQE.
79629 	 */
79630 	#define SQ_SEND_RAWETH_QP1_FLAGS_INLINE								UINT32_C(0x10)
79631 	/*
79632 	 * If set to 1, then the timestamp from the WQE is used. If
79633 	 * cleared to 0, then TWE provides the timestamp.
79634 	 */
79635 	#define SQ_SEND_RAWETH_QP1_FLAGS_WQE_TS_EN								UINT32_C(0x20)
79636 	/*
79637 	 * When set to '1', this operation will cause a trace capture in
79638 	 * each block it passes through.
79639 	 */
79640 	#define SQ_SEND_RAWETH_QP1_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
79641 	/*
79642 	 * The number of 16 bytes chunks of data including this first
79643 	 * word of the request that are a valid part of the request. The
79644 	 * valid 16 bytes units other than the WQE structure can be
79645 	 * SGEs (Scatter Gather Elements) OR inline data.
79646 	 *
79647 	 * While this field defines the valid WQE size. The actual
79648 	 * total WQE size is always 128B.
79649 	 */
79650 	uint8_t	wqe_size;
79651 	uint8_t	reserved8;
79652 	/*
79653 	 * All bits in this field must be valid on the first BD of a packet.
79654 	 * Their value on other BDs of the packet will be ignored.
79655 	 */
79656 	uint16_t	lflags;
79657 	/*
79658 	 * If set to 1, the controller replaces the TCP/UPD checksum
79659 	 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
79660 	 * checksum field of the encapsulated TCP/UDP packets with the
79661 	 * hardware calculated TCP/UDP checksum for the packet associated
79662 	 * with this descriptor.
79663 	 *
79664 	 * This bit must be valid on the first BD of a packet.
79665 	 */
79666 	#define SQ_SEND_RAWETH_QP1_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
79667 	/*
79668 	 * If set to 1, the controller replaces the IP checksum of the
79669 	 * normal packets, or the inner IP checksum of the encapsulated
79670 	 * packets with the hardware calculated IP checksum for the
79671 	 * packet associated with this descriptor.
79672 	 *
79673 	 * This bit must be valid on the first BD of a packet.
79674 	 */
79675 	#define SQ_SEND_RAWETH_QP1_LFLAGS_IP_CHKSUM	UINT32_C(0x2)
79676 	/*
79677 	 * If set to 1, the controller will not append an Ethernet CRC
79678 	 * to the end of the frame.
79679 	 *
79680 	 * This bit must be valid on the first BD of a packet.
79681 	 *
79682 	 * Packet must be 64B or longer when this flag is set. It is not
79683 	 * useful to use this bit with any form of TX offload such as
79684 	 * CSO or LSO. The intent is that the packet from the host already
79685 	 * has a valid Ethernet CRC on the packet.
79686 	 */
79687 	#define SQ_SEND_RAWETH_QP1_LFLAGS_NOCRC		UINT32_C(0x4)
79688 	/*
79689 	 * If set to 1, the device will record the time at which the packet
79690 	 * was actually transmitted at the TX MAC.
79691 	 *
79692 	 * This bit must be valid on the first BD of a packet.
79693 	 */
79694 	#define SQ_SEND_RAWETH_QP1_LFLAGS_STAMP		UINT32_C(0x8)
79695 	/*
79696 	 * If set to 1, The controller replaces the tunnel IP checksum
79697 	 * field with hardware calculated IP checksum for the IP header
79698 	 * of the packet associated with this descriptor. In case of
79699 	 * VXLAN, the controller also replaces the outer header UDP
79700 	 * checksum with hardware calculated UDP checksum for the packet
79701 	 * associated with this descriptor.
79702 	 */
79703 	#define SQ_SEND_RAWETH_QP1_LFLAGS_T_IP_CHKSUM	UINT32_C(0x10)
79704 	/*
79705 	 * If set to '1', then the RoCE ICRC will be appended to the
79706 	 * packet. Packet must be a valid RoCE format packet.
79707 	 */
79708 	#define SQ_SEND_RAWETH_QP1_LFLAGS_ROCE_CRC	UINT32_C(0x100)
79709 	/*
79710 	 * If set to '1', then the FCoE CRC will be appended to the
79711 	 * packet. Packet must be a valid FCoE format packet.
79712 	 */
79713 	#define SQ_SEND_RAWETH_QP1_LFLAGS_FCOE_CRC	UINT32_C(0x200)
79714 	/*
79715 	 * This value selects a CFA action to perform on the packet.
79716 	 * Set this value to zero if no CFA action is desired.
79717 	 *
79718 	 * This value must be valid on the first BD of a packet.
79719 	 */
79720 	uint16_t	cfa_action;
79721 	/*
79722 	 * This field represents a 32-bit total data length, in bytes.
79723 	 * Note, however, that the length cannot exceed the MTU.
79724 	 */
79725 	uint32_t	length;
79726 	uint32_t	reserved32_1;
79727 	/*
79728 	 * This value is action meta-data that defines CFA edit operations
79729 	 * that are done in addition to any action editing.
79730 	 */
79731 	uint32_t	cfa_meta;
79732 	/* When key=1, This is the VLAN tag VID value. */
79733 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
79734 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_SFT	0
79735 	/* When key=1, This is the VLAN tag DE value. */
79736 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_DE	UINT32_C(0x1000)
79737 	/* When key=1, This is the VLAN tag PRI value. */
79738 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
79739 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_SFT	13
79740 	/* When key=1, This is the VLAN tag TPID select value. */
79741 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
79742 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_SFT	16
79743 	/* 0x88a8 */
79744 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID88A8  (UINT32_C(0x0) << 16)
79745 	/* 0x8100 */
79746 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID8100  (UINT32_C(0x1) << 16)
79747 	/* 0x9100 */
79748 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9100  (UINT32_C(0x2) << 16)
79749 	/* 0x9200 */
79750 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9200  (UINT32_C(0x3) << 16)
79751 	/* 0x9300 */
79752 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9300  (UINT32_C(0x4) << 16)
79753 	/* Value programmed in CFA VLANTPID register. */
79754 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG   (UINT32_C(0x5) << 16)
79755 		#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_LAST	SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG
79756 	/* When key=1, This is the VLAN tag TPID select value. */
79757 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
79758 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_SFT 19
79759 	/*
79760 	 * This field identifies the type of edit to be performed
79761 	 * on the packet.
79762 	 *
79763 	 * This value must be valid on the first BD of a packet.
79764 	 */
79765 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_MASK	UINT32_C(0xf0000000)
79766 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_SFT	28
79767 	/* No editing */
79768 		#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
79769 	/*
79770 	 * - meta[17:16] - TPID select value (0 = 0x8100).
79771 	 * - meta[15:12] - PRI/DE value.
79772 	 * - meta[11:0] - VID value.
79773 	 */
79774 		#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
79775 		#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_LAST	SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG
79776 	uint32_t	reserved32_2;
79777 	uint32_t	reserved32_3;
79778 	uint32_t	timestamp;
79779 	/*
79780 	 * This field specifies a 24-bit timestamp that can be passed
79781 	 * down the TX path and optionally logged in the TXP timestamp
79782 	 * histogram.
79783 	 */
79784 	#define SQ_SEND_RAWETH_QP1_TIMESTAMP_MASK UINT32_C(0xffffff)
79785 	#define SQ_SEND_RAWETH_QP1_TIMESTAMP_SFT 0
79786 	/*
79787 	 * When inline=0, then this area is filled with from 1 to 6
79788 	 * SGEs based on the wqe_size field.
79789 	 *
79790 	 * When inline=1, this area is filled with payload data for the
79791 	 * send based on the length_or_AVID field. Bits [7:0] of word 0
79792 	 * hold the first byte to go out on the wire.
79793 	 */
79794 	uint32_t	data[24];
79795 } sq_send_raweth_qp1_t, *psq_send_raweth_qp1_t;
79796 
79797 /* Send Raw Ethernet and QP1 SQ WQE header. */
79798 /* sq_send_raweth_qp1_hdr (size:256b/32B) */
79799 
79800 typedef struct sq_send_raweth_qp1_hdr {
79801 	/* This field defines the type of SQ WQE. */
79802 	uint8_t	wqe_type;
79803 	/* Send */
79804 	#define SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_SEND UINT32_C(0x0)
79805 	#define SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_LAST SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_SEND
79806 	uint8_t	flags;
79807 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
79808 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
79809 	/*
79810 	 * Set if completion signaling is requested. If this bit is
79811 	 * 0, and the SQ is configured to support Unsignaled completion
79812 	 * the controller should not generate a CQE unless there was
79813 	 * an error. This refers to the CQE on the sender side. (The se
79814 	 * flag refers to the receiver side).
79815 	 */
79816 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
79817 	/* This flag must be zero for a Raweth or QP1 send. */
79818 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
79819 	/* This flag must be zero for a Raweth or QP1 send. */
79820 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_UC_FENCE								UINT32_C(0x4)
79821 	/* This flag must be zero for a Raweth or QP1 send. */
79822 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_SE									UINT32_C(0x8)
79823 	/*
79824 	 * Indicate that inline data is posted to the SQ in the data
79825 	 * area of this WQE.
79826 	 */
79827 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE								UINT32_C(0x10)
79828 	/*
79829 	 * If set to 1, then the timestamp from the WQE is used. If
79830 	 * cleared to 0, then TWE provides the timestamp.
79831 	 */
79832 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_WQE_TS_EN								UINT32_C(0x20)
79833 	/*
79834 	 * When set to '1', this operation will cause a trace capture in
79835 	 * each block it passes through.
79836 	 */
79837 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
79838 	/*
79839 	 * The number of 16 bytes chunks of data including this first
79840 	 * word of the request that are a valid part of the request. The
79841 	 * valid 16 bytes units other than the WQE structure can be
79842 	 * SGEs (Scatter Gather Elements) OR inline data.
79843 	 *
79844 	 * While this field defines the valid WQE size. The actual
79845 	 * total WQE size is always 128B.
79846 	 */
79847 	uint8_t	wqe_size;
79848 	uint8_t	reserved8;
79849 	/*
79850 	 * All bits in this field must be valid on the first BD of a packet.
79851 	 * Their value on other BDs of the packet will be ignored.
79852 	 */
79853 	uint16_t	lflags;
79854 	/*
79855 	 * If set to 1, the controller replaces the TCP/UPD checksum
79856 	 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
79857 	 * checksum field of the encapsulated TCP/UDP packets with the
79858 	 * hardware calculated TCP/UDP checksum for the packet associated
79859 	 * with this descriptor.
79860 	 *
79861 	 * This bit must be valid on the first BD of a packet.
79862 	 */
79863 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
79864 	/*
79865 	 * If set to 1, the controller replaces the IP checksum of the
79866 	 * normal packets, or the inner IP checksum of the encapsulated
79867 	 * packets with the hardware calculated IP checksum for the
79868 	 * packet associated with this descriptor.
79869 	 *
79870 	 * This bit must be valid on the first BD of a packet.
79871 	 */
79872 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_IP_CHKSUM	UINT32_C(0x2)
79873 	/*
79874 	 * If set to 1, the controller will not append an Ethernet CRC
79875 	 * to the end of the frame.
79876 	 *
79877 	 * This bit must be valid on the first BD of a packet.
79878 	 *
79879 	 * Packet must be 64B or longer when this flag is set. It is not
79880 	 * useful to use this bit with any form of TX offload such as
79881 	 * CSO or LSO. The intent is that the packet from the host already
79882 	 * has a valid Ethernet CRC on the packet.
79883 	 */
79884 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_NOCRC		UINT32_C(0x4)
79885 	/*
79886 	 * If set to 1, the device will record the time at which the packet
79887 	 * was actually transmitted at the TX MAC.
79888 	 *
79889 	 * This bit must be valid on the first BD of a packet.
79890 	 */
79891 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_STAMP		UINT32_C(0x8)
79892 	/*
79893 	 * If set to 1, The controller replaces the tunnel IP checksum
79894 	 * field with hardware calculated IP checksum for the IP header
79895 	 * of the packet associated with this descriptor. In case of
79896 	 * VXLAN, the controller also replaces the outer header UDP
79897 	 * checksum with hardware calculated UDP checksum for the packet
79898 	 * associated with this descriptor.
79899 	 */
79900 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_T_IP_CHKSUM	UINT32_C(0x10)
79901 	/*
79902 	 * If set to '1', then the RoCE ICRC will be appended to the
79903 	 * packet. Packet must be a valid RoCE format packet.
79904 	 */
79905 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_ROCE_CRC	UINT32_C(0x100)
79906 	/*
79907 	 * If set to '1', then the FCoE CRC will be appended to the
79908 	 * packet. Packet must be a valid FCoE format packet.
79909 	 */
79910 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_FCOE_CRC	UINT32_C(0x200)
79911 	/*
79912 	 * This value selects a CFA action to perform on the packet.
79913 	 * Set this value to zero if no CFA action is desired.
79914 	 *
79915 	 * This value must be valid on the first BD of a packet.
79916 	 */
79917 	uint16_t	cfa_action;
79918 	/*
79919 	 * This field represents a 32-bit total data length, in bytes.
79920 	 * Note, however, that the length cannot exceed the MTU.
79921 	 */
79922 	uint32_t	length;
79923 	uint32_t	reserved32_1;
79924 	/*
79925 	 * This value is action meta-data that defines CFA edit operations
79926 	 * that are done in addition to any action editing.
79927 	 */
79928 	uint32_t	cfa_meta;
79929 	/* When key=1, This is the VLAN tag VID value. */
79930 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
79931 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_VID_SFT	0
79932 	/* When key=1, This is the VLAN tag DE value. */
79933 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_DE	UINT32_C(0x1000)
79934 	/* When key=1, This is the VLAN tag PRI value. */
79935 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
79936 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_PRI_SFT	13
79937 	/* When key=1, This is the VLAN tag TPID select value. */
79938 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
79939 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_SFT	16
79940 	/* 0x88a8 */
79941 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID88A8  (UINT32_C(0x0) << 16)
79942 	/* 0x8100 */
79943 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID8100  (UINT32_C(0x1) << 16)
79944 	/* 0x9100 */
79945 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9100  (UINT32_C(0x2) << 16)
79946 	/* 0x9200 */
79947 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9200  (UINT32_C(0x3) << 16)
79948 	/* 0x9300 */
79949 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9300  (UINT32_C(0x4) << 16)
79950 	/* Value programmed in CFA VLANTPID register. */
79951 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPIDCFG   (UINT32_C(0x5) << 16)
79952 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_LAST	SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPIDCFG
79953 	/* When key=1, This is the VLAN tag TPID select value. */
79954 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
79955 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_RESERVED_SFT 19
79956 	/*
79957 	 * This field identifies the type of edit to be performed
79958 	 * on the packet.
79959 	 *
79960 	 * This value must be valid on the first BD of a packet.
79961 	 */
79962 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_MASK	UINT32_C(0xf0000000)
79963 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_SFT	28
79964 	/* No editing */
79965 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
79966 	/*
79967 	 * - meta[17:16] - TPID select value (0 = 0x8100).
79968 	 * - meta[15:12] - PRI/DE value.
79969 	 * - meta[11:0] - VID value.
79970 	 */
79971 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
79972 		#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_LAST	SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_VLAN_TAG
79973 	uint32_t	reserved32_2;
79974 	uint32_t	reserved32_3;
79975 	uint32_t	timestamp;
79976 	/*
79977 	 * This field specifies a 24-bit timestamp that can be passed
79978 	 * down the TX path and optionally logged in the TXP timestamp
79979 	 * histogram.
79980 	 */
79981 	#define SQ_SEND_RAWETH_QP1_HDR_TIMESTAMP_MASK UINT32_C(0xffffff)
79982 	#define SQ_SEND_RAWETH_QP1_HDR_TIMESTAMP_SFT 0
79983 } sq_send_raweth_qp1_hdr_t, *psq_send_raweth_qp1_hdr_t;
79984 
79985 /* RDMA SQ WQE */
79986 /* sq_rdma (size:1024b/128B) */
79987 
79988 typedef struct sq_rdma {
79989 	/* This field defines the type of SQ WQE. */
79990 	uint8_t	wqe_type;
79991 	/*
79992 	 * RDMA Write.
79993 	 *
79994 	 * Allowed only on reliable connection (RC) SQs.
79995 	 */
79996 	#define SQ_RDMA_WQE_TYPE_WRITE_WQE	UINT32_C(0x4)
79997 	/*
79998 	 * RDMA Write with Immediate.
79999 	 *
80000 	 * Allowed only on reliable connection (RC) SQs.
80001 	 */
80002 	#define SQ_RDMA_WQE_TYPE_WRITE_W_IMMEAD UINT32_C(0x5)
80003 	/*
80004 	 * RDMA Read.
80005 	 *
80006 	 * Allowed only on reliable connection (RC) SQs.
80007 	 */
80008 	#define SQ_RDMA_WQE_TYPE_READ_WQE	UINT32_C(0x6)
80009 	#define SQ_RDMA_WQE_TYPE_LAST	SQ_RDMA_WQE_TYPE_READ_WQE
80010 	uint8_t	flags;
80011 	#define SQ_RDMA_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
80012 	#define SQ_RDMA_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
80013 	/*
80014 	 * Set if completion signaling is requested. If this bit is
80015 	 * 0, and the SQ is configured to support Unsignaled
80016 	 * completion the controller should not generate a CQE
80017 	 * unless there was an error. This refers to CQE on the
80018 	 * sender side (se_flag refers to the receiver side)
80019 	 */
80020 	#define SQ_RDMA_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
80021 	/*
80022 	 * Indication to complete all previous RDMA Read or Atomic
80023 	 * WQEs on the SQ before executing this WQE
80024 	 */
80025 	#define SQ_RDMA_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
80026 	/*
80027 	 * Unconditional fence. Indication to complete all previous
80028 	 * SQ's WQEs before executing this WQE.
80029 	 */
80030 	#define SQ_RDMA_FLAGS_UC_FENCE								UINT32_C(0x4)
80031 	/*
80032 	 * Solicit event. Indication sent in BTH header to the
80033 	 * receiver to generate a Completion Event Notification,
80034 	 * i.e. CNQE. This bit should be set only in the last (or
80035 	 * only) packet of the message.
80036 	 */
80037 	#define SQ_RDMA_FLAGS_SE									UINT32_C(0x8)
80038 	/*
80039 	 * Indicate that inline data is posted to the SQ following
80040 	 * this WQE. This bit may be 1 only for write operations.
80041 	 */
80042 	#define SQ_RDMA_FLAGS_INLINE								UINT32_C(0x10)
80043 	/*
80044 	 * If set to 1, then the timestamp from the WQE is used. If
80045 	 * cleared to 0, then TWE provides the timestamp.
80046 	 */
80047 	#define SQ_RDMA_FLAGS_WQE_TS_EN								UINT32_C(0x20)
80048 	/*
80049 	 * When set to '1', this operation will cause a trace capture in
80050 	 * each block it passes through.
80051 	 */
80052 	#define SQ_RDMA_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
80053 	/*
80054 	 * The number of 16 bytes chunks of data including this first
80055 	 * wqe of the request that are a valid part of the request. The
80056 	 * valid 16 bytes units other than the WQE structure can be
80057 	 * SGEs (Scatter Gather Elements) OR inline data.
80058 	 *
80059 	 * While this field defines the valid WQE size. The actual
80060 	 * total WQE size is always 128B.
80061 	 */
80062 	uint8_t	wqe_size;
80063 	uint8_t	reserved8;
80064 	/*
80065 	 * Immediate data - valid for RDMA Write with immediate and
80066 	 * causes the controller to add immDt header with this value
80067 	 */
80068 	uint32_t	imm_data;
80069 	/* Total data length in bytes */
80070 	uint32_t	length;
80071 	uint32_t	reserved32_1;
80072 	/* Remote VA sent to the destination QP */
80073 	uint64_t	remote_va;
80074 	/*
80075 	 * R_Key provided by remote node when the connection was
80076 	 * established and placed in the RETH header. It identify the
80077 	 * MRW on the remote host
80078 	 */
80079 	uint32_t	remote_key;
80080 	uint32_t	timestamp;
80081 	/*
80082 	 * This field specifies a 24-bit timestamp that can be passed
80083 	 * down the TX path and optionally logged in the TXP timestamp
80084 	 * histogram.
80085 	 */
80086 	#define SQ_RDMA_TIMESTAMP_MASK UINT32_C(0xffffff)
80087 	#define SQ_RDMA_TIMESTAMP_SFT 0
80088 	/*
80089 	 * When inline=0, then this area is filled with from 1 to 6
80090 	 * SGEs based on the wqe_size field.
80091 	 *
80092 	 * When inline=1, this area is filled with payload data for the
80093 	 * write based on the length field. Bits [7:0] of word 0
80094 	 * hold the first byte to go out on the wire.
80095 	 */
80096 	uint32_t	data[24];
80097 } sq_rdma_t, *psq_rdma_t;
80098 
80099 /* RDMA SQ WQE header. */
80100 /* sq_rdma_hdr (size:256b/32B) */
80101 
80102 typedef struct sq_rdma_hdr {
80103 	/* This field defines the type of SQ WQE. */
80104 	uint8_t	wqe_type;
80105 	/*
80106 	 * RDMA Write.
80107 	 *
80108 	 * Allowed only on reliable connection (RC) SQs.
80109 	 */
80110 	#define SQ_RDMA_HDR_WQE_TYPE_WRITE_WQE	UINT32_C(0x4)
80111 	/*
80112 	 * RDMA Write with Immediate.
80113 	 *
80114 	 * Allowed only on reliable connection (RC) SQs.
80115 	 */
80116 	#define SQ_RDMA_HDR_WQE_TYPE_WRITE_W_IMMEAD UINT32_C(0x5)
80117 	/*
80118 	 * RDMA Read.
80119 	 *
80120 	 * Allowed only on reliable connection (RC) SQs.
80121 	 */
80122 	#define SQ_RDMA_HDR_WQE_TYPE_READ_WQE	UINT32_C(0x6)
80123 	#define SQ_RDMA_HDR_WQE_TYPE_LAST	SQ_RDMA_HDR_WQE_TYPE_READ_WQE
80124 	uint8_t	flags;
80125 	#define SQ_RDMA_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
80126 	#define SQ_RDMA_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
80127 	/*
80128 	 * Set if completion signaling is requested. If this bit is
80129 	 * 0, and the SQ is configured to support Unsignaled
80130 	 * completion the controller should not generate a CQE
80131 	 * unless there was an error. This refers to CQE on the
80132 	 * sender side (se_flag refers to the receiver side)
80133 	 */
80134 	#define SQ_RDMA_HDR_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
80135 	/*
80136 	 * Indication to complete all previous RDMA Read or Atomic
80137 	 * WQEs on the SQ before executing this WQE
80138 	 */
80139 	#define SQ_RDMA_HDR_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
80140 	/*
80141 	 * Unconditional fence. Indication to complete all previous
80142 	 * SQ's WQEs before executing this WQE.
80143 	 */
80144 	#define SQ_RDMA_HDR_FLAGS_UC_FENCE								UINT32_C(0x4)
80145 	/*
80146 	 * Solicit event. Indication sent in BTH header to the
80147 	 * receiver to generate a Completion Event Notification,
80148 	 * i.e. CNQE. This bit should be set only in the last (or
80149 	 * only) packet of the message.
80150 	 */
80151 	#define SQ_RDMA_HDR_FLAGS_SE									UINT32_C(0x8)
80152 	/*
80153 	 * Indicate that inline data is posted to the SQ following
80154 	 * this WQE. This bit may be 1 only for write operations.
80155 	 */
80156 	#define SQ_RDMA_HDR_FLAGS_INLINE								UINT32_C(0x10)
80157 	/*
80158 	 * If set to 1, then the timestamp from the WQE is used. If
80159 	 * cleared to 0, then TWE provides the timestamp.
80160 	 */
80161 	#define SQ_RDMA_HDR_FLAGS_WQE_TS_EN								UINT32_C(0x20)
80162 	/*
80163 	 * When set to '1', this operation will cause a trace capture in
80164 	 * each block it passes through.
80165 	 */
80166 	#define SQ_RDMA_HDR_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
80167 	/*
80168 	 * The number of 16 bytes chunks of data including this first
80169 	 * wqe of the request that are a valid part of the request. The
80170 	 * valid 16 bytes units other than the WQE structure can be
80171 	 * SGEs (Scatter Gather Elements) OR inline data.
80172 	 *
80173 	 * While this field defines the valid WQE size. The actual
80174 	 * total WQE size is always 128B.
80175 	 */
80176 	uint8_t	wqe_size;
80177 	uint8_t	reserved8;
80178 	/*
80179 	 * Immediate data - valid for RDMA Write with immediate and
80180 	 * causes the controller to add immDt header with this value
80181 	 */
80182 	uint32_t	imm_data;
80183 	/* Total data length in bytes */
80184 	uint32_t	length;
80185 	uint32_t	reserved32_1;
80186 	/* Remote VA sent to the destination QP */
80187 	uint64_t	remote_va;
80188 	/*
80189 	 * R_Key provided by remote node when the connection was
80190 	 * established and placed in the RETH header. It identify the
80191 	 * MRW on the remote host
80192 	 */
80193 	uint32_t	remote_key;
80194 	uint32_t	timestamp;
80195 	/*
80196 	 * This field specifies a 24-bit timestamp that can be passed
80197 	 * down the TX path and optionally logged in the TXP timestamp
80198 	 * histogram.
80199 	 */
80200 	#define SQ_RDMA_HDR_TIMESTAMP_MASK UINT32_C(0xffffff)
80201 	#define SQ_RDMA_HDR_TIMESTAMP_SFT 0
80202 } sq_rdma_hdr_t, *psq_rdma_hdr_t;
80203 
80204 /* Atomic SQ WQE */
80205 /* sq_atomic (size:1024b/128B) */
80206 
80207 typedef struct sq_atomic {
80208 	/* This field defines the type of SQ WQE. */
80209 	uint8_t	wqe_type;
80210 	/*
80211 	 * Atomic Compare/Swap.
80212 	 *
80213 	 * Allowed only on reliable connection (RC) SQs.
80214 	 */
80215 	#define SQ_ATOMIC_WQE_TYPE_ATOMIC_CS UINT32_C(0x8)
80216 	/*
80217 	 * Atomic Fetch/Add.
80218 	 *
80219 	 * Allowed only on reliable connection (RC) SQs.
80220 	 */
80221 	#define SQ_ATOMIC_WQE_TYPE_ATOMIC_FA UINT32_C(0xb)
80222 	#define SQ_ATOMIC_WQE_TYPE_LAST	SQ_ATOMIC_WQE_TYPE_ATOMIC_FA
80223 	uint8_t	flags;
80224 	#define SQ_ATOMIC_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
80225 	#define SQ_ATOMIC_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
80226 	/*
80227 	 * Set if completion signaling is requested. If this bit is
80228 	 * 0, and the SQ is configured to support Unsignaled
80229 	 * completion the controller should not generate a CQE
80230 	 * unless there was an error. This refers to CQE on the
80231 	 * sender side (se_flag refers to the receiver side)
80232 	 */
80233 	#define SQ_ATOMIC_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
80234 	/*
80235 	 * Indication to complete all previous RDMA Read or Atomic
80236 	 * WQEs on the SQ before executing this WQE
80237 	 */
80238 	#define SQ_ATOMIC_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
80239 	/*
80240 	 * Unconditional fence. Indication to complete all previous
80241 	 * SQ's WQEs before executing this WQE.
80242 	 */
80243 	#define SQ_ATOMIC_FLAGS_UC_FENCE								UINT32_C(0x4)
80244 	/*
80245 	 * Solicit event. Indication sent in BTH header to the
80246 	 * receiver to generate a Completion Event Notification,
80247 	 * i.e. CNQE. This bit should be set only in the last (or
80248 	 * only) packet of the message.
80249 	 */
80250 	#define SQ_ATOMIC_FLAGS_SE									UINT32_C(0x8)
80251 	/* NA for this WQE */
80252 	#define SQ_ATOMIC_FLAGS_INLINE								UINT32_C(0x10)
80253 	/*
80254 	 * The atomic WQE does not have a timestamp field, so this field is
80255 	 * ignored and should be zero.
80256 	 */
80257 	#define SQ_ATOMIC_FLAGS_WQE_TS_EN								UINT32_C(0x20)
80258 	/*
80259 	 * When set to '1', this operation will cause a trace capture in
80260 	 * each block it passes through.
80261 	 */
80262 	#define SQ_ATOMIC_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
80263 	uint16_t	reserved16;
80264 	/*
80265 	 * R_Key provided by remote node when the connection was
80266 	 * established and placed in the AETH header. It identify the
80267 	 * MRW on the remote host
80268 	 */
80269 	uint32_t	remote_key;
80270 	/* Remote VA sent to the destination QP */
80271 	uint64_t	remote_va;
80272 	/* Data value to be placed in remote host specified address */
80273 	uint64_t	swap_data;
80274 	/*
80275 	 * Data value to be compared with the value in the remote host
80276 	 * specified address
80277 	 */
80278 	uint64_t	cmp_data;
80279 	/*
80280 	 * The first 16B of the data field must be filled with a single
80281 	 * SGE. This will be used to store the return value from the
80282 	 * Atomic Ack response. The size of the single SGE must be 8B.
80283 	 */
80284 	uint32_t	data[24];
80285 } sq_atomic_t, *psq_atomic_t;
80286 
80287 /* Atomic SQ WQE header. */
80288 /* sq_atomic_hdr (size:256b/32B) */
80289 
80290 typedef struct sq_atomic_hdr {
80291 	/* This field defines the type of SQ WQE. */
80292 	uint8_t	wqe_type;
80293 	/*
80294 	 * Atomic Compare/Swap.
80295 	 *
80296 	 * Allowed only on reliable connection (RC) SQs.
80297 	 */
80298 	#define SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_CS UINT32_C(0x8)
80299 	/*
80300 	 * Atomic Fetch/Add.
80301 	 *
80302 	 * Allowed only on reliable connection (RC) SQs.
80303 	 */
80304 	#define SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_FA UINT32_C(0xb)
80305 	#define SQ_ATOMIC_HDR_WQE_TYPE_LAST	SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_FA
80306 	uint8_t	flags;
80307 	#define SQ_ATOMIC_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
80308 	#define SQ_ATOMIC_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
80309 	/*
80310 	 * Set if completion signaling is requested. If this bit is
80311 	 * 0, and the SQ is configured to support Unsignaled
80312 	 * completion the controller should not generate a CQE
80313 	 * unless there was an error. This refers to CQE on the
80314 	 * sender side (se_flag refers to the receiver side)
80315 	 */
80316 	#define SQ_ATOMIC_HDR_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
80317 	/*
80318 	 * Indication to complete all previous RDMA Read or Atomic
80319 	 * WQEs on the SQ before executing this WQE
80320 	 */
80321 	#define SQ_ATOMIC_HDR_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
80322 	/*
80323 	 * Unconditional fence. Indication to complete all previous
80324 	 * SQ's WQEs before executing this WQE.
80325 	 */
80326 	#define SQ_ATOMIC_HDR_FLAGS_UC_FENCE								UINT32_C(0x4)
80327 	/*
80328 	 * Solicit event. Indication sent in BTH header to the
80329 	 * receiver to generate a Completion Event Notification,
80330 	 * i.e. CNQE. This bit should be set only in the last (or
80331 	 * only) packet of the message.
80332 	 */
80333 	#define SQ_ATOMIC_HDR_FLAGS_SE									UINT32_C(0x8)
80334 	/* NA for this WQE */
80335 	#define SQ_ATOMIC_HDR_FLAGS_INLINE								UINT32_C(0x10)
80336 	/*
80337 	 * The atomic WQE does not have a timestamp field, so this field is
80338 	 * ignored and should be zero.
80339 	 */
80340 	#define SQ_ATOMIC_HDR_FLAGS_WQE_TS_EN								UINT32_C(0x20)
80341 	/*
80342 	 * When set to '1', this operation will cause a trace capture in
80343 	 * each block it passes through.
80344 	 */
80345 	#define SQ_ATOMIC_HDR_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
80346 	uint16_t	reserved16;
80347 	/*
80348 	 * R_Key provided by remote node when the connection was
80349 	 * established and placed in the AETH header. It identify the
80350 	 * MRW on the remote host
80351 	 */
80352 	uint32_t	remote_key;
80353 	/* Remote VA sent to the destination QP */
80354 	uint64_t	remote_va;
80355 	/* Data value to be placed in remote host specified address */
80356 	uint64_t	swap_data;
80357 	/*
80358 	 * Data value to be compared with the value in the remote host
80359 	 * specified address
80360 	 */
80361 	uint64_t	cmp_data;
80362 } sq_atomic_hdr_t, *psq_atomic_hdr_t;
80363 
80364 /* Local Invalidate SQ WQE */
80365 /* sq_localinvalidate (size:1024b/128B) */
80366 
80367 typedef struct sq_localinvalidate {
80368 	/* This field defines the type of SQ WQE. */
80369 	uint8_t	wqe_type;
80370 	/*
80371 	 * Local Invalidate.
80372 	 *
80373 	 * Allowed only on reliable connection (RC) SQs.
80374 	 */
80375 	#define SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID UINT32_C(0xc)
80376 	#define SQ_LOCALINVALIDATE_WQE_TYPE_LAST	SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID
80377 	uint8_t	flags;
80378 	#define SQ_LOCALINVALIDATE_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
80379 	#define SQ_LOCALINVALIDATE_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
80380 	/*
80381 	 * Set if completion signaling is requested. If this bit is
80382 	 * 0, and the SQ is configured to support Unsignaled
80383 	 * completion the controller should not generate a CQE
80384 	 * unless there was an error. This refers to CQE on the
80385 	 * sender side (se_flag refers to the receiver side)
80386 	 */
80387 	#define SQ_LOCALINVALIDATE_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
80388 	/*
80389 	 * Indication to complete all previous RDMA Read or Atomic
80390 	 * WQEs on the SQ before executing this WQE
80391 	 */
80392 	#define SQ_LOCALINVALIDATE_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
80393 	/*
80394 	 * Unconditional fence. Indication to complete all previous
80395 	 * SQ's WQEs before executing this WQE.
80396 	 */
80397 	#define SQ_LOCALINVALIDATE_FLAGS_UC_FENCE								UINT32_C(0x4)
80398 	/*
80399 	 * Solicit event. Indication sent in BTH header to the
80400 	 * receiver to generate a Completion Event Notification,
80401 	 * i.e. CNQE. This bit should be set only in the last (or
80402 	 * only) packet of the message.
80403 	 */
80404 	#define SQ_LOCALINVALIDATE_FLAGS_SE									UINT32_C(0x8)
80405 	/* NA for this WQE */
80406 	#define SQ_LOCALINVALIDATE_FLAGS_INLINE								UINT32_C(0x10)
80407 	/*
80408 	 * This flag is not applicable and should be 0 for a local memory
80409 	 * operation WQE.
80410 	 */
80411 	#define SQ_LOCALINVALIDATE_FLAGS_WQE_TS_EN								UINT32_C(0x20)
80412 	/*
80413 	 * When set to '1', this operation will cause a trace capture in
80414 	 * each block it passes through.
80415 	 */
80416 	#define SQ_LOCALINVALIDATE_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
80417 	uint16_t	reserved16;
80418 	/*
80419 	 * The local key for the MR/W to invalidate; 24 msb of the key
80420 	 * are used to index the MRW table, 8 lsb are compared with the
80421 	 * 8 bit key in the MRWC
80422 	 */
80423 	uint32_t	inv_l_key;
80424 	uint64_t	reserved64;
80425 	uint8_t	reserved128[16];
80426 	/* The data field for local invalidate is not used. */
80427 	uint32_t	data[24];
80428 } sq_localinvalidate_t, *psq_localinvalidate_t;
80429 
80430 /* Local Invalidate SQ WQE header. */
80431 /* sq_localinvalidate_hdr (size:256b/32B) */
80432 
80433 typedef struct sq_localinvalidate_hdr {
80434 	/* This field defines the type of SQ WQE. */
80435 	uint8_t	wqe_type;
80436 	/*
80437 	 * Local Invalidate.
80438 	 *
80439 	 * Allowed only on reliable connection (RC) SQs.
80440 	 */
80441 	#define SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LOCAL_INVALID UINT32_C(0xc)
80442 	#define SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LAST	SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LOCAL_INVALID
80443 	uint8_t	flags;
80444 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
80445 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
80446 	/*
80447 	 * Set if completion signaling is requested. If this bit is
80448 	 * 0, and the SQ is configured to support Unsignaled
80449 	 * completion the controller should not generate a CQE
80450 	 * unless there was an error. This refers to CQE on the
80451 	 * sender side (se_flag refers to the receiver side)
80452 	 */
80453 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
80454 	/*
80455 	 * Indication to complete all previous RDMA Read or Atomic
80456 	 * WQEs on the SQ before executing this WQE
80457 	 */
80458 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
80459 	/*
80460 	 * Unconditional fence. Indication to complete all previous
80461 	 * SQ's WQEs before executing this WQE.
80462 	 */
80463 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_UC_FENCE								UINT32_C(0x4)
80464 	/*
80465 	 * Solicit event. Indication sent in BTH header to the
80466 	 * receiver to generate a Completion Event Notification,
80467 	 * i.e. CNQE. This bit should be set only in the last (or
80468 	 * only) packet of the message.
80469 	 */
80470 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_SE									UINT32_C(0x8)
80471 	/* NA for this WQE */
80472 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE								UINT32_C(0x10)
80473 	/*
80474 	 * This flag is not applicable and should be 0 for a local memory
80475 	 * operation WQE.
80476 	 */
80477 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_WQE_TS_EN								UINT32_C(0x20)
80478 	/*
80479 	 * When set to '1', this operation will cause a trace capture in
80480 	 * each block it passes through.
80481 	 */
80482 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
80483 	uint16_t	reserved16;
80484 	/*
80485 	 * The local key for the MR/W to invalidate; 24 msb of the key
80486 	 * are used to index the MRW table, 8 lsb are compared with the
80487 	 * 8 bit key in the MRWC
80488 	 */
80489 	uint32_t	inv_l_key;
80490 	uint64_t	reserved64;
80491 	uint8_t	reserved128[16];
80492 } sq_localinvalidate_hdr_t, *psq_localinvalidate_hdr_t;
80493 
80494 /* FR-PMR SQ WQE */
80495 /* sq_fr_pmr (size:1024b/128B) */
80496 
80497 typedef struct sq_fr_pmr {
80498 	/* This field defines the type of SQ WQE. */
80499 	uint8_t	wqe_type;
80500 	/*
80501 	 * FR-PMR (Fast Register Physical Memory Region)
80502 	 *
80503 	 * Allowed only on reliable connection (RC) SQs.
80504 	 */
80505 	#define SQ_FR_PMR_WQE_TYPE_FR_PMR UINT32_C(0xd)
80506 	#define SQ_FR_PMR_WQE_TYPE_LAST  SQ_FR_PMR_WQE_TYPE_FR_PMR
80507 	uint8_t	flags;
80508 	/*
80509 	 * Set if completion signaling is requested. If this bit is
80510 	 * 0, and the SQ is configured to support Unsignaled
80511 	 * completion the controller should not generate a CQE
80512 	 * unless there was an error. This refers to CQE on the
80513 	 * sender side (se_flag refers to the receiver side)
80514 	 */
80515 	#define SQ_FR_PMR_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
80516 	/*
80517 	 * Indication to complete all previous RDMA Read or Atomic
80518 	 * WQEs on the SQ before executing this WQE
80519 	 */
80520 	#define SQ_FR_PMR_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
80521 	/*
80522 	 * Unconditional fence. Indication to complete all previous
80523 	 * SQ's WQEs before executing this WQE.
80524 	 */
80525 	#define SQ_FR_PMR_FLAGS_UC_FENCE		UINT32_C(0x4)
80526 	/* Not Applicable for FR_PMR. Nothing is sent */
80527 	#define SQ_FR_PMR_FLAGS_SE			UINT32_C(0x8)
80528 	/* NA */
80529 	#define SQ_FR_PMR_FLAGS_INLINE		UINT32_C(0x10)
80530 	/*
80531 	 * This flag is not applicable and should be 0 for a local memory
80532 	 * operation WQE.
80533 	 */
80534 	#define SQ_FR_PMR_FLAGS_WQE_TS_EN		UINT32_C(0x20)
80535 	/*
80536 	 * When set to '1', this operation will cause a trace capture in
80537 	 * each block it passes through.
80538 	 */
80539 	#define SQ_FR_PMR_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
80540 	/*
80541 	 * This is the new access control for the MR. '1' means
80542 	 * the operation is allowed. '0' means operation is
80543 	 * not allowed.
80544 	 */
80545 	uint8_t	access_cntl;
80546 	/* Local Write Access */
80547 	#define SQ_FR_PMR_ACCESS_CNTL_LOCAL_WRITE	UINT32_C(0x1)
80548 	/* Remote Read Access */
80549 	#define SQ_FR_PMR_ACCESS_CNTL_REMOTE_READ	UINT32_C(0x2)
80550 	/* Remote Write Access */
80551 	#define SQ_FR_PMR_ACCESS_CNTL_REMOTE_WRITE	UINT32_C(0x4)
80552 	/* Remote Atomic Access */
80553 	#define SQ_FR_PMR_ACCESS_CNTL_REMOTE_ATOMIC	UINT32_C(0x8)
80554 	/* Window Binding Allowed */
80555 	#define SQ_FR_PMR_ACCESS_CNTL_WINDOW_BIND	UINT32_C(0x10)
80556 	uint8_t	zero_based_page_size_log;
80557 	/* Page size. 0 for 4KB page size, ... to 8TB. */
80558 	#define SQ_FR_PMR_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
80559 	#define SQ_FR_PMR_PAGE_SIZE_LOG_SFT	0
80560 	/* Page size is 4KB. */
80561 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
80562 	/* Page size is 8KB. */
80563 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
80564 	/* Page size is 16KB. */
80565 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
80566 	/* Page size is 32KB. */
80567 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
80568 	/* Page size is 64KB. */
80569 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
80570 	/* Page size is 128KB. */
80571 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
80572 	/* Page size is 256KB. */
80573 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
80574 	/* Page size is 512KB. */
80575 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
80576 	/* Page size is 1MB. */
80577 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
80578 	/* Page size is 2MB. */
80579 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
80580 	/* Page size is 4MB. */
80581 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
80582 	/* Page size is 8MB. */
80583 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
80584 	/* Page size is 16MB. */
80585 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
80586 	/* Page size is 32MB. */
80587 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
80588 	/* Page size is 64MB. */
80589 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
80590 	/* Page size is 128MB. */
80591 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
80592 	/* Page size is 256MB. */
80593 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
80594 	/* Page size is 512MB. */
80595 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
80596 	/* Page size is 1GB. */
80597 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
80598 	/* Page size is 2GB. */
80599 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
80600 	/* Page size is 4GB. */
80601 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
80602 	/* Page size is 8GB. */
80603 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
80604 	/* Page size is 16GB. */
80605 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
80606 	/* Page size is 32GB. */
80607 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
80608 	/* Page size is 64GB. */
80609 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
80610 	/* Page size is 128GB. */
80611 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
80612 	/* Page size is 256GB. */
80613 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
80614 	/* Page size is 512GB. */
80615 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
80616 	/* Page size is 1TB. */
80617 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
80618 	/* Page size is 2TB. */
80619 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
80620 	/* Page size is 4TB. */
80621 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
80622 	/* Page size is 8TB. */
80623 		#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
80624 		#define SQ_FR_PMR_PAGE_SIZE_LOG_LAST	SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8T
80625 	/* Indicate the MR is ZBVA (Zero Base VA) */
80626 	#define SQ_FR_PMR_ZERO_BASED		UINT32_C(0x20)
80627 	/*
80628 	 * Local Key; 24 msb of the key are used to index the MRW
80629 	 * table, 8 lsb are assigned to the 8 bit key_lsb field in
80630 	 * the MRWC.
80631 	 */
80632 	uint32_t	l_key;
80633 	/* Length in bytes of registered MR */
80634 	uint8_t	length[5];
80635 	uint8_t	reserved8_1;
80636 	uint8_t	reserved8_2;
80637 	uint8_t	numlevels_pbl_page_size_log;
80638 	/* PBL page size. 0 for 4KB page size, ... to 8TB. */
80639 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
80640 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_SFT	0
80641 	/* Page size is 4KB. */
80642 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
80643 	/* Page size is 8KB. */
80644 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
80645 	/* Page size is 16KB. */
80646 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
80647 	/* Page size is 32KB. */
80648 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
80649 	/* Page size is 64KB. */
80650 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
80651 	/* Page size is 128KB. */
80652 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
80653 	/* Page size is 256KB. */
80654 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
80655 	/* Page size is 512KB. */
80656 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
80657 	/* Page size is 1MB. */
80658 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
80659 	/* Page size is 2MB. */
80660 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
80661 	/* Page size is 4MB. */
80662 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
80663 	/* Page size is 8MB. */
80664 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
80665 	/* Page size is 16MB. */
80666 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
80667 	/* Page size is 32MB. */
80668 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
80669 	/* Page size is 64MB. */
80670 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
80671 	/* Page size is 128MB. */
80672 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
80673 	/* Page size is 256MB. */
80674 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
80675 	/* Page size is 512MB. */
80676 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
80677 	/* Page size is 1GB. */
80678 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
80679 	/* Page size is 2GB. */
80680 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
80681 	/* Page size is 4GB. */
80682 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
80683 	/* Page size is 8GB. */
80684 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
80685 	/* Page size is 16GB. */
80686 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
80687 	/* Page size is 32GB. */
80688 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
80689 	/* Page size is 64GB. */
80690 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
80691 	/* Page size is 128GB. */
80692 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
80693 	/* Page size is 256GB. */
80694 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
80695 	/* Page size is 512GB. */
80696 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
80697 	/* Page size is 1TB. */
80698 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
80699 	/* Page size is 2TB. */
80700 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
80701 	/* Page size is 4TB. */
80702 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
80703 	/* Page size is 8TB. */
80704 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
80705 		#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_LAST	SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8T
80706 	/* Number of levels of PBL for translation */
80707 	#define SQ_FR_PMR_NUMLEVELS_MASK		UINT32_C(0xc0)
80708 	#define SQ_FR_PMR_NUMLEVELS_SFT		6
80709 	/*
80710 	 * A zero level PBL means that the VA is the physical address used
80711 	 * for the operation. No translation is done by the PTU.
80712 	 */
80713 		#define SQ_FR_PMR_NUMLEVELS_PHYSICAL	(UINT32_C(0x0) << 6)
80714 	/*
80715 	 * A one layer translation is provided between the logical and
80716 	 * physical address. The PBL points to a physical page that
80717 	 * contains PBE values that point to actual pg_size physical pages.
80718 	 */
80719 		#define SQ_FR_PMR_NUMLEVELS_LAYER1		(UINT32_C(0x1) << 6)
80720 	/*
80721 	 * A two layer translation is provided between the logical and
80722 	 * physical address. The PBL points to a physical page that
80723 	 * contains PDE values that in turn point to pbl_pg_size physical
80724 	 * pages that contain PBE values that point to actual physical
80725 	 * pages.
80726 	 */
80727 		#define SQ_FR_PMR_NUMLEVELS_LAYER2		(UINT32_C(0x2) << 6)
80728 		#define SQ_FR_PMR_NUMLEVELS_LAST		SQ_FR_PMR_NUMLEVELS_LAYER2
80729 	/* Pointer to the PBL, or PDL depending on number of levels */
80730 	uint64_t	pblptr;
80731 	/* Local Virtual Address */
80732 	uint64_t	va;
80733 	/* The data field for FR-PMR is not used. */
80734 	uint32_t	data[24];
80735 } sq_fr_pmr_t, *psq_fr_pmr_t;
80736 
80737 /* FR-PMR SQ WQE header. */
80738 /* sq_fr_pmr_hdr (size:256b/32B) */
80739 
80740 typedef struct sq_fr_pmr_hdr {
80741 	/* This field defines the type of SQ WQE. */
80742 	uint8_t	wqe_type;
80743 	/*
80744 	 * FR-PMR (Fast Register Physical Memory Region)
80745 	 *
80746 	 * Allowed only on reliable connection (RC) SQs.
80747 	 */
80748 	#define SQ_FR_PMR_HDR_WQE_TYPE_FR_PMR UINT32_C(0xd)
80749 	#define SQ_FR_PMR_HDR_WQE_TYPE_LAST  SQ_FR_PMR_HDR_WQE_TYPE_FR_PMR
80750 	uint8_t	flags;
80751 	/*
80752 	 * Set if completion signaling is requested. If this bit is
80753 	 * 0, and the SQ is configured to support Unsignaled
80754 	 * completion the controller should not generate a CQE
80755 	 * unless there was an error. This refers to CQE on the
80756 	 * sender side (se_flag refers to the receiver side)
80757 	 */
80758 	#define SQ_FR_PMR_HDR_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
80759 	/*
80760 	 * Indication to complete all previous RDMA Read or Atomic
80761 	 * WQEs on the SQ before executing this WQE
80762 	 */
80763 	#define SQ_FR_PMR_HDR_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
80764 	/*
80765 	 * Unconditional fence. Indication to complete all previous
80766 	 * SQ's WQEs before executing this WQE.
80767 	 */
80768 	#define SQ_FR_PMR_HDR_FLAGS_UC_FENCE		UINT32_C(0x4)
80769 	/* Not Applicable for FR_PMR. Nothing is sent */
80770 	#define SQ_FR_PMR_HDR_FLAGS_SE			UINT32_C(0x8)
80771 	/* NA */
80772 	#define SQ_FR_PMR_HDR_FLAGS_INLINE		UINT32_C(0x10)
80773 	/*
80774 	 * This flag is not applicable and should be 0 for a local memory
80775 	 * operation WQE.
80776 	 */
80777 	#define SQ_FR_PMR_HDR_FLAGS_WQE_TS_EN		UINT32_C(0x20)
80778 	/*
80779 	 * When set to '1', this operation will cause a trace capture in
80780 	 * each block it passes through.
80781 	 */
80782 	#define SQ_FR_PMR_HDR_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
80783 	/*
80784 	 * This is the new access control for the MR. '1' means
80785 	 * the operation is allowed. '0' means operation is
80786 	 * not allowed.
80787 	 */
80788 	uint8_t	access_cntl;
80789 	/* Local Write Access */
80790 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_LOCAL_WRITE	UINT32_C(0x1)
80791 	/* Remote Read Access */
80792 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_READ	UINT32_C(0x2)
80793 	/* Remote Write Access */
80794 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_WRITE	UINT32_C(0x4)
80795 	/* Remote Atomic Access */
80796 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_ATOMIC	UINT32_C(0x8)
80797 	/* Window Binding Allowed */
80798 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_WINDOW_BIND	UINT32_C(0x10)
80799 	uint8_t	zero_based_page_size_log;
80800 	/* Page size. 0 for 4KB page size, ... to 8TB. */
80801 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
80802 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_SFT	0
80803 	/* Page size is 4KB. */
80804 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
80805 	/* Page size is 8KB. */
80806 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
80807 	/* Page size is 16KB. */
80808 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
80809 	/* Page size is 32KB. */
80810 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
80811 	/* Page size is 64KB. */
80812 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
80813 	/* Page size is 128KB. */
80814 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
80815 	/* Page size is 256KB. */
80816 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
80817 	/* Page size is 512KB. */
80818 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
80819 	/* Page size is 1MB. */
80820 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
80821 	/* Page size is 2MB. */
80822 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
80823 	/* Page size is 4MB. */
80824 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
80825 	/* Page size is 8MB. */
80826 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
80827 	/* Page size is 16MB. */
80828 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
80829 	/* Page size is 32MB. */
80830 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
80831 	/* Page size is 64MB. */
80832 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
80833 	/* Page size is 128MB. */
80834 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
80835 	/* Page size is 256MB. */
80836 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
80837 	/* Page size is 512MB. */
80838 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
80839 	/* Page size is 1GB. */
80840 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
80841 	/* Page size is 2GB. */
80842 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
80843 	/* Page size is 4GB. */
80844 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
80845 	/* Page size is 8GB. */
80846 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
80847 	/* Page size is 16GB. */
80848 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
80849 	/* Page size is 32GB. */
80850 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
80851 	/* Page size is 64GB. */
80852 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
80853 	/* Page size is 128GB. */
80854 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
80855 	/* Page size is 256GB. */
80856 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
80857 	/* Page size is 512GB. */
80858 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
80859 	/* Page size is 1TB. */
80860 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
80861 	/* Page size is 2TB. */
80862 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
80863 	/* Page size is 4TB. */
80864 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
80865 	/* Page size is 8TB. */
80866 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
80867 		#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_LAST	SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8T
80868 	/* Indicate the MR is ZBVA (Zero Base VA) */
80869 	#define SQ_FR_PMR_HDR_ZERO_BASED		UINT32_C(0x20)
80870 	/*
80871 	 * Local Key; 24 msb of the key are used to index the MRW
80872 	 * table, 8 lsb are assigned to the 8 bit key_lsb field in
80873 	 * the MRWC.
80874 	 */
80875 	uint32_t	l_key;
80876 	/* Length in bytes of registered MR */
80877 	uint8_t	length[5];
80878 	uint8_t	reserved8_1;
80879 	uint8_t	reserved8_2;
80880 	uint8_t	numlevels_pbl_page_size_log;
80881 	/* PBL page size. 0 for 4KB page size, ... to 8TB. */
80882 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
80883 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_SFT	0
80884 	/* Page size is 4KB. */
80885 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
80886 	/* Page size is 8KB. */
80887 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
80888 	/* Page size is 16KB. */
80889 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
80890 	/* Page size is 32KB. */
80891 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
80892 	/* Page size is 64KB. */
80893 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
80894 	/* Page size is 128KB. */
80895 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
80896 	/* Page size is 256KB. */
80897 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
80898 	/* Page size is 512KB. */
80899 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
80900 	/* Page size is 1MB. */
80901 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
80902 	/* Page size is 2MB. */
80903 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
80904 	/* Page size is 4MB. */
80905 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
80906 	/* Page size is 8MB. */
80907 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
80908 	/* Page size is 16MB. */
80909 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
80910 	/* Page size is 32MB. */
80911 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
80912 	/* Page size is 64MB. */
80913 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
80914 	/* Page size is 128MB. */
80915 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
80916 	/* Page size is 256MB. */
80917 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
80918 	/* Page size is 512MB. */
80919 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
80920 	/* Page size is 1GB. */
80921 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
80922 	/* Page size is 2GB. */
80923 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
80924 	/* Page size is 4GB. */
80925 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
80926 	/* Page size is 8GB. */
80927 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
80928 	/* Page size is 16GB. */
80929 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
80930 	/* Page size is 32GB. */
80931 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
80932 	/* Page size is 64GB. */
80933 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
80934 	/* Page size is 128GB. */
80935 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
80936 	/* Page size is 256GB. */
80937 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
80938 	/* Page size is 512GB. */
80939 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
80940 	/* Page size is 1TB. */
80941 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
80942 	/* Page size is 2TB. */
80943 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
80944 	/* Page size is 4TB. */
80945 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
80946 	/* Page size is 8TB. */
80947 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
80948 		#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_LAST	SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T
80949 	/* Number of levels of PBL for translation */
80950 	#define SQ_FR_PMR_HDR_NUMLEVELS_MASK		UINT32_C(0xc0)
80951 	#define SQ_FR_PMR_HDR_NUMLEVELS_SFT		6
80952 	/*
80953 	 * A zero level PBL means that the VA is the physical address used
80954 	 * for the operation. No translation is done by the PTU.
80955 	 */
80956 		#define SQ_FR_PMR_HDR_NUMLEVELS_PHYSICAL	(UINT32_C(0x0) << 6)
80957 	/*
80958 	 * A one layer translation is provided between the logical and
80959 	 * physical address. The PBL points to a physical page that
80960 	 * contains PBE values that point to actual pg_size physical pages.
80961 	 */
80962 		#define SQ_FR_PMR_HDR_NUMLEVELS_LAYER1		(UINT32_C(0x1) << 6)
80963 	/*
80964 	 * A two layer translation is provided between the logical and
80965 	 * physical address. The PBL points to a physical page that
80966 	 * contains PDE values that in turn point to pbl_pg_size physical
80967 	 * pages that contain PBE values that point to actual physical
80968 	 * pages.
80969 	 */
80970 		#define SQ_FR_PMR_HDR_NUMLEVELS_LAYER2		(UINT32_C(0x2) << 6)
80971 		#define SQ_FR_PMR_HDR_NUMLEVELS_LAST		SQ_FR_PMR_HDR_NUMLEVELS_LAYER2
80972 	/* Pointer to the PBL, or PDL depending on number of levels */
80973 	uint64_t	pblptr;
80974 	/* Local Virtual Address */
80975 	uint64_t	va;
80976 } sq_fr_pmr_hdr_t, *psq_fr_pmr_hdr_t;
80977 
80978 /* FR-PPMR SQ WQE */
80979 /* sq_fr_ppmr (size:1024b/128B) */
80980 
80981 typedef struct sq_fr_ppmr {
80982 	/* This field defines the type of SQ WQE. */
80983 	uint8_t	wqe_type;
80984 	/*
80985 	 * FR-PPMR (Fast Register Proxy Physical Memory Region)
80986 	 *
80987 	 * Allowed only on reliable connection (RC) SQs.
80988 	 */
80989 	#define SQ_FR_PPMR_WQE_TYPE_FR_PPMR UINT32_C(0xf)
80990 	#define SQ_FR_PPMR_WQE_TYPE_LAST   SQ_FR_PPMR_WQE_TYPE_FR_PPMR
80991 	uint8_t	flags;
80992 	/*
80993 	 * Set if completion signaling is requested. If this bit is
80994 	 * 0, and the SQ is configured to support Unsignaled
80995 	 * completion the controller should not generate a CQE
80996 	 * unless there was an error. This refers to CQE on the
80997 	 * sender side (se_flag refers to the receiver side)
80998 	 */
80999 	#define SQ_FR_PPMR_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
81000 	/*
81001 	 * Indication to complete all previous RDMA Read or Atomic
81002 	 * WQEs on the SQ before executing this WQE
81003 	 */
81004 	#define SQ_FR_PPMR_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
81005 	/*
81006 	 * Unconditional fence. Indication to complete all previous
81007 	 * SQ's WQEs before executing this WQE.
81008 	 */
81009 	#define SQ_FR_PPMR_FLAGS_UC_FENCE		UINT32_C(0x4)
81010 	/* Not Applicable for FR_PPMR. Nothing is sent */
81011 	#define SQ_FR_PPMR_FLAGS_SE			UINT32_C(0x8)
81012 	/* NA */
81013 	#define SQ_FR_PPMR_FLAGS_INLINE		UINT32_C(0x10)
81014 	/*
81015 	 * This flag is not applicable and should be 0 for a local memory
81016 	 * operation WQE.
81017 	 */
81018 	#define SQ_FR_PPMR_FLAGS_WQE_TS_EN		UINT32_C(0x20)
81019 	/*
81020 	 * When set to '1', this operation will cause a trace capture in
81021 	 * each block it passes through.
81022 	 */
81023 	#define SQ_FR_PPMR_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
81024 	/*
81025 	 * This is the new access control for the MR. '1' means
81026 	 * the operation is allowed. '0' means operation is
81027 	 * not allowed.
81028 	 */
81029 	uint8_t	access_cntl;
81030 	/* Local Write Access */
81031 	#define SQ_FR_PPMR_ACCESS_CNTL_LOCAL_WRITE	UINT32_C(0x1)
81032 	/* Remote Read Access */
81033 	#define SQ_FR_PPMR_ACCESS_CNTL_REMOTE_READ	UINT32_C(0x2)
81034 	/* Remote Write Access */
81035 	#define SQ_FR_PPMR_ACCESS_CNTL_REMOTE_WRITE	UINT32_C(0x4)
81036 	/* Remote Atomic Access */
81037 	#define SQ_FR_PPMR_ACCESS_CNTL_REMOTE_ATOMIC	UINT32_C(0x8)
81038 	/* Window Binding Allowed */
81039 	#define SQ_FR_PPMR_ACCESS_CNTL_WINDOW_BIND	UINT32_C(0x10)
81040 	uint8_t	zero_based_page_size_log;
81041 	/* Page size. 0 for 4KB page size, ... to 8TB. */
81042 	#define SQ_FR_PPMR_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
81043 	#define SQ_FR_PPMR_PAGE_SIZE_LOG_SFT	0
81044 	/* Page size is 4KB. */
81045 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
81046 	/* Page size is 8KB. */
81047 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
81048 	/* Page size is 16KB. */
81049 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
81050 	/* Page size is 32KB. */
81051 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
81052 	/* Page size is 64KB. */
81053 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
81054 	/* Page size is 128KB. */
81055 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
81056 	/* Page size is 256KB. */
81057 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
81058 	/* Page size is 512KB. */
81059 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
81060 	/* Page size is 1MB. */
81061 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
81062 	/* Page size is 2MB. */
81063 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
81064 	/* Page size is 4MB. */
81065 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
81066 	/* Page size is 8MB. */
81067 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
81068 	/* Page size is 16MB. */
81069 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
81070 	/* Page size is 32MB. */
81071 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
81072 	/* Page size is 64MB. */
81073 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
81074 	/* Page size is 128MB. */
81075 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
81076 	/* Page size is 256MB. */
81077 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
81078 	/* Page size is 512MB. */
81079 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
81080 	/* Page size is 1GB. */
81081 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
81082 	/* Page size is 2GB. */
81083 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
81084 	/* Page size is 4GB. */
81085 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
81086 	/* Page size is 8GB. */
81087 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
81088 	/* Page size is 16GB. */
81089 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
81090 	/* Page size is 32GB. */
81091 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
81092 	/* Page size is 64GB. */
81093 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
81094 	/* Page size is 128GB. */
81095 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
81096 	/* Page size is 256GB. */
81097 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
81098 	/* Page size is 512GB. */
81099 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
81100 	/* Page size is 1TB. */
81101 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
81102 	/* Page size is 2TB. */
81103 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
81104 	/* Page size is 4TB. */
81105 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
81106 	/* Page size is 8TB. */
81107 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
81108 		#define SQ_FR_PPMR_PAGE_SIZE_LOG_LAST	SQ_FR_PPMR_PAGE_SIZE_LOG_PGSZ_8T
81109 	/* Indicate the MR is ZBVA (Zero Base VA) */
81110 	#define SQ_FR_PPMR_ZERO_BASED		UINT32_C(0x20)
81111 	/*
81112 	 * Local Key; 24 msb of the key are used to index the MRW
81113 	 * table, 8 lsb are assigned to the 8 bit key_lsb field in
81114 	 * the MRWC.
81115 	 */
81116 	uint32_t	l_key;
81117 	/* Length in bytes of registered MR */
81118 	uint32_t	length;
81119 	/* Sets the proxy_vfid field of the physical memory region. */
81120 	uint16_t	proxy_vfid;
81121 	/* Sets the proxy_pfid field of the physical memory region. */
81122 	uint8_t	proxy_pfid;
81123 	uint8_t	numlevels_pbl_page_size_log;
81124 	/* PBL page size. 0 for 4KB page size, ... to 8TB. */
81125 	#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
81126 	#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_SFT	0
81127 	/* Page size is 4KB. */
81128 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
81129 	/* Page size is 8KB. */
81130 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
81131 	/* Page size is 16KB. */
81132 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
81133 	/* Page size is 32KB. */
81134 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
81135 	/* Page size is 64KB. */
81136 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
81137 	/* Page size is 128KB. */
81138 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
81139 	/* Page size is 256KB. */
81140 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
81141 	/* Page size is 512KB. */
81142 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
81143 	/* Page size is 1MB. */
81144 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
81145 	/* Page size is 2MB. */
81146 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
81147 	/* Page size is 4MB. */
81148 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
81149 	/* Page size is 8MB. */
81150 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
81151 	/* Page size is 16MB. */
81152 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
81153 	/* Page size is 32MB. */
81154 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
81155 	/* Page size is 64MB. */
81156 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
81157 	/* Page size is 128MB. */
81158 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
81159 	/* Page size is 256MB. */
81160 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
81161 	/* Page size is 512MB. */
81162 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
81163 	/* Page size is 1GB. */
81164 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
81165 	/* Page size is 2GB. */
81166 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
81167 	/* Page size is 4GB. */
81168 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
81169 	/* Page size is 8GB. */
81170 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
81171 	/* Page size is 16GB. */
81172 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
81173 	/* Page size is 32GB. */
81174 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
81175 	/* Page size is 64GB. */
81176 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
81177 	/* Page size is 128GB. */
81178 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
81179 	/* Page size is 256GB. */
81180 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
81181 	/* Page size is 512GB. */
81182 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
81183 	/* Page size is 1TB. */
81184 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
81185 	/* Page size is 2TB. */
81186 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
81187 	/* Page size is 4TB. */
81188 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
81189 	/* Page size is 8TB. */
81190 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
81191 		#define SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_LAST	SQ_FR_PPMR_PBL_PAGE_SIZE_LOG_PGSZ_8T
81192 	/* Sets the proxy_vf_valid field of the physical memory region. */
81193 	#define SQ_FR_PPMR_PROXY_VF_VALID		UINT32_C(0x20)
81194 	/* Number of levels of PBL for translation */
81195 	#define SQ_FR_PPMR_NUMLEVELS_MASK		UINT32_C(0xc0)
81196 	#define SQ_FR_PPMR_NUMLEVELS_SFT		6
81197 	/*
81198 	 * A zero level PBL means that the VA is the physical address used
81199 	 * for the operation. No translation is done by the PTU.
81200 	 */
81201 		#define SQ_FR_PPMR_NUMLEVELS_PHYSICAL	(UINT32_C(0x0) << 6)
81202 	/*
81203 	 * A one layer translation is provided between the logical and
81204 	 * physical address. The PBL points to a physical page that
81205 	 * contains PBE values that point to actual pg_size physical pages.
81206 	 */
81207 		#define SQ_FR_PPMR_NUMLEVELS_LAYER1		(UINT32_C(0x1) << 6)
81208 	/*
81209 	 * A two layer translation is provided between the logical and
81210 	 * physical address. The PBL points to a physical page that
81211 	 * contains PDE values that in turn point to pbl_pg_size physical
81212 	 * pages that contain PBE values that point to actual physical
81213 	 * pages.
81214 	 */
81215 		#define SQ_FR_PPMR_NUMLEVELS_LAYER2		(UINT32_C(0x2) << 6)
81216 		#define SQ_FR_PPMR_NUMLEVELS_LAST		SQ_FR_PPMR_NUMLEVELS_LAYER2
81217 	/* Pointer to the PBL, or PDL depending on number of levels */
81218 	uint64_t	pblptr;
81219 	/* Local Virtual Address */
81220 	uint64_t	va;
81221 	/* The data field for FR-PPMR is not used. */
81222 	uint32_t	data[24];
81223 } sq_fr_ppmr_t, *psq_fr_ppmr_t;
81224 
81225 /* FR-PPMR SQ WQE header. */
81226 /* sq_fr_ppmr_hdr (size:256b/32B) */
81227 
81228 typedef struct sq_fr_ppmr_hdr {
81229 	/* This field defines the type of SQ WQE. */
81230 	uint8_t	wqe_type;
81231 	/*
81232 	 * FR-PPMR (Fast Register Proxy Physical Memory Region)
81233 	 *
81234 	 * Allowed only on reliable connection (RC) SQs.
81235 	 */
81236 	#define SQ_FR_PPMR_HDR_WQE_TYPE_FR_PPMR UINT32_C(0xf)
81237 	#define SQ_FR_PPMR_HDR_WQE_TYPE_LAST   SQ_FR_PPMR_HDR_WQE_TYPE_FR_PPMR
81238 	uint8_t	flags;
81239 	/*
81240 	 * Set if completion signaling is requested. If this bit is
81241 	 * 0, and the SQ is configured to support Unsignaled
81242 	 * completion the controller should not generate a CQE
81243 	 * unless there was an error. This refers to CQE on the
81244 	 * sender side (se_flag refers to the receiver side)
81245 	 */
81246 	#define SQ_FR_PPMR_HDR_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
81247 	/*
81248 	 * Indication to complete all previous RDMA Read or Atomic
81249 	 * WQEs on the SQ before executing this WQE
81250 	 */
81251 	#define SQ_FR_PPMR_HDR_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
81252 	/*
81253 	 * Unconditional fence. Indication to complete all previous
81254 	 * SQ's WQEs before executing this WQE.
81255 	 */
81256 	#define SQ_FR_PPMR_HDR_FLAGS_UC_FENCE		UINT32_C(0x4)
81257 	/* Not Applicable for FR_PPMR. Nothing is sent */
81258 	#define SQ_FR_PPMR_HDR_FLAGS_SE			UINT32_C(0x8)
81259 	/* NA */
81260 	#define SQ_FR_PPMR_HDR_FLAGS_INLINE		UINT32_C(0x10)
81261 	/*
81262 	 * This flag is not applicable and should be 0 for a local memory
81263 	 * operation WQE.
81264 	 */
81265 	#define SQ_FR_PPMR_HDR_FLAGS_WQE_TS_EN		UINT32_C(0x20)
81266 	/*
81267 	 * When set to '1', this operation will cause a trace capture in
81268 	 * each block it passes through.
81269 	 */
81270 	#define SQ_FR_PPMR_HDR_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
81271 	/*
81272 	 * This is the new access control for the MR. '1' means
81273 	 * the operation is allowed. '0' means operation is
81274 	 * not allowed.
81275 	 */
81276 	uint8_t	access_cntl;
81277 	/* Local Write Access */
81278 	#define SQ_FR_PPMR_HDR_ACCESS_CNTL_LOCAL_WRITE	UINT32_C(0x1)
81279 	/* Remote Read Access */
81280 	#define SQ_FR_PPMR_HDR_ACCESS_CNTL_REMOTE_READ	UINT32_C(0x2)
81281 	/* Remote Write Access */
81282 	#define SQ_FR_PPMR_HDR_ACCESS_CNTL_REMOTE_WRITE	UINT32_C(0x4)
81283 	/* Remote Atomic Access */
81284 	#define SQ_FR_PPMR_HDR_ACCESS_CNTL_REMOTE_ATOMIC	UINT32_C(0x8)
81285 	/* Window Binding Allowed */
81286 	#define SQ_FR_PPMR_HDR_ACCESS_CNTL_WINDOW_BIND	UINT32_C(0x10)
81287 	uint8_t	zero_based_page_size_log;
81288 	/* Page size. 0 for 4KB page size, ... to 8TB. */
81289 	#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
81290 	#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_SFT	0
81291 	/* Page size is 4KB. */
81292 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
81293 	/* Page size is 8KB. */
81294 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
81295 	/* Page size is 16KB. */
81296 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
81297 	/* Page size is 32KB. */
81298 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
81299 	/* Page size is 64KB. */
81300 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
81301 	/* Page size is 128KB. */
81302 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
81303 	/* Page size is 256KB. */
81304 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
81305 	/* Page size is 512KB. */
81306 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
81307 	/* Page size is 1MB. */
81308 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
81309 	/* Page size is 2MB. */
81310 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
81311 	/* Page size is 4MB. */
81312 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
81313 	/* Page size is 8MB. */
81314 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
81315 	/* Page size is 16MB. */
81316 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
81317 	/* Page size is 32MB. */
81318 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
81319 	/* Page size is 64MB. */
81320 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
81321 	/* Page size is 128MB. */
81322 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
81323 	/* Page size is 256MB. */
81324 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
81325 	/* Page size is 512MB. */
81326 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
81327 	/* Page size is 1GB. */
81328 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
81329 	/* Page size is 2GB. */
81330 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
81331 	/* Page size is 4GB. */
81332 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
81333 	/* Page size is 8GB. */
81334 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
81335 	/* Page size is 16GB. */
81336 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
81337 	/* Page size is 32GB. */
81338 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
81339 	/* Page size is 64GB. */
81340 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
81341 	/* Page size is 128GB. */
81342 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
81343 	/* Page size is 256GB. */
81344 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
81345 	/* Page size is 512GB. */
81346 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
81347 	/* Page size is 1TB. */
81348 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
81349 	/* Page size is 2TB. */
81350 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
81351 	/* Page size is 4TB. */
81352 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
81353 	/* Page size is 8TB. */
81354 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
81355 		#define SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_LAST	SQ_FR_PPMR_HDR_PAGE_SIZE_LOG_PGSZ_8T
81356 	/* Indicate the MR is ZBVA (Zero Base VA) */
81357 	#define SQ_FR_PPMR_HDR_ZERO_BASED		UINT32_C(0x20)
81358 	/*
81359 	 * Local Key; 24 msb of the key are used to index the MRW
81360 	 * table, 8 lsb are assigned to the 8 bit key_lsb field in
81361 	 * the MRWC.
81362 	 */
81363 	uint32_t	l_key;
81364 	/* Length in bytes of registered MR */
81365 	uint32_t	length;
81366 	/* Sets the proxy_vfid field of the physical memory region. */
81367 	uint16_t	proxy_vfid;
81368 	/* Sets the proxy_pfid field of the physical memory region. */
81369 	uint8_t	proxy_pfid;
81370 	uint8_t	numlevels_pbl_page_size_log;
81371 	/* PBL page size. 0 for 4KB page size, ... to 8TB. */
81372 	#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
81373 	#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_SFT	0
81374 	/* Page size is 4KB. */
81375 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
81376 	/* Page size is 8KB. */
81377 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
81378 	/* Page size is 16KB. */
81379 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16K   UINT32_C(0x2)
81380 	/* Page size is 32KB. */
81381 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32K   UINT32_C(0x3)
81382 	/* Page size is 64KB. */
81383 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64K   UINT32_C(0x4)
81384 	/* Page size is 128KB. */
81385 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128K  UINT32_C(0x5)
81386 	/* Page size is 256KB. */
81387 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256K  UINT32_C(0x6)
81388 	/* Page size is 512KB. */
81389 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512K  UINT32_C(0x7)
81390 	/* Page size is 1MB. */
81391 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
81392 	/* Page size is 2MB. */
81393 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
81394 	/* Page size is 4MB. */
81395 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
81396 	/* Page size is 8MB. */
81397 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
81398 	/* Page size is 16MB. */
81399 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16M   UINT32_C(0xc)
81400 	/* Page size is 32MB. */
81401 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32M   UINT32_C(0xd)
81402 	/* Page size is 64MB. */
81403 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64M   UINT32_C(0xe)
81404 	/* Page size is 128MB. */
81405 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128M  UINT32_C(0xf)
81406 	/* Page size is 256MB. */
81407 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256M  UINT32_C(0x10)
81408 	/* Page size is 512MB. */
81409 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512M  UINT32_C(0x11)
81410 	/* Page size is 1GB. */
81411 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
81412 	/* Page size is 2GB. */
81413 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
81414 	/* Page size is 4GB. */
81415 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
81416 	/* Page size is 8GB. */
81417 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
81418 	/* Page size is 16GB. */
81419 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16G   UINT32_C(0x16)
81420 	/* Page size is 32GB. */
81421 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32G   UINT32_C(0x17)
81422 	/* Page size is 64GB. */
81423 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64G   UINT32_C(0x18)
81424 	/* Page size is 128GB. */
81425 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128G  UINT32_C(0x19)
81426 	/* Page size is 256GB. */
81427 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256G  UINT32_C(0x1a)
81428 	/* Page size is 512GB. */
81429 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512G  UINT32_C(0x1b)
81430 	/* Page size is 1TB. */
81431 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
81432 	/* Page size is 2TB. */
81433 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
81434 	/* Page size is 4TB. */
81435 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
81436 	/* Page size is 8TB. */
81437 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
81438 		#define SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_LAST	SQ_FR_PPMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T
81439 	/* Sets the proxy_vf_valid field of the physical memory region. */
81440 	#define SQ_FR_PPMR_HDR_PROXY_VF_VALID		UINT32_C(0x20)
81441 	/* Number of levels of PBL for translation */
81442 	#define SQ_FR_PPMR_HDR_NUMLEVELS_MASK		UINT32_C(0xc0)
81443 	#define SQ_FR_PPMR_HDR_NUMLEVELS_SFT		6
81444 	/*
81445 	 * A zero level PBL means that the VA is the physical address used
81446 	 * for the operation. No translation is done by the PTU.
81447 	 */
81448 		#define SQ_FR_PPMR_HDR_NUMLEVELS_PHYSICAL	(UINT32_C(0x0) << 6)
81449 	/*
81450 	 * A one layer translation is provided between the logical and
81451 	 * physical address. The PBL points to a physical page that
81452 	 * contains PBE values that point to actual pg_size physical pages.
81453 	 */
81454 		#define SQ_FR_PPMR_HDR_NUMLEVELS_LAYER1		(UINT32_C(0x1) << 6)
81455 	/*
81456 	 * A two layer translation is provided between the logical and
81457 	 * physical address. The PBL points to a physical page that
81458 	 * contains PDE values that in turn point to pbl_pg_size physical
81459 	 * pages that contain PBE values that point to actual physical
81460 	 * pages.
81461 	 */
81462 		#define SQ_FR_PPMR_HDR_NUMLEVELS_LAYER2		(UINT32_C(0x2) << 6)
81463 		#define SQ_FR_PPMR_HDR_NUMLEVELS_LAST		SQ_FR_PPMR_HDR_NUMLEVELS_LAYER2
81464 	/* Pointer to the PBL, or PDL depending on number of levels */
81465 	uint64_t	pblptr;
81466 	/* Local Virtual Address */
81467 	uint64_t	va;
81468 } sq_fr_ppmr_hdr_t, *psq_fr_ppmr_hdr_t;
81469 
81470 /*
81471  * Bind SQ WQE. This WQE can perform either:
81472  * * type1 "bind memory window", if mw_type==Type1
81473  * * type2 "post send bind memory window", if mw_type==Type2
81474  */
81475 /* sq_bind (size:1024b/128B) */
81476 
81477 typedef struct sq_bind {
81478 	/* This field defines the type of SQ WQE. */
81479 	uint8_t	wqe_type;
81480 	/*
81481 	 * Memory Bind
81482 	 *
81483 	 * Allowed only on reliable connection (RC) SQs.
81484 	 */
81485 	#define SQ_BIND_WQE_TYPE_BIND UINT32_C(0xe)
81486 	#define SQ_BIND_WQE_TYPE_LAST SQ_BIND_WQE_TYPE_BIND
81487 	uint8_t	flags;
81488 	#define SQ_BIND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
81489 	#define SQ_BIND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
81490 	/*
81491 	 * Set if completion signaling is requested. If this bit is
81492 	 * 0, and the SQ is configured to support Unsignaled
81493 	 * completion the controller should not generate a CQE
81494 	 * unless there was an error. This refers to CQE on the
81495 	 * sender side (se_flag refers to the receiver side)
81496 	 */
81497 	#define SQ_BIND_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
81498 	/*
81499 	 * Indication to complete all previous RDMA Read or Atomic
81500 	 * WQEs on the SQ before executing this WQE
81501 	 */
81502 	#define SQ_BIND_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
81503 	/*
81504 	 * Unconditional fence. Indication to complete all previous
81505 	 * SQ's WQEs before executing this WQE.
81506 	 */
81507 	#define SQ_BIND_FLAGS_UC_FENCE								UINT32_C(0x4)
81508 	/* NA, nothing is sent. */
81509 	#define SQ_BIND_FLAGS_SE									UINT32_C(0x8)
81510 	/* NA */
81511 	#define SQ_BIND_FLAGS_INLINE								UINT32_C(0x10)
81512 	/*
81513 	 * This flag is not applicable and should be 0 for a local memory
81514 	 * operation WQE.
81515 	 */
81516 	#define SQ_BIND_FLAGS_WQE_TS_EN								UINT32_C(0x20)
81517 	/*
81518 	 * When set to '1', this operation will cause a trace capture in
81519 	 * each block it passes through.
81520 	 */
81521 	#define SQ_BIND_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
81522 	/*
81523 	 * This is the new access control for the MR. '1' means
81524 	 * the operation is allowed. '0' means operation is
81525 	 * not allowed.
81526 	 */
81527 	uint8_t	access_cntl;
81528 	#define SQ_BIND_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_MASK		UINT32_C(0xff)
81529 	#define SQ_BIND_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_SFT		0
81530 	/*
81531 	 * Local Write Access.
81532 	 *
81533 	 * Local accesses are never allowed for memory windows, so this
81534 	 * bit must always be zero in a bind WQE. If this bit is ever
81535 	 * set, the bind will fail with an errored completion.
81536 	 */
81537 	#define SQ_BIND_ACCESS_CNTL_LOCAL_WRITE									UINT32_C(0x1)
81538 	/* Remote Read Access */
81539 	#define SQ_BIND_ACCESS_CNTL_REMOTE_READ									UINT32_C(0x2)
81540 	/*
81541 	 * Remote Write Access.
81542 	 *
81543 	 * Note that, if this bit is set, then the parent region to which
81544 	 * the window is being bound must allow local writes. If this is
81545 	 * not the case, then the bind will fail with an errored
81546 	 * completion.
81547 	 */
81548 	#define SQ_BIND_ACCESS_CNTL_REMOTE_WRITE									UINT32_C(0x4)
81549 	/*
81550 	 * Remote Atomic Access.
81551 	 *
81552 	 * Note that, if this bit is set, then the parent region to which
81553 	 * the window is being bound must allow local writes. If this is
81554 	 * not the case, then the bind will fail with an errored
81555 	 * completion.
81556 	 */
81557 	#define SQ_BIND_ACCESS_CNTL_REMOTE_ATOMIC									UINT32_C(0x8)
81558 	/*
81559 	 * Window Binding Allowed.
81560 	 *
81561 	 * It is never allowed to bind windows to windows, so this bit
81562 	 * must always be zero in a bind WQE. If this bit is ever set,
81563 	 * the bind will fail with an errored completion.
81564 	 */
81565 	#define SQ_BIND_ACCESS_CNTL_WINDOW_BIND									UINT32_C(0x10)
81566 	/* reserved8_1 is 8 b */
81567 	uint8_t	reserved8_1;
81568 	uint8_t	mw_type_zero_based;
81569 	/*
81570 	 * If this bit is set, then the newly-bound memory window will be
81571 	 * zero-based. If clear, then the newly-bound memory window will be
81572 	 * non-zero-based.
81573 	 */
81574 	#define SQ_BIND_ZERO_BASED	UINT32_C(0x1)
81575 	/*
81576 	 * If type1 is specified, then this WQE performs a "bind memory
81577 	 * window" operation on a type1 window. If type2 is specified, then
81578 	 * this WQE performs a "post send bind memory window" operation on a
81579 	 * type2 window.
81580 	 *
81581 	 * Note that the bind WQE cannot change the type of the memory
81582 	 * window.
81583 	 *
81584 	 * If a "bind memory window" operation is attempted on a memory
81585 	 * window that was allocated as type2, then the bind will fail with
81586 	 * an errored completion, as "bind memory window" is allowed only on
81587 	 * type1 memory windows.
81588 	 *
81589 	 * Similarly, if a "post send bind memory window" operation is
81590 	 * attempted on a memory window that was allocated as type1, then the
81591 	 * bind will fail with an errored completions, as "post send bind
81592 	 * memory window" is allowed only on type2 memory windows.
81593 	 */
81594 	#define SQ_BIND_MW_TYPE	UINT32_C(0x2)
81595 	/* Type 1 Bind Memory Window */
81596 		#define SQ_BIND_MW_TYPE_TYPE1	(UINT32_C(0x0) << 1)
81597 	/* Type 2 Post Send Bind Memory Window */
81598 		#define SQ_BIND_MW_TYPE_TYPE2	(UINT32_C(0x1) << 1)
81599 		#define SQ_BIND_MW_TYPE_LAST	SQ_BIND_MW_TYPE_TYPE2
81600 	uint8_t	reserved8_2;
81601 	uint16_t	reserved16;
81602 	/*
81603 	 * The L_Key of the parent MR; 24 msb of the key are used to
81604 	 * index the MRW table, 8 lsb are compared with the 8 bit key
81605 	 * in the MRWC.
81606 	 */
81607 	uint32_t	parent_l_key;
81608 	/*
81609 	 * Local Key; 24 msb of the key are used to index the memory
81610 	 * window being bound in the MRW table, 8 lsb are assign to the
81611 	 * 8 bit key_lsb field in the MRWC.
81612 	 */
81613 	uint32_t	l_key;
81614 	/* Local Virtual Address */
81615 	uint64_t	va;
81616 	/*
81617 	 * Length in bytes of registered MW; 40 bits as this is the max
81618 	 * size of an MR/W
81619 	 */
81620 	uint8_t	length[5];
81621 	uint8_t	reserved24[3];
81622 	/* The data field for Bind is not used. */
81623 	uint32_t	data[24];
81624 } sq_bind_t, *psq_bind_t;
81625 
81626 /*
81627  * Bind SQ WQE header. This WQE can perform either:
81628  * * type1 "bind memory window", if mw_type==Type1
81629  * * type2 "post send bind memory window", if mw_type==Type2
81630  */
81631 /* sq_bind_hdr (size:256b/32B) */
81632 
81633 typedef struct sq_bind_hdr {
81634 	/* This field defines the type of SQ WQE. */
81635 	uint8_t	wqe_type;
81636 	/*
81637 	 * Memory Bind
81638 	 *
81639 	 * Allowed only on reliable connection (RC) SQs.
81640 	 */
81641 	#define SQ_BIND_HDR_WQE_TYPE_BIND UINT32_C(0xe)
81642 	#define SQ_BIND_HDR_WQE_TYPE_LAST SQ_BIND_HDR_WQE_TYPE_BIND
81643 	uint8_t	flags;
81644 	#define SQ_BIND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK		UINT32_C(0xff)
81645 	#define SQ_BIND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT			0
81646 	/*
81647 	 * Set if completion signaling is requested. If this bit is
81648 	 * 0, and the SQ is configured to support Unsignaled
81649 	 * completion the controller should not generate a CQE
81650 	 * unless there was an error. This refers to CQE on the
81651 	 * sender side (se_flag refers to the receiver side)
81652 	 */
81653 	#define SQ_BIND_HDR_FLAGS_SIGNAL_COMP								UINT32_C(0x1)
81654 	/*
81655 	 * Indication to complete all previous RDMA Read or Atomic
81656 	 * WQEs on the SQ before executing this WQE
81657 	 */
81658 	#define SQ_BIND_HDR_FLAGS_RD_OR_ATOMIC_FENCE							UINT32_C(0x2)
81659 	/*
81660 	 * Unconditional fence. Indication to complete all previous
81661 	 * SQ's WQEs before executing this WQE.
81662 	 */
81663 	#define SQ_BIND_HDR_FLAGS_UC_FENCE								UINT32_C(0x4)
81664 	/* NA, nothing is sent. */
81665 	#define SQ_BIND_HDR_FLAGS_SE									UINT32_C(0x8)
81666 	/* NA */
81667 	#define SQ_BIND_HDR_FLAGS_INLINE								UINT32_C(0x10)
81668 	/*
81669 	 * This flag is not applicable and should be 0 for a local memory
81670 	 * operation WQE.
81671 	 */
81672 	#define SQ_BIND_HDR_FLAGS_WQE_TS_EN								UINT32_C(0x20)
81673 	/*
81674 	 * When set to '1', this operation will cause a trace capture in
81675 	 * each block it passes through.
81676 	 */
81677 	#define SQ_BIND_HDR_FLAGS_DEBUG_TRACE								UINT32_C(0x40)
81678 	/*
81679 	 * This is the new access control for the MR. '1' means
81680 	 * the operation is allowed. '0' means operation is
81681 	 * not allowed.
81682 	 */
81683 	uint8_t	access_cntl;
81684 	#define SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_MASK		UINT32_C(0xff)
81685 	#define SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_SFT		0
81686 	/*
81687 	 * Local Write Access.
81688 	 *
81689 	 * Local accesses are never allowed for memory windows, so this
81690 	 * bit must always be zero in a bind WQE. If this bit is ever
81691 	 * set, the bind will fail with an errored completion.
81692 	 */
81693 	#define SQ_BIND_HDR_ACCESS_CNTL_LOCAL_WRITE									UINT32_C(0x1)
81694 	/* Remote Read Access */
81695 	#define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_READ									UINT32_C(0x2)
81696 	/*
81697 	 * Remote Write Access.
81698 	 *
81699 	 * Note that, if this bit is set, then the parent region to which
81700 	 * the window is being bound must allow local writes. If this is
81701 	 * not the case, then the bind will fail with an errored
81702 	 * completion.
81703 	 */
81704 	#define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_WRITE									UINT32_C(0x4)
81705 	/*
81706 	 * Remote Atomic Access.
81707 	 *
81708 	 * Note that, if this bit is set, then the parent region to which
81709 	 * the window is being bound must allow local writes. If this is
81710 	 * not the case, then the bind will fail with an errored
81711 	 * completion.
81712 	 */
81713 	#define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_ATOMIC									UINT32_C(0x8)
81714 	/*
81715 	 * Window Binding Allowed.
81716 	 *
81717 	 * It is never allowed to bind windows to windows, so this bit
81718 	 * must always be zero in a bind WQE. If this bit is ever set,
81719 	 * the bind will fail with an errored completion.
81720 	 */
81721 	#define SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND									UINT32_C(0x10)
81722 	/* reserved8_1 is 8 b */
81723 	uint8_t	reserved8_1;
81724 	uint8_t	mw_type_zero_based;
81725 	/*
81726 	 * If this bit is set, then the newly-bound memory window will be
81727 	 * zero-based. If clear, then the newly-bound memory window will be
81728 	 * non-zero-based.
81729 	 */
81730 	#define SQ_BIND_HDR_ZERO_BASED	UINT32_C(0x1)
81731 	/*
81732 	 * If type1 is specified, then this WQE performs a "bind memory
81733 	 * window" operation on a type1 window. If type2 is specified, then
81734 	 * this WQE performs a "post send bind memory window" operation on a
81735 	 * type2 window.
81736 	 *
81737 	 * Note that the bind WQE cannot change the type of the memory
81738 	 * window.
81739 	 *
81740 	 * If a "bind memory window" operation is attempted on a memory
81741 	 * window that was allocated as type2, then the bind will fail with
81742 	 * an errored completion, as "bind memory window" is allowed only on
81743 	 * type1 memory windows.
81744 	 *
81745 	 * Similarly, if a "post send bind memory window" operation is
81746 	 * attempted on a memory window that was allocated as type1, then the
81747 	 * bind will fail with an errored completions, as "post send bind
81748 	 * memory window" is allowed only on type2 memory windows.
81749 	 */
81750 	#define SQ_BIND_HDR_MW_TYPE	UINT32_C(0x2)
81751 	/* Type 1 Bind Memory Window */
81752 		#define SQ_BIND_HDR_MW_TYPE_TYPE1	(UINT32_C(0x0) << 1)
81753 	/* Type 2 Post Send Bind Memory Window */
81754 		#define SQ_BIND_HDR_MW_TYPE_TYPE2	(UINT32_C(0x1) << 1)
81755 		#define SQ_BIND_HDR_MW_TYPE_LAST	SQ_BIND_HDR_MW_TYPE_TYPE2
81756 	uint8_t	reserved8_2;
81757 	uint16_t	reserved16;
81758 	/*
81759 	 * The L_Key of the parent MR; 24 msb of the key are used to
81760 	 * index the MRW table, 8 lsb are compared with the 8 bit key
81761 	 * in the MRWC.
81762 	 */
81763 	uint32_t	parent_l_key;
81764 	/*
81765 	 * Local Key; 24 msb of the key are used to index the memory
81766 	 * window being bound in the MRW table, 8 lsb are assign to the
81767 	 * 8 bit key_lsb field in the MRWC.
81768 	 */
81769 	uint32_t	l_key;
81770 	/* Local Virtual Address */
81771 	uint64_t	va;
81772 	/*
81773 	 * Length in bytes of registered MW; 40 bits as this is the max
81774 	 * size of an MR/W
81775 	 */
81776 	uint8_t	length[5];
81777 	uint8_t	reserved24[3];
81778 } sq_bind_hdr_t, *psq_bind_hdr_t;
81779 
81780 /*
81781  * This V3 version of structure is not accessible from host software, but is documented here (in the SW section) anyway.
81782  * This is the MSN Table (located in IQM). The table is written by the RoCE transmitter when sending wire operation WQEs. It is used to provide the RoCE receiver with information about the SQ WQEs in order to make requester completions and to perform requester HW retransmission. The number of entries in the table is configured in the QPC and must be equal to the maximum number of WQEs that can be present in the SQ at one time, rounded up to the nearest power of two.
81783  */
81784 /* sq_msn_search_v3 (size:128b/16B) */
81785 
81786 typedef struct sq_msn_search_v3 {
81787 	uint64_t	idx_psn;
81788 	/* Start PSN of the WQE. */
81789 	#define SQ_MSN_SEARCH_V3_START_PSN_MASK UINT32_C(0xffffff)
81790 	#define SQ_MSN_SEARCH_V3_START_PSN_SFT 0
81791 	/* Next PSN. Equal to the start PSN of the next WQE. */
81792 	#define SQ_MSN_SEARCH_V3_NEXT_PSN_MASK UINT32_C(0xffffff000000)L
81793 	#define SQ_MSN_SEARCH_V3_NEXT_PSN_SFT  24
81794 	/*
81795 	 * Start index. For variable-size WQEs, this field indicates the
81796 	 * starting slot index that corresponds to the WQE. In
81797 	 * backward-compatible mode, this is the starting WQE index.
81798 	 */
81799 	#define SQ_MSN_SEARCH_V3_START_IDX_MASK UINT32_C(0xffff000000000000)L
81800 	#define SQ_MSN_SEARCH_V3_START_IDX_SFT 48
81801 	/*
81802 	 * This value will be returned in the completion if the completion
81803 	 * is signaled.
81804 	 */
81805 	uint32_t	wqe_opaque;
81806 	/* The size of the WQE in units of 16B chunks. */
81807 	uint8_t	wqe_size;
81808 	uint8_t	signal;
81809 	/* Set if completion signaling is requested. */
81810 	#define SQ_MSN_SEARCH_V3_SGNLD			UINT32_C(0x1)
81811 	/*
81812 	 * Set if at least one signaled local memory operation WQE is
81813 	 * present in the SQ between the previous wire-operation WQE
81814 	 * and this WQE.
81815 	 */
81816 	#define SQ_MSN_SEARCH_V3_PREV_SGNLD_LOCAL_MEM_WQE	UINT32_C(0x2)
81817 	uint16_t	reserved;
81818 } sq_msn_search_v3_t, *psq_msn_search_v3_t;
81819 
81820 /* SQ Send WQE V3 for RC SQs. */
81821 /* sq_send_v3 (size:1024b/128B) */
81822 
81823 typedef struct sq_send_v3 {
81824 	/* This field defines the type of SQ WQE. */
81825 	uint8_t	wqe_type;
81826 	/* Send V3 */
81827 	#define SQ_SEND_V3_WQE_TYPE_SEND_V3	UINT32_C(0x10)
81828 	/*
81829 	 * Send with Immediate V3
81830 	 *
81831 	 * Allowed only on reliable connection (RC) SQs.
81832 	 */
81833 	#define SQ_SEND_V3_WQE_TYPE_SEND_W_IMMED_V3   UINT32_C(0x11)
81834 	/*
81835 	 * Send with Invalidate V3
81836 	 *
81837 	 * Allowed only on reliable connection (RC) SQs.
81838 	 */
81839 	#define SQ_SEND_V3_WQE_TYPE_SEND_W_INVALID_V3 UINT32_C(0x12)
81840 	#define SQ_SEND_V3_WQE_TYPE_LAST		SQ_SEND_V3_WQE_TYPE_SEND_W_INVALID_V3
81841 	uint8_t	flags;
81842 	/*
81843 	 * Set if completion signaling is requested. If this bit is
81844 	 * 0, and the SQ is configured to support Unsignaled completion
81845 	 * the controller should not generate a CQE unless there was
81846 	 * an error. This refers to the CQE on the sender side. (The se
81847 	 * flag refers to the receiver side).
81848 	 */
81849 	#define SQ_SEND_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
81850 	/*
81851 	 * Indication to complete all previous RDMA Read or Atomic WQEs
81852 	 * on the SQ before executing this WQE.
81853 	 *
81854 	 * This flag must be zero for a UD send.
81855 	 */
81856 	#define SQ_SEND_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
81857 	/*
81858 	 * Unconditional fence. Indication to complete all
81859 	 * previous SQ's WQEs before executing this WQE.
81860 	 *
81861 	 * This flag must be zero for a UD send.
81862 	 */
81863 	#define SQ_SEND_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
81864 	/*
81865 	 * Solicit event flag. Indication sent in BTH header to the
81866 	 * receiver to generate a Completion Event Notification, i.e.
81867 	 * CNQE.
81868 	 */
81869 	#define SQ_SEND_V3_FLAGS_SE			UINT32_C(0x8)
81870 	/*
81871 	 * Indicate that inline data is posted to the SQ in the data
81872 	 * area of this WQE.
81873 	 */
81874 	#define SQ_SEND_V3_FLAGS_INLINE		UINT32_C(0x10)
81875 	/*
81876 	 * If set to 1, then the timestamp from the WQE is used. If
81877 	 * cleared to 0, then TWE provides the timestamp.
81878 	 */
81879 	#define SQ_SEND_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
81880 	/*
81881 	 * When set to '1', this operation will cause a trace capture in
81882 	 * each block it passes through.
81883 	 */
81884 	#define SQ_SEND_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
81885 	/*  */
81886 	uint8_t	wqe_size;
81887 	/*
81888 	 * The number of 16 bytes chunks of data including this first
81889 	 * word of the request that are a valid part of the request. The
81890 	 * valid 16 bytes units other than the WQE structure can be
81891 	 * SGEs (Scatter Gather Elements) OR inline data.
81892 	 *
81893 	 * Note: Since the WQE header consumes only one slot (16 bytes)
81894 	 * for this type of WQE, and the maximum number of SGEs supported
81895 	 * by the device is 30, this field must never exceed 31.
81896 	 */
81897 	#define SQ_SEND_V3_WQE_SIZE_MASK UINT32_C(0x3f)
81898 	#define SQ_SEND_V3_WQE_SIZE_SFT 0
81899 	uint8_t	inline_length;
81900 	/*
81901 	 * When inline flag is '1', this field determines the number of
81902 	 * bytes that are valid in the last 16B unit of the inline WQE.
81903 	 * Zero means all 16 bytes are valid. One means only bits 7:0 of
81904 	 * the last 16B unit are valid. This means the total size of the
81905 	 * inline data is determined by a combination of the wqe_size field
81906 	 * and this inline_length field.
81907 	 *
81908 	 * `inline_size = ((wqe_size - 1) * 16) - data_offset_in_bytes +
81909 	 * ((inline_length == 0 ) ? 16 : inline_length)
81910 	 *
81911 	 * Where data_offset_in_bytes is the offset within the WQE where
81912 	 * the data field starts.
81913 	 *
81914 	 * Note that this field is not applicable for zero-length inline
81915 	 * WQEs.
81916 	 */
81917 	#define SQ_SEND_V3_INLINE_LENGTH_MASK UINT32_C(0xf)
81918 	#define SQ_SEND_V3_INLINE_LENGTH_SFT 0
81919 	/*
81920 	 * This value will be returned in the completion if the completion is
81921 	 * signaled.
81922 	 */
81923 	uint32_t	opaque;
81924 	/*
81925 	 * Either invalidate key (R_Key of the remote host) that will
81926 	 * be send with IETH (Invalidate ETH) if wqe_type is of Send
81927 	 * with Invalidate, or immediate value that will be sent with
81928 	 * ImmDt header if wqe_type is Send with Immediate.
81929 	 */
81930 	uint32_t	inv_key_or_imm_data;
81931 	uint32_t	timestamp;
81932 	/*
81933 	 * This field specifies a 24-bit timestamp that can be passed
81934 	 * down the TX path and optionally logged in the TXP timestamp
81935 	 * histogram.
81936 	 */
81937 	#define SQ_SEND_V3_TIMESTAMP_MASK UINT32_C(0xffffff)
81938 	#define SQ_SEND_V3_TIMESTAMP_SFT 0
81939 	/*
81940 	 * When inline=0, then this area is filled with from 1 to 30 SGEs
81941 	 * based on the wqe_size field.
81942 	 *
81943 	 * When inline=1, this area is filled with payload data for the
81944 	 * send. Length of data is described in the inline_length field.
81945 	 * Bits [7:0] of word 0 hold the first byte to go out on the wire.
81946 	 */
81947 	uint32_t	data[28];
81948 } sq_send_v3_t, *psq_send_v3_t;
81949 
81950 /* Send SQ WQE V3 header. */
81951 /* sq_send_hdr_v3 (size:128b/16B) */
81952 
81953 typedef struct sq_send_hdr_v3 {
81954 	/* This field defines the type of SQ WQE. */
81955 	uint8_t	wqe_type;
81956 	/* Send V3 */
81957 	#define SQ_SEND_HDR_V3_WQE_TYPE_SEND_V3	UINT32_C(0x10)
81958 	/*
81959 	 * Send with Immediate V3
81960 	 *
81961 	 * Allowed only on reliable connection (RC) SQs.
81962 	 */
81963 	#define SQ_SEND_HDR_V3_WQE_TYPE_SEND_W_IMMED_V3   UINT32_C(0x11)
81964 	/*
81965 	 * Send with Invalidate V3
81966 	 *
81967 	 * Allowed only on reliable connection (RC) SQs.
81968 	 */
81969 	#define SQ_SEND_HDR_V3_WQE_TYPE_SEND_W_INVALID_V3 UINT32_C(0x12)
81970 	#define SQ_SEND_HDR_V3_WQE_TYPE_LAST		SQ_SEND_HDR_V3_WQE_TYPE_SEND_W_INVALID_V3
81971 	uint8_t	flags;
81972 	/*
81973 	 * Set if completion signaling is requested. If this bit is
81974 	 * 0, and the SQ is configured to support Unsignaled completion
81975 	 * the controller should not generate a CQE unless there was
81976 	 * an error. This refers to the CQE on the sender side. (The se
81977 	 * flag refers to the receiver side).
81978 	 */
81979 	#define SQ_SEND_HDR_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
81980 	/*
81981 	 * Indication to complete all previous RDMA Read or Atomic WQEs
81982 	 * on the SQ before executing this WQE.
81983 	 *
81984 	 * This flag must be zero for a UD send.
81985 	 */
81986 	#define SQ_SEND_HDR_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
81987 	/*
81988 	 * Unconditional fence. Indication to complete all
81989 	 * previous SQ's WQEs before executing this WQE.
81990 	 *
81991 	 * This flag must be zero for a UD send.
81992 	 */
81993 	#define SQ_SEND_HDR_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
81994 	/*
81995 	 * Solicit event flag. Indication sent in BTH header to the
81996 	 * receiver to generate a Completion Event Notification, i.e.
81997 	 * CNQE.
81998 	 */
81999 	#define SQ_SEND_HDR_V3_FLAGS_SE			UINT32_C(0x8)
82000 	/*
82001 	 * Indicate that inline data is posted to the SQ in the data
82002 	 * area of this WQE.
82003 	 */
82004 	#define SQ_SEND_HDR_V3_FLAGS_INLINE		UINT32_C(0x10)
82005 	/*
82006 	 * If set to 1, then the timestamp from the WQE is used. If
82007 	 * cleared to 0, then TWE provides the timestamp.
82008 	 */
82009 	#define SQ_SEND_HDR_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
82010 	/*
82011 	 * When set to '1', this operation will cause a trace capture in
82012 	 * each block it passes through.
82013 	 */
82014 	#define SQ_SEND_HDR_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
82015 	/*  */
82016 	uint8_t	wqe_size;
82017 	/*
82018 	 * The number of 16 bytes chunks of data including this first
82019 	 * word of the request that are a valid part of the request. The
82020 	 * valid 16 bytes units other than the WQE structure can be
82021 	 * SGEs (Scatter Gather Elements) OR inline data.
82022 	 *
82023 	 * Note: Since the WQE header consumes only one slot (16 bytes)
82024 	 * for this type of WQE, and the maximum number of SGEs supported
82025 	 * by the device is 30, this field must never exceed 31.
82026 	 */
82027 	#define SQ_SEND_HDR_V3_WQE_SIZE_MASK UINT32_C(0x3f)
82028 	#define SQ_SEND_HDR_V3_WQE_SIZE_SFT 0
82029 	uint8_t	inline_length;
82030 	/*
82031 	 * When inline flag is '1', this field determines the number of
82032 	 * bytes that are valid in the last 16B unit of the inline WQE.
82033 	 * Zero means all 16 bytes are valid. One means only bits 7:0 of
82034 	 * the last 16B unit are valid. This means the total size of the
82035 	 * inline data is determined by a combination of the wqe_size field
82036 	 * and this inline_length field.
82037 	 *
82038 	 * `inline_size = ((wqe_size - 1) * 16) - data_offset_in_bytes +
82039 	 * ((inline_length == 0 ) ? 16 : inline_length)
82040 	 *
82041 	 * Where data_offset_in_bytes is the offset within the WQE where
82042 	 * the data field starts.
82043 	 *
82044 	 * Note that this field is not applicable for zero-length inline
82045 	 * WQEs.
82046 	 */
82047 	#define SQ_SEND_HDR_V3_INLINE_LENGTH_MASK UINT32_C(0xf)
82048 	#define SQ_SEND_HDR_V3_INLINE_LENGTH_SFT 0
82049 	/*
82050 	 * This value will be returned in the completion if the completion is
82051 	 * signaled.
82052 	 */
82053 	uint32_t	opaque;
82054 	/*
82055 	 * Either invalidate key (R_Key of the remote host) that will
82056 	 * be send with IETH (Invalidate ETH) if wqe_type is of Send
82057 	 * with Invalidate, or immediate value that will be sent with
82058 	 * ImmDt header if wqe_type is Send with Immediate.
82059 	 */
82060 	uint32_t	inv_key_or_imm_data;
82061 	uint32_t	timestamp;
82062 	/*
82063 	 * This field specifies a 24-bit timestamp that can be passed
82064 	 * down the TX path and optionally logged in the TXP timestamp
82065 	 * histogram.
82066 	 */
82067 	#define SQ_SEND_HDR_V3_TIMESTAMP_MASK UINT32_C(0xffffff)
82068 	#define SQ_SEND_HDR_V3_TIMESTAMP_SFT 0
82069 } sq_send_hdr_v3_t, *psq_send_hdr_v3_t;
82070 
82071 /* SQ WQE V3 for Raw Ethernet and QP1 */
82072 /* sq_rawqp1send_v3 (size:1024b/128B) */
82073 
82074 typedef struct sq_rawqp1send_v3 {
82075 	/* This field defines the type of SQ WQE. */
82076 	uint8_t	wqe_type;
82077 	/* RawEth/QP1 Send V3 */
82078 	#define SQ_RAWQP1SEND_V3_WQE_TYPE_RAWQP1SEND_V3 UINT32_C(0x1d)
82079 	#define SQ_RAWQP1SEND_V3_WQE_TYPE_LAST	SQ_RAWQP1SEND_V3_WQE_TYPE_RAWQP1SEND_V3
82080 	uint8_t	flags;
82081 	/*
82082 	 * Set if completion signaling is requested. If this bit is
82083 	 * 0, and the SQ is configured to support Unsignaled completion
82084 	 * the controller should not generate a CQE unless there was
82085 	 * an error. This refers to the CQE on the sender side. (The se
82086 	 * flag refers to the receiver side).
82087 	 */
82088 	#define SQ_RAWQP1SEND_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
82089 	/*
82090 	 * Indication to complete all previous RDMA Read or Atomic WQEs
82091 	 * on the SQ before executing this WQE.
82092 	 *
82093 	 * This flag must be zero for a QP1 send.
82094 	 */
82095 	#define SQ_RAWQP1SEND_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
82096 	/*
82097 	 * Unconditional fence. Indication to complete all
82098 	 * previous SQ's WQEs before executing this WQE.
82099 	 *
82100 	 * This flag must be zero for a QP1 send.
82101 	 */
82102 	#define SQ_RAWQP1SEND_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
82103 	/*
82104 	 * Solicit event flag. Indication sent in BTH header to the
82105 	 * receiver to generate a Completion Event Notification, i.e.
82106 	 * CNQE.
82107 	 *
82108 	 * This flag must be zero for a QP1 send.
82109 	 */
82110 	#define SQ_RAWQP1SEND_V3_FLAGS_SE			UINT32_C(0x8)
82111 	/*
82112 	 * Indicate that inline data is posted to the SQ in the data
82113 	 * area of this WQE.
82114 	 */
82115 	#define SQ_RAWQP1SEND_V3_FLAGS_INLINE		UINT32_C(0x10)
82116 	/*
82117 	 * If set to 1, then the timestamp from the WQE is used. If
82118 	 * cleared to 0, then TWE provides the timestamp.
82119 	 */
82120 	#define SQ_RAWQP1SEND_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
82121 	/*
82122 	 * When set to '1', this operation will cause a trace capture in
82123 	 * each block it passes through.
82124 	 */
82125 	#define SQ_RAWQP1SEND_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
82126 	/*  */
82127 	uint8_t	wqe_size;
82128 	/*
82129 	 * The number of 16 bytes chunks of data including this first
82130 	 * word of the request that are a valid part of the request. The
82131 	 * valid 16 bytes units other than the WQE structure can be
82132 	 * SGEs (Scatter Gather Elements) OR inline data.
82133 	 *
82134 	 * This field shall never exceed 32 for WQEs of this type.
82135 	 */
82136 	#define SQ_RAWQP1SEND_V3_WQE_SIZE_MASK UINT32_C(0x3f)
82137 	#define SQ_RAWQP1SEND_V3_WQE_SIZE_SFT 0
82138 	uint8_t	inline_length;
82139 	/*
82140 	 * When inline flag is '1', this field determines the number of
82141 	 * bytes that are valid in the last 16B unit of the inline WQE.
82142 	 * Zero means all 16 bytes are valid. One means only bits 7:0 of
82143 	 * the last 16B unit are valid. This means the total size of the
82144 	 * inline data is determined by a combination of the wqe_size field
82145 	 * and this inline_length field.
82146 	 *
82147 	 * `inline_size = ((wqe_size - 1) * 16) - data_offset_in_bytes +
82148 	 * ((inline_length == 0 ) ? 16 : inline_length)
82149 	 *
82150 	 * Where data_offset_in_bytes is the offset within the WQE where
82151 	 * the data field starts.
82152 	 *
82153 	 * Note that this field is not applicable for zero-length inline
82154 	 * WQEs.
82155 	 */
82156 	#define SQ_RAWQP1SEND_V3_INLINE_LENGTH_MASK UINT32_C(0xf)
82157 	#define SQ_RAWQP1SEND_V3_INLINE_LENGTH_SFT 0
82158 	/*
82159 	 * This value will be returned in the completion if the completion is
82160 	 * signaled.
82161 	 */
82162 	uint32_t	opaque;
82163 	/*
82164 	 * All bits in this field must be valid on the first BD of a packet.
82165 	 * Their value on other BDs of the packet will be ignored.
82166 	 */
82167 	uint16_t	lflags;
82168 	/*
82169 	 * If set to 1, the controller replaces the TCP/UPD checksum
82170 	 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
82171 	 * checksum field of the encapsulated TCP/UDP packets with the
82172 	 * hardware calculated TCP/UDP checksum for the packet associated
82173 	 * with this descriptor.
82174 	 *
82175 	 * This bit must be valid on the first BD of a packet.
82176 	 */
82177 	#define SQ_RAWQP1SEND_V3_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
82178 	/*
82179 	 * If set to 1, the controller replaces the IP checksum of the
82180 	 * normal packets, or the inner IP checksum of the encapsulated
82181 	 * packets with the hardware calculated IP checksum for the
82182 	 * packet associated with this descriptor.
82183 	 *
82184 	 * This bit must be valid on the first BD of a packet.
82185 	 */
82186 	#define SQ_RAWQP1SEND_V3_LFLAGS_IP_CHKSUM	UINT32_C(0x2)
82187 	/*
82188 	 * If set to 1, the controller will not append an Ethernet CRC
82189 	 * to the end of the frame.
82190 	 *
82191 	 * This bit must be valid on the first BD of a packet.
82192 	 *
82193 	 * Packet must be 64B or longer when this flag is set. It is not
82194 	 * useful to use this bit with any form of TX offload such as
82195 	 * CSO or LSO. The intent is that the packet from the host already
82196 	 * has a valid Ethernet CRC on the packet.
82197 	 */
82198 	#define SQ_RAWQP1SEND_V3_LFLAGS_NOCRC		UINT32_C(0x4)
82199 	/*
82200 	 * If set to 1, The controller replaces the tunnel IP checksum
82201 	 * field with hardware calculated IP checksum for the IP header
82202 	 * of the packet associated with this descriptor. In case of
82203 	 * VXLAN, the controller also replaces the outer header UDP
82204 	 * checksum with hardware calculated UDP checksum for the packet
82205 	 * associated with this descriptor.
82206 	 */
82207 	#define SQ_RAWQP1SEND_V3_LFLAGS_T_IP_CHKSUM	UINT32_C(0x10)
82208 	/*
82209 	 * If set to 1, The controller replaces the Outer-tunnel IP
82210 	 * checksum field with hardware calculated IP checksum for the IP
82211 	 * header of the packet associated with this descriptor.
82212 	 *
82213 	 * For outer UDP checksum, it will be the following behavior for
82214 	 * all cases independent of settings of inner LSO and checksum
82215 	 * offload BD flags:
82216 	 *
82217 	 * - If outer UDP checksum is 0, then do not update it.
82218 	 * - If outer UDP checksum is non zero, then the hardware should
82219 	 *   compute and update it.
82220 	 */
82221 	#define SQ_RAWQP1SEND_V3_LFLAGS_OT_IP_CHKSUM	UINT32_C(0x20)
82222 	/*
82223 	 * If set to '1', then the RoCE ICRC will be appended to the
82224 	 * packet. Packet must be a valid RoCE format packet.
82225 	 */
82226 	#define SQ_RAWQP1SEND_V3_LFLAGS_ROCE_CRC	UINT32_C(0x100)
82227 	/*
82228 	 * If set to '1', then the FCoE CRC will be appended to the
82229 	 * packet. Packet must be a valid FCoE format packet.
82230 	 */
82231 	#define SQ_RAWQP1SEND_V3_LFLAGS_FCOE_CRC	UINT32_C(0x200)
82232 	/*
82233 	 * This value selects a CFA action to perform on the packet.
82234 	 * Set this value to zero if no CFA action is desired.
82235 	 *
82236 	 * This value must be valid on the first BD of a packet.
82237 	 */
82238 	uint16_t	cfa_action;
82239 	/*
82240 	 * This value selects a CFA action to perform on the packet.
82241 	 * Set this value to zero if no CFA action is desired.
82242 	 *
82243 	 * This value must be valid on the first BD of a packet.
82244 	 */
82245 	uint16_t	cfa_action_high;
82246 	/*
82247 	 * This value selects bits 25:16 of the CFA action to perform on
82248 	 * the packet. See the cfa_action field for more information.
82249 	 */
82250 	#define SQ_RAWQP1SEND_V3_CFA_ACTION_HIGH_MASK UINT32_C(0x3ff)
82251 	#define SQ_RAWQP1SEND_V3_CFA_ACTION_HIGH_SFT 0
82252 	uint16_t	reserved_2;
82253 	/*
82254 	 * This value is action meta-data that defines CFA edit operations
82255 	 * that are done in addition to any action editing.
82256 	 */
82257 	uint32_t	cfa_meta;
82258 	/* When key=1, This is the VLAN tag VID value. */
82259 	#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
82260 	#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_VID_SFT	0
82261 	/* When key=1, This is the VLAN tag DE value. */
82262 	#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_DE	UINT32_C(0x1000)
82263 	/* When key=1, This is the VLAN tag PRI value. */
82264 	#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
82265 	#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_PRI_SFT	13
82266 	/* When key=1, This is the VLAN tag TPID select value. */
82267 	#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
82268 	#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_TPID_SFT	16
82269 	/* 0x88a8 */
82270 		#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_TPID_TPID88A8  (UINT32_C(0x0) << 16)
82271 	/* 0x8100 */
82272 		#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_TPID_TPID8100  (UINT32_C(0x1) << 16)
82273 	/* 0x9100 */
82274 		#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_TPID_TPID9100  (UINT32_C(0x2) << 16)
82275 	/* 0x9200 */
82276 		#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_TPID_TPID9200  (UINT32_C(0x3) << 16)
82277 	/* 0x9300 */
82278 		#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_TPID_TPID9300  (UINT32_C(0x4) << 16)
82279 	/* Value programmed in CFA VLANTPID register. */
82280 		#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_TPID_TPIDCFG   (UINT32_C(0x5) << 16)
82281 		#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_TPID_LAST	SQ_RAWQP1SEND_V3_CFA_META_VLAN_TPID_TPIDCFG
82282 	/* When key=1, This is the VLAN tag TPID select value. */
82283 	#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
82284 	#define SQ_RAWQP1SEND_V3_CFA_META_VLAN_RESERVED_SFT 19
82285 	/*
82286 	 * This field identifies the type of edit to be performed
82287 	 * on the packet.
82288 	 *
82289 	 * This value must be valid on the first BD of a packet.
82290 	 */
82291 	#define SQ_RAWQP1SEND_V3_CFA_META_KEY_MASK	UINT32_C(0xf0000000)
82292 	#define SQ_RAWQP1SEND_V3_CFA_META_KEY_SFT	28
82293 	/* No editing */
82294 		#define SQ_RAWQP1SEND_V3_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
82295 	/*
82296 	 * - meta[17:16] - TPID select value (0 = 0x8100).
82297 	 * - meta[15:12] - PRI/DE value.
82298 	 * - meta[11:0] - VID value.
82299 	 */
82300 		#define SQ_RAWQP1SEND_V3_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
82301 		#define SQ_RAWQP1SEND_V3_CFA_META_KEY_LAST	SQ_RAWQP1SEND_V3_CFA_META_KEY_VLAN_TAG
82302 	uint32_t	timestamp;
82303 	/*
82304 	 * This field specifies a 24-bit timestamp that can be passed
82305 	 * down the TX path and optionally logged in the TXP timestamp
82306 	 * histogram.
82307 	 */
82308 	#define SQ_RAWQP1SEND_V3_TIMESTAMP_MASK UINT32_C(0xffffff)
82309 	#define SQ_RAWQP1SEND_V3_TIMESTAMP_SFT 0
82310 	uint64_t	reserved_3;
82311 	/*
82312 	 * When inline=0, then this area is filled with from 1 to 6 SGEs
82313 	 * based on the wqe_size field.
82314 	 *
82315 	 * When inline=1, this area is filled with payload data for the
82316 	 * send. Length of data is described in the inline_length field.
82317 	 * Bits [7:0] of word 0 hold the first byte to go out on the wire.
82318 	 */
82319 	uint32_t	data[24];
82320 } sq_rawqp1send_v3_t, *psq_rawqp1send_v3_t;
82321 
82322 /* SQ WQE V3 structure for Raw Ethernet and QP1 SQs. */
82323 /* sq_rawqp1send_hdr_v3 (size:256b/32B) */
82324 
82325 typedef struct sq_rawqp1send_hdr_v3 {
82326 	/* This field defines the type of SQ WQE. */
82327 	uint8_t	wqe_type;
82328 	/* RawEth/QP1 Send V3 */
82329 	#define SQ_RAWQP1SEND_HDR_V3_WQE_TYPE_RAWQP1SEND_V3 UINT32_C(0x1d)
82330 	#define SQ_RAWQP1SEND_HDR_V3_WQE_TYPE_LAST	SQ_RAWQP1SEND_HDR_V3_WQE_TYPE_RAWQP1SEND_V3
82331 	uint8_t	flags;
82332 	/*
82333 	 * Set if completion signaling is requested. If this bit is
82334 	 * 0, and the SQ is configured to support Unsignaled completion
82335 	 * the controller should not generate a CQE unless there was
82336 	 * an error. This refers to the CQE on the sender side. (The se
82337 	 * flag refers to the receiver side).
82338 	 */
82339 	#define SQ_RAWQP1SEND_HDR_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
82340 	/*
82341 	 * Indication to complete all previous RDMA Read or Atomic WQEs
82342 	 * on the SQ before executing this WQE.
82343 	 *
82344 	 * This flag must be zero for a QP1 send.
82345 	 */
82346 	#define SQ_RAWQP1SEND_HDR_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
82347 	/*
82348 	 * Unconditional fence. Indication to complete all
82349 	 * previous SQ's WQEs before executing this WQE.
82350 	 *
82351 	 * This flag must be zero for a QP1 send.
82352 	 */
82353 	#define SQ_RAWQP1SEND_HDR_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
82354 	/*
82355 	 * Solicit event flag. Indication sent in BTH header to the
82356 	 * receiver to generate a Completion Event Notification, i.e.
82357 	 * CNQE.
82358 	 *
82359 	 * This flag must be zero for a QP1 send.
82360 	 */
82361 	#define SQ_RAWQP1SEND_HDR_V3_FLAGS_SE			UINT32_C(0x8)
82362 	/*
82363 	 * Indicate that inline data is posted to the SQ in the data
82364 	 * area of this WQE.
82365 	 */
82366 	#define SQ_RAWQP1SEND_HDR_V3_FLAGS_INLINE		UINT32_C(0x10)
82367 	/*
82368 	 * If set to 1, then the timestamp from the WQE is used. If
82369 	 * cleared to 0, then TWE provides the timestamp.
82370 	 */
82371 	#define SQ_RAWQP1SEND_HDR_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
82372 	/*
82373 	 * When set to '1', this operation will cause a trace capture in
82374 	 * each block it passes through.
82375 	 */
82376 	#define SQ_RAWQP1SEND_HDR_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
82377 	/*  */
82378 	uint8_t	wqe_size;
82379 	/*
82380 	 * The number of 16 bytes chunks of data including this first
82381 	 * word of the request that are a valid part of the request. The
82382 	 * valid 16 bytes units other than the WQE structure can be
82383 	 * SGEs (Scatter Gather Elements) OR inline data.
82384 	 *
82385 	 * This field shall never exceed 32 for WQEs of this type.
82386 	 */
82387 	#define SQ_RAWQP1SEND_HDR_V3_WQE_SIZE_MASK UINT32_C(0x3f)
82388 	#define SQ_RAWQP1SEND_HDR_V3_WQE_SIZE_SFT 0
82389 	uint8_t	inline_length;
82390 	/*
82391 	 * When inline flag is '1', this field determines the number of
82392 	 * bytes that are valid in the last 16B unit of the inline WQE.
82393 	 * Zero means all 16 bytes are valid. One means only bits 7:0 of
82394 	 * the last 16B unit are valid. This means the total size of the
82395 	 * inline data is determined by a combination of the wqe_size field
82396 	 * and this inline_length field.
82397 	 *
82398 	 * `inline_size = ((wqe_size - 1) * 16) - data_offset_in_bytes +
82399 	 * ((inline_length == 0 ) ? 16 : inline_length)
82400 	 *
82401 	 * Where data_offset_in_bytes is the offset within the WQE where
82402 	 * the data field starts.
82403 	 *
82404 	 * Note that this field is not applicable for zero-length inline
82405 	 * WQEs.
82406 	 */
82407 	#define SQ_RAWQP1SEND_HDR_V3_INLINE_LENGTH_MASK UINT32_C(0xf)
82408 	#define SQ_RAWQP1SEND_HDR_V3_INLINE_LENGTH_SFT 0
82409 	/*
82410 	 * This value will be returned in the completion if the completion is
82411 	 * signaled.
82412 	 */
82413 	uint32_t	opaque;
82414 	/*
82415 	 * All bits in this field must be valid on the first BD of a packet.
82416 	 * Their value on other BDs of the packet will be ignored.
82417 	 */
82418 	uint16_t	lflags;
82419 	/*
82420 	 * If set to 1, the controller replaces the TCP/UPD checksum
82421 	 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
82422 	 * checksum field of the encapsulated TCP/UDP packets with the
82423 	 * hardware calculated TCP/UDP checksum for the packet associated
82424 	 * with this descriptor.
82425 	 *
82426 	 * This bit must be valid on the first BD of a packet.
82427 	 */
82428 	#define SQ_RAWQP1SEND_HDR_V3_LFLAGS_TCP_UDP_CHKSUM	UINT32_C(0x1)
82429 	/*
82430 	 * If set to 1, the controller replaces the IP checksum of the
82431 	 * normal packets, or the inner IP checksum of the encapsulated
82432 	 * packets with the hardware calculated IP checksum for the
82433 	 * packet associated with this descriptor.
82434 	 *
82435 	 * This bit must be valid on the first BD of a packet.
82436 	 */
82437 	#define SQ_RAWQP1SEND_HDR_V3_LFLAGS_IP_CHKSUM	UINT32_C(0x2)
82438 	/*
82439 	 * If set to 1, the controller will not append an Ethernet CRC
82440 	 * to the end of the frame.
82441 	 *
82442 	 * This bit must be valid on the first BD of a packet.
82443 	 *
82444 	 * Packet must be 64B or longer when this flag is set. It is not
82445 	 * useful to use this bit with any form of TX offload such as
82446 	 * CSO or LSO. The intent is that the packet from the host already
82447 	 * has a valid Ethernet CRC on the packet.
82448 	 */
82449 	#define SQ_RAWQP1SEND_HDR_V3_LFLAGS_NOCRC		UINT32_C(0x4)
82450 	/*
82451 	 * If set to 1, The controller replaces the tunnel IP checksum
82452 	 * field with hardware calculated IP checksum for the IP header
82453 	 * of the packet associated with this descriptor. In case of
82454 	 * VXLAN, the controller also replaces the outer header UDP
82455 	 * checksum with hardware calculated UDP checksum for the packet
82456 	 * associated with this descriptor.
82457 	 */
82458 	#define SQ_RAWQP1SEND_HDR_V3_LFLAGS_T_IP_CHKSUM	UINT32_C(0x10)
82459 	/*
82460 	 * If set to 1, The controller replaces the Outer-tunnel IP
82461 	 * checksum field with hardware calculated IP checksum for the IP
82462 	 * header of the packet associated with this descriptor.
82463 	 *
82464 	 * For outer UDP checksum, it will be the following behavior for
82465 	 * all cases independent of settings of inner LSO and checksum
82466 	 * offload BD flags:
82467 	 *
82468 	 * - If outer UDP checksum is 0, then do not update it.
82469 	 * - If outer UDP checksum is non zero, then the hardware should
82470 	 *   compute and update it.
82471 	 */
82472 	#define SQ_RAWQP1SEND_HDR_V3_LFLAGS_OT_IP_CHKSUM	UINT32_C(0x20)
82473 	/*
82474 	 * If set to '1', then the RoCE ICRC will be appended to the
82475 	 * packet. Packet must be a valid RoCE format packet.
82476 	 */
82477 	#define SQ_RAWQP1SEND_HDR_V3_LFLAGS_ROCE_CRC	UINT32_C(0x100)
82478 	/*
82479 	 * If set to '1', then the FCoE CRC will be appended to the
82480 	 * packet. Packet must be a valid FCoE format packet.
82481 	 */
82482 	#define SQ_RAWQP1SEND_HDR_V3_LFLAGS_FCOE_CRC	UINT32_C(0x200)
82483 	/*
82484 	 * This value selects a CFA action to perform on the packet.
82485 	 * Set this value to zero if no CFA action is desired.
82486 	 *
82487 	 * This value must be valid on the first BD of a packet.
82488 	 */
82489 	uint16_t	cfa_action;
82490 	/*
82491 	 * This value selects a CFA action to perform on the packet.
82492 	 * Set this value to zero if no CFA action is desired.
82493 	 *
82494 	 * This value must be valid on the first BD of a packet.
82495 	 */
82496 	uint16_t	cfa_action_high;
82497 	/*
82498 	 * This value selects bits 25:16 of the CFA action to perform on
82499 	 * the packet. See the cfa_action field for more information.
82500 	 */
82501 	#define SQ_RAWQP1SEND_HDR_V3_CFA_ACTION_HIGH_MASK UINT32_C(0x3ff)
82502 	#define SQ_RAWQP1SEND_HDR_V3_CFA_ACTION_HIGH_SFT 0
82503 	uint16_t	reserved_2;
82504 	/*
82505 	 * This value is action meta-data that defines CFA edit operations
82506 	 * that are done in addition to any action editing.
82507 	 */
82508 	uint32_t	cfa_meta;
82509 	/* When key=1, This is the VLAN tag VID value. */
82510 	#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_VID_MASK	UINT32_C(0xfff)
82511 	#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_VID_SFT	0
82512 	/* When key=1, This is the VLAN tag DE value. */
82513 	#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_DE	UINT32_C(0x1000)
82514 	/* When key=1, This is the VLAN tag PRI value. */
82515 	#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_PRI_MASK	UINT32_C(0xe000)
82516 	#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_PRI_SFT	13
82517 	/* When key=1, This is the VLAN tag TPID select value. */
82518 	#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_TPID_MASK	UINT32_C(0x70000)
82519 	#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_TPID_SFT	16
82520 	/* 0x88a8 */
82521 		#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_TPID_TPID88A8  (UINT32_C(0x0) << 16)
82522 	/* 0x8100 */
82523 		#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_TPID_TPID8100  (UINT32_C(0x1) << 16)
82524 	/* 0x9100 */
82525 		#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_TPID_TPID9100  (UINT32_C(0x2) << 16)
82526 	/* 0x9200 */
82527 		#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_TPID_TPID9200  (UINT32_C(0x3) << 16)
82528 	/* 0x9300 */
82529 		#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_TPID_TPID9300  (UINT32_C(0x4) << 16)
82530 	/* Value programmed in CFA VLANTPID register. */
82531 		#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_TPID_TPIDCFG   (UINT32_C(0x5) << 16)
82532 		#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_TPID_LAST	SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_TPID_TPIDCFG
82533 	/* When key=1, This is the VLAN tag TPID select value. */
82534 	#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
82535 	#define SQ_RAWQP1SEND_HDR_V3_CFA_META_VLAN_RESERVED_SFT 19
82536 	/*
82537 	 * This field identifies the type of edit to be performed
82538 	 * on the packet.
82539 	 *
82540 	 * This value must be valid on the first BD of a packet.
82541 	 */
82542 	#define SQ_RAWQP1SEND_HDR_V3_CFA_META_KEY_MASK	UINT32_C(0xf0000000)
82543 	#define SQ_RAWQP1SEND_HDR_V3_CFA_META_KEY_SFT	28
82544 	/* No editing */
82545 		#define SQ_RAWQP1SEND_HDR_V3_CFA_META_KEY_NONE		(UINT32_C(0x0) << 28)
82546 	/*
82547 	 * - meta[17:16] - TPID select value (0 = 0x8100).
82548 	 * - meta[15:12] - PRI/DE value.
82549 	 * - meta[11:0] - VID value.
82550 	 */
82551 		#define SQ_RAWQP1SEND_HDR_V3_CFA_META_KEY_VLAN_TAG	(UINT32_C(0x1) << 28)
82552 		#define SQ_RAWQP1SEND_HDR_V3_CFA_META_KEY_LAST	SQ_RAWQP1SEND_HDR_V3_CFA_META_KEY_VLAN_TAG
82553 	uint32_t	timestamp;
82554 	/*
82555 	 * This field specifies a 24-bit timestamp that can be passed
82556 	 * down the TX path and optionally logged in the TXP timestamp
82557 	 * histogram.
82558 	 */
82559 	#define SQ_RAWQP1SEND_HDR_V3_TIMESTAMP_MASK UINT32_C(0xffffff)
82560 	#define SQ_RAWQP1SEND_HDR_V3_TIMESTAMP_SFT 0
82561 	uint64_t	reserved_3;
82562 } sq_rawqp1send_hdr_v3_t, *psq_rawqp1send_hdr_v3_t;
82563 
82564 /* SQ Send WQE V3 for UD SQs. */
82565 /* sq_udsend_v3 (size:1024b/128B) */
82566 
82567 typedef struct sq_udsend_v3 {
82568 	/* This field defines the type of SQ WQE. */
82569 	uint8_t	wqe_type;
82570 	/*
82571 	 * UD Send V3
82572 	 *
82573 	 * Allowed only on unreliable datagram (UD) SQs.
82574 	 */
82575 	#define SQ_UDSEND_V3_WQE_TYPE_UDSEND_V3	UINT32_C(0x13)
82576 	/*
82577 	 * UD Send with Immediate V3
82578 	 *
82579 	 * Allowed only on unreliable datagram (UD) SQs.
82580 	 */
82581 	#define SQ_UDSEND_V3_WQE_TYPE_UDSEND_W_IMMED_V3 UINT32_C(0x14)
82582 	#define SQ_UDSEND_V3_WQE_TYPE_LAST		SQ_UDSEND_V3_WQE_TYPE_UDSEND_W_IMMED_V3
82583 	uint8_t	flags;
82584 	/*
82585 	 * Set if completion signaling is requested. If this bit is
82586 	 * 0, and the SQ is configured to support Unsignaled completion
82587 	 * the controller should not generate a CQE unless there was
82588 	 * an error. This refers to the CQE on the sender side. (The se
82589 	 * flag refers to the receiver side).
82590 	 */
82591 	#define SQ_UDSEND_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
82592 	/*
82593 	 * Indication to complete all previous RDMA Read or Atomic WQEs
82594 	 * on the SQ before executing this WQE.
82595 	 *
82596 	 * This flag must be zero for a UD send.
82597 	 */
82598 	#define SQ_UDSEND_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
82599 	/*
82600 	 * Unconditional fence. Indication to complete all
82601 	 * previous SQ's WQEs before executing this WQE.
82602 	 *
82603 	 * This flag must be zero for a UD send.
82604 	 */
82605 	#define SQ_UDSEND_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
82606 	/*
82607 	 * Solicit event flag. Indication sent in BTH header to the
82608 	 * receiver to generate a Completion Event Notification, i.e.
82609 	 * CNQE.
82610 	 */
82611 	#define SQ_UDSEND_V3_FLAGS_SE			UINT32_C(0x8)
82612 	/*
82613 	 * Indicate that inline data is posted to the SQ in the data
82614 	 * area of this WQE.
82615 	 */
82616 	#define SQ_UDSEND_V3_FLAGS_INLINE		UINT32_C(0x10)
82617 	/*
82618 	 * If set to 1, then the timestamp from the WQE is used. If
82619 	 * cleared to 0, then TWE provides the timestamp.
82620 	 */
82621 	#define SQ_UDSEND_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
82622 	/*
82623 	 * When set to '1', this operation will cause a trace capture in
82624 	 * each block it passes through.
82625 	 */
82626 	#define SQ_UDSEND_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
82627 	/*  */
82628 	uint8_t	wqe_size;
82629 	/*
82630 	 * The number of 16 bytes chunks of data including this first
82631 	 * word of the request that are a valid part of the request. The
82632 	 * valid 16 bytes units other than the WQE structure can be
82633 	 * SGEs (Scatter Gather Elements) OR inline data.
82634 	 *
82635 	 * This field shall never exceed 32 for WQEs of this type.
82636 	 */
82637 	#define SQ_UDSEND_V3_WQE_SIZE_MASK UINT32_C(0x3f)
82638 	#define SQ_UDSEND_V3_WQE_SIZE_SFT 0
82639 	uint8_t	inline_length;
82640 	/*
82641 	 * When inline flag is '1', this field determines the number of
82642 	 * bytes that are valid in the last 16B unit of the inline WQE.
82643 	 * Zero means all 16 bytes are valid. One means only bits 7:0 of
82644 	 * the last 16B unit are valid. This means the total size of the
82645 	 * inline data is determined by a combination of the wqe_size field
82646 	 * and this inline_length field.
82647 	 *
82648 	 * `inline_size = ((wqe_size - 1) * 16) - data_offset_in_bytes +
82649 	 * ((inline_length == 0 ) ? 16 : inline_length)
82650 	 *
82651 	 * Where data_offset_in_bytes is the offset within the WQE where
82652 	 * the data field starts.
82653 	 *
82654 	 * Note that this field is not applicable for zero-length inline
82655 	 * WQEs.
82656 	 */
82657 	#define SQ_UDSEND_V3_INLINE_LENGTH_MASK UINT32_C(0xf)
82658 	#define SQ_UDSEND_V3_INLINE_LENGTH_SFT 0
82659 	/*
82660 	 * This value will be returned in the completion if the completion is
82661 	 * signaled.
82662 	 */
82663 	uint32_t	opaque;
82664 	/*
82665 	 * Immediate value that will be sent with ImmDt header if wqe_type is
82666 	 * UD Send with Immediate.
82667 	 */
82668 	uint32_t	imm_data;
82669 	/*
82670 	 * When in the SQ of a UD QP, indicates the q_key to be used in
82671 	 * the transmitted packet. However, if the most significant bit
82672 	 * of this field is set, then the q_key will be taken from QP
82673 	 * context, rather than from this field.
82674 	 *
82675 	 * When in the SQ of a non-UD QP, this field is reserved and
82676 	 * should be filled with zeros.
82677 	 */
82678 	uint32_t	q_key;
82679 	/*
82680 	 * When in the SQ of a UD QP, indicates the destination QP to be
82681 	 * used in the transmitted packet.
82682 	 *
82683 	 * When in the SQ of a non-UD QP, this field is reserved and
82684 	 * should be filled with zeros.
82685 	 */
82686 	uint32_t	dst_qp;
82687 	#define SQ_UDSEND_V3_DST_QP_MASK UINT32_C(0xffffff)
82688 	#define SQ_UDSEND_V3_DST_QP_SFT 0
82689 	uint32_t	avid;
82690 	/*
82691 	 * If the serv_type is 'UD', then this field supplies the AVID
82692 	 * (Address Vector ID).
82693 	 */
82694 	#define SQ_UDSEND_V3_AVID_MASK UINT32_C(0x3ff)
82695 	#define SQ_UDSEND_V3_AVID_SFT 0
82696 	uint32_t	reserved2;
82697 	uint32_t	timestamp;
82698 	/*
82699 	 * This field specifies a 24-bit timestamp that can be passed
82700 	 * down the TX path and optionally logged in the TXP timestamp
82701 	 * histogram.
82702 	 */
82703 	#define SQ_UDSEND_V3_TIMESTAMP_MASK UINT32_C(0xffffff)
82704 	#define SQ_UDSEND_V3_TIMESTAMP_SFT 0
82705 	/*
82706 	 * When inline=0, then this area is filled with from 1 to 30 SGEs
82707 	 * based on the wqe_size field.
82708 	 *
82709 	 * When inline=1, this area is filled with payload data for the
82710 	 * send. Length of data is described in the inline_length field.
82711 	 * Bits [7:0] of word 0 hold the first byte to go out on the wire.
82712 	 */
82713 	uint32_t	data[24];
82714 } sq_udsend_v3_t, *psq_udsend_v3_t;
82715 
82716 /* SQ WQE V3 header for UD SQs. */
82717 /* sq_udsend_hdr_v3 (size:256b/32B) */
82718 
82719 typedef struct sq_udsend_hdr_v3 {
82720 	/* This field defines the type of SQ WQE. */
82721 	uint8_t	wqe_type;
82722 	/*
82723 	 * UD Send V3
82724 	 *
82725 	 * Allowed only on unreliable datagram (UD) SQs.
82726 	 */
82727 	#define SQ_UDSEND_HDR_V3_WQE_TYPE_UDSEND_V3	UINT32_C(0x13)
82728 	/*
82729 	 * UD Send with Immediate V3
82730 	 *
82731 	 * Allowed only on unreliable datagram (UD) SQs.
82732 	 */
82733 	#define SQ_UDSEND_HDR_V3_WQE_TYPE_UDSEND_W_IMMED_V3 UINT32_C(0x14)
82734 	#define SQ_UDSEND_HDR_V3_WQE_TYPE_LAST		SQ_UDSEND_HDR_V3_WQE_TYPE_UDSEND_W_IMMED_V3
82735 	uint8_t	flags;
82736 	/*
82737 	 * Set if completion signaling is requested. If this bit is
82738 	 * 0, and the SQ is configured to support Unsignaled completion
82739 	 * the controller should not generate a CQE unless there was
82740 	 * an error. This refers to the CQE on the sender side. (The se
82741 	 * flag refers to the receiver side).
82742 	 */
82743 	#define SQ_UDSEND_HDR_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
82744 	/*
82745 	 * Indication to complete all previous RDMA Read or Atomic WQEs
82746 	 * on the SQ before executing this WQE.
82747 	 *
82748 	 * This flag must be zero for a UD send.
82749 	 */
82750 	#define SQ_UDSEND_HDR_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
82751 	/*
82752 	 * Unconditional fence. Indication to complete all
82753 	 * previous SQ's WQEs before executing this WQE.
82754 	 *
82755 	 * This flag must be zero for a UD send.
82756 	 */
82757 	#define SQ_UDSEND_HDR_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
82758 	/*
82759 	 * Solicit event flag. Indication sent in BTH header to the
82760 	 * receiver to generate a Completion Event Notification, i.e.
82761 	 * CNQE.
82762 	 */
82763 	#define SQ_UDSEND_HDR_V3_FLAGS_SE			UINT32_C(0x8)
82764 	/*
82765 	 * Indicate that inline data is posted to the SQ in the data
82766 	 * area of this WQE.
82767 	 */
82768 	#define SQ_UDSEND_HDR_V3_FLAGS_INLINE		UINT32_C(0x10)
82769 	/*
82770 	 * If set to 1, then the timestamp from the WQE is used. If
82771 	 * cleared to 0, then TWE provides the timestamp.
82772 	 */
82773 	#define SQ_UDSEND_HDR_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
82774 	/*
82775 	 * When set to '1', this operation will cause a trace capture in
82776 	 * each block it passes through.
82777 	 */
82778 	#define SQ_UDSEND_HDR_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
82779 	/*  */
82780 	uint8_t	wqe_size;
82781 	/*
82782 	 * The number of 16 bytes chunks of data including this first
82783 	 * word of the request that are a valid part of the request. The
82784 	 * valid 16 bytes units other than the WQE structure can be
82785 	 * SGEs (Scatter Gather Elements) OR inline data.
82786 	 *
82787 	 * This field shall never exceed 32 for WQEs of this type.
82788 	 */
82789 	#define SQ_UDSEND_HDR_V3_WQE_SIZE_MASK UINT32_C(0x3f)
82790 	#define SQ_UDSEND_HDR_V3_WQE_SIZE_SFT 0
82791 	uint8_t	inline_length;
82792 	/*
82793 	 * When inline flag is '1', this field determines the number of
82794 	 * bytes that are valid in the last 16B unit of the inline WQE.
82795 	 * Zero means all 16 bytes are valid. One means only bits 7:0 of
82796 	 * the last 16B unit are valid. This means the total size of the
82797 	 * inline data is determined by a combination of the wqe_size field
82798 	 * and this inline_length field.
82799 	 *
82800 	 * `inline_size = ((wqe_size - 1) * 16) - data_offset_in_bytes +
82801 	 * ((inline_length == 0 ) ? 16 : inline_length)
82802 	 *
82803 	 * Where data_offset_in_bytes is the offset within the WQE where
82804 	 * the data field starts.
82805 	 *
82806 	 * Note that this field is not applicable for zero-length inline
82807 	 * WQEs.
82808 	 */
82809 	#define SQ_UDSEND_HDR_V3_INLINE_LENGTH_MASK UINT32_C(0xf)
82810 	#define SQ_UDSEND_HDR_V3_INLINE_LENGTH_SFT 0
82811 	/*
82812 	 * This value will be returned in the completion if the completion is
82813 	 * signaled.
82814 	 */
82815 	uint32_t	opaque;
82816 	/*
82817 	 * Immediate value that will be sent with ImmDt header if wqe_type is
82818 	 * UD Send with Immediate.
82819 	 */
82820 	uint32_t	imm_data;
82821 	/*
82822 	 * When in the SQ of a UD QP, indicates the q_key to be used in
82823 	 * the transmitted packet. However, if the most significant bit
82824 	 * of this field is set, then the q_key will be taken from QP
82825 	 * context, rather than from this field.
82826 	 *
82827 	 * When in the SQ of a non-UD QP, this field is reserved and
82828 	 * should be filled with zeros.
82829 	 */
82830 	uint32_t	q_key;
82831 	/*
82832 	 * When in the SQ of a UD QP, indicates the destination QP to be
82833 	 * used in the transmitted packet.
82834 	 *
82835 	 * When in the SQ of a non-UD QP, this field is reserved and
82836 	 * should be filled with zeros.
82837 	 */
82838 	uint32_t	dst_qp;
82839 	#define SQ_UDSEND_HDR_V3_DST_QP_MASK UINT32_C(0xffffff)
82840 	#define SQ_UDSEND_HDR_V3_DST_QP_SFT 0
82841 	uint32_t	avid;
82842 	/*
82843 	 * If the serv_type is 'UD', then this field supplies the AVID
82844 	 * (Address Vector ID).
82845 	 */
82846 	#define SQ_UDSEND_HDR_V3_AVID_MASK UINT32_C(0x3ff)
82847 	#define SQ_UDSEND_HDR_V3_AVID_SFT 0
82848 	uint32_t	reserved2;
82849 	uint32_t	timestamp;
82850 	/*
82851 	 * This field specifies a 24-bit timestamp that can be passed
82852 	 * down the TX path and optionally logged in the TXP timestamp
82853 	 * histogram.
82854 	 */
82855 	#define SQ_UDSEND_HDR_V3_TIMESTAMP_MASK UINT32_C(0xffffff)
82856 	#define SQ_UDSEND_HDR_V3_TIMESTAMP_SFT 0
82857 } sq_udsend_hdr_v3_t, *psq_udsend_hdr_v3_t;
82858 
82859 /* SQ RDMA WQE V3 for RC SQs. */
82860 /* sq_rdma_v3 (size:1024b/128B) */
82861 
82862 typedef struct sq_rdma_v3 {
82863 	/* This field defines the type of SQ WQE. */
82864 	uint8_t	wqe_type;
82865 	/*
82866 	 * RDMA Write V3
82867 	 *
82868 	 * Allowed only on reliable connection (RC) SQs.
82869 	 */
82870 	#define SQ_RDMA_V3_WQE_TYPE_WRITE_WQE_V3	UINT32_C(0x15)
82871 	/*
82872 	 * RDMA Write with Immediate V3
82873 	 *
82874 	 * Allowed only on reliable connection (RC) SQs.
82875 	 */
82876 	#define SQ_RDMA_V3_WQE_TYPE_WRITE_W_IMMED_V3 UINT32_C(0x16)
82877 	/*
82878 	 * RDMA Read V3
82879 	 *
82880 	 * Allowed only on reliable connection (RC) SQs.
82881 	 */
82882 	#define SQ_RDMA_V3_WQE_TYPE_READ_WQE_V3	UINT32_C(0x17)
82883 	#define SQ_RDMA_V3_WQE_TYPE_LAST		SQ_RDMA_V3_WQE_TYPE_READ_WQE_V3
82884 	uint8_t	flags;
82885 	/*
82886 	 * Set if completion signaling is requested. If this bit is
82887 	 * 0, and the SQ is configured to support Unsignaled
82888 	 * completion the controller should not generate a CQE
82889 	 * unless there was an error. This refers to CQE on the
82890 	 * sender side (The se flag refers to the receiver side).
82891 	 */
82892 	#define SQ_RDMA_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
82893 	/*
82894 	 * Indication to complete all previous RDMA Read or Atomic
82895 	 * WQEs on the SQ before executing this WQE
82896 	 */
82897 	#define SQ_RDMA_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
82898 	/*
82899 	 * Unconditional fence. Indication to complete all previous
82900 	 * SQ's WQEs before executing this WQE.
82901 	 */
82902 	#define SQ_RDMA_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
82903 	/*
82904 	 * Solicit event. Indication sent in BTH header to the
82905 	 * receiver to generate a Completion Event Notification,
82906 	 * i.e. CNQE.
82907 	 */
82908 	#define SQ_RDMA_V3_FLAGS_SE			UINT32_C(0x8)
82909 	/*
82910 	 * Indicate that inline data is posted to the SQ following
82911 	 * this WQE. This bit may be 1 only for write operations.
82912 	 */
82913 	#define SQ_RDMA_V3_FLAGS_INLINE		UINT32_C(0x10)
82914 	/*
82915 	 * If set to 1, then the timestamp from the WQE is used. If
82916 	 * cleared to 0, then TWE provides the timestamp.
82917 	 */
82918 	#define SQ_RDMA_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
82919 	/*
82920 	 * When set to '1', this operation will cause a trace capture in
82921 	 * each block it passes through.
82922 	 */
82923 	#define SQ_RDMA_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
82924 	/*  */
82925 	uint8_t	wqe_size;
82926 	/*
82927 	 * The number of 16 bytes chunks of data including this first
82928 	 * word of the request that are a valid part of the request. The
82929 	 * valid 16 bytes units other than the WQE structure can be
82930 	 * SGEs (Scatter Gather Elements) OR inline data.
82931 	 *
82932 	 * This field shall never exceed 32 for WQEs of this type.
82933 	 */
82934 	#define SQ_RDMA_V3_WQE_SIZE_MASK UINT32_C(0x3f)
82935 	#define SQ_RDMA_V3_WQE_SIZE_SFT 0
82936 	uint8_t	inline_length;
82937 	/*
82938 	 * When inline flag is '1', this field determines the number of
82939 	 * bytes that are valid in the last 16B unit of the inline WQE.
82940 	 * Zero means all 16 bytes are valid. One means only bits 7:0 of
82941 	 * the last 16B unit are valid. This means the total size of the
82942 	 * inline data is determined by a combination of the wqe_size field
82943 	 * and this inline_length field.
82944 	 *
82945 	 * `inline_size = ((wqe_size - 1) * 16) - data_offset_in_bytes +
82946 	 * ((inline_length == 0 ) ? 16 : inline_length)
82947 	 *
82948 	 * Where data_offset_in_bytes is the offset within the WQE where
82949 	 * the data field starts.
82950 	 *
82951 	 * Note that this field is not applicable for zero-length inline
82952 	 * WQEs.
82953 	 */
82954 	#define SQ_RDMA_V3_INLINE_LENGTH_MASK UINT32_C(0xf)
82955 	#define SQ_RDMA_V3_INLINE_LENGTH_SFT 0
82956 	/*
82957 	 * This value will be returned in the completion if the completion is
82958 	 * signaled.
82959 	 */
82960 	uint32_t	opaque;
82961 	/*
82962 	 * Immediate data - valid for RDMA Write with immediate and
82963 	 * causes the controller to add immDt header with this value
82964 	 */
82965 	uint32_t	imm_data;
82966 	uint32_t	reserved2;
82967 	/* Remote VA sent to the destination QP */
82968 	uint64_t	remote_va;
82969 	/*
82970 	 * R_Key provided by remote node when the connection was
82971 	 * established and placed in the RETH header. It identify the
82972 	 * MRW on the remote host
82973 	 */
82974 	uint32_t	remote_key;
82975 	uint32_t	timestamp;
82976 	/*
82977 	 * This field specifies a 24-bit timestamp that can be passed
82978 	 * down the TX path and optionally logged in the TXP timestamp
82979 	 * histogram.
82980 	 */
82981 	#define SQ_RDMA_V3_TIMESTAMP_MASK UINT32_C(0xffffff)
82982 	#define SQ_RDMA_V3_TIMESTAMP_SFT 0
82983 	/*
82984 	 * When inline=0, then this area is filled with from 1 to 30 SGEs
82985 	 * based on the wqe_size field.
82986 	 *
82987 	 * When inline=1, this area is filled with payload data for the send.
82988 	 * Length of data is described in the inline_length field. Bits [7:0]
82989 	 * of word 0 hold the first byte to go out on the wire.
82990 	 */
82991 	uint32_t	data[24];
82992 } sq_rdma_v3_t, *psq_rdma_v3_t;
82993 
82994 /* SQ RDMA WQE V3 header for RC SQs. */
82995 /* sq_rdma_hdr_v3 (size:256b/32B) */
82996 
82997 typedef struct sq_rdma_hdr_v3 {
82998 	/* This field defines the type of SQ WQE. */
82999 	uint8_t	wqe_type;
83000 	/*
83001 	 * RDMA Write V3
83002 	 *
83003 	 * Allowed only on reliable connection (RC) SQs.
83004 	 */
83005 	#define SQ_RDMA_HDR_V3_WQE_TYPE_WRITE_WQE_V3	UINT32_C(0x15)
83006 	/*
83007 	 * RDMA Write with Immediate V3
83008 	 *
83009 	 * Allowed only on reliable connection (RC) SQs.
83010 	 */
83011 	#define SQ_RDMA_HDR_V3_WQE_TYPE_WRITE_W_IMMED_V3 UINT32_C(0x16)
83012 	/*
83013 	 * RDMA Read V3
83014 	 *
83015 	 * Allowed only on reliable connection (RC) SQs.
83016 	 */
83017 	#define SQ_RDMA_HDR_V3_WQE_TYPE_READ_WQE_V3	UINT32_C(0x17)
83018 	#define SQ_RDMA_HDR_V3_WQE_TYPE_LAST		SQ_RDMA_HDR_V3_WQE_TYPE_READ_WQE_V3
83019 	uint8_t	flags;
83020 	/*
83021 	 * Set if completion signaling is requested. If this bit is
83022 	 * 0, and the SQ is configured to support Unsignaled
83023 	 * completion the controller should not generate a CQE
83024 	 * unless there was an error. This refers to CQE on the
83025 	 * sender side (The se flag refers to the receiver side).
83026 	 */
83027 	#define SQ_RDMA_HDR_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
83028 	/*
83029 	 * Indication to complete all previous RDMA Read or Atomic
83030 	 * WQEs on the SQ before executing this WQE
83031 	 */
83032 	#define SQ_RDMA_HDR_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
83033 	/*
83034 	 * Unconditional fence. Indication to complete all previous
83035 	 * SQ's WQEs before executing this WQE.
83036 	 */
83037 	#define SQ_RDMA_HDR_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
83038 	/*
83039 	 * Solicit event. Indication sent in BTH header to the
83040 	 * receiver to generate a Completion Event Notification,
83041 	 * i.e. CNQE.
83042 	 */
83043 	#define SQ_RDMA_HDR_V3_FLAGS_SE			UINT32_C(0x8)
83044 	/*
83045 	 * Indicate that inline data is posted to the SQ following
83046 	 * this WQE. This bit may be 1 only for write operations.
83047 	 */
83048 	#define SQ_RDMA_HDR_V3_FLAGS_INLINE		UINT32_C(0x10)
83049 	/*
83050 	 * If set to 1, then the timestamp from the WQE is used. If
83051 	 * cleared to 0, then TWE provides the timestamp.
83052 	 */
83053 	#define SQ_RDMA_HDR_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
83054 	/*
83055 	 * When set to '1', this operation will cause a trace capture in
83056 	 * each block it passes through.
83057 	 */
83058 	#define SQ_RDMA_HDR_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
83059 	/*  */
83060 	uint8_t	wqe_size;
83061 	/*
83062 	 * The number of 16 bytes chunks of data including this first
83063 	 * word of the request that are a valid part of the request. The
83064 	 * valid 16 bytes units other than the WQE structure can be
83065 	 * SGEs (Scatter Gather Elements) OR inline data.
83066 	 *
83067 	 * This field shall never exceed 32 for WQEs of this type.
83068 	 */
83069 	#define SQ_RDMA_HDR_V3_WQE_SIZE_MASK UINT32_C(0x3f)
83070 	#define SQ_RDMA_HDR_V3_WQE_SIZE_SFT 0
83071 	uint8_t	inline_length;
83072 	/*
83073 	 * When inline flag is '1', this field determines the number of
83074 	 * bytes that are valid in the last 16B unit of the inline WQE.
83075 	 * Zero means all 16 bytes are valid. One means only bits 7:0 of
83076 	 * the last 16B unit are valid. This means the total size of the
83077 	 * inline data is determined by a combination of the wqe_size field
83078 	 * and this inline_length field.
83079 	 *
83080 	 * `inline_size = ((wqe_size - 1) * 16) - data_offset_in_bytes +
83081 	 * ((inline_length == 0 ) ? 16 : inline_length)
83082 	 *
83083 	 * Where data_offset_in_bytes is the offset within the WQE where
83084 	 * the data field starts.
83085 	 *
83086 	 * Note that this field is not applicable for zero-length inline
83087 	 * WQEs.
83088 	 */
83089 	#define SQ_RDMA_HDR_V3_INLINE_LENGTH_MASK UINT32_C(0xf)
83090 	#define SQ_RDMA_HDR_V3_INLINE_LENGTH_SFT 0
83091 	/*
83092 	 * This value will be returned in the completion if the completion is
83093 	 * signaled.
83094 	 */
83095 	uint32_t	opaque;
83096 	/*
83097 	 * Immediate data - valid for RDMA Write with immediate and
83098 	 * causes the controller to add immDt header with this value
83099 	 */
83100 	uint32_t	imm_data;
83101 	uint32_t	reserved2;
83102 	/* Remote VA sent to the destination QP */
83103 	uint64_t	remote_va;
83104 	/*
83105 	 * R_Key provided by remote node when the connection was
83106 	 * established and placed in the RETH header. It identify the
83107 	 * MRW on the remote host
83108 	 */
83109 	uint32_t	remote_key;
83110 	uint32_t	timestamp;
83111 	/*
83112 	 * This field specifies a 24-bit timestamp that can be passed
83113 	 * down the TX path and optionally logged in the TXP timestamp
83114 	 * histogram.
83115 	 */
83116 	#define SQ_RDMA_HDR_V3_TIMESTAMP_MASK UINT32_C(0xffffff)
83117 	#define SQ_RDMA_HDR_V3_TIMESTAMP_SFT 0
83118 } sq_rdma_hdr_v3_t, *psq_rdma_hdr_v3_t;
83119 
83120 /* SQ Atomic V3 WQE for RC SQs. */
83121 /* sq_atomic_v3 (size:448b/56B) */
83122 
83123 typedef struct sq_atomic_v3 {
83124 	/* This field defines the type of SQ WQE. */
83125 	uint8_t	wqe_type;
83126 	/*
83127 	 * Atomic Compare/Swap V3
83128 	 *
83129 	 * Allowed only on reliable connection (RC) SQs.
83130 	 */
83131 	#define SQ_ATOMIC_V3_WQE_TYPE_ATOMIC_CS_V3 UINT32_C(0x18)
83132 	/*
83133 	 * Atomic Fetch/Add V3
83134 	 *
83135 	 * Allowed only on reliable connection (RC) SQs.
83136 	 */
83137 	#define SQ_ATOMIC_V3_WQE_TYPE_ATOMIC_FA_V3 UINT32_C(0x19)
83138 	#define SQ_ATOMIC_V3_WQE_TYPE_LAST	SQ_ATOMIC_V3_WQE_TYPE_ATOMIC_FA_V3
83139 	uint8_t	flags;
83140 	/*
83141 	 * Set if completion signaling is requested. If this bit is
83142 	 * 0, and the SQ is configured to support Unsignaled
83143 	 * completion the controller should not generate a CQE
83144 	 * unless there was an error. This refers to CQE on the
83145 	 * sender side (The se flag refers to the receiver side).
83146 	 */
83147 	#define SQ_ATOMIC_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
83148 	/*
83149 	 * Indication to complete all previous RDMA Read or Atomic
83150 	 * WQEs on the SQ before executing this WQE
83151 	 */
83152 	#define SQ_ATOMIC_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
83153 	/*
83154 	 * Unconditional fence. Indication to complete all previous
83155 	 * SQ's WQEs before executing this WQE.
83156 	 */
83157 	#define SQ_ATOMIC_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
83158 	/*
83159 	 * Solicit event. Indication sent in BTH header to the
83160 	 * receiver to generate a Completion Event Notification,
83161 	 * i.e. CNQE.
83162 	 */
83163 	#define SQ_ATOMIC_V3_FLAGS_SE			UINT32_C(0x8)
83164 	/* NA for this WQE */
83165 	#define SQ_ATOMIC_V3_FLAGS_INLINE		UINT32_C(0x10)
83166 	/*
83167 	 * The atomic WQE does not have a timestamp field, so this field is
83168 	 * ignored and should be zero.
83169 	 */
83170 	#define SQ_ATOMIC_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
83171 	/*
83172 	 * When set to '1', this operation will cause a trace capture in
83173 	 * each block it passes through.
83174 	 */
83175 	#define SQ_ATOMIC_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
83176 	/*  */
83177 	uint8_t	wqe_size;
83178 	/*
83179 	 * The size of the WQE in units of 16B chunks.
83180 	 *
83181 	 * For the Atomic WQE, this field will always have a value of 4.
83182 	 */
83183 	#define SQ_ATOMIC_V3_WQE_SIZE_MASK UINT32_C(0x3f)
83184 	#define SQ_ATOMIC_V3_WQE_SIZE_SFT 0
83185 	uint8_t	reserved1;
83186 	/*
83187 	 * This value will be returned in the completion if the completion is
83188 	 * signaled.
83189 	 */
83190 	uint32_t	opaque;
83191 	/*
83192 	 * R_Key provided by remote node when the connection was
83193 	 * established and placed in the AETH header. It identifies the
83194 	 * MRW on the remote host.
83195 	 */
83196 	uint32_t	remote_key;
83197 	uint32_t	reserved2;
83198 	/* Remote VA sent to the destination QP */
83199 	uint64_t	remote_va;
83200 	/*
83201 	 * For compare/swap, this is the data value to be placed in the
83202 	 * remote host at the specified remote_VA if the comparison succeeds.
83203 	 *
83204 	 * For fetch/add, this is the value to be added to the data in the
83205 	 * remote host at the specified remote_VA.
83206 	 */
83207 	uint64_t	swap_data;
83208 	/*
83209 	 * For compare/swap, this is the data value to be compared with the
83210 	 * value in the remote host at the specified remote_VA.
83211 	 *
83212 	 * This field is not used for fetch/add.
83213 	 */
83214 	uint64_t	cmp_data;
83215 	/*
83216 	 * The virtual address in local memory or a physical address when
83217 	 * l_key value is a reserved value of a physical address. Driver
83218 	 * configures this value in the chip and the chip compares l_key in
83219 	 * SGEs with that reserved value, if equal it access the physical
83220 	 * address specified. The chip however MUST verify that the QP allows
83221 	 * the use reserved key.
83222 	 */
83223 	uint64_t	va_or_pa;
83224 	/*
83225 	 * Local Key associated with this registered MR; The 24 msb of the
83226 	 * key used to index the MRW Table and the 8 lsb are compared with
83227 	 * the 8 bits key part stored in the MRWC. The PBL in the MRW Context
83228 	 * is used to translate the above VA to physical address.
83229 	 */
83230 	uint32_t	l_key;
83231 	/*
83232 	 * Size of SGE in bytes; Based on page size of the system the chip
83233 	 * knows how many entries are in the PBL
83234 	 *
83235 	 * This field must have a value of 8 for an Atomic WQE.
83236 	 */
83237 	uint32_t	size;
83238 } sq_atomic_v3_t, *psq_atomic_v3_t;
83239 
83240 /* SQ Atomic WQE V3 header for RC SQs. */
83241 /* sq_atomic_hdr_v3 (size:320b/40B) */
83242 
83243 typedef struct sq_atomic_hdr_v3 {
83244 	/* This field defines the type of SQ WQE. */
83245 	uint8_t	wqe_type;
83246 	/*
83247 	 * Atomic Compare/Swap V3
83248 	 *
83249 	 * Allowed only on reliable connection (RC) SQs.
83250 	 */
83251 	#define SQ_ATOMIC_HDR_V3_WQE_TYPE_ATOMIC_CS_V3 UINT32_C(0x18)
83252 	/*
83253 	 * Atomic Fetch/Add V3
83254 	 *
83255 	 * Allowed only on reliable connection (RC) SQs.
83256 	 */
83257 	#define SQ_ATOMIC_HDR_V3_WQE_TYPE_ATOMIC_FA_V3 UINT32_C(0x19)
83258 	#define SQ_ATOMIC_HDR_V3_WQE_TYPE_LAST	SQ_ATOMIC_HDR_V3_WQE_TYPE_ATOMIC_FA_V3
83259 	uint8_t	flags;
83260 	/*
83261 	 * Set if completion signaling is requested. If this bit is
83262 	 * 0, and the SQ is configured to support Unsignaled
83263 	 * completion the controller should not generate a CQE
83264 	 * unless there was an error. This refers to CQE on the
83265 	 * sender side (The se flag refers to the receiver side).
83266 	 */
83267 	#define SQ_ATOMIC_HDR_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
83268 	/*
83269 	 * Indication to complete all previous RDMA Read or Atomic
83270 	 * WQEs on the SQ before executing this WQE
83271 	 */
83272 	#define SQ_ATOMIC_HDR_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
83273 	/*
83274 	 * Unconditional fence. Indication to complete all previous
83275 	 * SQ's WQEs before executing this WQE.
83276 	 */
83277 	#define SQ_ATOMIC_HDR_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
83278 	/*
83279 	 * Solicit event. Indication sent in BTH header to the
83280 	 * receiver to generate a Completion Event Notification,
83281 	 * i.e. CNQE.
83282 	 */
83283 	#define SQ_ATOMIC_HDR_V3_FLAGS_SE			UINT32_C(0x8)
83284 	/* NA for this WQE */
83285 	#define SQ_ATOMIC_HDR_V3_FLAGS_INLINE		UINT32_C(0x10)
83286 	/*
83287 	 * The atomic WQE does not have a timestamp field, so this field is
83288 	 * ignored and should be zero.
83289 	 */
83290 	#define SQ_ATOMIC_HDR_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
83291 	/*
83292 	 * When set to '1', this operation will cause a trace capture in
83293 	 * each block it passes through.
83294 	 */
83295 	#define SQ_ATOMIC_HDR_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
83296 	/*  */
83297 	uint8_t	wqe_size;
83298 	/*
83299 	 * The size of the WQE in units of 16B chunks.
83300 	 *
83301 	 * For the Atomic WQE, this field will always have a value of 4.
83302 	 */
83303 	#define SQ_ATOMIC_HDR_V3_WQE_SIZE_MASK UINT32_C(0x3f)
83304 	#define SQ_ATOMIC_HDR_V3_WQE_SIZE_SFT 0
83305 	uint8_t	reserved1;
83306 	/*
83307 	 * This value will be returned in the completion if the completion is
83308 	 * signaled.
83309 	 */
83310 	uint32_t	opaque;
83311 	/*
83312 	 * R_Key provided by remote node when the connection was
83313 	 * established and placed in the AETH header. It identifies the
83314 	 * MRW on the remote host.
83315 	 */
83316 	uint32_t	remote_key;
83317 	uint32_t	reserved2;
83318 	/* Remote VA sent to the destination QP */
83319 	uint64_t	remote_va;
83320 	/*
83321 	 * For compare/swap, this is the data value to be placed in the
83322 	 * remote host at the specified remote_VA if the comparison succeeds.
83323 	 *
83324 	 * For fetch/add, this is the value to be added to the data in the
83325 	 * remote host at the specified remote_VA.
83326 	 */
83327 	uint64_t	swap_data;
83328 	/*
83329 	 * For compare/swap, this is the data value to be compared with the
83330 	 * value in the remote host at the specified remote_VA.
83331 	 *
83332 	 * This field is not used for fetch/add.
83333 	 */
83334 	uint64_t	cmp_data;
83335 } sq_atomic_hdr_v3_t, *psq_atomic_hdr_v3_t;
83336 
83337 /* SQ Local Invalidate WQE V3 for RC SQs. */
83338 /* sq_localinvalidate_v3 (size:128b/16B) */
83339 
83340 typedef struct sq_localinvalidate_v3 {
83341 	/* This field defines the type of SQ WQE. */
83342 	uint8_t	wqe_type;
83343 	/*
83344 	 * Local Invalidate V3
83345 	 *
83346 	 * Allowed only on reliable connection (RC) SQs.
83347 	 */
83348 	#define SQ_LOCALINVALIDATE_V3_WQE_TYPE_LOCAL_INVALID_V3 UINT32_C(0x1a)
83349 	#define SQ_LOCALINVALIDATE_V3_WQE_TYPE_LAST		SQ_LOCALINVALIDATE_V3_WQE_TYPE_LOCAL_INVALID_V3
83350 	uint8_t	flags;
83351 	/*
83352 	 * Set if completion signaling is requested. If this bit is
83353 	 * 0, and the SQ is configured to support Unsignaled
83354 	 * completion the controller should not generate a CQE
83355 	 * unless there was an error. This refers to CQE on the
83356 	 * sender side (The se flag refers to the receiver side).
83357 	 */
83358 	#define SQ_LOCALINVALIDATE_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
83359 	/*
83360 	 * Indication to complete all previous RDMA Read or Atomic
83361 	 * WQEs on the SQ before executing this WQE
83362 	 */
83363 	#define SQ_LOCALINVALIDATE_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
83364 	/*
83365 	 * Unconditional fence. Indication to complete all previous
83366 	 * SQ's WQEs before executing this WQE.
83367 	 */
83368 	#define SQ_LOCALINVALIDATE_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
83369 	/*
83370 	 * This flag is not applicable and should be 0 for a local memory
83371 	 * operation WQE.
83372 	 */
83373 	#define SQ_LOCALINVALIDATE_V3_FLAGS_SE			UINT32_C(0x8)
83374 	/*
83375 	 * This flag is not applicable and should be 0 for a local memory
83376 	 * operation WQE.
83377 	 */
83378 	#define SQ_LOCALINVALIDATE_V3_FLAGS_INLINE		UINT32_C(0x10)
83379 	/*
83380 	 * This flag is not applicable and should be 0 for a local memory
83381 	 * operation WQE.
83382 	 */
83383 	#define SQ_LOCALINVALIDATE_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
83384 	/*
83385 	 * When set to '1', this operation will cause a trace capture in
83386 	 * each block it passes through.
83387 	 */
83388 	#define SQ_LOCALINVALIDATE_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
83389 	/*  */
83390 	uint8_t	wqe_size;
83391 	/*
83392 	 * The size of the WQE in units of 16B chunks.
83393 	 *
83394 	 * For the Local Invalidate WQE, this field will always have
83395 	 * a value of 1.
83396 	 */
83397 	#define SQ_LOCALINVALIDATE_V3_WQE_SIZE_MASK UINT32_C(0x3f)
83398 	#define SQ_LOCALINVALIDATE_V3_WQE_SIZE_SFT 0
83399 	uint8_t	reserved1;
83400 	/*
83401 	 * This value will be returned in the completion if the completion is
83402 	 * signaled.
83403 	 */
83404 	uint32_t	opaque;
83405 	/*
83406 	 * The local key for the MR/W to invalidate; 24 msb of the key
83407 	 * are used to index the MRW table, 8 lsb are compared with the
83408 	 * 8 bit key in the MRWC
83409 	 */
83410 	uint32_t	inv_l_key;
83411 	uint32_t	reserved2;
83412 } sq_localinvalidate_v3_t, *psq_localinvalidate_v3_t;
83413 
83414 /* SQ Local Invalidate WQE V3 header for RC SQs. */
83415 /* sq_localinvalidate_hdr_v3 (size:128b/16B) */
83416 
83417 typedef struct sq_localinvalidate_hdr_v3 {
83418 	/* This field defines the type of SQ WQE. */
83419 	uint8_t	wqe_type;
83420 	/*
83421 	 * Local Invalidate V3
83422 	 *
83423 	 * Allowed only on reliable connection (RC) SQs.
83424 	 */
83425 	#define SQ_LOCALINVALIDATE_HDR_V3_WQE_TYPE_LOCAL_INVALID_V3 UINT32_C(0x1a)
83426 	#define SQ_LOCALINVALIDATE_HDR_V3_WQE_TYPE_LAST		SQ_LOCALINVALIDATE_HDR_V3_WQE_TYPE_LOCAL_INVALID_V3
83427 	uint8_t	flags;
83428 	/*
83429 	 * Set if completion signaling is requested. If this bit is
83430 	 * 0, and the SQ is configured to support Unsignaled
83431 	 * completion the controller should not generate a CQE
83432 	 * unless there was an error. This refers to CQE on the
83433 	 * sender side (The se flag refers to the receiver side).
83434 	 */
83435 	#define SQ_LOCALINVALIDATE_HDR_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
83436 	/*
83437 	 * Indication to complete all previous RDMA Read or Atomic
83438 	 * WQEs on the SQ before executing this WQE
83439 	 */
83440 	#define SQ_LOCALINVALIDATE_HDR_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
83441 	/*
83442 	 * Unconditional fence. Indication to complete all previous
83443 	 * SQ's WQEs before executing this WQE.
83444 	 */
83445 	#define SQ_LOCALINVALIDATE_HDR_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
83446 	/*
83447 	 * This flag is not applicable and should be 0 for a local memory
83448 	 * operation WQE.
83449 	 */
83450 	#define SQ_LOCALINVALIDATE_HDR_V3_FLAGS_SE			UINT32_C(0x8)
83451 	/*
83452 	 * This flag is not applicable and should be 0 for a local memory
83453 	 * operation WQE.
83454 	 */
83455 	#define SQ_LOCALINVALIDATE_HDR_V3_FLAGS_INLINE		UINT32_C(0x10)
83456 	/*
83457 	 * This flag is not applicable and should be 0 for a local memory
83458 	 * operation WQE.
83459 	 */
83460 	#define SQ_LOCALINVALIDATE_HDR_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
83461 	/*
83462 	 * When set to '1', this operation will cause a trace capture in
83463 	 * each block it passes through.
83464 	 */
83465 	#define SQ_LOCALINVALIDATE_HDR_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
83466 	/*  */
83467 	uint8_t	wqe_size;
83468 	/*
83469 	 * The size of the WQE in units of 16B chunks.
83470 	 *
83471 	 * For the Local Invalidate WQE, this field will always have
83472 	 * a value of 1.
83473 	 */
83474 	#define SQ_LOCALINVALIDATE_HDR_V3_WQE_SIZE_MASK UINT32_C(0x3f)
83475 	#define SQ_LOCALINVALIDATE_HDR_V3_WQE_SIZE_SFT 0
83476 	uint8_t	reserved1;
83477 	/*
83478 	 * This value will be returned in the completion if the completion is
83479 	 * signaled.
83480 	 */
83481 	uint32_t	opaque;
83482 	/*
83483 	 * The local key for the MR/W to invalidate; 24 msb of the key
83484 	 * are used to index the MRW table, 8 lsb are compared with the
83485 	 * 8 bit key in the MRWC
83486 	 */
83487 	uint32_t	inv_l_key;
83488 	uint32_t	reserved2;
83489 } sq_localinvalidate_hdr_v3_t, *psq_localinvalidate_hdr_v3_t;
83490 
83491 /*
83492  * SQ FR-PMR WQE V3 for RC SQs.
83493  *
83494  * The FR-PMR WQE must be padded to 3 slots (48 bytes) in the SQ, even
83495  * though the final 8 bytes are not shown here.
83496  */
83497 /* sq_fr_pmr_v3 (size:320b/40B) */
83498 
83499 typedef struct sq_fr_pmr_v3 {
83500 	/* This field defines the type of SQ WQE. */
83501 	uint8_t	wqe_type;
83502 	/*
83503 	 * FR-PMR (Fast Register Physical Memory Region) V3
83504 	 *
83505 	 * Allowed only on reliable connection (RC) SQs.
83506 	 */
83507 	#define SQ_FR_PMR_V3_WQE_TYPE_FR_PMR_V3 UINT32_C(0x1b)
83508 	#define SQ_FR_PMR_V3_WQE_TYPE_LAST	SQ_FR_PMR_V3_WQE_TYPE_FR_PMR_V3
83509 	uint8_t	flags;
83510 	/*
83511 	 * Set if completion signaling is requested. If this bit is
83512 	 * 0, and the SQ is configured to support Unsignaled
83513 	 * completion the controller should not generate a CQE
83514 	 * unless there was an error. This refers to CQE on the
83515 	 * sender side (The se flag refers to the receiver side).
83516 	 */
83517 	#define SQ_FR_PMR_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
83518 	/*
83519 	 * Indication to complete all previous RDMA Read or Atomic
83520 	 * WQEs on the SQ before executing this WQE
83521 	 */
83522 	#define SQ_FR_PMR_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
83523 	/*
83524 	 * Unconditional fence. Indication to complete all previous
83525 	 * SQ's WQEs before executing this WQE.
83526 	 */
83527 	#define SQ_FR_PMR_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
83528 	/*
83529 	 * This flag is not applicable and should be 0 for a local memory
83530 	 * operation WQE.
83531 	 */
83532 	#define SQ_FR_PMR_V3_FLAGS_SE			UINT32_C(0x8)
83533 	/*
83534 	 * This flag is not applicable and should be 0 for a local memory
83535 	 * operation WQE.
83536 	 */
83537 	#define SQ_FR_PMR_V3_FLAGS_INLINE		UINT32_C(0x10)
83538 	/*
83539 	 * This flag is not applicable and should be 0 for a local memory
83540 	 * operation WQE.
83541 	 */
83542 	#define SQ_FR_PMR_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
83543 	/*
83544 	 * When set to '1', this operation will cause a trace capture in
83545 	 * each block it passes through.
83546 	 */
83547 	#define SQ_FR_PMR_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
83548 	/*  */
83549 	uint8_t	wqe_size_zero_based;
83550 	/*
83551 	 * The size of the WQE in units of 16B chunks.
83552 	 *
83553 	 * For the FR-PMR WQE, this field will always have a value of 3.
83554 	 */
83555 	#define SQ_FR_PMR_V3_WQE_SIZE_MASK  UINT32_C(0x3f)
83556 	#define SQ_FR_PMR_V3_WQE_SIZE_SFT   0
83557 	/*
83558 	 * If this is set, the PMR will be zero-based. If clear, the PMR
83559 	 * will be non-zero-based.
83560 	 */
83561 	#define SQ_FR_PMR_V3_ZERO_BASED	UINT32_C(0x40)
83562 	/*
83563 	 * This is the new access control for the MR. '1' means
83564 	 * the operation is allowed. '0' means operation is
83565 	 * not allowed.
83566 	 */
83567 	uint8_t	access_cntl;
83568 	/* Local Write Access */
83569 	#define SQ_FR_PMR_V3_ACCESS_CNTL_LOCAL_WRITE	UINT32_C(0x1)
83570 	/* Remote Read Access */
83571 	#define SQ_FR_PMR_V3_ACCESS_CNTL_REMOTE_READ	UINT32_C(0x2)
83572 	/* Remote Write Access */
83573 	#define SQ_FR_PMR_V3_ACCESS_CNTL_REMOTE_WRITE	UINT32_C(0x4)
83574 	/* Remote Atomic Access */
83575 	#define SQ_FR_PMR_V3_ACCESS_CNTL_REMOTE_ATOMIC	UINT32_C(0x8)
83576 	/* Window Binding Allowed */
83577 	#define SQ_FR_PMR_V3_ACCESS_CNTL_WINDOW_BIND	UINT32_C(0x10)
83578 	/*
83579 	 * This value will be returned in the completion if the completion is
83580 	 * signaled.
83581 	 */
83582 	uint32_t	opaque;
83583 	/*
83584 	 * Local Key; 24 msb of the key are used to index the MRW
83585 	 * table, 8 lsb are assigned to the 8 bit key_lsb field in
83586 	 * the MRWC.
83587 	 */
83588 	uint32_t	l_key;
83589 	uint16_t	page_size_log;
83590 	/*
83591 	 * This value controls the page size for leaf memory pages in
83592 	 * a PBL. While many page sizes are supported only the following
83593 	 * should be tested - 4k, 8k, 64k, 256k, 1m, 2m, 4m, 1g
83594 	 */
83595 	#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
83596 	#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_SFT	0
83597 	/* Page size is 4KB. */
83598 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
83599 	/* Page size is 8KB. */
83600 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
83601 	/* Page size is 16KB. */
83602 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_16K	UINT32_C(0x2)
83603 	/* Page size is 32KB. */
83604 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_32K	UINT32_C(0x3)
83605 	/* Page size is 64KB. */
83606 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_64K	UINT32_C(0x4)
83607 	/* Page size is 128KB. */
83608 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_128K	UINT32_C(0x5)
83609 	/* Page size is 256KB. */
83610 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_256K	UINT32_C(0x6)
83611 	/* Page size is 512KB. */
83612 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_512K	UINT32_C(0x7)
83613 	/* Page size is 1MB. */
83614 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
83615 	/* Page size is 2MB. */
83616 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
83617 	/* Page size is 4MB. */
83618 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
83619 	/* Page size is 8MB. */
83620 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
83621 	/* Page size is 16MB. */
83622 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_16M	UINT32_C(0xc)
83623 	/* Page size is 32MB. */
83624 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_32M	UINT32_C(0xd)
83625 	/* Page size is 64MB. */
83626 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_64M	UINT32_C(0xe)
83627 	/* Page size is 128MB. */
83628 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_128M	UINT32_C(0xf)
83629 	/* Page size is 256MB. */
83630 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_256M	UINT32_C(0x10)
83631 	/* Page size is 512MB. */
83632 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_512M	UINT32_C(0x11)
83633 	/* Page size is 1GB. */
83634 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
83635 	/* Page size is 2GB. */
83636 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
83637 	/* Page size is 4GB. */
83638 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
83639 	/* Page size is 8GB. */
83640 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
83641 	/* Page size is 16GB. */
83642 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_16G	UINT32_C(0x16)
83643 	/* Page size is 32GB. */
83644 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_32G	UINT32_C(0x17)
83645 	/* Page size is 64GB. */
83646 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_64G	UINT32_C(0x18)
83647 	/* Page size is 128GB. */
83648 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_128G	UINT32_C(0x19)
83649 	/* Page size is 256GB. */
83650 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_256G	UINT32_C(0x1a)
83651 	/* Page size is 512GB. */
83652 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_512G	UINT32_C(0x1b)
83653 	/* Page size is 1TB. */
83654 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
83655 	/* Page size is 2TB. */
83656 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
83657 	/* Page size is 4TB. */
83658 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
83659 	/* Page size is 8TB. */
83660 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
83661 		#define SQ_FR_PMR_V3_PAGE_SIZE_LOG_LAST	SQ_FR_PMR_V3_PAGE_SIZE_LOG_PGSZ_8T
83662 	/*
83663 	 * This value controls the page size for page table elements
83664 	 * within a PBL. While many page sizes are supported only the
83665 	 * following should be tested - 4k, 8k, 64k, 256k, 1m, 2m, 4m, 1g
83666 	 */
83667 	#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_MASK	UINT32_C(0x3e0)
83668 	#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_SFT	5
83669 	/* Page size is 4KB. */
83670 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_4K	(UINT32_C(0x0) << 5)
83671 	/* Page size is 8KB. */
83672 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_8K	(UINT32_C(0x1) << 5)
83673 	/* Page size is 16KB. */
83674 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_16K   (UINT32_C(0x2) << 5)
83675 	/* Page size is 32KB. */
83676 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_32K   (UINT32_C(0x3) << 5)
83677 	/* Page size is 64KB. */
83678 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_64K   (UINT32_C(0x4) << 5)
83679 	/* Page size is 128KB. */
83680 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_128K  (UINT32_C(0x5) << 5)
83681 	/* Page size is 256KB. */
83682 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_256K  (UINT32_C(0x6) << 5)
83683 	/* Page size is 512KB. */
83684 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_512K  (UINT32_C(0x7) << 5)
83685 	/* Page size is 1MB. */
83686 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_1M	(UINT32_C(0x8) << 5)
83687 	/* Page size is 2MB. */
83688 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_2M	(UINT32_C(0x9) << 5)
83689 	/* Page size is 4MB. */
83690 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_4M	(UINT32_C(0xa) << 5)
83691 	/* Page size is 8MB. */
83692 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_8M	(UINT32_C(0xb) << 5)
83693 	/* Page size is 16MB. */
83694 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_16M   (UINT32_C(0xc) << 5)
83695 	/* Page size is 32MB. */
83696 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_32M   (UINT32_C(0xd) << 5)
83697 	/* Page size is 64MB. */
83698 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_64M   (UINT32_C(0xe) << 5)
83699 	/* Page size is 128MB. */
83700 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_128M  (UINT32_C(0xf) << 5)
83701 	/* Page size is 256MB. */
83702 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_256M  (UINT32_C(0x10) << 5)
83703 	/* Page size is 512MB. */
83704 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_512M  (UINT32_C(0x11) << 5)
83705 	/* Page size is 1GB. */
83706 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_1G	(UINT32_C(0x12) << 5)
83707 	/* Page size is 2GB. */
83708 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_2G	(UINT32_C(0x13) << 5)
83709 	/* Page size is 4GB. */
83710 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_4G	(UINT32_C(0x14) << 5)
83711 	/* Page size is 8GB. */
83712 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_8G	(UINT32_C(0x15) << 5)
83713 	/* Page size is 16GB. */
83714 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_16G   (UINT32_C(0x16) << 5)
83715 	/* Page size is 32GB. */
83716 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_32G   (UINT32_C(0x17) << 5)
83717 	/* Page size is 64GB. */
83718 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_64G   (UINT32_C(0x18) << 5)
83719 	/* Page size is 128GB. */
83720 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_128G  (UINT32_C(0x19) << 5)
83721 	/* Page size is 256GB. */
83722 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_256G  (UINT32_C(0x1a) << 5)
83723 	/* Page size is 512GB. */
83724 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_512G  (UINT32_C(0x1b) << 5)
83725 	/* Page size is 1TB. */
83726 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_1T	(UINT32_C(0x1c) << 5)
83727 	/* Page size is 2TB. */
83728 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_2T	(UINT32_C(0x1d) << 5)
83729 	/* Page size is 4TB. */
83730 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_4T	(UINT32_C(0x1e) << 5)
83731 	/* Page size is 8TB. */
83732 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_8T	(UINT32_C(0x1f) << 5)
83733 		#define SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_LAST	SQ_FR_PMR_V3_PBL_PAGE_SIZE_LOG_PGSZ_8T
83734 	/* Number of levels of PBL for translation */
83735 	#define SQ_FR_PMR_V3_NUMLEVELS_MASK		UINT32_C(0xc00)
83736 	#define SQ_FR_PMR_V3_NUMLEVELS_SFT		10
83737 	/*
83738 	 * A zero level PBL means that the VA is the physical address
83739 	 * used for the operation. No translation is done by the PTU.
83740 	 */
83741 		#define SQ_FR_PMR_V3_NUMLEVELS_PHYSICAL	(UINT32_C(0x0) << 10)
83742 	/*
83743 	 * A one layer translation is provided between the logical and
83744 	 * physical address. The PBL points to a physical page that
83745 	 * contains PBE values that point to actual pg_size physical
83746 	 * pages.
83747 	 */
83748 		#define SQ_FR_PMR_V3_NUMLEVELS_LAYER1		(UINT32_C(0x1) << 10)
83749 	/*
83750 	 * A two layer translation is provided between the logical and
83751 	 * physical address. The PBL points to a physical page that
83752 	 * contains PDE values that in turn point to pbl_pg_size
83753 	 * physical pages that contain PBE values that point to actual
83754 	 * physical pages.
83755 	 */
83756 		#define SQ_FR_PMR_V3_NUMLEVELS_LAYER2		(UINT32_C(0x2) << 10)
83757 		#define SQ_FR_PMR_V3_NUMLEVELS_LAST		SQ_FR_PMR_V3_NUMLEVELS_LAYER2
83758 	uint16_t	reserved;
83759 	/* Local Virtual Address */
83760 	uint64_t	va;
83761 	/* Length in bytes of registered MR */
83762 	uint64_t	length;
83763 	/* Pointer to the PBL, or PDL depending on number of levels */
83764 	uint64_t	pbl_ptr;
83765 } sq_fr_pmr_v3_t, *psq_fr_pmr_v3_t;
83766 
83767 /* SQ FR-PMR WQE V3 header for RC SQs. */
83768 /* sq_fr_pmr_hdr_v3 (size:320b/40B) */
83769 
83770 typedef struct sq_fr_pmr_hdr_v3 {
83771 	/* This field defines the type of SQ WQE. */
83772 	uint8_t	wqe_type;
83773 	/*
83774 	 * FR-PMR (Fast Register Physical Memory Region) V3
83775 	 *
83776 	 * Allowed only on reliable connection (RC) SQs.
83777 	 */
83778 	#define SQ_FR_PMR_HDR_V3_WQE_TYPE_FR_PMR_V3 UINT32_C(0x1b)
83779 	#define SQ_FR_PMR_HDR_V3_WQE_TYPE_LAST	SQ_FR_PMR_HDR_V3_WQE_TYPE_FR_PMR_V3
83780 	uint8_t	flags;
83781 	/*
83782 	 * Set if completion signaling is requested. If this bit is
83783 	 * 0, and the SQ is configured to support Unsignaled
83784 	 * completion the controller should not generate a CQE
83785 	 * unless there was an error. This refers to CQE on the
83786 	 * sender side (The se flag refers to the receiver side).
83787 	 */
83788 	#define SQ_FR_PMR_HDR_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
83789 	/*
83790 	 * Indication to complete all previous RDMA Read or Atomic
83791 	 * WQEs on the SQ before executing this WQE
83792 	 */
83793 	#define SQ_FR_PMR_HDR_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
83794 	/*
83795 	 * Unconditional fence. Indication to complete all previous
83796 	 * SQ's WQEs before executing this WQE.
83797 	 */
83798 	#define SQ_FR_PMR_HDR_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
83799 	/*
83800 	 * This flag is not applicable and should be 0 for a local memory
83801 	 * operation WQE.
83802 	 */
83803 	#define SQ_FR_PMR_HDR_V3_FLAGS_SE			UINT32_C(0x8)
83804 	/*
83805 	 * This flag is not applicable and should be 0 for a local memory
83806 	 * operation WQE.
83807 	 */
83808 	#define SQ_FR_PMR_HDR_V3_FLAGS_INLINE		UINT32_C(0x10)
83809 	/*
83810 	 * This flag is not applicable and should be 0 for a local memory
83811 	 * operation WQE.
83812 	 */
83813 	#define SQ_FR_PMR_HDR_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
83814 	/*
83815 	 * When set to '1', this operation will cause a trace capture in
83816 	 * each block it passes through.
83817 	 */
83818 	#define SQ_FR_PMR_HDR_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
83819 	/*  */
83820 	uint8_t	wqe_size_zero_based;
83821 	/*
83822 	 * The size of the WQE in units of 16B chunks.
83823 	 *
83824 	 * For the FR-PMR WQE, this field will always have a value of 3.
83825 	 */
83826 	#define SQ_FR_PMR_HDR_V3_WQE_SIZE_MASK  UINT32_C(0x3f)
83827 	#define SQ_FR_PMR_HDR_V3_WQE_SIZE_SFT   0
83828 	/*
83829 	 * If this is set, the PMR will be zero-based. If clear, the PMR
83830 	 * will be non-zero-based.
83831 	 */
83832 	#define SQ_FR_PMR_HDR_V3_ZERO_BASED	UINT32_C(0x40)
83833 	/*
83834 	 * This is the new access control for the MR. '1' means
83835 	 * the operation is allowed. '0' means operation is
83836 	 * not allowed.
83837 	 */
83838 	uint8_t	access_cntl;
83839 	/* Local Write Access */
83840 	#define SQ_FR_PMR_HDR_V3_ACCESS_CNTL_LOCAL_WRITE	UINT32_C(0x1)
83841 	/* Remote Read Access */
83842 	#define SQ_FR_PMR_HDR_V3_ACCESS_CNTL_REMOTE_READ	UINT32_C(0x2)
83843 	/* Remote Write Access */
83844 	#define SQ_FR_PMR_HDR_V3_ACCESS_CNTL_REMOTE_WRITE	UINT32_C(0x4)
83845 	/* Remote Atomic Access */
83846 	#define SQ_FR_PMR_HDR_V3_ACCESS_CNTL_REMOTE_ATOMIC	UINT32_C(0x8)
83847 	/* Window Binding Allowed */
83848 	#define SQ_FR_PMR_HDR_V3_ACCESS_CNTL_WINDOW_BIND	UINT32_C(0x10)
83849 	/*
83850 	 * This value will be returned in the completion if the completion is
83851 	 * signaled.
83852 	 */
83853 	uint32_t	opaque;
83854 	/*
83855 	 * Local Key; 24 msb of the key are used to index the MRW
83856 	 * table, 8 lsb are assigned to the 8 bit key_lsb field in
83857 	 * the MRWC.
83858 	 */
83859 	uint32_t	l_key;
83860 	uint16_t	page_size_log;
83861 	/*
83862 	 * This value controls the page size for leaf memory pages in
83863 	 * a PBL. While many page sizes are supported only the following
83864 	 * should be tested - 4k, 8k, 64k, 256k, 1m, 2m, 4m, 1g
83865 	 */
83866 	#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_MASK	UINT32_C(0x1f)
83867 	#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_SFT	0
83868 	/* Page size is 4KB. */
83869 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_4K	UINT32_C(0x0)
83870 	/* Page size is 8KB. */
83871 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_8K	UINT32_C(0x1)
83872 	/* Page size is 16KB. */
83873 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_16K	UINT32_C(0x2)
83874 	/* Page size is 32KB. */
83875 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_32K	UINT32_C(0x3)
83876 	/* Page size is 64KB. */
83877 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_64K	UINT32_C(0x4)
83878 	/* Page size is 128KB. */
83879 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_128K	UINT32_C(0x5)
83880 	/* Page size is 256KB. */
83881 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_256K	UINT32_C(0x6)
83882 	/* Page size is 512KB. */
83883 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_512K	UINT32_C(0x7)
83884 	/* Page size is 1MB. */
83885 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_1M	UINT32_C(0x8)
83886 	/* Page size is 2MB. */
83887 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_2M	UINT32_C(0x9)
83888 	/* Page size is 4MB. */
83889 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_4M	UINT32_C(0xa)
83890 	/* Page size is 8MB. */
83891 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_8M	UINT32_C(0xb)
83892 	/* Page size is 16MB. */
83893 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_16M	UINT32_C(0xc)
83894 	/* Page size is 32MB. */
83895 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_32M	UINT32_C(0xd)
83896 	/* Page size is 64MB. */
83897 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_64M	UINT32_C(0xe)
83898 	/* Page size is 128MB. */
83899 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_128M	UINT32_C(0xf)
83900 	/* Page size is 256MB. */
83901 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_256M	UINT32_C(0x10)
83902 	/* Page size is 512MB. */
83903 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_512M	UINT32_C(0x11)
83904 	/* Page size is 1GB. */
83905 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_1G	UINT32_C(0x12)
83906 	/* Page size is 2GB. */
83907 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_2G	UINT32_C(0x13)
83908 	/* Page size is 4GB. */
83909 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_4G	UINT32_C(0x14)
83910 	/* Page size is 8GB. */
83911 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_8G	UINT32_C(0x15)
83912 	/* Page size is 16GB. */
83913 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_16G	UINT32_C(0x16)
83914 	/* Page size is 32GB. */
83915 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_32G	UINT32_C(0x17)
83916 	/* Page size is 64GB. */
83917 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_64G	UINT32_C(0x18)
83918 	/* Page size is 128GB. */
83919 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_128G	UINT32_C(0x19)
83920 	/* Page size is 256GB. */
83921 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_256G	UINT32_C(0x1a)
83922 	/* Page size is 512GB. */
83923 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_512G	UINT32_C(0x1b)
83924 	/* Page size is 1TB. */
83925 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_1T	UINT32_C(0x1c)
83926 	/* Page size is 2TB. */
83927 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_2T	UINT32_C(0x1d)
83928 	/* Page size is 4TB. */
83929 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_4T	UINT32_C(0x1e)
83930 	/* Page size is 8TB. */
83931 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_8T	UINT32_C(0x1f)
83932 		#define SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_LAST	SQ_FR_PMR_HDR_V3_PAGE_SIZE_LOG_PGSZ_8T
83933 	/*
83934 	 * This value controls the page size for page table elements
83935 	 * within a PBL. While many page sizes are supported only the
83936 	 * following should be tested - 4k, 8k, 64k, 256k, 1m, 2m, 4m, 1g
83937 	 */
83938 	#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_MASK	UINT32_C(0x3e0)
83939 	#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_SFT	5
83940 	/* Page size is 4KB. */
83941 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_4K	(UINT32_C(0x0) << 5)
83942 	/* Page size is 8KB. */
83943 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_8K	(UINT32_C(0x1) << 5)
83944 	/* Page size is 16KB. */
83945 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_16K   (UINT32_C(0x2) << 5)
83946 	/* Page size is 32KB. */
83947 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_32K   (UINT32_C(0x3) << 5)
83948 	/* Page size is 64KB. */
83949 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_64K   (UINT32_C(0x4) << 5)
83950 	/* Page size is 128KB. */
83951 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_128K  (UINT32_C(0x5) << 5)
83952 	/* Page size is 256KB. */
83953 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_256K  (UINT32_C(0x6) << 5)
83954 	/* Page size is 512KB. */
83955 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_512K  (UINT32_C(0x7) << 5)
83956 	/* Page size is 1MB. */
83957 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_1M	(UINT32_C(0x8) << 5)
83958 	/* Page size is 2MB. */
83959 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_2M	(UINT32_C(0x9) << 5)
83960 	/* Page size is 4MB. */
83961 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_4M	(UINT32_C(0xa) << 5)
83962 	/* Page size is 8MB. */
83963 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_8M	(UINT32_C(0xb) << 5)
83964 	/* Page size is 16MB. */
83965 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_16M   (UINT32_C(0xc) << 5)
83966 	/* Page size is 32MB. */
83967 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_32M   (UINT32_C(0xd) << 5)
83968 	/* Page size is 64MB. */
83969 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_64M   (UINT32_C(0xe) << 5)
83970 	/* Page size is 128MB. */
83971 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_128M  (UINT32_C(0xf) << 5)
83972 	/* Page size is 256MB. */
83973 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_256M  (UINT32_C(0x10) << 5)
83974 	/* Page size is 512MB. */
83975 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_512M  (UINT32_C(0x11) << 5)
83976 	/* Page size is 1GB. */
83977 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_1G	(UINT32_C(0x12) << 5)
83978 	/* Page size is 2GB. */
83979 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_2G	(UINT32_C(0x13) << 5)
83980 	/* Page size is 4GB. */
83981 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_4G	(UINT32_C(0x14) << 5)
83982 	/* Page size is 8GB. */
83983 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_8G	(UINT32_C(0x15) << 5)
83984 	/* Page size is 16GB. */
83985 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_16G   (UINT32_C(0x16) << 5)
83986 	/* Page size is 32GB. */
83987 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_32G   (UINT32_C(0x17) << 5)
83988 	/* Page size is 64GB. */
83989 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_64G   (UINT32_C(0x18) << 5)
83990 	/* Page size is 128GB. */
83991 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_128G  (UINT32_C(0x19) << 5)
83992 	/* Page size is 256GB. */
83993 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_256G  (UINT32_C(0x1a) << 5)
83994 	/* Page size is 512GB. */
83995 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_512G  (UINT32_C(0x1b) << 5)
83996 	/* Page size is 1TB. */
83997 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_1T	(UINT32_C(0x1c) << 5)
83998 	/* Page size is 2TB. */
83999 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_2T	(UINT32_C(0x1d) << 5)
84000 	/* Page size is 4TB. */
84001 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_4T	(UINT32_C(0x1e) << 5)
84002 	/* Page size is 8TB. */
84003 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_8T	(UINT32_C(0x1f) << 5)
84004 		#define SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_LAST	SQ_FR_PMR_HDR_V3_PBL_PAGE_SIZE_LOG_PGSZ_8T
84005 	/* Number of levels of PBL for translation */
84006 	#define SQ_FR_PMR_HDR_V3_NUMLEVELS_MASK		UINT32_C(0xc00)
84007 	#define SQ_FR_PMR_HDR_V3_NUMLEVELS_SFT		10
84008 	/*
84009 	 * A zero level PBL means that the VA is the physical address
84010 	 * used for the operation. No translation is done by the PTU.
84011 	 */
84012 		#define SQ_FR_PMR_HDR_V3_NUMLEVELS_PHYSICAL	(UINT32_C(0x0) << 10)
84013 	/*
84014 	 * A one layer translation is provided between the logical and
84015 	 * physical address. The PBL points to a physical page that
84016 	 * contains PBE values that point to actual pg_size physical
84017 	 * pages.
84018 	 */
84019 		#define SQ_FR_PMR_HDR_V3_NUMLEVELS_LAYER1		(UINT32_C(0x1) << 10)
84020 	/*
84021 	 * A two layer translation is provided between the logical and
84022 	 * physical address. The PBL points to a physical page that
84023 	 * contains PDE values that in turn point to pbl_pg_size
84024 	 * physical pages that contain PBE values that point to actual
84025 	 * physical pages.
84026 	 */
84027 		#define SQ_FR_PMR_HDR_V3_NUMLEVELS_LAYER2		(UINT32_C(0x2) << 10)
84028 		#define SQ_FR_PMR_HDR_V3_NUMLEVELS_LAST		SQ_FR_PMR_HDR_V3_NUMLEVELS_LAYER2
84029 	uint16_t	reserved;
84030 	/* Local Virtual Address */
84031 	uint64_t	va;
84032 	/* Length in bytes of registered MR */
84033 	uint64_t	length;
84034 	/* Pointer to the PBL, or PDL depending on number of levels */
84035 	uint64_t	pbl_ptr;
84036 } sq_fr_pmr_hdr_v3_t, *psq_fr_pmr_hdr_v3_t;
84037 
84038 /*
84039  * SQ Bind WQE V3. This WQE can perform either:
84040  * * type1 "bind memory window", if mw_type==Type1
84041  * * type2 "post send bind memory window", if mw_type==Type2
84042  */
84043 /* sq_bind_v3 (size:256b/32B) */
84044 
84045 typedef struct sq_bind_v3 {
84046 	/* This field defines the type of SQ WQE. */
84047 	uint8_t	wqe_type;
84048 	/*
84049 	 * Memory Bind V3
84050 	 *
84051 	 * Allowed only on reliable connection (RC) SQs.
84052 	 */
84053 	#define SQ_BIND_V3_WQE_TYPE_BIND_V3 UINT32_C(0x1c)
84054 	#define SQ_BIND_V3_WQE_TYPE_LAST   SQ_BIND_V3_WQE_TYPE_BIND_V3
84055 	uint8_t	flags;
84056 	/*
84057 	 * Set if completion signaling is requested. If this bit is
84058 	 * 0, and the SQ is configured to support Unsignaled
84059 	 * completion the controller should not generate a CQE
84060 	 * unless there was an error. This refers to CQE on the
84061 	 * sender side (The se flag refers to the receiver side).
84062 	 */
84063 	#define SQ_BIND_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
84064 	/*
84065 	 * Indication to complete all previous RDMA Read or Atomic
84066 	 * WQEs on the SQ before executing this WQE
84067 	 */
84068 	#define SQ_BIND_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
84069 	/*
84070 	 * Unconditional fence. Indication to complete all previous
84071 	 * SQ's WQEs before executing this WQE.
84072 	 */
84073 	#define SQ_BIND_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
84074 	/*
84075 	 * This flag is not applicable and should be 0 for a local memory
84076 	 * operation WQE.
84077 	 */
84078 	#define SQ_BIND_V3_FLAGS_SE			UINT32_C(0x8)
84079 	/*
84080 	 * This flag is not applicable and should be 0 for a local memory
84081 	 * operation WQE.
84082 	 */
84083 	#define SQ_BIND_V3_FLAGS_INLINE		UINT32_C(0x10)
84084 	/*
84085 	 * This flag is not applicable and should be 0 for a local memory
84086 	 * operation WQE.
84087 	 */
84088 	#define SQ_BIND_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
84089 	/*
84090 	 * When set to '1', this operation will cause a trace capture in
84091 	 * each block it passes through.
84092 	 */
84093 	#define SQ_BIND_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
84094 	uint8_t	wqe_size_zero_based_mw_type;
84095 	/*
84096 	 * The size of the WQE in units of 16B chunks.
84097 	 *
84098 	 * For the Bind WQE, this field will always have a value of 2.
84099 	 */
84100 	#define SQ_BIND_V3_WQE_SIZE_MASK  UINT32_C(0x3f)
84101 	#define SQ_BIND_V3_WQE_SIZE_SFT   0
84102 	/*
84103 	 * If this bit is set, then the newly-bound memory window will be
84104 	 * zero-based. If clear, then the newly-bound memory window will be
84105 	 * non-zero-based.
84106 	 */
84107 	#define SQ_BIND_V3_ZERO_BASED	UINT32_C(0x40)
84108 	/*
84109 	 * If type1 is specified, then this WQE performs a "bind memory
84110 	 * window" operation on a type1 window. If type2 is specified, then
84111 	 * this WQE performs a "post send bind memory window" operation on a
84112 	 * type2 window.
84113 	 *
84114 	 * Note that the bind WQE cannot change the type of the memory
84115 	 * window.
84116 	 *
84117 	 * If a "bind memory window" operation is attempted on a memory
84118 	 * window that was allocated as type2, then the bind will fail with
84119 	 * an errored completion, as "bind memory window" is allowed only on
84120 	 * type1 memory windows.
84121 	 *
84122 	 * Similarly, if a "post send bind memory window" operation is
84123 	 * attempted on a memory window that was allocated as type1, then the
84124 	 * bind will fail with an errored completions, as "post send bind
84125 	 * memory window" is allowed only on type2 memory windows.
84126 	 */
84127 	#define SQ_BIND_V3_MW_TYPE	UINT32_C(0x80)
84128 	/* Type 1 Bind Memory Window */
84129 		#define SQ_BIND_V3__TYPE1	(UINT32_C(0x0) << 7)
84130 	/* Type 2 Post Send Bind Memory Window */
84131 		#define SQ_BIND_V3__TYPE2	(UINT32_C(0x1) << 7)
84132 		#define SQ_BIND_V3__LAST	SQ_BIND_V3__TYPE2
84133 	/*
84134 	 * This is the new access control for the MR. '1' means
84135 	 * the operation is allowed. '0' means operation is
84136 	 * not allowed.
84137 	 */
84138 	uint8_t	access_cntl;
84139 	/*
84140 	 * Local Write Access.
84141 	 *
84142 	 * Local accesses are never allowed for memory windows, so this
84143 	 * bit must always be zero in a bind WQE. If this bit is ever
84144 	 * set, the bind will fail with an errored completion.
84145 	 */
84146 	#define SQ_BIND_V3_ACCESS_CNTL_LOCAL_WRITE	UINT32_C(0x1)
84147 	/* Remote Read Access */
84148 	#define SQ_BIND_V3_ACCESS_CNTL_REMOTE_READ	UINT32_C(0x2)
84149 	/*
84150 	 * Remote Write Access.
84151 	 *
84152 	 * Note that, if this bit is set, then the parent region to which
84153 	 * the window is being bound must allow local writes. If this is not
84154 	 * the case, then the bind will fail with an errored completion.
84155 	 */
84156 	#define SQ_BIND_V3_ACCESS_CNTL_REMOTE_WRITE	UINT32_C(0x4)
84157 	/*
84158 	 * Remote Atomic Access.
84159 	 *
84160 	 * Note that, if this bit is set, then the parent region to which
84161 	 * the window is being bound must allow local writes. If this is not
84162 	 * the case, then the bind will fail with an errored completion.
84163 	 */
84164 	#define SQ_BIND_V3_ACCESS_CNTL_REMOTE_ATOMIC	UINT32_C(0x8)
84165 	/*
84166 	 * Window Binding Allowed.
84167 	 *
84168 	 * It is never allowed to bind windows to windows, so this bit
84169 	 * must always be zero in a bind WQE. If this bit is ever set,
84170 	 * the bind will fail with an errored completion.
84171 	 */
84172 	#define SQ_BIND_V3_ACCESS_CNTL_WINDOW_BIND	UINT32_C(0x10)
84173 	/*
84174 	 * This value will be returned in the completion if the completion is
84175 	 * signaled.
84176 	 */
84177 	uint32_t	opaque;
84178 	/*
84179 	 * The L_Key of the parent MR; 24 msb of the key are used to
84180 	 * index the MRW table, 8 lsb are compared with the 8 bit key
84181 	 * in the MRWC.
84182 	 */
84183 	uint32_t	parent_l_key;
84184 	/*
84185 	 * Local Key; 24 msb of the key are used to index the memory
84186 	 * window being bound in the MRW table, 8 lsb are assign to the
84187 	 * 8 bit key_lsb field in the MRWC.
84188 	 */
84189 	uint32_t	l_key;
84190 	/* Local Virtual Address */
84191 	uint64_t	va;
84192 	/*
84193 	 * Length in bytes of registered MW; 40 bits as this is the max
84194 	 * size of an MR/W
84195 	 */
84196 	uint64_t	length;
84197 } sq_bind_v3_t, *psq_bind_v3_t;
84198 
84199 /*
84200  * SQ Bind WQE V3 header. This WQE can perform either:
84201  * * type1 "bind memory window", if mw_type==Type1
84202  * * type2 "post send bind memory window", if mw_type==Type2
84203  */
84204 /* sq_bind_hdr_v3 (size:256b/32B) */
84205 
84206 typedef struct sq_bind_hdr_v3 {
84207 	/* This field defines the type of SQ WQE. */
84208 	uint8_t	wqe_type;
84209 	/*
84210 	 * Memory Bind V3
84211 	 *
84212 	 * Allowed only on reliable connection (RC) SQs.
84213 	 */
84214 	#define SQ_BIND_HDR_V3_WQE_TYPE_BIND_V3 UINT32_C(0x1c)
84215 	#define SQ_BIND_HDR_V3_WQE_TYPE_LAST   SQ_BIND_HDR_V3_WQE_TYPE_BIND_V3
84216 	uint8_t	flags;
84217 	/*
84218 	 * Set if completion signaling is requested. If this bit is
84219 	 * 0, and the SQ is configured to support Unsignaled
84220 	 * completion the controller should not generate a CQE
84221 	 * unless there was an error. This refers to CQE on the
84222 	 * sender side (The se flag refers to the receiver side).
84223 	 */
84224 	#define SQ_BIND_HDR_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
84225 	/*
84226 	 * Indication to complete all previous RDMA Read or Atomic
84227 	 * WQEs on the SQ before executing this WQE
84228 	 */
84229 	#define SQ_BIND_HDR_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
84230 	/*
84231 	 * Unconditional fence. Indication to complete all previous
84232 	 * SQ's WQEs before executing this WQE.
84233 	 */
84234 	#define SQ_BIND_HDR_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
84235 	/*
84236 	 * This flag is not applicable and should be 0 for a local memory
84237 	 * operation WQE.
84238 	 */
84239 	#define SQ_BIND_HDR_V3_FLAGS_SE			UINT32_C(0x8)
84240 	/*
84241 	 * This flag is not applicable and should be 0 for a local memory
84242 	 * operation WQE.
84243 	 */
84244 	#define SQ_BIND_HDR_V3_FLAGS_INLINE		UINT32_C(0x10)
84245 	/*
84246 	 * This flag is not applicable and should be 0 for a local memory
84247 	 * operation WQE.
84248 	 */
84249 	#define SQ_BIND_HDR_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
84250 	/*
84251 	 * When set to '1', this operation will cause a trace capture in
84252 	 * each block it passes through.
84253 	 */
84254 	#define SQ_BIND_HDR_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
84255 	uint8_t	wqe_size_zero_based_mw_type;
84256 	/*
84257 	 * The size of the WQE in units of 16B chunks.
84258 	 *
84259 	 * For the Bind WQE, this field will always have a value of 2.
84260 	 */
84261 	#define SQ_BIND_HDR_V3_WQE_SIZE_MASK  UINT32_C(0x3f)
84262 	#define SQ_BIND_HDR_V3_WQE_SIZE_SFT   0
84263 	/*
84264 	 * If this bit is set, then the newly-bound memory window will be
84265 	 * zero-based. If clear, then the newly-bound memory window will be
84266 	 * non-zero-based.
84267 	 */
84268 	#define SQ_BIND_HDR_V3_ZERO_BASED	UINT32_C(0x40)
84269 	/*
84270 	 * If type1 is specified, then this WQE performs a "bind memory
84271 	 * window" operation on a type1 window. If type2 is specified, then
84272 	 * this WQE performs a "post send bind memory window" operation on a
84273 	 * type2 window.
84274 	 *
84275 	 * Note that the bind WQE cannot change the type of the memory
84276 	 * window.
84277 	 *
84278 	 * If a "bind memory window" operation is attempted on a memory
84279 	 * window that was allocated as type2, then the bind will fail with
84280 	 * an errored completion, as "bind memory window" is allowed only on
84281 	 * type1 memory windows.
84282 	 *
84283 	 * Similarly, if a "post send bind memory window" operation is
84284 	 * attempted on a memory window that was allocated as type1, then the
84285 	 * bind will fail with an errored completions, as "post send bind
84286 	 * memory window" is allowed only on type2 memory windows.
84287 	 */
84288 	#define SQ_BIND_HDR_V3_MW_TYPE	UINT32_C(0x80)
84289 	/* Type 1 Bind Memory Window */
84290 		#define SQ_BIND_HDR_V3__TYPE1	(UINT32_C(0x0) << 7)
84291 	/* Type 2 Post Send Bind Memory Window */
84292 		#define SQ_BIND_HDR_V3__TYPE2	(UINT32_C(0x1) << 7)
84293 		#define SQ_BIND_HDR_V3__LAST	SQ_BIND_HDR_V3__TYPE2
84294 	/*
84295 	 * This is the new access control for the MR. '1' means
84296 	 * the operation is allowed. '0' means operation is
84297 	 * not allowed.
84298 	 */
84299 	uint8_t	access_cntl;
84300 	/*
84301 	 * Local Write Access.
84302 	 *
84303 	 * Local accesses are never allowed for memory windows, so this
84304 	 * bit must always be zero in a bind WQE. If this bit is ever
84305 	 * set, the bind will fail with an errored completion.
84306 	 */
84307 	#define SQ_BIND_HDR_V3_ACCESS_CNTL_LOCAL_WRITE	UINT32_C(0x1)
84308 	/* Remote Read Access */
84309 	#define SQ_BIND_HDR_V3_ACCESS_CNTL_REMOTE_READ	UINT32_C(0x2)
84310 	/*
84311 	 * Remote Write Access.
84312 	 *
84313 	 * Note that, if this bit is set, then the parent region to which
84314 	 * the window is being bound must allow local writes. If this is not
84315 	 * the case, then the bind will fail with an errored completion.
84316 	 */
84317 	#define SQ_BIND_HDR_V3_ACCESS_CNTL_REMOTE_WRITE	UINT32_C(0x4)
84318 	/*
84319 	 * Remote Atomic Access.
84320 	 *
84321 	 * Note that, if this bit is set, then the parent region to which
84322 	 * the window is being bound must allow local writes. If this is not
84323 	 * the case, then the bind will fail with an errored completion.
84324 	 */
84325 	#define SQ_BIND_HDR_V3_ACCESS_CNTL_REMOTE_ATOMIC	UINT32_C(0x8)
84326 	/*
84327 	 * Window Binding Allowed.
84328 	 *
84329 	 * It is never allowed to bind windows to windows, so this bit
84330 	 * must always be zero in a bind WQE. If this bit is ever set,
84331 	 * the bind will fail with an errored completion.
84332 	 */
84333 	#define SQ_BIND_HDR_V3_ACCESS_CNTL_WINDOW_BIND	UINT32_C(0x10)
84334 	/*
84335 	 * This value will be returned in the completion if the completion is
84336 	 * signaled.
84337 	 */
84338 	uint32_t	opaque;
84339 	/*
84340 	 * The L_Key of the parent MR; 24 msb of the key are used to
84341 	 * index the MRW table, 8 lsb are compared with the 8 bit key
84342 	 * in the MRWC.
84343 	 */
84344 	uint32_t	parent_l_key;
84345 	/*
84346 	 * Local Key; 24 msb of the key are used to index the memory
84347 	 * window being bound in the MRW table, 8 lsb are assign to the
84348 	 * 8 bit key_lsb field in the MRWC.
84349 	 */
84350 	uint32_t	l_key;
84351 	/* Local Virtual Address */
84352 	uint64_t	va;
84353 	/*
84354 	 * Length in bytes of registered MW; 40 bits as this is the max
84355 	 * size of an MR/W
84356 	 */
84357 	uint64_t	length;
84358 } sq_bind_hdr_v3_t, *psq_bind_hdr_v3_t;
84359 
84360 /*
84361  * This is the Change UDP Source Port WQE V3 structure. It is supported
84362  * for both RC and UD QP's.
84363  *
84364  * It is recommended to set the uc_fence flag for this WQE, so that the
84365  * source port does not change while there are unacknowledged packets.
84366  */
84367 /* sq_change_udpsrcport_v3 (size:128b/16B) */
84368 
84369 typedef struct sq_change_udpsrcport_v3 {
84370 	/* This field defines the type of SQ WQE. */
84371 	uint8_t	wqe_type;
84372 	/* Change UDP Source Port V3 */
84373 	#define SQ_CHANGE_UDPSRCPORT_V3_WQE_TYPE_CHANGE_UDPSRCPORT_V3 UINT32_C(0x1e)
84374 	#define SQ_CHANGE_UDPSRCPORT_V3_WQE_TYPE_LAST		SQ_CHANGE_UDPSRCPORT_V3_WQE_TYPE_CHANGE_UDPSRCPORT_V3
84375 	uint8_t	flags;
84376 	/*
84377 	 * Set if completion signaling is requested. If this bit is
84378 	 * 0, and the SQ is configured to support Unsignaled
84379 	 * completion the controller should not generate a CQE
84380 	 * unless there was an error. This refers to CQE on the
84381 	 * sender side (The se flag refers to the receiver side).
84382 	 */
84383 	#define SQ_CHANGE_UDPSRCPORT_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
84384 	/*
84385 	 * Indication to complete all previous RDMA Read or Atomic
84386 	 * WQEs on the SQ before executing this WQE
84387 	 */
84388 	#define SQ_CHANGE_UDPSRCPORT_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
84389 	/*
84390 	 * Unconditional fence. Indication to complete all previous
84391 	 * SQ's WQEs before executing this WQE.
84392 	 *
84393 	 * It is recommended to set this flag for Change UDP Source Port
84394 	 * WQE's.
84395 	 */
84396 	#define SQ_CHANGE_UDPSRCPORT_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
84397 	/*
84398 	 * This flag is not applicable and should be 0 for a local memory
84399 	 * operation WQE.
84400 	 */
84401 	#define SQ_CHANGE_UDPSRCPORT_V3_FLAGS_SE			UINT32_C(0x8)
84402 	/*
84403 	 * This flag is not applicable and should be 0 for a local memory
84404 	 * operation WQE.
84405 	 */
84406 	#define SQ_CHANGE_UDPSRCPORT_V3_FLAGS_INLINE		UINT32_C(0x10)
84407 	/*
84408 	 * This flag is not applicable and should be 0 for a local memory
84409 	 * operation WQE.
84410 	 */
84411 	#define SQ_CHANGE_UDPSRCPORT_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
84412 	/*
84413 	 * When set to '1', this operation will cause a trace capture in
84414 	 * each block it passes through.
84415 	 */
84416 	#define SQ_CHANGE_UDPSRCPORT_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
84417 	uint8_t	wqe_size;
84418 	/*
84419 	 * The size of the WQE in units of 16B chunks.
84420 	 *
84421 	 * For the Change UDP Source Port WQE, this field will always have
84422 	 * a value of 1.
84423 	 */
84424 	#define SQ_CHANGE_UDPSRCPORT_V3_WQE_SIZE_MASK UINT32_C(0x3f)
84425 	#define SQ_CHANGE_UDPSRCPORT_V3_WQE_SIZE_SFT 0
84426 	uint8_t	reserved_1;
84427 	/*
84428 	 * This value will be returned in the completion if the completion is
84429 	 * signaled.
84430 	 */
84431 	uint32_t	opaque;
84432 	/* The new value for the QP's UDP source port. */
84433 	uint16_t	udp_src_port;
84434 	uint16_t	reserved_2;
84435 	uint32_t	reserved_3;
84436 } sq_change_udpsrcport_v3_t, *psq_change_udpsrcport_v3_t;
84437 
84438 /* SQ Change UDP Source Port WQE V3 header */
84439 /* sq_change_udpsrcport_hdr_v3 (size:128b/16B) */
84440 
84441 typedef struct sq_change_udpsrcport_hdr_v3 {
84442 	/* This field defines the type of SQ WQE. */
84443 	uint8_t	wqe_type;
84444 	/* Change UDP Source Port V3 */
84445 	#define SQ_CHANGE_UDPSRCPORT_HDR_V3_WQE_TYPE_CHANGE_UDPSRCPORT_V3 UINT32_C(0x1e)
84446 	#define SQ_CHANGE_UDPSRCPORT_HDR_V3_WQE_TYPE_LAST		SQ_CHANGE_UDPSRCPORT_HDR_V3_WQE_TYPE_CHANGE_UDPSRCPORT_V3
84447 	uint8_t	flags;
84448 	/*
84449 	 * Set if completion signaling is requested. If this bit is
84450 	 * 0, and the SQ is configured to support Unsignaled
84451 	 * completion the controller should not generate a CQE
84452 	 * unless there was an error. This refers to CQE on the
84453 	 * sender side (The se flag refers to the receiver side).
84454 	 */
84455 	#define SQ_CHANGE_UDPSRCPORT_HDR_V3_FLAGS_SIGNAL_COMP		UINT32_C(0x1)
84456 	/*
84457 	 * Indication to complete all previous RDMA Read or Atomic
84458 	 * WQEs on the SQ before executing this WQE
84459 	 */
84460 	#define SQ_CHANGE_UDPSRCPORT_HDR_V3_FLAGS_RD_OR_ATOMIC_FENCE	UINT32_C(0x2)
84461 	/*
84462 	 * Unconditional fence. Indication to complete all previous
84463 	 * SQ's WQEs before executing this WQE.
84464 	 *
84465 	 * It is recommended to set this flag for Change UDP Source Port
84466 	 * WQE's.
84467 	 */
84468 	#define SQ_CHANGE_UDPSRCPORT_HDR_V3_FLAGS_UC_FENCE		UINT32_C(0x4)
84469 	/*
84470 	 * This flag is not applicable and should be 0 for a local memory
84471 	 * operation WQE.
84472 	 */
84473 	#define SQ_CHANGE_UDPSRCPORT_HDR_V3_FLAGS_SE			UINT32_C(0x8)
84474 	/*
84475 	 * This flag is not applicable and should be 0 for a local memory
84476 	 * operation WQE.
84477 	 */
84478 	#define SQ_CHANGE_UDPSRCPORT_HDR_V3_FLAGS_INLINE		UINT32_C(0x10)
84479 	/*
84480 	 * This flag is not applicable and should be 0 for a local memory
84481 	 * operation WQE.
84482 	 */
84483 	#define SQ_CHANGE_UDPSRCPORT_HDR_V3_FLAGS_WQE_TS_EN		UINT32_C(0x20)
84484 	/*
84485 	 * When set to '1', this operation will cause a trace capture in
84486 	 * each block it passes through.
84487 	 */
84488 	#define SQ_CHANGE_UDPSRCPORT_HDR_V3_FLAGS_DEBUG_TRACE		UINT32_C(0x40)
84489 	uint8_t	wqe_size;
84490 	/*
84491 	 * The size of the WQE in units of 16B chunks.
84492 	 *
84493 	 * For the Change UDP Source Port WQE, this field will always have
84494 	 * a value of 1.
84495 	 */
84496 	#define SQ_CHANGE_UDPSRCPORT_HDR_V3_WQE_SIZE_MASK UINT32_C(0x3f)
84497 	#define SQ_CHANGE_UDPSRCPORT_HDR_V3_WQE_SIZE_SFT 0
84498 	uint8_t	reserved_1;
84499 	/*
84500 	 * This value will be returned in the completion if the completion is
84501 	 * signaled.
84502 	 */
84503 	uint32_t	opaque;
84504 	/* The new value for the QP's UDP source port. */
84505 	uint16_t	udp_src_port;
84506 	uint16_t	reserved_2;
84507 	uint32_t	reserved_3;
84508 } sq_change_udpsrcport_hdr_v3_t, *psq_change_udpsrcport_hdr_v3_t;
84509 
84510 /* RQ/SRQ WQE */
84511 /* rq_wqe (size:1024b/128B) */
84512 
84513 typedef struct rq_wqe {
84514 	/* wqe_type is 8 b */
84515 	uint8_t	wqe_type;
84516 	/*
84517 	 * RQ/SRQ WQE. This WQE is used for posting buffers on
84518 	 * an RQ or SRQ.
84519 	 */
84520 	#define RQ_WQE_WQE_TYPE_RCV UINT32_C(0x80)
84521 	#define RQ_WQE_WQE_TYPE_LAST RQ_WQE_WQE_TYPE_RCV
84522 	/* No flags supported for this WQE type. */
84523 	uint8_t	flags;
84524 	/*
84525 	 * Specify the total number 16B chunks that make up the valid
84526 	 * portion of the WQE. This includes the first chunk that is the
84527 	 * WQE structure and up to 6 SGE structures.
84528 	 *
84529 	 * While the valid area is defined by the wqe_size field, the
84530 	 * actual WQE size is fixed at 128B.
84531 	 */
84532 	uint8_t	wqe_size;
84533 	uint8_t	reserved8;
84534 	uint32_t	reserved32;
84535 	uint64_t	wr_id;
84536 	/*
84537 	 * Opaque value used by upper layer SW to identify the id of the
84538 	 * WR which generated the WQE. Used in CQE. Valid in the first
84539 	 * SGE of an SRQ WQE.
84540 	 */
84541 	#define RQ_WQE_WR_ID_MASK UINT32_C(0xfffff)
84542 	#define RQ_WQE_WR_ID_SFT 0
84543 	uint8_t	reserved128[16];
84544 	/*
84545 	 * The data field for RQ WQE is filled with from 1 to 6 SGE
84546 	 * structures as defined by the wqe_size field.
84547 	 */
84548 	uint32_t	data[24];
84549 } rq_wqe_t, *prq_wqe_t;
84550 
84551 /* RQ/SRQ WQE header. */
84552 /* rq_wqe_hdr (size:256b/32B) */
84553 
84554 typedef struct rq_wqe_hdr {
84555 	/* wqe_type is 8 b */
84556 	uint8_t	wqe_type;
84557 	/*
84558 	 * RQ/SRQ WQE. This WQE is used for posting buffers on
84559 	 * an RQ or SRQ.
84560 	 */
84561 	#define RQ_WQE_HDR_WQE_TYPE_RCV UINT32_C(0x80)
84562 	#define RQ_WQE_HDR_WQE_TYPE_LAST RQ_WQE_HDR_WQE_TYPE_RCV
84563 	/* No flags supported for this WQE type. */
84564 	uint8_t	flags;
84565 	/*
84566 	 * Specify the total number 16B chunks that make up the valid
84567 	 * portion of the WQE. This includes the first chunk that is the
84568 	 * WQE structure and up to 6 SGE structures.
84569 	 *
84570 	 * While the valid area is defined by the wqe_size field, the
84571 	 * actual WQE size is fixed at 128B.
84572 	 */
84573 	uint8_t	wqe_size;
84574 	uint8_t	reserved8;
84575 	uint32_t	reserved32;
84576 	uint64_t	wr_id;
84577 	/*
84578 	 * Opaque value used by upper layer SW to identify the id of the
84579 	 * WR which generated the WQE. Used in CQE. Valid in the first
84580 	 * SGE of an SRQ WQE.
84581 	 */
84582 	#define RQ_WQE_HDR_WR_ID_MASK UINT32_C(0xfffff)
84583 	#define RQ_WQE_HDR_WR_ID_SFT 0
84584 	uint8_t	reserved128[16];
84585 } rq_wqe_hdr_t, *prq_wqe_hdr_t;
84586 
84587 /* RQ/SRQ WQE V3 */
84588 /* rq_wqe_v3 (size:4096b/512B) */
84589 
84590 typedef struct rq_wqe_v3 {
84591 	/* wqe_type is 8 b */
84592 	uint8_t	wqe_type;
84593 	/*
84594 	 * RQ/SRQ WQE V3. This WQE is used for posting buffers on
84595 	 * an RQ or SRQ.
84596 	 */
84597 	#define RQ_WQE_V3_WQE_TYPE_RCV_V3 UINT32_C(0x90)
84598 	#define RQ_WQE_V3_WQE_TYPE_LAST  RQ_WQE_V3_WQE_TYPE_RCV_V3
84599 	/* No flags supported for this WQE type. */
84600 	uint8_t	flags;
84601 	/*
84602 	 * Specify the total number 16B chunks that make up the valid portion
84603 	 * of the WQE. This includes the first chunk that is the WQE
84604 	 * structure and up to 30 SGE structures. The maximum value for this
84605 	 * field is 32, representing a maximum-sized WQE of 512B.
84606 	 */
84607 	uint8_t	wqe_size;
84608 	uint8_t	reserved1;
84609 	/* This value will be returned in the completion. */
84610 	uint32_t	opaque;
84611 	uint64_t	reserved2;
84612 	/*
84613 	 * The data field for RQ WQE is filled with from 1 to 30 SGE
84614 	 * structures as defined by the wqe_size field.
84615 	 */
84616 	uint32_t	data[124];
84617 } rq_wqe_v3_t, *prq_wqe_v3_t;
84618 
84619 /* RQ/SRQ WQE V3 header. */
84620 /* rq_wqe_hdr_v3 (size:128b/16B) */
84621 
84622 typedef struct rq_wqe_hdr_v3 {
84623 	/* wqe_type is 8 b */
84624 	uint8_t	wqe_type;
84625 	/*
84626 	 * RQ/SRQ WQE V3. This WQE is used for posting buffers on
84627 	 * an RQ or SRQ.
84628 	 */
84629 	#define RQ_WQE_HDR_V3_WQE_TYPE_RCV_V3 UINT32_C(0x90)
84630 	#define RQ_WQE_HDR_V3_WQE_TYPE_LAST  RQ_WQE_HDR_V3_WQE_TYPE_RCV_V3
84631 	/* No flags supported for this WQE type. */
84632 	uint8_t	flags;
84633 	/*
84634 	 * Specify the total number 16B chunks that make up the valid portion
84635 	 * of the WQE. This includes the first chunk that is the WQE
84636 	 * structure and up to 30 SGE structures. The maximum value for this
84637 	 * field is 32, representing a maximum-sized WQE of 512B.
84638 	 */
84639 	uint8_t	wqe_size;
84640 	uint8_t	reserved1;
84641 	/* This value will be returned in the completion. */
84642 	uint32_t	opaque;
84643 	uint64_t	reserved2;
84644 } rq_wqe_hdr_v3_t, *prq_wqe_hdr_v3_t;
84645 
84646 /* cq_base (size:256b/32B) */
84647 
84648 typedef struct cq_base {
84649 	uint64_t	reserved64_1;
84650 	uint64_t	reserved64_2;
84651 	uint64_t	reserved64_3;
84652 	uint8_t	cqe_type_toggle;
84653 	/*
84654 	 * Indicate valid completion - written by the chip. The NIC
84655 	 * toggle this bit each time it finished consuming all PBL
84656 	 * entries.
84657 	 */
84658 	#define CQ_BASE_TOGGLE			UINT32_C(0x1)
84659 	/* This field defines the type of CQE. */
84660 	#define CQ_BASE_CQE_TYPE_MASK		UINT32_C(0x1e)
84661 	#define CQ_BASE_CQE_TYPE_SFT		1
84662 	/*
84663 	 * Requester completion - This is used for both RC and UD SQ
84664 	 * completions.
84665 	 */
84666 		#define CQ_BASE_CQE_TYPE_REQ		(UINT32_C(0x0) << 1)
84667 	/*
84668 	 * Responder RC Completion - This is used for both RQ and SRQ
84669 	 * completions for RC service QPs.
84670 	 */
84671 		#define CQ_BASE_CQE_TYPE_RES_RC		(UINT32_C(0x1) << 1)
84672 	/*
84673 	 * Responder UD Completion - This is used for both RQ and SRQ
84674 	 * completion for UD service QPs.
84675 	 */
84676 		#define CQ_BASE_CQE_TYPE_RES_UD		(UINT32_C(0x2) << 1)
84677 	/*
84678 	 * Responder RawEth and QP1 Completion - This is used for RQ
84679 	 * completion for RawEth service and QP1 service QPs.
84680 	 */
84681 		#define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1	(UINT32_C(0x3) << 1)
84682 	/*
84683 	 * Responder UD completion with CFA. This is used for both RQ
84684 	 * and SQ completion for UD service QPs. It includes cfa fields
84685 	 * (some of which carry VLAN information), in place of QP handle.
84686 	 */
84687 		#define CQ_BASE_CQE_TYPE_RES_UD_CFA	(UINT32_C(0x4) << 1)
84688 	/*
84689 	 * Requester completion V3 - This is used for both RC and UD SQ
84690 	 * completions.
84691 	 */
84692 		#define CQ_BASE_CQE_TYPE_REQ_V3		(UINT32_C(0x8) << 1)
84693 	/*
84694 	 * Responder RC Completion V3 - This is used for both RQ and SRQ
84695 	 * completions for RC service QPs.
84696 	 */
84697 		#define CQ_BASE_CQE_TYPE_RES_RC_V3	(UINT32_C(0x9) << 1)
84698 	/*
84699 	 * Responder UD Completion V3 - This is used for both RQ and SRQ
84700 	 * completion for UD service QPs. It is also used for QP1 QPs
84701 	 * that are treated as UD.
84702 	 */
84703 		#define CQ_BASE_CQE_TYPE_RES_UD_V3	(UINT32_C(0xa) << 1)
84704 	/*
84705 	 * Responder RawEth and QP1 Completion V3 - This is used for RQ and
84706 	 * SRQ completion for RawEth service. It is also used for QP1 QPs
84707 	 * that are treated as RawEth.
84708 	 */
84709 		#define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1_V3  (UINT32_C(0xb) << 1)
84710 	/*
84711 	 * Responder UD Completion with CFA V3 - This is used for both RQ
84712 	 * and SRQ completion for UD service QPs. It includes CFA fields
84713 	 * (some of which carry VLAN information), in place of the QP
84714 	 * handle. It is also used for QP1 QPs that are treated as UD.
84715 	 */
84716 		#define CQ_BASE_CQE_TYPE_RES_UD_CFA_V3	(UINT32_C(0xc) << 1)
84717 	/*
84718 	 * NO_OP completion - This is used to indicate that no
84719 	 * operation completed.
84720 	 */
84721 		#define CQ_BASE_CQE_TYPE_NO_OP		(UINT32_C(0xd) << 1)
84722 	/*
84723 	 * Terminal completion - This is used to indicate that no
84724 	 * further completions will be made for this QP on this CQ.
84725 	 */
84726 		#define CQ_BASE_CQE_TYPE_TERMINAL	(UINT32_C(0xe) << 1)
84727 	/*
84728 	 * Cut off CQE; for CQ resize. This CQE is written to the "old"
84729 	 * CQ as the last CQE written. SW may use this to know when the
84730 	 * "old" CQ can be destroyed.
84731 	 */
84732 		#define CQ_BASE_CQE_TYPE_CUT_OFF		(UINT32_C(0xf) << 1)
84733 		#define CQ_BASE_CQE_TYPE_LAST		CQ_BASE_CQE_TYPE_CUT_OFF
84734 	/* This field indicates the status for the CQE. */
84735 	uint8_t	status;
84736 	/* The operation completed successfully. */
84737 	#define CQ_BASE_STATUS_OK			UINT32_C(0x0)
84738 	/*
84739 	 * An unexpected BTH opcode or a First/Middle packet that is not
84740 	 * the full MTU size was returned by the responder.
84741 	 *
84742 	 * This is a fatal error detected by the requester Rx.
84743 	 */
84744 	#define CQ_BASE_STATUS_BAD_RESPONSE_ERR	UINT32_C(0x1)
84745 	/*
84746 	 * Generated for a WQE posted to the local SQ when the sum of the
84747 	 * lengths of the SGEs in the WQE exceeds the maximum message
84748 	 * length of 2^31 bytes.
84749 	 *
84750 	 * Generated for a WQE posted to the local RQ/SRQ when the sum of
84751 	 * the lengths of the SGEs in the WQE is too small to receive the
84752 	 * (valid) incoming message or the length of the incoming message
84753 	 * is greater than the maximum message size supported.
84754 	 *
84755 	 * This is a fatal error detected by the requester Tx or responder
84756 	 * Rx. For responder CQEs, only the opaque field is valid.
84757 	 */
84758 	#define CQ_BASE_STATUS_LOCAL_LENGTH_ERR	UINT32_C(0x2)
84759 	/*
84760 	 * This indicates that the packet was too long for the WQE provided
84761 	 * on the SRQ/RQ.
84762 	 *
84763 	 * This is not a fatal error. All the fields in the CQE are valid.
84764 	 */
84765 	#define CQ_BASE_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x3)
84766 	/*
84767 	 * An internal QP consistency error was detected while processing
84768 	 * this Work Request. For requester, this could be an SQ WQE format
84769 	 * error or an operation specified in the WQE that is not supported
84770 	 * for the QP. For responder, this is an RQ/SRQ WQE format error.
84771 	 *
84772 	 * This is a fatal error detected by the requester Tx or responder
84773 	 * Rx. For responder CQEs, only the opaque field is valid.
84774 	 */
84775 	#define CQ_BASE_STATUS_LOCAL_QP_OPERATION_ERR	UINT32_C(0x4)
84776 	/*
84777 	 * An SGE in the locally posted WQE does not reference a Memory
84778 	 * Region that is valid for the requested operation. If this error
84779 	 * is generated for an SGE using the reserved l_key, this means
84780 	 * that the reserved l_key is not enabled.
84781 	 *
84782 	 * This is a fatal error detected by the requester Tx or responder
84783 	 * Rx. For responder CQEs, only the opaque field is valid.
84784 	 */
84785 	#define CQ_BASE_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x5)
84786 	/*
84787 	 * A protection error occurred on a local data buffer during the
84788 	 * processing of a RDMA Write with Immediate Data operation sent
84789 	 * from the remote node.
84790 	 *
84791 	 * This is a fatal error detected by the responder Rx. Only the
84792 	 * opaque field in the CQE is valid.
84793 	 */
84794 	#define CQ_BASE_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x6)
84795 	/*
84796 	 * The SSC detected an error on a local memory operation from the
84797 	 * SQ (fast-register, local invalidate, or bind).
84798 	 *
84799 	 * This is a fatal error detected by the requester Tx.
84800 	 */
84801 	#define CQ_BASE_STATUS_MEMORY_MGT_OPERATION_ERR   UINT32_C(0x7)
84802 	/*
84803 	 * An invalid message was received by the responder. This could be
84804 	 * an operation that is not supported by this QP, an IRRQ overflow
84805 	 * error, or the length in an RDMA operation is greater than the
84806 	 * maximum message size (2^31 bytes).
84807 	 *
84808 	 * This is a fatal error detected by the responder and communicated
84809 	 * back to the requester using a NAK-Invalid Request. For responder
84810 	 * CQEs, only the opaque field is valid.
84811 	 */
84812 	#define CQ_BASE_STATUS_REMOTE_INVALID_REQUEST_ERR UINT32_C(0x8)
84813 	/*
84814 	 * A protection error occurred on a remote data buffer to be read
84815 	 * by an RDMA Read, written by an RDMA Write or accessed by an
84816 	 * atomic operation. This error is reported only on RDMA operations
84817 	 * or atomic operations.
84818 	 *
84819 	 * This is a fatal error detected by the responder and communicated
84820 	 * back to the requester using a NAK-Remote Access Violation.
84821 	 */
84822 	#define CQ_BASE_STATUS_REMOTE_ACCESS_ERR	UINT32_C(0x9)
84823 	/*
84824 	 * The operation could not be completed successfully by the
84825 	 * responder. Possible causes include an RQ/SRQ WQE format error,
84826 	 * an SSC error when validating an SGE from an RQ/SRQ WQE, or the
84827 	 * message received was too long for the RQ/SRQ WQE.
84828 	 *
84829 	 * This is a fatal error detected by the responder and communicated
84830 	 * back to the requester using a NAK-Remote Operation Error.
84831 	 */
84832 	#define CQ_BASE_STATUS_REMOTE_OPERATION_ERR	UINT32_C(0xa)
84833 	/*
84834 	 * The RNR NAK retry count was exceeded while trying to send this
84835 	 * message.
84836 	 *
84837 	 * This is a fatal error detected by the requester.
84838 	 */
84839 	#define CQ_BASE_STATUS_RNR_NAK_RETRY_CNT_ERR	UINT32_C(0xb)
84840 	/*
84841 	 * The local transport timeout retry counter was exceeded while
84842 	 * trying to send this message.
84843 	 *
84844 	 * This is a fatal error detected by the requester.
84845 	 */
84846 	#define CQ_BASE_STATUS_TRANSPORT_RETRY_CNT_ERR	UINT32_C(0xc)
84847 	/*
84848 	 * A WQE was in process or outstanding when the QP transitioned
84849 	 * into the Error State.
84850 	 */
84851 	#define CQ_BASE_STATUS_WORK_REQUEST_FLUSHED_ERR   UINT32_C(0xd)
84852 	/*
84853 	 * A WQE had already been taken off the RQ/SRQ when a fatal error
84854 	 * was detected on responder Rx. Only the opaque field in the CQE
84855 	 * is valid.
84856 	 */
84857 	#define CQ_BASE_STATUS_HW_FLUSH_ERR		UINT32_C(0xe)
84858 	/*
84859 	 * A WQE was posted to the SQ/RQ that caused it to overflow. For
84860 	 * requester CQEs, it was the SQ that overflowed. For responder
84861 	 * CQEs, it was the RQ that overflowed.
84862 	 */
84863 	#define CQ_BASE_STATUS_OVERFLOW_ERR		UINT32_C(0xf)
84864 	#define CQ_BASE_STATUS_LAST			CQ_BASE_STATUS_OVERFLOW_ERR
84865 	uint16_t	reserved16;
84866 	/*
84867 	 * This value is from the WQE that is being completed. This field is
84868 	 * only applicable to V3 version of CQEs.
84869 	 */
84870 	uint32_t	opaque;
84871 } cq_base_t, *pcq_base_t;
84872 
84873 /* Requester CQ CQE */
84874 /* cq_req (size:256b/32B) */
84875 
84876 typedef struct cq_req {
84877 	/*
84878 	 * This is an application level ID used to identify the
84879 	 * QP and its SQ and RQ.
84880 	 */
84881 	uint64_t	qp_handle;
84882 	/*
84883 	 * SQ Consumer Index - points to the entry just past the last WQE
84884 	 * that has been completed by the chip. Wraps around at
84885 	 * QPC.sq_size (i.e. the valid range of the SQ Consumer Index is 0
84886 	 * to (QPC.sq_size - 1)).
84887 	 */
84888 	uint16_t	sq_cons_idx;
84889 	uint16_t	reserved16_1;
84890 	uint32_t	reserved32_2;
84891 	uint64_t	reserved64;
84892 	uint8_t	cqe_type_toggle;
84893 	/*
84894 	 * Indicate valid completion - written by the chip. Cumulus
84895 	 * toggle this bit each time it finished consuming all PBL
84896 	 * entries
84897 	 */
84898 	#define CQ_REQ_TOGGLE	UINT32_C(0x1)
84899 	/* This field defines the type of CQE. */
84900 	#define CQ_REQ_CQE_TYPE_MASK UINT32_C(0x1e)
84901 	#define CQ_REQ_CQE_TYPE_SFT 1
84902 	/*
84903 	 * Requester completion - This is used for both RC and UD SQ
84904 	 * completions.
84905 	 */
84906 		#define CQ_REQ_CQE_TYPE_REQ   (UINT32_C(0x0) << 1)
84907 		#define CQ_REQ_CQE_TYPE_LAST CQ_REQ_CQE_TYPE_REQ
84908 	/*
84909 	 * When this bit is '1', it indicates that the packet completed
84910 	 * was transmitted using the push accelerated data provided by
84911 	 * the driver. When this bit is '0', it indicates that the packet
84912 	 * had not push acceleration data written or was executed as a
84913 	 * normal packet even though push data was provided.
84914 	 * This field is intended to be used for driver-generated push
84915 	 * statistics. It is not applicable for RC since not all RC packets
84916 	 * return a CQE.
84917 	 */
84918 	#define CQ_REQ_PUSH	UINT32_C(0x20)
84919 	/* This field indicates the status for the CQE. */
84920 	uint8_t	status;
84921 	/* OK is 0 */
84922 	#define CQ_REQ_STATUS_OK			UINT32_C(0x0)
84923 	/* BAD_RESPONSE_ERR is 1 */
84924 	#define CQ_REQ_STATUS_BAD_RESPONSE_ERR	UINT32_C(0x1)
84925 	/* LOCAL_LENGTH_ERR is 2 */
84926 	#define CQ_REQ_STATUS_LOCAL_LENGTH_ERR	UINT32_C(0x2)
84927 	/* LOCAL_QP_OPERATION_ERR is 3 */
84928 	#define CQ_REQ_STATUS_LOCAL_QP_OPERATION_ERR	UINT32_C(0x3)
84929 	/* LOCAL_PROTECTION_ERR is 4 */
84930 	#define CQ_REQ_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x4)
84931 	/* MEMORY_MGT_OPERATION_ERR is 5 */
84932 	#define CQ_REQ_STATUS_MEMORY_MGT_OPERATION_ERR   UINT32_C(0x5)
84933 	/* REMOTE_INVALID_REQUEST_ERR is 6 */
84934 	#define CQ_REQ_STATUS_REMOTE_INVALID_REQUEST_ERR UINT32_C(0x6)
84935 	/* REMOTE_ACCESS_ERR is 7 */
84936 	#define CQ_REQ_STATUS_REMOTE_ACCESS_ERR	UINT32_C(0x7)
84937 	/* REMOTE_OPERATION_ERR is 8 */
84938 	#define CQ_REQ_STATUS_REMOTE_OPERATION_ERR	UINT32_C(0x8)
84939 	/* RNR_NAK_RETRY_CNT_ERR is 9 */
84940 	#define CQ_REQ_STATUS_RNR_NAK_RETRY_CNT_ERR	UINT32_C(0x9)
84941 	/* TRANSPORT_RETRY_CNT_ERR is 10 */
84942 	#define CQ_REQ_STATUS_TRANSPORT_RETRY_CNT_ERR	UINT32_C(0xa)
84943 	/* WORK_REQUEST_FLUSHED_ERR is 11 */
84944 	#define CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR   UINT32_C(0xb)
84945 	#define CQ_REQ_STATUS_LAST			CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR
84946 	uint16_t	reserved16_2;
84947 	uint32_t	reserved32_1;
84948 } cq_req_t, *pcq_req_t;
84949 
84950 /* Responder RC CQE */
84951 /* cq_res_rc (size:256b/32B) */
84952 
84953 typedef struct cq_res_rc {
84954 	/*
84955 	 * The length of the message's payload in bytes, stored in
84956 	 * the SGEs
84957 	 */
84958 	uint32_t	length;
84959 	/*
84960 	 * Immediate data in case the imm_flag set, R_Key to be
84961 	 * invalidated in case inv_flag is set.
84962 	 */
84963 	uint32_t	imm_data_or_inv_r_key;
84964 	/*
84965 	 * This is an application level ID used to identify the
84966 	 * QP and its SQ and RQ.
84967 	 */
84968 	uint64_t	qp_handle;
84969 	/*
84970 	 * Opaque value - valid when inv_flag is set. Used by driver
84971 	 * to reference the buffer used to store PBL when the MR was
84972 	 * fast registered. The driver can reclaim this buffer after
84973 	 * an MR was remotely invalidated. The controller take that
84974 	 * value from the MR referenced by R_Key
84975 	 */
84976 	uint64_t	mr_handle;
84977 	uint8_t	cqe_type_toggle;
84978 	/*
84979 	 * Indicate valid completion - written by the chip. Cumulus
84980 	 * toggle this bit each time it finished consuming all PBL
84981 	 * entries
84982 	 */
84983 	#define CQ_RES_RC_TOGGLE	UINT32_C(0x1)
84984 	/* This field defines the type of CQE. */
84985 	#define CQ_RES_RC_CQE_TYPE_MASK  UINT32_C(0x1e)
84986 	#define CQ_RES_RC_CQE_TYPE_SFT   1
84987 	/*
84988 	 * Responder RC Completion - This is used for both RQ and SRQ
84989 	 * completions for RC service QPs.
84990 	 */
84991 		#define CQ_RES_RC_CQE_TYPE_RES_RC  (UINT32_C(0x1) << 1)
84992 		#define CQ_RES_RC_CQE_TYPE_LAST   CQ_RES_RC_CQE_TYPE_RES_RC
84993 	/* This field indicates the status for the CQE. */
84994 	uint8_t	status;
84995 	/* OK is 0 */
84996 	#define CQ_RES_RC_STATUS_OK			UINT32_C(0x0)
84997 	/* LOCAL_ACCESS_ERROR is 1 */
84998 	#define CQ_RES_RC_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
84999 	/* LOCAL_LENGTH_ERR is 2 */
85000 	#define CQ_RES_RC_STATUS_LOCAL_LENGTH_ERR	UINT32_C(0x2)
85001 	/* LOCAL_PROTECTION_ERR is 3 */
85002 	#define CQ_RES_RC_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
85003 	/* LOCAL_QP_OPERATION_ERR is 4 */
85004 	#define CQ_RES_RC_STATUS_LOCAL_QP_OPERATION_ERR	UINT32_C(0x4)
85005 	/* MEMORY_MGT_OPERATION_ERR is 5 */
85006 	#define CQ_RES_RC_STATUS_MEMORY_MGT_OPERATION_ERR   UINT32_C(0x5)
85007 	/* REMOTE_INVALID_REQUEST_ERR is 6 */
85008 	#define CQ_RES_RC_STATUS_REMOTE_INVALID_REQUEST_ERR UINT32_C(0x6)
85009 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
85010 	#define CQ_RES_RC_STATUS_WORK_REQUEST_FLUSHED_ERR   UINT32_C(0x7)
85011 	/* HW_FLUSH_ERR is 8 */
85012 	#define CQ_RES_RC_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
85013 	#define CQ_RES_RC_STATUS_LAST			CQ_RES_RC_STATUS_HW_FLUSH_ERR
85014 	uint16_t	flags;
85015 	/*
85016 	 * This flag indicates that the completion is for a SRQ entry
85017 	 * rather than for an RQ entry.
85018 	 */
85019 	#define CQ_RES_RC_FLAGS_SRQ		UINT32_C(0x1)
85020 	/* CQE relates to RQ WQE. */
85021 		#define CQ_RES_RC_FLAGS_SRQ_RQ	UINT32_C(0x0)
85022 	/* CQE relates to SRQ WQE. */
85023 		#define CQ_RES_RC_FLAGS_SRQ_SRQ	UINT32_C(0x1)
85024 		#define CQ_RES_RC_FLAGS_SRQ_LAST	CQ_RES_RC_FLAGS_SRQ_SRQ
85025 	/* Immediate data indicator */
85026 	#define CQ_RES_RC_FLAGS_IMM		UINT32_C(0x2)
85027 	/* R_Key invalidate indicator */
85028 	#define CQ_RES_RC_FLAGS_INV		UINT32_C(0x4)
85029 	#define CQ_RES_RC_FLAGS_RDMA	UINT32_C(0x8)
85030 	/* CQE relates to an incoming Send request */
85031 		#define CQ_RES_RC_FLAGS_RDMA_SEND	(UINT32_C(0x0) << 3)
85032 	/* CQE relates to incoming RDMA Write request */
85033 		#define CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE  (UINT32_C(0x1) << 3)
85034 		#define CQ_RES_RC_FLAGS_RDMA_LAST	CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE
85035 	uint32_t	srq_or_rq_wr_id;
85036 	/*
85037 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
85038 	 * reference the WQE in order to claim the received data
85039 	 * and reuse the WQE space
85040 	 */
85041 	#define CQ_RES_RC_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
85042 	#define CQ_RES_RC_SRQ_OR_RQ_WR_ID_SFT 0
85043 } cq_res_rc_t, *pcq_res_rc_t;
85044 
85045 /* Responder UD CQE */
85046 /* cq_res_ud (size:256b/32B) */
85047 
85048 typedef struct cq_res_ud {
85049 	uint16_t	length;
85050 	/*
85051 	 * The length of the message's payload in bytes, stored in
85052 	 * the SGEs
85053 	 */
85054 	#define CQ_RES_UD_LENGTH_MASK UINT32_C(0x3fff)
85055 	#define CQ_RES_UD_LENGTH_SFT 0
85056 	/*
85057 	 * This is data from the CFA or VNIC block as indicated by the
85058 	 * ext_meta_format and meta_format fields.
85059 	 */
85060 	uint16_t	cfa_metadata;
85061 	/* When meta_format=1, this value is the VLAN VID. */
85062 	#define CQ_RES_UD_CFA_METADATA_VID_MASK UINT32_C(0xfff)
85063 	#define CQ_RES_UD_CFA_METADATA_VID_SFT 0
85064 	/* When meta_format=1, this value is the VLAN DE. */
85065 	#define CQ_RES_UD_CFA_METADATA_DE	UINT32_C(0x1000)
85066 	/* When meta_format=1, this value is the VLAN PRI. */
85067 	#define CQ_RES_UD_CFA_METADATA_PRI_MASK UINT32_C(0xe000)
85068 	#define CQ_RES_UD_CFA_METADATA_PRI_SFT 13
85069 	/* Immediate data in case the imm_flag set. */
85070 	uint32_t	imm_data;
85071 	/*
85072 	 * This is an application level ID used to identify the
85073 	 * QP and its SQ and RQ.
85074 	 */
85075 	uint64_t	qp_handle;
85076 	/*
85077 	 * Source MAC address for the UD message placed in the WQE
85078 	 * that is completed by this CQE.
85079 	 */
85080 	uint16_t	src_mac[3];
85081 	/* Lower 16b of the Source QP value from the DETH header. */
85082 	uint16_t	src_qp_low;
85083 	uint8_t	cqe_type_toggle;
85084 	/*
85085 	 * Indicate valid completion - written by the chip. Cumulus
85086 	 * toggle this bit each time it finished consuming all PBL
85087 	 * entries
85088 	 */
85089 	#define CQ_RES_UD_TOGGLE	UINT32_C(0x1)
85090 	/* This field defines the type of CQE. */
85091 	#define CQ_RES_UD_CQE_TYPE_MASK  UINT32_C(0x1e)
85092 	#define CQ_RES_UD_CQE_TYPE_SFT   1
85093 	/*
85094 	 * Responder UD Completion - This is used for both RQ and SRQ
85095 	 * completion for UD service QPs.
85096 	 */
85097 		#define CQ_RES_UD_CQE_TYPE_RES_UD  (UINT32_C(0x2) << 1)
85098 		#define CQ_RES_UD_CQE_TYPE_LAST   CQ_RES_UD_CQE_TYPE_RES_UD
85099 	/* This field indicates the status for the CQE. */
85100 	uint8_t	status;
85101 	/*
85102 	 * This indicates that the completion is without error.
85103 	 * All fields are valid.
85104 	 */
85105 	#define CQ_RES_UD_STATUS_OK			UINT32_C(0x0)
85106 	/*
85107 	 * This indicates that write access was not allowed for
85108 	 * at least one of the SGEs in the WQE.
85109 	 *
85110 	 * This is a fatal error. Only the srq_or_rq_wr_id is field
85111 	 * is valid.
85112 	 */
85113 	#define CQ_RES_UD_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
85114 	/*
85115 	 * This indicates that the packet was too long for the WQE
85116 	 * provided on the SRQ/RQ.
85117 	 *
85118 	 * This is not a fatal error. All the fields are valid.
85119 	 */
85120 	#define CQ_RES_UD_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
85121 	/* LOCAL_PROTECTION_ERR is 3 */
85122 	#define CQ_RES_UD_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
85123 	/* LOCAL_QP_OPERATION_ERR is 4 */
85124 	#define CQ_RES_UD_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
85125 	/* MEMORY_MGT_OPERATION_ERR is 5 */
85126 	#define CQ_RES_UD_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
85127 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
85128 	#define CQ_RES_UD_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
85129 	/* HW_FLUSH_ERR is 8 */
85130 	#define CQ_RES_UD_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
85131 	#define CQ_RES_UD_STATUS_LAST			CQ_RES_UD_STATUS_HW_FLUSH_ERR
85132 	uint16_t	flags;
85133 	/*
85134 	 * This flag indicates that the completion is for a SRQ entry
85135 	 * rather than for an RQ entry.
85136 	 */
85137 	#define CQ_RES_UD_FLAGS_SRQ		UINT32_C(0x1)
85138 	/* CQE relates to RQ WQE. */
85139 		#define CQ_RES_UD_FLAGS_SRQ_RQ		UINT32_C(0x0)
85140 	/* CQE relates to SRQ WQE. */
85141 		#define CQ_RES_UD_FLAGS_SRQ_SRQ		UINT32_C(0x1)
85142 		#define CQ_RES_UD_FLAGS_SRQ_LAST		CQ_RES_UD_FLAGS_SRQ_SRQ
85143 	/* Immediate data indicator */
85144 	#define CQ_RES_UD_FLAGS_IMM		UINT32_C(0x2)
85145 	#define CQ_RES_UD_FLAGS_UNUSED_MASK	UINT32_C(0xc)
85146 	#define CQ_RES_UD_FLAGS_UNUSED_SFT		2
85147 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_MASK	UINT32_C(0x30)
85148 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_SFT	4
85149 	/* RoCEv1 Message */
85150 		#define CQ_RES_UD_FLAGS_ROCE_IP_VER_V1	(UINT32_C(0x0) << 4)
85151 	/* RoCEv2 IPv4 Message */
85152 		#define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV4	(UINT32_C(0x2) << 4)
85153 	/* RoCEv2 IPv6 Message */
85154 		#define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6	(UINT32_C(0x3) << 4)
85155 		#define CQ_RES_UD_FLAGS_ROCE_IP_VER_LAST	CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6
85156 	/*
85157 	 * The combination of this value and ext_meta_format indicates
85158 	 * what format the metadata field is.
85159 	 */
85160 	#define CQ_RES_UD_FLAGS_META_FORMAT_MASK	UINT32_C(0x3c0)
85161 	#define CQ_RES_UD_FLAGS_META_FORMAT_SFT	6
85162 	/* No metadata information. Value is zero. */
85163 		#define CQ_RES_UD_FLAGS_META_FORMAT_NONE	(UINT32_C(0x0) << 6)
85164 	/*
85165 	 * The metadata field contains the VLAN tag and TPID value.
85166 	 * - metadata[11:0] contains the vlan VID value.
85167 	 * - metadata[12] contains the vlan DE value.
85168 	 * - metadata[15:13] contains the vlan PRI value.
85169 	 */
85170 		#define CQ_RES_UD_FLAGS_META_FORMAT_VLAN	(UINT32_C(0x1) << 6)
85171 	/*
85172 	 * If ext_meta_format is equal to 1, the metadata field
85173 	 * contains the lower 16b of the tunnel ID value, justified
85174 	 * to LSB
85175 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
85176 	 * - Geneve (NGE) = VNI[23:0] -> Virtual Network Identifier.
85177 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
85178 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
85179 	 * - IPV4 = 0 (not populated)
85180 	 * - IPV6 = Flow Label[19:0]
85181 	 * - PPPoE = sessionID[15:0]
85182 	 * - MPLs = Outer label[19:0]
85183 	 * - UPAR = Selected[31:0] with bit mask
85184 	 */
85185 		#define CQ_RES_UD_FLAGS_META_FORMAT_TUNNEL_ID   (UINT32_C(0x2) << 6)
85186 	/*
85187 	 * if ext_meta_format is equal to 1, metadata field contains
85188 	 * 16b metadata from the prepended header (chdr_data).
85189 	 */
85190 		#define CQ_RES_UD_FLAGS_META_FORMAT_CHDR_DATA   (UINT32_C(0x3) << 6)
85191 	/*
85192 	 * If ext_meta_format is equal to 1, the metadata field contains
85193 	 * the outer_l3_offset and lower 7 bits of the inner_l2_offset,
85194 	 * - metadata[8:0] contains the outer_l3_offset.
85195 	 * - metadata[15:9] contains the inner_l2_offset[6:0]
85196 	 */
85197 		#define CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET  (UINT32_C(0x4) << 6)
85198 		#define CQ_RES_UD_FLAGS_META_FORMAT_LAST	CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET
85199 	/*
85200 	 * The combination of this value and meta_format indicates what
85201 	 * format the metadata field is
85202 	 */
85203 	#define CQ_RES_UD_FLAGS_EXT_META_FORMAT_MASK  UINT32_C(0xc00)
85204 	#define CQ_RES_UD_FLAGS_EXT_META_FORMAT_SFT   10
85205 	uint32_t	src_qp_high_srq_or_rq_wr_id;
85206 	/*
85207 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
85208 	 * reference the WQE in order to claim the received data
85209 	 * and reuse the WQE space
85210 	 */
85211 	#define CQ_RES_UD_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
85212 	#define CQ_RES_UD_SRQ_OR_RQ_WR_ID_SFT 0
85213 	/* Upper 8b of the Source QP value from the DETH header. */
85214 	#define CQ_RES_UD_SRC_QP_HIGH_MASK	UINT32_C(0xff000000)
85215 	#define CQ_RES_UD_SRC_QP_HIGH_SFT	24
85216 } cq_res_ud_t, *pcq_res_ud_t;
85217 
85218 /* Responder UD CQE version 2 */
85219 /* cq_res_ud_v2 (size:256b/32B) */
85220 
85221 typedef struct cq_res_ud_v2 {
85222 	uint16_t	length;
85223 	/*
85224 	 * The length of the message's payload in bytes, stored in
85225 	 * the SGEs
85226 	 */
85227 	#define CQ_RES_UD_V2_LENGTH_MASK UINT32_C(0x3fff)
85228 	#define CQ_RES_UD_V2_LENGTH_SFT 0
85229 	/* This is data from the CFA as indicated by the meta_format field. */
85230 	uint16_t	cfa_metadata0;
85231 	/* When meta_format=1, this value is the VLAN VID. */
85232 	#define CQ_RES_UD_V2_CFA_METADATA0_VID_MASK UINT32_C(0xfff)
85233 	#define CQ_RES_UD_V2_CFA_METADATA0_VID_SFT 0
85234 	/* When meta_format=1, this value is the VLAN DE. */
85235 	#define CQ_RES_UD_V2_CFA_METADATA0_DE	UINT32_C(0x1000)
85236 	/* When meta_format=1, this value is the VLAN PRI. */
85237 	#define CQ_RES_UD_V2_CFA_METADATA0_PRI_MASK UINT32_C(0xe000)
85238 	#define CQ_RES_UD_V2_CFA_METADATA0_PRI_SFT 13
85239 	/* Immediate data in case the imm_flag set. */
85240 	uint32_t	imm_data;
85241 	/*
85242 	 * This is an application level ID used to identify the
85243 	 * QP and its SQ and RQ.
85244 	 */
85245 	uint64_t	qp_handle;
85246 	/*
85247 	 * Source MAC address for the UD message placed in the WQE
85248 	 * that is completed by this CQE.
85249 	 */
85250 	uint16_t	src_mac[3];
85251 	/* Lower 16b of the Source QP value from the DETH header. */
85252 	uint16_t	src_qp_low;
85253 	uint8_t	cqe_type_toggle;
85254 	/*
85255 	 * Indicate valid completion - written by the chip. Cumulus
85256 	 * toggle this bit each time it finished consuming all PBL
85257 	 * entries
85258 	 */
85259 	#define CQ_RES_UD_V2_TOGGLE	UINT32_C(0x1)
85260 	/* This field defines the type of CQE. */
85261 	#define CQ_RES_UD_V2_CQE_TYPE_MASK  UINT32_C(0x1e)
85262 	#define CQ_RES_UD_V2_CQE_TYPE_SFT   1
85263 	/*
85264 	 * Responder UD Completion - This is used for both RQ and SRQ
85265 	 * completion for UD service QPs.
85266 	 */
85267 		#define CQ_RES_UD_V2_CQE_TYPE_RES_UD  (UINT32_C(0x2) << 1)
85268 		#define CQ_RES_UD_V2_CQE_TYPE_LAST   CQ_RES_UD_V2_CQE_TYPE_RES_UD
85269 	/* This field indicates the status for the CQE. */
85270 	uint8_t	status;
85271 	/*
85272 	 * This indicates that the completion is without error.
85273 	 * All fields are valid.
85274 	 */
85275 	#define CQ_RES_UD_V2_STATUS_OK			UINT32_C(0x0)
85276 	/*
85277 	 * This indicates that write access was not allowed for
85278 	 * at least one of the SGEs in the WQE.
85279 	 *
85280 	 * This is a fatal error. Only the srq_or_rq_wr_id is field
85281 	 * is valid.
85282 	 */
85283 	#define CQ_RES_UD_V2_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
85284 	/*
85285 	 * This indicates that the packet was too long for the WQE
85286 	 * provided on the SRQ/RQ.
85287 	 *
85288 	 * This is not a fatal error. All the fields are valid.
85289 	 */
85290 	#define CQ_RES_UD_V2_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
85291 	/* LOCAL_PROTECTION_ERR is 3 */
85292 	#define CQ_RES_UD_V2_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
85293 	/* LOCAL_QP_OPERATION_ERR is 4 */
85294 	#define CQ_RES_UD_V2_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
85295 	/* MEMORY_MGT_OPERATION_ERR is 5 */
85296 	#define CQ_RES_UD_V2_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
85297 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
85298 	#define CQ_RES_UD_V2_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
85299 	/* HW_FLUSH_ERR is 8 */
85300 	#define CQ_RES_UD_V2_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
85301 	#define CQ_RES_UD_V2_STATUS_LAST			CQ_RES_UD_V2_STATUS_HW_FLUSH_ERR
85302 	uint16_t	flags;
85303 	/*
85304 	 * This flag indicates that the completion is for a SRQ entry
85305 	 * rather than for an RQ entry.
85306 	 */
85307 	#define CQ_RES_UD_V2_FLAGS_SRQ			UINT32_C(0x1)
85308 	/* CQE relates to RQ WQE. */
85309 		#define CQ_RES_UD_V2_FLAGS_SRQ_RQ		UINT32_C(0x0)
85310 	/* CQE relates to SRQ WQE. */
85311 		#define CQ_RES_UD_V2_FLAGS_SRQ_SRQ		UINT32_C(0x1)
85312 		#define CQ_RES_UD_V2_FLAGS_SRQ_LAST		CQ_RES_UD_V2_FLAGS_SRQ_SRQ
85313 	/* Immediate data indicator */
85314 	#define CQ_RES_UD_V2_FLAGS_IMM			UINT32_C(0x2)
85315 	#define CQ_RES_UD_V2_FLAGS_UNUSED_MASK		UINT32_C(0xc)
85316 	#define CQ_RES_UD_V2_FLAGS_UNUSED_SFT		2
85317 	#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_MASK	UINT32_C(0x30)
85318 	#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_SFT	4
85319 	/* RoCEv1 Message */
85320 		#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V1	(UINT32_C(0x0) << 4)
85321 	/* RoCEv2 IPv4 Message */
85322 		#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV4	(UINT32_C(0x2) << 4)
85323 	/* RoCEv2 IPv6 Message */
85324 		#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV6	(UINT32_C(0x3) << 4)
85325 		#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_LAST	CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV6
85326 	/* The field indicates what format the metadata field is. */
85327 	#define CQ_RES_UD_V2_FLAGS_META_FORMAT_MASK	UINT32_C(0x3c0)
85328 	#define CQ_RES_UD_V2_FLAGS_META_FORMAT_SFT	6
85329 	/* No metadata information. Value is zero. */
85330 		#define CQ_RES_UD_V2_FLAGS_META_FORMAT_NONE	(UINT32_C(0x0) << 6)
85331 	/*
85332 	 * The {metadata1, metadata0} fields contain the vtag
85333 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
85334 	 * de, vid[11:0]} The metadata2 field contains the table scope
85335 	 * and action record pointer. - metadata2[25:0] contains the
85336 	 * action record pointer. - metadata2[31:26] contains the table
85337 	 * scope.
85338 	 */
85339 		#define CQ_RES_UD_V2_FLAGS_META_FORMAT_ACT_REC_PTR  (UINT32_C(0x1) << 6)
85340 	/*
85341 	 * The {metadata1, metadata0} fields contain the vtag
85342 	 * information:
85343 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
85344 	 * The metadata2 field contains the Tunnel ID
85345 	 * value, justified to LSB. i
85346 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
85347 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
85348 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
85349 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
85350 	 * - IPv4 = 0 (not populated)
85351 	 * - IPv6 = Flow Label[19:0]
85352 	 * - PPPoE = sessionID[15:0]
85353 	 * - MPLs = Outer label[19:0]
85354 	 * - UPAR = Selected[31:0] with bit mask
85355 	 */
85356 		#define CQ_RES_UD_V2_FLAGS_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 6)
85357 	/*
85358 	 * The {metadata1, metadata0} fields contain the vtag
85359 	 * information:
85360 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
85361 	 * The metadata2 field contains the 32b metadata from the
85362 	 * prepended header (chdr_data).
85363 	 */
85364 		#define CQ_RES_UD_V2_FLAGS_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 6)
85365 	/*
85366 	 * If ext_meta_format is equal to 1, the metadata field contains
85367 	 * the outer_l3_offset and lower 7 bits of the inner_l2_offset,
85368 	 * - metadata[8:0] contains the outer_l3_offset.
85369 	 * - metadata[15:9] contains the inner_l2_offset[6:0]
85370 	 */
85371 		#define CQ_RES_UD_V2_FLAGS_META_FORMAT_HDR_OFFSET   (UINT32_C(0x4) << 6)
85372 		#define CQ_RES_UD_V2_FLAGS_META_FORMAT_LAST	CQ_RES_UD_V2_FLAGS_META_FORMAT_HDR_OFFSET
85373 	uint32_t	src_qp_high_srq_or_rq_wr_id;
85374 	/*
85375 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
85376 	 * reference the WQE in order to claim the received data
85377 	 * and reuse the WQE space
85378 	 */
85379 	#define CQ_RES_UD_V2_SRQ_OR_RQ_WR_ID_MASK	UINT32_C(0xfffff)
85380 	#define CQ_RES_UD_V2_SRQ_OR_RQ_WR_ID_SFT		0
85381 	#define CQ_RES_UD_V2_CFA_METADATA1_MASK		UINT32_C(0xf00000)
85382 	#define CQ_RES_UD_V2_CFA_METADATA1_SFT		20
85383 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
85384 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_MASK	UINT32_C(0x700000)
85385 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_SFT	20
85386 	/* 0x88a8 */
85387 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 20)
85388 	/* 0x8100 */
85389 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 20)
85390 	/* 0x9100 */
85391 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 20)
85392 	/* 0x9200 */
85393 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 20)
85394 	/* 0x9300 */
85395 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 20)
85396 	/* Value programmed in CFA VLANTPID register. */
85397 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 20)
85398 		#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_LAST	CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPIDCFG
85399 	/* When meta_format != 0, this value is the VLAN valid. */
85400 	#define CQ_RES_UD_V2_CFA_METADATA1_VALID		UINT32_C(0x800000)
85401 	/* Upper 8b of the Source QP value from the DETH header. */
85402 	#define CQ_RES_UD_V2_SRC_QP_HIGH_MASK		UINT32_C(0xff000000)
85403 	#define CQ_RES_UD_V2_SRC_QP_HIGH_SFT		24
85404 } cq_res_ud_v2_t, *pcq_res_ud_v2_t;
85405 
85406 /* Responder UD with CFA CQE */
85407 /* cq_res_ud_cfa (size:256b/32B) */
85408 
85409 typedef struct cq_res_ud_cfa {
85410 	uint16_t	length;
85411 	/*
85412 	 * The length of the message's payload in bytes, stored in
85413 	 * the SGEs
85414 	 */
85415 	#define CQ_RES_UD_CFA_LENGTH_MASK UINT32_C(0x3fff)
85416 	#define CQ_RES_UD_CFA_LENGTH_SFT 0
85417 	/*
85418 	 * This field identifies the CFA action rule that was used
85419 	 * for this packet.
85420 	 */
85421 	uint16_t	cfa_code;
85422 	/* Immediate data in case the imm_flag set. */
85423 	uint32_t	imm_data;
85424 	uint32_t	qid;
85425 	/*
85426 	 * This value indicates the QPID associated with this operation.
85427 	 * The driver will use the qid from this CQE to map a QP handle
85428 	 * in the completion record returned to the application.
85429 	 */
85430 	#define CQ_RES_UD_CFA_QID_MASK UINT32_C(0xfffff)
85431 	#define CQ_RES_UD_CFA_QID_SFT 0
85432 	/*
85433 	 * This is data from the CFA or VNIC block as indicated by the
85434 	 * ext_meta_format and meta_format fields.
85435 	 */
85436 	uint32_t	cfa_metadata;
85437 	/* When meta_format=1, this value is the VLAN VID. */
85438 	#define CQ_RES_UD_CFA_CFA_METADATA_VID_MASK UINT32_C(0xfff)
85439 	#define CQ_RES_UD_CFA_CFA_METADATA_VID_SFT  0
85440 	/* When meta_format=1, this value is the VLAN DE. */
85441 	#define CQ_RES_UD_CFA_CFA_METADATA_DE	UINT32_C(0x1000)
85442 	/* When meta_format=1, this value is the VLAN PRI. */
85443 	#define CQ_RES_UD_CFA_CFA_METADATA_PRI_MASK UINT32_C(0xe000)
85444 	#define CQ_RES_UD_CFA_CFA_METADATA_PRI_SFT  13
85445 	/* When meta_format=1, this value is the VLAN TPID. */
85446 	#define CQ_RES_UD_CFA_CFA_METADATA_TPID_MASK UINT32_C(0xffff0000)
85447 	#define CQ_RES_UD_CFA_CFA_METADATA_TPID_SFT 16
85448 	/*
85449 	 * Source MAC address for the UD message placed in the WQE
85450 	 * that is completed by this CQE.
85451 	 */
85452 	uint16_t	src_mac[3];
85453 	/* Lower 16b of the Source QP value from the DETH header. */
85454 	uint16_t	src_qp_low;
85455 	uint8_t	cqe_type_toggle;
85456 	/*
85457 	 * Indicate valid completion - written by the chip. Cumulus
85458 	 * toggle this bit each time it finished consuming all PBL
85459 	 * entries
85460 	 */
85461 	#define CQ_RES_UD_CFA_TOGGLE		UINT32_C(0x1)
85462 	/* This field defines the type of CQE. */
85463 	#define CQ_RES_UD_CFA_CQE_TYPE_MASK	UINT32_C(0x1e)
85464 	#define CQ_RES_UD_CFA_CQE_TYPE_SFT	1
85465 	/*
85466 	 * Responder UD Completion with CFA - This is used for both RQ
85467 	 * and SRQ completion for UD service QPs. It includes cfa fields
85468 	 * (some of which carry VLAN information), in place of the QP
85469 	 * handle. It is also used for QP1 QPs that are treated as UD.
85470 	 */
85471 		#define CQ_RES_UD_CFA_CQE_TYPE_RES_UD_CFA  (UINT32_C(0x4) << 1)
85472 		#define CQ_RES_UD_CFA_CQE_TYPE_LAST	CQ_RES_UD_CFA_CQE_TYPE_RES_UD_CFA
85473 	/* This field indicates the status for the CQE. */
85474 	uint8_t	status;
85475 	/*
85476 	 * This indicates that the completion is without error.
85477 	 * All fields are valid.
85478 	 */
85479 	#define CQ_RES_UD_CFA_STATUS_OK			UINT32_C(0x0)
85480 	/*
85481 	 * This indicates that write access was not allowed for
85482 	 * at least one of the SGEs in the WQE.
85483 	 *
85484 	 * This is a fatal error. Only the srq_or_rq_wr_id is field
85485 	 * is valid.
85486 	 */
85487 	#define CQ_RES_UD_CFA_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
85488 	/*
85489 	 * This indicates that the packet was too long for the WQE
85490 	 * provided on the SRQ/RQ.
85491 	 *
85492 	 * This is not a fatal error. All the fields are valid.
85493 	 */
85494 	#define CQ_RES_UD_CFA_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
85495 	/* LOCAL_PROTECTION_ERR is 3 */
85496 	#define CQ_RES_UD_CFA_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
85497 	/* LOCAL_QP_OPERATION_ERR is 4 */
85498 	#define CQ_RES_UD_CFA_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
85499 	/* MEMORY_MGT_OPERATION_ERR is 5 */
85500 	#define CQ_RES_UD_CFA_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
85501 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
85502 	#define CQ_RES_UD_CFA_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
85503 	/* HW_FLUSH_ERR is 8 */
85504 	#define CQ_RES_UD_CFA_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
85505 	#define CQ_RES_UD_CFA_STATUS_LAST			CQ_RES_UD_CFA_STATUS_HW_FLUSH_ERR
85506 	uint16_t	flags;
85507 	/*
85508 	 * This flag indicates that the completion is for a SRQ entry
85509 	 * rather than for an RQ entry.
85510 	 */
85511 	#define CQ_RES_UD_CFA_FLAGS_SRQ		UINT32_C(0x1)
85512 	/* CQE relates to RQ WQE. */
85513 		#define CQ_RES_UD_CFA_FLAGS_SRQ_RQ		UINT32_C(0x0)
85514 	/* CQE relates to SRQ WQE. */
85515 		#define CQ_RES_UD_CFA_FLAGS_SRQ_SRQ		UINT32_C(0x1)
85516 		#define CQ_RES_UD_CFA_FLAGS_SRQ_LAST		CQ_RES_UD_CFA_FLAGS_SRQ_SRQ
85517 	/* Immediate data indicator */
85518 	#define CQ_RES_UD_CFA_FLAGS_IMM		UINT32_C(0x2)
85519 	#define CQ_RES_UD_CFA_FLAGS_UNUSED_MASK	UINT32_C(0xc)
85520 	#define CQ_RES_UD_CFA_FLAGS_UNUSED_SFT		2
85521 	#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_MASK	UINT32_C(0x30)
85522 	#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_SFT	4
85523 	/* RoCEv1 Message */
85524 		#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V1	(UINT32_C(0x0) << 4)
85525 	/* RoCEv2 IPv4 Message */
85526 		#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV4	(UINT32_C(0x2) << 4)
85527 	/* RoCEv2 IPv6 Message */
85528 		#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV6	(UINT32_C(0x3) << 4)
85529 		#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_LAST	CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV6
85530 	/*
85531 	 * The combination of this value and ext_meta_format indicates
85532 	 * what format the metadata field is.
85533 	 */
85534 	#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_MASK	UINT32_C(0x3c0)
85535 	#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_SFT	6
85536 	/*
85537 	 * If ext_meta_format is equal to 0, there is no metadata
85538 	 * information. Value is zero.
85539 	 */
85540 		#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_NONE	(UINT32_C(0x0) << 6)
85541 	/*
85542 	 * If ext_meta_format is equal to 0, the metadata field contains
85543 	 * the VLAN tag and TPID value.
85544 	 * - metadata[11:0] contains the vlan VID value.
85545 	 * - metadata[12] contains the vlan DE value.
85546 	 * - metadata[15:13] contains the vlan PRI value.
85547 	 * - metadata[31:16] contains the vlan TPID value.
85548 	 */
85549 		#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_VLAN	(UINT32_C(0x1) << 6)
85550 	/*
85551 	 * If ext_meta_format is equal to 1, the metadata field contains
85552 	 * the Tunnel ID value, justified to LSB.
85553 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
85554 	 * - Geneve (NGE) = VNI[23:0] -> Virtual Network Identifier
85555 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
85556 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
85557 	 * - IPV4 = 0 (not populated)
85558 	 * - IPV6 = Flow Label[19:0]
85559 	 * - PPPoE = sessionID[15:0]
85560 	 * - MPLs = Outer label[19:0]
85561 	 * - UPAR = Selected[31:0] with bit mask
85562 	 */
85563 		#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_TUNNEL_ID   (UINT32_C(0x2) << 6)
85564 	/*
85565 	 * if ext_meta_format is equal to 1, metadata field contains
85566 	 * 16b metadata from the prepended header (chdr_data).
85567 	 */
85568 		#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_CHDR_DATA   (UINT32_C(0x3) << 6)
85569 	/*
85570 	 * If ext_meta_format is equal to 1, the metadata field contains
85571 	 * the outer_l3_offset, inner_l2_offset, inner_l3_offset, and
85572 	 * inner_l4_size.
85573 	 * - metadata[8:0] contains the outer_l3_offset.
85574 	 * - metadata[17:9] contains the inner_l2_offset.
85575 	 * - metadata[26:18] contains the inner_l3_offset.
85576 	 * - metadata[31:27] contains the inner_l4_size.
85577 	 */
85578 		#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_HDR_OFFSET  (UINT32_C(0x4) << 6)
85579 		#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_LAST	CQ_RES_UD_CFA_FLAGS_META_FORMAT_HDR_OFFSET
85580 	/*
85581 	 * The combination of this value and meta_format indicates what
85582 	 * format the metadata field is
85583 	 */
85584 	#define CQ_RES_UD_CFA_FLAGS_EXT_META_FORMAT_MASK  UINT32_C(0xc00)
85585 	#define CQ_RES_UD_CFA_FLAGS_EXT_META_FORMAT_SFT   10
85586 	uint32_t	src_qp_high_srq_or_rq_wr_id;
85587 	/*
85588 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
85589 	 * reference the WQE in order to claim the received data
85590 	 * and reuse the WQE space
85591 	 */
85592 	#define CQ_RES_UD_CFA_SRQ_OR_RQ_WR_ID_MASK UINT32_C(0xfffff)
85593 	#define CQ_RES_UD_CFA_SRQ_OR_RQ_WR_ID_SFT 0
85594 	/* Upper 8b of the Source QP value from the DETH header. */
85595 	#define CQ_RES_UD_CFA_SRC_QP_HIGH_MASK	UINT32_C(0xff000000)
85596 	#define CQ_RES_UD_CFA_SRC_QP_HIGH_SFT	24
85597 } cq_res_ud_cfa_t, *pcq_res_ud_cfa_t;
85598 
85599 /* Responder UD with CFA CQE version 2 */
85600 /* cq_res_ud_cfa_v2 (size:256b/32B) */
85601 
85602 typedef struct cq_res_ud_cfa_v2 {
85603 	uint16_t	length;
85604 	/*
85605 	 * The length of the message's payload in bytes, stored in
85606 	 * the SGEs
85607 	 */
85608 	#define CQ_RES_UD_CFA_V2_LENGTH_MASK UINT32_C(0x3fff)
85609 	#define CQ_RES_UD_CFA_V2_LENGTH_SFT 0
85610 	/* This is data from the CFA as indicated by the meta_format field. */
85611 	uint16_t	cfa_metadata0;
85612 	/* When meta_format=1, this value is the VLAN VID. */
85613 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_VID_MASK UINT32_C(0xfff)
85614 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_VID_SFT 0
85615 	/* When meta_format=1, this value is the VLAN DE. */
85616 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_DE	UINT32_C(0x1000)
85617 	/* When meta_format=1, this value is the VLAN PRI. */
85618 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_PRI_MASK UINT32_C(0xe000)
85619 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_PRI_SFT 13
85620 	/* Immediate data in case the imm_flag set. */
85621 	uint32_t	imm_data;
85622 	uint32_t	qid;
85623 	/*
85624 	 * This value indicates the QPID associated with this operation.
85625 	 * The driver will use the qid from this CQE to map a QP handle
85626 	 * in the completion record returned to the application.
85627 	 */
85628 	#define CQ_RES_UD_CFA_V2_QID_MASK UINT32_C(0xfffff)
85629 	#define CQ_RES_UD_CFA_V2_QID_SFT 0
85630 	/*
85631 	 * This is data from the CFA block as indicated by the meta_format
85632 	 * field.
85633 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
85634 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
85635 	 *   act_rec_ptr[25:0]}
85636 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
85637 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
85638 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
85639 	 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
85640 	 * of the host address from the first BD used to place the packet.
85641 	 */
85642 	uint32_t	cfa_metadata2;
85643 	/*
85644 	 * Source MAC address for the UD message placed in the WQE
85645 	 * that is completed by this CQE.
85646 	 */
85647 	uint16_t	src_mac[3];
85648 	/* Lower 16b of the Source QP value from the DETH header. */
85649 	uint16_t	src_qp_low;
85650 	uint8_t	cqe_type_toggle;
85651 	/*
85652 	 * Indicate valid completion - written by the chip. Cumulus
85653 	 * toggle this bit each time it finished consuming all PBL
85654 	 * entries
85655 	 */
85656 	#define CQ_RES_UD_CFA_V2_TOGGLE		UINT32_C(0x1)
85657 	/* This field defines the type of CQE. */
85658 	#define CQ_RES_UD_CFA_V2_CQE_TYPE_MASK	UINT32_C(0x1e)
85659 	#define CQ_RES_UD_CFA_V2_CQE_TYPE_SFT	1
85660 	/*
85661 	 * Responder UD Completion with CFA - This is used for both RQ
85662 	 * and SRQ completion for UD service QPs. It includes cfa fields
85663 	 * (some of which carry VLAN information), in place of the QP
85664 	 * handle. It is also used for QP1 QPs that are treated as UD.
85665 	 */
85666 		#define CQ_RES_UD_CFA_V2_CQE_TYPE_RES_UD_CFA  (UINT32_C(0x4) << 1)
85667 		#define CQ_RES_UD_CFA_V2_CQE_TYPE_LAST	CQ_RES_UD_CFA_V2_CQE_TYPE_RES_UD_CFA
85668 	/* This field indicates the status for the CQE. */
85669 	uint8_t	status;
85670 	/*
85671 	 * This indicates that the completion is without error.
85672 	 * All fields are valid.
85673 	 */
85674 	#define CQ_RES_UD_CFA_V2_STATUS_OK			UINT32_C(0x0)
85675 	/*
85676 	 * This indicates that write access was not allowed for
85677 	 * at least one of the SGEs in the WQE.
85678 	 *
85679 	 * This is a fatal error. Only the srq_or_rq_wr_id is field
85680 	 * is valid.
85681 	 */
85682 	#define CQ_RES_UD_CFA_V2_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
85683 	/*
85684 	 * This indicates that the packet was too long for the WQE
85685 	 * provided on the SRQ/RQ.
85686 	 *
85687 	 * This is not a fatal error. All the fields are valid.
85688 	 */
85689 	#define CQ_RES_UD_CFA_V2_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
85690 	/* LOCAL_PROTECTION_ERR is 3 */
85691 	#define CQ_RES_UD_CFA_V2_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
85692 	/* LOCAL_QP_OPERATION_ERR is 4 */
85693 	#define CQ_RES_UD_CFA_V2_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
85694 	/* MEMORY_MGT_OPERATION_ERR is 5 */
85695 	#define CQ_RES_UD_CFA_V2_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
85696 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
85697 	#define CQ_RES_UD_CFA_V2_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
85698 	/* HW_FLUSH_ERR is 8 */
85699 	#define CQ_RES_UD_CFA_V2_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
85700 	#define CQ_RES_UD_CFA_V2_STATUS_LAST			CQ_RES_UD_CFA_V2_STATUS_HW_FLUSH_ERR
85701 	uint16_t	flags;
85702 	/*
85703 	 * This flag indicates that the completion is for a SRQ entry
85704 	 * rather than for an RQ entry.
85705 	 */
85706 	#define CQ_RES_UD_CFA_V2_FLAGS_SRQ			UINT32_C(0x1)
85707 	/* CQE relates to RQ WQE. */
85708 		#define CQ_RES_UD_CFA_V2_FLAGS_SRQ_RQ		UINT32_C(0x0)
85709 	/* CQE relates to SRQ WQE. */
85710 		#define CQ_RES_UD_CFA_V2_FLAGS_SRQ_SRQ		UINT32_C(0x1)
85711 		#define CQ_RES_UD_CFA_V2_FLAGS_SRQ_LAST		CQ_RES_UD_CFA_V2_FLAGS_SRQ_SRQ
85712 	/* Immediate data indicator */
85713 	#define CQ_RES_UD_CFA_V2_FLAGS_IMM			UINT32_C(0x2)
85714 	#define CQ_RES_UD_CFA_V2_FLAGS_UNUSED_MASK		UINT32_C(0xc)
85715 	#define CQ_RES_UD_CFA_V2_FLAGS_UNUSED_SFT		2
85716 	#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_MASK	UINT32_C(0x30)
85717 	#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_SFT	4
85718 	/* RoCEv1 Message */
85719 		#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V1	(UINT32_C(0x0) << 4)
85720 	/* RoCEv2 IPv4 Message */
85721 		#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV4	(UINT32_C(0x2) << 4)
85722 	/* RoCEv2 IPv6 Message */
85723 		#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV6	(UINT32_C(0x3) << 4)
85724 		#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_LAST	CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV6
85725 	/* The field indicates what format the metadata field is. */
85726 	#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_MASK	UINT32_C(0x3c0)
85727 	#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_SFT	6
85728 	/* No metadata information. Value is zero. */
85729 		#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_NONE	(UINT32_C(0x0) << 6)
85730 	/*
85731 	 * The {metadata1, metadata0} fields contain the vtag
85732 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
85733 	 * de, vid[11:0]} The metadata2 field contains the table scope
85734 	 * and action record pointer. - metadata2[25:0] contains the
85735 	 * action record pointer. - metadata2[31:26] contains the table
85736 	 * scope.
85737 	 */
85738 		#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_ACT_REC_PTR  (UINT32_C(0x1) << 6)
85739 	/*
85740 	 * The {metadata1, metadata0} fields contain the vtag
85741 	 * information:
85742 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
85743 	 * The metadata2 field contains the Tunnel ID
85744 	 * value, justified to LSB. i
85745 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
85746 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
85747 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
85748 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
85749 	 * - IPv4 = 0 (not populated)
85750 	 * - IPv6 = Flow Label[19:0]
85751 	 * - PPPoE = sessionID[15:0]
85752 	 * - MPLs = Outer label[19:0]
85753 	 * - UPAR = Selected[31:0] with bit mask
85754 	 */
85755 		#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 6)
85756 	/*
85757 	 * The {metadata1, metadata0} fields contain the vtag
85758 	 * information:
85759 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
85760 	 * The metadata2 field contains the 32b metadata from the
85761 	 * prepended header (chdr_data).
85762 	 */
85763 		#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 6)
85764 	/*
85765 	 * If ext_meta_format is equal to 1, the metadata field contains
85766 	 * the outer_l3_offset and lower 7 bits of the inner_l2_offset,
85767 	 * - metadata[8:0] contains the outer_l3_offset.
85768 	 * - metadata[15:9] contains the inner_l2_offset[6:0]
85769 	 */
85770 		#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_HDR_OFFSET   (UINT32_C(0x4) << 6)
85771 		#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_LAST	CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_HDR_OFFSET
85772 	uint32_t	src_qp_high_srq_or_rq_wr_id;
85773 	/*
85774 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
85775 	 * reference the WQE in order to claim the received data
85776 	 * and reuse the WQE space
85777 	 */
85778 	#define CQ_RES_UD_CFA_V2_SRQ_OR_RQ_WR_ID_MASK	UINT32_C(0xfffff)
85779 	#define CQ_RES_UD_CFA_V2_SRQ_OR_RQ_WR_ID_SFT		0
85780 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_MASK		UINT32_C(0xf00000)
85781 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_SFT		20
85782 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
85783 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_MASK	UINT32_C(0x700000)
85784 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_SFT	20
85785 	/* 0x88a8 */
85786 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 20)
85787 	/* 0x8100 */
85788 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 20)
85789 	/* 0x9100 */
85790 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 20)
85791 	/* 0x9200 */
85792 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 20)
85793 	/* 0x9300 */
85794 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 20)
85795 	/* Value programmed in CFA VLANTPID register. */
85796 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 20)
85797 		#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_LAST	CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPIDCFG
85798 	/* When meta_format != 0, this value is the VLAN valid. */
85799 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_VALID		UINT32_C(0x800000)
85800 	/* Upper 8b of the Source QP value from the DETH header. */
85801 	#define CQ_RES_UD_CFA_V2_SRC_QP_HIGH_MASK		UINT32_C(0xff000000)
85802 	#define CQ_RES_UD_CFA_V2_SRC_QP_HIGH_SFT		24
85803 } cq_res_ud_cfa_v2_t, *pcq_res_ud_cfa_v2_t;
85804 
85805 /* Responder RawEth and QP1 CQE */
85806 /* cq_res_raweth_qp1 (size:256b/32B) */
85807 
85808 typedef struct cq_res_raweth_qp1 {
85809 	uint16_t	length;
85810 	/*
85811 	 * The length of the message's payload in bytes, stored in
85812 	 * the SGEs
85813 	 */
85814 	#define CQ_RES_RAWETH_QP1_LENGTH_MASK UINT32_C(0x3fff)
85815 	#define CQ_RES_RAWETH_QP1_LENGTH_SFT 0
85816 	uint16_t	raweth_qp1_flags;
85817 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_MASK		UINT32_C(0x3ff)
85818 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_SFT		0
85819 	/*
85820 	 * When this bit is '1', it indicates a packet that has an
85821 	 * error of some type. Type of error is indicated in
85822 	 * raweth_qp1_errors.
85823 	 */
85824 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ERROR		UINT32_C(0x1)
85825 	/*
85826 	 * This value indicates what the inner packet determined for the
85827 	 * packet was.
85828 	 */
85829 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_MASK		UINT32_C(0x3c0)
85830 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_SFT		6
85831 	/*
85832 	 * Not Known:
85833 	 * Indicates that the packet type was not known.
85834 	 */
85835 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN	(UINT32_C(0x0) << 6)
85836 	/*
85837 	 * IP Packet:
85838 	 * Indicates that the packet was an IP packet, but further
85839 	 * classification was not possible.
85840 	 */
85841 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_IP		(UINT32_C(0x1) << 6)
85842 	/*
85843 	 * TCP Packet:
85844 	 * Indicates that the packet was IP and TCP.
85845 	 * This indicates that the raweth_qp1_payload_offset field is
85846 	 * valid.
85847 	 */
85848 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 6)
85849 	/*
85850 	 * UDP Packet:
85851 	 * Indicates that the packet was IP and UDP.
85852 	 * This indicates that the raweth_qp1_payload_offset field is
85853 	 * valid.
85854 	 */
85855 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_UDP		(UINT32_C(0x3) << 6)
85856 	/*
85857 	 * FCoE Packet:
85858 	 * Indicates that the packet was recognized as a FCoE.
85859 	 * This also indicates that the raweth_qp1_payload_offset field
85860 	 * is valid.
85861 	 */
85862 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_FCOE		(UINT32_C(0x4) << 6)
85863 	/*
85864 	 * RoCE Packet:
85865 	 * Indicates that the packet was recognized as a RoCE.
85866 	 * This also indicates that the raweth_qp1_payload_offset field
85867 	 * is valid.
85868 	 */
85869 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ROCE		(UINT32_C(0x5) << 6)
85870 	/*
85871 	 * ICMP Packet:
85872 	 * Indicates that the packet was recognized as ICMP.
85873 	 * This indicates that the raweth_qp1_payload_offset field is
85874 	 * valid.
85875 	 */
85876 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ICMP		(UINT32_C(0x7) << 6)
85877 	/*
85878 	 * PtP packet wo/timestamp:
85879 	 * Indicates that the packet was recognized as a PtP
85880 	 * packet.
85881 	 */
85882 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP   (UINT32_C(0x8) << 6)
85883 	/*
85884 	 * PtP packet w/timestamp:
85885 	 * Indicates that the packet was recognized as a PtP
85886 	 * packet and that a timestamp was taken for the packet.
85887 	 */
85888 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 6)
85889 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_LAST		CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP
85890 	uint16_t	raweth_qp1_errors;
85891 	/*
85892 	 * This indicates that there was an error in the IP header
85893 	 * checksum.
85894 	 */
85895 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_IP_CS_ERROR			UINT32_C(0x10)
85896 	/*
85897 	 * This indicates that there was an error in the TCP, UDP
85898 	 * or ICMP checksum.
85899 	 */
85900 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_L4_CS_ERROR			UINT32_C(0x20)
85901 	/*
85902 	 * This indicates that there was an error in the tunnel
85903 	 * IP header checksum.
85904 	 */
85905 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_IP_CS_ERROR			UINT32_C(0x40)
85906 	/*
85907 	 * This indicates that there was an error in the tunnel
85908 	 * UDP checksum.
85909 	 */
85910 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_L4_CS_ERROR			UINT32_C(0x80)
85911 	/*
85912 	 * This indicates that there was a CRC error on either an FCoE
85913 	 * or RoCE packet. The itype indicates the packet type.
85914 	 */
85915 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_CRC_ERROR			UINT32_C(0x100)
85916 	/*
85917 	 * This indicates that there was an error in the tunnel
85918 	 * portion of the packet when this
85919 	 * field is non-zero.
85920 	 */
85921 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe00)
85922 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT		9
85923 	/*
85924 	 * No additional error occurred on the tunnel portion
85925 	 * of the packet of the packet does not have a tunnel.
85926 	 */
85927 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 9)
85928 	/*
85929 	 * Indicates that IP header version does not match
85930 	 * expectation from L2 Ethertype for IPv4 and IPv6
85931 	 * in the tunnel header.
85932 	 */
85933 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 9)
85934 	/*
85935 	 * Indicates that header length is out of range in the
85936 	 * tunnel header. Valid for
85937 	 * IPv4.
85938 	 */
85939 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 9)
85940 	/*
85941 	 * Indicates that the physical packet is shorter than that
85942 	 * claimed by the PPPoE header length for a tunnel PPPoE
85943 	 * packet.
85944 	 */
85945 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR	(UINT32_C(0x3) << 9)
85946 	/*
85947 	 * Indicates that physical packet is shorter than that claimed
85948 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6
85949 	 * tunnel packet packets.
85950 	 */
85951 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x4) << 9)
85952 	/*
85953 	 * Indicates that the physical packet is shorter than that
85954 	 * claimed by the tunnel UDP header length for a tunnel
85955 	 * UDP packet that is not fragmented.
85956 	 */
85957 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x5) << 9)
85958 	/*
85959 	 * indicates that the IPv4 TTL or IPv6 hop limit check
85960 	 * have failed (e.g. TTL = 0) in the tunnel header. Valid
85961 	 * for IPv4, and IPv6.
85962 	 */
85963 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x6) << 9)
85964 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_LAST		CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
85965 	/*
85966 	 * This indicates that there was an error in the inner
85967 	 * portion of the packet when this
85968 	 * field is non-zero.
85969 	 */
85970 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_MASK			UINT32_C(0xf000)
85971 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_SFT			12
85972 	/*
85973 	 * No additional error occurred on the tunnel portion
85974 	 * of the packet of the packet does not have a tunnel.
85975 	 */
85976 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 12)
85977 	/*
85978 	 * Indicates that IP header version does not match
85979 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
85980 	 * option other than VFT was parsed on
85981 	 * FCoE packet.
85982 	 */
85983 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 12)
85984 	/*
85985 	 * indicates that header length is out of range. Valid for
85986 	 * IPv4 and RoCE
85987 	 */
85988 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 12)
85989 	/*
85990 	 * indicates that the IPv4 TTL or IPv6 hop limit check
85991 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
85992 	 */
85993 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 12)
85994 	/*
85995 	 * Indicates that physical packet is shorter than that
85996 	 * claimed by the l3 header length. Valid for IPv4,
85997 	 * IPv6 packet or RoCE packets.
85998 	 */
85999 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 12)
86000 	/*
86001 	 * Indicates that the physical packet is shorter than that
86002 	 * claimed by the UDP header length for a UDP packet that is
86003 	 * not fragmented.
86004 	 */
86005 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR	(UINT32_C(0x5) << 12)
86006 	/*
86007 	 * Indicates that TCP header length > IP payload. Valid for
86008 	 * TCP packets only.
86009 	 */
86010 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 12)
86011 	/* Indicates that TCP header length < 5. Valid for TCP. */
86012 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL  (UINT32_C(0x7) << 12)
86013 	/*
86014 	 * Indicates that TCP option headers result in a TCP header
86015 	 * size that does not match data offset in TCP header. Valid
86016 	 * for TCP.
86017 	 */
86018 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 12)
86019 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_LAST			CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
86020 	/*
86021 	 * This field identifies the CFA action rule that was used for this
86022 	 * packet.
86023 	 */
86024 	uint16_t	raweth_qp1_cfa_code;
86025 	/*
86026 	 * This is an application level ID used to identify the
86027 	 * QP and its SQ and RQ.
86028 	 */
86029 	uint64_t	qp_handle;
86030 	uint32_t	raweth_qp1_flags2;
86031 	/*
86032 	 * This indicates that the ip checksum was calculated for the
86033 	 * inner packet and that the ip_cs_error field indicates if there
86034 	 * was an error.
86035 	 */
86036 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_CS_CALC		UINT32_C(0x1)
86037 	/*
86038 	 * This indicates that the TCP, UDP or ICMP checksum was
86039 	 * calculated for the inner packet and that the l4_cs_error field
86040 	 * indicates if there was an error.
86041 	 */
86042 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_L4_CS_CALC		UINT32_C(0x2)
86043 	/*
86044 	 * This indicates that the ip checksum was calculated for the
86045 	 * tunnel header and that the t_ip_cs_error field indicates if
86046 	 * there was an error.
86047 	 */
86048 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_IP_CS_CALC		UINT32_C(0x4)
86049 	/*
86050 	 * This indicates that the UDP checksum was
86051 	 * calculated for the tunnel packet and that the t_l4_cs_error
86052 	 * field indicates if there was an error.
86053 	 */
86054 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_L4_CS_CALC		UINT32_C(0x8)
86055 	/*
86056 	 * This value indicates what format the raweth_qp1_metadata field
86057 	 * is.
86058 	 */
86059 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
86060 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_SFT		4
86061 	/* No metadata information. Value is zero. */
86062 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
86063 	/*
86064 	 * The raweth_qp1_metadata field contains the VLAN tag and TPID
86065 	 * value.
86066 	 * - raweth_qp1_metadata[11:0] contains the vlan VID value.
86067 	 * - raweth_qp1_metadata[12] contains the vlan DE value.
86068 	 * - raweth_qp1_metadata[15:13] contains the vlan PRI value.
86069 	 * - raweth_qp1_metadata[31:16] contains the vlan TPID value.
86070 	 */
86071 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_VLAN		(UINT32_C(0x1) << 4)
86072 	/*
86073 	 * If ext_meta_format is equal to 1, the metadata field
86074 	 * contains the lower 16b of the tunnel ID value, justified
86075 	 * to LSB
86076 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
86077 	 * - Geneve (NGE) = VNI[23:0] -> Virtual Network Identifier.
86078 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
86079 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
86080 	 * - IPV4 = 0 (not populated)
86081 	 * - IPV6 = Flow Label[19:0]
86082 	 * - PPPoE = sessionID[15:0]
86083 	 * - MPLs = Outer label[19:0]
86084 	 * - UPAR = Selected[31:0] with bit mask
86085 	 */
86086 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
86087 	/*
86088 	 * if ext_meta_format is equal to 1, metadata field contains
86089 	 * 16b metadata from the prepended header (chdr_data).
86090 	 */
86091 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
86092 	/*
86093 	 * If ext_meta_format is equal to 1, the metadata field contains
86094 	 * the outer_l3_offset and lower 7 bits of the inner_l2_offset,
86095 	 * - metadata[8:0] contains the outer_l3_offset.
86096 	 * - metadata[15:9] contains the inner_l2_offset[6:0]
86097 	 */
86098 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
86099 		#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_LAST		CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET
86100 	/*
86101 	 * This field indicates the IP type for the inner-most IP header.
86102 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
86103 	 * This value is only valid if itype indicates a packet
86104 	 * with an IP header.
86105 	 */
86106 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_TYPE			UINT32_C(0x100)
86107 	/*
86108 	 * This indicates that the complete 1's complement checksum was
86109 	 * calculated for the packet.
86110 	 */
86111 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
86112 	/*
86113 	 * The combination of this value and meta_format indicated what
86114 	 * format the metadata field is.
86115 	 */
86116 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_EXT_META_FORMAT_MASK	UINT32_C(0xc00)
86117 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_EXT_META_FORMAT_SFT	10
86118 	/*
86119 	 * This value is the complete 1's complement checksum calculated
86120 	 * from the start of the outer L3 header to the end of the packet
86121 	 * (not including the ethernet crc). It is valid when the
86122 	 * 'complete_checksum_calc' flag is set.
86123 	 */
86124 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
86125 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_SFT	16
86126 	/*
86127 	 * This is data from the CFA block as indicated by the meta_format
86128 	 * field.
86129 	 */
86130 	uint32_t	raweth_qp1_metadata;
86131 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_DE_VID_MASK	UINT32_C(0xffff)
86132 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_DE_VID_SFT	0
86133 	/* When meta_format=1, this value is the VLAN VID. */
86134 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_MASK	UINT32_C(0xfff)
86135 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_SFT		0
86136 	/* When meta_format=1, this value is the VLAN DE. */
86137 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_DE		UINT32_C(0x1000)
86138 	/* When meta_format=1, this value is the VLAN PRI. */
86139 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_MASK	UINT32_C(0xe000)
86140 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_SFT		13
86141 	/* When meta_format=1, this value is the VLAN TPID. */
86142 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_MASK	UINT32_C(0xffff0000)
86143 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_SFT	16
86144 	uint8_t	cqe_type_toggle;
86145 	/*
86146 	 * Indicate valid completion - written by the chip. Cumulus
86147 	 * toggle this bit each time it finished consuming all PBL
86148 	 * entries
86149 	 */
86150 	#define CQ_RES_RAWETH_QP1_TOGGLE		UINT32_C(0x1)
86151 	/* This field defines the type of CQE. */
86152 	#define CQ_RES_RAWETH_QP1_CQE_TYPE_MASK	UINT32_C(0x1e)
86153 	#define CQ_RES_RAWETH_QP1_CQE_TYPE_SFT	1
86154 	/*
86155 	 * Responder RawEth and QP1 Completion - This is used for RQ
86156 	 * completion for RawEth service and QP1 service QPs.
86157 	 */
86158 		#define CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1  (UINT32_C(0x3) << 1)
86159 		#define CQ_RES_RAWETH_QP1_CQE_TYPE_LAST	CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1
86160 	/* This field indicates the status for the CQE. */
86161 	uint8_t	status;
86162 	/*
86163 	 * This indicates that the completion is without error.
86164 	 * All fields are valid.
86165 	 */
86166 	#define CQ_RES_RAWETH_QP1_STATUS_OK			UINT32_C(0x0)
86167 	/*
86168 	 * This indicates that write access was not allowed for
86169 	 * at least one of the SGEs in the WQE.
86170 	 *
86171 	 * This is a fatal error. Only the srq_or_rq_wr_id is field
86172 	 * is valid.
86173 	 */
86174 	#define CQ_RES_RAWETH_QP1_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
86175 	/*
86176 	 * This indicates that the packet was too long for the WQE
86177 	 * provided on the RQ.
86178 	 *
86179 	 * This is not a fatal error. All the fields are valid.
86180 	 */
86181 	#define CQ_RES_RAWETH_QP1_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
86182 	/* LOCAL_PROTECTION_ERR is 3 */
86183 	#define CQ_RES_RAWETH_QP1_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
86184 	/* LOCAL_QP_OPERATION_ERR is 4 */
86185 	#define CQ_RES_RAWETH_QP1_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
86186 	/* MEMORY_MGT_OPERATION_ERR is 5 */
86187 	#define CQ_RES_RAWETH_QP1_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
86188 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
86189 	#define CQ_RES_RAWETH_QP1_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
86190 	/* HW_FLUSH_ERR is 8 */
86191 	#define CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
86192 	#define CQ_RES_RAWETH_QP1_STATUS_LAST			CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR
86193 	uint16_t	flags;
86194 	/*
86195 	 * This flag indicates that the completion is for a SRQ entry
86196 	 * rather than for an RQ entry.
86197 	 */
86198 	#define CQ_RES_RAWETH_QP1_FLAGS_SRQ	UINT32_C(0x1)
86199 	/* CQE relates to RQ WQE. */
86200 		#define CQ_RES_RAWETH_QP1_FLAGS_SRQ_RQ	UINT32_C(0x0)
86201 	/* CQE relates to SRQ WQE. */
86202 		#define CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ   UINT32_C(0x1)
86203 		#define CQ_RES_RAWETH_QP1_FLAGS_SRQ_LAST CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ
86204 	uint32_t	raweth_qp1_payload_offset_srq_or_rq_wr_id;
86205 	/*
86206 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
86207 	 * reference the WQE in order to claim the received data
86208 	 * and reuse the WQE space
86209 	 */
86210 	#define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_MASK	UINT32_C(0xfffff)
86211 	#define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_SFT	0
86212 	/*
86213 	 * This value indicates the offset in bytes from the beginning of the
86214 	 * packet where the inner payload starts. This value is valid for
86215 	 * TCP, UDP, FCoE, and RoCE packets.
86216 	 * A value of zero indicates an offset of 256 bytes.
86217 	 */
86218 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_MASK UINT32_C(0xff000000)
86219 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_SFT 24
86220 } cq_res_raweth_qp1_t, *pcq_res_raweth_qp1_t;
86221 
86222 /* Responder RawEth and QP1 CQE version 2 */
86223 /* cq_res_raweth_qp1_v2 (size:256b/32B) */
86224 
86225 typedef struct cq_res_raweth_qp1_v2 {
86226 	uint16_t	length;
86227 	/*
86228 	 * The length of the message's payload in bytes, stored in
86229 	 * the SGEs
86230 	 */
86231 	#define CQ_RES_RAWETH_QP1_V2_LENGTH_MASK UINT32_C(0x3fff)
86232 	#define CQ_RES_RAWETH_QP1_V2_LENGTH_SFT 0
86233 	uint16_t	raweth_qp1_flags;
86234 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_MASK		UINT32_C(0x3ff)
86235 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_SFT		0
86236 	/*
86237 	 * When this bit is '1', it indicates a packet that has an
86238 	 * error of some type. Type of error is indicated in
86239 	 * raweth_qp1_errors.
86240 	 */
86241 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ERROR		UINT32_C(0x1)
86242 	/*
86243 	 * This value indicates what the inner packet determined for the
86244 	 * packet was.
86245 	 */
86246 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_MASK		UINT32_C(0x3c0)
86247 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_SFT		6
86248 	/*
86249 	 * Not Known:
86250 	 * Indicates that the packet type was not known.
86251 	 */
86252 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN	(UINT32_C(0x0) << 6)
86253 	/*
86254 	 * IP Packet:
86255 	 * Indicates that the packet was an IP packet, but further
86256 	 * classification was not possible.
86257 	 */
86258 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_IP		(UINT32_C(0x1) << 6)
86259 	/*
86260 	 * TCP Packet:
86261 	 * Indicates that the packet was IP and TCP.
86262 	 * This indicates that the raweth_qp1_payload_offset field is
86263 	 * valid.
86264 	 */
86265 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_TCP		(UINT32_C(0x2) << 6)
86266 	/*
86267 	 * UDP Packet:
86268 	 * Indicates that the packet was IP and UDP.
86269 	 * This indicates that the raweth_qp1_payload_offset field is
86270 	 * valid.
86271 	 */
86272 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_UDP		(UINT32_C(0x3) << 6)
86273 	/*
86274 	 * FCoE Packet:
86275 	 * Indicates that the packet was recognized as a FCoE.
86276 	 * This also indicates that the raweth_qp1_payload_offset field
86277 	 * is valid.
86278 	 */
86279 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_FCOE		(UINT32_C(0x4) << 6)
86280 	/*
86281 	 * RoCE Packet:
86282 	 * Indicates that the packet was recognized as a RoCE.
86283 	 * This also indicates that the raweth_qp1_payload_offset field
86284 	 * is valid.
86285 	 */
86286 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_ROCE		(UINT32_C(0x5) << 6)
86287 	/*
86288 	 * ICMP Packet:
86289 	 * Indicates that the packet was recognized as ICMP.
86290 	 * This indicates that the raweth_qp1_payload_offset field is
86291 	 * valid.
86292 	 */
86293 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_ICMP		(UINT32_C(0x7) << 6)
86294 	/*
86295 	 * PtP packet wo/timestamp:
86296 	 * Indicates that the packet was recognized as a PtP
86297 	 * packet.
86298 	 */
86299 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP   (UINT32_C(0x8) << 6)
86300 	/*
86301 	 * PtP packet w/timestamp:
86302 	 * Indicates that the packet was recognized as a PtP
86303 	 * packet and that a timestamp was taken for the packet.
86304 	 */
86305 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 6)
86306 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_LAST		CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP
86307 	uint16_t	raweth_qp1_errors;
86308 	/*
86309 	 * This indicates that there was an error in the IP header
86310 	 * checksum.
86311 	 */
86312 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_IP_CS_ERROR			UINT32_C(0x10)
86313 	/*
86314 	 * This indicates that there was an error in the TCP, UDP
86315 	 * or ICMP checksum.
86316 	 */
86317 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_L4_CS_ERROR			UINT32_C(0x20)
86318 	/*
86319 	 * This indicates that there was an error in the tunnel
86320 	 * IP header checksum.
86321 	 */
86322 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_IP_CS_ERROR			UINT32_C(0x40)
86323 	/*
86324 	 * This indicates that there was an error in the tunnel
86325 	 * UDP checksum.
86326 	 */
86327 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_L4_CS_ERROR			UINT32_C(0x80)
86328 	/*
86329 	 * This indicates that there was a CRC error on either an FCoE
86330 	 * or RoCE packet. The itype indicates the packet type.
86331 	 */
86332 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_CRC_ERROR			UINT32_C(0x100)
86333 	/*
86334 	 * This indicates that there was an error in the tunnel
86335 	 * portion of the packet when this
86336 	 * field is non-zero.
86337 	 */
86338 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe00)
86339 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT		9
86340 	/*
86341 	 * No additional error occurred on the tunnel portion
86342 	 * of the packet of the packet does not have a tunnel.
86343 	 */
86344 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 9)
86345 	/*
86346 	 * Indicates that IP header version does not match
86347 	 * expectation from L2 Ethertype for IPv4 and IPv6
86348 	 * in the tunnel header.
86349 	 */
86350 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 9)
86351 	/*
86352 	 * Indicates that header length is out of range in the
86353 	 * tunnel header. Valid for
86354 	 * IPv4.
86355 	 */
86356 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 9)
86357 	/*
86358 	 * Indicates that the physical packet is shorter than that
86359 	 * claimed by the PPPoE header length for a tunnel PPPoE
86360 	 * packet.
86361 	 */
86362 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR	(UINT32_C(0x3) << 9)
86363 	/*
86364 	 * Indicates that physical packet is shorter than that claimed
86365 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6
86366 	 * tunnel packet packets.
86367 	 */
86368 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x4) << 9)
86369 	/*
86370 	 * Indicates that the physical packet is shorter than that
86371 	 * claimed by the tunnel UDP header length for a tunnel
86372 	 * UDP packet that is not fragmented.
86373 	 */
86374 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x5) << 9)
86375 	/*
86376 	 * indicates that the IPv4 TTL or IPv6 hop limit check
86377 	 * have failed (e.g. TTL = 0) in the tunnel header. Valid
86378 	 * for IPv4, and IPv6.
86379 	 */
86380 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x6) << 9)
86381 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_LAST		CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
86382 	/*
86383 	 * This indicates that there was an error in the inner
86384 	 * portion of the packet when this
86385 	 * field is non-zero.
86386 	 */
86387 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_MASK			UINT32_C(0xf000)
86388 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_SFT			12
86389 	/*
86390 	 * No additional error occurred on the tunnel portion
86391 	 * of the packet of the packet does not have a tunnel.
86392 	 */
86393 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 12)
86394 	/*
86395 	 * Indicates that IP header version does not match
86396 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
86397 	 * option other than VFT was parsed on
86398 	 * FCoE packet.
86399 	 */
86400 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 12)
86401 	/*
86402 	 * indicates that header length is out of range. Valid for
86403 	 * IPv4 and RoCE
86404 	 */
86405 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 12)
86406 	/*
86407 	 * indicates that the IPv4 TTL or IPv6 hop limit check
86408 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
86409 	 */
86410 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 12)
86411 	/*
86412 	 * Indicates that physical packet is shorter than that
86413 	 * claimed by the l3 header length. Valid for IPv4,
86414 	 * IPv6 packet or RoCE packets.
86415 	 */
86416 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 12)
86417 	/*
86418 	 * Indicates that the physical packet is shorter than that
86419 	 * claimed by the UDP header length for a UDP packet that is
86420 	 * not fragmented.
86421 	 */
86422 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR	(UINT32_C(0x5) << 12)
86423 	/*
86424 	 * Indicates that TCP header length > IP payload. Valid for
86425 	 * TCP packets only.
86426 	 */
86427 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 12)
86428 	/* Indicates that TCP header length < 5. Valid for TCP. */
86429 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL  (UINT32_C(0x7) << 12)
86430 	/*
86431 	 * Indicates that TCP option headers result in a TCP header
86432 	 * size that does not match data offset in TCP header. Valid
86433 	 * for TCP.
86434 	 */
86435 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 12)
86436 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_LAST			CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
86437 	/* This is data from the CFA as indicated by the meta_format field. */
86438 	uint16_t	cfa_metadata0;
86439 	/* When meta_format=1, this value is the VLAN VID. */
86440 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_VID_MASK UINT32_C(0xfff)
86441 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_VID_SFT 0
86442 	/* When meta_format=1, this value is the VLAN DE. */
86443 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_DE	UINT32_C(0x1000)
86444 	/* When meta_format=1, this value is the VLAN PRI. */
86445 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_PRI_MASK UINT32_C(0xe000)
86446 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_PRI_SFT 13
86447 	/*
86448 	 * This is an application level ID used to identify the
86449 	 * QP and its SQ and RQ.
86450 	 */
86451 	uint64_t	qp_handle;
86452 	uint32_t	raweth_qp1_flags2;
86453 	/*
86454 	 * When this bit is '0', the cs_ok field has the following
86455 	 * definition:- ip_cs_ok[2:0] = The number of header groups with a
86456 	 * valid IP checksum in the delivered packet, counted from the
86457 	 * outer-most header group to the inner-most header group, stopping
86458 	 * at the first error. - l4_cs_ok[5:3] = The number of header groups
86459 	 * with a valid L4 checksum in the delivered packet, counted from
86460 	 * the outer-most header group to the inner-most header group,
86461 	 * stopping at the first error. When this bit is '1', the cs_ok
86462 	 * field has the following definition: - hdr_cnt[2:0] = The number of
86463 	 * header groups that were parsed by the chip and passed in the
86464 	 * delivered packet. - ip_cs_all_ok[3] =This bit will be '1' if all
86465 	 * the parsed header groups with an IP checksum are valid.
86466 	 * - l4_cs_all_ok[4] = This bit will be '1' if all the parsed header
86467 	 * groups with an L4 checksum are valid.
86468 	 */
86469 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_ALL_OK_MODE		UINT32_C(0x8)
86470 	/* This value indicates what format the metadata field is. */
86471 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
86472 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_SFT		4
86473 	/* There is no metadata information. Values are zero. */
86474 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
86475 	/*
86476 	 * The {metadata1, metadata0} fields contain the vtag
86477 	 * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
86478 	 * de, vid[11:0]} The metadata2 field contains the table scope
86479 	 * and action record pointer. - metadata2[25:0] contains the
86480 	 * action record pointer. - metadata2[31:26] contains the table
86481 	 * scope.
86482 	 */
86483 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_ACT_REC_PTR	(UINT32_C(0x1) << 4)
86484 	/*
86485 	 * The {metadata1, metadata0} fields contain the vtag
86486 	 * information:
86487 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
86488 	 * The metadata2 field contains the Tunnel ID
86489 	 * value, justified to LSB. i
86490 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
86491 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
86492 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
86493 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
86494 	 * - IPv4 = 0 (not populated)
86495 	 * - IPv6 = Flow Label[19:0]
86496 	 * - PPPoE = sessionID[15:0]
86497 	 * - MPLs = Outer label[19:0]
86498 	 * - UPAR = Selected[31:0] with bit mask
86499 	 */
86500 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
86501 	/*
86502 	 * The {metadata1, metadata0} fields contain the vtag
86503 	 * information:
86504 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
86505 	 * The metadata2 field contains the 32b metadata from the prepended
86506 	 * header (chdr_data).
86507 	 */
86508 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
86509 	/*
86510 	 * The {metadata1, metadata0} fields contain the vtag
86511 	 * information:
86512 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
86513 	 * The metadata2 field contains the outer_l3_offset,
86514 	 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
86515 	 * - metadata2[8:0] contains the outer_l3_offset.
86516 	 * - metadata2[17:9] contains the inner_l2_offset.
86517 	 * - metadata2[26:18] contains the inner_l3_offset.
86518 	 * - metadata2[31:27] contains the inner_l4_size.
86519 	 */
86520 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
86521 		#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_LAST		CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET
86522 	/*
86523 	 * This field indicates the IP type for the inner-most IP header.
86524 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
86525 	 * This value is only valid if itype indicates a packet
86526 	 * with an IP header.
86527 	 */
86528 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_IP_TYPE			UINT32_C(0x100)
86529 	/*
86530 	 * This indicates that the complete 1's complement checksum was
86531 	 * calculated for the packet.
86532 	 */
86533 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
86534 	/*
86535 	 * This field indicates the status of IP and L4 CS calculations done
86536 	 * by the chip. The format of this field is indicated by the
86537 	 * cs_all_ok_mode bit.
86538 	 */
86539 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_OK_MASK		UINT32_C(0xfc00)
86540 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_OK_SFT		10
86541 	/*
86542 	 * This value is the complete 1's complement checksum calculated from
86543 	 * the start of the outer L3 header to the end of the packet (not
86544 	 * including the ethernet crc). It is valid when the
86545 	 * 'complete_checksum_calc' flag is set.
86546 	 */
86547 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
86548 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_SFT	16
86549 	/*
86550 	 * This is data from the CFA block as indicated by the meta_format
86551 	 * field.
86552 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
86553 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
86554 	 *   act_rec_ptr[25:0]}
86555 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
86556 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
86557 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
86558 	 * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
86559 	 * of the host address from the first BD used to place the packet.
86560 	 */
86561 	uint32_t	cfa_metadata2;
86562 	uint8_t	cqe_type_toggle;
86563 	/*
86564 	 * Indicate valid completion - written by the chip. Cumulus
86565 	 * toggle this bit each time it finished consuming all PBL
86566 	 * entries
86567 	 */
86568 	#define CQ_RES_RAWETH_QP1_V2_TOGGLE		UINT32_C(0x1)
86569 	/* This field defines the type of CQE. */
86570 	#define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_MASK	UINT32_C(0x1e)
86571 	#define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_SFT	1
86572 	/*
86573 	 * Responder RawEth and QP1 Completion - This is used for RQ
86574 	 * completion for RawEth service and QP1 service QPs.
86575 	 */
86576 		#define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_RES_RAWETH_QP1  (UINT32_C(0x3) << 1)
86577 		#define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_LAST	CQ_RES_RAWETH_QP1_V2_CQE_TYPE_RES_RAWETH_QP1
86578 	/* This field indicates the status for the CQE. */
86579 	uint8_t	status;
86580 	/*
86581 	 * This indicates that the completion is without error.
86582 	 * All fields are valid.
86583 	 */
86584 	#define CQ_RES_RAWETH_QP1_V2_STATUS_OK			UINT32_C(0x0)
86585 	/*
86586 	 * This indicates that write access was not allowed for
86587 	 * at least one of the SGEs in the WQE.
86588 	 *
86589 	 * This is a fatal error. Only the srq_or_rq_wr_id is field
86590 	 * is valid.
86591 	 */
86592 	#define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x1)
86593 	/*
86594 	 * This indicates that the packet was too long for the WQE
86595 	 * provided on the RQ.
86596 	 *
86597 	 * This is not a fatal error. All the fields are valid.
86598 	 */
86599 	#define CQ_RES_RAWETH_QP1_V2_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x2)
86600 	/* LOCAL_PROTECTION_ERR is 3 */
86601 	#define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x3)
86602 	/* LOCAL_QP_OPERATION_ERR is 4 */
86603 	#define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
86604 	/* MEMORY_MGT_OPERATION_ERR is 5 */
86605 	#define CQ_RES_RAWETH_QP1_V2_STATUS_MEMORY_MGT_OPERATION_ERR UINT32_C(0x5)
86606 	/* WORK_REQUEST_FLUSHED_ERR is 7 */
86607 	#define CQ_RES_RAWETH_QP1_V2_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0x7)
86608 	/* HW_FLUSH_ERR is 8 */
86609 	#define CQ_RES_RAWETH_QP1_V2_STATUS_HW_FLUSH_ERR		UINT32_C(0x8)
86610 	#define CQ_RES_RAWETH_QP1_V2_STATUS_LAST			CQ_RES_RAWETH_QP1_V2_STATUS_HW_FLUSH_ERR
86611 	uint16_t	flags;
86612 	/*
86613 	 * This flag indicates that the completion is for a SRQ entry
86614 	 * rather than for an RQ entry.
86615 	 */
86616 	#define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ	UINT32_C(0x1)
86617 	/* CQE relates to RQ WQE. */
86618 		#define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_RQ	UINT32_C(0x0)
86619 	/* CQE relates to SRQ WQE. */
86620 		#define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_SRQ   UINT32_C(0x1)
86621 		#define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_LAST CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_SRQ
86622 	uint32_t	raweth_qp1_payload_offset_srq_or_rq_wr_id;
86623 	/*
86624 	 * Opaque value from RQ or SRQ WQE. Used by driver/lib to
86625 	 * reference the WQE in order to claim the received data
86626 	 * and reuse the WQE space
86627 	 */
86628 	#define CQ_RES_RAWETH_QP1_V2_SRQ_OR_RQ_WR_ID_MASK	UINT32_C(0xfffff)
86629 	#define CQ_RES_RAWETH_QP1_V2_SRQ_OR_RQ_WR_ID_SFT		0
86630 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_MASK		UINT32_C(0xf00000)
86631 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_SFT		20
86632 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
86633 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_MASK	UINT32_C(0x700000)
86634 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_SFT	20
86635 	/* 0x88a8 */
86636 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID88A8   (UINT32_C(0x0) << 20)
86637 	/* 0x8100 */
86638 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID8100   (UINT32_C(0x1) << 20)
86639 	/* 0x9100 */
86640 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9100   (UINT32_C(0x2) << 20)
86641 	/* 0x9200 */
86642 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9200   (UINT32_C(0x3) << 20)
86643 	/* 0x9300 */
86644 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9300   (UINT32_C(0x4) << 20)
86645 	/* Value programmed in CFA VLANTPID register. */
86646 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPIDCFG	(UINT32_C(0x5) << 20)
86647 		#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_LAST	CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPIDCFG
86648 	/* When meta_format != 0, this value is the VLAN valid. */
86649 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_VALID		UINT32_C(0x800000)
86650 	/*
86651 	 * This value indicates the offset in bytes from the beginning of
86652 	 * the packet where the inner payload starts. This value is valid
86653 	 * for TCP, UDP, FCoE, and RoCE packets.
86654 	 *
86655 	 * A value of zero indicates an offset of 256 bytes.
86656 	 */
86657 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_PAYLOAD_OFFSET_MASK UINT32_C(0xff000000)
86658 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_PAYLOAD_OFFSET_SFT  24
86659 } cq_res_raweth_qp1_v2_t, *pcq_res_raweth_qp1_v2_t;
86660 
86661 /*
86662  * This is the terminal CQE structure. This CQE is generated to
86663  * indicate that no further completions will be generated for this QP.
86664  */
86665 /* cq_terminal (size:256b/32B) */
86666 
86667 typedef struct cq_terminal {
86668 	/*
86669 	 * This is an application level ID used to identify the
86670 	 * QP and its SQ and RQ.
86671 	 */
86672 	uint64_t	qp_handle;
86673 	/*
86674 	 * Final SQ Consumer Index value. Any additional SQ WQEs will
86675 	 * have to be completed by the user provider.
86676 	 */
86677 	uint16_t	sq_cons_idx;
86678 	/*
86679 	 * Final RQ Consumer Index value. Any additional RQ WQEs will
86680 	 * have to be completed by the user provider.
86681 	 */
86682 	uint16_t	rq_cons_idx;
86683 	uint32_t	reserved32_1;
86684 	uint64_t	reserved64_3;
86685 	uint8_t	cqe_type_toggle;
86686 	/*
86687 	 * Indicate valid completion - written by the chip. Cumulus
86688 	 * toggle this bit each time it finished consuming all PBL
86689 	 * entries
86690 	 */
86691 	#define CQ_TERMINAL_TOGGLE	UINT32_C(0x1)
86692 	/* This field defines the type of CQE. */
86693 	#define CQ_TERMINAL_CQE_TYPE_MASK	UINT32_C(0x1e)
86694 	#define CQ_TERMINAL_CQE_TYPE_SFT	1
86695 	/*
86696 	 * Terminal completion - This is used to indicate that no
86697 	 * further completions will be made for this QP on this CQ.
86698 	 */
86699 		#define CQ_TERMINAL_CQE_TYPE_TERMINAL  (UINT32_C(0xe) << 1)
86700 		#define CQ_TERMINAL_CQE_TYPE_LAST	CQ_TERMINAL_CQE_TYPE_TERMINAL
86701 	/* This field indicates the status for the CQE. */
86702 	uint8_t	status;
86703 	/* The operation completed successfully. */
86704 	#define CQ_TERMINAL_STATUS_OK UINT32_C(0x0)
86705 	#define CQ_TERMINAL_STATUS_LAST CQ_TERMINAL_STATUS_OK
86706 	uint16_t	reserved16;
86707 	uint32_t	reserved32_2;
86708 } cq_terminal_t, *pcq_terminal_t;
86709 
86710 /* Cutoff CQE */
86711 /* cq_cutoff (size:256b/32B) */
86712 
86713 typedef struct cq_cutoff {
86714 	uint64_t	reserved64_1;
86715 	uint64_t	reserved64_2;
86716 	uint64_t	reserved64_3;
86717 	uint8_t	cqe_type_toggle;
86718 	/*
86719 	 * Indicate valid completion - written by the chip. The NIC
86720 	 * toggles this bit each time it finished consuming all PBL
86721 	 * entries
86722 	 */
86723 	#define CQ_CUTOFF_TOGGLE		UINT32_C(0x1)
86724 	/* This field defines the type of CQE. */
86725 	#define CQ_CUTOFF_CQE_TYPE_MASK	UINT32_C(0x1e)
86726 	#define CQ_CUTOFF_CQE_TYPE_SFT	1
86727 	/* Cut off CQE; for CQ resize see CQ and SRQ Resize */
86728 		#define CQ_CUTOFF_CQE_TYPE_CUT_OFF	(UINT32_C(0xf) << 1)
86729 		#define CQ_CUTOFF_CQE_TYPE_LAST	CQ_CUTOFF_CQE_TYPE_CUT_OFF
86730 	/*
86731 	 * This field carries the toggle value that must be used to
86732 	 * acknowledge this CQ resize operation. When this CQE is
86733 	 * processed, the driver should send a CQ_CUTOFF_ACK doorbell
86734 	 * to the chip to let the chip know that the resize operation
86735 	 * is complete.
86736 	 *
86737 	 * This value is used by HW to detect old and
86738 	 * stale CQ_CUTOFF_ACK doorbells that are caused by having
86739 	 * a backup doorbell location or by PCI or other reordering
86740 	 * problems. Only doorbells with the latest value will be honored.
86741 	 * This field is needed only for devices that use the hardware
86742 	 * based doorbell drop recovery feature.
86743 	 */
86744 	#define CQ_CUTOFF_RESIZE_TOGGLE_MASK UINT32_C(0x60)
86745 	#define CQ_CUTOFF_RESIZE_TOGGLE_SFT 5
86746 	/* This field indicates the status for the CQE. */
86747 	uint8_t	status;
86748 	/* The operation completed successfully. */
86749 	#define CQ_CUTOFF_STATUS_OK UINT32_C(0x0)
86750 	#define CQ_CUTOFF_STATUS_LAST CQ_CUTOFF_STATUS_OK
86751 	uint16_t	reserved16;
86752 	uint32_t	reserved32;
86753 } cq_cutoff_t, *pcq_cutoff_t;
86754 
86755 /* No-Op CQE */
86756 /* cq_no_op (size:256b/32B) */
86757 
86758 typedef struct cq_no_op {
86759 	uint64_t	reserved64_1;
86760 	uint64_t	reserved64_2;
86761 	uint64_t	reserved64_3;
86762 	uint8_t	cqe_type_toggle;
86763 	/*
86764 	 * Indicate valid completion - written by the chip. The NIC
86765 	 * toggles this bit each time it finished consuming all PBL
86766 	 * entries.
86767 	 */
86768 	#define CQ_NO_OP_TOGGLE	UINT32_C(0x1)
86769 	/* This field defines the type of CQE. */
86770 	#define CQ_NO_OP_CQE_TYPE_MASK UINT32_C(0x1e)
86771 	#define CQ_NO_OP_CQE_TYPE_SFT  1
86772 	/*
86773 	 * NO-OP completion - This is used to indicate that no operation
86774 	 * completed.
86775 	 */
86776 		#define CQ_NO_OP_CQE_TYPE_NO_OP  (UINT32_C(0xd) << 1)
86777 		#define CQ_NO_OP_CQE_TYPE_LAST  CQ_NO_OP_CQE_TYPE_NO_OP
86778 	/* This field indicates the status for the CQE. */
86779 	uint8_t	status;
86780 	/* The operation completed successfully. */
86781 	#define CQ_NO_OP_STATUS_OK UINT32_C(0x0)
86782 	#define CQ_NO_OP_STATUS_LAST CQ_NO_OP_STATUS_OK
86783 	uint16_t	reserved16;
86784 	uint32_t	reserved32;
86785 } cq_no_op_t, *pcq_no_op_t;
86786 
86787 /*
86788  * This is the Requester CQE V3 structure. This is used to complete each
86789  * signaled SQ WQE. The sq_cons_idx and opaque is used to indicate
86790  * which WQE has been completed. When a WQE is completed, it indicates
86791  * that all WQEs before it in the SQ are also completed without error.
86792  * Space freed by completed WQEs can be used for new WQEs.
86793  */
86794 /* cq_req_v3 (size:256b/32B) */
86795 
86796 typedef struct cq_req_v3 {
86797 	/*
86798 	 * This is an application level ID used to identify the
86799 	 * QP and its SQ and RQ.
86800 	 */
86801 	uint64_t	qp_handle;
86802 	/*
86803 	 * SQ Consumer Index - points to the entry just past the last WQE
86804 	 * that has been completed by the chip. Wraps around at QPC.sq_size
86805 	 * (i.e. the valid range of the SQ Consumer Index is 0 to
86806 	 * (QPC.sq_size - 1)). The sq_cons_idx is in 16B units (as is
86807 	 * QPC.sq_size).
86808 	 *
86809 	 * User can determine available space in the SQ by comparing
86810 	 * sq_cons_idx to a sq_prod_idx maintained by the user. When the two
86811 	 * values are equal, the SQ is empty. When
86812 	 * (sq_prod_idx+1)%QPC.sq_size==sq_cons_idx, the queue is full.
86813 	 */
86814 	uint16_t	sq_cons_idx;
86815 	uint16_t	reserved1;
86816 	uint32_t	reserved2;
86817 	uint64_t	reserved3;
86818 	uint8_t	cqe_type_toggle;
86819 	/*
86820 	 * Indicate valid completion - written by the chip. The NIC
86821 	 * toggles this bit each time it finished consuming all PBL
86822 	 * entries.
86823 	 */
86824 	#define CQ_REQ_V3_TOGGLE	UINT32_C(0x1)
86825 	/* This field defines the type of CQE. */
86826 	#define CQ_REQ_V3_CQE_TYPE_MASK  UINT32_C(0x1e)
86827 	#define CQ_REQ_V3_CQE_TYPE_SFT   1
86828 	/*
86829 	 * Requester completion V3 - This is used for both RC and UD SQ
86830 	 * completions.
86831 	 */
86832 		#define CQ_REQ_V3_CQE_TYPE_REQ_V3  (UINT32_C(0x8) << 1)
86833 		#define CQ_REQ_V3_CQE_TYPE_LAST   CQ_REQ_V3_CQE_TYPE_REQ_V3
86834 	/*
86835 	 * When this bit is '1', it indicates that the packet completed
86836 	 * was transmitted using the push accelerated data provided by
86837 	 * the driver. When this bit is '0', it indicates that the packet
86838 	 * had not push acceleration data written or was executed as a
86839 	 * normal packet even though push data was provided.
86840 	 *
86841 	 * Note: This field is intended to be used for driver-generated push
86842 	 * statistics. As such, It is not applicable for RC since not all
86843 	 * RC packets return a CQE.
86844 	 */
86845 	#define CQ_REQ_V3_PUSH	UINT32_C(0x20)
86846 	/* This field indicates the status for the CQE. */
86847 	uint8_t	status;
86848 	/* The operation completed successfully. */
86849 	#define CQ_REQ_V3_STATUS_OK			UINT32_C(0x0)
86850 	/*
86851 	 * An unexpected BTH opcode or a First/Middle packet that is not
86852 	 * the full MTU size was returned by the responder.
86853 	 *
86854 	 * This is a fatal error detected by the requester Rx.
86855 	 */
86856 	#define CQ_REQ_V3_STATUS_BAD_RESPONSE_ERR	UINT32_C(0x1)
86857 	/*
86858 	 * Generated for a WQE posted to the local SQ when the sum of the
86859 	 * lengths of the SGEs in the WQE exceeds the maximum message
86860 	 * length of 2^31 bytes.
86861 	 *
86862 	 * Generated for a WQE posted to the local RQ/SRQ when the sum of
86863 	 * the lengths of the SGEs in the WQE is too small to receive the
86864 	 * (valid) incoming message or the length of the incoming message
86865 	 * is greater than the maximum message size supported.
86866 	 *
86867 	 * This is a fatal error detected by the requester Tx or responder
86868 	 * Rx. For responder CQEs, only the opaque field is valid.
86869 	 */
86870 	#define CQ_REQ_V3_STATUS_LOCAL_LENGTH_ERR	UINT32_C(0x2)
86871 	/*
86872 	 * An internal QP consistency error was detected while processing
86873 	 * this Work Request. For requester, this could be an SQ WQE format
86874 	 * error or an operation specified in the WQE that is not supported
86875 	 * for the QP. For responder, this is an RQ/SRQ WQE format error.
86876 	 *
86877 	 * This is a fatal error detected by the requester Tx or responder
86878 	 * Rx. For responder CQEs, only the opaque field is valid.
86879 	 */
86880 	#define CQ_REQ_V3_STATUS_LOCAL_QP_OPERATION_ERR	UINT32_C(0x4)
86881 	/*
86882 	 * An SGE in the locally posted WQE does not reference a Memory
86883 	 * Region that is valid for the requested operation. If this error
86884 	 * is generated for an SGE using the reserved l_key, this means
86885 	 * that the reserved l_key is not enabled.
86886 	 *
86887 	 * This is a fatal error detected by the requester Tx or responder
86888 	 * Rx. For responder CQEs, only the opaque field is valid.
86889 	 */
86890 	#define CQ_REQ_V3_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x5)
86891 	/*
86892 	 * The SSC detected an error on a local memory operation from the
86893 	 * SQ (fast-register, local invalidate, or bind).
86894 	 *
86895 	 * This is a fatal error detected by the requester Tx.
86896 	 */
86897 	#define CQ_REQ_V3_STATUS_MEMORY_MGT_OPERATION_ERR   UINT32_C(0x7)
86898 	/*
86899 	 * An invalid message was received by the responder. This could be
86900 	 * an operation that is not supported by this QP, an IRRQ overflow
86901 	 * error, or the length in an RDMA operation is greater than the
86902 	 * maximum message size (2^31 bytes).
86903 	 *
86904 	 * This is a fatal error detected by the responder and communicated
86905 	 * back to the requester using a NAK-Invalid Request. For responder
86906 	 * CQEs, only the opaque field is valid.
86907 	 */
86908 	#define CQ_REQ_V3_STATUS_REMOTE_INVALID_REQUEST_ERR UINT32_C(0x8)
86909 	/*
86910 	 * A protection error occurred on a remote data buffer to be read
86911 	 * by an RDMA Read, written by an RDMA Write or accessed by an
86912 	 * atomic operation. This error is reported only on RDMA operations
86913 	 * or atomic operations.
86914 	 *
86915 	 * This is a fatal error detected by the responder and communicated
86916 	 * back to the requester using a NAK-Remote Access Violation.
86917 	 */
86918 	#define CQ_REQ_V3_STATUS_REMOTE_ACCESS_ERR	UINT32_C(0x9)
86919 	/*
86920 	 * The operation could not be completed successfully by the
86921 	 * responder. Possible causes include an RQ/SRQ WQE format error,
86922 	 * an SSC error when validating an SGE from an RQ/SRQ WQE, or the
86923 	 * message received was too long for the RQ/SRQ WQE.
86924 	 *
86925 	 * This is a fatal error detected by the responder and communicated
86926 	 * back to the requester using a NAK-Remote Operation Error.
86927 	 */
86928 	#define CQ_REQ_V3_STATUS_REMOTE_OPERATION_ERR	UINT32_C(0xa)
86929 	/*
86930 	 * The RNR NAK retry count was exceeded while trying to send this
86931 	 * message.
86932 	 *
86933 	 * This is a fatal error detected by the requester.
86934 	 */
86935 	#define CQ_REQ_V3_STATUS_RNR_NAK_RETRY_CNT_ERR	UINT32_C(0xb)
86936 	/*
86937 	 * The local transport timeout retry counter was exceeded while
86938 	 * trying to send this message.
86939 	 *
86940 	 * This is a fatal error detected by the requester.
86941 	 */
86942 	#define CQ_REQ_V3_STATUS_TRANSPORT_RETRY_CNT_ERR	UINT32_C(0xc)
86943 	/*
86944 	 * A WQE was in process or outstanding when the QP transitioned
86945 	 * into the Error State.
86946 	 */
86947 	#define CQ_REQ_V3_STATUS_WORK_REQUEST_FLUSHED_ERR   UINT32_C(0xd)
86948 	/*
86949 	 * A WQE was posted to the SQ/RQ that caused it to overflow. For
86950 	 * requester CQEs, it was the SQ that overflowed. For responder
86951 	 * CQEs, it was the RQ that overflowed.
86952 	 */
86953 	#define CQ_REQ_V3_STATUS_OVERFLOW_ERR		UINT32_C(0xf)
86954 	#define CQ_REQ_V3_STATUS_LAST			CQ_REQ_V3_STATUS_OVERFLOW_ERR
86955 	uint16_t	reserved4;
86956 	/* This value is from the WQE that is being completed. */
86957 	uint32_t	opaque;
86958 } cq_req_v3_t, *pcq_req_v3_t;
86959 
86960 /*
86961  * This is the Responder RQ/SRQ CQE V3 structure for RC QPs. This is
86962  * used to complete each RQ/SRQ WQE. When the WQE is completed, it
86963  * indicates that there is room for one more WQE on the corresponding
86964  * RQ/SRQ.
86965  *
86966  * User can determine available space in the RQ/SRQ by comparing
86967  * a rq_cons_idx to a rq_prod_idx, both maintained by the user. The
86968  * range for rq_prod/cons_idx is from 0 to QPC.rq_size-1. The
86969  * rq_prod_idx value increments by one for each WQE that is added to
86970  * the RQ/SRQ by the user. Value must be wrapped at rq_size. The
86971  * rq_cons_idx value increments by one for each WQE that is completed
86972  * from that particular RQ/SRQ. The qp_handle can be used by the user
86973  * to determine what RQ/SRQ to increment. Value must also be wrapped at
86974  * rq_size. When the two values are equal, the RQ/SRQ is empty. When
86975  * (rq_prod_idx+1)%QPC.rq_size==rq_cons_idx, the queue is full.
86976  */
86977 /* cq_res_rc_v3 (size:256b/32B) */
86978 
86979 typedef struct cq_res_rc_v3 {
86980 	/*
86981 	 * The length of the message's payload in bytes, stored in
86982 	 * the SGEs
86983 	 */
86984 	uint32_t	length;
86985 	/*
86986 	 * Immediate data in case the imm_flag set, R_Key to be
86987 	 * invalidated in case inv_flag is set.
86988 	 */
86989 	uint32_t	imm_data_or_inv_r_key;
86990 	/*
86991 	 * This is an application level ID used to identify the
86992 	 * QP and its SQ and RQ.
86993 	 */
86994 	uint64_t	qp_handle;
86995 	/*
86996 	 * Opaque value - valid when inv_flag is set. Used by driver
86997 	 * to reference the buffer used to store PBL when the MR was
86998 	 * fast registered. The driver can reclaim this buffer after
86999 	 * an MR was remotely invalidated. The controller take that
87000 	 * value from the MR referenced by R_Key
87001 	 */
87002 	uint64_t	mr_handle;
87003 	uint8_t	cqe_type_toggle;
87004 	/*
87005 	 * Indicate valid completion - written by the chip. The NIC
87006 	 * toggles this bit each time it finished consuming all PBL
87007 	 * entries.
87008 	 */
87009 	#define CQ_RES_RC_V3_TOGGLE		UINT32_C(0x1)
87010 	/* This field defines the type of CQE. */
87011 	#define CQ_RES_RC_V3_CQE_TYPE_MASK	UINT32_C(0x1e)
87012 	#define CQ_RES_RC_V3_CQE_TYPE_SFT	1
87013 	/*
87014 	 * Responder RC Completion - This is used for both RQ and SRQ
87015 	 * completions for RC service QPs.
87016 	 */
87017 		#define CQ_RES_RC_V3_CQE_TYPE_RES_RC_V3  (UINT32_C(0x9) << 1)
87018 		#define CQ_RES_RC_V3_CQE_TYPE_LAST	CQ_RES_RC_V3_CQE_TYPE_RES_RC_V3
87019 	/* This field indicates the status for the CQE. */
87020 	uint8_t	status;
87021 	/* The operation completed successfully. */
87022 	#define CQ_RES_RC_V3_STATUS_OK			UINT32_C(0x0)
87023 	/*
87024 	 * Generated for a WQE posted to the local SQ when the sum of the
87025 	 * lengths of the SGEs in the WQE exceeds the maximum message
87026 	 * length of 2^31 bytes.
87027 	 *
87028 	 * Generated for a WQE posted to the local RQ/SRQ when the sum of
87029 	 * the lengths of the SGEs in the WQE is too small to receive the
87030 	 * (valid) incoming message or the length of the incoming message
87031 	 * is greater than the maximum message size supported.
87032 	 *
87033 	 * This is a fatal error detected by the requester Tx or responder
87034 	 * Rx. For responder CQEs, only the opaque field is valid.
87035 	 */
87036 	#define CQ_RES_RC_V3_STATUS_LOCAL_LENGTH_ERR	UINT32_C(0x2)
87037 	/*
87038 	 * An internal QP consistency error was detected while processing
87039 	 * this Work Request. For requester, this could be an SQ WQE format
87040 	 * error or an operation specified in the WQE that is not supported
87041 	 * for the QP. For responder, this is an RQ/SRQ WQE format error.
87042 	 *
87043 	 * This is a fatal error detected by the requester Tx or responder
87044 	 * Rx. For responder CQEs, only the opaque field is valid.
87045 	 */
87046 	#define CQ_RES_RC_V3_STATUS_LOCAL_QP_OPERATION_ERR	UINT32_C(0x4)
87047 	/*
87048 	 * An SGE in the locally posted WQE does not reference a Memory
87049 	 * Region that is valid for the requested operation. If this error
87050 	 * is generated for an SGE using the reserved l_key, this means
87051 	 * that the reserved l_key is not enabled.
87052 	 *
87053 	 * This is a fatal error detected by the requester Tx or responder
87054 	 * Rx. For responder CQEs, only the opaque field is valid.
87055 	 */
87056 	#define CQ_RES_RC_V3_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x5)
87057 	/*
87058 	 * A protection error occurred on a local data buffer during the
87059 	 * processing of a RDMA Write with Immediate Data operation sent
87060 	 * from the remote node.
87061 	 *
87062 	 * This is a fatal error detected by the responder Rx. Only the
87063 	 * opaque field in the CQE is valid.
87064 	 */
87065 	#define CQ_RES_RC_V3_STATUS_LOCAL_ACCESS_ERROR	UINT32_C(0x6)
87066 	/*
87067 	 * An invalid message was received by the responder. This could be
87068 	 * an operation that is not supported by this QP, an IRRQ overflow
87069 	 * error, or the length in an RDMA operation is greater than the
87070 	 * maximum message size (2^31 bytes).
87071 	 *
87072 	 * This is a fatal error detected by the responder and communicated
87073 	 * back to the requester using a NAK-Invalid Request. For responder
87074 	 * CQEs, only the opaque field is valid.
87075 	 */
87076 	#define CQ_RES_RC_V3_STATUS_REMOTE_INVALID_REQUEST_ERR UINT32_C(0x8)
87077 	/*
87078 	 * A WQE was in process or outstanding when the QP transitioned
87079 	 * into the Error State.
87080 	 */
87081 	#define CQ_RES_RC_V3_STATUS_WORK_REQUEST_FLUSHED_ERR   UINT32_C(0xd)
87082 	/*
87083 	 * A WQE had already been taken off the RQ/SRQ when a fatal error
87084 	 * was detected on responder Rx. Only the opaque field in the CQE
87085 	 * is valid.
87086 	 */
87087 	#define CQ_RES_RC_V3_STATUS_HW_FLUSH_ERR		UINT32_C(0xe)
87088 	/*
87089 	 * A WQE was posted to the SQ/RQ that caused it to overflow. For
87090 	 * requester CQEs, it was the SQ that overflowed. For responder
87091 	 * CQEs, it was the RQ that overflowed.
87092 	 */
87093 	#define CQ_RES_RC_V3_STATUS_OVERFLOW_ERR		UINT32_C(0xf)
87094 	#define CQ_RES_RC_V3_STATUS_LAST			CQ_RES_RC_V3_STATUS_OVERFLOW_ERR
87095 	uint16_t	flags;
87096 	/*
87097 	 * This flag indicates that the completion is for a SRQ entry
87098 	 * rather than for an RQ entry.
87099 	 */
87100 	#define CQ_RES_RC_V3_FLAGS_SRQ		UINT32_C(0x1)
87101 	/* CQE relates to RQ WQE. */
87102 		#define CQ_RES_RC_V3_FLAGS_SRQ_RQ	UINT32_C(0x0)
87103 	/* CQE relates to SRQ WQE. */
87104 		#define CQ_RES_RC_V3_FLAGS_SRQ_SRQ	UINT32_C(0x1)
87105 		#define CQ_RES_RC_V3_FLAGS_SRQ_LAST	CQ_RES_RC_V3_FLAGS_SRQ_SRQ
87106 	/* Immediate data indicator */
87107 	#define CQ_RES_RC_V3_FLAGS_IMM		UINT32_C(0x2)
87108 	/* R_Key invalidate indicator */
87109 	#define CQ_RES_RC_V3_FLAGS_INV		UINT32_C(0x4)
87110 	#define CQ_RES_RC_V3_FLAGS_RDMA	UINT32_C(0x8)
87111 	/* CQE relates to an incoming Send request */
87112 		#define CQ_RES_RC_V3_FLAGS_RDMA_SEND	(UINT32_C(0x0) << 3)
87113 	/* CQE relates to incoming RDMA Write request */
87114 		#define CQ_RES_RC_V3_FLAGS_RDMA_RDMA_WRITE  (UINT32_C(0x1) << 3)
87115 		#define CQ_RES_RC_V3_FLAGS_RDMA_LAST	CQ_RES_RC_V3_FLAGS_RDMA_RDMA_WRITE
87116 	/* This value is from the WQE that is being completed. */
87117 	uint32_t	opaque;
87118 } cq_res_rc_v3_t, *pcq_res_rc_v3_t;
87119 
87120 /*
87121  * This is the Responder RQ/SRQ CQE V3 structure for UD QPs and QP1 QPs
87122  * that are treated as UD. This is used to complete RQ/SRQ WQE's. When
87123  * the WQE is completed, it indicates that there is room for one more
87124  * WQE on the corresponding RQ/SRQ.
87125  *
87126  * User can determine available space in the RQ/SRQ by comparing
87127  * a rq_cons_idx to a rq_prod_idx, both maintained by the user. The
87128  * range for rq_prod/cons_idx is from 0 to QPC.rq_size-1. The
87129  * rq_prod_idx value increments by one for each WQE that is added to
87130  * the RQ/SRQ by the user. Value must be wrapped at rq_size. The
87131  * rq_cons_idx value increments by one for each WQE that is completed
87132  * from that particular RQ/SRQ. The qp_handle can be used by the user
87133  * to determine what RQ/SRQ to increment. Value must also be wrapped at
87134  * rq_size. When the two values are equal, the RQ/SRQ is empty. When
87135  * (rq_prod_idx+1)%QPC.rq_size==rq_cons_idx, the queue is full.
87136  */
87137 /* cq_res_ud_v3 (size:256b/32B) */
87138 
87139 typedef struct cq_res_ud_v3 {
87140 	uint16_t	length;
87141 	/*
87142 	 * The length of the message's payload in bytes, stored in
87143 	 * the SGEs
87144 	 */
87145 	#define CQ_RES_UD_V3_LENGTH_MASK UINT32_C(0x3fff)
87146 	#define CQ_RES_UD_V3_LENGTH_SFT 0
87147 	uint8_t	reserved1;
87148 	/* Upper 8b of the Source QP value from the DETH header. */
87149 	uint8_t	src_qp_high;
87150 	/* Immediate data in case the imm_flag set. */
87151 	uint32_t	imm_data;
87152 	/*
87153 	 * This is an application level ID used to identify the
87154 	 * QP and its SQ and RQ.
87155 	 */
87156 	uint64_t	qp_handle;
87157 	/*
87158 	 * Source MAC address for the UD message placed in the WQE
87159 	 * that is completed by this CQE.
87160 	 */
87161 	uint16_t	src_mac[3];
87162 	/* Lower 16b of the Source QP value from the DETH header. */
87163 	uint16_t	src_qp_low;
87164 	uint8_t	cqe_type_toggle;
87165 	/*
87166 	 * Indicate valid completion - written by the chip. The NIC
87167 	 * toggles this bit each time it finished consuming all PBL
87168 	 * entries.
87169 	 */
87170 	#define CQ_RES_UD_V3_TOGGLE		UINT32_C(0x1)
87171 	/* This field defines the type of CQE. */
87172 	#define CQ_RES_UD_V3_CQE_TYPE_MASK	UINT32_C(0x1e)
87173 	#define CQ_RES_UD_V3_CQE_TYPE_SFT	1
87174 	/*
87175 	 * Responder UD Completion - This is used for both RQ and SRQ
87176 	 * completion for UD service QPs. It is also used for QP1 QPs
87177 	 * that are treated as UD.
87178 	 */
87179 		#define CQ_RES_UD_V3_CQE_TYPE_RES_UD_V3  (UINT32_C(0xa) << 1)
87180 		#define CQ_RES_UD_V3_CQE_TYPE_LAST	CQ_RES_UD_V3_CQE_TYPE_RES_UD_V3
87181 	/* This field indicates the status for the CQE. */
87182 	uint8_t	status;
87183 	/* The operation completed successfully. */
87184 	#define CQ_RES_UD_V3_STATUS_OK			UINT32_C(0x0)
87185 	/*
87186 	 * This indicates that the packet was too long for the WQE provided
87187 	 * on the SRQ/RQ.
87188 	 *
87189 	 * This is not a fatal error. All the fields in the CQE are valid.
87190 	 */
87191 	#define CQ_RES_UD_V3_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x3)
87192 	/*
87193 	 * An internal QP consistency error was detected while processing
87194 	 * this Work Request. For requester, this could be an SQ WQE format
87195 	 * error or an operation specified in the WQE that is not supported
87196 	 * for the QP. For responder, this is an RQ/SRQ WQE format error.
87197 	 *
87198 	 * This is a fatal error detected by the requester Tx or responder
87199 	 * Rx. For responder CQEs, only the opaque field is valid.
87200 	 */
87201 	#define CQ_RES_UD_V3_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
87202 	/*
87203 	 * An SGE in the locally posted WQE does not reference a Memory
87204 	 * Region that is valid for the requested operation. If this error
87205 	 * is generated for an SGE using the reserved l_key, this means
87206 	 * that the reserved l_key is not enabled.
87207 	 *
87208 	 * This is a fatal error detected by the requester Tx or responder
87209 	 * Rx. For responder CQEs, only the opaque field is valid.
87210 	 */
87211 	#define CQ_RES_UD_V3_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x5)
87212 	/*
87213 	 * A WQE was in process or outstanding when the QP transitioned
87214 	 * into the Error State.
87215 	 */
87216 	#define CQ_RES_UD_V3_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0xd)
87217 	/*
87218 	 * A WQE had already been taken off the RQ/SRQ when a fatal error
87219 	 * was detected on responder Rx. Only the opaque field in the CQE
87220 	 * is valid.
87221 	 */
87222 	#define CQ_RES_UD_V3_STATUS_HW_FLUSH_ERR		UINT32_C(0xe)
87223 	/*
87224 	 * A WQE was posted to the SQ/RQ that caused it to overflow. For
87225 	 * requester CQEs, it was the SQ that overflowed. For responder
87226 	 * CQEs, it was the RQ that overflowed.
87227 	 */
87228 	#define CQ_RES_UD_V3_STATUS_OVERFLOW_ERR		UINT32_C(0xf)
87229 	#define CQ_RES_UD_V3_STATUS_LAST			CQ_RES_UD_V3_STATUS_OVERFLOW_ERR
87230 	uint16_t	flags;
87231 	/*
87232 	 * This flag indicates that the completion is for a SRQ entry
87233 	 * rather than for an RQ entry.
87234 	 */
87235 	#define CQ_RES_UD_V3_FLAGS_SRQ		UINT32_C(0x1)
87236 	/* CQE relates to RQ WQE. */
87237 		#define CQ_RES_UD_V3_FLAGS_SRQ_RQ		UINT32_C(0x0)
87238 	/* CQE relates to SRQ WQE. */
87239 		#define CQ_RES_UD_V3_FLAGS_SRQ_SRQ		UINT32_C(0x1)
87240 		#define CQ_RES_UD_V3_FLAGS_SRQ_LAST	CQ_RES_UD_V3_FLAGS_SRQ_SRQ
87241 	/* Immediate data indicator */
87242 	#define CQ_RES_UD_V3_FLAGS_IMM		UINT32_C(0x2)
87243 	#define CQ_RES_UD_V3_FLAGS_UNUSED_MASK	UINT32_C(0xc)
87244 	#define CQ_RES_UD_V3_FLAGS_UNUSED_SFT	2
87245 	#define CQ_RES_UD_V3_FLAGS_ROCE_IP_VER_MASK  UINT32_C(0x30)
87246 	#define CQ_RES_UD_V3_FLAGS_ROCE_IP_VER_SFT   4
87247 	/* RoCEv1 Message */
87248 		#define CQ_RES_UD_V3_FLAGS_ROCE_IP_VER_V1	(UINT32_C(0x0) << 4)
87249 	/* RoCEv2 IPv4 Message */
87250 		#define CQ_RES_UD_V3_FLAGS_ROCE_IP_VER_V2IPV4  (UINT32_C(0x2) << 4)
87251 	/* RoCEv2 IPv6 Message */
87252 		#define CQ_RES_UD_V3_FLAGS_ROCE_IP_VER_V2IPV6  (UINT32_C(0x3) << 4)
87253 		#define CQ_RES_UD_V3_FLAGS_ROCE_IP_VER_LAST   CQ_RES_UD_V3_FLAGS_ROCE_IP_VER_V2IPV6
87254 	/* This value is from the WQE that is being completed. */
87255 	uint32_t	opaque;
87256 } cq_res_ud_v3_t, *pcq_res_ud_v3_t;
87257 
87258 /*
87259  * This is the Responder RQ/SRQ CQE V3 structure for RawEth. This is
87260  * used to complete RQ/SRQ WQE's. When the WQE is completed, it
87261  * indicates that there is room for one more WQE on the corresponding
87262  * RQ/SRQ.
87263  *
87264  * User can determine available space in the RQ/SRQ by comparing
87265  * a rq_cons_idx to a rq_prod_idx, both maintained by the user. The
87266  * range for rq_prod/cons_idx is from 0 to QPC.rq_size-1. The
87267  * rq_prod_idx value increments by one for each WQE that is added to
87268  * the RQ/SRQ by the user. Value must be wrapped at rq_size. The
87269  * rq_cons_idx value increments by one for each WQE that is completed
87270  * from that particular RQ/SRQ. The qp_handle can be used by the user
87271  * to determine what RQ/SRQ to increment. Value must also be wrapped at
87272  * rq_size. When the two values are equal, the RQ/SRQ is empty. When
87273  * (rq_prod_idx+1)%QPC.rq_size==rq_cons_idx, the queue is full.
87274  */
87275 /* cq_res_raweth_qp1_v3 (size:256b/32B) */
87276 
87277 typedef struct cq_res_raweth_qp1_v3 {
87278 	uint16_t	length;
87279 	/*
87280 	 * The length of the message's payload in bytes, stored in
87281 	 * the SGEs
87282 	 */
87283 	#define CQ_RES_RAWETH_QP1_V3_LENGTH_MASK UINT32_C(0x3fff)
87284 	#define CQ_RES_RAWETH_QP1_V3_LENGTH_SFT 0
87285 	uint16_t	raweth_qp1_flags_cfa_metadata1;
87286 	/*
87287 	 * When this bit is '1', it indicates a packet that has an
87288 	 * error of some type. Type of error is indicated in
87289 	 * raweth_qp1_errors.
87290 	 */
87291 	#define CQ_RES_RAWETH_QP1_V3_ERROR			UINT32_C(0x1)
87292 	/*
87293 	 * This value indicates what the inner packet determined for the
87294 	 * packet was.
87295 	 */
87296 	#define CQ_RES_RAWETH_QP1_V3_ITYPE_MASK		UINT32_C(0x3c0)
87297 	#define CQ_RES_RAWETH_QP1_V3_ITYPE_SFT		6
87298 	/*
87299 	 * Not Known:
87300 	 * Indicates that the packet type was not known.
87301 	 */
87302 		#define CQ_RES_RAWETH_QP1_V3_ITYPE_NOT_KNOWN		(UINT32_C(0x0) << 6)
87303 	/*
87304 	 * IP Packet:
87305 	 * Indicates that the packet was an IP packet, but further
87306 	 * classification was not possible.
87307 	 */
87308 		#define CQ_RES_RAWETH_QP1_V3_ITYPE_IP			(UINT32_C(0x1) << 6)
87309 	/*
87310 	 * TCP Packet:
87311 	 * Indicates that the packet was IP and TCP.
87312 	 * This indicates that the raweth_qp1_payload_offset field is
87313 	 * valid.
87314 	 */
87315 		#define CQ_RES_RAWETH_QP1_V3_ITYPE_TCP			(UINT32_C(0x2) << 6)
87316 	/*
87317 	 * UDP Packet:
87318 	 * Indicates that the packet was IP and UDP.
87319 	 * This indicates that the raweth_qp1_payload_offset field is
87320 	 * valid.
87321 	 */
87322 		#define CQ_RES_RAWETH_QP1_V3_ITYPE_UDP			(UINT32_C(0x3) << 6)
87323 	/*
87324 	 * FCoE Packet:
87325 	 * Indicates that the packet was recognized as a FCoE.
87326 	 * This also indicates that the raweth_qp1_payload_offset field is
87327 	 * valid.
87328 	 */
87329 		#define CQ_RES_RAWETH_QP1_V3_ITYPE_FCOE		(UINT32_C(0x4) << 6)
87330 	/*
87331 	 * RoCE Packet:
87332 	 * Indicates that the packet was recognized as a RoCE.
87333 	 * This also indicates that the raweth_qp1_payload_offset field is
87334 	 * valid.
87335 	 */
87336 		#define CQ_RES_RAWETH_QP1_V3_ITYPE_ROCE		(UINT32_C(0x5) << 6)
87337 	/*
87338 	 * ICMP Packet:
87339 	 * Indicates that the packet was recognized as ICMP.
87340 	 * This indicates that the raweth_qp1_payload_offset field is
87341 	 * valid.
87342 	 */
87343 		#define CQ_RES_RAWETH_QP1_V3_ITYPE_ICMP		(UINT32_C(0x7) << 6)
87344 	/*
87345 	 * PtP packet wo/timestamp:
87346 	 * Indicates that the packet was recognized as a PtP
87347 	 * packet.
87348 	 */
87349 		#define CQ_RES_RAWETH_QP1_V3_ITYPE_PTP_WO_TIMESTAMP	(UINT32_C(0x8) << 6)
87350 	/*
87351 	 * PtP packet w/timestamp:
87352 	 * Indicates that the packet was recognized as a PtP
87353 	 * packet and that a timestamp was taken for the packet.
87354 	 */
87355 		#define CQ_RES_RAWETH_QP1_V3_ITYPE_PTP_W_TIMESTAMP	(UINT32_C(0x9) << 6)
87356 		#define CQ_RES_RAWETH_QP1_V3_ITYPE_LAST		CQ_RES_RAWETH_QP1_V3_ITYPE_PTP_W_TIMESTAMP
87357 	#define CQ_RES_RAWETH_QP1_V3_CFA_METADATA1_MASK	UINT32_C(0xf000)
87358 	#define CQ_RES_RAWETH_QP1_V3_CFA_METADATA1_SFT	12
87359 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
87360 	#define CQ_RES_RAWETH_QP1_V3_CFA_METADATA1_TPID_SEL_MASK UINT32_C(0x7000)
87361 	#define CQ_RES_RAWETH_QP1_V3_CFA_METADATA1_TPID_SEL_SFT  12
87362 	/* When meta_format != 0, this value is the VLAN valid. */
87363 	#define CQ_RES_RAWETH_QP1_V3_CFA_METADATA1_VALID	UINT32_C(0x8000)
87364 	uint16_t	raweth_qp1_errors;
87365 	/*
87366 	 * This indicates that there was an error in the IP header
87367 	 * checksum.
87368 	 */
87369 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_IP_CS_ERROR			UINT32_C(0x10)
87370 	/*
87371 	 * This indicates that there was an error in the TCP, UDP
87372 	 * or ICMP checksum.
87373 	 */
87374 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_L4_CS_ERROR			UINT32_C(0x20)
87375 	/*
87376 	 * This indicates that there was an error in the tunnel
87377 	 * IP header checksum.
87378 	 */
87379 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_IP_CS_ERROR			UINT32_C(0x40)
87380 	/*
87381 	 * This indicates that there was an error in the tunnel
87382 	 * UDP checksum.
87383 	 */
87384 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_L4_CS_ERROR			UINT32_C(0x80)
87385 	/*
87386 	 * This indicates that there was a CRC error on either an FCoE
87387 	 * or RoCE packet. The itype indicates the packet type.
87388 	 */
87389 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_CRC_ERROR			UINT32_C(0x100)
87390 	/*
87391 	 * This indicates that there was an error in the tunnel
87392 	 * portion of the packet when this
87393 	 * field is non-zero.
87394 	 */
87395 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK		UINT32_C(0xe00)
87396 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT		9
87397 	/*
87398 	 * No additional error occurred on the tunnel portion
87399 	 * of the packet of the packet does not have a tunnel.
87400 	 */
87401 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 9)
87402 	/*
87403 	 * Indicates that IP header version does not match
87404 	 * expectation from L2 Ethertype for IPv4 and IPv6
87405 	 * in the tunnel header.
87406 	 */
87407 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION	(UINT32_C(0x1) << 9)
87408 	/*
87409 	 * Indicates that header length is out of range in the
87410 	 * tunnel header. Valid for
87411 	 * IPv4.
87412 	 */
87413 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN	(UINT32_C(0x2) << 9)
87414 	/*
87415 	 * Indicates that physical packet is shorter than that claimed
87416 	 * by the tunnel l3 header length. Valid for IPv4, or IPv6
87417 	 * tunnel packet packets.
87418 	 */
87419 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR	(UINT32_C(0x3) << 9)
87420 	/*
87421 	 * Indicates that the physical packet is shorter than that
87422 	 * claimed by the tunnel UDP header length for a tunnel
87423 	 * UDP packet that is not fragmented.
87424 	 */
87425 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR	(UINT32_C(0x4) << 9)
87426 	/*
87427 	 * indicates that the IPv4 TTL or IPv6 hop limit check
87428 	 * have failed (e.g. TTL = 0) in the tunnel header. Valid
87429 	 * for IPv4, and IPv6.
87430 	 */
87431 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL		(UINT32_C(0x5) << 9)
87432 	/*
87433 	 * Indicates that the physical packet is shorter than that
87434 	 * claimed by the tunnel header length. Valid for GTPv1-U
87435 	 * packets.
87436 	 */
87437 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_TOTAL_ERROR	(UINT32_C(0x6) << 9)
87438 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_PKT_ERROR_LAST		CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_TOTAL_ERROR
87439 	/*
87440 	 * This indicates that there was an error in the inner
87441 	 * portion of the packet when this
87442 	 * field is non-zero.
87443 	 */
87444 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_MASK			UINT32_C(0xf000)
87445 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_SFT			12
87446 	/*
87447 	 * No additional error occurred on the tunnel portion
87448 	 * of the packet of the packet does not have a tunnel.
87449 	 */
87450 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR		(UINT32_C(0x0) << 12)
87451 	/*
87452 	 * Indicates that IP header version does not match
87453 	 * expectation from L2 Ethertype for IPv4 and IPv6 or that
87454 	 * option other than VFT was parsed on
87455 	 * FCoE packet.
87456 	 */
87457 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION		(UINT32_C(0x1) << 12)
87458 	/*
87459 	 * indicates that header length is out of range. Valid for
87460 	 * IPv4 and RoCE
87461 	 */
87462 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN		(UINT32_C(0x2) << 12)
87463 	/*
87464 	 * indicates that the IPv4 TTL or IPv6 hop limit check
87465 	 * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
87466 	 */
87467 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL		(UINT32_C(0x3) << 12)
87468 	/*
87469 	 * Indicates that physical packet is shorter than that
87470 	 * claimed by the l3 header length. Valid for IPv4,
87471 	 * IPv6 packet or RoCE packets.
87472 	 */
87473 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR		(UINT32_C(0x4) << 12)
87474 	/*
87475 	 * Indicates that the physical packet is shorter than that
87476 	 * claimed by the UDP header length for a UDP packet that is
87477 	 * not fragmented.
87478 	 */
87479 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR	(UINT32_C(0x5) << 12)
87480 	/*
87481 	 * Indicates that TCP header length > IP payload. Valid for
87482 	 * TCP packets only.
87483 	 */
87484 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN		(UINT32_C(0x6) << 12)
87485 	/* Indicates that TCP header length < 5. Valid for TCP. */
87486 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL  (UINT32_C(0x7) << 12)
87487 	/*
87488 	 * Indicates that TCP option headers result in a TCP header
87489 	 * size that does not match data offset in TCP header. Valid
87490 	 * for TCP.
87491 	 */
87492 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN		(UINT32_C(0x8) << 12)
87493 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_LAST			CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
87494 	/* This is data from the CFA as indicated by the meta_format field. */
87495 	uint16_t	cfa_metadata0;
87496 	/* When meta_format=1, this value is the VLAN VID. */
87497 	#define CQ_RES_RAWETH_QP1_V3_CFA_METADATA0_VID_MASK UINT32_C(0xfff)
87498 	#define CQ_RES_RAWETH_QP1_V3_CFA_METADATA0_VID_SFT 0
87499 	/* When meta_format=1, this value is the VLAN DE. */
87500 	#define CQ_RES_RAWETH_QP1_V3_CFA_METADATA0_DE	UINT32_C(0x1000)
87501 	/* When meta_format=1, this value is the VLAN PRI. */
87502 	#define CQ_RES_RAWETH_QP1_V3_CFA_METADATA0_PRI_MASK UINT32_C(0xe000)
87503 	#define CQ_RES_RAWETH_QP1_V3_CFA_METADATA0_PRI_SFT 13
87504 	/*
87505 	 * This is an application level ID used to identify the
87506 	 * QP and its SQ and RQ.
87507 	 */
87508 	uint64_t	qp_handle;
87509 	uint32_t	raweth_qp1_flags2;
87510 	/*
87511 	 * This indicates that the ip checksum was calculated for the
87512 	 * inner packet and that the ip_cs_error field indicates if there
87513 	 * was an error.
87514 	 */
87515 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_IP_CS_CALC		UINT32_C(0x1)
87516 	/*
87517 	 * This indicates that the TCP, UDP or ICMP checksum was
87518 	 * calculated for the inner packet and that the l4_cs_error field
87519 	 * indicates if there was an error.
87520 	 */
87521 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_L4_CS_CALC		UINT32_C(0x2)
87522 	/*
87523 	 * This indicates that the ip checksum was calculated for the
87524 	 * tunnel header and that the t_ip_cs_error field indicates if
87525 	 * there was an error.
87526 	 */
87527 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_T_IP_CS_CALC		UINT32_C(0x4)
87528 	/*
87529 	 * This indicates that the UDP checksum was
87530 	 * calculated for the tunnel packet and that the t_l4_cs_error
87531 	 * field indicates if there was an error.
87532 	 */
87533 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_T_L4_CS_CALC		UINT32_C(0x8)
87534 	/* The field indicates what format the metadata field is. */
87535 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_META_FORMAT_MASK	UINT32_C(0xf0)
87536 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_META_FORMAT_SFT		4
87537 	/* No metadata information. Values are zero. */
87538 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_META_FORMAT_NONE		(UINT32_C(0x0) << 4)
87539 	/*
87540 	 * The {metadata1, metadata0} fields contain the vtag
87541 	 * information:
87542 	 *
87543 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
87544 	 *
87545 	 * The metadata2 field contains the table scope
87546 	 * and action record pointer.
87547 	 *
87548 	 * - metadata2[25:0] contains the action record pointer.
87549 	 * - metadata2[31:26] contains the table scope.
87550 	 */
87551 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_META_FORMAT_ACT_REC_PTR	(UINT32_C(0x1) << 4)
87552 	/*
87553 	 * The {metadata1, metadata0} fields contain the vtag
87554 	 * information:
87555 	 *
87556 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
87557 	 *
87558 	 * The metadata2 field contains the Tunnel ID value, justified
87559 	 * to LSB.
87560 	 *
87561 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
87562 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
87563 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
87564 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
87565 	 * - IPv4 = 0 (not populated)
87566 	 * - IPv6 = Flow Label[19:0]
87567 	 * - PPPoE = sessionID[15:0]
87568 	 * - MPLs = Outer label[19:0]
87569 	 * - UPAR = Selected[31:0] with bit mask
87570 	 */
87571 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 4)
87572 	/*
87573 	 * The {metadata1, metadata0} fields contain the vtag
87574 	 * information:
87575 	 *
87576 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
87577 	 *
87578 	 * The metadata2 field contains the 32b metadata from the
87579 	 * prepended header (chdr_data).
87580 	 */
87581 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 4)
87582 	/*
87583 	 * The {metadata1, metadata0} fields contain the vtag
87584 	 * information:
87585 	 *
87586 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
87587 	 *
87588 	 * The metadata2 field contains the outer_l3_offset,
87589 	 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
87590 	 *
87591 	 * - metadata2[8:0] contains the outer_l3_offset.
87592 	 * - metadata2[17:9] contains the inner_l2_offset.
87593 	 * - metadata2[26:18] contains the inner_l3_offset.
87594 	 * - metadata2[31:27] contains the inner_l4_size.
87595 	 */
87596 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET	(UINT32_C(0x4) << 4)
87597 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_META_FORMAT_LAST		CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET
87598 	/*
87599 	 * This field indicates the IP type for the inner-most IP header.
87600 	 * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
87601 	 * This value is only valid if itype indicates a packet
87602 	 * with an IP header.
87603 	 */
87604 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_IP_TYPE			UINT32_C(0x100)
87605 	/*
87606 	 * This indicates that the complete 1's complement checksum was
87607 	 * calculated for the packet.
87608 	 */
87609 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_CALC	UINT32_C(0x200)
87610 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_T_IP_TYPE		UINT32_C(0x400)
87611 	/* Indicates that the Tunnel IP type was IPv4. */
87612 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_T_IP_TYPE_IPV4		(UINT32_C(0x0) << 10)
87613 	/* Indicates that the Tunnel IP type was IPv6. */
87614 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_T_IP_TYPE_IPV6		(UINT32_C(0x1) << 10)
87615 		#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_T_IP_TYPE_LAST		CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_T_IP_TYPE_IPV6
87616 	/*
87617 	 * This value is the complete 1's complement checksum calculated
87618 	 * from the start of the outer L3 header to the end of the packet
87619 	 * (not including the ethernet crc). It is valid when the
87620 	 * 'complete_checksum_calc' flag is set.
87621 	 */
87622 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_MASK	UINT32_C(0xffff0000)
87623 	#define CQ_RES_RAWETH_QP1_V3_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_SFT	16
87624 	/*
87625 	 * This is data from the CFA block as indicated by the meta_format
87626 	 * field.
87627 	 *
87628 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
87629 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
87630 	 *   act_rec_ptr[25:0]}
87631 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
87632 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
87633 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
87634 	 */
87635 	uint32_t	cfa_metadata2;
87636 	uint8_t	cqe_type_toggle;
87637 	/*
87638 	 * Indicate valid completion - written by the chip. The NIC
87639 	 * toggles this bit each time it finished consuming all PBL
87640 	 * entries.
87641 	 */
87642 	#define CQ_RES_RAWETH_QP1_V3_TOGGLE			UINT32_C(0x1)
87643 	/* This field defines the type of CQE. */
87644 	#define CQ_RES_RAWETH_QP1_V3_CQE_TYPE_MASK		UINT32_C(0x1e)
87645 	#define CQ_RES_RAWETH_QP1_V3_CQE_TYPE_SFT		1
87646 	/*
87647 	 * Responder RawEth and QP1 Completion - This is used for RQ and
87648 	 * SRQ completion for RawEth service. It is also used for QP1 QPs
87649 	 * that are treated as RawEth.
87650 	 */
87651 		#define CQ_RES_RAWETH_QP1_V3_CQE_TYPE_RES_RAWETH_QP1_V3  (UINT32_C(0xb) << 1)
87652 		#define CQ_RES_RAWETH_QP1_V3_CQE_TYPE_LAST		CQ_RES_RAWETH_QP1_V3_CQE_TYPE_RES_RAWETH_QP1_V3
87653 	/* This field indicates the status for the CQE. */
87654 	uint8_t	status;
87655 	/* The operation completed successfully. */
87656 	#define CQ_RES_RAWETH_QP1_V3_STATUS_OK			UINT32_C(0x0)
87657 	/*
87658 	 * This indicates that the packet was too long for the WQE provided
87659 	 * on the SRQ/RQ.
87660 	 *
87661 	 * This is not a fatal error. All the fields in the CQE are valid.
87662 	 */
87663 	#define CQ_RES_RAWETH_QP1_V3_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x3)
87664 	/*
87665 	 * An internal QP consistency error was detected while processing
87666 	 * this Work Request. For requester, this could be an SQ WQE format
87667 	 * error or an operation specified in the WQE that is not supported
87668 	 * for the QP. For responder, this is an RQ/SRQ WQE format error.
87669 	 *
87670 	 * This is a fatal error detected by the requester Tx or responder
87671 	 * Rx. For responder CQEs, only the opaque field is valid.
87672 	 */
87673 	#define CQ_RES_RAWETH_QP1_V3_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
87674 	/*
87675 	 * An SGE in the locally posted WQE does not reference a Memory
87676 	 * Region that is valid for the requested operation. If this error
87677 	 * is generated for an SGE using the reserved l_key, this means
87678 	 * that the reserved l_key is not enabled.
87679 	 *
87680 	 * This is a fatal error detected by the requester Tx or responder
87681 	 * Rx. For responder CQEs, only the opaque field is valid.
87682 	 */
87683 	#define CQ_RES_RAWETH_QP1_V3_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x5)
87684 	/*
87685 	 * A WQE was in process or outstanding when the QP transitioned
87686 	 * into the Error State.
87687 	 */
87688 	#define CQ_RES_RAWETH_QP1_V3_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0xd)
87689 	/*
87690 	 * A WQE had already been taken off the RQ/SRQ when a fatal error
87691 	 * was detected on responder Rx. Only the opaque field in the CQE
87692 	 * is valid.
87693 	 */
87694 	#define CQ_RES_RAWETH_QP1_V3_STATUS_HW_FLUSH_ERR		UINT32_C(0xe)
87695 	/*
87696 	 * A WQE was posted to the SQ/RQ that caused it to overflow. For
87697 	 * requester CQEs, it was the SQ that overflowed. For responder
87698 	 * CQEs, it was the RQ that overflowed.
87699 	 */
87700 	#define CQ_RES_RAWETH_QP1_V3_STATUS_OVERFLOW_ERR		UINT32_C(0xf)
87701 	#define CQ_RES_RAWETH_QP1_V3_STATUS_LAST			CQ_RES_RAWETH_QP1_V3_STATUS_OVERFLOW_ERR
87702 	uint8_t	flags;
87703 	/*
87704 	 * This flag indicates that the completion is for a SRQ entry
87705 	 * rather than for an RQ entry.
87706 	 */
87707 	#define CQ_RES_RAWETH_QP1_V3_FLAGS_SRQ	UINT32_C(0x1)
87708 	/* CQE relates to RQ WQE. */
87709 		#define CQ_RES_RAWETH_QP1_V3_FLAGS_SRQ_RQ	UINT32_C(0x0)
87710 	/* CQE relates to SRQ WQE. */
87711 		#define CQ_RES_RAWETH_QP1_V3_FLAGS_SRQ_SRQ   UINT32_C(0x1)
87712 		#define CQ_RES_RAWETH_QP1_V3_FLAGS_SRQ_LAST CQ_RES_RAWETH_QP1_V3_FLAGS_SRQ_SRQ
87713 	/*
87714 	 * This value indicates the offset in bytes from the beginning of the
87715 	 * packet where the inner payload starts. This value is valid for
87716 	 * TCP, UDP, FCoE, and RoCE packets.
87717 	 *
87718 	 * A value of zero indicates an offset of 256 bytes.
87719 	 */
87720 	uint8_t	raweth_qp1_payload_offset;
87721 	/* This value is from the WQE that is being completed. */
87722 	uint32_t	opaque;
87723 } cq_res_raweth_qp1_v3_t, *pcq_res_raweth_qp1_v3_t;
87724 
87725 /*
87726  * This is the Responder RQ/SRQ CQE V3 structure for UD QPs and QP1 QPs
87727  * treated as UD. This is used to complete RQ/SRQ WQE's. It differs
87728  * from the Res_UD CQE in that it carries additional CFA fields, in
87729  * place of the QP handle. (Instead of the QP handle, this CQE carries
87730  * the QID. It is up to the user to map the QID back to a QP handle.)
87731  * When the WQE is completed, it indicates that there is room for one
87732  * more WQE on the corresponding RQ/SRQ.
87733  *
87734  * User can determine available space in the RQ/SRQ by comparing
87735  * a rq_cons_idx to a rq_prod_idx, both maintained by the user. The
87736  * range for rq_prod/cons_idx is from 0 to QPC.rq_size-1. The
87737  * rq_prod_idx value increments by one for each WQE that is added to
87738  * the RQ/SRQ by the user. Value must be wrapped at rq_size. The
87739  * rq_cons_idx value increments by one for each WQE that is completed
87740  * from that particular RQ/SRQ. The qp_handle can be used by the user
87741  * to determine what RQ/SRQ to increment. Value must also be wrapped at
87742  * rq_size. When the two values are equal, the RQ/SRQ is empty. When
87743  * (rq_prod_idx+1)%QPC.rq_size==rq_cons_idx, the queue is full.
87744  */
87745 /* cq_res_ud_cfa_v3 (size:256b/32B) */
87746 
87747 typedef struct cq_res_ud_cfa_v3 {
87748 	uint16_t	length;
87749 	/*
87750 	 * The length of the message's payload in bytes, stored in
87751 	 * the SGEs
87752 	 */
87753 	#define CQ_RES_UD_CFA_V3_LENGTH_MASK UINT32_C(0x3fff)
87754 	#define CQ_RES_UD_CFA_V3_LENGTH_SFT 0
87755 	/* This is data from the CFA as indicated by the meta_format field. */
87756 	uint16_t	cfa_metadata0;
87757 	/* When meta_format=1, this value is the VLAN VID. */
87758 	#define CQ_RES_UD_CFA_V3_CFA_METADATA0_VID_MASK UINT32_C(0xfff)
87759 	#define CQ_RES_UD_CFA_V3_CFA_METADATA0_VID_SFT 0
87760 	/* When meta_format=1, this value is the VLAN DE. */
87761 	#define CQ_RES_UD_CFA_V3_CFA_METADATA0_DE	UINT32_C(0x1000)
87762 	/* When meta_format=1, this value is the VLAN PRI. */
87763 	#define CQ_RES_UD_CFA_V3_CFA_METADATA0_PRI_MASK UINT32_C(0xe000)
87764 	#define CQ_RES_UD_CFA_V3_CFA_METADATA0_PRI_SFT 13
87765 	/* Immediate data in case the imm_flag set. */
87766 	uint32_t	imm_data;
87767 	uint32_t	qid_cfa_metadata1_src_qp_high;
87768 	/*
87769 	 * This value indicates the QPID associated with this operation.
87770 	 *
87771 	 * The driver will use the qid from this CQE to map a QP handle
87772 	 * in the completion record returned to the application.
87773 	 */
87774 	#define CQ_RES_UD_CFA_V3_QID_MASK		UINT32_C(0x7ff)
87775 	#define CQ_RES_UD_CFA_V3_QID_SFT			0
87776 	#define CQ_RES_UD_CFA_V3_UNUSED_MASK		UINT32_C(0xff800)
87777 	#define CQ_RES_UD_CFA_V3_UNUSED_SFT		11
87778 	#define CQ_RES_UD_CFA_V3_CFA_METADATA1_MASK	UINT32_C(0xf00000)
87779 	#define CQ_RES_UD_CFA_V3_CFA_METADATA1_SFT	20
87780 	/* When meta_format != 0, this value is the VLAN TPID_SEL. */
87781 	#define CQ_RES_UD_CFA_V3_CFA_METADATA1_TPID_SEL_MASK UINT32_C(0x700000)
87782 	#define CQ_RES_UD_CFA_V3_CFA_METADATA1_TPID_SEL_SFT  20
87783 	/* When meta_format != 0, this value is the VLAN valid. */
87784 	#define CQ_RES_UD_CFA_V3_CFA_METADATA1_VALID	UINT32_C(0x800000)
87785 	/* Upper 8b of the Source QP value from the DETH header. */
87786 	#define CQ_RES_UD_CFA_V3_SRC_QP_HIGH_MASK	UINT32_C(0xff000000)
87787 	#define CQ_RES_UD_CFA_V3_SRC_QP_HIGH_SFT		24
87788 	/*
87789 	 * This is data from the CFA block as indicated by the meta_format
87790 	 * field.
87791 	 *
87792 	 * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
87793 	 * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
87794 	 *   act_rec_ptr[25:0]}
87795 	 * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
87796 	 * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
87797 	 * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
87798 	 */
87799 	uint32_t	cfa_metadata2;
87800 	/*
87801 	 * Source MAC address for the UD message placed in the WQE
87802 	 * that is completed by this CQE.
87803 	 */
87804 	uint16_t	src_mac[3];
87805 	/* Lower 16b of the Source QP value from the DETH header. */
87806 	uint16_t	src_qp_low;
87807 	uint8_t	cqe_type_toggle;
87808 	/*
87809 	 * Indicate valid completion - written by the chip. The NIC
87810 	 * toggles this bit each time it finished consuming all PBL
87811 	 * entries
87812 	 */
87813 	#define CQ_RES_UD_CFA_V3_TOGGLE		UINT32_C(0x1)
87814 	/* This field defines the type of CQE. */
87815 	#define CQ_RES_UD_CFA_V3_CQE_TYPE_MASK	UINT32_C(0x1e)
87816 	#define CQ_RES_UD_CFA_V3_CQE_TYPE_SFT	1
87817 	/*
87818 	 * Responder UD Completion with CFA - This is used for both RQ
87819 	 * and SRQ completion for UD service QPs. It includes cfa fields
87820 	 * (some of which carry VLAN information), in place of the QP
87821 	 * handle. It is also used for QP1 QPs that are treated as UD.
87822 	 */
87823 		#define CQ_RES_UD_CFA_V3_CQE_TYPE_RES_UD_CFA_V3  (UINT32_C(0xc) << 1)
87824 		#define CQ_RES_UD_CFA_V3_CQE_TYPE_LAST	CQ_RES_UD_CFA_V3_CQE_TYPE_RES_UD_CFA_V3
87825 	/* This field indicates the status for the CQE. */
87826 	uint8_t	status;
87827 	/* The operation completed successfully. */
87828 	#define CQ_RES_UD_CFA_V3_STATUS_OK			UINT32_C(0x0)
87829 	/*
87830 	 * This indicates that the packet was too long for the WQE provided
87831 	 * on the SRQ/RQ.
87832 	 *
87833 	 * This is not a fatal error. All the fields in the CQE are valid.
87834 	 */
87835 	#define CQ_RES_UD_CFA_V3_STATUS_HW_LOCAL_LENGTH_ERR	UINT32_C(0x3)
87836 	/*
87837 	 * An internal QP consistency error was detected while processing
87838 	 * this Work Request. For requester, this could be an SQ WQE format
87839 	 * error or an operation specified in the WQE that is not supported
87840 	 * for the QP. For responder, this is an RQ/SRQ WQE format error.
87841 	 *
87842 	 * This is a fatal error detected by the requester Tx or responder
87843 	 * Rx. For responder CQEs, only the opaque field is valid.
87844 	 */
87845 	#define CQ_RES_UD_CFA_V3_STATUS_LOCAL_QP_OPERATION_ERR   UINT32_C(0x4)
87846 	/*
87847 	 * An SGE in the locally posted WQE does not reference a Memory
87848 	 * Region that is valid for the requested operation. If this error
87849 	 * is generated for an SGE using the reserved l_key, this means
87850 	 * that the reserved l_key is not enabled.
87851 	 *
87852 	 * This is a fatal error detected by the requester Tx or responder
87853 	 * Rx. For responder CQEs, only the opaque field is valid.
87854 	 */
87855 	#define CQ_RES_UD_CFA_V3_STATUS_LOCAL_PROTECTION_ERR	UINT32_C(0x5)
87856 	/*
87857 	 * A WQE was in process or outstanding when the QP transitioned
87858 	 * into the Error State.
87859 	 */
87860 	#define CQ_RES_UD_CFA_V3_STATUS_WORK_REQUEST_FLUSHED_ERR UINT32_C(0xd)
87861 	/*
87862 	 * A WQE had already been taken off the RQ/SRQ when a fatal error
87863 	 * was detected on responder Rx. Only the opaque field in the CQE
87864 	 * is valid.
87865 	 */
87866 	#define CQ_RES_UD_CFA_V3_STATUS_HW_FLUSH_ERR		UINT32_C(0xe)
87867 	/*
87868 	 * A WQE was posted to the SQ/RQ that caused it to overflow. For
87869 	 * requester CQEs, it was the SQ that overflowed. For responder
87870 	 * CQEs, it was the RQ that overflowed.
87871 	 */
87872 	#define CQ_RES_UD_CFA_V3_STATUS_OVERFLOW_ERR		UINT32_C(0xf)
87873 	#define CQ_RES_UD_CFA_V3_STATUS_LAST			CQ_RES_UD_CFA_V3_STATUS_OVERFLOW_ERR
87874 	uint16_t	flags;
87875 	/*
87876 	 * This flag indicates that the completion is for a SRQ entry
87877 	 * rather than for an RQ entry.
87878 	 */
87879 	#define CQ_RES_UD_CFA_V3_FLAGS_SRQ			UINT32_C(0x1)
87880 	/* CQE relates to RQ WQE. */
87881 		#define CQ_RES_UD_CFA_V3_FLAGS_SRQ_RQ		UINT32_C(0x0)
87882 	/* CQE relates to SRQ WQE. */
87883 		#define CQ_RES_UD_CFA_V3_FLAGS_SRQ_SRQ		UINT32_C(0x1)
87884 		#define CQ_RES_UD_CFA_V3_FLAGS_SRQ_LAST		CQ_RES_UD_CFA_V3_FLAGS_SRQ_SRQ
87885 	/* Immediate data indicator */
87886 	#define CQ_RES_UD_CFA_V3_FLAGS_IMM			UINT32_C(0x2)
87887 	#define CQ_RES_UD_CFA_V3_FLAGS_UNUSED_MASK		UINT32_C(0xc)
87888 	#define CQ_RES_UD_CFA_V3_FLAGS_UNUSED_SFT		2
87889 	#define CQ_RES_UD_CFA_V3_FLAGS_ROCE_IP_VER_MASK	UINT32_C(0x30)
87890 	#define CQ_RES_UD_CFA_V3_FLAGS_ROCE_IP_VER_SFT	4
87891 	/* RoCEv1 Message */
87892 		#define CQ_RES_UD_CFA_V3_FLAGS_ROCE_IP_VER_V1	(UINT32_C(0x0) << 4)
87893 	/* RoCEv2 IPv4 Message */
87894 		#define CQ_RES_UD_CFA_V3_FLAGS_ROCE_IP_VER_V2IPV4	(UINT32_C(0x2) << 4)
87895 	/* RoCEv2 IPv6 Message */
87896 		#define CQ_RES_UD_CFA_V3_FLAGS_ROCE_IP_VER_V2IPV6	(UINT32_C(0x3) << 4)
87897 		#define CQ_RES_UD_CFA_V3_FLAGS_ROCE_IP_VER_LAST	CQ_RES_UD_CFA_V3_FLAGS_ROCE_IP_VER_V2IPV6
87898 	/* The field indicates what format the metadata field is. */
87899 	#define CQ_RES_UD_CFA_V3_FLAGS_META_FORMAT_MASK	UINT32_C(0x3c0)
87900 	#define CQ_RES_UD_CFA_V3_FLAGS_META_FORMAT_SFT	6
87901 	/* No metadata information. Value is zero. */
87902 		#define CQ_RES_UD_CFA_V3_FLAGS_META_FORMAT_NONE	(UINT32_C(0x0) << 6)
87903 	/*
87904 	 * The {metadata1, metadata0} fields contain the vtag
87905 	 * information:
87906 	 *
87907 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
87908 	 *
87909 	 * The metadata2 field contains the table scope
87910 	 * and action record pointer.
87911 	 *
87912 	 * - metadata2[25:0] contains the action record pointer.
87913 	 * - metadata2[31:26] contains the table scope.
87914 	 */
87915 		#define CQ_RES_UD_CFA_V3_FLAGS_META_FORMAT_ACT_REC_PTR  (UINT32_C(0x1) << 6)
87916 	/*
87917 	 * The {metadata1, metadata0} fields contain the vtag
87918 	 * information:
87919 	 *
87920 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
87921 	 *
87922 	 * The metadata2 field contains the Tunnel ID
87923 	 * value, justified to LSB.
87924 	 *
87925 	 * - VXLAN = VNI[23:0] -> VXLAN Network ID
87926 	 * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
87927 	 * - NVGRE = TNI[23:0] -> Tenant Network ID
87928 	 * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
87929 	 * - IPv4 = 0 (not populated)
87930 	 * - IPv6 = Flow Label[19:0]
87931 	 * - PPPoE = sessionID[15:0]
87932 	 * - MPLs = Outer label[19:0]
87933 	 * - UPAR = Selected[31:0] with bit mask
87934 	 */
87935 		#define CQ_RES_UD_CFA_V3_FLAGS_META_FORMAT_TUNNEL_ID	(UINT32_C(0x2) << 6)
87936 	/*
87937 	 * The {metadata1, metadata0} fields contain the vtag
87938 	 * information:
87939 	 *
87940 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
87941 	 *
87942 	 * The metadata2 field contains the 32b metadata from the
87943 	 * prepended header (chdr_data).
87944 	 */
87945 		#define CQ_RES_UD_CFA_V3_FLAGS_META_FORMAT_CHDR_DATA	(UINT32_C(0x3) << 6)
87946 	/*
87947 	 * The {metadata1, metadata0} fields contain the vtag
87948 	 * information:
87949 	 *
87950 	 * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
87951 	 *
87952 	 * The metadata2 field contains the outer_l3_offset,
87953 	 * inner_l2_offset, inner_l3_offset, and inner_l4_size.
87954 	 *
87955 	 * - metadata2[8:0] contains the outer_l3_offset.
87956 	 * - metadata2[17:9] contains the inner_l2_offset.
87957 	 * - metadata2[26:18] contains the inner_l3_offset.
87958 	 * - metadata2[31:27] contains the inner_l4_size.
87959 	 */
87960 		#define CQ_RES_UD_CFA_V3_FLAGS_META_FORMAT_HDR_OFFSET   (UINT32_C(0x4) << 6)
87961 		#define CQ_RES_UD_CFA_V3_FLAGS_META_FORMAT_LAST	CQ_RES_UD_CFA_V3_FLAGS_META_FORMAT_HDR_OFFSET
87962 	/*
87963 	 * This value will be returned in the completion if the completion is
87964 	 * signaled.
87965 	 */
87966 	uint32_t	opaque;
87967 } cq_res_ud_cfa_v3_t, *pcq_res_ud_cfa_v3_t;
87968 
87969 /* nq_base (size:128b/16B) */
87970 
87971 typedef struct nq_base {
87972 	uint16_t	info10_type;
87973 	/*
87974 	 * This field indicates the exact type of the completion.
87975 	 * By convention, the LSB identifies the length of the
87976 	 * record in 16B units. Even values indicate 16B
87977 	 * records. Odd values indicate 32B
87978 	 * records.
87979 	 */
87980 	#define NQ_BASE_TYPE_MASK	UINT32_C(0x3f)
87981 	#define NQ_BASE_TYPE_SFT		0
87982 	/* CQ Notification */
87983 		#define NQ_BASE_TYPE_CQ_NOTIFICATION  UINT32_C(0x30)
87984 	/* SRQ Threshold Event */
87985 		#define NQ_BASE_TYPE_SRQ_EVENT	UINT32_C(0x32)
87986 	/* DBQ Threshold Event */
87987 		#define NQ_BASE_TYPE_DBQ_EVENT	UINT32_C(0x34)
87988 	/* QP Async Notification */
87989 		#define NQ_BASE_TYPE_QP_EVENT	UINT32_C(0x38)
87990 	/* Function Async Notification */
87991 		#define NQ_BASE_TYPE_FUNC_EVENT	UINT32_C(0x3a)
87992 	/* NQ Reassign Notification */
87993 		#define NQ_BASE_TYPE_NQ_REASSIGN	UINT32_C(0x3c)
87994 		#define NQ_BASE_TYPE_LAST		NQ_BASE_TYPE_NQ_REASSIGN
87995 	/* info10 is 10 b */
87996 	#define NQ_BASE_INFO10_MASK	UINT32_C(0xffc0)
87997 	#define NQ_BASE_INFO10_SFT	6
87998 	/* info16 is 16 b */
87999 	uint16_t	info16;
88000 	/* info32 is 32 b */
88001 	uint32_t	info32;
88002 	/* info32 is 32 b */
88003 	uint64_t	info63_v;
88004 	/*
88005 	 * This value is written by the NIC such that it will be different
88006 	 * for each pass through the completion queue. The even passes
88007 	 * will write 1. The odd passes will write 0.
88008 	 */
88009 	#define NQ_BASE_V	UINT32_C(0x1)
88010 	/* info63 is 63 b */
88011 	#define NQ_BASE_INFO63_MASK UINT32_C(0xfffffffe)
88012 	#define NQ_BASE_INFO63_SFT 1
88013 } nq_base_t, *pnq_base_t;
88014 
88015 /* Completion Queue Notification */
88016 /* nq_cn (size:128b/16B) */
88017 
88018 typedef struct nq_cn {
88019 	uint16_t	type;
88020 	/*
88021 	 * This field indicates the exact type of the completion.
88022 	 * By convention, the LSB identifies the length of the
88023 	 * record in 16B units. Even values indicate 16B
88024 	 * records. Odd values indicate 32B
88025 	 * records.
88026 	 */
88027 	#define NQ_CN_TYPE_MASK	UINT32_C(0x3f)
88028 	#define NQ_CN_TYPE_SFT		0
88029 	/* CQ Notification */
88030 		#define NQ_CN_TYPE_CQ_NOTIFICATION  UINT32_C(0x30)
88031 		#define NQ_CN_TYPE_LAST		NQ_CN_TYPE_CQ_NOTIFICATION
88032 	/*
88033 	 * This field carries the toggle value that must be used to
88034 	 * re-arm this CQ. The toggle value should be copied into the
88035 	 * doorbell used to CQ_ARMENA, CQ_ARMALL or CQ_ARMSE doorbells.
88036 	 *
88037 	 * This value is used by HW to detect old and stale CQ_ARMENA,
88038 	 * CQ_ARMALL, or CQ_ARMSE doorbells that are caused by having
88039 	 * a backup doorbell location or by PCI or other reordering
88040 	 * problems. Only the doorbells that match the latest value of
88041 	 * toggle will be honored.
88042 	 */
88043 	#define NQ_CN_TOGGLE_MASK	UINT32_C(0xc0)
88044 	#define NQ_CN_TOGGLE_SFT	6
88045 	uint16_t	reserved16;
88046 	/*
88047 	 * This is an application level ID used to identify the
88048 	 * CQ. This field carries the lower 32b of the value.
88049 	 */
88050 	uint32_t	cq_handle_low;
88051 	uint32_t	v;
88052 	/*
88053 	 * This value is written by the NIC such that it will be different
88054 	 * for each pass through the completion queue. The even passes
88055 	 * will write 1. The odd passes will write 0.
88056 	 */
88057 	#define NQ_CN_V	UINT32_C(0x1)
88058 	/*
88059 	 * This is an application level ID used to identify the
88060 	 * CQ. This field carries the upper 32b of the value.
88061 	 */
88062 	uint32_t	cq_handle_high;
88063 } nq_cn_t, *pnq_cn_t;
88064 
88065 /* SRQ Event Notification */
88066 /* nq_srq_event (size:128b/16B) */
88067 
88068 typedef struct nq_srq_event {
88069 	uint8_t	type;
88070 	/*
88071 	 * This field indicates the exact type of the completion.
88072 	 * By convention, the LSB identifies the length of the
88073 	 * record in 16B units. Even values indicate 16B
88074 	 * records. Odd values indicate 32B records.
88075 	 */
88076 	#define NQ_SRQ_EVENT_TYPE_MASK	UINT32_C(0x3f)
88077 	#define NQ_SRQ_EVENT_TYPE_SFT	0
88078 	/* SRQ Threshold Event */
88079 		#define NQ_SRQ_EVENT_TYPE_SRQ_EVENT  UINT32_C(0x32)
88080 		#define NQ_SRQ_EVENT_TYPE_LAST	NQ_SRQ_EVENT_TYPE_SRQ_EVENT
88081 	/*
88082 	 * This field carries the toggle value that must be used
88083 	 * to re-arm this SRQ. The toggle value should be copied
88084 	 * into the doorbell used to SRQ_ARMENA or SRQ_ARM doorbells.
88085 	 */
88086 	#define NQ_SRQ_EVENT_TOGGLE_MASK   UINT32_C(0xc0)
88087 	#define NQ_SRQ_EVENT_TOGGLE_SFT	6
88088 	/*
88089 	 * This value define what type of async event has occurred
88090 	 * on the SRQ.
88091 	 */
88092 	uint8_t	event;
88093 	/* The threshold event has occurred on the specified SRQ. */
88094 	#define NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT UINT32_C(0x1)
88095 	#define NQ_SRQ_EVENT_EVENT_LAST		NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT
88096 	uint16_t	reserved16;
88097 	/*
88098 	 * This is the SRQ handle value for the queue that has
88099 	 * reached it's event threshold. This field carries the
88100 	 * lower 32b of the value.
88101 	 */
88102 	uint32_t	srq_handle_low;
88103 	uint32_t	v;
88104 	/*
88105 	 * This value is written by the NIC such that it will be different
88106 	 * for each pass through the completion queue. The even passes
88107 	 * will write 1. The odd passes will write 0.
88108 	 */
88109 	#define NQ_SRQ_EVENT_V	UINT32_C(0x1)
88110 	/*
88111 	 * This is the SRQ handle value for the queue that has
88112 	 * reached it's event threshold. This field carries the
88113 	 * upper 32b of the value.
88114 	 */
88115 	uint32_t	srq_handle_high;
88116 } nq_srq_event_t, *pnq_srq_event_t;
88117 
88118 /* DBQ Async Event Notification */
88119 /* nq_dbq_event (size:128b/16B) */
88120 
88121 typedef struct nq_dbq_event {
88122 	uint8_t	type;
88123 	/*
88124 	 * This field indicates the exact type of the completion.
88125 	 * By convention, the LSB identifies the length of the
88126 	 * record in 16B units. Even values indicate 16B
88127 	 * records. Odd values indicate 32B
88128 	 * records.
88129 	 */
88130 	#define NQ_DBQ_EVENT_TYPE_MASK	UINT32_C(0x3f)
88131 	#define NQ_DBQ_EVENT_TYPE_SFT	0
88132 	/* DBQ Threshold Event */
88133 		#define NQ_DBQ_EVENT_TYPE_DBQ_EVENT  UINT32_C(0x34)
88134 		#define NQ_DBQ_EVENT_TYPE_LAST	NQ_DBQ_EVENT_TYPE_DBQ_EVENT
88135 	/* This value define what type of action the driver should take. */
88136 	uint8_t	event;
88137 	/*
88138 	 * The driver should start writing dummy values to the
88139 	 * the doorbell in an attempt to consume all the PCIE
88140 	 * posted write resources and prevent doorbell overflow.
88141 	 */
88142 	#define NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT UINT32_C(0x1)
88143 	#define NQ_DBQ_EVENT_EVENT_LAST		NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT
88144 	uint16_t	db_pfid;
88145 	/*
88146 	 * This is the PFID of function that wrote the doorbell that
88147 	 * crossed the async event threshold.
88148 	 */
88149 	#define NQ_DBQ_EVENT_DB_PFID_MASK UINT32_C(0xf)
88150 	#define NQ_DBQ_EVENT_DB_PFID_SFT 0
88151 	uint32_t	db_dpi;
88152 	/*
88153 	 * This is the DPI of the doorbell write that crossed
88154 	 * the async event threshold.
88155 	 */
88156 	#define NQ_DBQ_EVENT_DB_DPI_MASK UINT32_C(0xfffff)
88157 	#define NQ_DBQ_EVENT_DB_DPI_SFT 0
88158 	uint32_t	v;
88159 	/*
88160 	 * This value is written by the NIC such that it will be different
88161 	 * for each pass through the completion queue. The even passes
88162 	 * will write 1. The odd passes will write 0.
88163 	 */
88164 	#define NQ_DBQ_EVENT_V	UINT32_C(0x1)
88165 	uint32_t	db_type_db_xid;
88166 	/*
88167 	 * DB 'XID' field from doorbell that crossed the async event
88168 	 * threshold. This is a QPID, SID, or CID, depending on
88169 	 * the db_type field.
88170 	 */
88171 	#define NQ_DBQ_EVENT_DB_XID_MASK UINT32_C(0xfffff)
88172 	#define NQ_DBQ_EVENT_DB_XID_SFT  0
88173 	/*
88174 	 * DB 'type' field from doorbell that crossed the async event
88175 	 * threshold.
88176 	 */
88177 	#define NQ_DBQ_EVENT_DB_TYPE_MASK UINT32_C(0xf0000000)
88178 	#define NQ_DBQ_EVENT_DB_TYPE_SFT 28
88179 } nq_dbq_event_t, *pnq_dbq_event_t;
88180 
88181 /*
88182  * This completion indicates that the NQ Reassign doorbell has been
88183  * executed by the CQ processing block and no further NQE will arrive
88184  * for this CQ on this NQ.
88185  */
88186 /* nq_reassign (size:128b/16B) */
88187 
88188 typedef struct nq_reassign {
88189 	uint16_t	type;
88190 	/*
88191 	 * This field indicates the exact type of the completion.
88192 	 * By convention, the LSB identifies the length of the
88193 	 * record in 16B units. Even values indicate 16B
88194 	 * records. Odd values indicate 32B records.
88195 	 */
88196 	#define NQ_REASSIGN_TYPE_MASK	UINT32_C(0x3f)
88197 	#define NQ_REASSIGN_TYPE_SFT	0
88198 	/* NQ Reassign Notification */
88199 		#define NQ_REASSIGN_TYPE_NQ_REASSIGN  UINT32_C(0x3c)
88200 		#define NQ_REASSIGN_TYPE_LAST	NQ_REASSIGN_TYPE_NQ_REASSIGN
88201 	uint16_t	reserved16;
88202 	/*
88203 	 * This is an application level ID used to identify the
88204 	 * CQ. This field carries the lower 32b of the value.
88205 	 */
88206 	uint32_t	cq_handle_low;
88207 	uint32_t	v;
88208 	/*
88209 	 * This value is written by the NIC such that it will be different
88210 	 * for each pass through the completion queue. The even passes
88211 	 * will write 1. The odd passes will write 0.
88212 	 */
88213 	#define NQ_REASSIGN_V	UINT32_C(0x1)
88214 	/*
88215 	 * This is an application level ID used to identify the
88216 	 * CQ. This field carries the upper 32b of the value.
88217 	 */
88218 	uint32_t	cq_handle_high;
88219 } nq_reassign_t, *pnq_reassign_t;
88220 
88221 /* Input Read Request Queue (IRRQ) Message */
88222 /* xrrq_irrq (size:256b/32B) */
88223 
88224 typedef struct xrrq_irrq {
88225 	uint16_t	credits_type;
88226 	/* Type indication */
88227 	#define XRRQ_IRRQ_TYPE	UINT32_C(0x1)
88228 	/* RDMA Read */
88229 		#define XRRQ_IRRQ_TYPE_READ_REQ	UINT32_C(0x0)
88230 	/* Atomic */
88231 		#define XRRQ_IRRQ_TYPE_ATOMIC_REQ  UINT32_C(0x1)
88232 		#define XRRQ_IRRQ_TYPE_LAST	XRRQ_IRRQ_TYPE_ATOMIC_REQ
88233 	/*
88234 	 * The credit code calculated by Rx path when receiving the
88235 	 * request. It will be placed in the syndrome credit code with
88236 	 * the acks on first and last response.
88237 	 */
88238 	#define XRRQ_IRRQ_CREDITS_MASK   UINT32_C(0xf800)
88239 	#define XRRQ_IRRQ_CREDITS_SFT	11
88240 	uint16_t	reserved16;
88241 	uint32_t	reserved32;
88242 	uint32_t	psn;
88243 	/* The PSN of the outstanding incoming request */
88244 	#define XRRQ_IRRQ_PSN_MASK UINT32_C(0xffffff)
88245 	#define XRRQ_IRRQ_PSN_SFT 0
88246 	uint32_t	msn;
88247 	/*
88248 	 * The value of QPC.pending_ack_msn after it is incremented as a
88249 	 * result of receiving the read/atomic request. IRRQ.msn-1 will
88250 	 * be placed in the MSN field of the first response and IRRQ.msn
88251 	 * will placed in the MSN field of the last or only response.
88252 	 */
88253 	#define XRRQ_IRRQ_MSN_MASK UINT32_C(0xffffff)
88254 	#define XRRQ_IRRQ_MSN_SFT 0
88255 	/*
88256 	 * Virtual address on local host for RDMA READ
88257 	 *
88258 	 * In case of duplicate Atomic, the VA is not required to
88259 	 * be validated, only the PSN is, thus this field is used
88260 	 * to store the value returned in the Ack to the atomic
88261 	 * request, and if duplicate arrives, this value is used
88262 	 * again for resending the ack.
88263 	 */
88264 	uint64_t	va_or_atomic_result;
88265 	/* The key to the MR/W in the request */
88266 	uint32_t	rdma_r_key;
88267 	/*
88268 	 * Length in bytes of the data requested. Length must be 8 if type is
88269 	 * atomic.
88270 	 */
88271 	uint32_t	length;
88272 } xrrq_irrq_t, *pxrrq_irrq_t;
88273 
88274 /* Output Read Request Queue (ORRQ) Message */
88275 /* xrrq_orrq (size:256b/32B) */
88276 
88277 typedef struct xrrq_orrq {
88278 	uint16_t	num_sges_type;
88279 	/* Type indication */
88280 	#define XRRQ_ORRQ_TYPE	UINT32_C(0x1)
88281 	/* RDMA Read */
88282 		#define XRRQ_ORRQ_TYPE_READ_REQ	UINT32_C(0x0)
88283 	/* Atomic */
88284 		#define XRRQ_ORRQ_TYPE_ATOMIC_REQ  UINT32_C(0x1)
88285 		#define XRRQ_ORRQ_TYPE_LAST	XRRQ_ORRQ_TYPE_ATOMIC_REQ
88286 	/*
88287 	 * Up to 6 SGEs. This value is 1 if type is atomic as one
88288 	 * SGE is required to store Atomic response result field. 2
88289 	 * more bits allocated for future growth.
88290 	 *
88291 	 * Note that, if num_sges is 1 for an RDMA Read request, then
88292 	 * the first_sge_phy_or_sing_sge_va, single_sge_l_key, and
88293 	 * single_sge_size fields will be populated from the single
88294 	 * SGE.
88295 	 *
88296 	 * If num_sges is 2 or more for an RDMA Read request, then
88297 	 * the first_sge_phy_or_sing_sge_va field carries the
88298 	 * physical address in host memory where the first sge is
88299 	 * stored. The single_sge_l_key and single_sge_size fields
88300 	 * are unused in this case.
88301 	 *
88302 	 * A special case is a zero-length, zero-sge RDMA read request
88303 	 * WQE. In this situation, num_sges will be 1. However,
88304 	 * first_sge_phy_or_sing_sge_va, single_sge_l_key, and
88305 	 * single_sge_size will all be populated with zeros.
88306 	 */
88307 	#define XRRQ_ORRQ_NUM_SGES_MASK  UINT32_C(0xf800)
88308 	#define XRRQ_ORRQ_NUM_SGES_SFT   11
88309 	uint16_t	reserved16;
88310 	/*
88311 	 * Length in bytes of the data requested. Length must be 8 if type is
88312 	 * atomic.
88313 	 */
88314 	uint32_t	length;
88315 	uint32_t	psn;
88316 	/* The PSN of the outstanding outgoing request */
88317 	#define XRRQ_ORRQ_PSN_MASK UINT32_C(0xffffff)
88318 	#define XRRQ_ORRQ_PSN_SFT 0
88319 	uint32_t	end_psn;
88320 	/*
88321 	 * The expected last PSN on a response to this request where
88322 	 * an ack with response, rather than just response, should
88323 	 * arrive. If ack arrive with smaller PSN than end_psn then it
88324 	 * is considered a NAK.
88325 	 */
88326 	#define XRRQ_ORRQ_END_PSN_MASK UINT32_C(0xffffff)
88327 	#define XRRQ_ORRQ_END_PSN_SFT 0
88328 	/*
88329 	 * If num_sges == 1 this is the va of that SGE. Otherwise,
88330 	 * physical address to the first SGE specified by the WQE.
88331 	 * Points to the first SGE in the Request's WQE in the SQ.
88332 	 * It is assumed that WQE does not cross page boundaries!
88333 	 * Driver is responsible to enforce that. SGEs are 16B
88334 	 * aligned 0b0000 lsb added to get 64 bit address.
88335 	 */
88336 	uint64_t	first_sge_phy_or_sing_sge_va;
88337 	/* The L_Key of a single SGE if used */
88338 	uint32_t	single_sge_l_key;
88339 	/* The size in bytes of the single SGE if used */
88340 	uint32_t	single_sge_size;
88341 } xrrq_orrq_t, *pxrrq_orrq_t;
88342 
88343 /* Page Table Entry (PTE) */
88344 /* ptu_pte (size:64b/8B) */
88345 
88346 typedef struct ptu_pte {
88347 	uint64_t	page_next_to_last_last_valid;
88348 	/*
88349 	 * This field indicates if the PTE is valid. A value of '0'
88350 	 * indicates that the page is not valid. A value of '1'
88351 	 * indicates that the page is valid. A reference to an
88352 	 * invalid page will return a PTU error.
88353 	 */
88354 	#define PTU_PTE_VALID		UINT32_C(0x1)
88355 	/*
88356 	 * This field is used only for "ring" PBLs that are used for
88357 	 * SQ, RQ, SRQ, or CQ structures. For all other PBL structures,
88358 	 * this bit should be zero. When this bit is '1', it indicates
88359 	 * that the page pointed to by this PTE is the last page in the
88360 	 * ring. A prefetch for the ring should use the first PTE in
88361 	 * the PBL.
88362 	 */
88363 	#define PTU_PTE_LAST		UINT32_C(0x2)
88364 	/*
88365 	 * This field is used only for "ring" PBLs that are used for
88366 	 * SQ, RQ, SRQ, or CQ structures. For all other PBL structures,
88367 	 * this bit should be zero. When this bit is '1', it indicates
88368 	 * that this is the next-to-last page of the PBL.
88369 	 */
88370 	#define PTU_PTE_NEXT_TO_LAST	UINT32_C(0x4)
88371 	/* These bits should be programmed to zero. */
88372 	#define PTU_PTE_UNUSED_MASK	UINT32_C(0xff8)
88373 	#define PTU_PTE_UNUSED_SFT	3
88374 	/*
88375 	 * This is the upper bits of the physical page controlled by
88376 	 * this PTE. If the page is larger than 4KB, then the unused
88377 	 * lower bits of the page address should be zero.
88378 	 */
88379 	#define PTU_PTE_PAGE_MASK	UINT32_C(0xfffffffffffff000)L
88380 	#define PTU_PTE_PAGE_SFT	12
88381 } ptu_pte_t, *pptu_pte_t;
88382 
88383 /* Page Directory Entry (PDE) */
88384 /* ptu_pde (size:64b/8B) */
88385 
88386 typedef struct ptu_pde {
88387 	uint64_t	page_valid;
88388 	/*
88389 	 * This field indicates if the PTE is valid. A value of '0'
88390 	 * indicates that the page is not valid. A value of '1'
88391 	 * indicates that the page is valid. A reference to an
88392 	 * invalid page will return a PTU error.
88393 	 */
88394 	#define PTU_PDE_VALID	UINT32_C(0x1)
88395 	/* These bits should be programmed to zero. */
88396 	#define PTU_PDE_UNUSED_MASK UINT32_C(0xffe)
88397 	#define PTU_PDE_UNUSED_SFT 1
88398 	/*
88399 	 * This is the upper bits of the physical page controlled by
88400 	 * this PTE. If the page is larger than 4KB, then the unused
88401 	 * lower bits of the page address should be zero.
88402 	 */
88403 	#define PTU_PDE_PAGE_MASK  UINT32_C(0xfffffffffffff000)L
88404 	#define PTU_PDE_PAGE_SFT   12
88405 } ptu_pde_t, *pptu_pde_t;
88406 
88407 /*
88408  * This is the 64b doorbell format. The host writes this message
88409  * format directly to byte offset 0 of the appropriate doorbell page.
88410  */
88411 /* dbc_dbc (size:64b/8B) */
88412 
88413 typedef struct dbc_dbc {
88414 	uint32_t	index;
88415 	/*
88416 	 * This value is the index being written.
88417 	 *
88418 	 * For SQ, RQ, and SRQ, this is the producer index and the unit is
88419 	 * 16B of queue space for L2 path and for the Engine path. For RoCE
88420 	 * path there is a legacy mode with 128B unit size and a variable
88421 	 * size WQE mode with 16B unit size of queue space. This mode is
88422 	 * configured in the QP.
88423 	 *
88424 	 * For CQ this is the consumer index and the unit is 32B of queue
88425 	 * space for the RoCE/Engine path and the CQ index unit is 16B of
88426 	 * queue space for the L2 path.
88427 	 *
88428 	 * For NQ this is the consumer index and the unit is always 16B of
88429 	 * queue space.
88430 	 *
88431 	 * The index size is 24b for L2 and engine paths and 16b for the
88432 	 * RoCE path. Unused bits should be written as zero.
88433 	 */
88434 	#define DBC_DBC_INDEX_MASK UINT32_C(0xffffff)
88435 	#define DBC_DBC_INDEX_SFT  0
88436 	/*
88437 	 * The epoch bit provides a frame of reference for the queue index.
88438 	 * S/W will toggle this bit in the doorbell each time index range is
88439 	 * wrapped. This allows the receiving HW block to more efficiently
88440 	 * detect out-of-order doorbells and to ignore the older doorbells.
88441 	 * Out-of-order doorbells occur normally during dropped doorbell
88442 	 * recovery.
88443 	 */
88444 	#define DBC_DBC_EPOCH	UINT32_C(0x1000000)
88445 	/*
88446 	 * The toggle value is used in CQ_ARMENA, CQ_ARMSE, CQ_ARMALL,
88447 	 * SRQ_ARMENA, SRQ_ARM, and CQ_CUTOFF_ACK doorbells to qualify the
88448 	 * doorbell as valid. This value should be taken from the latest
88449 	 * NQE or cutoff completion.
88450 	 *
88451 	 * Doorbells of the above types with the wrong toggle value will
88452 	 * be ignored. This is how old values in of backup doorbells
88453 	 * are ignored.
88454 	 */
88455 	#define DBC_DBC_TOGGLE_MASK UINT32_C(0x6000000)
88456 	#define DBC_DBC_TOGGLE_SFT 25
88457 	uint32_t	type_path_xid;
88458 	/*
88459 	 * This value identifies the resource that the doorbell is intended
88460 	 * to notify.
88461 	 *
88462 	 * For SQ and RQ, this is the QPID. For SRQ, this is the SID. For
88463 	 * CQ, this is the CID. For NQ, this is the NID.
88464 	 *
88465 	 * Bits [19:16] of this values must be zero for a SID value.
88466 	 */
88467 	#define DBC_DBC_XID_MASK	UINT32_C(0xfffff)
88468 	#define DBC_DBC_XID_SFT	0
88469 	/*
88470 	 * This value defines the intended doorbell path between RoCE and
88471 	 * L2.
88472 	 */
88473 	#define DBC_DBC_PATH_MASK	UINT32_C(0x3000000)
88474 	#define DBC_DBC_PATH_SFT	24
88475 	/* This is a RoCE doorbell message. */
88476 		#define DBC_DBC_PATH_ROCE	(UINT32_C(0x0) << 24)
88477 	/* This is a L2 doorbell message. */
88478 		#define DBC_DBC_PATH_L2		(UINT32_C(0x1) << 24)
88479 	/* Engine path doorbell. */
88480 		#define DBC_DBC_PATH_ENGINE	(UINT32_C(0x2) << 24)
88481 		#define DBC_DBC_PATH_LAST	DBC_DBC_PATH_ENGINE
88482 	/*
88483 	 * This indicates it is valid doorbell update. It should be set for
88484 	 * each doorbell written to the chip and set when doorbell message is
88485 	 * written to the backup doorbell location. The bit should be cleared
88486 	 * in the backup doorbell location at time zero to indicate that the
88487 	 * backup doorbell has not yet been written.
88488 	 */
88489 	#define DBC_DBC_VALID		UINT32_C(0x4000000)
88490 	/*
88491 	 * When this bit is set to one, the chip will capture debug
88492 	 * information for the doorbell ring. This is intended to only be
88493 	 * used on SQ doorbell rings.
88494 	 */
88495 	#define DBC_DBC_DEBUG_TRACE	UINT32_C(0x8000000)
88496 	/* This value identifies the type of doorbell being written. */
88497 	#define DBC_DBC_TYPE_MASK	UINT32_C(0xf0000000)
88498 	#define DBC_DBC_TYPE_SFT	28
88499 	/*
88500 	 * This is a SQ producer index update. It indicates one or more
88501 	 * new entries have been written to the SQ for the QPID indicated
88502 	 * on the xID field. This type is valid for L2, RoCE and Engine
88503 	 * path.
88504 	 */
88505 		#define DBC_DBC_TYPE_SQ		(UINT32_C(0x0) << 28)
88506 	/*
88507 	 * This is a RQ producer index update. It indicates one or more
88508 	 * new entries have been written to the RQ for the QPID indicated
88509 	 * on the xID field. This type is valid for RoCE path.
88510 	 */
88511 		#define DBC_DBC_TYPE_RQ		(UINT32_C(0x1) << 28)
88512 	/*
88513 	 * This is a SRQ producer index update. It indicates one or more
88514 	 * new entries have been written to the SRQ for the SID indicated
88515 	 * on the xID field. This type is valid for L2 and RoCE path.
88516 	 */
88517 		#define DBC_DBC_TYPE_SRQ		(UINT32_C(0x2) << 28)
88518 	/*
88519 	 * This doorbell command arms the SRQ async event.
88520 	 * The xID field must identify the SID that is begin armed.
88521 	 * The index field is will set the arm threshold such that
88522 	 * a notification will be generated if less than that number
88523 	 * or SRQ entries are posted. This type is valid for RoCE path.
88524 	 */
88525 		#define DBC_DBC_TYPE_SRQ_ARM	(UINT32_C(0x3) << 28)
88526 	/*
88527 	 * This is a CQ consumer index update. It indicates one or more
88528 	 * entries have been processed off the CQ indicated on the xID
88529 	 * field.This type is valid for L2, RoCE and Engine path.
88530 	 */
88531 		#define DBC_DBC_TYPE_CQ		(UINT32_C(0x4) << 28)
88532 	/*
88533 	 * this is a CQ consumer index update that also arms the CQ for
88534 	 * solicited events. This type is valid for RoCE path.
88535 	 */
88536 		#define DBC_DBC_TYPE_CQ_ARMSE	(UINT32_C(0x5) << 28)
88537 	/*
88538 	 * This is a CQ consumer index update that also arms the CQ
88539 	 * for any new CQE. This type is valid for L2, RoCE and Engine
88540 	 * path.
88541 	 */
88542 		#define DBC_DBC_TYPE_CQ_ARMALL	(UINT32_C(0x6) << 28)
88543 	/*
88544 	 * This is a CQ arm enable message. This message must be sent
88545 	 * from the privileged driver before a new CQ_ARMSE or CQ_ARMALL
88546 	 * message will be accepted.
88547 	 *
88548 	 * This doorbell can only be sent from the privileged (first)
88549 	 * doorbell page of a function.
88550 	 */
88551 		#define DBC_DBC_TYPE_CQ_ARMENA	(UINT32_C(0x7) << 28)
88552 	/*
88553 	 * This doorbell command enables the SRQ async event
88554 	 * to be armed. This message must be sent from the privileged
88555 	 * driver before a new SRQ_ARM message will be accepted.
88556 	 * The xID field must identify the SID that is begin enabled
88557 	 * for arm.
88558 	 *
88559 	 * This doorbell can only be sent from the privileged (first)
88560 	 * doorbell page of a function.
88561 	 */
88562 		#define DBC_DBC_TYPE_SRQ_ARMENA	(UINT32_C(0x8) << 28)
88563 	/*
88564 	 * This doorbell command indicates that the cutoff CQE has
88565 	 * been processed and the driver is now processing completions
88566 	 * from the new CQ.
88567 	 *
88568 	 * The index field for this doorbell type must be zero.
88569 	 */
88570 		#define DBC_DBC_TYPE_CQ_CUTOFF_ACK  (UINT32_C(0x9) << 28)
88571 	/*
88572 	 * This is a NQ consumer index update. It indicates one or more
88573 	 * entries have been processed off the NQ indicated on the xID
88574 	 * field. This type is valid for L2, RoCE and Engine path.
88575 	 */
88576 		#define DBC_DBC_TYPE_NQ		(UINT32_C(0xa) << 28)
88577 	/*
88578 	 * This is a NQ consumer index update that also arms the NQ for
88579 	 * any new NQE. This type is valid for L2, RoCE and Engine path.
88580 	 */
88581 		#define DBC_DBC_TYPE_NQ_ARM	(UINT32_C(0xb) << 28)
88582 	/*
88583 	 * This is a NQ consumer index update that also arms the NQ for
88584 	 * any new NQE. It is used for the legacy INT mask. This type
88585 	 * is valid for L2, RoCE and Engine path.
88586 	 */
88587 		#define DBC_DBC_TYPE_NQ_MASK	(UINT32_C(0xe) << 28)
88588 	/*
88589 	 * This doorbell command is used during doorbell moderation
88590 	 * to consume system BW and help prevent doorbell FIFO
88591 	 * overflow.
88592 	 *
88593 	 * All other fields should be zero for NULL doorbell.
88594 	 * For doorbell recovery, NULL doorbell type in the Application
88595 	 * table indicates that it is the last QP entry for the function.
88596 	 * This type is valid for L2, RoCE and Engine path.
88597 	 */
88598 		#define DBC_DBC_TYPE_NULL	(UINT32_C(0xf) << 28)
88599 		#define DBC_DBC_TYPE_LAST	DBC_DBC_TYPE_NULL
88600 } dbc_dbc_t, *pdbc_dbc_t;
88601 
88602 /*
88603  * This is the 64b doorbell copy format. The host writes this DB to
88604  * the doorbell copy memory. Upon a HW Doorbell Drop Recovery process,
88605  * it would be DMAed into HW for recovering the dropped doorbell.
88606  */
88607 /* dbc_dbc64 (size:64b/8B) */
88608 
88609 typedef struct dbc_dbc64 {
88610 	uint64_t	dbc;
88611 	/*
88612 	 * This value is the index being written.
88613 	 *
88614 	 * For SQ, RQ, and SRQ, this is the producer index and the unit is
88615 	 * 16B of queue space for L2 path and for the Engine path. For RoCE
88616 	 * path there is a legacy mode with 128B unit size and a variable
88617 	 * size WQE mode with 16B unit size of queue space. This mode is
88618 	 * configured in the QP.
88619 	 *
88620 	 * For CQ this is the consumer index and the unit is 32B of queue
88621 	 * space for the RoCE/Engine path and the CQ index unit is 16B of
88622 	 * queue space for the L2 path.
88623 	 *
88624 	 * For NQ this is the consumer index and the unit is always 16B of
88625 	 * queue space.
88626 	 *
88627 	 * The index size is 24b for L2 and engine paths and 16b for the
88628 	 * RoCE path. Unused bits should be written as zero.
88629 	 */
88630 	#define DBC_DBC64_INDEX_MASK	UINT32_C(0xffffff)
88631 	#define DBC_DBC64_INDEX_SFT	0
88632 	/*
88633 	 * The epoch bit provides a frame of reference for the queue index.
88634 	 * S/W will toggle this bit in the doorbell each time index range is
88635 	 * wrapped. This allows the receiving HW block to more efficiently
88636 	 * detect out-of-order doorbells and to ignore the older doorbells.
88637 	 * Out-of-order doorbells occur normally during dropped doorbell
88638 	 * recovery.
88639 	 */
88640 	#define DBC_DBC64_EPOCH		UINT32_C(0x1000000)
88641 	/*
88642 	 * The toggle value is used in CQ_ARMENA, CQ_ARMSE, CQ_ARMALL,
88643 	 * SRQ_ARMENA, SRQ_ARM, and CQ_CUTOFF_ACK doorbells to qualify the
88644 	 * doorbell as valid. This value should be taken from the latest
88645 	 * NQE or cutoff completion.
88646 	 *
88647 	 * Doorbells of the above types with the wrong toggle value will
88648 	 * be ignored. This is how old values in of backup doorbells
88649 	 * are ignored.
88650 	 */
88651 	#define DBC_DBC64_TOGGLE_MASK	UINT32_C(0x6000000)
88652 	#define DBC_DBC64_TOGGLE_SFT	25
88653 	/*
88654 	 * This value identifies the resource that the doorbell is intended
88655 	 * to notify.
88656 	 *
88657 	 * For SQ and RQ, this is the QPID. For SRQ, this is the SID. For
88658 	 * CQ, this is the CID. For NQ, this is the NID.
88659 	 *
88660 	 * Bits [51:48] of this values must be zero for a SID value.
88661 	 */
88662 	#define DBC_DBC64_XID_MASK	UINT32_C(0xfffff00000000)L
88663 	#define DBC_DBC64_XID_SFT	32
88664 	/*
88665 	 * This value defines the intended doorbell path between RoCE and
88666 	 * L2.
88667 	 */
88668 	#define DBC_DBC64_PATH_MASK	UINT32_C(0x300000000000000)L
88669 	#define DBC_DBC64_PATH_SFT	56
88670 	/* This is a RoCE doorbell message. */
88671 		#define DBC_DBC64_PATH_ROCE	(UINT32_C(0x0)L << 56)
88672 	/* This is a L2 doorbell message. */
88673 		#define DBC_DBC64_PATH_L2		(UINT32_C(0x1)L << 56)
88674 	/* Engine path doorbell. */
88675 		#define DBC_DBC64_PATH_ENGINE	(UINT32_C(0x2)L << 56)
88676 		#define DBC_DBC64_PATH_LAST	DBC_DBC64_PATH_ENGINE
88677 	/*
88678 	 * This indicates it is valid doorbell update. It should be set for
88679 	 * each doorbell written to the chip and set when doorbell message is
88680 	 * written to the backup doorbell location. The bit should be cleared
88681 	 * in the backup doorbell location at time zero to indicate that the
88682 	 * backup doorbell has not yet been written.
88683 	 */
88684 	#define DBC_DBC64_VALID		UINT32_C(0x400000000000000)L
88685 	/*
88686 	 * When this bit is set to one, the chip will capture debug
88687 	 * information for the doorbell ring. This is intended to only be
88688 	 * used on SQ doorbell rings.
88689 	 */
88690 	#define DBC_DBC64_DEBUG_TRACE	UINT32_C(0x800000000000000)L
88691 	/* This value identifies the type of doorbell being written. */
88692 	#define DBC_DBC64_TYPE_MASK	UINT32_C(0xf000000000000000)L
88693 	#define DBC_DBC64_TYPE_SFT	60
88694 	/*
88695 	 * This is a SQ producer index update. It indicates one or more
88696 	 * new entries have been written to the SQ for the QPID indicated
88697 	 * on the xID field. This type is valid for L2, RoCE and Engine
88698 	 * path.
88699 	 */
88700 		#define DBC_DBC64_TYPE_SQ		(UINT32_C(0x0)L << 60)
88701 	/*
88702 	 * This is a RQ producer index update. It indicates one or more
88703 	 * new entries have been written to the RQ for the QPID indicated
88704 	 * on the xID field. This type is valid for RoCE path.
88705 	 */
88706 		#define DBC_DBC64_TYPE_RQ		(UINT32_C(0x1)L << 60)
88707 	/*
88708 	 * This is a SRQ producer index update. It indicates one or more
88709 	 * new entries have been written to the SRQ for the SID indicated
88710 	 * on the xID field. This type is valid for L2 and RoCE path.
88711 	 */
88712 		#define DBC_DBC64_TYPE_SRQ		(UINT32_C(0x2)L << 60)
88713 	/*
88714 	 * This doorbell command arms the SRQ async event.
88715 	 * The xID field must identify the SID that is begin armed.
88716 	 * The index field is will set the arm threshold such that
88717 	 * a notification will be generated if less than that number
88718 	 * or SRQ entries are posted. This type is valid for RoCE path.
88719 	 */
88720 		#define DBC_DBC64_TYPE_SRQ_ARM	(UINT32_C(0x3)L << 60)
88721 	/*
88722 	 * This is a CQ consumer index update. It indicates one or more
88723 	 * entries have been processed off the CQ indicated on the xID
88724 	 * field.This type is valid for L2, RoCE and Engine path.
88725 	 */
88726 		#define DBC_DBC64_TYPE_CQ		(UINT32_C(0x4)L << 60)
88727 	/*
88728 	 * this is a CQ consumer index update that also arms the CQ for
88729 	 * solicited events. This type is valid for RoCE path.
88730 	 */
88731 		#define DBC_DBC64_TYPE_CQ_ARMSE	(UINT32_C(0x5)L << 60)
88732 	/*
88733 	 * This is a CQ consumer index update that also arms the CQ
88734 	 * for any new CQE. This type is valid for L2, RoCE and Engine
88735 	 * path.
88736 	 */
88737 		#define DBC_DBC64_TYPE_CQ_ARMALL	(UINT32_C(0x6)L << 60)
88738 	/*
88739 	 * This is a CQ arm enable message. This message must be sent
88740 	 * from the privileged driver before a new CQ_ARMSE or CQ_ARMALL
88741 	 * message will be accepted.
88742 	 *
88743 	 * This doorbell can only be sent from the privileged (first)
88744 	 * doorbell page of a function.
88745 	 */
88746 		#define DBC_DBC64_TYPE_CQ_ARMENA	(UINT32_C(0x7)L << 60)
88747 	/*
88748 	 * This doorbell command enables the SRQ async event
88749 	 * to be armed. This message must be sent from the privileged
88750 	 * driver before a new SRQ_ARM message will be accepted.
88751 	 * The xID field must identify the SID that is begin enabled
88752 	 * for arm.
88753 	 *
88754 	 * This doorbell can only be sent from the privileged (first)
88755 	 * doorbell page of a function.
88756 	 */
88757 		#define DBC_DBC64_TYPE_SRQ_ARMENA	(UINT32_C(0x8)L << 60)
88758 	/*
88759 	 * This doorbell command indicates that the cutoff CQE has
88760 	 * been processed and the driver is now processing completions
88761 	 * from the new CQ.
88762 	 *
88763 	 * The index field for this doorbell type must be zero.
88764 	 */
88765 		#define DBC_DBC64_TYPE_CQ_CUTOFF_ACK  (UINT32_C(0x9)L << 60)
88766 	/*
88767 	 * This is a NQ consumer index update. It indicates one or more
88768 	 * entries have been processed off the NQ indicated on the xID
88769 	 * field. This type is valid for L2, RoCE and Engine path.
88770 	 */
88771 		#define DBC_DBC64_TYPE_NQ		(UINT32_C(0xa)L << 60)
88772 	/*
88773 	 * This is a NQ consumer index update that also arms the NQ for
88774 	 * any new NQE. This type is valid for L2, RoCE and Engine path.
88775 	 */
88776 		#define DBC_DBC64_TYPE_NQ_ARM	(UINT32_C(0xb)L << 60)
88777 	/*
88778 	 * This is a NQ consumer index update that also arms the NQ for
88779 	 * any new NQE. It is used for the legacy INT mask. This type
88780 	 * is valid for L2, RoCE and Engine path.
88781 	 */
88782 		#define DBC_DBC64_TYPE_NQ_MASK	(UINT32_C(0xe)L << 60)
88783 	/*
88784 	 * This doorbell command is used during doorbell moderation
88785 	 * to consume system BW and help prevent doorbell FIFO
88786 	 * overflow.
88787 	 *
88788 	 * All other fields should be zero for NULL doorbell.
88789 	 * For doorbell recovery, NULL doorbell type in the Application
88790 	 * table indicates that it is the last QP entry for the function.
88791 	 * This type is valid for L2, RoCE and Engine path.
88792 	 */
88793 		#define DBC_DBC64_TYPE_NULL	(UINT32_C(0xf)L << 60)
88794 		#define DBC_DBC64_TYPE_LAST	DBC_DBC64_TYPE_NULL
88795 } dbc_dbc64_t, *pdbc_dbc64_t;
88796 
88797 /*
88798  * This is the 32b doorbell format. The host writes this message
88799  * format directly to byte offset 8 of the appropriate doorbell page.
88800  */
88801 /* dbc_dbc32 (size:32b/4B) */
88802 
88803 typedef struct dbc_dbc32 {
88804 	uint32_t	type_abs_incr_xid;
88805 	/*
88806 	 * This value identifies the resource that the doorbell is intended
88807 	 * to notify.
88808 	 *
88809 	 * For SQ and RQ, this is the QPID. For SRQ, this is the SID. For
88810 	 * CQ, this is the CID.
88811 	 *
88812 	 * Bits [19:16] of this values must be zero for a SID value.
88813 	 */
88814 	#define DBC_DBC32_XID_MASK UINT32_C(0xfffff)
88815 	#define DBC_DBC32_XID_SFT  0
88816 	/*
88817 	 * This value defines the intended doorbell path between RoCE and
88818 	 * L2.
88819 	 */
88820 	#define DBC_DBC32_PATH_MASK UINT32_C(0xc00000)
88821 	#define DBC_DBC32_PATH_SFT 22
88822 	/* This is a RoCE doorbell message. */
88823 		#define DBC_DBC32_PATH_ROCE  (UINT32_C(0x0) << 22)
88824 	/* This is a L2 doorbell message. */
88825 		#define DBC_DBC32_PATH_L2	(UINT32_C(0x1) << 22)
88826 		#define DBC_DBC32_PATH_LAST DBC_DBC32_PATH_L2
88827 	/*
88828 	 * When abs=0, this value is the value to add to the appropriate
88829 	 * index value.
88830 	 *
88831 	 * When abs=1, this value is the new value for the index. Absolute
88832 	 * value is used when the queue is being wrapped. When abs=1,
88833 	 * the incr value follows the same rules as the index value
88834 	 * in the 64b doorbell.
88835 	 */
88836 	#define DBC_DBC32_INCR_MASK UINT32_C(0xf000000)
88837 	#define DBC_DBC32_INCR_SFT 24
88838 	/* This value defines how the incr value will be interpreted. */
88839 	#define DBC_DBC32_ABS	UINT32_C(0x10000000)
88840 	/* This value identifies the type of doorbell being written. */
88841 	#define DBC_DBC32_TYPE_MASK UINT32_C(0xe0000000)
88842 	#define DBC_DBC32_TYPE_SFT 29
88843 	/*
88844 	 * This is a SQ producer index update. It indicates one or more
88845 	 * new entries have been written to the SQ for the QPID
88846 	 * indicated on the xID field.
88847 	 */
88848 		#define DBC_DBC32_TYPE_SQ	(UINT32_C(0x0) << 29)
88849 		#define DBC_DBC32_TYPE_LAST DBC_DBC32_TYPE_SQ
88850 } dbc_dbc32_t, *pdbc_dbc32_t;
88851 
88852 /*
88853  * This is the 64b Push Start doorbell format. The host writes this
88854  * message format directly to offset of each push associated WCB (write
88855  * combine buffer) within doorbell page. WCB#0 = offset 16, WCB#1 =
88856  * offset 24, WCB#2 = offset 32, ... The start doorbell is followed by
88857  * write combining data to the WCB and then that is followed by a end
88858  * doorbell.
88859  */
88860 /* db_push_start (size:64b/8B) */
88861 
88862 typedef struct db_push_start {
88863 	uint64_t	db;
88864 	/*
88865 	 * This is the push index and should be the SQ slot index,
88866 	 * aligned to the start of the corresponding push WQE/packet in
88867 	 * the Send Queue.
88868 	 *
88869 	 * The index size is 16b for RoCE path and 24b for L2 and Engine
88870 	 * paths. Any unused bits should be written as zero.
88871 	 *
88872 	 * The index unit is 16B for L2 path. For RoCE there is a legacy
88873 	 * mode with 128B unit size and a variable size mode with 16B
88874 	 * unit size. For Engine mode, the unit size is 16B, where RQEs
88875 	 * are always 128B - so it always increments by eight 16B slots
88876 	 * per RQE.
88877 	 *
88878 	 * > This field is not used by the older versions of the chip,
88879 	 * > but is used in this and future revisions of the chip. In
88880 	 * > older versions of the chip, the driver is required to
88881 	 * > complete the push doorbell operation by following it with a
88882 	 * > regular doorbell which will be used to properly increment
88883 	 * > the producer index. This extra doorbell write is not needed
88884 	 * > on this and future versions of the chip.
88885 	 */
88886 	#define DB_PUSH_START_DB_INDEX_MASK	UINT32_C(0xffffff)
88887 	#define DB_PUSH_START_DB_INDEX_SFT	0
88888 	/*
88889 	 * This value is the PI index (lower 8bits) within 4K DPI
88890 	 * associated with push write. It is the doorbell page that
88891 	 * contains the WCB that will be used.
88892 	 */
88893 	#define DB_PUSH_START_DB_PI_LO_MASK	UINT32_C(0xff000000)
88894 	#define DB_PUSH_START_DB_PI_LO_SFT	24
88895 	/*
88896 	 * This value identifies the resource that the doorbell is
88897 	 * intended to notify.
88898 	 *
88899 	 * This is the QPID.
88900 	 */
88901 	#define DB_PUSH_START_DB_XID_MASK	UINT32_C(0xfffff00000000)L
88902 	#define DB_PUSH_START_DB_XID_SFT	32
88903 	/*
88904 	 * This value is the PI index (upper 4bits) within 4K DPI
88905 	 * associated with push write. It is the doorbell page that
88906 	 * contains the WCB that will be used.
88907 	 */
88908 	#define DB_PUSH_START_DB_PI_HI_MASK	UINT32_C(0xf0000000000000)L
88909 	#define DB_PUSH_START_DB_PI_HI_SFT	52
88910 	/* This value identifies the type of doorbell being written. */
88911 	#define DB_PUSH_START_DB_TYPE_MASK	UINT32_C(0xf000000000000000)L
88912 	#define DB_PUSH_START_DB_TYPE_SFT	60
88913 	/*
88914 	 * This is a SQ producer index update for Push. It indicates
88915 	 * one or more new entries have been written to the SQ for
88916 	 * the QPID indicated on the `xid` field.
88917 	 */
88918 		#define DB_PUSH_START_DB_TYPE_PUSH_START  (UINT32_C(0xc)L << 60)
88919 	/*
88920 	 * This is a SQ producer index update for Push. It indicates
88921 	 * one or more new entries have been written to the SQ for
88922 	 * the QPID indicated on the `xid` field.
88923 	 */
88924 		#define DB_PUSH_START_DB_TYPE_PUSH_END	(UINT32_C(0xd)L << 60)
88925 		#define DB_PUSH_START_DB_TYPE_LAST	DB_PUSH_START_DB_TYPE_PUSH_END
88926 } db_push_start_t, *pdb_push_start_t;
88927 
88928 /*
88929  * This is the 64b Push End doorbell format. The host writes this message
88930  * format directly to offset of each push associated WCB (write combine
88931  * buffer) within doorbell page. WCB#0 = offset 16, WCB#1 = offset 24,
88932  * WCB#2 = offset 32, ... The start doorbell is followed by write
88933  * combining data to the WCB and then that is followed by a end doorbell.
88934  */
88935 /* db_push_end (size:64b/8B) */
88936 
88937 typedef struct db_push_end {
88938 	uint64_t	db;
88939 	/*
88940 	 * This is the producer index and should be the queue index of
88941 	 * the last WQE written plus the length field contained in that
88942 	 * WQE. For example, if the length is 8 index units and the WQE
88943 	 * was written to the first location in the queue (zero), this
88944 	 * index should be written to 8. The index should point to the
88945 	 * start of the first location that has not been filled in with
88946 	 * WQE data.
88947 	 *
88948 	 * For L2 and Engine SQ, the index unit is 16B. For RoCE there
88949 	 * are two modes. For Legacy fixed size RQE mode, the unit is
88950 	 * 128B. For variable size RQE mode, the unit is 16B.
88951 	 *
88952 	 * The index size is 24b for L2 and engine paths and 16b for the
88953 	 * RoCE path. Unused bits should be written as zero.
88954 	 *
88955 	 * > In past revisions of this chip, this field was the push
88956 	 * > index rather than the producer index. For this version of
88957 	 * > the chip and future versions of the chip, this field must be
88958 	 * > the producer index, as described above.
88959 	 * >
88960 	 * > Also, in past revisions of this chip, an additional
88961 	 * > doorbell write was needed to communicate the producer index.
88962 	 * > In this and future versions of the chip, this extra doorbell
88963 	 * > write is no longer needed.
88964 	 */
88965 	#define DB_PUSH_END_DB_INDEX_MASK	UINT32_C(0xffffff)
88966 	#define DB_PUSH_END_DB_INDEX_SFT	0
88967 	/*
88968 	 * This value is the PI index (lower 8bits) within 4K DPI
88969 	 * associated with push write. It is the doorbell page that
88970 	 * contains the WCB that will be used.
88971 	 */
88972 	#define DB_PUSH_END_DB_PI_LO_MASK	UINT32_C(0xff000000)
88973 	#define DB_PUSH_END_DB_PI_LO_SFT	24
88974 	/*
88975 	 * This value identifies the resource that the doorbell is
88976 	 * intended to notify.
88977 	 *
88978 	 * This is the QPID.
88979 	 */
88980 	#define DB_PUSH_END_DB_XID_MASK	UINT32_C(0xfffff00000000)L
88981 	#define DB_PUSH_END_DB_XID_SFT	32
88982 	/*
88983 	 * This value is the PI index (upper 4bits) within 4K DPI
88984 	 * associated with push write. It is the doorbell page that
88985 	 * contains the WCB that will be used.
88986 	 */
88987 	#define DB_PUSH_END_DB_PI_HI_MASK	UINT32_C(0xf0000000000000)L
88988 	#define DB_PUSH_END_DB_PI_HI_SFT	52
88989 	/*
88990 	 * This value defines the intended doorbell path between RoCE and
88991 	 * L2.
88992 	 */
88993 	#define DB_PUSH_END_DB_PATH_MASK	UINT32_C(0x300000000000000)L
88994 	#define DB_PUSH_END_DB_PATH_SFT	56
88995 	/* This is a RoCE doorbell message. */
88996 		#define DB_PUSH_END_DB_PATH_ROCE	(UINT32_C(0x0)L << 56)
88997 	/* This is a L2 doorbell message. */
88998 		#define DB_PUSH_END_DB_PATH_L2	(UINT32_C(0x1)L << 56)
88999 	/* Engine path doorbell. */
89000 		#define DB_PUSH_END_DB_PATH_ENGINE	(UINT32_C(0x2)L << 56)
89001 		#define DB_PUSH_END_DB_PATH_LAST	DB_PUSH_END_DB_PATH_ENGINE
89002 	/*
89003 	 * When this bit is set to one, the chip will capture debug
89004 	 * information for the doorbell ring. This is intended to only be
89005 	 * used on SQ doorbell rings.
89006 	 */
89007 	#define DB_PUSH_END_DB_DEBUG_TRACE	UINT32_C(0x800000000000000)L
89008 	/* This value identifies the type of doorbell being written. */
89009 	#define DB_PUSH_END_DB_TYPE_MASK	UINT32_C(0xf000000000000000)L
89010 	#define DB_PUSH_END_DB_TYPE_SFT	60
89011 	/*
89012 	 * This is a SQ producer index update for Push. It indicates
89013 	 * one or more new entries have been written to the SQ for
89014 	 * the QPID indicated on the `xid` field.
89015 	 */
89016 		#define DB_PUSH_END_DB_TYPE_PUSH_START   (UINT32_C(0xc)L << 60)
89017 	/*
89018 	 * This is a SQ producer index update for Push. It indicates
89019 	 * one or more new entries have been written to the SQ for
89020 	 * the QPID indicated on the `xid` field.
89021 	 */
89022 		#define DB_PUSH_END_DB_TYPE_PUSH_END	(UINT32_C(0xd)L << 60)
89023 		#define DB_PUSH_END_DB_TYPE_LAST	DB_PUSH_END_DB_TYPE_PUSH_END
89024 } db_push_end_t, *pdb_push_end_t;
89025 
89026 /*
89027  * This is the Push information that is the second 8B of the Push
89028  * Doorbell.
89029  */
89030 /* db_push_info (size:64b/8B) */
89031 
89032 typedef struct db_push_info {
89033 	uint32_t	push_size_push_index;
89034 	/*
89035 	 * This value is the index for the push being started. For
89036 	 * example, if the push_size is 8 index units and the WQE was
89037 	 * written to the first location in the queue (zero), this
89038 	 * push_index should be written to 0. The push_index should point
89039 	 * to the start of the first location that the push is started.
89040 	 *
89041 	 * The push_index unit is 16B, except in RoCE legacy WQE mode, in
89042 	 * which case the unit is 128B.
89043 	 *
89044 	 * The push_index size is 24b for L2 and 16b for the RoCE path.
89045 	 * Unused bits should be written as zero.
89046 	 */
89047 	#define DB_PUSH_INFO_PUSH_INDEX_MASK UINT32_C(0xffffff)
89048 	#define DB_PUSH_INFO_PUSH_INDEX_SFT 0
89049 	/*
89050 	 * This value defines the size of push. The unit is 8B. The value
89051 	 * 0 means 256B size of push. The push write is done in 8B units
89052 	 * by the SW.
89053 	 *
89054 	 * Note: For packet rate performance reasons, it is recommended
89055 	 * that SW aligns push requests with a granularity of 16B.
89056 	 */
89057 	#define DB_PUSH_INFO_PUSH_SIZE_MASK UINT32_C(0x1f000000)
89058 	#define DB_PUSH_INFO_PUSH_SIZE_SFT  24
89059 	uint32_t	reserved32;
89060 } db_push_info_t, *pdb_push_info_t;
89061 
89062 /*
89063  * This is the "Absolute" 32b Doorbell format. The host writes this
89064  * message format directly to byte offset 0xC of the appropriate
89065  * doorbell page.
89066  *
89067  * Absolute doorbells are supported for only a limited number of
89068  * functions and for a limited number of xID values within each
89069  * function.
89070  *
89071  * Doorbell recovery can be supported for absolute 32b doorbells.
89072  */
89073 /* dbc_absolute_db_32 (size:32b/4B) */
89074 
89075 typedef struct dbc_absolute_db_32 {
89076 	uint32_t	index;
89077 	/*
89078 	 * This value is the index being written. For SQ, RQ, SRQ, this is
89079 	 * the producer index and should be the queue index of the last WQE
89080 	 * or BD written plus the length field contained in that WQE/BD.
89081 	 * For example, if the length is 8 index units and the WQE was
89082 	 * written to the first location in the queue (zero), this index
89083 	 * should be written to 8. The index should point to the start of
89084 	 * the first location that has not been filled in with WQE/BD data.
89085 	 *
89086 	 * For CQ, this is the consumer index and should be the starting
89087 	 * queue index of the last CQE processed plus the size of the last
89088 	 * processed CQE in index units. The index should point to the start
89089 	 * of the first CQE in the queue that has not been processed.
89090 	 *
89091 	 * For NQ, this is the consumer index and should be the starting
89092 	 * queue index of the last NQE processed plus the size of the last
89093 	 * processed NQE in index units. The index should point to the start
89094 	 * of the first NQE in the queue that has not been processed.
89095 	 *
89096 	 * For L2 and Engine SQ, the index unit is 16B. For RoCE there are
89097 	 * two modes. For Legacy fixed size RQE mode, the unit is 128B. For
89098 	 * variable size RQE mode, the unit is 16B. For RoCE and engine CQs,
89099 	 * the index unit is 32B. For L2 CQs, the index unit is 16B.
89100 	 *
89101 	 * For NQ this is the consumer index and the unit is always 16B of
89102 	 * queue space.
89103 	 *
89104 	 * The index size is 16b for all queue types. This limits the size
89105 	 * of some queues when absolute doorbells are in use. Unused bits
89106 	 * should be written as zero.
89107 	 */
89108 	#define DBC_ABSOLUTE_DB_32_INDEX_MASK	UINT32_C(0xffff)
89109 	#define DBC_ABSOLUTE_DB_32_INDEX_SFT	0
89110 	/*
89111 	 * The epoch bit provides a frame of reference for the queue index.
89112 	 * S/W will toggle this bit in the doorbell each time index range is
89113 	 * wrapped. This allows the receiving HW block to more efficiently
89114 	 * detect out-of-order doorbells and to ignore the older doorbells.
89115 	 * Out-of-order doorbells occur normally during dropped doorbell
89116 	 * recovery.
89117 	 */
89118 	#define DBC_ABSOLUTE_DB_32_EPOCH	UINT32_C(0x10000)
89119 	/*
89120 	 * The toggle value is used in CQ_ARMENA, CQ_ARMSE, CQ_ARMALL,
89121 	 * SRQ_ARMENA, SRQ_ARM, and CQ_CUTOFF_ACK doorbells to qualify the
89122 	 * doorbell as valid. This value should be taken from the latest NQE
89123 	 * or cutoff completion.
89124 	 *
89125 	 * Doorbells of the above types with the wrong toggle value will be
89126 	 * ignored. This is how old values in of backup doorbells are
89127 	 * ignored.
89128 	 */
89129 	#define DBC_ABSOLUTE_DB_32_TOGGLE_MASK	UINT32_C(0x60000)
89130 	#define DBC_ABSOLUTE_DB_32_TOGGLE_SFT	17
89131 	/*
89132 	 * This value identifies the resource that the doorbell is intended
89133 	 * to notify.
89134 	 *
89135 	 * This is a "modified" xID value. The DBR block will convert this
89136 	 * value into the full xID value by looking up the base xID for this
89137 	 * particular function and adding the mxID value to that base value.
89138 	 */
89139 	#define DBC_ABSOLUTE_DB_32_MXID_MASK	UINT32_C(0x1f80000)
89140 	#define DBC_ABSOLUTE_DB_32_MXID_SFT	19
89141 	/*
89142 	 * This value defines the intended doorbell path between RoCE and
89143 	 * L2.
89144 	 */
89145 	#define DBC_ABSOLUTE_DB_32_PATH_MASK	UINT32_C(0x6000000)
89146 	#define DBC_ABSOLUTE_DB_32_PATH_SFT	25
89147 	/* This is a RoCE doorbell message. */
89148 		#define DBC_ABSOLUTE_DB_32_PATH_ROCE	(UINT32_C(0x0) << 25)
89149 	/* This is a L2 doorbell message. */
89150 		#define DBC_ABSOLUTE_DB_32_PATH_L2	(UINT32_C(0x1) << 25)
89151 		#define DBC_ABSOLUTE_DB_32_PATH_LAST	DBC_ABSOLUTE_DB_32_PATH_L2
89152 	/*
89153 	 * This indicates it is valid doorbell update. It should be set for
89154 	 * each doorbell written to the chip and set when doorbell message is
89155 	 * written to the backup doorbell location. The bit should be cleared
89156 	 * in the backup doorbell location at time zero to indicate that the
89157 	 * backup doorbell has not yet been written.
89158 	 */
89159 	#define DBC_ABSOLUTE_DB_32_VALID	UINT32_C(0x8000000)
89160 	/* This value identifies the type of doorbell being written. */
89161 	#define DBC_ABSOLUTE_DB_32_TYPE_MASK	UINT32_C(0xf0000000)
89162 	#define DBC_ABSOLUTE_DB_32_TYPE_SFT	28
89163 	/*
89164 	 * This is a SQ producer index update. It indicates one or more
89165 	 * new entries have been written to the SQ for the QPID indicated
89166 	 * on the xID field. This type is valid for L2, RoCE and Engine
89167 	 * path.
89168 	 */
89169 		#define DBC_ABSOLUTE_DB_32_TYPE_SQ	(UINT32_C(0x0) << 28)
89170 	/*
89171 	 * This is a RQ producer index update. It indicates one or more
89172 	 * new entries have been written to the RQ for the QPID indicated
89173 	 * on the xID field. This type is valid for RoCE path.
89174 	 */
89175 		#define DBC_ABSOLUTE_DB_32_TYPE_RQ	(UINT32_C(0x1) << 28)
89176 	/*
89177 	 * This is a SRQ producer index update. It indicates one or more
89178 	 * new entries have been written to the SRQ for the SID indicated
89179 	 * on the xID field. This type is valid for L2 and RoCE path.
89180 	 */
89181 		#define DBC_ABSOLUTE_DB_32_TYPE_SRQ	(UINT32_C(0x2) << 28)
89182 	/*
89183 	 * This doorbell command arms the SRQ async event.
89184 	 * The xID field must identify the SID that is begin armed.
89185 	 * The index field is will set the arm threshold such that
89186 	 * a notification will be generated if less than that number
89187 	 * or SRQ entries are posted. This type is valid for RoCE path.
89188 	 */
89189 		#define DBC_ABSOLUTE_DB_32_TYPE_SRQ_ARM	(UINT32_C(0x3) << 28)
89190 	/*
89191 	 * This is a CQ consumer index update. It indicates one or more
89192 	 * entries have been processed off the CQ indicated on the xID
89193 	 * field.This type is valid for L2, RoCE and Engine path.
89194 	 */
89195 		#define DBC_ABSOLUTE_DB_32_TYPE_CQ	(UINT32_C(0x4) << 28)
89196 	/*
89197 	 * this is a CQ consumer index update that also arms the CQ for
89198 	 * solicited events. This type is valid for RoCE path.
89199 	 */
89200 		#define DBC_ABSOLUTE_DB_32_TYPE_CQ_ARMSE	(UINT32_C(0x5) << 28)
89201 	/*
89202 	 * This is a CQ consumer index update that also arms the CQ
89203 	 * for any new CQE. This type is valid for L2, RoCE and Engine
89204 	 * path.
89205 	 */
89206 		#define DBC_ABSOLUTE_DB_32_TYPE_CQ_ARMALL   (UINT32_C(0x6) << 28)
89207 	/*
89208 	 * This is a CQ arm enable message. This message must be sent from
89209 	 * the privileged driver before a new CQ_ARMSE or CQ_ARMALL message
89210 	 * will be accepted from user space (non-privileged doorbell page).
89211 	 * The index and epoch for this doorbell type are unused.
89212 	 *
89213 	 * This doorbell can only be sent from the privileged (first)
89214 	 * doorbell page of a function.
89215 	 */
89216 		#define DBC_ABSOLUTE_DB_32_TYPE_CQ_ARMENA   (UINT32_C(0x7) << 28)
89217 	/*
89218 	 * This doorbell command enables the SRQ async event to be armed.
89219 	 * This message must be sent from the privileged driver before a
89220 	 * new SRQ_ARM message will be accepted from user space.
89221 	 * The xID field must identify the SID that is being enabled for
89222 	 * arm. The index and epoch for this doorbell type are unused.
89223 	 *
89224 	 * This doorbell can only be sent from the privileged (first)
89225 	 * doorbell page of a function.
89226 	 */
89227 		#define DBC_ABSOLUTE_DB_32_TYPE_SRQ_ARMENA  (UINT32_C(0x8) << 28)
89228 	/*
89229 	 * This is a NQ consumer index update. It indicates one or more
89230 	 * entries have been processed off the NQ indicated on the xID
89231 	 * field. This type is valid for L2, RoCE and Engine path.
89232 	 */
89233 		#define DBC_ABSOLUTE_DB_32_TYPE_NQ	(UINT32_C(0xa) << 28)
89234 	/*
89235 	 * This is a NQ consumer index update that also arms the NQ for
89236 	 * any new NQE. This type is valid for L2, RoCE and Engine path.
89237 	 */
89238 		#define DBC_ABSOLUTE_DB_32_TYPE_NQ_ARM	(UINT32_C(0xb) << 28)
89239 	/*
89240 	 * This is a NQ consumer index update that also arms the NQ for
89241 	 * any new NQE. It is used for the legacy INT mask. This type
89242 	 * is valid for L2, RoCE and Engine path.
89243 	 */
89244 		#define DBC_ABSOLUTE_DB_32_TYPE_NQ_MASK	(UINT32_C(0xe) << 28)
89245 	/*
89246 	 * This doorbell command is used during doorbell moderation
89247 	 * to consume system BW and help prevent doorbell FIFO
89248 	 * overflow.
89249 	 *
89250 	 * All other fields should be zero for NULL doorbell.
89251 	 * For doorbell recovery, NULL doorbell type in the Application
89252 	 * table indicates that it is the last QP entry for the function.
89253 	 * This type is valid for L2, RoCE and Engine path.
89254 	 */
89255 		#define DBC_ABSOLUTE_DB_32_TYPE_NULL	(UINT32_C(0xf) << 28)
89256 		#define DBC_ABSOLUTE_DB_32_TYPE_LAST	DBC_ABSOLUTE_DB_32_TYPE_NULL
89257 } dbc_absolute_db_32_t, *pdbc_absolute_db_32_t;
89258 
89259 /*
89260  * This is the "Relative" 32b Doorbell format. The host writes this
89261  * message format directly to byte offset 8 of the appropriate doorbell
89262  * page.
89263  *
89264  * Doorbell recovery can not be supported for relative doorbells. So
89265  * relative doorbells are only safe to use when SOC is supporting the
89266  * context backing store in local DDR. If that is the case, it is safe
89267  * to turn off doorbell drops and use this type of doorbell.
89268  */
89269 /* dbc_relative_db_32 (size:32b/4B) */
89270 
89271 typedef struct dbc_relative_db_32 {
89272 	uint32_t	xid;
89273 	/*
89274 	 * This value identifies the resource that the doorbell is intended
89275 	 * to notify.
89276 	 *
89277 	 * For SQ, this is the QPID value.
89278 	 */
89279 	#define DBC_RELATIVE_DB_32_XID_MASK	UINT32_C(0xfffff)
89280 	#define DBC_RELATIVE_DB_32_XID_SFT	0
89281 	/*
89282 	 * This value defines the intended doorbell path between RoCE and
89283 	 * L2.
89284 	 */
89285 	#define DBC_RELATIVE_DB_32_PATH_MASK	UINT32_C(0xc00000)
89286 	#define DBC_RELATIVE_DB_32_PATH_SFT	22
89287 	/* This is a RoCE doorbell message. */
89288 		#define DBC_RELATIVE_DB_32_PATH_ROCE	(UINT32_C(0x0) << 22)
89289 	/* This is a L2 doorbell message. */
89290 		#define DBC_RELATIVE_DB_32_PATH_L2	(UINT32_C(0x1) << 22)
89291 		#define DBC_RELATIVE_DB_32_PATH_LAST	DBC_RELATIVE_DB_32_PATH_L2
89292 	/*
89293 	 * This value is the value to add to the appropriate index value.
89294 	 *
89295 	 * The increment unit is 16B for L2 path. For RoCE there is a
89296 	 * legacy mode with 128B unit size and a variable size mode with
89297 	 * 32B unit size. For Engine mode, the unit size is always 128B.
89298 	 */
89299 	#define DBC_RELATIVE_DB_32_INCR_MASK	UINT32_C(0x1f000000)
89300 	#define DBC_RELATIVE_DB_32_INCR_SFT	24
89301 	/* This value identifies the type of doorbell being written. */
89302 	#define DBC_RELATIVE_DB_32_TYPE_MASK	UINT32_C(0xe0000000)
89303 	#define DBC_RELATIVE_DB_32_TYPE_SFT	29
89304 	/*
89305 	 * This is a SQ producer index update. It indicates one or more
89306 	 * new entries have been written to the SQ for the QPID indicated
89307 	 * on the xID field. This type is valid for L2, RoCE and Engine
89308 	 * path.
89309 	 */
89310 		#define DBC_RELATIVE_DB_32_TYPE_SQ	(UINT32_C(0x0) << 29)
89311 	/*
89312 	 * This is a SRQ producer index update. It indicates one or more
89313 	 * new entries have been written to the SRQ for the SID indicated
89314 	 * on the xID field. This type is valid for L2 and RoCE path.
89315 	 */
89316 		#define DBC_RELATIVE_DB_32_TYPE_SRQ	(UINT32_C(0x1) << 29)
89317 	/*
89318 	 * This is a CQ consumer index update. It indicates one or more
89319 	 * entries have been processed off the CQ indicated on the xID
89320 	 * field.This type is valid for L2, RoCE and Engine path.
89321 	 */
89322 		#define DBC_RELATIVE_DB_32_TYPE_CQ	(UINT32_C(0x2) << 29)
89323 	/*
89324 	 * This is a CQ consumer index update that also arms the CQ
89325 	 * for any new CQE. This type is valid for L2, RoCE and Engine
89326 	 * path.
89327 	 */
89328 		#define DBC_RELATIVE_DB_32_TYPE_CQ_ARMALL  (UINT32_C(0x3) << 29)
89329 	/*
89330 	 * This is a NQ consumer index update. It indicates one or more
89331 	 * entries have been processed off the NQ indicated on the xID
89332 	 * field. This type is valid for L2, RoCE and Engine path.
89333 	 */
89334 		#define DBC_RELATIVE_DB_32_TYPE_NQ	(UINT32_C(0x4) << 29)
89335 	/*
89336 	 * This is a NQ consumer index update that also arms the NQ for
89337 	 * any new NQE. This type is valid for L2, RoCE and Engine path.
89338 	 */
89339 		#define DBC_RELATIVE_DB_32_TYPE_NQ_ARM	(UINT32_C(0x5) << 29)
89340 	/*
89341 	 * This is a NQ consumer index update that also arms the NQ for
89342 	 * any new NQE. It is used for the legacy INT mask. This type
89343 	 * is valid for L2, RoCE and Engine path.
89344 	 */
89345 		#define DBC_RELATIVE_DB_32_TYPE_NQ_MASK	(UINT32_C(0x6) << 29)
89346 		#define DBC_RELATIVE_DB_32_TYPE_LAST	DBC_RELATIVE_DB_32_TYPE_NQ_MASK
89347 } dbc_relative_db_32_t, *pdbc_relative_db_32_t;
89348 
89349 /*
89350  * The kernel memory structure is per-type (SQ, RQ, SRQ/SRQ_ARM and
89351  * CQ/CQ_ARMSE/CQ_ARMALL). Each kernel driver will support a table for
89352  * the doorbell recovery.
89353  */
89354 /* dbc_drk (size:128b/16B) */
89355 
89356 typedef struct dbc_drk {
89357 	uint32_t	db_format_linked_last_valid_stride_size;
89358 	/*
89359 	 * This indicates it is valid entry. It should be set for each
89360 	 * doorbell written to the chip. The bit should be cleared at time
89361 	 * zero to indicate that it has not yet been written. The bit i
89362 	 * should be cleared when the function for the table is disabled.
89363 	 */
89364 	#define DBC_DRK_VALID	UINT32_C(0x1)
89365 	/* This indicates it is last entry for the table. */
89366 	#define DBC_DRK_LAST	UINT32_C(0x2)
89367 	/* This indicates it is entry for the next 4KB kernel memory pointer. */
89368 	#define DBC_DRK_LINKED	UINT32_C(0x4)
89369 	/*
89370 	 * This field indicates if the doorbells in the table are 32b
89371 	 * absolute or 64b format.
89372 	 */
89373 	#define DBC_DRK_DB_FORMAT	UINT32_C(0x8)
89374 	/* The doorbells are 64b format. */
89375 		#define DBC_DRK_DB_FORMAT_B64   (UINT32_C(0x0) << 3)
89376 	/*
89377 	 * The doorbells are in the absolute 32b format. The doorbell
89378 	 * is in the right-most half of the 64b space provided in the
89379 	 * application table entry.
89380 	 */
89381 		#define DBC_DRK_DB_FORMAT_B32A  (UINT32_C(0x1) << 3)
89382 		#define DBC_DRK_DB_FORMAT_LAST DBC_DRK_DB_FORMAT_B32A
89383 	/*
89384 	 * This field controls the stride feature. The stride feature is
89385 	 * more bandwidth efficient on the PCIE bus when only a small number
89386 	 * of doorbells are used in each cache line.
89387 	 */
89388 	#define DBC_DRK_STRIDE_MASK   UINT32_C(0x300)
89389 	#define DBC_DRK_STRIDE_SFT	8
89390 	/*
89391 	 * When stride is off, the DBR will read all the bytes in
89392 	 * an application page until a NULL doorbell is found or
89393 	 * the end of the 4K page is reached.
89394 	 */
89395 		#define DBC_DRK_STRIDE_OFF	(UINT32_C(0x0) << 8)
89396 	/*
89397 	 * When stride is 1, the DBR will read the 'size' doorbells,
89398 	 * starting at the next 64B cache line boundary or until
89399 	 * a NULL doorbell is found in the application page or
89400 	 * the end of the 4K page is reached.
89401 	 */
89402 		#define DBC_DRK_STRIDE_SZ64	(UINT32_C(0x1) << 8)
89403 	/*
89404 	 * When stride is 2, the DBR will read the 'size' doorbells,
89405 	 * starting at the next 128B cache line boundary or until
89406 	 * a NULL doorbell is found in the application page or
89407 	 * the end of the 4K page is reached.
89408 	 */
89409 		#define DBC_DRK_STRIDE_SZ128	(UINT32_C(0x2) << 8)
89410 		#define DBC_DRK_STRIDE_LAST	DBC_DRK_STRIDE_SZ128
89411 	/*
89412 	 * This value controls how many doorbells are read at each stride
89413 	 * when stride mode is in use.
89414 	 */
89415 	#define DBC_DRK_SIZE_MASK	UINT32_C(0xc00)
89416 	#define DBC_DRK_SIZE_SFT	10
89417 	/* 4*8B is read at the start of each stride. */
89418 		#define DBC_DRK_SIZE_FOUR	(UINT32_C(0x0) << 10)
89419 	/* 1*8B is read at the start of each stride. */
89420 		#define DBC_DRK_SIZE_ONE	(UINT32_C(0x1) << 10)
89421 	/* 2*8B is read at the start of each stride. */
89422 		#define DBC_DRK_SIZE_TWO	(UINT32_C(0x2) << 10)
89423 	/* 3*8B is read at the start of each stride. */
89424 		#define DBC_DRK_SIZE_THREE	(UINT32_C(0x3) << 10)
89425 		#define DBC_DRK_SIZE_LAST	DBC_DRK_SIZE_THREE
89426 	uint32_t	pi;
89427 	/*
89428 	 * Page Index portion of DPI{VF_VALID,VFID,PI}. The pi needs to match
89429 	 * the value from the context DPI for the operation to be valid or
89430 	 * the pi must be zero, indicating a write from the privileged
89431 	 * driver.
89432 	 *
89433 	 * pi in the kernel memory table is there for DBR to generate the DPI
89434 	 * message to the client.
89435 	 */
89436 	#define DBC_DRK_PI_MASK UINT32_C(0xffff)
89437 	#define DBC_DRK_PI_SFT 0
89438 	/*
89439 	 * It is the application memory page(4KB) pointer when linked = 0.
89440 	 * It is the next kernel memory page(4KB) pointer when linked = 1.
89441 	 * The pointer doesn't have to be aligned to the page(4KB) but it
89442 	 * should be aligned to 128B boundary. This means that the bottom
89443 	 * 7b of the pointer must be zero.
89444 	 */
89445 	uint64_t	memptr;
89446 } dbc_drk_t, *pdbc_drk_t;
89447 
89448 /*
89449  * The kernel memory structure is per-type (SQ, RQ, SRQ/SRQ_ARM and
89450  * CQ/CQ_ARMSE/CQ_ARMALL). Each kernel driver will support a table for
89451  * the doorbell recovery.
89452  */
89453 /* dbc_drk64 (size:128b/16B) */
89454 
89455 typedef struct dbc_drk64 {
89456 	uint64_t	flags;
89457 	/*
89458 	 * This indicates it is valid entry. It should be set for each
89459 	 * doorbell written to the chip. The bit should be cleared at time
89460 	 * zero to indicate that it has not yet been written. The bit i
89461 	 * should be cleared when the function for the table is disabled.
89462 	 */
89463 	#define DBC_DRK64_VALID	UINT32_C(0x1)
89464 	/* This indicates it is last entry for the table. */
89465 	#define DBC_DRK64_LAST	UINT32_C(0x2)
89466 	/* This indicates it is entry for the next 4KB kernel memory pointer. */
89467 	#define DBC_DRK64_LINKED	UINT32_C(0x4)
89468 	/*
89469 	 * This field indicates if the doorbells in the table are 32b
89470 	 * absolute or 64b format.
89471 	 */
89472 	#define DBC_DRK64_DB_FORMAT	UINT32_C(0x8)
89473 	/* The doorbells are 64b format. */
89474 		#define DBC_DRK64_DB_FORMAT_B64   (UINT32_C(0x0) << 3)
89475 	/*
89476 	 * The doorbells are in the absolute 32b format. The doorbell
89477 	 * is in the right-most half of the 64b space provided in the
89478 	 * application table entry.
89479 	 */
89480 		#define DBC_DRK64_DB_FORMAT_B32A  (UINT32_C(0x1) << 3)
89481 		#define DBC_DRK64_DB_FORMAT_LAST DBC_DRK64_DB_FORMAT_B32A
89482 	/*
89483 	 * This field controls the stride feature. The stride feature is
89484 	 * more bandwidth efficient on the PCIE bus when only a small number
89485 	 * of doorbells are used in each cache line.
89486 	 */
89487 	#define DBC_DRK64_STRIDE_MASK   UINT32_C(0x300)
89488 	#define DBC_DRK64_STRIDE_SFT	8
89489 	/*
89490 	 * When stride is off, the DBR will read all the bytes in
89491 	 * an application page until a NULL doorbell is found or
89492 	 * the end of the 4K page is reached.
89493 	 */
89494 		#define DBC_DRK64_STRIDE_OFF	(UINT32_C(0x0) << 8)
89495 	/*
89496 	 * When stride is 1, the DBR will read the 'size' doorbells,
89497 	 * starting at the next 64B cache line boundary or until
89498 	 * a NULL doorbell is found in the application page or
89499 	 * the end of the 4K page is reached.
89500 	 */
89501 		#define DBC_DRK64_STRIDE_SZ64	(UINT32_C(0x1) << 8)
89502 	/*
89503 	 * When stride is 2, the DBR will read the 'size' doorbells,
89504 	 * starting at the next 128B cache line boundary or until
89505 	 * a NULL doorbell is found in the application page or
89506 	 * the end of the 4K page is reached.
89507 	 */
89508 		#define DBC_DRK64_STRIDE_SZ128	(UINT32_C(0x2) << 8)
89509 		#define DBC_DRK64_STRIDE_LAST	DBC_DRK64_STRIDE_SZ128
89510 	/*
89511 	 * This value controls how many doorbells are read at each stride
89512 	 * when stride mode is in use.
89513 	 */
89514 	#define DBC_DRK64_SIZE_MASK	UINT32_C(0xc00)
89515 	#define DBC_DRK64_SIZE_SFT	10
89516 	/* 4*8B is read at the start of each stride. */
89517 		#define DBC_DRK64_SIZE_FOUR	(UINT32_C(0x0) << 10)
89518 	/* 1*8B is read at the start of each stride. */
89519 		#define DBC_DRK64_SIZE_ONE	(UINT32_C(0x1) << 10)
89520 	/* 2*8B is read at the start of each stride. */
89521 		#define DBC_DRK64_SIZE_TWO	(UINT32_C(0x2) << 10)
89522 	/* 3*8B is read at the start of each stride. */
89523 		#define DBC_DRK64_SIZE_THREE	(UINT32_C(0x3) << 10)
89524 		#define DBC_DRK64_SIZE_LAST	DBC_DRK64_SIZE_THREE
89525 	/*
89526 	 * Page Index portion of DPI{VF_VALID,VFID,PI}. The pi needs to match
89527 	 * the value from the context DPI for the operation to be valid or
89528 	 * the pi must be zero, indicating a write from the privileged
89529 	 * driver.
89530 	 *
89531 	 * pi in the kernel memory table is there for DBR to generate the DPI
89532 	 * message to the client.
89533 	 */
89534 	#define DBC_DRK64_PI_MASK	UINT32_C(0xffff00000000)L
89535 	#define DBC_DRK64_PI_SFT	32
89536 	/*
89537 	 * It is the application memory page(4KB) pointer when linked = 0.
89538 	 * It is the next kernel memory page(4KB) pointer when linked = 1.
89539 	 * The pointer doesn't have to be aligned to the page(4KB) but it
89540 	 * should be aligned to 128B boundary. This means that the bottom
89541 	 * 7b of the pointer must be zero.
89542 	 */
89543 	uint64_t	memptr;
89544 } dbc_drk64_t, *pdbc_drk64_t;
89545 
89546 /*
89547  * This is the 64b doorbell format. The host writes this message
89548  * format directly to byte offset 0 of the appropriate doorbell page.
89549  */
89550 /* dbc_dbc_v3 (size:64b/8B) */
89551 
89552 typedef struct dbc_dbc_v3 {
89553 	uint32_t	index;
89554 	/*
89555 	 * This value is the index being written.
89556 	 *
89557 	 * For SQ/RQ/SRQ, this is the producer index. It should be set to
89558 	 * the queue index of the last WQE/BD written plus the number of
89559 	 * index units in the WQE/BD. For example, if the number of index
89560 	 * units in an SQ WQE is 8 and the WQE was written to the first
89561 	 * location in the queue (zero), this index should be written to 8.
89562 	 * The index should point to the start of the first location that
89563 	 * has not been filled in with WQE/BD data. For SQ (both RoCE and
89564 	 * L2), the index unit is 16B. For RQ/SRQ, the index unit is 1 WQE
89565 	 * (RoCE) or 1 BD (L2).
89566 	 *
89567 	 * For CQ, this is the consumer index and should be the starting
89568 	 * queue index of the last CQE processed plus the size of the last
89569 	 * processed CQE in index units. The index should point to the
89570 	 * start of the first CQE in the queue that has not been processed.
89571 	 * The index unit is 16B.
89572 	 *
89573 	 * For NQ, this is the consumer index and should be the starting
89574 	 * queue index of the last NQE processed plus the size of the last
89575 	 * processed NQE in index units. The index should point to the
89576 	 * start of the first NQE in the queue that has not been processed.
89577 	 * The index unit is 16B.
89578 	 */
89579 	#define DBC_DBC_V3_INDEX_MASK UINT32_C(0xffffff)
89580 	#define DBC_DBC_V3_INDEX_SFT  0
89581 	/*
89582 	 * The epoch bit provides a frame of reference for the queue index.
89583 	 * S/W will toggle this bit in the doorbell each time index range is
89584 	 * wrapped. This allows the receiving HW block to more efficiently
89585 	 * detect out-of-order doorbells and to ignore the older doorbells.
89586 	 * Out-of-order doorbells occur normally during dropped doorbell
89587 	 * recovery.
89588 	 */
89589 	#define DBC_DBC_V3_EPOCH	UINT32_C(0x1000000)
89590 	/*
89591 	 * The toggle value is used in CQ_ARMENA, CQ_ARMSE, CQ_ARMALL,
89592 	 * SRQ_ARMENA, SRQ_ARM, and CQ_CUTOFF_ACK doorbells to qualify the
89593 	 * doorbell as valid. This value should be taken from the latest
89594 	 * NQE or cutoff completion.
89595 	 *
89596 	 * Doorbells of the above types with the wrong toggle value will
89597 	 * be ignored. This is how old values in of backup doorbells
89598 	 * are ignored.
89599 	 */
89600 	#define DBC_DBC_V3_TOGGLE_MASK UINT32_C(0x6000000)
89601 	#define DBC_DBC_V3_TOGGLE_SFT 25
89602 	uint32_t	type_path_xid;
89603 	/*
89604 	 * This value identifies the resource that the doorbell is intended
89605 	 * to notify.
89606 	 *
89607 	 * For SQ and RQ, this is the QPID. For SRQ, this is the SID. For
89608 	 * CQ, this is the CID. For NQ, this is the NID.
89609 	 *
89610 	 * Unused bits (for example bits [11:7] of the SID value) must be
89611 	 * zero.
89612 	 */
89613 	#define DBC_DBC_V3_XID_MASK	UINT32_C(0xfff)
89614 	#define DBC_DBC_V3_XID_SFT	0
89615 	/*
89616 	 * This value defines the intended doorbell path between RoCE and
89617 	 * L2.
89618 	 */
89619 	#define DBC_DBC_V3_PATH_MASK	UINT32_C(0x3000000)
89620 	#define DBC_DBC_V3_PATH_SFT	24
89621 	/* This is a RoCE doorbell message. */
89622 		#define DBC_DBC_V3_PATH_ROCE	(UINT32_C(0x0) << 24)
89623 	/* This is a L2 doorbell message. */
89624 		#define DBC_DBC_V3_PATH_L2		(UINT32_C(0x1) << 24)
89625 		#define DBC_DBC_V3_PATH_LAST	DBC_DBC_V3_PATH_L2
89626 	/*
89627 	 * This indicates it is valid doorbell update. It should be set for
89628 	 * each doorbell written to the chip and set when doorbell message is
89629 	 * written to the backup doorbell location. The bit should be cleared
89630 	 * in the backup doorbell location at time zero to indicate that the
89631 	 * backup doorbell has not yet been written.
89632 	 */
89633 	#define DBC_DBC_V3_VALID		UINT32_C(0x4000000)
89634 	/*
89635 	 * When this bit is set to one, the chip will capture debug
89636 	 * information for the doorbell ring. This is intended to only be
89637 	 * used on SQ doorbell rings.
89638 	 */
89639 	#define DBC_DBC_V3_DEBUG_TRACE	UINT32_C(0x8000000)
89640 	/* This value identifies the type of doorbell being written. */
89641 	#define DBC_DBC_V3_TYPE_MASK	UINT32_C(0xf0000000)
89642 	#define DBC_DBC_V3_TYPE_SFT	28
89643 	/*
89644 	 * This is a SQ producer index update. It indicates one or more
89645 	 * new entries have been written to the SQ for the QPID indicated
89646 	 * on the xID field. This type is valid for L2 and RoCE path.
89647 	 */
89648 		#define DBC_DBC_V3_TYPE_SQ		(UINT32_C(0x0) << 28)
89649 	/*
89650 	 * This is a RQ producer index update. It indicates one or more
89651 	 * new entries have been written to the RQ for the QPID indicated
89652 	 * on the xID field. This type is valid for RoCE path.
89653 	 */
89654 		#define DBC_DBC_V3_TYPE_RQ		(UINT32_C(0x1) << 28)
89655 	/*
89656 	 * This is a SRQ producer index update. It indicates one or more
89657 	 * new entries have been written to the SRQ for the SID indicated
89658 	 * on the xID field. This type is valid for L2 and RoCE path.
89659 	 */
89660 		#define DBC_DBC_V3_TYPE_SRQ		(UINT32_C(0x2) << 28)
89661 	/*
89662 	 * This doorbell command arms the SRQ async event. The xID field
89663 	 * must identify the SID that is begin armed. The index field is
89664 	 * will set the arm threshold such that a notification will be
89665 	 * generated if less than that number or SRQ entries are posted.
89666 	 *
89667 	 * This type is valid for RoCE path.
89668 	 */
89669 		#define DBC_DBC_V3_TYPE_SRQ_ARM	(UINT32_C(0x3) << 28)
89670 	/*
89671 	 * CQ doorbell is used to update the consumer index for the CQ
89672 	 * for overflow detection. It should only be sent if overflow
89673 	 * detection is enabled for the CQ. Keep in mind that if
89674 	 * doorbells are being dropped due to PCIE ordering rules, you
89675 	 * may get a false overflow detection if you are checking for CQ
89676 	 * overflow.
89677 	 *
89678 	 * This type is valid for L2 and RoCE path.
89679 	 */
89680 		#define DBC_DBC_V3_TYPE_CQ		(UINT32_C(0x4) << 28)
89681 	/*
89682 	 * This is a CQ consumer index update that also arms the CQ for
89683 	 * solicited events. This is for roce only not for l2.
89684 	 *
89685 	 * The index is used as the location of the last CQE that was
89686 	 * processed by the driver. The new interrupt will be generated
89687 	 * based on this location.
89688 	 *
89689 	 * This type is valid for RoCE path.
89690 	 */
89691 		#define DBC_DBC_V3_TYPE_CQ_ARMSE	(UINT32_C(0x5) << 28)
89692 	/*
89693 	 * This is a CQ consumer index update that also arms the CQ for
89694 	 * any new CQE.
89695 	 *
89696 	 * The index is used as the location of the last CQE that was
89697 	 * processed by the driver. The new interrupt will be generated
89698 	 * based on this location.
89699 	 *
89700 	 * This type is valid for L2 and RoCE path.
89701 	 */
89702 		#define DBC_DBC_V3_TYPE_CQ_ARMALL	(UINT32_C(0x6) << 28)
89703 	/*
89704 	 * This is a CQ arm enable message. This message must be sent
89705 	 * from the privileged driver before a new CQ_ARMSE or CQ_ARMALL
89706 	 * message will be accepted from user space (non-privileged
89707 	 * doorbell page). The index and epoch for this doorbell type are
89708 	 * unused.
89709 	 *
89710 	 * This doorbell can only be sent from the privileged (first)
89711 	 * doorbell page of a function.
89712 	 */
89713 		#define DBC_DBC_V3_TYPE_CQ_ARMENA	(UINT32_C(0x7) << 28)
89714 	/*
89715 	 * This doorbell command enables the SRQ async event to be armed.
89716 	 * This message must be sent from the privileged driver before
89717 	 * a new SRQ_ARM message will be accepted from user space. The
89718 	 * xID field must identify the SID that is being enabled for arm.
89719 	 * The index and epoch for this doorbell type are unused.
89720 	 *
89721 	 * This doorbell can only be sent from the privileged (first)
89722 	 * doorbell page of a function.
89723 	 */
89724 		#define DBC_DBC_V3_TYPE_SRQ_ARMENA	(UINT32_C(0x8) << 28)
89725 	/*
89726 	 * This doorbell type is used to acknowledge a cutoff completion
89727 	 * in the CQ. The index and epoch for this doorbell type are
89728 	 * unused. This doorbell is sent when the cutoff completion has
89729 	 * been processed and the old CQ in a CQ resize operation is no
89730 	 * longer needed.
89731 	 *
89732 	 * The index and epoch must be valid for this doorbell if
89733 	 * overflow checking is enabled for the CQ.
89734 	 */
89735 		#define DBC_DBC_V3_TYPE_CQ_CUTOFF_ACK  (UINT32_C(0x9) << 28)
89736 	/*
89737 	 * This is a NQ consumer index update. It indicates one or more
89738 	 * entries have been processed off the NQ indicated on the xID
89739 	 * field. It will also mask the NQ for any new NQE. This type is
89740 	 * valid for L2 and RoCE path.
89741 	 *
89742 	 * Thor is broken in that it doesn't mask a legacy INTA interrupt
89743 	 * when used at the start of an ISR, as it is supposed to be.
89744 	 *
89745 	 * type=NQ masks the current interrupt. When the iSR starts, it
89746 	 * writes a type=NQ with the current consumer index. For legacy
89747 	 * PCI interrupts, this needs to mask the interrupt so the legacy
89748 	 * interrupt is deasserted. Then the driver does some work and
89749 	 * writes some more type=NQ. Finally the driver stops the ISR and
89750 	 * does a type=NQ_ARM to get another interrupt (when needed). The
89751 	 * only reason to use type=NQ_MASK is to back out of the armed
89752 	 * state. In that request, the index update is not required.
89753 	 */
89754 		#define DBC_DBC_V3_TYPE_NQ		(UINT32_C(0xa) << 28)
89755 	/*
89756 	 * This is a NQ consumer index update that also arms the NQ for
89757 	 * any new NQE.
89758 	 *
89759 	 * This type is valid for L2 and RoCE path.
89760 	 */
89761 		#define DBC_DBC_V3_TYPE_NQ_ARM	(UINT32_C(0xb) << 28)
89762 	/*
89763 	 * This doorbell will assign a new NQ to a CQ. This is handy if
89764 	 * the user wants to change which interrupt handler is going to
89765 	 * process a particular CQ. This doorbell must be sent from the
89766 	 * privileged driver.
89767 	 *
89768 	 * The xID must be the CID for the CQ that needs to be changed.
89769 	 * The index value is the NQID of the new NQ that will be used
89770 	 * for future notifications. epoch and toggle are ignored for
89771 	 * this doorbell type.
89772 	 *
89773 	 * The CQ will disarm notifications and generate a NQE to the old
89774 	 * NQ with the nq_reassign type value. The chip will guarantee
89775 	 * that no notification will be sent to the old NQ after the
89776 	 * nq_reassign NQE has been sent.
89777 	 *
89778 	 * This type is valid for L2 and RoCE CQs.
89779 	 */
89780 		#define DBC_DBC_V3_TYPE_CQ_REASSIGN	(UINT32_C(0xc) << 28)
89781 	/*
89782 	 * This masks the NQ for any new NQE. This will NOT update the NQ
89783 	 * consumer index.
89784 	 *
89785 	 * This type is valid for L2 and RoCE path.
89786 	 */
89787 		#define DBC_DBC_V3_TYPE_NQ_MASK	(UINT32_C(0xe) << 28)
89788 	/*
89789 	 * All other fields should be zero for NULL doorbell.
89790 	 *
89791 	 * For doorbell recovery, NULL doorbell type in the Application
89792 	 * table indicates that it is the last QP entry for the function.
89793 	 * This type is valid for L2 and RoCE path.
89794 	 */
89795 		#define DBC_DBC_V3_TYPE_NULL	(UINT32_C(0xf) << 28)
89796 		#define DBC_DBC_V3_TYPE_LAST	DBC_DBC_V3_TYPE_NULL
89797 } dbc_dbc_v3_t, *pdbc_dbc_v3_t;
89798 
89799 /*
89800  * This is the RoCE Express Doorbell format. The host writes this
89801  * message format directly to offset 0x40 of the appropriate doorbell
89802  * page. Express doorbells are used when the chip will be owning the
89803  * SQ, RQ, and SRQ as well as the producer indexes for each queue. This
89804  * provides a simple fastpath programming model.
89805  *
89806  * Express doorbell must be received by the chip as a single TLP
89807  * message.
89808  */
89809 /* dbc_xp (size:512b/64B) */
89810 
89811 typedef struct dbc_xp {
89812 	uint32_t	reserved;
89813 	uint32_t	type_xid;
89814 	/*
89815 	 * This value identifies the resource that the doorbell is intended
89816 	 * to notify.
89817 	 *
89818 	 * For SQ and RQ, this is the QPID. For SRQ, this is the SID. For
89819 	 * CQ, this is the CID. For NQ, this is the NID.
89820 	 *
89821 	 * Unused bits (for example bits [11:7] of the SID value) must be
89822 	 * zero.
89823 	 */
89824 	#define DBC_XP_XID_MASK	UINT32_C(0xfff)
89825 	#define DBC_XP_XID_SFT	0
89826 	/*
89827 	 * When this bit is set to one, the chip will capture debug
89828 	 * information for the doorbell ring. This is intended to only be
89829 	 * used on SQ doorbell rings.
89830 	 */
89831 	#define DBC_XP_DEBUG_TRACE	UINT32_C(0x1000000)
89832 	/* This value identifies the type of doorbell being written. */
89833 	#define DBC_XP_TYPE_MASK	UINT32_C(0xf0000000)
89834 	#define DBC_XP_TYPE_SFT	28
89835 	/*
89836 	 * This is a SQ producer index update. It indicates one or more
89837 	 * new entries have been written to the SQ for the QPID indicated
89838 	 * on the xID field. This type is valid for L2, RoCE and Engine
89839 	 * path.
89840 	 */
89841 		#define DBC_XP_TYPE_SQ	(UINT32_C(0x0) << 28)
89842 	/*
89843 	 * This is a RQ producer index update. It indicates one or more
89844 	 * new entries have been written to the RQ for the QPID indicated
89845 	 * on the xID field. This type is valid for RoCE path.
89846 	 */
89847 		#define DBC_XP_TYPE_RQ	(UINT32_C(0x1) << 28)
89848 	/*
89849 	 * This is a SRQ producer index update. It indicates one or more
89850 	 * new entries have been written to the SRQ for the SID indicated
89851 	 * on the xID field. This type is valid for L2 and RoCE path.
89852 	 */
89853 		#define DBC_XP_TYPE_SRQ	(UINT32_C(0x2) << 28)
89854 		#define DBC_XP_TYPE_LAST	DBC_XP_TYPE_SRQ
89855 	/*
89856 	 * This field hold one express WQE. The WQE must be appropriate for
89857 	 * the queue selected by the type field.
89858 	 */
89859 	uint32_t	wqe[14];
89860 } dbc_xp_t, *pdbc_xp_t;
89861 
89862 /*
89863  * This is a firmware status register that indicates the software status
89864  * exposed by the firmware to the host.
89865  *
89866  * > This register is not present in previous versions of this chip.
89867  */
89868 /* fw_status_reg (size:32b/4B) */
89869 
89870 typedef struct fw_status_reg {
89871 	uint32_t	fw_status;
89872 	/*
89873 	 * These bits indicate the status as being reported by the firmware.
89874 	 *
89875 	 * The value should be interpreted as follows:
89876 	 * A value below 0x8000 is an indication that the firmware is still
89877 	 * in the process of starting up and is not ready. The host driver
89878 	 * should continue waiting with a timeout for firmware status to be
89879 	 * ready.
89880 	 * >	0x0000 to 0x00FF : SBL state information
89881 	 * >	0x0200 to 0x02FF : SBI state information
89882 	 * >	0x0400 to 0x04FF : SRT state information
89883 	 * >	0x0600 to 0x06FF : CRT/CHIMP state information
89884 	 * >	0x0800 to 0x08FF : External Firmware state information
89885 	 * >	0x0A00 to 0x0FFF : Reserved for future fw functionality
89886 	 *
89887 	 * A value of 0x8000 indicates firmware is ready and healthy. The
89888 	 * host driver can start initiating HWRM commands to the firmware.
89889 	 *
89890 	 * A value over 0x8000 is an indication that the firmware has
89891 	 * detected a fatal error, this error could be in one of the hardware
89892 	 * block or in a software module. The lower 8 bits indicate a
89893 	 * block/module specific error and the upper 8 bits identify the
89894 	 * hardware block or firmware module that was the source of the
89895 	 * error.
89896 	 * >	0x81XX - 0xBFXX  : 63 ASIC blocks
89897 	 * >	0xC0XX to 0xFDXX : 62 Firmware modules
89898 	 * >	0xFE00 to 0xFEFF : External firmware module
89899 	 * >	0xFFXX	: Reserved for future
89900 	 */
89901 	#define FW_STATUS_REG_CODE_MASK		UINT32_C(0xffff)
89902 	#define FW_STATUS_REG_CODE_SFT		0
89903 	/* Indicates firmware is ready. */
89904 		#define FW_STATUS_REG_CODE_READY		UINT32_C(0x8000)
89905 		#define FW_STATUS_REG_CODE_LAST		FW_STATUS_REG_CODE_READY
89906 	/*
89907 	 * Image Degraded bit. If set indicates that one of the firmware
89908 	 * image is degraded.
89909 	 *
89910 	 * The firmware binary located on NVM has redundant copies to protect
89911 	 * against corruption. When one of the primary or secondary copy is
89912 	 * detected as corrupted, this bit will be set by the firmware either
89913 	 * as part of power on from the context of hwrm_fw_health_check.
89914 	 */
89915 	#define FW_STATUS_REG_IMAGE_DEGRADED	UINT32_C(0x10000)
89916 	/*
89917 	 * Recoverable bit. If set indicates that the fatal error is
89918 	 * recoverable with a full reset.
89919 	 *
89920 	 * This bit should be used by host software and deployment models
89921 	 * that support error recovery by resetting the controller. A
89922 	 * recovery should be attempted from a fatal error condition only if
89923 	 * this bit is set. This bit is meaningful only when the code field
89924 	 * is greater than 0x8000 (32768 decimal).
89925 	 */
89926 	#define FW_STATUS_REG_RECOVERABLE		UINT32_C(0x20000)
89927 	/*
89928 	 * Crash dump is in process. If set indicates that the firmware is
89929 	 * currently recording a crash dump.
89930 	 *
89931 	 * This bit provides a hint to the host driver if the firmware is
89932 	 * currently recording a crash dump. Host driers should avoid
89933 	 * resetting the controller when a crash dump is in progress if
89934 	 * possible. This bit is meaningful only when the code field is
89935 	 * greater than 0x8000 (32768 decimal).
89936 	 */
89937 	#define FW_STATUS_REG_CRASHDUMP_ONGOING	UINT32_C(0x40000)
89938 	/*
89939 	 * Crash dump is available. If set indicates that a firmware crash
89940 	 * dump was recorded before and is now available.
89941 	 *
89942 	 * This bit provides indication to the host driver that the firmware
89943 	 * has completed a crash dump. This bit is meaningful only when the
89944 	 * code field is greater than 0x8000 (32768 decimal).
89945 	 */
89946 	#define FW_STATUS_REG_CRASHDUMP_COMPLETE	UINT32_C(0x80000)
89947 	/*
89948 	 * This bit is used to indicate device state when it enters the
89949 	 * shutdown mode and stopped the communication with the host. The
89950 	 * host should initiate the reload of firmware image or initiate the
89951 	 * reset to bring the device to the normal operational state and
89952 	 * re-establish the communication.
89953 	 *
89954 	 * This bit is meaningful only when the code field is greater than
89955 	 * 0x8000 (32768 decimal).
89956 	 */
89957 	#define FW_STATUS_REG_SHUTDOWN		UINT32_C(0x100000)
89958 	/*
89959 	 * This bit will be set to 1 by the FW when FW crashed without master
89960 	 * function.
89961 	 *
89962 	 * This bit is controller specific, not all products will support
89963 	 * this bit. This bit is valid only when the code field is greater
89964 	 * than 0x8000 (32768 decimal).
89965 	 */
89966 	#define FW_STATUS_REG_CRASHED_NO_MASTER	UINT32_C(0x200000)
89967 	/*
89968 	 * The firmware sets this bit to 1 when the firmware has taken an
89969 	 * exception and expects to initiate error recovery.
89970 	 *
89971 	 * This bit is valid only when the code field is greater than 0x8000
89972 	 * (32768 decimal).
89973 	 */
89974 	#define FW_STATUS_REG_RECOVERING		UINT32_C(0x400000)
89975 	/*
89976 	 * The SBL sets this bit to indicate whether manu_debug pin is
89977 	 * detected high or low.
89978 	 */
89979 	#define FW_STATUS_REG_MANU_DEBUG_STATUS	UINT32_C(0x800000)
89980 } fw_status_reg_t, *pfw_status_reg_t;
89981 
89982 /*
89983  * This structure is fixed at the beginning of the ChiMP SRAM (GRC
89984  * offset: 0x31001F0). Host software is expected to read from this
89985  * location for a defined signature. If it exists, the software can
89986  * assume the presence of this structure and the validity of the
89987  * FW_STATUS location in the next field.
89988  */
89989 /* hcomm_status (size:64b/8B) */
89990 
89991 typedef struct hcomm_status {
89992 	uint32_t	sig_ver;
89993 	/*
89994 	 * This field defines the version of the structure. The latest
89995 	 * version value is 1.
89996 	 */
89997 	#define HCOMM_STATUS_VER_MASK	UINT32_C(0xff)
89998 	#define HCOMM_STATUS_VER_SFT	0
89999 		#define HCOMM_STATUS_VER_LATEST	UINT32_C(0x1)
90000 		#define HCOMM_STATUS_VER_LAST	HCOMM_STATUS_VER_LATEST
90001 	/*
90002 	 * This field is to store the signature value to indicate the
90003 	 * presence of the structure.
90004 	 */
90005 	#define HCOMM_STATUS_SIGNATURE_MASK UINT32_C(0xffffff00)
90006 	#define HCOMM_STATUS_SIGNATURE_SFT 8
90007 		#define HCOMM_STATUS_SIGNATURE_VAL   (UINT32_C(0x484353) << 8)
90008 		#define HCOMM_STATUS_SIGNATURE_LAST HCOMM_STATUS_SIGNATURE_VAL
90009 	uint32_t	fw_status_loc;
90010 	#define HCOMM_STATUS_TRUE_ADDR_SPACE_MASK	UINT32_C(0x3)
90011 	#define HCOMM_STATUS_TRUE_ADDR_SPACE_SFT	0
90012 	/* PCIE configuration space */
90013 		#define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
90014 	/* GRC space */
90015 		#define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_GRC	UINT32_C(0x1)
90016 	/* BAR0 space */
90017 		#define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR0	UINT32_C(0x2)
90018 	/* BAR1 space */
90019 		#define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR1	UINT32_C(0x3)
90020 		#define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_LAST	HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR1
90021 	/*
90022 	 * This offset where the fw_status register is located. The value
90023 	 * is generally 4-byte aligned.
90024 	 */
90025 	#define HCOMM_STATUS_TRUE_OFFSET_MASK	UINT32_C(0xfffffffc)
90026 	#define HCOMM_STATUS_TRUE_OFFSET_SFT	2
90027 } hcomm_status_t, *phcomm_status_t;
90028 
90029 /* This is the GRC offset where the hcomm_status struct resides. */
90030 #define HCOMM_STATUS_STRUCT_LOC 0x31001F0UL
90031 
90032 /***********************
90033  * hwrm_selftest_qlist *
90034  ***********************/
90035 
90036 
90037 /* hwrm_selftest_qlist_input (size:128b/16B) */
90038 
90039 typedef struct hwrm_selftest_qlist_input {
90040 	/* The HWRM command request type. */
90041 	uint16_t	req_type;
90042 	/*
90043 	 * The completion ring to send the completion event on. This should
90044 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
90045 	 */
90046 	uint16_t	cmpl_ring;
90047 	/*
90048 	 * The sequence ID is used by the driver for tracking multiple
90049 	 * commands. This ID is treated as opaque data by the firmware and
90050 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
90051 	 */
90052 	uint16_t	seq_id;
90053 	/*
90054 	 * The target ID of the command:
90055 	 * * 0x0-0xFFF8 - The function ID
90056 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
90057 	 * * 0xFFFD - Reserved for user-space HWRM interface
90058 	 * * 0xFFFF - HWRM
90059 	 */
90060 	uint16_t	target_id;
90061 	/*
90062 	 * A physical address pointer pointing to a host buffer that the
90063 	 * command's response data will be written. This can be either a host
90064 	 * physical address (HPA) or a guest physical address (GPA) and must
90065 	 * point to a physically contiguous block of memory.
90066 	 */
90067 	uint64_t	resp_addr;
90068 } hwrm_selftest_qlist_input_t, *phwrm_selftest_qlist_input_t;
90069 
90070 /* hwrm_selftest_qlist_output (size:2240b/280B) */
90071 
90072 typedef struct hwrm_selftest_qlist_output {
90073 	/* The specific error status for the command. */
90074 	uint16_t	error_code;
90075 	/* The HWRM command request type. */
90076 	uint16_t	req_type;
90077 	/* The sequence ID from the original command. */
90078 	uint16_t	seq_id;
90079 	/* The length of the response data in number of bytes. */
90080 	uint16_t	resp_len;
90081 	/*
90082 	 * This field represents the number of tests available to be
90083 	 * requested by a driver.
90084 	 */
90085 	uint8_t	num_tests;
90086 	/* This field indicates which self-test is available to be run. */
90087 	uint8_t	available_tests;
90088 	/* Can run the NVM test. */
90089 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_NVM_TEST		UINT32_C(0x1)
90090 	/* Can run the link test. */
90091 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_LINK_TEST		UINT32_C(0x2)
90092 	/* Can run the register test. */
90093 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_REGISTER_TEST		UINT32_C(0x4)
90094 	/* Can run the memory test. */
90095 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_MEMORY_TEST		UINT32_C(0x8)
90096 	/* Can run the PCIe serdes test. (deprecated) */
90097 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_PCIE_SERDES_TEST	UINT32_C(0x10)
90098 	/* Can run the Ethernet serdes test. (deprecated) */
90099 	#define HWRM_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
90100 	uint8_t	offline_tests;
90101 	/* The NVM test is an offline test. */
90102 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_NVM_TEST		UINT32_C(0x1)
90103 	/* The link test is an offline test. */
90104 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_LINK_TEST		UINT32_C(0x2)
90105 	/* The register test is an offline test. */
90106 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_REGISTER_TEST		UINT32_C(0x4)
90107 	/* The memory test is an offline test. */
90108 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_MEMORY_TEST		UINT32_C(0x8)
90109 	/* The PCIe serdes test is an offline test. (deprecated) */
90110 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_PCIE_SERDES_TEST	UINT32_C(0x10)
90111 	/* The Ethernet serdes test is an offline test. (deprecated) */
90112 	#define HWRM_SELFTEST_QLIST_OUTPUT_OFFLINE_TESTS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
90113 	uint8_t	unused_0;
90114 	/*
90115 	 * This field represents the maximum timeout for all the
90116 	 * tests to complete in milliseconds.
90117 	 */
90118 	uint16_t	test_timeout;
90119 	uint8_t	unused_1[2];
90120 	/*
90121 	 * This field represents array of 8 test name strings (ASCII chars
90122 	 * with NULL at the end).
90123 	 */
90124 	char	test_name[8][32];
90125 	/*
90126 	 * The lowest available target BER that is supported by FW eyescope.
90127 	 * A Value of 3 indicates that FW supports 1e-8, 1e-9, 1e-10, and
90128 	 * 1e-11. (deprecated)
90129 	 */
90130 	uint8_t	eyescope_target_BER_support;
90131 	/* Eyescope supports a target BER of 1e-8 */
90132 	#define HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_BER_1E8_SUPPORTED  UINT32_C(0x0)
90133 	/* Eyescope supports a target BER of 1e-9 */
90134 	#define HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_BER_1E9_SUPPORTED  UINT32_C(0x1)
90135 	/* Eyescope supports a target BER of 1e-10 */
90136 	#define HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_BER_1E10_SUPPORTED UINT32_C(0x2)
90137 	/* Eyescope supports a target BER of 1e-11 */
90138 	#define HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_BER_1E11_SUPPORTED UINT32_C(0x3)
90139 	/* Eyescope supports a target BER of 1e-12 */
90140 	#define HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_BER_1E12_SUPPORTED UINT32_C(0x4)
90141 	#define HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_LAST		HWRM_SELFTEST_QLIST_OUTPUT_EYESCOPE_TARGET_BER_SUPPORT_BER_1E12_SUPPORTED
90142 	uint8_t	unused_2[6];
90143 	/*
90144 	 * This field is used in Output records to indicate that the output
90145 	 * is completely written to RAM. This field should be read as '1'
90146 	 * to indicate that the output has been completely written. When
90147 	 * writing a command completion or response to an internal processor,
90148 	 * the order of writes has to be such that this field is written last.
90149 	 */
90150 	uint8_t	valid;
90151 } hwrm_selftest_qlist_output_t, *phwrm_selftest_qlist_output_t;
90152 
90153 /**********************
90154  * hwrm_selftest_exec *
90155  **********************/
90156 
90157 
90158 /* hwrm_selftest_exec_input (size:192b/24B) */
90159 
90160 typedef struct hwrm_selftest_exec_input {
90161 	/* The HWRM command request type. */
90162 	uint16_t	req_type;
90163 	/*
90164 	 * The completion ring to send the completion event on. This should
90165 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
90166 	 */
90167 	uint16_t	cmpl_ring;
90168 	/*
90169 	 * The sequence ID is used by the driver for tracking multiple
90170 	 * commands. This ID is treated as opaque data by the firmware and
90171 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
90172 	 */
90173 	uint16_t	seq_id;
90174 	/*
90175 	 * The target ID of the command:
90176 	 * * 0x0-0xFFF8 - The function ID
90177 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
90178 	 * * 0xFFFD - Reserved for user-space HWRM interface
90179 	 * * 0xFFFF - HWRM
90180 	 */
90181 	uint16_t	target_id;
90182 	/*
90183 	 * A physical address pointer pointing to a host buffer that the
90184 	 * command's response data will be written. This can be either a host
90185 	 * physical address (HPA) or a guest physical address (GPA) and must
90186 	 * point to a physically contiguous block of memory.
90187 	 */
90188 	uint64_t	resp_addr;
90189 	/* This field indicates which self-test is being requested to run. */
90190 	uint8_t	flags;
90191 	/* Run the NVM test. */
90192 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_NVM_TEST		UINT32_C(0x1)
90193 	/* Run the link test. */
90194 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_LINK_TEST		UINT32_C(0x2)
90195 	/* Run the register test. */
90196 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_REGISTER_TEST		UINT32_C(0x4)
90197 	/* Run the memory test. */
90198 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_MEMORY_TEST		UINT32_C(0x8)
90199 	/* Run the PCIe serdes test. (deprecated) */
90200 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_PCIE_SERDES_TEST	UINT32_C(0x10)
90201 	/* Run the Ethernet serdes test. (deprecated) */
90202 	#define HWRM_SELFTEST_EXEC_INPUT_FLAGS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
90203 	uint8_t	unused_0[7];
90204 } hwrm_selftest_exec_input_t, *phwrm_selftest_exec_input_t;
90205 
90206 /* hwrm_selftest_exec_output (size:128b/16B) */
90207 
90208 typedef struct hwrm_selftest_exec_output {
90209 	/* The specific error status for the command. */
90210 	uint16_t	error_code;
90211 	/* The HWRM command request type. */
90212 	uint16_t	req_type;
90213 	/* The sequence ID from the original command. */
90214 	uint16_t	seq_id;
90215 	/* The length of the response data in number of bytes. */
90216 	uint16_t	resp_len;
90217 	/* The following tests were requested to be run. */
90218 	uint8_t	requested_tests;
90219 	/* A request was made to run the NVM test. */
90220 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_NVM_TEST		UINT32_C(0x1)
90221 	/* A request was made to run the link test. */
90222 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_LINK_TEST		UINT32_C(0x2)
90223 	/* A request was made to run the register test. */
90224 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_REGISTER_TEST		UINT32_C(0x4)
90225 	/* A request was made to run the memory test. */
90226 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_MEMORY_TEST		UINT32_C(0x8)
90227 	/* A request was made to run the PCIe serdes test. (deprecated) */
90228 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_PCIE_SERDES_TEST	UINT32_C(0x10)
90229 	/* A request was made to run the Ethernet serdes test. (deprecated) */
90230 	#define HWRM_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
90231 	/*
90232 	 * If a test was requested to be run as seen in the requested_tests
90233 	 * field, this bit indicates whether the test was successful(1) or
90234 	 * failed(0).
90235 	 */
90236 	uint8_t	test_success;
90237 	/*
90238 	 * If requested, a value of 1 indicates the NVM test completed
90239 	 * successfully.
90240 	 */
90241 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_NVM_TEST		UINT32_C(0x1)
90242 	/*
90243 	 * If requested, a value of 1 indicates the link test completed
90244 	 * successfully.
90245 	 */
90246 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_LINK_TEST		UINT32_C(0x2)
90247 	/*
90248 	 * If requested, a value of 1 indicates the register test completed
90249 	 * successfully.
90250 	 */
90251 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_REGISTER_TEST		UINT32_C(0x4)
90252 	/*
90253 	 * If requested, a value of 1 indicates the memory test completed
90254 	 * successfully.
90255 	 */
90256 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_MEMORY_TEST		UINT32_C(0x8)
90257 	/*
90258 	 * If requested, a value of 1 indicates the PCIe serdes test
90259 	 * completed successfully. (deprecated)
90260 	 */
90261 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_PCIE_SERDES_TEST	UINT32_C(0x10)
90262 	/*
90263 	 * If requested, a value of 1 indicates the Ethernet serdes test
90264 	 * completed successfully. (deprecated)
90265 	 */
90266 	#define HWRM_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
90267 	uint8_t	unused_0[5];
90268 	/*
90269 	 * This field is used in Output records to indicate that the output
90270 	 * is completely written to RAM. This field should be read as '1'
90271 	 * to indicate that the output has been completely written. When
90272 	 * writing a command completion or response to an internal processor,
90273 	 * the order of writes has to be such that this field is written last.
90274 	 */
90275 	uint8_t	valid;
90276 } hwrm_selftest_exec_output_t, *phwrm_selftest_exec_output_t;
90277 
90278 /*********************
90279  * hwrm_selftest_irq *
90280  *********************/
90281 
90282 
90283 /* hwrm_selftest_irq_input (size:128b/16B) */
90284 
90285 typedef struct hwrm_selftest_irq_input {
90286 	/* The HWRM command request type. */
90287 	uint16_t	req_type;
90288 	/*
90289 	 * The completion ring to send the completion event on. This should
90290 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
90291 	 */
90292 	uint16_t	cmpl_ring;
90293 	/*
90294 	 * The sequence ID is used by the driver for tracking multiple
90295 	 * commands. This ID is treated as opaque data by the firmware and
90296 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
90297 	 */
90298 	uint16_t	seq_id;
90299 	/*
90300 	 * The target ID of the command:
90301 	 * * 0x0-0xFFF8 - The function ID
90302 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
90303 	 * * 0xFFFD - Reserved for user-space HWRM interface
90304 	 * * 0xFFFF - HWRM
90305 	 */
90306 	uint16_t	target_id;
90307 	/*
90308 	 * A physical address pointer pointing to a host buffer that the
90309 	 * command's response data will be written. This can be either a host
90310 	 * physical address (HPA) or a guest physical address (GPA) and must
90311 	 * point to a physically contiguous block of memory.
90312 	 */
90313 	uint64_t	resp_addr;
90314 } hwrm_selftest_irq_input_t, *phwrm_selftest_irq_input_t;
90315 
90316 /* hwrm_selftest_irq_output (size:128b/16B) */
90317 
90318 typedef struct hwrm_selftest_irq_output {
90319 	/* The specific error status for the command. */
90320 	uint16_t	error_code;
90321 	/* The HWRM command request type. */
90322 	uint16_t	req_type;
90323 	/* The sequence ID from the original command. */
90324 	uint16_t	seq_id;
90325 	/* The length of the response data in number of bytes. */
90326 	uint16_t	resp_len;
90327 	uint8_t	unused_0[7];
90328 	/*
90329 	 * This field is used in Output records to indicate that the output
90330 	 * is completely written to RAM. This field should be read as '1'
90331 	 * to indicate that the output has been completely written. When
90332 	 * writing a command completion or response to an internal processor,
90333 	 * the order of writes has to be such that this field is written last.
90334 	 */
90335 	uint8_t	valid;
90336 } hwrm_selftest_irq_output_t, *phwrm_selftest_irq_output_t;
90337 
90338 /**************************************
90339  * hwrm_selftest_retrieve_serdes_data *
90340  **************************************/
90341 
90342 
90343 /* hwrm_selftest_retrieve_serdes_data_input (size:320b/40B) */
90344 
90345 typedef struct hwrm_selftest_retrieve_serdes_data_input {
90346 	/* The HWRM command request type. */
90347 	uint16_t	req_type;
90348 	/*
90349 	 * The completion ring to send the completion event on. This should
90350 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
90351 	 */
90352 	uint16_t	cmpl_ring;
90353 	/*
90354 	 * The sequence ID is used by the driver for tracking multiple
90355 	 * commands. This ID is treated as opaque data by the firmware and
90356 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
90357 	 */
90358 	uint16_t	seq_id;
90359 	/*
90360 	 * The target ID of the command:
90361 	 * * 0x0-0xFFF8 - The function ID
90362 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
90363 	 * * 0xFFFD - Reserved for user-space HWRM interface
90364 	 * * 0xFFFF - HWRM
90365 	 */
90366 	uint16_t	target_id;
90367 	/*
90368 	 * A physical address pointer pointing to a host buffer that the
90369 	 * command's response data will be written. This can be either a host
90370 	 * physical address (HPA) or a guest physical address (GPA) and must
90371 	 * point to a physically contiguous block of memory.
90372 	 */
90373 	uint64_t	resp_addr;
90374 	/* Host address data is to DMA'd to. */
90375 	uint64_t	resp_data_addr;
90376 	/*
90377 	 * This field contains the offset into the captured data to begin
90378 	 * copying the data to the host from. This should be set to 0 on the
90379 	 * initial call to this command.
90380 	 */
90381 	uint32_t	resp_data_offset;
90382 	/*
90383 	 * Size of the buffer pointed to by resp_data_addr. The firmware may
90384 	 * use this entire buffer or less than the entire buffer, but never
90385 	 * more.
90386 	 */
90387 	uint16_t	data_len;
90388 	/*
90389 	 * This field allows this command to request the individual serdes
90390 	 * tests to be run using this command.
90391 	 */
90392 	uint8_t	flags;
90393 	/* Unused. */
90394 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_FLAGS_UNUSED_TEST_MASK	UINT32_C(0x7)
90395 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_FLAGS_UNUSED_TEST_SFT	0
90396 	/* Display eye_projection */
90397 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_FLAGS_EYE_PROJECTION	UINT32_C(0x8)
90398 	/* Run the PCIe serdes test. */
90399 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_FLAGS_PCIE_SERDES_TEST	UINT32_C(0x10)
90400 	/* Run the Ethernet serdes test. */
90401 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_FLAGS_ETHERNET_SERDES_TEST	UINT32_C(0x20)
90402 	uint8_t	options;
90403 	/*
90404 	 * This field represents the PCIE lane number on which tools wants to
90405 	 * retrieve eye plot. This field is valid only when 'pcie_serdes_test'
90406 	 * flag is set.
90407 	 * Valid values from 0 to 16.
90408 	 */
90409 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PCIE_LANE_NO_MASK	UINT32_C(0xf)
90410 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PCIE_LANE_NO_SFT	0
90411 	/* This value indicates the Horizontal or vertical plot direction. */
90412 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_DIRECTION		UINT32_C(0x10)
90413 	/* Value 0 indicates Horizontal plot request. */
90414 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_DIRECTION_HORIZONTAL	(UINT32_C(0x0) << 4)
90415 	/* Value 1 indicates vertical plot request. */
90416 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_DIRECTION_VERTICAL	(UINT32_C(0x1) << 4)
90417 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_DIRECTION_LAST	HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_DIRECTION_VERTICAL
90418 	/* This value indicates eye projection type */
90419 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PROJ_TYPE		UINT32_C(0x20)
90420 	/*
90421 	 * Value 0 indicates left/top projection in horizontal/vertical
90422 	 * This value is valid only when eye_projection flag was set.
90423 	 */
90424 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PROJ_TYPE_LEFT_TOP	(UINT32_C(0x0) << 5)
90425 	/*
90426 	 * Value 1 indicates right/bottom projection in
90427 	 * horizontal/vertical. This value is valid only when
90428 	 * eye_projection flag was set.
90429 	 */
90430 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PROJ_TYPE_RIGHT_BOTTOM  (UINT32_C(0x1) << 5)
90431 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PROJ_TYPE_LAST	HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_PROJ_TYPE_RIGHT_BOTTOM
90432 	/* Reserved for future. */
90433 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_RSVD_MASK		UINT32_C(0xc0)
90434 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_OPTIONS_RSVD_SFT		6
90435 	/*
90436 	 * This field allows this command to request a specific targetBER
90437 	 * to be run using this command.
90438 	 */
90439 	uint8_t	targetBER;
90440 	/* When collecting an eyescope, measure with a target BER of 1e-8 */
90441 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_BER_1E8  UINT32_C(0x0)
90442 	/* When collecting an eyescope, measure with a target BER of 1e-9 */
90443 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_BER_1E9  UINT32_C(0x1)
90444 	/* When collecting an eyescope, measure with a target BER of 1e-10 */
90445 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_BER_1E10 UINT32_C(0x2)
90446 	/* When collecting an eyescope, measure with a target BER of 1e-11 */
90447 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_BER_1E11 UINT32_C(0x3)
90448 	/* When collecting an eyescope, measure with a target BER of 1e-12 */
90449 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_BER_1E12 UINT32_C(0x4)
90450 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_LAST	HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_TARGETBER_BER_1E12
90451 	/*
90452 	 * This field allows this command to specify the action to take when
90453 	 * collecting an eyescope.
90454 	 */
90455 	uint8_t	action;
90456 	/*
90457 	 * Value 0 indicates that collection of the eyescope should be
90458 	 * returned synchronously in the output. This only applies to
90459 	 * a targetBER of 1e-8.
90460 	 */
90461 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_ACTION_SYNCHRONOUS UINT32_C(0x0)
90462 	/*
90463 	 * Value 1 indicates to the firmware to start the collection of the
90464 	 * eyescope.
90465 	 */
90466 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_ACTION_START	UINT32_C(0x1)
90467 	/*
90468 	 * Value 2 indicates to the firmware to respond with a progress
90469 	 * percentage of the current eyescope collection from 0.0 to 100.0.
90470 	 */
90471 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_ACTION_PROGRESS	UINT32_C(0x2)
90472 	/*
90473 	 * Value 3 indicates to stop the eyescope. if the progress
90474 	 * percentage is 100.0, the data will be DMAed back to
90475 	 * resp_data_addr.
90476 	 */
90477 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_ACTION_STOP	UINT32_C(0x3)
90478 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_ACTION_LAST	HWRM_SELFTEST_RETRIEVE_SERDES_DATA_INPUT_ACTION_STOP
90479 	uint8_t	unused[6];
90480 } hwrm_selftest_retrieve_serdes_data_input_t, *phwrm_selftest_retrieve_serdes_data_input_t;
90481 
90482 /* hwrm_selftest_retrieve_serdes_data_output (size:192b/24B) */
90483 
90484 typedef struct hwrm_selftest_retrieve_serdes_data_output {
90485 	/* The specific error status for the command. */
90486 	uint16_t	error_code;
90487 	/* The HWRM command request type. */
90488 	uint16_t	req_type;
90489 	/* The sequence ID from the original command. */
90490 	uint16_t	seq_id;
90491 	/* The length of the response data in number of bytes. */
90492 	uint16_t	resp_len;
90493 	/* Total length of stored data. */
90494 	uint16_t	total_data_len;
90495 	/*
90496 	 * Amount of data DMA'd to host by this call. The driver can use this
90497 	 * field along with the total_data_len field above to determine the
90498 	 * value to write to the resp_data_offset field in the next call
90499 	 * if more than one call to these commands is required to retrieve all
90500 	 * the stored data.
90501 	 */
90502 	uint16_t	copied_data_len;
90503 	/*
90504 	 * Percentage of completion of collection of BER values from the
90505 	 * current eyescope operation in tenths of a percentage. 0 (0.0) to
90506 	 * 1000 (100.0).
90507 	 */
90508 	uint16_t	progress_percent;
90509 	/* Timeout in seconds for timeout of an individual BER point. */
90510 	uint16_t	timeout;
90511 	uint8_t	flags;
90512 	/*
90513 	 * This value indicates the structure of data returned by the
90514 	 * firmware when DMA'ed to resp_data_addr.
90515 	 */
90516 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_OUTPUT_FLAGS_BIT_COUNT_TYPE		UINT32_C(0x1)
90517 	/*
90518 	 * Value 0 indicates that bit_count value is a raw total
90519 	 * such that BER = error_count / bit_count.
90520 	 */
90521 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_OUTPUT_FLAGS_BIT_COUNT_TYPE_BIT_COUNT_TOTAL  UINT32_C(0x0)
90522 	/*
90523 	 * Value 1 indicates that bit count is a power of
90524 	 * 2 that bit_count is normalized to. A Value of 42 indicates
90525 	 * that BER = error_count / 2^42
90526 	 */
90527 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_OUTPUT_FLAGS_BIT_COUNT_TYPE_BIT_COUNT_POW2   UINT32_C(0x1)
90528 		#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_OUTPUT_FLAGS_BIT_COUNT_TYPE_LAST		HWRM_SELFTEST_RETRIEVE_SERDES_DATA_OUTPUT_FLAGS_BIT_COUNT_TYPE_BIT_COUNT_POW2
90529 	/* Reserved for future. */
90530 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_OUTPUT_FLAGS_RSVD_MASK			UINT32_C(0xfe)
90531 	#define HWRM_SELFTEST_RETRIEVE_SERDES_DATA_OUTPUT_FLAGS_RSVD_SFT			1
90532 	uint8_t	unused_0;
90533 	/*
90534 	 * Size of header prepended to the bit_count and error_count array.
90535 	 * Use this value to skip forward to the bit_count and error_count
90536 	 * array.
90537 	 */
90538 	uint16_t	hdr_size;
90539 	uint8_t	unused_1[3];
90540 	/*
90541 	 * This field is used in Output records to indicate that the output
90542 	 * is completely written to RAM. This field should be read as '1'
90543 	 * to indicate that the output has been completely written. When
90544 	 * writing a command completion or response to an internal processor,
90545 	 * the order of writes has to be such that this field is written last.
90546 	 */
90547 	uint8_t	valid;
90548 } hwrm_selftest_retrieve_serdes_data_output_t, *phwrm_selftest_retrieve_serdes_data_output_t;
90549 
90550 /******************************
90551  * hwrm_mfg_fru_write_control *
90552  ******************************/
90553 
90554 
90555 /* hwrm_mfg_fru_write_control_input (size:192b/24B) */
90556 
90557 typedef struct hwrm_mfg_fru_write_control_input {
90558 	/* The HWRM command request type. */
90559 	uint16_t	req_type;
90560 	/*
90561 	 * The completion ring to send the completion event on. This should
90562 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
90563 	 */
90564 	uint16_t	cmpl_ring;
90565 	/*
90566 	 * The sequence ID is used by the driver for tracking multiple
90567 	 * commands. This ID is treated as opaque data by the firmware and
90568 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
90569 	 */
90570 	uint16_t	seq_id;
90571 	/*
90572 	 * The target ID of the command:
90573 	 * * 0x0-0xFFF8 - The function ID
90574 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
90575 	 * * 0xFFFD - Reserved for user-space HWRM interface
90576 	 * * 0xFFFF - HWRM
90577 	 */
90578 	uint16_t	target_id;
90579 	/*
90580 	 * A physical address pointer pointing to a host buffer that the
90581 	 * command's response data will be written. This can be either a host
90582 	 * physical address (HPA) or a guest physical address (GPA) and must
90583 	 * point to a physically contiguous block of memory.
90584 	 */
90585 	uint64_t	resp_addr;
90586 	/*
90587 	 * This field indicates the lock/unlock operation. 0 means Unlock and
90588 	 * 1 means Lock.
90589 	 */
90590 	uint32_t	fru_lock;
90591 	uint32_t	unused_0;
90592 } hwrm_mfg_fru_write_control_input_t, *phwrm_mfg_fru_write_control_input_t;
90593 
90594 /* hwrm_mfg_fru_write_control_output (size:128b/16B) */
90595 
90596 typedef struct hwrm_mfg_fru_write_control_output {
90597 	/* The specific error status for the command. */
90598 	uint16_t	error_code;
90599 	/* The HWRM command request type. */
90600 	uint16_t	req_type;
90601 	/* The sequence ID from the original command. */
90602 	uint16_t	seq_id;
90603 	/* The length of the response data in number of bytes. */
90604 	uint16_t	resp_len;
90605 	uint8_t	unused_0[7];
90606 	/*
90607 	 * This field is used in Output records to indicate that the output
90608 	 * is completely written to RAM. This field should be read as '1'
90609 	 * to indicate that the output has been completely written. When
90610 	 * writing a command completion or response to an internal processor,
90611 	 * the order of writes has to be such that this field is written last.
90612 	 */
90613 	uint8_t	valid;
90614 } hwrm_mfg_fru_write_control_output_t, *phwrm_mfg_fru_write_control_output_t;
90615 
90616 /*************************
90617  * hwrm_mfg_timers_query *
90618  *************************/
90619 
90620 
90621 /* hwrm_mfg_timers_query_input (size:192b/24B) */
90622 
90623 typedef struct hwrm_mfg_timers_query_input {
90624 	/* The HWRM command request type. */
90625 	uint16_t	req_type;
90626 	/*
90627 	 * The completion ring to send the completion event on. This should
90628 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
90629 	 */
90630 	uint16_t	cmpl_ring;
90631 	/*
90632 	 * The sequence ID is used by the driver for tracking multiple
90633 	 * commands. This ID is treated as opaque data by the firmware and
90634 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
90635 	 */
90636 	uint16_t	seq_id;
90637 	/*
90638 	 * The target ID of the command:
90639 	 * * 0x0-0xFFF8 - The function ID
90640 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
90641 	 * * 0xFFFD - Reserved for user-space HWRM interface
90642 	 * * 0xFFFF - HWRM
90643 	 */
90644 	uint16_t	target_id;
90645 	/*
90646 	 * A physical address pointer pointing to a host buffer that the
90647 	 * command's response data will be written. This can be either a host
90648 	 * physical address (HPA) or a guest physical address (GPA) and must
90649 	 * point to a physically contiguous block of memory.
90650 	 */
90651 	uint64_t	resp_addr;
90652 	uint64_t	unused_0;
90653 } hwrm_mfg_timers_query_input_t, *phwrm_mfg_timers_query_input_t;
90654 
90655 /* hwrm_mfg_timers_query_output (size:192b/24B) */
90656 
90657 typedef struct hwrm_mfg_timers_query_output {
90658 	/* The specific error status for the command. */
90659 	uint16_t	error_code;
90660 	/* The HWRM command request type. */
90661 	uint16_t	req_type;
90662 	/* The sequence ID from the original command. */
90663 	uint16_t	seq_id;
90664 	/* The length of the response data in number of bytes. */
90665 	uint16_t	resp_len;
90666 	/*
90667 	 * This is free running counter value running at 1 usec per tick.
90668 	 * The value can wrap around. On error, a value of 0 on all ticks
90669 	 * will be returned.
90670 	 */
90671 	uint32_t	us_tick;
90672 	/*
90673 	 * This is free running counter value running at 1 msec per tick.
90674 	 * The value can wrap around. On error, a value of 0 on all ticks
90675 	 * will be returned.
90676 	 */
90677 	uint32_t	ms_tick;
90678 	/*
90679 	 * This is free running counter value running at 100 msec per tick.
90680 	 * The value can wrap around. On error, a value of 0 on all ticks
90681 	 * will be returned.
90682 	 */
90683 	uint32_t	ms100_tick;
90684 	uint8_t	unused_0[3];
90685 	/*
90686 	 * This field is used in Output records to indicate that the output
90687 	 * is completely written to RAM. This field should be read as '1'
90688 	 * to indicate that the output has been completely written. When
90689 	 * writing a command completion or response to an internal processor,
90690 	 * the order of writes has to be such that this field is written last.
90691 	 */
90692 	uint8_t	valid;
90693 } hwrm_mfg_timers_query_output_t, *phwrm_mfg_timers_query_output_t;
90694 
90695 /********************
90696  * hwrm_mfg_otp_cfg *
90697  ********************/
90698 
90699 
90700 /* hwrm_mfg_otp_cfg_input (size:256b/32B) */
90701 
90702 typedef struct hwrm_mfg_otp_cfg_input {
90703 	/* The HWRM command request type. */
90704 	uint16_t	req_type;
90705 	/*
90706 	 * The completion ring to send the completion event on. This should
90707 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
90708 	 */
90709 	uint16_t	cmpl_ring;
90710 	/*
90711 	 * The sequence ID is used by the driver for tracking multiple
90712 	 * commands. This ID is treated as opaque data by the firmware and
90713 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
90714 	 */
90715 	uint16_t	seq_id;
90716 	/*
90717 	 * The target ID of the command:
90718 	 * * 0x0-0xFFF8 - The function ID
90719 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
90720 	 * * 0xFFFD - Reserved for user-space HWRM interface
90721 	 * * 0xFFFF - HWRM
90722 	 */
90723 	uint16_t	target_id;
90724 	/*
90725 	 * A physical address pointer pointing to a host buffer that the
90726 	 * command's response data will be written. This can be either a host
90727 	 * physical address (HPA) or a guest physical address (GPA) and must
90728 	 * point to a physically contiguous block of memory.
90729 	 */
90730 	uint64_t	resp_addr;
90731 	uint16_t	enables;
90732 	/*
90733 	 * This bit must be '1' for the crid field to be
90734 	 * configured.
90735 	 */
90736 	#define HWRM_MFG_OTP_CFG_INPUT_ENABLES_CRID		UINT32_C(0x1)
90737 	/*
90738 	 * This bit must be '1' for the srt_rev_id field to be
90739 	 * configured.
90740 	 */
90741 	#define HWRM_MFG_OTP_CFG_INPUT_ENABLES_SRT_REV_ID	UINT32_C(0x2)
90742 	/*
90743 	 * This bit must be '1' for the crt_rev_id field to be
90744 	 * configured.
90745 	 */
90746 	#define HWRM_MFG_OTP_CFG_INPUT_ENABLES_CRT_REV_ID	UINT32_C(0x4)
90747 	/*
90748 	 * This bit must be '1' for the sbi_rev_id field to be
90749 	 * configured.
90750 	 */
90751 	#define HWRM_MFG_OTP_CFG_INPUT_ENABLES_SBI_REV_ID	UINT32_C(0x8)
90752 	/*
90753 	 * This bit must be '1' for the max_speed field to be
90754 	 * configured.
90755 	 */
90756 	#define HWRM_MFG_OTP_CFG_INPUT_ENABLES_MAX_SPEED_SELECT	UINT32_C(0x10)
90757 	/* This field indicates the crid value to be set. */
90758 	uint16_t	crid_cfg_value;
90759 	/* This field indicates the srt rev id value to be set. */
90760 	uint16_t	srt_rev_id_cfg_value;
90761 	/* This field indicates the crt rev id value to be set. */
90762 	uint16_t	crt_rev_id_cfg_value;
90763 	/* This field indicates the sbi rev id value to be set. */
90764 	uint16_t	sbi_rev_id_cfg_value;
90765 	/* This field indicates the max speed value to be set. */
90766 	uint16_t	max_speed_cfg_value;
90767 	/* max speed value not configured. */
90768 	#define HWRM_MFG_OTP_CFG_INPUT_MAX_SPEED_CFG_VALUE_NOT_CONFIGURED UINT32_C(0x0)
90769 	/* max speed value 50G. */
90770 	#define HWRM_MFG_OTP_CFG_INPUT_MAX_SPEED_CFG_VALUE_50G		UINT32_C(0x1)
90771 	/* max speed value 100G. */
90772 	#define HWRM_MFG_OTP_CFG_INPUT_MAX_SPEED_CFG_VALUE_100G	UINT32_C(0x2)
90773 	/* max speed value 200G. */
90774 	#define HWRM_MFG_OTP_CFG_INPUT_MAX_SPEED_CFG_VALUE_200G	UINT32_C(0x3)
90775 	#define HWRM_MFG_OTP_CFG_INPUT_MAX_SPEED_CFG_VALUE_LAST	HWRM_MFG_OTP_CFG_INPUT_MAX_SPEED_CFG_VALUE_200G
90776 	uint8_t	unused_0[4];
90777 } hwrm_mfg_otp_cfg_input_t, *phwrm_mfg_otp_cfg_input_t;
90778 
90779 /* hwrm_mfg_otp_cfg_output (size:128b/16B) */
90780 
90781 typedef struct hwrm_mfg_otp_cfg_output {
90782 	/* The specific error status for the command. */
90783 	uint16_t	error_code;
90784 	/* The HWRM command request type. */
90785 	uint16_t	req_type;
90786 	/* The sequence ID from the original command. */
90787 	uint16_t	seq_id;
90788 	/* The length of the response data in number of bytes. */
90789 	uint16_t	resp_len;
90790 	uint8_t	unused_0[7];
90791 	/*
90792 	 * This field is used in Output records to indicate that the output
90793 	 * is completely written to RAM. This field should be read as '1'
90794 	 * to indicate that the output has been completely written. When
90795 	 * writing a command completion or response to an internal processor,
90796 	 * the order of writes has to be such that this field is written last.
90797 	 */
90798 	uint8_t	valid;
90799 } hwrm_mfg_otp_cfg_output_t, *phwrm_mfg_otp_cfg_output_t;
90800 
90801 /*********************
90802  * hwrm_mfg_otp_qcfg *
90803  *********************/
90804 
90805 
90806 /* hwrm_mfg_otp_qcfg_input (size:192b/24B) */
90807 
90808 typedef struct hwrm_mfg_otp_qcfg_input {
90809 	/* The HWRM command request type. */
90810 	uint16_t	req_type;
90811 	/*
90812 	 * The completion ring to send the completion event on. This should
90813 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
90814 	 */
90815 	uint16_t	cmpl_ring;
90816 	/*
90817 	 * The sequence ID is used by the driver for tracking multiple
90818 	 * commands. This ID is treated as opaque data by the firmware and
90819 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
90820 	 */
90821 	uint16_t	seq_id;
90822 	/*
90823 	 * The target ID of the command:
90824 	 * * 0x0-0xFFF8 - The function ID
90825 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
90826 	 * * 0xFFFD - Reserved for user-space HWRM interface
90827 	 * * 0xFFFF - HWRM
90828 	 */
90829 	uint16_t	target_id;
90830 	/*
90831 	 * A physical address pointer pointing to a host buffer that the
90832 	 * command's response data will be written. This can be either a host
90833 	 * physical address (HPA) or a guest physical address (GPA) and must
90834 	 * point to a physically contiguous block of memory.
90835 	 */
90836 	uint64_t	resp_addr;
90837 	uint16_t	enables;
90838 	/*
90839 	 * This bit must be '1' for the crid field to be
90840 	 * queried.
90841 	 */
90842 	#define HWRM_MFG_OTP_QCFG_INPUT_ENABLES_CRID		UINT32_C(0x1)
90843 	/*
90844 	 * This bit must be '1' for the srt_rev_id field to be
90845 	 * queried.
90846 	 */
90847 	#define HWRM_MFG_OTP_QCFG_INPUT_ENABLES_SRT_REV_ID	UINT32_C(0x2)
90848 	/*
90849 	 * This bit must be '1' for the crt_rev_id field to be
90850 	 * queried.
90851 	 */
90852 	#define HWRM_MFG_OTP_QCFG_INPUT_ENABLES_CRT_REV_ID	UINT32_C(0x4)
90853 	/*
90854 	 * This bit must be '1' for the sbi_rev_id field to be
90855 	 * queried.
90856 	 */
90857 	#define HWRM_MFG_OTP_QCFG_INPUT_ENABLES_SBI_REV_ID	UINT32_C(0x8)
90858 	/*
90859 	 * This bit must be '1' for the max_speed field to be
90860 	 * queried.
90861 	 */
90862 	#define HWRM_MFG_OTP_QCFG_INPUT_ENABLES_MAX_SPEED_SELECT	UINT32_C(0x10)
90863 	uint8_t	unused_0[6];
90864 } hwrm_mfg_otp_qcfg_input_t, *phwrm_mfg_otp_qcfg_input_t;
90865 
90866 /* hwrm_mfg_otp_qcfg_output (size:256b/32B) */
90867 
90868 typedef struct hwrm_mfg_otp_qcfg_output {
90869 	/* The specific error status for the command. */
90870 	uint16_t	error_code;
90871 	/* The HWRM command request type. */
90872 	uint16_t	req_type;
90873 	/* The sequence ID from the original command. */
90874 	uint16_t	seq_id;
90875 	/* The length of the response data in number of bytes. */
90876 	uint16_t	resp_len;
90877 	/*
90878 	 * This field contains the value of current device type. The
90879 	 * value indicates the current chip mode (Unassigned/AB_PROD).
90880 	 */
90881 	uint32_t	enc_device_type;
90882 	/* This field indicates the current crid value. */
90883 	uint16_t	crid;
90884 	/* This field indicates the current srt rev id value. */
90885 	uint16_t	srt_rev_id;
90886 	/* This field indicates the current crt rev id value. */
90887 	uint16_t	crt_rev_id;
90888 	/* This field indicates the current sbi rev id value. */
90889 	uint16_t	sbi_rev_id;
90890 	/* This field indicates the current max speed value. */
90891 	uint16_t	max_speed;
90892 	/* max speed value not configured. */
90893 	#define HWRM_MFG_OTP_QCFG_OUTPUT_MAX_SPEED_NOT_CONFIGURED UINT32_C(0x0)
90894 	/* max speed value 50G. */
90895 	#define HWRM_MFG_OTP_QCFG_OUTPUT_MAX_SPEED_50G		UINT32_C(0x1)
90896 	/* max speed value 100G. */
90897 	#define HWRM_MFG_OTP_QCFG_OUTPUT_MAX_SPEED_100G	UINT32_C(0x2)
90898 	/* max speed value 200G. */
90899 	#define HWRM_MFG_OTP_QCFG_OUTPUT_MAX_SPEED_200G	UINT32_C(0x3)
90900 	#define HWRM_MFG_OTP_QCFG_OUTPUT_MAX_SPEED_LAST	HWRM_MFG_OTP_QCFG_OUTPUT_MAX_SPEED_200G
90901 	/* This field sets a bitmap for new enabled fields. */
90902 	uint16_t	enables_bitmap;
90903 	/* This bit checks max speed cfg enable. */
90904 	#define HWRM_MFG_OTP_QCFG_OUTPUT_ENABLES_BITMAP_MAX_SPEED	UINT32_C(0x10)
90905 	/* This bit validates this enable bitmap. */
90906 	#define HWRM_MFG_OTP_QCFG_OUTPUT_ENABLES_BITMAP_ENABLES_VALID	UINT32_C(0x8000)
90907 	uint8_t	unused_0[7];
90908 	/*
90909 	 * This field is used in Output records to indicate that the output
90910 	 * is completely written to RAM. This field should be read as '1'
90911 	 * to indicate that the output has been completely written. When
90912 	 * writing a command completion or response to an internal processor,
90913 	 * the order of writes has to be such that this field is written last.
90914 	 */
90915 	uint8_t	valid;
90916 } hwrm_mfg_otp_qcfg_output_t, *phwrm_mfg_otp_qcfg_output_t;
90917 
90918 /**********************
90919  * hwrm_mfg_hdma_test *
90920  **********************/
90921 
90922 
90923 /* hwrm_mfg_hdma_test_input (size:384b/48B) */
90924 
90925 typedef struct hwrm_mfg_hdma_test_input {
90926 	/* The HWRM command request type. */
90927 	uint16_t	req_type;
90928 	/*
90929 	 * The completion ring to send the completion event on. This should
90930 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
90931 	 */
90932 	uint16_t	cmpl_ring;
90933 	/*
90934 	 * The sequence ID is used by the driver for tracking multiple
90935 	 * commands. This ID is treated as opaque data by the firmware and
90936 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
90937 	 */
90938 	uint16_t	seq_id;
90939 	/*
90940 	 * The target ID of the command:
90941 	 * * 0x0-0xFFF8 - The function ID
90942 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
90943 	 * * 0xFFFD - Reserved for user-space HWRM interface
90944 	 * * 0xFFFF - HWRM
90945 	 */
90946 	uint16_t	target_id;
90947 	/*
90948 	 * A physical address pointer pointing to a host buffer that the
90949 	 * command's response data will be written. This can be either a host
90950 	 * physical address (HPA) or a guest physical address (GPA) and must
90951 	 * point to a physically contiguous block of memory.
90952 	 */
90953 	uint64_t	resp_addr;
90954 	/* The host (DMA) buffer physical addr for the firmware to read from. */
90955 	uint64_t	host_src_data_addr;
90956 	/* The host (DMA) buffer physical addr for the firmware to write to. */
90957 	uint64_t	host_dst_data_addr;
90958 	/*
90959 	 * The user provided data pattern which will be used in the DMA
90960 	 * transfer.
90961 	 */
90962 	uint64_t	user_data_pattern;
90963 	/* Timeout value to stop the test. */
90964 	uint16_t	timeout;
90965 	/* The number of DMA transfers to be done in the test. */
90966 	uint16_t	repeat_count;
90967 	/* Types can be any of "incremental", "fixed", or "random". */
90968 	uint16_t	subtype;
90969 	/* Test is run with the incremental data pattern. */
90970 	#define HWRM_MFG_HDMA_TEST_INPUT_SUBTYPE_INCREMENTAL UINT32_C(0x1)
90971 	/* Test is run with the fixed data pattern. */
90972 	#define HWRM_MFG_HDMA_TEST_INPUT_SUBTYPE_FIXED	UINT32_C(0x2)
90973 	/* Test is run with a random data pattern. */
90974 	#define HWRM_MFG_HDMA_TEST_INPUT_SUBTYPE_RANDOM	UINT32_C(0x3)
90975 	#define HWRM_MFG_HDMA_TEST_INPUT_SUBTYPE_LAST	HWRM_MFG_HDMA_TEST_INPUT_SUBTYPE_RANDOM
90976 	/* The length of the data used in the DMA transfers. */
90977 	uint16_t	data_len;
90978 } hwrm_mfg_hdma_test_input_t, *phwrm_mfg_hdma_test_input_t;
90979 
90980 /* hwrm_mfg_hdma_test_output (size:128b/16B) */
90981 
90982 typedef struct hwrm_mfg_hdma_test_output {
90983 	/* The specific error status for the command. */
90984 	uint16_t	error_code;
90985 	/* The HWRM command request type. */
90986 	uint16_t	req_type;
90987 	/* The sequence ID from the original command. */
90988 	uint16_t	seq_id;
90989 	/* The length of the response data in number of bytes. */
90990 	uint16_t	resp_len;
90991 	uint8_t	unused_0[7];
90992 	/*
90993 	 * This field is used in Output records to indicate that the output
90994 	 * is completely written to RAM. This field should be read as '1'
90995 	 * to indicate that the output has been completely written. When
90996 	 * writing a command completion or response to an internal processor,
90997 	 * the order of writes has to be such that this field is written last.
90998 	 */
90999 	uint8_t	valid;
91000 } hwrm_mfg_hdma_test_output_t, *phwrm_mfg_hdma_test_output_t;
91001 
91002 /*****************************
91003  * hwrm_mfg_fru_eeprom_write *
91004  *****************************/
91005 
91006 
91007 /* hwrm_mfg_fru_eeprom_write_input (size:256b/32B) */
91008 
91009 typedef struct hwrm_mfg_fru_eeprom_write_input {
91010 	/* The HWRM command request type. */
91011 	uint16_t	req_type;
91012 	/*
91013 	 * The completion ring to send the completion event on. This should
91014 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
91015 	 */
91016 	uint16_t	cmpl_ring;
91017 	/*
91018 	 * The sequence ID is used by the driver for tracking multiple
91019 	 * commands. This ID is treated as opaque data by the firmware and
91020 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
91021 	 */
91022 	uint16_t	seq_id;
91023 	/*
91024 	 * The target ID of the command:
91025 	 * * 0x0-0xFFF8 - The function ID
91026 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
91027 	 * * 0xFFFD - Reserved for user-space HWRM interface
91028 	 * * 0xFFFF - HWRM
91029 	 */
91030 	uint16_t	target_id;
91031 	/*
91032 	 * A physical address pointer pointing to a host buffer that the
91033 	 * command's response data will be written. This can be either a host
91034 	 * physical address (HPA) or a guest physical address (GPA) and must
91035 	 * point to a physically contiguous block of memory.
91036 	 */
91037 	uint64_t	resp_addr;
91038 	/*
91039 	 * The host (DMA) buffer physical addr for the firmware to read from.
91040 	 * This buffer is populated with the fru binary bits which is going
91041 	 * to be programmed into the fru memory.
91042 	 */
91043 	uint64_t	data_addr;
91044 	/* i2c slave address. If set to 0xffff, fw will decide what to use. */
91045 	uint16_t	i2c_slave_addr;
91046 	/* Size of the buffer pointed to by data_addr. */
91047 	uint16_t	data_len;
91048 	/* The offset within the SEEPROM to start programming. */
91049 	uint16_t	offset;
91050 	uint8_t	unused[2];
91051 } hwrm_mfg_fru_eeprom_write_input_t, *phwrm_mfg_fru_eeprom_write_input_t;
91052 
91053 /* hwrm_mfg_fru_eeprom_write_output (size:128b/16B) */
91054 
91055 typedef struct hwrm_mfg_fru_eeprom_write_output {
91056 	/* The specific error status for the command. */
91057 	uint16_t	error_code;
91058 	/* The HWRM command request type. */
91059 	uint16_t	req_type;
91060 	/* The sequence ID from the original command. */
91061 	uint16_t	seq_id;
91062 	/* The length of the response data in number of bytes. */
91063 	uint16_t	resp_len;
91064 	/* Total length of data written to the fru memory. */
91065 	uint16_t	total_data_len;
91066 	uint16_t	unused_0;
91067 	uint8_t	unused_1[3];
91068 	/*
91069 	 * This field is used in Output records to indicate that the output
91070 	 * is completely written to RAM. This field should be read as '1'
91071 	 * to indicate that the output has been completely written. When
91072 	 * writing a command completion or response to an internal processor,
91073 	 * the order of writes has to be such that this field is written last.
91074 	 */
91075 	uint8_t	valid;
91076 } hwrm_mfg_fru_eeprom_write_output_t, *phwrm_mfg_fru_eeprom_write_output_t;
91077 
91078 /****************************
91079  * hwrm_mfg_fru_eeprom_read *
91080  ****************************/
91081 
91082 
91083 /* hwrm_mfg_fru_eeprom_read_input (size:256b/32B) */
91084 
91085 typedef struct hwrm_mfg_fru_eeprom_read_input {
91086 	/* The HWRM command request type. */
91087 	uint16_t	req_type;
91088 	/*
91089 	 * The completion ring to send the completion event on. This should
91090 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
91091 	 */
91092 	uint16_t	cmpl_ring;
91093 	/*
91094 	 * The sequence ID is used by the driver for tracking multiple
91095 	 * commands. This ID is treated as opaque data by the firmware and
91096 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
91097 	 */
91098 	uint16_t	seq_id;
91099 	/*
91100 	 * The target ID of the command:
91101 	 * * 0x0-0xFFF8 - The function ID
91102 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
91103 	 * * 0xFFFD - Reserved for user-space HWRM interface
91104 	 * * 0xFFFF - HWRM
91105 	 */
91106 	uint16_t	target_id;
91107 	/*
91108 	 * A physical address pointer pointing to a host buffer that the
91109 	 * command's response data will be written. This can be either a host
91110 	 * physical address (HPA) or a guest physical address (GPA) and must
91111 	 * point to a physically contiguous block of memory.
91112 	 */
91113 	uint64_t	resp_addr;
91114 	/*
91115 	 * The host (DMA) buffer physical addr for the firmware to write to.
91116 	 * This buffer is populated with the fru binary bits which is going
91117 	 * to be read from the fru memory.
91118 	 */
91119 	uint64_t	data_addr;
91120 	/* i2c slave address. If set to 0xffff, fw will decide what to use. */
91121 	uint16_t	i2c_slave_addr;
91122 	/*
91123 	 * Size of the buffer pointed to by data_addr. The firmware may
91124 	 * use this entire buffer or less than the entire buffer, but never
91125 	 * more.
91126 	 */
91127 	uint16_t	data_len;
91128 	/* The offset within the SEEPROM to start reading. */
91129 	uint16_t	offset;
91130 	uint8_t	unused[2];
91131 } hwrm_mfg_fru_eeprom_read_input_t, *phwrm_mfg_fru_eeprom_read_input_t;
91132 
91133 /* hwrm_mfg_fru_eeprom_read_output (size:128b/16B) */
91134 
91135 typedef struct hwrm_mfg_fru_eeprom_read_output {
91136 	/* The specific error status for the command. */
91137 	uint16_t	error_code;
91138 	/* The HWRM command request type. */
91139 	uint16_t	req_type;
91140 	/* The sequence ID from the original command. */
91141 	uint16_t	seq_id;
91142 	/* The length of the response data in number of bytes. */
91143 	uint16_t	resp_len;
91144 	/* Total length of data written to the host memory. */
91145 	uint16_t	total_data_len;
91146 	uint16_t	unused_0;
91147 	uint8_t	unused_1[3];
91148 	/*
91149 	 * This field is used in Output records to indicate that the output
91150 	 * is completely written to RAM. This field should be read as '1'
91151 	 * to indicate that the output has been completely written. When
91152 	 * writing a command completion or response to an internal processor,
91153 	 * the order of writes has to be such that this field is written last.
91154 	 */
91155 	uint8_t	valid;
91156 } hwrm_mfg_fru_eeprom_read_output_t, *phwrm_mfg_fru_eeprom_read_output_t;
91157 
91158 /**********************
91159  * hwrm_mfg_soc_image *
91160  **********************/
91161 
91162 
91163 /* hwrm_mfg_soc_image_input (size:512b/64B) */
91164 
91165 typedef struct hwrm_mfg_soc_image_input {
91166 	/* The HWRM command request type. */
91167 	uint16_t	req_type;
91168 	/*
91169 	 * The completion ring to send the completion event on. This should
91170 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
91171 	 */
91172 	uint16_t	cmpl_ring;
91173 	/*
91174 	 * The sequence ID is used by the driver for tracking multiple
91175 	 * commands. This ID is treated as opaque data by the firmware and
91176 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
91177 	 */
91178 	uint16_t	seq_id;
91179 	/*
91180 	 * The target ID of the command:
91181 	 * * 0x0-0xFFF8 - The function ID
91182 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
91183 	 * * 0xFFFD - Reserved for user-space HWRM interface
91184 	 * * 0xFFFF - HWRM
91185 	 */
91186 	uint16_t	target_id;
91187 	/*
91188 	 * A physical address pointer pointing to a host buffer that the
91189 	 * command's response data will be written. This can be either a host
91190 	 * physical address (HPA) or a guest physical address (GPA) and must
91191 	 * point to a physically contiguous block of memory.
91192 	 */
91193 	uint64_t	resp_addr;
91194 	/*
91195 	 * TBD. Work in progress.
91196 	 * This field is the signature value used by SoC UEFI.
91197 	 */
91198 	uint32_t	image_signature;
91199 	/*
91200 	 * TBD. Work in progress.
91201 	 * This field is unused for now.
91202 	 */
91203 	uint32_t	image_type;
91204 	/*
91205 	 * The offset within the image content that is being provided by the
91206 	 * current invocation of this HWRM command. The primate firmware does
91207 	 * not offer any score boarding services to ensure entire image
91208 	 * content is transferred, it is the responsibility of the caller to
91209 	 * ensure image consistency.
91210 	 */
91211 	uint32_t	image_offset;
91212 	/*
91213 	 * Size in bytes for the image content. The maximum value this field
91214 	 * can specify is 4096.
91215 	 */
91216 	uint32_t	image_length;
91217 	/*
91218 	 * Address in host memory where the image content is located. This
91219 	 * location should be 4KB aligned.
91220 	 */
91221 	uint64_t	host_src_addr;
91222 	/*
91223 	 * Address in SoC address space where the provided image content is
91224 	 * to be copied. Primate firmware will copy the image content from
91225 	 * host memory to this location. If the image size is more than the
91226 	 * maximum size that can be transferred with each invocation of this
91227 	 * command, then this address should be updated by the caller for
91228 	 * each invocation to copy the full image.
91229 	 */
91230 	uint64_t	soc_dest_addr;
91231 	/*
91232 	 * Indicates the entrypoint in the image that should be used. This
91233 	 * field is optional. When set to 0, the SoC will determine the
91234 	 * entrypoint on its own.
91235 	 */
91236 	uint32_t	entrypoint_offset;
91237 	uint32_t	flags;
91238 	/*
91239 	 * This bit should be set to '1' only when an image transfer is
91240 	 * being initiated for each unique image_signature.
91241 	 */
91242 	#define HWRM_MFG_SOC_IMAGE_INPUT_FLAGS_START	UINT32_C(0x1)
91243 	/*
91244 	 * This bit should be set to '1' only when an image transfer for a
91245 	 * given image_signature is complete.
91246 	 */
91247 	#define HWRM_MFG_SOC_IMAGE_INPUT_FLAGS_END	UINT32_C(0x2)
91248 	/*
91249 	 * An incrementing number starting with 1 for each invocation of this
91250 	 * HWRM command for any given image_id. No two invocation of this
91251 	 * command for a given image_id shall carry the same seq_number. Each
91252 	 * consecutive invocation of this command for any given image_id
91253 	 * shall increment this number by 1. The value 0 is used when
91254 	 * seq_number is invalid when no image content is being moved.
91255 	 */
91256 	uint32_t	seq_number;
91257 	/*  */
91258 	uint32_t	reserved1;
91259 } hwrm_mfg_soc_image_input_t, *phwrm_mfg_soc_image_input_t;
91260 
91261 /* hwrm_mfg_soc_image_output (size:128b/16B) */
91262 
91263 typedef struct hwrm_mfg_soc_image_output {
91264 	/* The specific error status for the command. */
91265 	uint16_t	error_code;
91266 	/* The HWRM command request type. */
91267 	uint16_t	req_type;
91268 	/* The sequence ID from the original command. */
91269 	uint16_t	seq_id;
91270 	/* The length of the response data in number of bytes. */
91271 	uint16_t	resp_len;
91272 	uint8_t	unused_1[7];
91273 	/*
91274 	 * This field is used in Output records to indicate that the output
91275 	 * is completely written to RAM. This field should be read as '1'
91276 	 * to indicate that the output has been completely written.
91277 	 * When writing a command completion or response to an internal
91278 	 * processor, the order of writes has to be such that this field is
91279 	 * written last.
91280 	 */
91281 	uint8_t	valid;
91282 } hwrm_mfg_soc_image_output_t, *phwrm_mfg_soc_image_output_t;
91283 
91284 /************************
91285  * hwrm_mfg_soc_qstatus *
91286  ************************/
91287 
91288 
91289 /* hwrm_mfg_soc_qstatus_input (size:192b/24B) */
91290 
91291 typedef struct hwrm_mfg_soc_qstatus_input {
91292 	/* The HWRM command request type. */
91293 	uint16_t	req_type;
91294 	/*
91295 	 * The completion ring to send the completion event on. This should
91296 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
91297 	 */
91298 	uint16_t	cmpl_ring;
91299 	/*
91300 	 * The sequence ID is used by the driver for tracking multiple
91301 	 * commands. This ID is treated as opaque data by the firmware and
91302 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
91303 	 */
91304 	uint16_t	seq_id;
91305 	/*
91306 	 * The target ID of the command:
91307 	 * * 0x0-0xFFF8 - The function ID
91308 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
91309 	 * * 0xFFFD - Reserved for user-space HWRM interface
91310 	 * * 0xFFFF - HWRM
91311 	 */
91312 	uint16_t	target_id;
91313 	/*
91314 	 * A physical address pointer pointing to a host buffer that the
91315 	 * command's response data will be written. This can be either a host
91316 	 * physical address (HPA) or a guest physical address (GPA) and must
91317 	 * point to a physically contiguous block of memory.
91318 	 */
91319 	uint64_t	resp_addr;
91320 	/*  */
91321 	uint32_t	reserved1;
91322 	/*  */
91323 	uint32_t	reserved2;
91324 } hwrm_mfg_soc_qstatus_input_t, *phwrm_mfg_soc_qstatus_input_t;
91325 
91326 /* hwrm_mfg_soc_qstatus_output (size:576b/72B) */
91327 
91328 typedef struct hwrm_mfg_soc_qstatus_output {
91329 	/* The specific error status for the command. */
91330 	uint16_t	error_code;
91331 	/* The HWRM command request type. */
91332 	uint16_t	req_type;
91333 	/* The sequence ID from the original command. */
91334 	uint16_t	seq_id;
91335 	/* The length of the response data in number of bytes. */
91336 	uint16_t	resp_len;
91337 	/*
91338 	 * This field describes capabilities of primate firmware for SoC
91339 	 * image.
91340 	 */
91341 	uint32_t	primate_flags;
91342 	/*  */
91343 	uint32_t	reserved1;
91344 	/* This field contains the current content of the AP_STATUS register. */
91345 	uint32_t	ap_status;
91346 	/*
91347 	 * This field contains the current content of the CRMU_STATUS
91348 	 * register.
91349 	 */
91350 	uint32_t	crmu_status;
91351 	/*
91352 	 * If an image provision operation is in process, this field will
91353 	 * provide information on requested image signature else the contents
91354 	 * are undefined.
91355 	 */
91356 	uint32_t	image_signature;
91357 	/*
91358 	 * If an image provision operation is in process, this field will
91359 	 * provide information on requested image command else the contents
91360 	 * are undefined.
91361 	 */
91362 	uint32_t	image_command;
91363 	/*
91364 	 * If an image provision operation is in process, this field will
91365 	 * provide the requested image name else the contents are undefined.
91366 	 */
91367 	uint8_t	image_name[32];
91368 	uint8_t	unused_1[7];
91369 	/*
91370 	 * This field is used in Output records to indicate that the output
91371 	 * is completely written to RAM. This field should be read as '1'
91372 	 * to indicate that the output has been completely written.
91373 	 * When writing a command completion or response to an internal
91374 	 * processor, the order of writes has to be such that this field is
91375 	 * written last.
91376 	 */
91377 	uint8_t	valid;
91378 } hwrm_mfg_soc_qstatus_output_t, *phwrm_mfg_soc_qstatus_output_t;
91379 
91380 /*****************************************
91381  * hwrm_mfg_param_critical_data_finalize *
91382  *****************************************/
91383 
91384 
91385 /* hwrm_mfg_param_critical_data_finalize_input (size:192b/24B) */
91386 
91387 typedef struct hwrm_mfg_param_critical_data_finalize_input {
91388 	/* The HWRM command request type. */
91389 	uint16_t	req_type;
91390 	/*
91391 	 * The completion ring to send the completion event on. This should
91392 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
91393 	 */
91394 	uint16_t	cmpl_ring;
91395 	/*
91396 	 * The sequence ID is used by the driver for tracking multiple
91397 	 * commands. This ID is treated as opaque data by the firmware and
91398 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
91399 	 */
91400 	uint16_t	seq_id;
91401 	/*
91402 	 * The target ID of the command:
91403 	 * * 0x0-0xFFF8 - The function ID
91404 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
91405 	 * * 0xFFFD - Reserved for user-space HWRM interface
91406 	 * * 0xFFFF - HWRM
91407 	 */
91408 	uint16_t	target_id;
91409 	/*
91410 	 * A physical address pointer pointing to a host buffer that the
91411 	 * command's response data will be written. This can be either a host
91412 	 * physical address (HPA) or a guest physical address (GPA) and must
91413 	 * point to a physically contiguous block of memory.
91414 	 */
91415 	uint64_t	resp_addr;
91416 	uint16_t	flags;
91417 	/*
91418 	 * Set to 1 if you wish to unlock and erase the region
91419 	 * before finalizing the data.
91420 	 */
91421 	#define HWRM_MFG_PARAM_CRITICAL_DATA_FINALIZE_INPUT_FLAGS_FORCE	UINT32_C(0x1)
91422 	uint16_t	unused_0;
91423 	uint32_t	unused_1;
91424 } hwrm_mfg_param_critical_data_finalize_input_t, *phwrm_mfg_param_critical_data_finalize_input_t;
91425 
91426 /* hwrm_mfg_param_critical_data_finalize_output (size:128b/16B) */
91427 
91428 typedef struct hwrm_mfg_param_critical_data_finalize_output {
91429 	/* The specific error status for the command. */
91430 	uint16_t	error_code;
91431 	/* The HWRM command request type. */
91432 	uint16_t	req_type;
91433 	/* The sequence ID from the original command. */
91434 	uint16_t	seq_id;
91435 	/* The length of the response data in number of bytes. */
91436 	uint16_t	resp_len;
91437 	/* Total length of data finalized. */
91438 	uint32_t	total_data_len;
91439 	uint16_t	error_status;
91440 	/* Critical data region was already locked */
91441 	#define HWRM_MFG_PARAM_CRITICAL_DATA_FINALIZE_OUTPUT_ERROR_STATUS_ALREADY_LOCKED	UINT32_C(0x1)
91442 	/* Flash region was not entirely empty */
91443 	#define HWRM_MFG_PARAM_CRITICAL_DATA_FINALIZE_OUTPUT_ERROR_STATUS_NOT_EMPTY		UINT32_C(0x2)
91444 	/* FACT_CFG was missing for write to critical cfg */
91445 	#define HWRM_MFG_PARAM_CRITICAL_DATA_FINALIZE_OUTPUT_ERROR_STATUS_MISSING_FACT_CFG	UINT32_C(0x4)
91446 	/* VPD was missing for write to critical cfg */
91447 	#define HWRM_MFG_PARAM_CRITICAL_DATA_FINALIZE_OUTPUT_ERROR_STATUS_MISSING_VPD	UINT32_C(0x8)
91448 	uint8_t	unused_1;
91449 	/*
91450 	 * This field is used in Output records to indicate that the output
91451 	 * is completely written to RAM. This field should be read as '1'
91452 	 * to indicate that the output has been completely written. When
91453 	 * writing a command completion or response to an internal processor,
91454 	 * the order of writes has to be such that this field is written last.
91455 	 */
91456 	uint8_t	valid;
91457 } hwrm_mfg_param_critical_data_finalize_output_t, *phwrm_mfg_param_critical_data_finalize_output_t;
91458 
91459 /*************************************
91460  * hwrm_mfg_param_critical_data_read *
91461  *************************************/
91462 
91463 
91464 /* hwrm_mfg_param_critical_data_read_input (size:256b/32B) */
91465 
91466 typedef struct hwrm_mfg_param_critical_data_read_input {
91467 	/* The HWRM command request type. */
91468 	uint16_t	req_type;
91469 	/*
91470 	 * The completion ring to send the completion event on. This should
91471 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
91472 	 */
91473 	uint16_t	cmpl_ring;
91474 	/*
91475 	 * The sequence ID is used by the driver for tracking multiple
91476 	 * commands. This ID is treated as opaque data by the firmware and
91477 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
91478 	 */
91479 	uint16_t	seq_id;
91480 	/*
91481 	 * The target ID of the command:
91482 	 * * 0x0-0xFFF8 - The function ID
91483 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
91484 	 * * 0xFFFD - Reserved for user-space HWRM interface
91485 	 * * 0xFFFF - HWRM
91486 	 */
91487 	uint16_t	target_id;
91488 	/*
91489 	 * A physical address pointer pointing to a host buffer that the
91490 	 * command's response data will be written. This can be either a host
91491 	 * physical address (HPA) or a guest physical address (GPA) and must
91492 	 * point to a physically contiguous block of memory.
91493 	 */
91494 	uint64_t	resp_addr;
91495 	/*
91496 	 * The host (DMA) buffer physical addr for the firmware to write to.
91497 	 * This buffer is populated with data read from the
91498 	 * critical data storage location.
91499 	 */
91500 	uint64_t	data_addr;
91501 	/*
91502 	 * Size of the buffer pointed to by data_addr. The firmware may
91503 	 * use this entire buffer or less than the entire buffer, but never
91504 	 * more.
91505 	 */
91506 	uint32_t	data_len;
91507 	/* The offset within the critical data to start reading. */
91508 	uint32_t	offset;
91509 } hwrm_mfg_param_critical_data_read_input_t, *phwrm_mfg_param_critical_data_read_input_t;
91510 
91511 /* hwrm_mfg_param_critical_data_read_output (size:128b/16B) */
91512 
91513 typedef struct hwrm_mfg_param_critical_data_read_output {
91514 	/* The specific error status for the command. */
91515 	uint16_t	error_code;
91516 	/* The HWRM command request type. */
91517 	uint16_t	req_type;
91518 	/* The sequence ID from the original command. */
91519 	uint16_t	seq_id;
91520 	/* The length of the response data in number of bytes. */
91521 	uint16_t	resp_len;
91522 	/* Total length of data written to the host memory. */
91523 	uint32_t	total_data_len;
91524 	uint16_t	unused_0;
91525 	uint8_t	unused_1;
91526 	/*
91527 	 * This field is used in Output records to indicate that the output
91528 	 * is completely written to RAM. This field should be read as '1'
91529 	 * to indicate that the output has been completely written. When
91530 	 * writing a command completion or response to an internal processor,
91531 	 * the order of writes has to be such that this field is written last.
91532 	 */
91533 	uint8_t	valid;
91534 } hwrm_mfg_param_critical_data_read_output_t, *phwrm_mfg_param_critical_data_read_output_t;
91535 
91536 /***************************************
91537  * hwrm_mfg_param_critical_data_health *
91538  ***************************************/
91539 
91540 
91541 /* hwrm_mfg_param_critical_data_health_input (size:192b/24B) */
91542 
91543 typedef struct hwrm_mfg_param_critical_data_health_input {
91544 	/* The HWRM command request type. */
91545 	uint16_t	req_type;
91546 	/*
91547 	 * The completion ring to send the completion event on. This should
91548 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
91549 	 */
91550 	uint16_t	cmpl_ring;
91551 	/*
91552 	 * The sequence ID is used by the driver for tracking multiple
91553 	 * commands. This ID is treated as opaque data by the firmware and
91554 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
91555 	 */
91556 	uint16_t	seq_id;
91557 	/*
91558 	 * The target ID of the command:
91559 	 * * 0x0-0xFFF8 - The function ID
91560 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
91561 	 * * 0xFFFD - Reserved for user-space HWRM interface
91562 	 * * 0xFFFF - HWRM
91563 	 */
91564 	uint16_t	target_id;
91565 	/*
91566 	 * A physical address pointer pointing to a host buffer that the
91567 	 * command's response data will be written. This can be either a host
91568 	 * physical address (HPA) or a guest physical address (GPA) and must
91569 	 * point to a physically contiguous block of memory.
91570 	 */
91571 	uint64_t	resp_addr;
91572 	uint64_t	unused_0;
91573 } hwrm_mfg_param_critical_data_health_input_t, *phwrm_mfg_param_critical_data_health_input_t;
91574 
91575 /* hwrm_mfg_param_critical_data_health_output (size:128b/16B) */
91576 
91577 typedef struct hwrm_mfg_param_critical_data_health_output {
91578 	/* The specific error status for the command. */
91579 	uint16_t	error_code;
91580 	/* The HWRM command request type. */
91581 	uint16_t	req_type;
91582 	/* The sequence ID from the original command. */
91583 	uint16_t	seq_id;
91584 	/* The length of the response data in number of bytes. */
91585 	uint16_t	resp_len;
91586 	uint32_t	health_status;
91587 	/* region entirely empty */
91588 	#define HWRM_MFG_PARAM_CRITICAL_DATA_HEALTH_OUTPUT_HEALTH_STATUS_IS_EMPTY	UINT32_C(0x1)
91589 	/* Data checksum fail */
91590 	#define HWRM_MFG_PARAM_CRITICAL_DATA_HEALTH_OUTPUT_HEALTH_STATUS_CHECKSUM_FAIL	UINT32_C(0x2)
91591 	/* Malformed data (header/footer) */
91592 	#define HWRM_MFG_PARAM_CRITICAL_DATA_HEALTH_OUTPUT_HEALTH_STATUS_MALFORMED_DATA	UINT32_C(0x4)
91593 	/* Critical data not locked */
91594 	#define HWRM_MFG_PARAM_CRITICAL_DATA_HEALTH_OUTPUT_HEALTH_STATUS_NOT_LOCKED	UINT32_C(0x8)
91595 	uint16_t	unused_1;
91596 	uint8_t	unused_2;
91597 	/*
91598 	 * This field is used in Output records to indicate that the output
91599 	 * is completely written to RAM. This field should be read as '1'
91600 	 * to indicate that the output has been completely written. When
91601 	 * writing a command completion or response to an internal processor,
91602 	 * the order of writes has to be such that this field is written last.
91603 	 */
91604 	uint8_t	valid;
91605 } hwrm_mfg_param_critical_data_health_output_t, *phwrm_mfg_param_critical_data_health_output_t;
91606 
91607 /*****************************
91608  * hwrm_mfg_prvsn_export_csr *
91609  *****************************/
91610 
91611 
91612 /* hwrm_mfg_prvsn_export_csr_input (size:256b/32B) */
91613 
91614 typedef struct hwrm_mfg_prvsn_export_csr_input {
91615 	/* The HWRM command request type. */
91616 	uint16_t	req_type;
91617 	/*
91618 	 * The completion ring to send the completion event on. This should
91619 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
91620 	 */
91621 	uint16_t	cmpl_ring;
91622 	/*
91623 	 * The sequence ID is used by the driver for tracking multiple
91624 	 * commands. This ID is treated as opaque data by the firmware and
91625 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
91626 	 */
91627 	uint16_t	seq_id;
91628 	/*
91629 	 * The target ID of the command:
91630 	 * * 0x0-0xFFF8 - The function ID
91631 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
91632 	 * * 0xFFFD - Reserved for user-space HWRM interface
91633 	 * * 0xFFFF - HWRM
91634 	 */
91635 	uint16_t	target_id;
91636 	/*
91637 	 * A physical address pointer pointing to a host buffer that the
91638 	 * command's response data will be written. This can be either a host
91639 	 * physical address (HPA) or a guest physical address (GPA) and must
91640 	 * point to a physically contiguous block of memory.
91641 	 */
91642 	uint64_t	resp_addr;
91643 	/*
91644 	 * 64-bit Host destination address. This is the host address where
91645 	 * data will be written.
91646 	 */
91647 	uint64_t	host_dest_addr;
91648 	/* Provisioning slot number. 0-indexed. */
91649 	uint8_t	slot;
91650 	uint8_t	unused_0;
91651 	/* Size in bytes of the available host buffer. */
91652 	uint16_t	host_buf_len;
91653 	uint8_t	flags;
91654 	/*
91655 	 * This bit is only used when external secure SoC is used for
91656 	 * secure boot. If this bit is set, export a certificate signing
91657 	 * request (CSR) from the security SoC non-volatile storage on
91658 	 * the device.
91659 	 */
91660 	#define HWRM_MFG_PRVSN_EXPORT_CSR_INPUT_FLAGS_SECURE_SOC_SUPPORT	UINT32_C(0x1)
91661 	uint8_t	unused_1[3];
91662 } hwrm_mfg_prvsn_export_csr_input_t, *phwrm_mfg_prvsn_export_csr_input_t;
91663 
91664 /* hwrm_mfg_prvsn_export_csr_output (size:128b/16B) */
91665 
91666 typedef struct hwrm_mfg_prvsn_export_csr_output {
91667 	/* The specific error status for the command. */
91668 	uint16_t	error_code;
91669 	/* The HWRM command request type. */
91670 	uint16_t	req_type;
91671 	/* The sequence ID from the original command. */
91672 	uint16_t	seq_id;
91673 	/* The length of the response data in number of bytes. */
91674 	uint16_t	resp_len;
91675 	/* Provisioning slot number. 0-indexed. */
91676 	uint8_t	slot;
91677 	uint8_t	unused_0;
91678 	/* Size in bytes of the exported CSR. */
91679 	uint16_t	csr_len;
91680 	uint8_t	unused_1[3];
91681 	/*
91682 	 * This field is used in Output records to indicate that the output
91683 	 * is completely written to RAM. This field should be read as '1'
91684 	 * to indicate that the output has been completely written.
91685 	 * When writing a command completion or response to an internal
91686 	 * processor, the order of writes has to be such that this field is
91687 	 * written last.
91688 	 */
91689 	uint8_t	valid;
91690 } hwrm_mfg_prvsn_export_csr_output_t, *phwrm_mfg_prvsn_export_csr_output_t;
91691 
91692 /* hwrm_mfg_prvsn_export_csr_cmd_err (size:64b/8B) */
91693 
91694 typedef struct hwrm_mfg_prvsn_export_csr_cmd_err {
91695 	/*
91696 	 * command specific error codes that goes to
91697 	 * the cmd_err field in Common HWRM Error Response.
91698 	 */
91699 	uint8_t	code;
91700 	/* Unknown error. */
91701 	#define HWRM_MFG_PRVSN_EXPORT_CSR_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
91702 	/* Slot invalid */
91703 	#define HWRM_MFG_PRVSN_EXPORT_CSR_CMD_ERR_CODE_SLOT_INVALID  UINT32_C(0x1)
91704 	/* Host provided buffer is too small */
91705 	#define HWRM_MFG_PRVSN_EXPORT_CSR_CMD_ERR_CODE_BUFFER_LENGTH UINT32_C(0x2)
91706 	#define HWRM_MFG_PRVSN_EXPORT_CSR_CMD_ERR_CODE_LAST	HWRM_MFG_PRVSN_EXPORT_CSR_CMD_ERR_CODE_BUFFER_LENGTH
91707 	uint8_t	unused_0[7];
91708 } hwrm_mfg_prvsn_export_csr_cmd_err_t, *phwrm_mfg_prvsn_export_csr_cmd_err_t;
91709 
91710 /******************************
91711  * hwrm_mfg_prvsn_import_cert *
91712  ******************************/
91713 
91714 
91715 /* hwrm_mfg_prvsn_import_cert_input (size:256b/32B) */
91716 
91717 typedef struct hwrm_mfg_prvsn_import_cert_input {
91718 	/* The HWRM command request type. */
91719 	uint16_t	req_type;
91720 	/*
91721 	 * The completion ring to send the completion event on. This should
91722 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
91723 	 */
91724 	uint16_t	cmpl_ring;
91725 	/*
91726 	 * The sequence ID is used by the driver for tracking multiple
91727 	 * commands. This ID is treated as opaque data by the firmware and
91728 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
91729 	 */
91730 	uint16_t	seq_id;
91731 	/*
91732 	 * The target ID of the command:
91733 	 * * 0x0-0xFFF8 - The function ID
91734 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
91735 	 * * 0xFFFD - Reserved for user-space HWRM interface
91736 	 * * 0xFFFF - HWRM
91737 	 */
91738 	uint16_t	target_id;
91739 	/*
91740 	 * A physical address pointer pointing to a host buffer that the
91741 	 * command's response data will be written. This can be either a host
91742 	 * physical address (HPA) or a guest physical address (GPA) and must
91743 	 * point to a physically contiguous block of memory.
91744 	 */
91745 	uint64_t	resp_addr;
91746 	/*
91747 	 * 64-bit Host source address. This is the host address where
91748 	 * source data is located.
91749 	 */
91750 	uint64_t	host_src_addr;
91751 	/* Provisioning slot number. 0-indexed. */
91752 	uint8_t	slot;
91753 	uint8_t	unused_0;
91754 	/* Size in bytes of the certificate chain. */
91755 	uint16_t	cert_len;
91756 	uint8_t	flags;
91757 	/*
91758 	 * This bit is only used when external secure SoC is used for
91759 	 * secure boot. If this bit is set, then import a HSM-signed
91760 	 * certificate chain to security SoC non-volatile storage on
91761 	 * the device.
91762 	 */
91763 	#define HWRM_MFG_PRVSN_IMPORT_CERT_INPUT_FLAGS_SECURE_SOC_SUPPORT	UINT32_C(0x1)
91764 	uint8_t	unused_1[3];
91765 } hwrm_mfg_prvsn_import_cert_input_t, *phwrm_mfg_prvsn_import_cert_input_t;
91766 
91767 /* hwrm_mfg_prvsn_import_cert_output (size:128b/16B) */
91768 
91769 typedef struct hwrm_mfg_prvsn_import_cert_output {
91770 	/* The specific error status for the command. */
91771 	uint16_t	error_code;
91772 	/* The HWRM command request type. */
91773 	uint16_t	req_type;
91774 	/* The sequence ID from the original command. */
91775 	uint16_t	seq_id;
91776 	/* The length of the response data in number of bytes. */
91777 	uint16_t	resp_len;
91778 	/* Provisioning slot number. 0-indexed. */
91779 	uint8_t	slot;
91780 	/* Provisioned state */
91781 	uint8_t	state;
91782 	/* Certificate chain is not provisioned. */
91783 	#define HWRM_MFG_PRVSN_IMPORT_CERT_OUTPUT_STATE_NOT_PROVISIONED UINT32_C(0x0)
91784 	/* Certificate chain successfully provisioned. */
91785 	#define HWRM_MFG_PRVSN_IMPORT_CERT_OUTPUT_STATE_PROVISIONED	UINT32_C(0x1)
91786 	#define HWRM_MFG_PRVSN_IMPORT_CERT_OUTPUT_STATE_LAST	HWRM_MFG_PRVSN_IMPORT_CERT_OUTPUT_STATE_PROVISIONED
91787 	uint8_t	unused_0[5];
91788 	/*
91789 	 * This field is used in Output records to indicate that the output
91790 	 * is completely written to RAM. This field should be read as '1'
91791 	 * to indicate that the output has been completely written.
91792 	 * When writing a command completion or response to an internal
91793 	 * processor, the order of writes has to be such that this field is
91794 	 * written last.
91795 	 */
91796 	uint8_t	valid;
91797 } hwrm_mfg_prvsn_import_cert_output_t, *phwrm_mfg_prvsn_import_cert_output_t;
91798 
91799 /* hwrm_mfg_prvsn_import_cert_cmd_err (size:64b/8B) */
91800 
91801 typedef struct hwrm_mfg_prvsn_import_cert_cmd_err {
91802 	/*
91803 	 * command specific error codes that goes to
91804 	 * the cmd_err field in Common HWRM Error Response.
91805 	 */
91806 	uint8_t	code;
91807 	/* Unknown error. */
91808 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_UNKNOWN		UINT32_C(0x0)
91809 	/* Slot invalid */
91810 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_SLOT_INVALID	UINT32_C(0x1)
91811 	/* Slot is provisioned and locked */
91812 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_SLOT_LOCKED	UINT32_C(0x2)
91813 	/* Non-volatile storage is full or in error. */
91814 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_NO_STORAGE		UINT32_C(0x3)
91815 	/* Certificate chain verification failed. */
91816 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_CERT_VERIFY_FAIL	UINT32_C(0x4)
91817 	/* There is no self-signed device id certificate on device */
91818 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_NO_SIGNED_DEVICE_CERT UINT32_C(0x5)
91819 	#define HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_LAST		HWRM_MFG_PRVSN_IMPORT_CERT_CMD_ERR_CODE_NO_SIGNED_DEVICE_CERT
91820 	uint8_t	unused_0[7];
91821 } hwrm_mfg_prvsn_import_cert_cmd_err_t, *phwrm_mfg_prvsn_import_cert_cmd_err_t;
91822 
91823 /****************************
91824  * hwrm_mfg_prvsn_get_state *
91825  ****************************/
91826 
91827 
91828 /* hwrm_mfg_prvsn_get_state_input (size:128b/16B) */
91829 
91830 typedef struct hwrm_mfg_prvsn_get_state_input {
91831 	/* The HWRM command request type. */
91832 	uint16_t	req_type;
91833 	/*
91834 	 * The completion ring to send the completion event on. This should
91835 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
91836 	 */
91837 	uint16_t	cmpl_ring;
91838 	/*
91839 	 * The sequence ID is used by the driver for tracking multiple
91840 	 * commands. This ID is treated as opaque data by the firmware and
91841 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
91842 	 */
91843 	uint16_t	seq_id;
91844 	/*
91845 	 * The target ID of the command:
91846 	 * * 0x0-0xFFF8 - The function ID
91847 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
91848 	 * * 0xFFFD - Reserved for user-space HWRM interface
91849 	 * * 0xFFFF - HWRM
91850 	 */
91851 	uint16_t	target_id;
91852 	/*
91853 	 * A physical address pointer pointing to a host buffer that the
91854 	 * command's response data will be written. This can be either a host
91855 	 * physical address (HPA) or a guest physical address (GPA) and must
91856 	 * point to a physically contiguous block of memory.
91857 	 */
91858 	uint64_t	resp_addr;
91859 } hwrm_mfg_prvsn_get_state_input_t, *phwrm_mfg_prvsn_get_state_input_t;
91860 
91861 /* hwrm_mfg_prvsn_get_state_output (size:128b/16B) */
91862 
91863 typedef struct hwrm_mfg_prvsn_get_state_output {
91864 	/* The specific error status for the command. */
91865 	uint16_t	error_code;
91866 	/* The HWRM command request type. */
91867 	uint16_t	req_type;
91868 	/* The sequence ID from the original command. */
91869 	uint16_t	seq_id;
91870 	/* The length of the response data in number of bytes. */
91871 	uint16_t	resp_len;
91872 	/* Flag indicating if provision get state is valid. */
91873 	uint8_t	get_state_valid;
91874 	/*
91875 	 * Provision get state is invalid. The attestation agent has not
91876 	 * yet initialized and not completed verification of the
91877 	 * provisioned certificate chain.
91878 	 * The slot_status field is undetermined.
91879 	 */
91880 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_GET_STATE_VALID_INVALID  UINT32_C(0x0)
91881 	/* Provision get state is valid for SPDM. */
91882 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_GET_STATE_VALID_SPDM	UINT32_C(0x1)
91883 	/* Provision get state is valid for Cerberus. */
91884 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_GET_STATE_VALID_CERBERUS UINT32_C(0x2)
91885 	/* Provision get state is valid. There is no attestation agent. */
91886 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_GET_STATE_VALID_NONE	UINT32_C(0xff)
91887 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_GET_STATE_VALID_LAST	HWRM_MFG_PRVSN_GET_STATE_OUTPUT_GET_STATE_VALID_NONE
91888 	/*
91889 	 * An 8-bit mask returning the provisioned state of the imported
91890 	 * certificate chain on the device for each available slot.
91891 	 * Bit-N corresponding to slot N.
91892 	 * The slot_status field is undetermined if get_state_valid = 0.
91893 	 */
91894 	uint8_t	slot_status;
91895 	/* Slot N entries */
91896 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_SLOT_STATUS_SLOT_N_MASK	UINT32_C(0xff)
91897 	#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_SLOT_STATUS_SLOT_N_SFT		0
91898 	/* Slot N is not provisioned. */
91899 		#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_SLOT_STATUS_SLOT_N_NOT_PROVISIONED  UINT32_C(0x0)
91900 	/*
91901 	 * Slot N is provisioned and certificate chain is loaded
91902 	 * successfully by the attestation agent.
91903 	 */
91904 		#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_SLOT_STATUS_SLOT_N_PROVISIONED	UINT32_C(0x1)
91905 		#define HWRM_MFG_PRVSN_GET_STATE_OUTPUT_SLOT_STATUS_SLOT_N_LAST		HWRM_MFG_PRVSN_GET_STATE_OUTPUT_SLOT_STATUS_SLOT_N_PROVISIONED
91906 	uint8_t	unused_0[5];
91907 	/*
91908 	 * This field is used in Output records to indicate that the output
91909 	 * is completely written to RAM. This field should be read as '1'
91910 	 * to indicate that the output has been completely written.
91911 	 * When writing a command completion or response to an internal
91912 	 * processor, the order of writes has to be such that this field is
91913 	 * written last.
91914 	 */
91915 	uint8_t	valid;
91916 } hwrm_mfg_prvsn_get_state_output_t, *phwrm_mfg_prvsn_get_state_output_t;
91917 
91918 /******************************
91919  * hwrm_mfg_prvsn_export_cert *
91920  ******************************/
91921 
91922 
91923 /* hwrm_mfg_prvsn_export_cert_input (size:256b/32B) */
91924 
91925 typedef struct hwrm_mfg_prvsn_export_cert_input {
91926 	/* The HWRM command request type. */
91927 	uint16_t	req_type;
91928 	/*
91929 	 * The completion ring to send the completion event on. This should
91930 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
91931 	 */
91932 	uint16_t	cmpl_ring;
91933 	/*
91934 	 * The sequence ID is used by the driver for tracking multiple
91935 	 * commands. This ID is treated as opaque data by the firmware and
91936 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
91937 	 */
91938 	uint16_t	seq_id;
91939 	/*
91940 	 * The target ID of the command:
91941 	 * * 0x0-0xFFF8 - The function ID
91942 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
91943 	 * * 0xFFFD - Reserved for user-space HWRM interface
91944 	 * * 0xFFFF - HWRM
91945 	 */
91946 	uint16_t	target_id;
91947 	/*
91948 	 * A physical address pointer pointing to a host buffer that the
91949 	 * command's response data will be written. This can be either a host
91950 	 * physical address (HPA) or a guest physical address (GPA) and must
91951 	 * point to a physically contiguous block of memory.
91952 	 */
91953 	uint64_t	resp_addr;
91954 	/*
91955 	 * 64-bit Host destination address. This is the host address where
91956 	 * data will be written.
91957 	 */
91958 	uint64_t	host_dest_addr;
91959 	/* Provisioning slot number. 0-indexed. */
91960 	uint8_t	slot;
91961 	uint8_t	unused_0;
91962 	/* Size in bytes of the available host buffer. */
91963 	uint16_t	host_buf_len;
91964 	uint8_t	flags;
91965 	/*
91966 	 * This bit is only used when external secure SoC is used
91967 	 * for secure boot. If this bit is set, then export the
91968 	 * provisioned certificate from the security SoC non-volatile
91969 	 * storage device.
91970 	 */
91971 	#define HWRM_MFG_PRVSN_EXPORT_CERT_INPUT_FLAGS_SECURE_SOC_SUPPORT	UINT32_C(0x1)
91972 	uint8_t	unused_1[3];
91973 } hwrm_mfg_prvsn_export_cert_input_t, *phwrm_mfg_prvsn_export_cert_input_t;
91974 
91975 /* hwrm_mfg_prvsn_export_cert_output (size:128b/16B) */
91976 
91977 typedef struct hwrm_mfg_prvsn_export_cert_output {
91978 	/* The specific error status for the command. */
91979 	uint16_t	error_code;
91980 	/* The HWRM command request type. */
91981 	uint16_t	req_type;
91982 	/* The sequence ID from the original command. */
91983 	uint16_t	seq_id;
91984 	/* The length of the response data in number of bytes. */
91985 	uint16_t	resp_len;
91986 	/* Provisioning slot number. 0-indexed. */
91987 	uint8_t	slot;
91988 	uint8_t	unused_0;
91989 	/*
91990 	 * Size in bytes of the exported certificate chain. If there are no
91991 	 * certificates provisioned for the specified slot, the device will
91992 	 * return a successful response with cert_len equal to 0.
91993 	 */
91994 	uint16_t	cert_len;
91995 	uint8_t	unused_1[3];
91996 	/*
91997 	 * This field is used in Output records to indicate that the output
91998 	 * is completely written to RAM. This field should be read as '1'
91999 	 * to indicate that the output has been completely written.
92000 	 * When writing a command completion or response to an internal
92001 	 * processor, the order of writes has to be such that this field is
92002 	 * written last.
92003 	 */
92004 	uint8_t	valid;
92005 } hwrm_mfg_prvsn_export_cert_output_t, *phwrm_mfg_prvsn_export_cert_output_t;
92006 
92007 /* hwrm_mfg_prvsn_export_cert_cmd_err (size:64b/8B) */
92008 
92009 typedef struct hwrm_mfg_prvsn_export_cert_cmd_err {
92010 	/*
92011 	 * command specific error codes that goes to
92012 	 * the cmd_err field in Common HWRM Error Response.
92013 	 */
92014 	uint8_t	code;
92015 	/* Unknown error. */
92016 	#define HWRM_MFG_PRVSN_EXPORT_CERT_CMD_ERR_CODE_UNKNOWN	UINT32_C(0x0)
92017 	/* Slot invalid */
92018 	#define HWRM_MFG_PRVSN_EXPORT_CERT_CMD_ERR_CODE_SLOT_INVALID  UINT32_C(0x1)
92019 	/*
92020 	 * The provisioned certificates are invalid due to device ID change,
92021 	 * NVRAM corruption or another reason.
92022 	 */
92023 	#define HWRM_MFG_PRVSN_EXPORT_CERT_CMD_ERR_CODE_CERT_INVALID  UINT32_C(0x2)
92024 	/* Host provided buffer is too small */
92025 	#define HWRM_MFG_PRVSN_EXPORT_CERT_CMD_ERR_CODE_BUFFER_LENGTH UINT32_C(0x3)
92026 	#define HWRM_MFG_PRVSN_EXPORT_CERT_CMD_ERR_CODE_LAST	HWRM_MFG_PRVSN_EXPORT_CERT_CMD_ERR_CODE_BUFFER_LENGTH
92027 	uint8_t	unused_0[7];
92028 } hwrm_mfg_prvsn_export_cert_cmd_err_t, *phwrm_mfg_prvsn_export_cert_cmd_err_t;
92029 
92030 /********************************
92031  * hwrm_mfg_get_nvm_measurement *
92032  ********************************/
92033 
92034 
92035 /* hwrm_mfg_get_nvm_measurement_input (size:128b/16B) */
92036 
92037 typedef struct hwrm_mfg_get_nvm_measurement_input {
92038 	/* The HWRM command request type. */
92039 	uint16_t	req_type;
92040 	/*
92041 	 * The completion ring to send the completion event on. This should
92042 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
92043 	 */
92044 	uint16_t	cmpl_ring;
92045 	/*
92046 	 * The sequence ID is used by the driver for tracking multiple
92047 	 * commands. This ID is treated as opaque data by the firmware and
92048 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
92049 	 */
92050 	uint16_t	seq_id;
92051 	/*
92052 	 * The target ID of the command:
92053 	 * * 0x0-0xFFF8 - The function ID
92054 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
92055 	 * * 0xFFFD - Reserved for user-space HWRM interface
92056 	 * * 0xFFFF - HWRM
92057 	 */
92058 	uint16_t	target_id;
92059 	/*
92060 	 * A physical address pointer pointing to a host buffer that the
92061 	 * command's response data will be written. This can be either a host
92062 	 * physical address (HPA) or a guest physical address (GPA) and must
92063 	 * point to a physically contiguous block of memory.
92064 	 */
92065 	uint64_t	resp_addr;
92066 } hwrm_mfg_get_nvm_measurement_input_t, *phwrm_mfg_get_nvm_measurement_input_t;
92067 
92068 /* hwrm_mfg_get_nvm_measurement_output (size:704b/88B) */
92069 
92070 typedef struct hwrm_mfg_get_nvm_measurement_output {
92071 	/* The specific error status for the command. */
92072 	uint16_t	error_code;
92073 	/* The HWRM command request type. */
92074 	uint16_t	req_type;
92075 	/* The sequence ID from the original command. */
92076 	uint16_t	seq_id;
92077 	/* The length of the response data in number of bytes. */
92078 	uint16_t	resp_len;
92079 	/* Flag indicating if the hash returned is valid. */
92080 	uint8_t	hash_state;
92081 	/*
92082 	 * Measurement hash is invalid. There was an error
92083 	 * calculating the hash or firmware does not support NVM
92084 	 * measurement.
92085 	 */
92086 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_STATE_INVALID UINT32_C(0x0)
92087 	/* Measurement hash is valid. */
92088 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_STATE_VALID   UINT32_C(0x1)
92089 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_STATE_LAST   HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_STATE_VALID
92090 	/*
92091 	 * Flag indicating whether the measurement was calculated
92092 	 * in real time or calculated during bootup time.
92093 	 */
92094 	uint8_t	calc_time;
92095 	/* Measurement was calculated during bootup time. */
92096 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_CALC_TIME_BOOTUP UINT32_C(0x0)
92097 	/* Measurement is calculated in real time */
92098 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_CALC_TIME_LIVE   UINT32_C(0x1)
92099 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_CALC_TIME_LAST  HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_CALC_TIME_LIVE
92100 	/* Flag indicating the hash type when hash_state is valid. */
92101 	uint8_t	hash_type;
92102 	/* Measurement hash is SHA256(32 bytes). */
92103 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_TYPE_SHA256 UINT32_C(0x0)
92104 	/* Measurement hash is SHA384(48 bytes). */
92105 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_TYPE_SHA384 UINT32_C(0x1)
92106 	/* Measurement hash is SHA512(64 bytes). */
92107 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_TYPE_SHA512 UINT32_C(0x2)
92108 	#define HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_TYPE_LAST  HWRM_MFG_GET_NVM_MEASUREMENT_OUTPUT_HASH_TYPE_SHA512
92109 	uint8_t	unused_0[5];
92110 	/* NVM configuration hash with length indicated by hash_type. */
92111 	uint8_t	hash[64];
92112 	uint8_t	unused_1[7];
92113 	/*
92114 	 * This field is used in Output records to indicate that the output
92115 	 * is completely written to RAM. This field should be read as '1'
92116 	 * to indicate that the output has been completely written.
92117 	 * When writing a command completion or response to an internal
92118 	 * processor, the order of writes has to be such that this field is
92119 	 * written last.
92120 	 */
92121 	uint8_t	valid;
92122 } hwrm_mfg_get_nvm_measurement_output_t, *phwrm_mfg_get_nvm_measurement_output_t;
92123 
92124 /*************************
92125  * hwrm_mfg_psoc_qstatus *
92126  *************************/
92127 
92128 
92129 /* hwrm_mfg_psoc_qstatus_input (size:192b/24B) */
92130 
92131 typedef struct hwrm_mfg_psoc_qstatus_input {
92132 	/* The HWRM command request type. */
92133 	uint16_t	req_type;
92134 	/*
92135 	 * The completion ring to send the completion event on. This should
92136 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
92137 	 */
92138 	uint16_t	cmpl_ring;
92139 	/*
92140 	 * The sequence ID is used by the driver for tracking multiple
92141 	 * commands. This ID is treated as opaque data by the firmware and
92142 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
92143 	 */
92144 	uint16_t	seq_id;
92145 	/*
92146 	 * The target ID of the command:
92147 	 * * 0x0-0xFFF8 - The function ID
92148 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
92149 	 * * 0xFFFD - Reserved for user-space HWRM interface
92150 	 * * 0xFFFF - HWRM
92151 	 */
92152 	uint16_t	target_id;
92153 	/*
92154 	 * A physical address pointer pointing to a host buffer that the
92155 	 * command's response data will be written. This can be either a host
92156 	 * physical address (HPA) or a guest physical address (GPA) and must
92157 	 * point to a physically contiguous block of memory.
92158 	 */
92159 	uint64_t	resp_addr;
92160 	/*  */
92161 	uint32_t	reserved1;
92162 	/*  */
92163 	uint32_t	reserved2;
92164 } hwrm_mfg_psoc_qstatus_input_t, *phwrm_mfg_psoc_qstatus_input_t;
92165 
92166 /* hwrm_mfg_psoc_qstatus_output (size:768b/96B) */
92167 
92168 typedef struct hwrm_mfg_psoc_qstatus_output {
92169 	/* The specific error status for the command. */
92170 	uint16_t	error_code;
92171 	/* The HWRM command request type. */
92172 	uint16_t	req_type;
92173 	/* The sequence ID from the original command. */
92174 	uint16_t	seq_id;
92175 	/* The length of the response data in number of bytes. */
92176 	uint16_t	resp_len;
92177 	/* PBL version info. Start at 0, roll if change in structure */
92178 	uint8_t	pbl_info_version;
92179 	/* PBL info length. Counts all bytes. */
92180 	uint8_t	pbl_info_length;
92181 	/*
92182 	 * Hardware generation major version. Rolled on incompatible hardware
92183 	 * changes.
92184 	 */
92185 	uint8_t	hw_generation_major;
92186 	/* Hardware generation minor version. Tracks minor changes. */
92187 	uint8_t	hw_generation_minor;
92188 	/* Reserved. */
92189 	uint8_t	feature_support;
92190 	/* Firmware version major. */
92191 	uint8_t	fw_version_major;
92192 	/* Firmware version minor. */
92193 	uint8_t	fw_version_minor;
92194 	/* Indicate which of the two firmware images is active. */
92195 	uint8_t	active_image;
92196 	/* Identifies PSoC specific part. */
92197 	uint32_t	silicon_id;
92198 	/* Length of part number string in bytes, including NULL terminator. */
92199 	uint8_t	part_number_string_length;
92200 	uint8_t	unused_1[3];
92201 	/* Part number string in ASCII. */
92202 	uint8_t	part_number_string[64];
92203 	uint8_t	unused_2[7];
92204 	/*
92205 	 * This field is used in Output records to indicate that the output
92206 	 * is completely written to RAM. This field should be read as '1'
92207 	 * to indicate that the output has been completely written.
92208 	 * When writing a command completion or response to an internal
92209 	 * processor, the order of writes has to be such that this field is
92210 	 * written last.
92211 	 */
92212 	uint8_t	valid;
92213 } hwrm_mfg_psoc_qstatus_output_t, *phwrm_mfg_psoc_qstatus_output_t;
92214 
92215 /***************************
92216  * hwrm_mfg_selftest_qlist *
92217  ***************************/
92218 
92219 
92220 /* hwrm_mfg_selftest_qlist_input (size:128b/16B) */
92221 
92222 typedef struct hwrm_mfg_selftest_qlist_input {
92223 	/* The HWRM command request type. */
92224 	uint16_t	req_type;
92225 	/*
92226 	 * The completion ring to send the completion event on. This should
92227 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
92228 	 */
92229 	uint16_t	cmpl_ring;
92230 	/*
92231 	 * The sequence ID is used by the driver for tracking multiple
92232 	 * commands. This ID is treated as opaque data by the firmware and
92233 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
92234 	 */
92235 	uint16_t	seq_id;
92236 	/*
92237 	 * The target ID of the command:
92238 	 * * 0x0-0xFFF8 - The function ID
92239 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
92240 	 * * 0xFFFD - Reserved for user-space HWRM interface
92241 	 * * 0xFFFF - HWRM
92242 	 */
92243 	uint16_t	target_id;
92244 	/*
92245 	 * A physical address pointer pointing to a host buffer that the
92246 	 * command's response data will be written. This can be either a host
92247 	 * physical address (HPA) or a guest physical address (GPA) and must
92248 	 * point to a physically contiguous block of memory.
92249 	 */
92250 	uint64_t	resp_addr;
92251 } hwrm_mfg_selftest_qlist_input_t, *phwrm_mfg_selftest_qlist_input_t;
92252 
92253 /* hwrm_mfg_selftest_qlist_output (size:192b/24B) */
92254 
92255 typedef struct hwrm_mfg_selftest_qlist_output {
92256 	/* The specific error status for the command. */
92257 	uint16_t	error_code;
92258 	/* The HWRM command request type. */
92259 	uint16_t	req_type;
92260 	/* The sequence ID from the original command. */
92261 	uint16_t	seq_id;
92262 	/* The length of the response data in number of bytes. */
92263 	uint16_t	resp_len;
92264 	/*
92265 	 * This field represents the number of tests available to be
92266 	 * requested by manufacturing tool.
92267 	 */
92268 	uint8_t	num_tests;
92269 	/* This field indicates which self-test is available to be run. */
92270 	uint8_t	available_tests;
92271 	/*
92272 	 * Can run the peripheral tests. Individual peripherals are
92273 	 * specified in peripheral_tests field.
92274 	 */
92275 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_AVAILABLE_TESTS_PERIPHERAL_TEST	UINT32_C(0x1)
92276 	/*
92277 	 * This field represents the maximum timeout for all the
92278 	 * tests to complete in milliseconds.
92279 	 */
92280 	uint16_t	test_timeout;
92281 	/*
92282 	 * This field is a 32 bits bitmap, each bit specifies a peripheral
92283 	 * test.
92284 	 */
92285 	uint32_t	peripheral_tests;
92286 	/* Can run memory test on Co-CPU peripheral */
92287 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_CO_CPU_MEMORY	UINT32_C(0x1)
92288 	/* Can run test on dpll eeprom peripheral */
92289 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_DPLL_EEPROM	UINT32_C(0x2)
92290 	/* Can run test on dpll mmcx connector peripheral */
92291 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_DPLL_MMCX	UINT32_C(0x4)
92292 	/* Can run test on gnss peripheral */
92293 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_GNSS		UINT32_C(0x8)
92294 	/* Can run pcie test on Co-CPU peripheral */
92295 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_CO_CPU_PCIE	UINT32_C(0x10)
92296 	/* Can run test on internal fabric peripheral */
92297 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_INTERNAL_FABRIC	UINT32_C(0x20)
92298 	/* Can run test on oven controlled crystal oscillator peripheral */
92299 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_OCXO		UINT32_C(0x40)
92300 	/* Can run test on telecom pll peripheral */
92301 	#define HWRM_MFG_SELFTEST_QLIST_OUTPUT_PERIPHERAL_TESTS_TELECOM_PLL	UINT32_C(0x80)
92302 	uint8_t	unused_2[7];
92303 	/*
92304 	 * This field is used in Output records to indicate that the output
92305 	 * is completely written to RAM. This field should be read as '1'
92306 	 * to indicate that the output has been completely written. When
92307 	 * writing a command completion or response to an internal processor,
92308 	 * the order of writes has to be such that this field is written last.
92309 	 */
92310 	uint8_t	valid;
92311 } hwrm_mfg_selftest_qlist_output_t, *phwrm_mfg_selftest_qlist_output_t;
92312 
92313 /**************************
92314  * hwrm_mfg_selftest_exec *
92315  **************************/
92316 
92317 
92318 /* hwrm_mfg_selftest_exec_input (size:192b/24B) */
92319 
92320 typedef struct hwrm_mfg_selftest_exec_input {
92321 	/* The HWRM command request type. */
92322 	uint16_t	req_type;
92323 	/*
92324 	 * The completion ring to send the completion event on. This should
92325 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
92326 	 */
92327 	uint16_t	cmpl_ring;
92328 	/*
92329 	 * The sequence ID is used by the driver for tracking multiple
92330 	 * commands. This ID is treated as opaque data by the firmware and
92331 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
92332 	 */
92333 	uint16_t	seq_id;
92334 	/*
92335 	 * The target ID of the command:
92336 	 * * 0x0-0xFFF8 - The function ID
92337 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
92338 	 * * 0xFFFD - Reserved for user-space HWRM interface
92339 	 * * 0xFFFF - HWRM
92340 	 */
92341 	uint16_t	target_id;
92342 	/*
92343 	 * A physical address pointer pointing to a host buffer that the
92344 	 * command's response data will be written. This can be either a host
92345 	 * physical address (HPA) or a guest physical address (GPA) and must
92346 	 * point to a physically contiguous block of memory.
92347 	 */
92348 	uint64_t	resp_addr;
92349 	/* This field indicates which self-test is being requested to run. */
92350 	uint8_t	flags;
92351 	/*
92352 	 * Run the Peripheral tests specified in peripheral_tests
92353 	 * field.
92354 	 */
92355 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_FLAGS_PERIPHERAL_TEST	UINT32_C(0x1)
92356 	uint8_t	unused_0[3];
92357 	/*
92358 	 * This field is a 32 bits bitmap to specify which peripheral tests to
92359 	 * run, each bit specifies a peripheral test.
92360 	 */
92361 	uint32_t	peripheral_tests;
92362 	/* Run memory test on Co-CPU peripheral */
92363 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_CO_CPU_MEMORY	UINT32_C(0x1)
92364 	/* Run test on dpll eeprom peripheral */
92365 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_DPLL_EEPROM	UINT32_C(0x2)
92366 	/* Run test on dpll mmcx connector peripheral */
92367 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_DPLL_MMCX	UINT32_C(0x4)
92368 	/* Run test on gnss peripheral */
92369 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_GNSS		UINT32_C(0x8)
92370 	/* Run pcie test on Co-CPU peripheral */
92371 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_CO_CPU_PCIE	UINT32_C(0x10)
92372 	/* Run test on internal fabric peripheral */
92373 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_INTERNAL_FABRIC	UINT32_C(0x20)
92374 	/* Run test on oven controlled crystal oscillator peripheral */
92375 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_OCXO		UINT32_C(0x40)
92376 	/* Run test on telecom pll peripheral */
92377 	#define HWRM_MFG_SELFTEST_EXEC_INPUT_PERIPHERAL_TESTS_TELECOM_PLL	UINT32_C(0x80)
92378 } hwrm_mfg_selftest_exec_input_t, *phwrm_mfg_selftest_exec_input_t;
92379 
92380 /* hwrm_mfg_selftest_exec_output (size:192b/24B) */
92381 
92382 typedef struct hwrm_mfg_selftest_exec_output {
92383 	/* The specific error status for the command. */
92384 	uint16_t	error_code;
92385 	/* The HWRM command request type. */
92386 	uint16_t	req_type;
92387 	/* The sequence ID from the original command. */
92388 	uint16_t	seq_id;
92389 	/* The length of the response data in number of bytes. */
92390 	uint16_t	resp_len;
92391 	/* The following tests were requested to be run. */
92392 	uint8_t	requested_tests;
92393 	/* A request was made to run the peripheral tests. */
92394 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_REQUESTED_TESTS_PERIPHERAL_TEST	UINT32_C(0x1)
92395 	/*
92396 	 * If a test was requested to be run as seen in the requested_tests
92397 	 * field, this bit indicates whether the test was successful(1) or
92398 	 * failed(0).
92399 	 */
92400 	uint8_t	test_success;
92401 	/*
92402 	 * If requested, a value of 1 indicates the peripheral tests
92403 	 * completed successfully.
92404 	 */
92405 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_TEST_SUCCESS_PERIPHERAL_TEST	UINT32_C(0x1)
92406 	uint8_t	unused_0[2];
92407 	/*
92408 	 * This field is a 32 bits bitmap for firmware to indicate which
92409 	 * peripheral tests are specified by the host, each bit specifies
92410 	 * a peripheral test.
92411 	 */
92412 	uint32_t	peripheral_requested_tests;
92413 	/* Co-CPU peripheral test requested */
92414 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_CO_CPU_MEMORY	UINT32_C(0x1)
92415 	/* dpll eeprom peripheral test requested */
92416 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_DPLL_EEPROM	UINT32_C(0x2)
92417 	/* dpll mmcx connector peripheral test requested */
92418 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_DPLL_MMCX	UINT32_C(0x4)
92419 	/* gnss peripheral test requested */
92420 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_GNSS		UINT32_C(0x8)
92421 	/* pcie test on Co-CPU peripheral test requested */
92422 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_CO_CPU_PCIE	UINT32_C(0x10)
92423 	/* internal fabric peripheral test requested */
92424 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_INTERNAL_FABRIC	UINT32_C(0x20)
92425 	/* oven controlled crystal oscillator peripheral test requested */
92426 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_OCXO		UINT32_C(0x40)
92427 	/* telecom pll peripheral test requested */
92428 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_REQUESTED_TESTS_TELECOM_PLL	UINT32_C(0x80)
92429 	/*
92430 	 * This field is a 32 bits bitmap for firmware to indicate which
92431 	 * peripheral tests are successfully executed, each bit specifies
92432 	 * a peripheral test.
92433 	 */
92434 	uint32_t	peripheral_tests_success;
92435 	/* Co-CPU peripheral test is successfully executed */
92436 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_CO_CPU_MEMORY	UINT32_C(0x1)
92437 	/* dpll eeprom peripheral test is successfully executed */
92438 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_DPLL_EEPROM	UINT32_C(0x2)
92439 	/* dpll mmcx connector peripheral test is successfully executed */
92440 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_DPLL_MMCX	UINT32_C(0x4)
92441 	/* gnss peripheral test is successfully executed */
92442 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_GNSS		UINT32_C(0x8)
92443 	/* pcie test on Co-CPU peripheral test is successfully executed */
92444 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_CO_CPU_PCIE	UINT32_C(0x10)
92445 	/* internal fabric peripheral test is successfully executed */
92446 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_INTERNAL_FABRIC	UINT32_C(0x20)
92447 	/*
92448 	 * oven controlled crystal oscillator peripheral test is successfully
92449 	 * executed
92450 	 */
92451 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_OCXO		UINT32_C(0x40)
92452 	/* telecom pll peripheral test is successfully executed */
92453 	#define HWRM_MFG_SELFTEST_EXEC_OUTPUT_PERIPHERAL_TESTS_SUCCESS_TELECOM_PLL	UINT32_C(0x80)
92454 	uint8_t	unused_1[3];
92455 	/*
92456 	 * This field is used in Output records to indicate that the output
92457 	 * is completely written to RAM. This field should be read as '1'
92458 	 * to indicate that the output has been completely written. When
92459 	 * writing a command completion or response to an internal processor,
92460 	 * the order of writes has to be such that this field is written last.
92461 	 */
92462 	uint8_t	valid;
92463 } hwrm_mfg_selftest_exec_output_t, *phwrm_mfg_selftest_exec_output_t;
92464 
92465 /****************
92466  * hwrm_oem_cmd *
92467  ****************/
92468 
92469 
92470 /* hwrm_oem_cmd_input (size:1024b/128B) */
92471 
92472 typedef struct hwrm_oem_cmd_input {
92473 	/* The HWRM command request type. */
92474 	uint16_t	req_type;
92475 	/*
92476 	 * The completion ring to send the completion event on. This should
92477 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
92478 	 */
92479 	uint16_t	cmpl_ring;
92480 	/*
92481 	 * The sequence ID is used by the driver for tracking multiple
92482 	 * commands. This ID is treated as opaque data by the firmware and
92483 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
92484 	 */
92485 	uint16_t	seq_id;
92486 	/*
92487 	 * The target ID of the command:
92488 	 * * 0x0-0xFFF8 - The function ID
92489 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
92490 	 * * 0xFFFD - Reserved for user-space HWRM interface
92491 	 * * 0xFFFF - HWRM
92492 	 */
92493 	uint16_t	target_id;
92494 	/*
92495 	 * A physical address pointer pointing to a host buffer that the
92496 	 * command's response data will be written. This can be either a host
92497 	 * physical address (HPA) or a guest physical address (GPA) and must
92498 	 * point to a physically contiguous block of memory.
92499 	 */
92500 	uint64_t	resp_addr;
92501 	/*
92502 	 * The organization owning the message format. Set this field
92503 	 * to 0x14e4 when used for Broadcom internal use when
92504 	 * the naming authority is set to PCI_SIG.
92505 	 */
92506 	uint32_t	oem_id;
92507 	/* The naming authority used for setting the oem_id. */
92508 	uint8_t	naming_authority;
92509 	/* Invalid naming authority */
92510 	#define HWRM_OEM_CMD_INPUT_NAMING_AUTHORITY_INVALID UINT32_C(0x0)
92511 	/* PCI_SIG naming authority numbering is used */
92512 	#define HWRM_OEM_CMD_INPUT_NAMING_AUTHORITY_PCI_SIG UINT32_C(0x1)
92513 	#define HWRM_OEM_CMD_INPUT_NAMING_AUTHORITY_LAST   HWRM_OEM_CMD_INPUT_NAMING_AUTHORITY_PCI_SIG
92514 	/* The message family within the organization. */
92515 	uint8_t	message_family;
92516 	/* Invalid message family */
92517 	#define HWRM_OEM_CMD_INPUT_MESSAGE_FAMILY_INVALID UINT32_C(0x0)
92518 	/* This message is targeted for Truflow */
92519 	#define HWRM_OEM_CMD_INPUT_MESSAGE_FAMILY_TRUFLOW UINT32_C(0x1)
92520 	/* This message is targeted for RoCE */
92521 	#define HWRM_OEM_CMD_INPUT_MESSAGE_FAMILY_ROCE	UINT32_C(0x2)
92522 	#define HWRM_OEM_CMD_INPUT_MESSAGE_FAMILY_LAST   HWRM_OEM_CMD_INPUT_MESSAGE_FAMILY_ROCE
92523 	uint16_t	unused;
92524 	/* This field contains the vendor specific command data. */
92525 	uint32_t	oem_data[26];
92526 } hwrm_oem_cmd_input_t, *phwrm_oem_cmd_input_t;
92527 
92528 /* hwrm_oem_cmd_output (size:768b/96B) */
92529 
92530 typedef struct hwrm_oem_cmd_output {
92531 	/* The specific error status for the command. */
92532 	uint16_t	error_code;
92533 	/* The HWRM command request type. */
92534 	uint16_t	req_type;
92535 	/* The sequence ID from the original command. */
92536 	uint16_t	seq_id;
92537 	/* The length of the response data in number of bytes. */
92538 	uint16_t	resp_len;
92539 	/* The organization owning the message format. */
92540 	uint32_t	oem_id;
92541 	/* The naming authority used for setting the oem_id. */
92542 	uint8_t	naming_authority;
92543 	/* The message family within the organization. */
92544 	uint8_t	message_family;
92545 	uint16_t	unused;
92546 	/* This field contains the vendor specific response data. */
92547 	uint32_t	oem_data[18];
92548 	uint8_t	unused_1[7];
92549 	/*
92550 	 * This field is used in Output records to indicate that the output
92551 	 * is completely written to RAM. This field should be read as '1'
92552 	 * to indicate that the output has been completely written. When
92553 	 * writing a command completion or response to an internal processor,
92554 	 * the order of writes has to be such that this field is written last.
92555 	 */
92556 	uint8_t	valid;
92557 } hwrm_oem_cmd_output_t, *phwrm_oem_cmd_output_t;
92558 
92559 /***********
92560  * hwrm_sv *
92561  ***********/
92562 
92563 
92564 /* hwrm_sv_input (size:1152b/144B) */
92565 
92566 typedef struct hwrm_sv_input {
92567 	/* The HWRM command request type. */
92568 	uint16_t	req_type;
92569 	/*
92570 	 * The completion ring to send the completion event on. This should
92571 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
92572 	 */
92573 	uint16_t	cmpl_ring;
92574 	/*
92575 	 * The sequence ID is used by the driver for tracking multiple
92576 	 * commands. This ID is treated as opaque data by the firmware and
92577 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
92578 	 */
92579 	uint16_t	seq_id;
92580 	/*
92581 	 * The target ID of the command:
92582 	 * * 0x0-0xFFF8 - The function ID
92583 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
92584 	 * * 0xFFFD - Reserved for user-space HWRM interface
92585 	 * * 0xFFFF - HWRM
92586 	 */
92587 	uint16_t	target_id;
92588 	/*
92589 	 * A physical address pointer pointing to a host buffer that the
92590 	 * command's response data will be written. This can be either a host
92591 	 * physical address (HPA) or a guest physical address (GPA) and must
92592 	 * point to a physically contiguous block of memory.
92593 	 */
92594 	uint64_t	resp_addr;
92595 	uint32_t	opaque[32];
92596 } hwrm_sv_input_t, *phwrm_sv_input_t;
92597 
92598 /* hwrm_sv_output (size:1088b/136B) */
92599 
92600 typedef struct hwrm_sv_output {
92601 	/* The specific error status for the command. */
92602 	uint16_t	error_code;
92603 	/* The HWRM command request type. */
92604 	uint16_t	req_type;
92605 	/* The sequence ID from the original command. */
92606 	uint16_t	seq_id;
92607 	/* The length of the response data in number of bytes. */
92608 	uint16_t	resp_len;
92609 	uint32_t	opaque[32];
92610 } hwrm_sv_output_t, *phwrm_sv_output_t;
92611 
92612 /*******************
92613  * hwrm_udcc_qcaps *
92614  *******************/
92615 
92616 
92617 /* hwrm_udcc_qcaps_input (size:128b/16B) */
92618 
92619 typedef struct hwrm_udcc_qcaps_input {
92620 	/* The HWRM command request type. */
92621 	uint16_t	req_type;
92622 	/*
92623 	 * The completion ring to send the completion event on. This should
92624 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
92625 	 */
92626 	uint16_t	cmpl_ring;
92627 	/*
92628 	 * The sequence ID is used by the driver for tracking multiple
92629 	 * commands. This ID is treated as opaque data by the firmware and
92630 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
92631 	 */
92632 	uint16_t	seq_id;
92633 	/*
92634 	 * The target ID of the command:
92635 	 * * 0x0-0xFFF8 - The function ID
92636 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
92637 	 * * 0xFFFD - Reserved for user-space HWRM interface
92638 	 * * 0xFFFF - HWRM
92639 	 */
92640 	uint16_t	target_id;
92641 	/*
92642 	 * A physical address pointer pointing to a host buffer that the
92643 	 * command's response data will be written. This can be either a host
92644 	 * physical address (HPA) or a guest physical address (GPA) and must
92645 	 * point to a physically contiguous block of memory.
92646 	 */
92647 	uint64_t	resp_addr;
92648 } hwrm_udcc_qcaps_input_t, *phwrm_udcc_qcaps_input_t;
92649 
92650 /* hwrm_udcc_qcaps_output (size:192b/24B) */
92651 
92652 typedef struct hwrm_udcc_qcaps_output {
92653 	/* The specific error status for the command. */
92654 	uint16_t	error_code;
92655 	/* The HWRM command request type. */
92656 	uint16_t	req_type;
92657 	/* The sequence ID from the original command. */
92658 	uint16_t	seq_id;
92659 	/* The length of the response data in number of bytes. */
92660 	uint16_t	resp_len;
92661 	/*
92662 	 * This field represents guaranteed minimum number of UDCC sessions
92663 	 * available to the function.
92664 	 */
92665 	uint16_t	min_sessions;
92666 	/*
92667 	 * This field represents unguaranteed maximum number of UDCC sessions
92668 	 * available to the function.
92669 	 */
92670 	uint16_t	max_sessions;
92671 	/*
92672 	 * This value indicates the type of session being modified by the
92673 	 * UDCC.
92674 	 */
92675 	uint8_t	session_type;
92676 	/* sessions are allocated on a per destination basis. */
92677 	#define HWRM_UDCC_QCAPS_OUTPUT_SESSION_TYPE_PER_DESTINATION UINT32_C(0x0)
92678 	/* sessions are allocated on a per QP basis. */
92679 	#define HWRM_UDCC_QCAPS_OUTPUT_SESSION_TYPE_PER_QP	UINT32_C(0x1)
92680 	#define HWRM_UDCC_QCAPS_OUTPUT_SESSION_TYPE_LAST	HWRM_UDCC_QCAPS_OUTPUT_SESSION_TYPE_PER_QP
92681 	uint8_t	unused_0[3];
92682 	/*
92683 	 * This field represents the maximum number of bytes of UDCC program
92684 	 * configuration data that one hwrm_udcc_comp_cfg request or
92685 	 * hwrm_udcc_comp_qcfg response can transfer.
92686 	 * The value is determined by the UDCC firmware.
92687 	 */
92688 	uint16_t	max_comp_cfg_xfer;
92689 	/*
92690 	 * This field represents the maximum number of bytes of UDCC program
92691 	 * status or statistics data that one hwrm_udcc_comp_query response
92692 	 * can transfer. The value is determined by the UDCC firmware.
92693 	 */
92694 	uint16_t	max_comp_data_xfer;
92695 	uint8_t	unused_1[3];
92696 	/*
92697 	 * This field is used in Output records to indicate that the output
92698 	 * is completely written to RAM. This field should be read as '1'
92699 	 * to indicate that the output has been completely written. When
92700 	 * writing a command completion or response to an internal processor,
92701 	 * the order of writes has to be such that this field is written last.
92702 	 */
92703 	uint8_t	valid;
92704 } hwrm_udcc_qcaps_output_t, *phwrm_udcc_qcaps_output_t;
92705 
92706 /*****************
92707  * hwrm_udcc_cfg *
92708  *****************/
92709 
92710 
92711 /* hwrm_udcc_cfg_input (size:192b/24B) */
92712 
92713 typedef struct hwrm_udcc_cfg_input {
92714 	/* The HWRM command request type. */
92715 	uint16_t	req_type;
92716 	/*
92717 	 * The completion ring to send the completion event on. This should
92718 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
92719 	 */
92720 	uint16_t	cmpl_ring;
92721 	/*
92722 	 * The sequence ID is used by the driver for tracking multiple
92723 	 * commands. This ID is treated as opaque data by the firmware and
92724 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
92725 	 */
92726 	uint16_t	seq_id;
92727 	/*
92728 	 * The target ID of the command:
92729 	 * * 0x0-0xFFF8 - The function ID
92730 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
92731 	 * * 0xFFFD - Reserved for user-space HWRM interface
92732 	 * * 0xFFFF - HWRM
92733 	 */
92734 	uint16_t	target_id;
92735 	/*
92736 	 * A physical address pointer pointing to a host buffer that the
92737 	 * command's response data will be written. This can be either a host
92738 	 * physical address (HPA) or a guest physical address (GPA) and must
92739 	 * point to a physically contiguous block of memory.
92740 	 */
92741 	uint64_t	resp_addr;
92742 	uint32_t	enables;
92743 	/*
92744 	 * This bit must be '1' for the udcc_mode field to be
92745 	 * configured.
92746 	 */
92747 	#define HWRM_UDCC_CFG_INPUT_ENABLES_UDCC_MODE	UINT32_C(0x1)
92748 	/* UDCC mode for this function. */
92749 	uint8_t	udcc_mode;
92750 	/* UDCC is not enabled. */
92751 	#define HWRM_UDCC_CFG_INPUT_UDCC_MODE_DISABLED UINT32_C(0x0)
92752 	/* UDCC is enabled. */
92753 	#define HWRM_UDCC_CFG_INPUT_UDCC_MODE_ENABLED  UINT32_C(0x1)
92754 	#define HWRM_UDCC_CFG_INPUT_UDCC_MODE_LAST	HWRM_UDCC_CFG_INPUT_UDCC_MODE_ENABLED
92755 	uint8_t	unused_1[3];
92756 } hwrm_udcc_cfg_input_t, *phwrm_udcc_cfg_input_t;
92757 
92758 /* hwrm_udcc_cfg_output (size:128b/16B) */
92759 
92760 typedef struct hwrm_udcc_cfg_output {
92761 	/* The specific error status for the command. */
92762 	uint16_t	error_code;
92763 	/* The HWRM command request type. */
92764 	uint16_t	req_type;
92765 	/* The sequence ID from the original command. */
92766 	uint16_t	seq_id;
92767 	/* The length of the response data in number of bytes. */
92768 	uint16_t	resp_len;
92769 	uint8_t	unused_1[7];
92770 	/*
92771 	 * This field is used in Output records to indicate that the output
92772 	 * is completely written to RAM. This field should be read as '1'
92773 	 * to indicate that the output has been completely written. When
92774 	 * writing a command completion or response to an internal processor,
92775 	 * the order of writes has to be such that this field is written last.
92776 	 */
92777 	uint8_t	valid;
92778 } hwrm_udcc_cfg_output_t, *phwrm_udcc_cfg_output_t;
92779 
92780 /******************
92781  * hwrm_udcc_qcfg *
92782  ******************/
92783 
92784 
92785 /* hwrm_udcc_qcfg_input (size:128b/16B) */
92786 
92787 typedef struct hwrm_udcc_qcfg_input {
92788 	/* The HWRM command request type. */
92789 	uint16_t	req_type;
92790 	/*
92791 	 * The completion ring to send the completion event on. This should
92792 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
92793 	 */
92794 	uint16_t	cmpl_ring;
92795 	/*
92796 	 * The sequence ID is used by the driver for tracking multiple
92797 	 * commands. This ID is treated as opaque data by the firmware and
92798 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
92799 	 */
92800 	uint16_t	seq_id;
92801 	/*
92802 	 * The target ID of the command:
92803 	 * * 0x0-0xFFF8 - The function ID
92804 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
92805 	 * * 0xFFFD - Reserved for user-space HWRM interface
92806 	 * * 0xFFFF - HWRM
92807 	 */
92808 	uint16_t	target_id;
92809 	/*
92810 	 * A physical address pointer pointing to a host buffer that the
92811 	 * command's response data will be written. This can be either a host
92812 	 * physical address (HPA) or a guest physical address (GPA) and must
92813 	 * point to a physically contiguous block of memory.
92814 	 */
92815 	uint64_t	resp_addr;
92816 } hwrm_udcc_qcfg_input_t, *phwrm_udcc_qcfg_input_t;
92817 
92818 /* hwrm_udcc_qcfg_output (size:128b/16B) */
92819 
92820 typedef struct hwrm_udcc_qcfg_output {
92821 	/* The specific error status for the command. */
92822 	uint16_t	error_code;
92823 	/* The HWRM command request type. */
92824 	uint16_t	req_type;
92825 	/* The sequence ID from the original command. */
92826 	uint16_t	seq_id;
92827 	/* The length of the response data in number of bytes. */
92828 	uint16_t	resp_len;
92829 	/* UDCC mode for this function. */
92830 	uint8_t	udcc_mode;
92831 	uint8_t	unused_1[6];
92832 	/*
92833 	 * This field is used in Output records to indicate that the output
92834 	 * is completely written to RAM. This field should be read as '1'
92835 	 * to indicate that the output has been completely written. When
92836 	 * writing a command completion or response to an internal processor,
92837 	 * the order of writes has to be such that this field is written last.
92838 	 */
92839 	uint8_t	valid;
92840 } hwrm_udcc_qcfg_output_t, *phwrm_udcc_qcfg_output_t;
92841 
92842 /*************************
92843  * hwrm_udcc_session_cfg *
92844  *************************/
92845 
92846 
92847 /* hwrm_udcc_session_cfg_input (size:384b/48B) */
92848 
92849 typedef struct hwrm_udcc_session_cfg_input {
92850 	/* The HWRM command request type. */
92851 	uint16_t	req_type;
92852 	/*
92853 	 * The completion ring to send the completion event on. This should
92854 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
92855 	 */
92856 	uint16_t	cmpl_ring;
92857 	/*
92858 	 * The sequence ID is used by the driver for tracking multiple
92859 	 * commands. This ID is treated as opaque data by the firmware and
92860 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
92861 	 */
92862 	uint16_t	seq_id;
92863 	/*
92864 	 * The target ID of the command:
92865 	 * * 0x0-0xFFF8 - The function ID
92866 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
92867 	 * * 0xFFFD - Reserved for user-space HWRM interface
92868 	 * * 0xFFFF - HWRM
92869 	 */
92870 	uint16_t	target_id;
92871 	/*
92872 	 * A physical address pointer pointing to a host buffer that the
92873 	 * command's response data will be written. This can be either a host
92874 	 * physical address (HPA) or a guest physical address (GPA) and must
92875 	 * point to a physically contiguous block of memory.
92876 	 */
92877 	uint64_t	resp_addr;
92878 	uint32_t	enables;
92879 	/* This bit must be '1' for the session_state to be configured. */
92880 	#define HWRM_UDCC_SESSION_CFG_INPUT_ENABLES_SESSION_STATE	UINT32_C(0x1)
92881 	/* This bit must be '1' for the dest_mac to be configured. */
92882 	#define HWRM_UDCC_SESSION_CFG_INPUT_ENABLES_DEST_MAC		UINT32_C(0x2)
92883 	/* This bit must be '1' for the src_mac to be configured. */
92884 	#define HWRM_UDCC_SESSION_CFG_INPUT_ENABLES_SRC_MAC		UINT32_C(0x4)
92885 	/* This bit must be '1' for the tx_stats_record to be configured. */
92886 	#define HWRM_UDCC_SESSION_CFG_INPUT_ENABLES_TX_STATS_RECORD	UINT32_C(0x8)
92887 	/* This bit must be '1' for the rx_stats_record to be configured. */
92888 	#define HWRM_UDCC_SESSION_CFG_INPUT_ENABLES_RX_STATS_RECORD	UINT32_C(0x10)
92889 	/* State to configure for the session. */
92890 	uint8_t	session_state;
92891 	/*
92892 	 * This bit is set if the session is to be enabled and have firmware
92893 	 * querying it for events. The bit is cleared if the session is to
92894 	 * be disabled in firmware.
92895 	 */
92896 	#define HWRM_UDCC_SESSION_CFG_INPUT_SESSION_STATE_ENABLED		UINT32_C(0x1)
92897 	/* UDCC flow is not created in driver. */
92898 	#define HWRM_UDCC_SESSION_CFG_INPUT_SESSION_STATE_FLOW_NOT_CREATED	UINT32_C(0x2)
92899 	/* UDCC flow is now deleted in driver. */
92900 	#define HWRM_UDCC_SESSION_CFG_INPUT_SESSION_STATE_FLOW_HAS_BEEN_DELETED	UINT32_C(0x4)
92901 	uint8_t	unused_1;
92902 	/* A handle for the session to be configured, if previously allocated. */
92903 	uint16_t	session_id;
92904 	/* destination mac address used for the session. */
92905 	uint8_t	dest_mac[6];
92906 	uint16_t	unused_2;
92907 	/* source mac address used for the session. */
92908 	uint8_t	src_mac[6];
92909 	uint16_t	unused_3;
92910 	/*
92911 	 * address for the tx flow statistics record to be sampled by the
92912 	 * UDCC firmware. Session must be disabled to take effect.
92913 	 */
92914 	uint32_t	tx_stats_record;
92915 	/*
92916 	 * address for the rx flow statistics record to be sampled by the
92917 	 * UDCC firmware. Session must be disabled to take effect.
92918 	 */
92919 	uint32_t	rx_stats_record;
92920 } hwrm_udcc_session_cfg_input_t, *phwrm_udcc_session_cfg_input_t;
92921 
92922 /* hwrm_udcc_session_cfg_output (size:128b/16B) */
92923 
92924 typedef struct hwrm_udcc_session_cfg_output {
92925 	/* The specific error status for the command. */
92926 	uint16_t	error_code;
92927 	/* The HWRM command request type. */
92928 	uint16_t	req_type;
92929 	/* The sequence ID from the original command. */
92930 	uint16_t	seq_id;
92931 	/* The length of the response data in number of bytes. */
92932 	uint16_t	resp_len;
92933 	uint8_t	unused_1[7];
92934 	/*
92935 	 * This field is used in Output records to indicate that the output
92936 	 * is completely written to RAM. This field should be read as '1'
92937 	 * to indicate that the output has been completely written. When
92938 	 * writing a command completion or response to an internal processor,
92939 	 * the order of writes has to be such that this field is written last.
92940 	 */
92941 	uint8_t	valid;
92942 } hwrm_udcc_session_cfg_output_t, *phwrm_udcc_session_cfg_output_t;
92943 
92944 /**************************
92945  * hwrm_udcc_session_qcfg *
92946  **************************/
92947 
92948 
92949 /* hwrm_udcc_session_qcfg_input (size:192b/24B) */
92950 
92951 typedef struct hwrm_udcc_session_qcfg_input {
92952 	/* The HWRM command request type. */
92953 	uint16_t	req_type;
92954 	/*
92955 	 * The completion ring to send the completion event on. This should
92956 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
92957 	 */
92958 	uint16_t	cmpl_ring;
92959 	/*
92960 	 * The sequence ID is used by the driver for tracking multiple
92961 	 * commands. This ID is treated as opaque data by the firmware and
92962 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
92963 	 */
92964 	uint16_t	seq_id;
92965 	/*
92966 	 * The target ID of the command:
92967 	 * * 0x0-0xFFF8 - The function ID
92968 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
92969 	 * * 0xFFFD - Reserved for user-space HWRM interface
92970 	 * * 0xFFFF - HWRM
92971 	 */
92972 	uint16_t	target_id;
92973 	/*
92974 	 * A physical address pointer pointing to a host buffer that the
92975 	 * command's response data will be written. This can be either a host
92976 	 * physical address (HPA) or a guest physical address (GPA) and must
92977 	 * point to a physically contiguous block of memory.
92978 	 */
92979 	uint64_t	resp_addr;
92980 	/* A handle for the session to be queried, if previously allocated. */
92981 	uint16_t	session_id;
92982 	uint8_t	unused_0[6];
92983 } hwrm_udcc_session_qcfg_input_t, *phwrm_udcc_session_qcfg_input_t;
92984 
92985 /* hwrm_udcc_session_qcfg_output (size:512b/64B) */
92986 
92987 typedef struct hwrm_udcc_session_qcfg_output {
92988 	/* The specific error status for the command. */
92989 	uint16_t	error_code;
92990 	/* The HWRM command request type. */
92991 	uint16_t	req_type;
92992 	/* The sequence ID from the original command. */
92993 	uint16_t	seq_id;
92994 	/* The length of the response data in number of bytes. */
92995 	uint16_t	resp_len;
92996 	/* session_state specifying configuration of the session. */
92997 	uint8_t	session_state;
92998 	/*
92999 	 * This bit is set if the session is enabled and firmware is
93000 	 * querying it for events. The bit is cleared if no querying
93001 	 * should occur for this session.
93002 	 */
93003 	#define HWRM_UDCC_SESSION_QCFG_OUTPUT_SESSION_STATE_ENABLED		UINT32_C(0x1)
93004 	/* UDCC flow is not created in driver. */
93005 	#define HWRM_UDCC_SESSION_QCFG_OUTPUT_SESSION_STATE_FLOW_NOT_CREATED	UINT32_C(0x2)
93006 	/* UDCC flow is now deleted in driver. */
93007 	#define HWRM_UDCC_SESSION_QCFG_OUTPUT_SESSION_STATE_FLOW_HAS_BEEN_DELETED	UINT32_C(0x4)
93008 	uint8_t	unused_0;
93009 	/* destination mac address used for the session. */
93010 	uint8_t	dest_mac[6];
93011 	/*
93012 	 * a 4 byte or 16 byte IP address, depending on whether the ip_type
93013 	 * specifies IPv4 or IPv6. For IPv4 addresses, the first 4 bytes of the
93014 	 * 16 byte field are used; the remaining 12 bytes are not used.
93015 	 */
93016 	uint32_t	dest_ip[4];
93017 	uint8_t	unused_1[2];
93018 	/* source mac address used for the session. */
93019 	uint8_t	src_mac[6];
93020 	/* source QP number used for the session. */
93021 	uint32_t	src_qp_num;
93022 	/* destination QP number used for the session. */
93023 	uint32_t	dest_qp_num;
93024 	/*
93025 	 * address for the tx flow statistics record to be sampled by the
93026 	 * UDCC firmware.
93027 	 */
93028 	uint32_t	tx_stats_record;
93029 	/*
93030 	 * address for the rx flow statistics record to be sampled by the
93031 	 * UDCC firmware.
93032 	 */
93033 	uint32_t	rx_stats_record;
93034 	uint8_t	unused_2[7];
93035 	/*
93036 	 * This field is used in Output records to indicate that the output
93037 	 * is completely written to RAM. This field should be read as '1'
93038 	 * to indicate that the output has been completely written. When
93039 	 * writing a command completion or response to an internal processor,
93040 	 * the order of writes has to be such that this field is written last.
93041 	 */
93042 	uint8_t	valid;
93043 } hwrm_udcc_session_qcfg_output_t, *phwrm_udcc_session_qcfg_output_t;
93044 
93045 /***************************
93046  * hwrm_udcc_session_query *
93047  ***************************/
93048 
93049 
93050 /* hwrm_udcc_session_query_input (size:192b/24B) */
93051 
93052 typedef struct hwrm_udcc_session_query_input {
93053 	/* The HWRM command request type. */
93054 	uint16_t	req_type;
93055 	/*
93056 	 * The completion ring to send the completion event on. This should
93057 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
93058 	 */
93059 	uint16_t	cmpl_ring;
93060 	/*
93061 	 * The sequence ID is used by the driver for tracking multiple
93062 	 * commands. This ID is treated as opaque data by the firmware and
93063 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
93064 	 */
93065 	uint16_t	seq_id;
93066 	/*
93067 	 * The target ID of the command:
93068 	 * * 0x0-0xFFF8 - The function ID
93069 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
93070 	 * * 0xFFFD - Reserved for user-space HWRM interface
93071 	 * * 0xFFFF - HWRM
93072 	 */
93073 	uint16_t	target_id;
93074 	/*
93075 	 * A physical address pointer pointing to a host buffer that the
93076 	 * command's response data will be written. This can be either a host
93077 	 * physical address (HPA) or a guest physical address (GPA) and must
93078 	 * point to a physically contiguous block of memory.
93079 	 */
93080 	uint64_t	resp_addr;
93081 	/* A handle for the session to be queried, if previously allocated. */
93082 	uint16_t	session_id;
93083 	uint8_t	unused_0[6];
93084 } hwrm_udcc_session_query_input_t, *phwrm_udcc_session_query_input_t;
93085 
93086 /* hwrm_udcc_session_query_output (size:640b/80B) */
93087 
93088 typedef struct hwrm_udcc_session_query_output {
93089 	/* The specific error status for the command. */
93090 	uint16_t	error_code;
93091 	/* The HWRM command request type. */
93092 	uint16_t	req_type;
93093 	/* The sequence ID from the original command. */
93094 	uint16_t	seq_id;
93095 	/* The length of the response data in number of bytes. */
93096 	uint16_t	resp_len;
93097 	/* field for the minimum RTT value (in ns) for the session. */
93098 	uint32_t	min_rtt_ns;
93099 	/* field for the maximum RTT value (in ns) for the session. */
93100 	uint32_t	max_rtt_ns;
93101 	/*
93102 	 * field for the current configured rate (in Mbps) for the
93103 	 * session.
93104 	 */
93105 	uint32_t	cur_rate_mbps;
93106 	/*
93107 	 * count for the number of events sent from FW to the UDCC
93108 	 * program.
93109 	 */
93110 	uint32_t	tx_event_count;
93111 	/*
93112 	 * count for the number of CNP events sent from FW to the UDCC
93113 	 * program.
93114 	 */
93115 	uint32_t	cnp_rx_event_count;
93116 	/*
93117 	 * count for the number of RTT request events received by the FW from
93118 	 * the UDCC program.
93119 	 */
93120 	uint32_t	rtt_req_count;
93121 	/*
93122 	 * count for the number of RTT response events sent by the FW to the
93123 	 * UDCC program.
93124 	 */
93125 	uint32_t	rtt_resp_count;
93126 	/* count for the number of bytes transmitted for the session. */
93127 	uint32_t	tx_bytes_count;
93128 	/* count for the number of packets transmitted for the session. */
93129 	uint32_t	tx_packets_count;
93130 	/* count of initiator probes transmitted for the session. */
93131 	uint32_t	init_probes_sent;
93132 	/* count of terminator probes received for the session. */
93133 	uint32_t	term_probes_recv;
93134 	/* count of CNP packets received for the session. */
93135 	uint32_t	cnp_packets_recv;
93136 	/* count of retransmission timeout events received for the session. */
93137 	uint32_t	rto_event_recv;
93138 	/* count of sequence error NAK events received for the session. */
93139 	uint32_t	seq_err_nak_recv;
93140 	/* the current number of qps associated with the session. */
93141 	uint32_t	qp_count;
93142 	/* count for the number of Tx events detected for the session. */
93143 	uint32_t	tx_event_detect_count;
93144 	uint8_t	unused_1[7];
93145 	/*
93146 	 * This field is used in Output records to indicate that the output
93147 	 * is completely written to RAM. This field should be read as '1'
93148 	 * to indicate that the output has been completely written. When
93149 	 * writing a command completion or response to an internal processor,
93150 	 * the order of writes has to be such that this field is written last.
93151 	 */
93152 	uint8_t	valid;
93153 } hwrm_udcc_session_query_output_t, *phwrm_udcc_session_query_output_t;
93154 
93155 /**********************
93156  * hwrm_udcc_comp_cfg *
93157  **********************/
93158 
93159 
93160 /* hwrm_udcc_comp_cfg_input (size:576b/72B) */
93161 
93162 typedef struct hwrm_udcc_comp_cfg_input {
93163 	/* The HWRM command request type. */
93164 	uint16_t	req_type;
93165 	/*
93166 	 * The completion ring to send the completion event on. This should
93167 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
93168 	 */
93169 	uint16_t	cmpl_ring;
93170 	/*
93171 	 * The sequence ID is used by the driver for tracking multiple
93172 	 * commands. This ID is treated as opaque data by the firmware and
93173 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
93174 	 */
93175 	uint16_t	seq_id;
93176 	/*
93177 	 * The target ID of the command:
93178 	 * * 0x0-0xFFF8 - The function ID
93179 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
93180 	 * * 0xFFFD - Reserved for user-space HWRM interface
93181 	 * * 0xFFFF - HWRM
93182 	 */
93183 	uint16_t	target_id;
93184 	/*
93185 	 * A physical address pointer pointing to a host buffer that the
93186 	 * command's response data will be written. This can be either a host
93187 	 * physical address (HPA) or a guest physical address (GPA) and must
93188 	 * point to a physically contiguous block of memory.
93189 	 */
93190 	uint64_t	resp_addr;
93191 	/*
93192 	 * This field holds the configuration arguments, which can be used
93193 	 * to specify the context of the configuration data, e.g. type,
93194 	 * session ID, etc. It is possible not all arg_buf are utilized.
93195 	 * The format and meaning of the arguments are internal to
93196 	 * the UDCC program.
93197 	 */
93198 	uint8_t	arg_buf[40];
93199 	/*
93200 	 * This field specifies the number of bytes in arg_buf that are
93201 	 * configuration arguments. It can be zero if there are no arguments.
93202 	 */
93203 	uint32_t	arg_len;
93204 	/*
93205 	 * This field specifies the length of the configuration data
93206 	 * stored in the host memory. The host driver shall guarantee
93207 	 * this number is not greater than the maximum configuration
93208 	 * transfer size that is specified by the max_comp_cfg_xfer
93209 	 * field of hwrm_udcc_qcaps_output.
93210 	 */
93211 	uint32_t	cfg_len;
93212 	/*
93213 	 * This field specifies the address of the host memory where
93214 	 * the configuration data is stored. The format and meaning of
93215 	 * the configuration data are internal to the UDCC program.
93216 	 */
93217 	uint64_t	cfg_host_addr;
93218 } hwrm_udcc_comp_cfg_input_t, *phwrm_udcc_comp_cfg_input_t;
93219 
93220 /* hwrm_udcc_comp_cfg_output (size:128b/16B) */
93221 
93222 typedef struct hwrm_udcc_comp_cfg_output {
93223 	/* The specific error status for the command. */
93224 	uint16_t	error_code;
93225 	/* The HWRM command request type. */
93226 	uint16_t	req_type;
93227 	/* The sequence ID from the original command. */
93228 	uint16_t	seq_id;
93229 	/* The length of the response data in number of bytes. */
93230 	uint16_t	resp_len;
93231 	uint8_t	unused_0[7];
93232 	/*
93233 	 * This field is used in Output records to indicate that the output
93234 	 * is completely written to RAM. This field should be read as '1'
93235 	 * to indicate that the output has been completely written. When
93236 	 * writing a command completion or response to an internal processor,
93237 	 * the order of writes has to be such that this field is written last.
93238 	 */
93239 	uint8_t	valid;
93240 } hwrm_udcc_comp_cfg_output_t, *phwrm_udcc_comp_cfg_output_t;
93241 
93242 /***********************
93243  * hwrm_udcc_comp_qcfg *
93244  ***********************/
93245 
93246 
93247 /* hwrm_udcc_comp_qcfg_input (size:576b/72B) */
93248 
93249 typedef struct hwrm_udcc_comp_qcfg_input {
93250 	/* The HWRM command request type. */
93251 	uint16_t	req_type;
93252 	/*
93253 	 * The completion ring to send the completion event on. This should
93254 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
93255 	 */
93256 	uint16_t	cmpl_ring;
93257 	/*
93258 	 * The sequence ID is used by the driver for tracking multiple
93259 	 * commands. This ID is treated as opaque data by the firmware and
93260 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
93261 	 */
93262 	uint16_t	seq_id;
93263 	/*
93264 	 * The target ID of the command:
93265 	 * * 0x0-0xFFF8 - The function ID
93266 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
93267 	 * * 0xFFFD - Reserved for user-space HWRM interface
93268 	 * * 0xFFFF - HWRM
93269 	 */
93270 	uint16_t	target_id;
93271 	/*
93272 	 * A physical address pointer pointing to a host buffer that the
93273 	 * command's response data will be written. This can be either a host
93274 	 * physical address (HPA) or a guest physical address (GPA) and must
93275 	 * point to a physically contiguous block of memory.
93276 	 */
93277 	uint64_t	resp_addr;
93278 	/*
93279 	 * This field holds the query arguments, which can be used to
93280 	 * specify the context of the query, e.g. type, session ID, etc.
93281 	 * It is possible not all arg_buf are utilized.
93282 	 * The format and meaning of the arguments are internal to
93283 	 * the UDCC program.
93284 	 */
93285 	uint8_t	arg_buf[40];
93286 	/*
93287 	 * This field specifies the number of bytes in arg_buf that are
93288 	 * query arguments. It can be zero if there are no arguments.
93289 	 */
93290 	uint32_t	arg_len;
93291 	/*
93292 	 * This field specifies the size of the buffer in the host memory
93293 	 * for receiving the configuration data. The host driver shall
93294 	 * guarantee the size of the buffer is not smaller than
93295 	 * the maximum configuration transfer size that is specified by
93296 	 * the max_comp_cfg_xfer field of hwrm_udcc_qcaps_output.
93297 	 */
93298 	uint32_t	cfg_host_buf_size;
93299 	/*
93300 	 * This field specifies the address of the host memory where
93301 	 * the queried configuration to be stored.
93302 	 */
93303 	uint64_t	cfg_host_addr;
93304 } hwrm_udcc_comp_qcfg_input_t, *phwrm_udcc_comp_qcfg_input_t;
93305 
93306 /* hwrm_udcc_comp_qcfg_output (size:128b/16B) */
93307 
93308 typedef struct hwrm_udcc_comp_qcfg_output {
93309 	/* The specific error status for the command. */
93310 	uint16_t	error_code;
93311 	/* The HWRM command request type. */
93312 	uint16_t	req_type;
93313 	/* The sequence ID from the original command. */
93314 	uint16_t	seq_id;
93315 	/* The length of the response data in number of bytes. */
93316 	uint16_t	resp_len;
93317 	/*
93318 	 * This field specifies the length of configuration data transferred
93319 	 * into the host memory. The amount of data transferred is up to
93320 	 * the maximum configuration transfer size that is specified by
93321 	 * the max_comp_cfg_xfer field of hwrm_udcc_qcaps_output.
93322 	 */
93323 	uint32_t	cfg_len;
93324 	uint8_t	unused_0[3];
93325 	/*
93326 	 * This field is used in Output records to indicate that the output
93327 	 * is completely written to RAM. This field should be read as '1'
93328 	 * to indicate that the output has been completely written. When
93329 	 * writing a command completion or response to an internal processor,
93330 	 * the order of writes has to be such that this field is written last.
93331 	 */
93332 	uint8_t	valid;
93333 } hwrm_udcc_comp_qcfg_output_t, *phwrm_udcc_comp_qcfg_output_t;
93334 
93335 /************************
93336  * hwrm_udcc_comp_query *
93337  ************************/
93338 
93339 
93340 /* hwrm_udcc_comp_query_input (size:576b/72B) */
93341 
93342 typedef struct hwrm_udcc_comp_query_input {
93343 	/* The HWRM command request type. */
93344 	uint16_t	req_type;
93345 	/*
93346 	 * The completion ring to send the completion event on. This should
93347 	 * be the NQ ID returned from the `nq_alloc` HWRM command.
93348 	 */
93349 	uint16_t	cmpl_ring;
93350 	/*
93351 	 * The sequence ID is used by the driver for tracking multiple
93352 	 * commands. This ID is treated as opaque data by the firmware and
93353 	 * the value is returned in the `hwrm_resp_hdr` upon completion.
93354 	 */
93355 	uint16_t	seq_id;
93356 	/*
93357 	 * The target ID of the command:
93358 	 * * 0x0-0xFFF8 - The function ID
93359 	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
93360 	 * * 0xFFFD - Reserved for user-space HWRM interface
93361 	 * * 0xFFFF - HWRM
93362 	 */
93363 	uint16_t	target_id;
93364 	/*
93365 	 * A physical address pointer pointing to a host buffer that the
93366 	 * command's response data will be written. This can be either a host
93367 	 * physical address (HPA) or a guest physical address (GPA) and must
93368 	 * point to a physically contiguous block of memory.
93369 	 */
93370 	uint64_t	resp_addr;
93371 	/*
93372 	 * This field holds the query arguments, which can be used to
93373 	 * specify the context of the query, e.g. type, session ID, etc.
93374 	 * It is possible not all arg_buf are utilized.
93375 	 * The format and meaning of the arguments are internal to
93376 	 * the UDCC program.
93377 	 */
93378 	uint8_t	arg_buf[40];
93379 	/*
93380 	 * This field specifies the number of bytes in arg_buf that are
93381 	 * query arguments. It can be zero if there are no arguments.
93382 	 */
93383 	uint32_t	arg_len;
93384 	/*
93385 	 * This field specifies the size of the buffer in the host memory
93386 	 * for receiving the status or statistics data. The host driver
93387 	 * shall guarantee the size of the buffer is not smaller than
93388 	 * the maximum data transfer size that is specified by
93389 	 * the max_comp_data_xfer field of hwrm_udcc_qcaps_output.
93390 	 */
93391 	uint32_t	data_host_buf_size;
93392 	/*
93393 	 * This field specifies the address of the host memory where
93394 	 * the queried data to be stored.
93395 	 */
93396 	uint64_t	data_host_addr;
93397 } hwrm_udcc_comp_query_input_t, *phwrm_udcc_comp_query_input_t;
93398 
93399 /* hwrm_udcc_comp_query_output (size:128b/16B) */
93400 
93401 typedef struct hwrm_udcc_comp_query_output {
93402 	/* The specific error status for the command. */
93403 	uint16_t	error_code;
93404 	/* The HWRM command request type. */
93405 	uint16_t	req_type;
93406 	/* The sequence ID from the original command. */
93407 	uint16_t	seq_id;
93408 	/* The length of the response data in number of bytes. */
93409 	uint16_t	resp_len;
93410 	/*
93411 	 * This field specifies the length of status or statistics data
93412 	 * transferred into the host memory. The amount of data transferred
93413 	 * is up to the maximum data transfer size that is specified by
93414 	 * the max_comp_data_xfer field of hwrm_udcc_qcaps_output.
93415 	 */
93416 	uint32_t	data_len;
93417 	uint8_t	unused_0[3];
93418 	/*
93419 	 * This field is used in Output records to indicate that the output
93420 	 * is completely written to RAM. This field should be read as '1'
93421 	 * to indicate that the output has been completely written. When
93422 	 * writing a command completion or response to an internal processor,
93423 	 * the order of writes has to be such that this field is written last.
93424 	 */
93425 	uint8_t	valid;
93426 } hwrm_udcc_comp_query_output_t, *phwrm_udcc_comp_query_output_t;
93427 
93428 #endif /* _HSI_STRUCT_DEF_H_ */
93429